{"version":3,"file":"js/application-ea5f12ac9a6c0050b89b.js","sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/controllers sync _controller\\.js$","webpack:///./app/javascript/controllers/act-description_controller.js","webpack:///./app/javascript/controllers/activities_controller.js","webpack:///./app/javascript/controllers/activity-analytics-filter_controller.js","webpack:///./app/javascript/controllers/activity-detail_controller.js","webpack:///./app/javascript/controllers/activity-list_controller.js","webpack:///./app/javascript/controllers/additional-accordion_controller.js","webpack:///./app/javascript/controllers/additional-information_controller.js","webpack:///./app/javascript/controllers/admins-and-tags_controller.js","webpack:///./app/javascript/controllers/attachments_controller.js","webpack:///./app/javascript/controllers/bulk-delete-user_controller.js","webpack:///./app/javascript/controllers/change-project-status_controller.js","webpack:///./app/javascript/controllers/change-proposal-status_controller.js","webpack:///./app/javascript/controllers/change-role_controller.js","webpack:///./app/javascript/controllers/comment_controller.js","webpack:///./app/javascript/controllers/congratulation_controller.js","webpack:///./app/javascript/controllers/conversation-chart_controller.js","webpack:///./app/javascript/controllers/conversation-list_controller.js","webpack:///./app/javascript/controllers/conversation_controller.js","webpack:///./app/javascript/controllers/copy-button_controller.js","webpack:///./app/javascript/controllers/countdown-timer_controller.js","webpack:///./app/javascript/controllers/cropper_controller.js","webpack:///./app/javascript/controllers/dashboard-filter_controller.js","webpack:///./app/javascript/controllers/dashboard-report_controller.js","webpack:///./app/javascript/controllers/delete-project_controller.js","webpack:///./app/javascript/controllers/demography_controller.js","webpack:///./app/javascript/controllers/divisive-chart_controller.js","webpack:///./app/javascript/controllers/dropdown_controller.js","webpack:///./app/javascript/controllers/end-date-time-picker_controller.js","webpack:///./app/javascript/controllers/form-validation_controller.js","webpack:///./app/javascript/controllers/generate-report_controller.js","webpack:///./app/javascript/controllers/home-carousel_controller.js","webpack:///./app/javascript/controllers/index.js","webpack:///./app/javascript/controllers/max-title-input_controller.js","webpack:///./app/javascript/controllers/mobile-activity-detail_controller.js","webpack:///./app/javascript/controllers/modal-overlay_controller.js","webpack:///./app/javascript/controllers/navbar-active_controller.js","webpack:///./app/javascript/controllers/navigation_controller.js","webpack:///./app/javascript/controllers/official-update_controller.js","webpack:///./app/javascript/controllers/opinion-chart_controller.js","webpack:///./app/javascript/controllers/overall-filter_controller.js","webpack:///./app/javascript/controllers/overall-graph_controller.js","webpack:///./app/javascript/controllers/participant-chart_controller.js","webpack:///./app/javascript/controllers/pca-chart-filter_controller.js","webpack:///./app/javascript/controllers/perspective-mobile_controller.js","webpack:///./app/javascript/controllers/perspective_controller.js","webpack:///./app/javascript/controllers/poll-accordion_controller.js","webpack:///./app/javascript/controllers/poll-carousel_controller.js","webpack:///./app/javascript/controllers/poll-chart_controller.js","webpack:///./app/javascript/controllers/poll-normal-carousel_controller.js","webpack:///./app/javascript/controllers/poll_controller.js","webpack:///./app/javascript/controllers/profile-cropper_controller.js","webpack:///./app/javascript/controllers/project-chart_controller.js","webpack:///./app/javascript/controllers/project-config_controller.js","webpack:///./app/javascript/controllers/project-description_controller.js","webpack:///./app/javascript/controllers/project-list_controller.js","webpack:///./app/javascript/controllers/proposal-comment_controller.js","webpack:///./app/javascript/controllers/proposal-description_controller.js","webpack:///./app/javascript/controllers/proposal-detail_controller.js","webpack:///./app/javascript/controllers/proposal-filter_controller.js","webpack:///./app/javascript/controllers/proposal-preview_controller.js","webpack:///./app/javascript/controllers/proposal-tags_controller.js","webpack:///./app/javascript/controllers/radio-chip_controller.js","webpack:///./app/javascript/controllers/redirector_controller.js","webpack:///./app/javascript/controllers/reset-form_controller.js","webpack:///./app/javascript/controllers/search-dropdown_controller.js","webpack:///./app/javascript/controllers/sign-out_controller.js","webpack:///./app/javascript/controllers/snackbar_controller.js","webpack:///./app/javascript/controllers/sso-modal_controller.js","webpack:///./app/javascript/controllers/start-date-time-picker_controller.js","webpack:///./app/javascript/controllers/stepper_controller.js","webpack:///./app/javascript/controllers/user-list_controller.js","webpack:///./app/javascript/controllers/vote-chart_controller.js","webpack:///./app/javascript/packs/application.js","webpack:///./app/javascript/packs/stylesheets/application.tailwind.scss","webpack:///./app/javascript/services/additional-information_services.js","webpack:///./app/javascript/services/btn-disable-loader_service.js","webpack:///./app/javascript/services/cropper_service.js","webpack:///./app/javascript/services/graph_service.js","webpack:///./app/javascript/services/project-status-menu_service.js","webpack:///./app/javascript/services/questions_service.js","webpack:///./app/javascript/services/screen_service.js","webpack:///./app/javascript/services/snackbar.js","webpack:///./app/javascript/services/tooltip-position_service.js","webpack:///./app/javascript/services/validations_mapper.js","webpack:///./node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js","webpack:///./node_modules/@hotwired/stimulus/dist/stimulus.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/form_submissions.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js","webpack:///./node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js","webpack:///./node_modules/@rails/activestorage/app/assets/javascripts/activestorage.esm.js","webpack:///./node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/buffer/index.js","webpack:///./node_modules/chart.js/auto/auto.esm.js","webpack:///./node_modules/chart.js/dist/chart.esm.js","webpack:///./node_modules/chart.js/dist/chunks/helpers.segment.js","webpack:///./node_modules/chart.js/dist/helpers.esm.js","webpack:///./node_modules/chart.js/helpers/helpers.esm.js","webpack:///./node_modules/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js","webpack:///./node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js","webpack:///./node_modules/cropperjs/dist/cropper.js","webpack:///./node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","webpack:///./node_modules/date-fns/esm/_lib/assign/index.js","webpack:///./node_modules/date-fns/esm/_lib/cloneObject/index.js","webpack:///./node_modules/date-fns/esm/_lib/defaultLocale/index.js","webpack:///./node_modules/date-fns/esm/_lib/defaultOptions/index.js","webpack:///./node_modules/date-fns/esm/_lib/format/formatters/index.js","webpack:///./node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","webpack:///./node_modules/date-fns/esm/_lib/format/longFormatters/index.js","webpack:///./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/isSameUTCWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/protectedTokens/index.js","webpack:///./node_modules/date-fns/esm/_lib/requiredArgs/index.js","webpack:///./node_modules/date-fns/esm/_lib/roundingMethods/index.js","webpack:///./node_modules/date-fns/esm/_lib/setUTCDay/index.js","webpack:///./node_modules/date-fns/esm/_lib/setUTCISODay/index.js","webpack:///./node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/setUTCWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/toInteger/index.js","webpack:///./node_modules/date-fns/esm/add/index.js","webpack:///./node_modules/date-fns/esm/addBusinessDays/index.js","webpack:///./node_modules/date-fns/esm/addDays/index.js","webpack:///./node_modules/date-fns/esm/addHours/index.js","webpack:///./node_modules/date-fns/esm/addISOWeekYears/index.js","webpack:///./node_modules/date-fns/esm/addMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/addMinutes/index.js","webpack:///./node_modules/date-fns/esm/addMonths/index.js","webpack:///./node_modules/date-fns/esm/addQuarters/index.js","webpack:///./node_modules/date-fns/esm/addSeconds/index.js","webpack:///./node_modules/date-fns/esm/addWeeks/index.js","webpack:///./node_modules/date-fns/esm/addYears/index.js","webpack:///./node_modules/date-fns/esm/areIntervalsOverlapping/index.js","webpack:///./node_modules/date-fns/esm/clamp/index.js","webpack:///./node_modules/date-fns/esm/closestIndexTo/index.js","webpack:///./node_modules/date-fns/esm/closestTo/index.js","webpack:///./node_modules/date-fns/esm/compareAsc/index.js","webpack:///./node_modules/date-fns/esm/compareDesc/index.js","webpack:///./node_modules/date-fns/esm/constants/index.js","webpack:///./node_modules/date-fns/esm/daysToWeeks/index.js","webpack:///./node_modules/date-fns/esm/differenceInBusinessDays/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarDays/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarISOWeekYears/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarISOWeeks/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarMonths/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarQuarters/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarWeeks/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarYears/index.js","webpack:///./node_modules/date-fns/esm/differenceInDays/index.js","webpack:///./node_modules/date-fns/esm/differenceInHours/index.js","webpack:///./node_modules/date-fns/esm/differenceInISOWeekYears/index.js","webpack:///./node_modules/date-fns/esm/differenceInMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/differenceInMinutes/index.js","webpack:///./node_modules/date-fns/esm/differenceInMonths/index.js","webpack:///./node_modules/date-fns/esm/differenceInQuarters/index.js","webpack:///./node_modules/date-fns/esm/differenceInSeconds/index.js","webpack:///./node_modules/date-fns/esm/differenceInWeeks/index.js","webpack:///./node_modules/date-fns/esm/differenceInYears/index.js","webpack:///./node_modules/date-fns/esm/eachDayOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachHourOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachMinuteOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachMonthOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachQuarterOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachWeekOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachWeekendOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachWeekendOfMonth/index.js","webpack:///./node_modules/date-fns/esm/eachWeekendOfYear/index.js","webpack:///./node_modules/date-fns/esm/eachYearOfInterval/index.js","webpack:///./node_modules/date-fns/esm/endOfDay/index.js","webpack:///./node_modules/date-fns/esm/endOfDecade/index.js","webpack:///./node_modules/date-fns/esm/endOfHour/index.js","webpack:///./node_modules/date-fns/esm/endOfISOWeek/index.js","webpack:///./node_modules/date-fns/esm/endOfISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/endOfMinute/index.js","webpack:///./node_modules/date-fns/esm/endOfMonth/index.js","webpack:///./node_modules/date-fns/esm/endOfQuarter/index.js","webpack:///./node_modules/date-fns/esm/endOfSecond/index.js","webpack:///./node_modules/date-fns/esm/endOfToday/index.js","webpack:///./node_modules/date-fns/esm/endOfTomorrow/index.js","webpack:///./node_modules/date-fns/esm/endOfWeek/index.js","webpack:///./node_modules/date-fns/esm/endOfYear/index.js","webpack:///./node_modules/date-fns/esm/endOfYesterday/index.js","webpack:///./node_modules/date-fns/esm/format/index.js","webpack:///./node_modules/date-fns/esm/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/formatDistanceStrict/index.js","webpack:///./node_modules/date-fns/esm/formatDistanceToNow/index.js","webpack:///./node_modules/date-fns/esm/formatDistanceToNowStrict/index.js","webpack:///./node_modules/date-fns/esm/formatDuration/index.js","webpack:///./node_modules/date-fns/esm/formatISO/index.js","webpack:///./node_modules/date-fns/esm/formatISO9075/index.js","webpack:///./node_modules/date-fns/esm/formatISODuration/index.js","webpack:///./node_modules/date-fns/esm/formatRFC3339/index.js","webpack:///./node_modules/date-fns/esm/formatRFC7231/index.js","webpack:///./node_modules/date-fns/esm/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/fromUnixTime/index.js","webpack:///./node_modules/date-fns/esm/getDate/index.js","webpack:///./node_modules/date-fns/esm/getDay/index.js","webpack:///./node_modules/date-fns/esm/getDayOfYear/index.js","webpack:///./node_modules/date-fns/esm/getDaysInMonth/index.js","webpack:///./node_modules/date-fns/esm/getDaysInYear/index.js","webpack:///./node_modules/date-fns/esm/getDecade/index.js","webpack:///./node_modules/date-fns/esm/getDefaultOptions/index.js","webpack:///./node_modules/date-fns/esm/getHours/index.js","webpack:///./node_modules/date-fns/esm/getISODay/index.js","webpack:///./node_modules/date-fns/esm/getISOWeek/index.js","webpack:///./node_modules/date-fns/esm/getISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/getISOWeeksInYear/index.js","webpack:///./node_modules/date-fns/esm/getMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/getMinutes/index.js","webpack:///./node_modules/date-fns/esm/getMonth/index.js","webpack:///./node_modules/date-fns/esm/getOverlappingDaysInIntervals/index.js","webpack:///./node_modules/date-fns/esm/getQuarter/index.js","webpack:///./node_modules/date-fns/esm/getSeconds/index.js","webpack:///./node_modules/date-fns/esm/getTime/index.js","webpack:///./node_modules/date-fns/esm/getUnixTime/index.js","webpack:///./node_modules/date-fns/esm/getWeek/index.js","webpack:///./node_modules/date-fns/esm/getWeekOfMonth/index.js","webpack:///./node_modules/date-fns/esm/getWeekYear/index.js","webpack:///./node_modules/date-fns/esm/getWeeksInMonth/index.js","webpack:///./node_modules/date-fns/esm/getYear/index.js","webpack:///./node_modules/date-fns/esm/hoursToMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/hoursToMinutes/index.js","webpack:///./node_modules/date-fns/esm/hoursToSeconds/index.js","webpack:///./node_modules/date-fns/esm/index.js","webpack:///./node_modules/date-fns/esm/intervalToDuration/index.js","webpack:///./node_modules/date-fns/esm/intlFormat/index.js","webpack:///./node_modules/date-fns/esm/intlFormatDistance/index.js","webpack:///./node_modules/date-fns/esm/isAfter/index.js","webpack:///./node_modules/date-fns/esm/isBefore/index.js","webpack:///./node_modules/date-fns/esm/isDate/index.js","webpack:///./node_modules/date-fns/esm/isEqual/index.js","webpack:///./node_modules/date-fns/esm/isExists/index.js","webpack:///./node_modules/date-fns/esm/isFirstDayOfMonth/index.js","webpack:///./node_modules/date-fns/esm/isFriday/index.js","webpack:///./node_modules/date-fns/esm/isFuture/index.js","webpack:///./node_modules/date-fns/esm/isLastDayOfMonth/index.js","webpack:///./node_modules/date-fns/esm/isLeapYear/index.js","webpack:///./node_modules/date-fns/esm/isMatch/index.js","webpack:///./node_modules/date-fns/esm/isMonday/index.js","webpack:///./node_modules/date-fns/esm/isPast/index.js","webpack:///./node_modules/date-fns/esm/isSameDay/index.js","webpack:///./node_modules/date-fns/esm/isSameHour/index.js","webpack:///./node_modules/date-fns/esm/isSameISOWeek/index.js","webpack:///./node_modules/date-fns/esm/isSameISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/isSameMinute/index.js","webpack:///./node_modules/date-fns/esm/isSameMonth/index.js","webpack:///./node_modules/date-fns/esm/isSameQuarter/index.js","webpack:///./node_modules/date-fns/esm/isSameSecond/index.js","webpack:///./node_modules/date-fns/esm/isSameWeek/index.js","webpack:///./node_modules/date-fns/esm/isSameYear/index.js","webpack:///./node_modules/date-fns/esm/isSaturday/index.js","webpack:///./node_modules/date-fns/esm/isSunday/index.js","webpack:///./node_modules/date-fns/esm/isThisHour/index.js","webpack:///./node_modules/date-fns/esm/isThisISOWeek/index.js","webpack:///./node_modules/date-fns/esm/isThisMinute/index.js","webpack:///./node_modules/date-fns/esm/isThisMonth/index.js","webpack:///./node_modules/date-fns/esm/isThisQuarter/index.js","webpack:///./node_modules/date-fns/esm/isThisSecond/index.js","webpack:///./node_modules/date-fns/esm/isThisWeek/index.js","webpack:///./node_modules/date-fns/esm/isThisYear/index.js","webpack:///./node_modules/date-fns/esm/isThursday/index.js","webpack:///./node_modules/date-fns/esm/isToday/index.js","webpack:///./node_modules/date-fns/esm/isTomorrow/index.js","webpack:///./node_modules/date-fns/esm/isTuesday/index.js","webpack:///./node_modules/date-fns/esm/isValid/index.js","webpack:///./node_modules/date-fns/esm/isWednesday/index.js","webpack:///./node_modules/date-fns/esm/isWeekend/index.js","webpack:///./node_modules/date-fns/esm/isWithinInterval/index.js","webpack:///./node_modules/date-fns/esm/isYesterday/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfDecade/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfISOWeek/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfMonth/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfQuarter/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfWeek/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfYear/index.js","webpack:///./node_modules/date-fns/esm/lightFormat/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","webpack:///./node_modules/date-fns/esm/locale/af/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/af/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/af/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/af/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/af/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/af/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-DZ/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-DZ/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-DZ/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-DZ/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-DZ/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-DZ/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-EG/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-EG/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-EG/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-EG/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-EG/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-EG/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-MA/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-MA/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-MA/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-MA/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-MA/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-MA/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-SA/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-SA/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-SA/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-SA/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-SA/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-SA/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-TN/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-TN/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-TN/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-TN/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-TN/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ar-TN/index.js","webpack:///./node_modules/date-fns/esm/locale/ar/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ar/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ar/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ar/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ar/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ar/index.js","webpack:///./node_modules/date-fns/esm/locale/az/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/az/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/az/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/az/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/az/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/az/index.js","webpack:///./node_modules/date-fns/esm/locale/be-tarask/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/be-tarask/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/be-tarask/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/be-tarask/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/be-tarask/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/be-tarask/index.js","webpack:///./node_modules/date-fns/esm/locale/be/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/be/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/be/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/be/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/be/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/be/index.js","webpack:///./node_modules/date-fns/esm/locale/bg/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/bg/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/bg/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/bg/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/bg/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/bg/index.js","webpack:///./node_modules/date-fns/esm/locale/bn/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/bn/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/bn/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/bn/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/bn/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/bn/index.js","webpack:///./node_modules/date-fns/esm/locale/bs/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/bs/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/bs/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/bs/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/bs/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/bs/index.js","webpack:///./node_modules/date-fns/esm/locale/ca/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ca/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ca/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ca/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ca/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ca/index.js","webpack:///./node_modules/date-fns/esm/locale/cs/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/cs/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/cs/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/cs/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/cs/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/cs/index.js","webpack:///./node_modules/date-fns/esm/locale/cy/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/cy/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/cy/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/cy/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/cy/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/cy/index.js","webpack:///./node_modules/date-fns/esm/locale/da/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/da/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/da/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/da/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/da/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/da/index.js","webpack:///./node_modules/date-fns/esm/locale/de-AT/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/de-AT/index.js","webpack:///./node_modules/date-fns/esm/locale/de/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/de/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/de/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/de/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/de/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/de/index.js","webpack:///./node_modules/date-fns/esm/locale/el/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/el/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/el/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/el/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/el/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/el/index.js","webpack:///./node_modules/date-fns/esm/locale/en-AU/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-AU/index.js","webpack:///./node_modules/date-fns/esm/locale/en-CA/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/en-CA/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-CA/index.js","webpack:///./node_modules/date-fns/esm/locale/en-GB/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-GB/index.js","webpack:///./node_modules/date-fns/esm/locale/en-IE/index.js","webpack:///./node_modules/date-fns/esm/locale/en-IN/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-IN/index.js","webpack:///./node_modules/date-fns/esm/locale/en-NZ/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-NZ/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/index.js","webpack:///./node_modules/date-fns/esm/locale/en-ZA/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-ZA/index.js","webpack:///./node_modules/date-fns/esm/locale/eo/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/eo/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/eo/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/eo/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/eo/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/eo/index.js","webpack:///./node_modules/date-fns/esm/locale/es/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/es/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/es/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/es/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/es/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/es/index.js","webpack:///./node_modules/date-fns/esm/locale/et/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/et/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/et/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/et/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/et/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/et/index.js","webpack:///./node_modules/date-fns/esm/locale/eu/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/eu/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/eu/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/eu/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/eu/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/eu/index.js","webpack:///./node_modules/date-fns/esm/locale/fa-IR/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/fa-IR/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/fa-IR/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/fa-IR/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/fa-IR/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/fa-IR/index.js","webpack:///./node_modules/date-fns/esm/locale/fi/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/fi/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/fi/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/fi/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/fi/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/fi/index.js","webpack:///./node_modules/date-fns/esm/locale/fr-CA/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/fr-CA/index.js","webpack:///./node_modules/date-fns/esm/locale/fr-CH/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/fr-CH/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/fr-CH/index.js","webpack:///./node_modules/date-fns/esm/locale/fr/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/fr/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/fr/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/fr/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/fr/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/fr/index.js","webpack:///./node_modules/date-fns/esm/locale/fy/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/fy/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/fy/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/fy/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/fy/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/fy/index.js","webpack:///./node_modules/date-fns/esm/locale/gd/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/gd/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/gd/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/gd/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/gd/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/gd/index.js","webpack:///./node_modules/date-fns/esm/locale/gl/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/gl/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/gl/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/gl/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/gl/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/gl/index.js","webpack:///./node_modules/date-fns/esm/locale/gu/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/gu/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/gu/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/gu/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/gu/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/gu/index.js","webpack:///./node_modules/date-fns/esm/locale/he/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/he/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/he/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/he/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/he/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/he/index.js","webpack:///./node_modules/date-fns/esm/locale/hi/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/hi/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/hi/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/hi/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/hi/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/hi/index.js","webpack:///./node_modules/date-fns/esm/locale/hr/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/hr/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/hr/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/hr/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/hr/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/hr/index.js","webpack:///./node_modules/date-fns/esm/locale/ht/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ht/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ht/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ht/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ht/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ht/index.js","webpack:///./node_modules/date-fns/esm/locale/hu/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/hu/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/hu/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/hu/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/hu/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/hu/index.js","webpack:///./node_modules/date-fns/esm/locale/hy/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/hy/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/hy/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/hy/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/hy/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/hy/index.js","webpack:///./node_modules/date-fns/esm/locale/id/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/id/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/id/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/id/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/id/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/id/index.js","webpack:///./node_modules/date-fns/esm/locale/index.js","webpack:///./node_modules/date-fns/esm/locale/is/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/is/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/is/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/is/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/is/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/is/index.js","webpack:///./node_modules/date-fns/esm/locale/it-CH/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/it-CH/index.js","webpack:///./node_modules/date-fns/esm/locale/it/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/it/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/it/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/it/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/it/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/it/index.js","webpack:///./node_modules/date-fns/esm/locale/ja-Hira/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ja-Hira/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ja-Hira/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ja-Hira/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ja-Hira/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ja-Hira/index.js","webpack:///./node_modules/date-fns/esm/locale/ja/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ja/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ja/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ja/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ja/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ja/index.js","webpack:///./node_modules/date-fns/esm/locale/ka/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ka/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ka/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ka/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ka/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ka/index.js","webpack:///./node_modules/date-fns/esm/locale/kk/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/kk/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/kk/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/kk/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/kk/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/kk/index.js","webpack:///./node_modules/date-fns/esm/locale/km/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/km/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/km/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/km/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/km/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/km/index.js","webpack:///./node_modules/date-fns/esm/locale/kn/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/kn/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/kn/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/kn/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/kn/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/kn/index.js","webpack:///./node_modules/date-fns/esm/locale/ko/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ko/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ko/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ko/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ko/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ko/index.js","webpack:///./node_modules/date-fns/esm/locale/lb/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/lb/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/lb/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/lb/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/lb/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/lb/index.js","webpack:///./node_modules/date-fns/esm/locale/lt/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/lt/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/lt/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/lt/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/lt/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/lt/index.js","webpack:///./node_modules/date-fns/esm/locale/lv/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/lv/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/lv/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/lv/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/lv/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/lv/index.js","webpack:///./node_modules/date-fns/esm/locale/mk/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/mk/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/mk/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/mk/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/mk/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/mk/index.js","webpack:///./node_modules/date-fns/esm/locale/mn/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/mn/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/mn/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/mn/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/mn/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/mn/index.js","webpack:///./node_modules/date-fns/esm/locale/ms/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ms/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ms/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ms/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ms/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ms/index.js","webpack:///./node_modules/date-fns/esm/locale/mt/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/mt/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/mt/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/mt/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/mt/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/mt/index.js","webpack:///./node_modules/date-fns/esm/locale/nb/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/nb/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/nb/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/nb/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/nb/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/nb/index.js","webpack:///./node_modules/date-fns/esm/locale/nl-BE/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/nl-BE/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/nl-BE/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/nl-BE/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/nl-BE/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/nl-BE/index.js","webpack:///./node_modules/date-fns/esm/locale/nl/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/nl/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/nl/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/nl/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/nl/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/nl/index.js","webpack:///./node_modules/date-fns/esm/locale/nn/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/nn/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/nn/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/nn/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/nn/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/nn/index.js","webpack:///./node_modules/date-fns/esm/locale/oc/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/oc/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/oc/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/oc/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/oc/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/oc/index.js","webpack:///./node_modules/date-fns/esm/locale/pl/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/pl/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/pl/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/pl/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/pl/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/pl/index.js","webpack:///./node_modules/date-fns/esm/locale/pt-BR/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/pt-BR/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/pt-BR/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/pt-BR/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/pt-BR/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/pt-BR/index.js","webpack:///./node_modules/date-fns/esm/locale/pt/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/pt/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/pt/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/pt/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/pt/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/pt/index.js","webpack:///./node_modules/date-fns/esm/locale/ro/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ro/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ro/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ro/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ro/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ro/index.js","webpack:///./node_modules/date-fns/esm/locale/ru/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ru/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ru/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ru/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ru/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ru/index.js","webpack:///./node_modules/date-fns/esm/locale/sk/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/sk/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/sk/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/sk/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/sk/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/sk/index.js","webpack:///./node_modules/date-fns/esm/locale/sl/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/sl/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/sl/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/sl/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/sl/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/sl/index.js","webpack:///./node_modules/date-fns/esm/locale/sq/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/sq/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/sq/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/sq/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/sq/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/sq/index.js","webpack:///./node_modules/date-fns/esm/locale/sr-Latn/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/sr-Latn/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/sr-Latn/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/sr-Latn/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/sr-Latn/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/sr-Latn/index.js","webpack:///./node_modules/date-fns/esm/locale/sr/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/sr/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/sr/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/sr/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/sr/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/sr/index.js","webpack:///./node_modules/date-fns/esm/locale/sv/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/sv/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/sv/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/sv/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/sv/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/sv/index.js","webpack:///./node_modules/date-fns/esm/locale/ta/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ta/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ta/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ta/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ta/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ta/index.js","webpack:///./node_modules/date-fns/esm/locale/te/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/te/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/te/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/te/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/te/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/te/index.js","webpack:///./node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/th/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/th/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/th/index.js","webpack:///./node_modules/date-fns/esm/locale/tr/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/tr/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/tr/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/tr/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/tr/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/tr/index.js","webpack:///./node_modules/date-fns/esm/locale/ug/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/ug/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/ug/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/ug/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/ug/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/ug/index.js","webpack:///./node_modules/date-fns/esm/locale/uk/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/uk/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/uk/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/uk/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/uk/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/uk/index.js","webpack:///./node_modules/date-fns/esm/locale/uz-Cyrl/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/uz-Cyrl/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/uz-Cyrl/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/uz-Cyrl/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/uz-Cyrl/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/uz-Cyrl/index.js","webpack:///./node_modules/date-fns/esm/locale/uz/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/uz/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/uz/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/uz/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/uz/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/uz/index.js","webpack:///./node_modules/date-fns/esm/locale/vi/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/vi/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/vi/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/vi/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/vi/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/vi/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-CN/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-CN/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-CN/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-CN/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-CN/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-CN/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-HK/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-HK/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-HK/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-HK/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-HK/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-HK/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-TW/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-TW/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-TW/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-TW/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-TW/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/zh-TW/index.js","webpack:///./node_modules/date-fns/esm/max/index.js","webpack:///./node_modules/date-fns/esm/milliseconds/index.js","webpack:///./node_modules/date-fns/esm/millisecondsToHours/index.js","webpack:///./node_modules/date-fns/esm/millisecondsToMinutes/index.js","webpack:///./node_modules/date-fns/esm/millisecondsToSeconds/index.js","webpack:///./node_modules/date-fns/esm/min/index.js","webpack:///./node_modules/date-fns/esm/minutesToHours/index.js","webpack:///./node_modules/date-fns/esm/minutesToMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/minutesToSeconds/index.js","webpack:///./node_modules/date-fns/esm/monthsToQuarters/index.js","webpack:///./node_modules/date-fns/esm/monthsToYears/index.js","webpack:///./node_modules/date-fns/esm/nextDay/index.js","webpack:///./node_modules/date-fns/esm/nextFriday/index.js","webpack:///./node_modules/date-fns/esm/nextMonday/index.js","webpack:///./node_modules/date-fns/esm/nextSaturday/index.js","webpack:///./node_modules/date-fns/esm/nextSunday/index.js","webpack:///./node_modules/date-fns/esm/nextThursday/index.js","webpack:///./node_modules/date-fns/esm/nextTuesday/index.js","webpack:///./node_modules/date-fns/esm/nextWednesday/index.js","webpack:///./node_modules/date-fns/esm/parse/_lib/Parser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/Setter.js","webpack:///./node_modules/date-fns/esm/parse/_lib/constants.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/index.js","webpack:///./node_modules/date-fns/esm/parse/_lib/utils.js","webpack:///./node_modules/date-fns/esm/parse/index.js","webpack:///./node_modules/date-fns/esm/parseISO/index.js","webpack:///./node_modules/date-fns/esm/parseJSON/index.js","webpack:///./node_modules/date-fns/esm/previousDay/index.js","webpack:///./node_modules/date-fns/esm/previousFriday/index.js","webpack:///./node_modules/date-fns/esm/previousMonday/index.js","webpack:///./node_modules/date-fns/esm/previousSaturday/index.js","webpack:///./node_modules/date-fns/esm/previousSunday/index.js","webpack:///./node_modules/date-fns/esm/previousThursday/index.js","webpack:///./node_modules/date-fns/esm/previousTuesday/index.js","webpack:///./node_modules/date-fns/esm/previousWednesday/index.js","webpack:///./node_modules/date-fns/esm/quartersToMonths/index.js","webpack:///./node_modules/date-fns/esm/quartersToYears/index.js","webpack:///./node_modules/date-fns/esm/roundToNearestMinutes/index.js","webpack:///./node_modules/date-fns/esm/secondsToHours/index.js","webpack:///./node_modules/date-fns/esm/secondsToMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/secondsToMinutes/index.js","webpack:///./node_modules/date-fns/esm/set/index.js","webpack:///./node_modules/date-fns/esm/setDate/index.js","webpack:///./node_modules/date-fns/esm/setDay/index.js","webpack:///./node_modules/date-fns/esm/setDayOfYear/index.js","webpack:///./node_modules/date-fns/esm/setDefaultOptions/index.js","webpack:///./node_modules/date-fns/esm/setHours/index.js","webpack:///./node_modules/date-fns/esm/setISODay/index.js","webpack:///./node_modules/date-fns/esm/setISOWeek/index.js","webpack:///./node_modules/date-fns/esm/setISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/setMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/setMinutes/index.js","webpack:///./node_modules/date-fns/esm/setMonth/index.js","webpack:///./node_modules/date-fns/esm/setQuarter/index.js","webpack:///./node_modules/date-fns/esm/setSeconds/index.js","webpack:///./node_modules/date-fns/esm/setWeek/index.js","webpack:///./node_modules/date-fns/esm/setWeekYear/index.js","webpack:///./node_modules/date-fns/esm/setYear/index.js","webpack:///./node_modules/date-fns/esm/startOfDay/index.js","webpack:///./node_modules/date-fns/esm/startOfDecade/index.js","webpack:///./node_modules/date-fns/esm/startOfHour/index.js","webpack:///./node_modules/date-fns/esm/startOfISOWeek/index.js","webpack:///./node_modules/date-fns/esm/startOfISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/startOfMinute/index.js","webpack:///./node_modules/date-fns/esm/startOfMonth/index.js","webpack:///./node_modules/date-fns/esm/startOfQuarter/index.js","webpack:///./node_modules/date-fns/esm/startOfSecond/index.js","webpack:///./node_modules/date-fns/esm/startOfToday/index.js","webpack:///./node_modules/date-fns/esm/startOfTomorrow/index.js","webpack:///./node_modules/date-fns/esm/startOfWeek/index.js","webpack:///./node_modules/date-fns/esm/startOfWeekYear/index.js","webpack:///./node_modules/date-fns/esm/startOfYear/index.js","webpack:///./node_modules/date-fns/esm/startOfYesterday/index.js","webpack:///./node_modules/date-fns/esm/sub/index.js","webpack:///./node_modules/date-fns/esm/subBusinessDays/index.js","webpack:///./node_modules/date-fns/esm/subDays/index.js","webpack:///./node_modules/date-fns/esm/subHours/index.js","webpack:///./node_modules/date-fns/esm/subISOWeekYears/index.js","webpack:///./node_modules/date-fns/esm/subMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/subMinutes/index.js","webpack:///./node_modules/date-fns/esm/subMonths/index.js","webpack:///./node_modules/date-fns/esm/subQuarters/index.js","webpack:///./node_modules/date-fns/esm/subSeconds/index.js","webpack:///./node_modules/date-fns/esm/subWeeks/index.js","webpack:///./node_modules/date-fns/esm/subYears/index.js","webpack:///./node_modules/date-fns/esm/toDate/index.js","webpack:///./node_modules/date-fns/esm/weeksToDays/index.js","webpack:///./node_modules/date-fns/esm/yearsToMonths/index.js","webpack:///./node_modules/date-fns/esm/yearsToQuarters/index.js","webpack:///./node_modules/dayjs/dayjs.min.js","webpack:///./node_modules/dayjs/plugin/duration.js","webpack:///./node_modules/flatpickr/dist/esm/index.js","webpack:///./node_modules/flatpickr/dist/esm/l10n/default.js","webpack:///./node_modules/flatpickr/dist/esm/types/options.js","webpack:///./node_modules/flatpickr/dist/esm/utils/dates.js","webpack:///./node_modules/flatpickr/dist/esm/utils/dom.js","webpack:///./node_modules/flatpickr/dist/esm/utils/formatting.js","webpack:///./node_modules/flatpickr/dist/esm/utils/index.js","webpack:///./node_modules/flatpickr/dist/esm/utils/polyfills.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/isarray/index.js","webpack:///./node_modules/quill/dist/quill.js","webpack:///./node_modules/stimulus/dist/stimulus.js","webpack:///./node_modules/stimulus/webpack-helpers.js","webpack:///./node_modules/tw-elements/dist/js/index.min.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/module.js"],"sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"application\": 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"js/\" + ({\"vendors~actioncable\":\"vendors~actioncable\"}[chunkId]||chunkId) + \"-\" + {\"vendors~actioncable\":\"6e88051f251e85a64280\"}[chunkId] + \".chunk.js\"\n \t}\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 \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\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 \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/javascript/packs/application.js\");\n","var map = {\n\t\"./act-description_controller.js\": \"./app/javascript/controllers/act-description_controller.js\",\n\t\"./activities_controller.js\": \"./app/javascript/controllers/activities_controller.js\",\n\t\"./activity-analytics-filter_controller.js\": \"./app/javascript/controllers/activity-analytics-filter_controller.js\",\n\t\"./activity-detail_controller.js\": \"./app/javascript/controllers/activity-detail_controller.js\",\n\t\"./activity-list_controller.js\": \"./app/javascript/controllers/activity-list_controller.js\",\n\t\"./additional-accordion_controller.js\": \"./app/javascript/controllers/additional-accordion_controller.js\",\n\t\"./additional-information_controller.js\": \"./app/javascript/controllers/additional-information_controller.js\",\n\t\"./admins-and-tags_controller.js\": \"./app/javascript/controllers/admins-and-tags_controller.js\",\n\t\"./attachments_controller.js\": \"./app/javascript/controllers/attachments_controller.js\",\n\t\"./bulk-delete-user_controller.js\": \"./app/javascript/controllers/bulk-delete-user_controller.js\",\n\t\"./change-project-status_controller.js\": \"./app/javascript/controllers/change-project-status_controller.js\",\n\t\"./change-proposal-status_controller.js\": \"./app/javascript/controllers/change-proposal-status_controller.js\",\n\t\"./change-role_controller.js\": \"./app/javascript/controllers/change-role_controller.js\",\n\t\"./comment_controller.js\": \"./app/javascript/controllers/comment_controller.js\",\n\t\"./congratulation_controller.js\": \"./app/javascript/controllers/congratulation_controller.js\",\n\t\"./conversation-chart_controller.js\": \"./app/javascript/controllers/conversation-chart_controller.js\",\n\t\"./conversation-list_controller.js\": \"./app/javascript/controllers/conversation-list_controller.js\",\n\t\"./conversation_controller.js\": \"./app/javascript/controllers/conversation_controller.js\",\n\t\"./copy-button_controller.js\": \"./app/javascript/controllers/copy-button_controller.js\",\n\t\"./countdown-timer_controller.js\": \"./app/javascript/controllers/countdown-timer_controller.js\",\n\t\"./cropper_controller.js\": \"./app/javascript/controllers/cropper_controller.js\",\n\t\"./dashboard-filter_controller.js\": \"./app/javascript/controllers/dashboard-filter_controller.js\",\n\t\"./dashboard-report_controller.js\": \"./app/javascript/controllers/dashboard-report_controller.js\",\n\t\"./delete-project_controller.js\": \"./app/javascript/controllers/delete-project_controller.js\",\n\t\"./demography_controller.js\": \"./app/javascript/controllers/demography_controller.js\",\n\t\"./divisive-chart_controller.js\": \"./app/javascript/controllers/divisive-chart_controller.js\",\n\t\"./dropdown_controller.js\": \"./app/javascript/controllers/dropdown_controller.js\",\n\t\"./end-date-time-picker_controller.js\": \"./app/javascript/controllers/end-date-time-picker_controller.js\",\n\t\"./form-validation_controller.js\": \"./app/javascript/controllers/form-validation_controller.js\",\n\t\"./generate-report_controller.js\": \"./app/javascript/controllers/generate-report_controller.js\",\n\t\"./home-carousel_controller.js\": \"./app/javascript/controllers/home-carousel_controller.js\",\n\t\"./max-title-input_controller.js\": \"./app/javascript/controllers/max-title-input_controller.js\",\n\t\"./mobile-activity-detail_controller.js\": \"./app/javascript/controllers/mobile-activity-detail_controller.js\",\n\t\"./modal-overlay_controller.js\": \"./app/javascript/controllers/modal-overlay_controller.js\",\n\t\"./navbar-active_controller.js\": \"./app/javascript/controllers/navbar-active_controller.js\",\n\t\"./navigation_controller.js\": \"./app/javascript/controllers/navigation_controller.js\",\n\t\"./official-update_controller.js\": \"./app/javascript/controllers/official-update_controller.js\",\n\t\"./opinion-chart_controller.js\": \"./app/javascript/controllers/opinion-chart_controller.js\",\n\t\"./overall-filter_controller.js\": \"./app/javascript/controllers/overall-filter_controller.js\",\n\t\"./overall-graph_controller.js\": \"./app/javascript/controllers/overall-graph_controller.js\",\n\t\"./participant-chart_controller.js\": \"./app/javascript/controllers/participant-chart_controller.js\",\n\t\"./pca-chart-filter_controller.js\": \"./app/javascript/controllers/pca-chart-filter_controller.js\",\n\t\"./perspective-mobile_controller.js\": \"./app/javascript/controllers/perspective-mobile_controller.js\",\n\t\"./perspective_controller.js\": \"./app/javascript/controllers/perspective_controller.js\",\n\t\"./poll-accordion_controller.js\": \"./app/javascript/controllers/poll-accordion_controller.js\",\n\t\"./poll-carousel_controller.js\": \"./app/javascript/controllers/poll-carousel_controller.js\",\n\t\"./poll-chart_controller.js\": \"./app/javascript/controllers/poll-chart_controller.js\",\n\t\"./poll-normal-carousel_controller.js\": \"./app/javascript/controllers/poll-normal-carousel_controller.js\",\n\t\"./poll_controller.js\": \"./app/javascript/controllers/poll_controller.js\",\n\t\"./profile-cropper_controller.js\": \"./app/javascript/controllers/profile-cropper_controller.js\",\n\t\"./project-chart_controller.js\": \"./app/javascript/controllers/project-chart_controller.js\",\n\t\"./project-config_controller.js\": \"./app/javascript/controllers/project-config_controller.js\",\n\t\"./project-description_controller.js\": \"./app/javascript/controllers/project-description_controller.js\",\n\t\"./project-list_controller.js\": \"./app/javascript/controllers/project-list_controller.js\",\n\t\"./proposal-comment_controller.js\": \"./app/javascript/controllers/proposal-comment_controller.js\",\n\t\"./proposal-description_controller.js\": \"./app/javascript/controllers/proposal-description_controller.js\",\n\t\"./proposal-detail_controller.js\": \"./app/javascript/controllers/proposal-detail_controller.js\",\n\t\"./proposal-filter_controller.js\": \"./app/javascript/controllers/proposal-filter_controller.js\",\n\t\"./proposal-preview_controller.js\": \"./app/javascript/controllers/proposal-preview_controller.js\",\n\t\"./proposal-tags_controller.js\": \"./app/javascript/controllers/proposal-tags_controller.js\",\n\t\"./radio-chip_controller.js\": \"./app/javascript/controllers/radio-chip_controller.js\",\n\t\"./redirector_controller.js\": \"./app/javascript/controllers/redirector_controller.js\",\n\t\"./reset-form_controller.js\": \"./app/javascript/controllers/reset-form_controller.js\",\n\t\"./search-dropdown_controller.js\": \"./app/javascript/controllers/search-dropdown_controller.js\",\n\t\"./sign-out_controller.js\": \"./app/javascript/controllers/sign-out_controller.js\",\n\t\"./snackbar_controller.js\": \"./app/javascript/controllers/snackbar_controller.js\",\n\t\"./sso-modal_controller.js\": \"./app/javascript/controllers/sso-modal_controller.js\",\n\t\"./start-date-time-picker_controller.js\": \"./app/javascript/controllers/start-date-time-picker_controller.js\",\n\t\"./stepper_controller.js\": \"./app/javascript/controllers/stepper_controller.js\",\n\t\"./user-list_controller.js\": \"./app/javascript/controllers/user-list_controller.js\",\n\t\"./vote-chart_controller.js\": \"./app/javascript/controllers/vote-chart_controller.js\"\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 = \"./app/javascript/controllers sync recursive _controller\\\\.js$\";","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n static targets = ['lineClamp', 'linkText', 'linkIcon'];\n lineClamp = this.lineClampTarget;\n linkText = this.linkTextTarget;\n linkIcon = this.linkIconTarget;\n\n connect() {\n }\n\n readMore(evt) {\n let currentText = evt.currentTarget.dataset.id;\n let readMoreText = evt.currentTarget.dataset.readMore;\n let readLessText = evt.currentTarget.dataset.readLess;\n const classLine = evt.currentTarget.dataset.class;\n const classArray = classLine.split(\" \");\n\n if (currentText === 'readmore') {\n classArray.forEach(className => {\n this.lineClamp.classList.remove(className);\n });\n evt.currentTarget.innerHTML = readLessText;\n this.linkIcon.innerHTML = 'expand_less';\n evt.currentTarget.setAttribute('data-id', 'readless');\n } else {\n classArray.forEach(className => {\n this.lineClamp.classList.add(className);\n });\n evt.currentTarget.innerHTML = readMoreText;\n this.linkIcon.innerHTML = 'expand_more';\n evt.currentTarget.setAttribute('data-id', 'readmore');\n }\n\n }\n}","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n secondStep(event) {\n let typeController = this.application.getControllerForElementAndIdentifier(document.getElementById('activity_type_element'), 'radio-chip')\n if (!typeController.state.new) {\n document.getElementById('activity_type_error').removeAttribute('hidden')\n } else {\n document.getElementById('activity_type_error').setAttribute('hidden', true)\n }\n if (typeController.state) {\n if (typeController.state.old === typeController.state.new) {\n if (document.getElementById(`${typeController.state.new}_content`)) {\n document.getElementById(`${typeController.state.new}_content`).removeAttribute('hidden')\n }\n } else {\n if (document.getElementById(`${typeController.state.new}_content`) || document.getElementById(`${typeController.state.old}_content`)) {\n document.getElementById(`${typeController.state.new}_content`).removeAttribute('hidden')\n document.getElementById(`${typeController.state.old}_content`).setAttribute('hidden', true)\n }\n }\n }\n }\n}","import {Controller} from \"stimulus\";\nimport {overlayLoader, disposeOverlayLoader} from \"../services/screen_service\";\n\nexport default class ActivityAnalyticsFilterController extends Controller {\n static targets = ['filterValue', 'filter']\n filters = {}\n interval = 'month'\n\n connect() {\n this.filters = JSON.parse(this.element.dataset.filters)\n }\n\n applyFilter(event) {\n const activityId = event.currentTarget.dataset.activityId;\n overlayLoader();\n fetch(`/analytics/new_filter?activity_id=${activityId}`, {\n method: \"POST\",\n body: JSON.stringify({filters: this.filters}),\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content,\n 'Content-Type': 'application/json',\n },\n }).then(response => response.text())\n .then(html => {\n disposeOverlayLoader();\n document.body.innerHTML = html;\n })\n }\n\n addFilter(event) {\n const filterCategory = event.currentTarget.dataset.filterCategoryId;\n const filterValueId = event.currentTarget.dataset.filterValueId;\n\n if (event.currentTarget.checked) {\n if (this.filters[filterCategory]) {\n this.filters[filterCategory].push(filterValueId);\n } else {\n this.filters[filterCategory] = [filterValueId];\n }\n } else {\n const valueIndex = this.filters[filterCategory].indexOf(filterValueId);\n this.filters[filterCategory].splice(valueIndex, 1);\n\n if (this.filters[filterCategory].length === 0) {\n delete this.filters[filterCategory];\n }\n }\n }\n\n reset(event) {\n this.filters = {}\n this.applyFilter(event);\n }\n\n setIntervalFilter(event) {\n this.interval = event.currentTarget.dataset.interval\n }\n\n removeFromChip(event) {\n this.addFilter(event);\n this.applyFilter(event);\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n connect() {\n let activityDescriptionText = document.getElementById('activity-description');\n let fullText = activityDescriptionText.textContent;\n let maxDescription = activityDescriptionText.textContent.substr(0, 300) + '...';\n\n const btnShowMore = document.getElementById('btn-show-more');\n const btnShowLess = document.getElementById('btn-show-less');\n const btnWrapper = document.getElementById('btn-wrapper');\n const activityLeft = document.getElementById('activity-left');\n const activityRight = document.getElementById('activity-right');\n const participant = document.getElementById('participant');\n const activityDetail = document.getElementById('activity_detail');\n\n btnWrapper.classList.add('bg-gradient-to-t', 'from-white', 'block', 'h-[120px]');\n fullText.length > 303 ? activityDescriptionText.textContent = maxDescription : activityDescriptionText.textContent = fullText;\n\n btnShowMore.addEventListener('click', function() {\n activityDescriptionText.textContent = fullText;\n activityDescriptionText.classList.contains('hidden') ? activityDescriptionText.classList.remove('hidden') : '';\n participant.classList.contains('hidden') ? participant.classList.remove('hidden') : '';\n activityDetail.classList.contains('hidden') ? activityDetail.classList.remove('hidden') && activityDetail.classList.add('flex'): '';\n activityLeft.classList.add('sm:w-[70%]');\n btnWrapper.classList.remove('bg-gradient-to-t', 'from-white', 'h-[120px]');\n activityRight.classList.remove('hidden');\n btnShowMore.classList.add('hidden');\n btnShowLess.classList.remove('hidden');\n participant.classList.remove('mb-[40px]');\n });\n\n btnShowLess.addEventListener('click', function () {\n activityDescriptionText.classList.contains('hidden') ? '' : activityDescriptionText.classList.add('hidden');\n participant.classList.contains('hidden') ? '' : participant.classList.add('hidden');\n activityDetail.classList.contains('hidden') ? '' : activityDetail.classList.add('hidden');\n btnWrapper.classList.add('bg-gradient-to-t', 'from-white', 'h-[120px]');\n activityLeft.classList.remove('sm:w-[70%]');\n activityRight.classList.add('hidden');\n btnShowMore.classList.remove('hidden');\n btnShowLess.classList.add('hidden');\n participant.classList.add('mb-[40px]');\n fullText.length > 303 ? activityDescriptionText.textContent = maxDescription : activityDescriptionText.textContent = fullText;\n })\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n enterPressed(event) {\n if (event.key === 'Enter') {\n document.getElementById('search_activity').click()\n }\n }\n\n iconPressed(event) {\n document.getElementById('search_activity').click()\n }\n\n tabClicked(event) {\n if (event.currentTarget.ariaSelected === 'true') {\n document.getElementById('form_tab_status').value = event.currentTarget.dataset.status\n document.querySelectorAll('.delete_modal_status').forEach(element => {\n element.value = event.currentTarget.dataset.status\n })\n }\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n static targets = ['accHeader', 'description', 'field']\n\n connect() {\n this.disableDesc(0, 'true');\n this.disableField(0, 'true');\n }\n\n openAcc(event) {\n event.target.innerHTML = event.target.innerHTML === 'expand_more' ? 'expand_less' : 'expand_more';\n let accHeader = event.currentTarget;\n this.disableDesc(accHeader.dataset.additionalDesc, accHeader.ariaExpanded);\n this.disableField(accHeader.dataset.additionalDesc, accHeader.ariaExpanded);\n }\n\n inputOpen(event) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n disableDesc(id, state) {\n document.querySelectorAll('.un-accordion__additional-title').forEach(element => {\n element.style.display = (element.id === 'additional-desc-' + id && state === 'true') ? 'none' : 'block'\n })\n\n }\n\n disableField(id, state) {\n document.querySelectorAll('.un-accordion__additional-field').forEach(element => {\n element.style.display = (element.id === 'additional-field-' + id && state === 'true') ? 'block' : 'none';\n })\n }\n\n}\n","import {Controller} from \"stimulus\";\nimport {additionalOptionHtml, additionalQuestionHtml} from \"../services/additional-information_services\";\n\nexport default class extends Controller {\n stepperController\n\n additionalQuestions = [\n {\n index: 0,\n question: '',\n question_type: 'additional_question',\n options_attributes: [\n {index: 0, option: ''},\n {index: 1, option: ''}\n ]\n }\n ]\n\n connect() {\n this.stepperController = this.application.getControllerForElementAndIdentifier(document.getElementById('activityCreateComp'), 'stepper')\n if (this.element.dataset.questions && this.element.dataset.questions !== '[]') {\n this.additionalQuestions = JSON.parse(this.element.dataset.questions.replaceAll('=>', ':'))\n this.validateAdditionalInputs()\n }\n }\n\n addQuestion(event) {\n if(this.validateAdditionalInputs()) return\n\n let currentIndex = this.additionalQuestions.length > 0 ? this.additionalQuestions[this.additionalQuestions.length - 1].index + 1 : 0\n let elem = document.createElement('div')\n elem.innerHTML = additionalQuestionHtml('additional', 'additional-information', currentIndex)\n document.getElementById('additional-accordion').appendChild(elem.children[0])\n this.additionalQuestions.push(\n {\n index: currentIndex,\n question: '',\n question_type: 'additional_question',\n options_attributes: [\n {index: 0, option: ''},\n {index: 1, option: ''}\n ]\n }\n )\n document.getElementById('additional_questions_json').value = JSON.stringify(this.additionalQuestions)\n this.validateAdditionalInputs()\n }\n\n\n addOption(event) {\n if(this.validateAdditionalInputs()) return\n\n let questionIndex = this.findAdditonalQuestionIndex(+event.currentTarget.dataset.questionId)\n let currentIndex = this.additionalQuestions[questionIndex].options_attributes.length > 0 ? this.additionalQuestions[questionIndex].options_attributes[this.additionalQuestions[questionIndex].options_attributes.length - 1].index + 1 : 0\n let elem = document.createElement('div')\n elem.innerHTML = additionalOptionHtml('additional', 'additional-information', event.currentTarget.dataset.questionId, currentIndex)\n document.getElementById(`additional-poll-options-${event.currentTarget.dataset.questionId}`).appendChild(elem.children[0])\n this.additionalQuestions[questionIndex].options_attributes.push({index: currentIndex, option: ''})\n document.getElementById('additional_questions_json').value = JSON.stringify(this.additionalQuestions)\n\n this.validateAdditionalInputs()\n }\n\n removeOption(event) {\n let questionIndex = this.findAdditonalQuestionIndex(+event.currentTarget.dataset.questionId)\n let optionIndex = this.additionalQuestions[questionIndex].options_attributes.findIndex(option => option.index === +event.currentTarget.dataset.optionId)\n document.getElementById(`additionalOptionDiv${event.currentTarget.dataset.questionId}${event.currentTarget.dataset.optionId}`).remove()\n if (this.additionalQuestions[questionIndex].options_attributes[optionIndex].id) {\n this.additionalQuestions[questionIndex].options_attributes[optionIndex]['_destroy'] = 1\n } else {\n this.additionalQuestions[questionIndex].options_attributes.splice(optionIndex, 1)\n this.validateAdditionalInputs()\n }\n document.getElementById('additional_questions_json').value = JSON.stringify(this.additionalQuestions)\n }\n\n removeQuestion(event) {\n let questionIndex = this.findAdditonalQuestionIndex(+event.currentTarget.dataset.questionId)\n document.getElementById(`additional_question${event.currentTarget.dataset.questionId}`).remove()\n if (this.additionalQuestions[questionIndex].id) {\n this.additionalQuestions[questionIndex]['_destroy'] = 1\n } else {\n this.additionalQuestions.splice(questionIndex, 1)\n this.validateAdditionalInputs()\n }\n document.getElementById('additional_questions_json').value = JSON.stringify(this.additionalQuestions)\n }\n\n inputQuestion(event) {\n let index = this.findAdditonalQuestionIndex(+event.currentTarget.dataset.questionId)\n this.additionalQuestions[index].question = event.currentTarget.value\n document.getElementById('additional_questions_json').value = JSON.stringify(this.additionalQuestions)\n document.getElementById(`additional-desc-${event.currentTarget.dataset.questionId}`).innerText = event.currentTarget.value\n this.validateAdditionalInputs();\n }\n\n inputOption(event) {\n let questionIndex = this.findAdditonalQuestionIndex(+event.currentTarget.dataset.questionId)\n let optionIndex = this.additionalQuestions[questionIndex].options_attributes.findIndex(option => option.index === +event.currentTarget.dataset.optionId)\n this.additionalQuestions[questionIndex].options_attributes[optionIndex].option = event.currentTarget.value\n document.getElementById('additional_questions_json').value = JSON.stringify(this.additionalQuestions)\n this.validateAdditionalInputs()\n }\n\n findAdditonalQuestionIndex(questionId) {\n return this.additionalQuestions.findIndex(question => question.index === questionId)\n }\n\n validateAdditionalInputs() {\n return this.stepperController.validateAdditionalInputs()\n }\n}\n","import {Controller} from 'stimulus';\n\nexport default class extends Controller {\n admins = []\n removed_admins = []\n DEFAULT_PROFILE_PICTURE_LIST = \"https://images.selise.club/799093b06d8c47b367ff9cf7bb825868.jpeg\"\n adminsList = JSON.parse(this.element.dataset.admins)\n tags = []\n\n connect() {\n if (this.element.dataset.existingAdmins) {\n let existingAdmins = JSON.parse(this.element.dataset.existingAdmins)\n if (existingAdmins) {\n this.admins = existingAdmins\n document.getElementById('admin_param').value = JSON.stringify(this.admins)\n existingAdmins.forEach(admin => {\n if (document.getElementById(`admin_list_${admin}`)) {\n this.removed_admins.push({id: admin, dom: document.getElementById(`admin_list_${admin}`)})\n document.getElementById(`admin_list_${admin}`).remove()\n }\n })\n }\n }\n\n if (this.element.dataset.existingTags) {\n let existingTags = JSON.parse(this.element.dataset.existingTags)\n if (existingTags) {\n this.tags = existingTags\n document.getElementById('tag_param').value = JSON.stringify(this.tags)\n existingTags.forEach(tag => {\n document.getElementById(`tag_${tag}`).classList.add('!bg-light-primary/[0.1]')\n document.getElementById(`close_tag_${tag}`).classList.remove('!hidden')\n })\n }\n }\n }\n\n selectAdmin(event) {\n let admin = JSON.parse(event.currentTarget.dataset.admin)\n let selectedDom = `
\n \"profile\"\n\n

${admin.name}

\n admins-and-tags#removeAdmin\">close\n
`\n let element = document.createElement('div')\n element.innerHTML = selectedDom\n document.getElementById('selected_admin_content').appendChild(element.children[0])\n this.removed_admins.push({id: admin.ref_id, dom: event.currentTarget})\n event.currentTarget.remove()\n this.admins.push(admin.ref_id)\n document.getElementById('admin_param').value = JSON.stringify(this.admins)\n }\n\n removeAdmin(event) {\n let id = event.currentTarget.dataset.id\n document.getElementById(`admin_${id}`).remove()\n document.getElementById('admin_list').appendChild(this.removed_admins.find(admin => admin.id === id).dom)\n this.admins = this.admins.filter(admin => admin !== id)\n document.getElementById('admin_param').value = JSON.stringify(this.admins)\n }\n\n searchAdmin(event) {\n let searchValue = event.currentTarget.value;\n let result = []\n let menuDom = document.getElementById('admin_list_menu_control')\n let adminDom = document.getElementById('admin_list_menu')\n this.adminsList.filter((v, i) => {\n let value = v.name\n if (value.toLowerCase().includes(searchValue.toLowerCase())) {\n if (document.getElementById(`admin_list_${v.ref_id}`)) {\n document.getElementById(`admin_list_${v.ref_id}`).style.display = \"block\"\n result.push(v.ref_id)\n }\n } else {\n if (document.getElementById(`admin_list_${v.ref_id}`))\n document.getElementById(`admin_list_${v.ref_id}`).style.display = \"none\"\n }\n })\n if (menuDom) {\n if (result.length < 1) {\n adminDom.classList.contains('show') ? adminDom.classList.remove('show') : null\n menuDom.classList.contains('show') ? menuDom.classList.remove('show') : null\n } else {\n adminDom.classList.contains('show') ? null : adminDom.classList.add('show')\n menuDom.classList.contains('show') ? null : menuDom.classList.add('show')\n }\n }\n }\n\n selectTag(event) {\n if (!this.tags.includes(event.currentTarget.dataset.id)) {\n this.tags.push(event.currentTarget.dataset.id)\n }\n event.currentTarget.classList.add('!bg-light-primary/[0.1]')\n document.getElementById(`close_tag_${event.currentTarget.dataset.id}`).classList.remove('!hidden')\n document.getElementById('tag_param').value = JSON.stringify(this.tags)\n }\n\n removeTag(event) {\n event.preventDefault()\n event.stopImmediatePropagation()\n this.tags = this.tags.filter(tag => tag !== event.currentTarget.dataset.id)\n event.currentTarget.classList.add('!hidden')\n document.getElementById(`tag_${event.currentTarget.dataset.id}`).classList.remove('!bg-light-primary/[0.1]')\n document.getElementById('tag_param').value = JSON.stringify(this.tags)\n }\n}\n","import {Controller} from 'stimulus';\n\nexport default class extends Controller {\n state = {\n attachments: []\n }\n file_count = 0\n\n connect() {\n if (this.element.dataset.attachments) {\n let attachments = JSON.parse(this.element.dataset.attachments.replaceAll('=>', ':'))\n this.file_count = attachments.length\n this.state.attachments = attachments\n document.getElementById('attachments_param').value = JSON.stringify(this.state.attachments)\n if (document.getElementById('phone_attachments_param')) {\n document.getElementById('phone_attachments_param').value = JSON.stringify(this.state.attachments)\n }\n }\n }\n\n cancel(event) {\n let data = event.currentTarget.dataset\n let uuid = data.uuid\n document.querySelectorAll(`#file_${data.index}`).forEach(element => element.remove())\n let attachment_uuids = this.state.attachments\n let index = this.findObjectIndexByKey(attachment_uuids, 'id', +uuid) || this.findObjectIndexByKey(attachment_uuids, 'id', uuid)\n attachment_uuids.splice(index, 1)\n this.state.attachments = attachment_uuids\n document.getElementById('attachments_param').value = JSON.stringify(this.state.attachments)\n if (document.getElementById('phone_attachments_param')) {\n document.getElementById('phone_attachments_param').value = JSON.stringify(this.state.attachments)\n }\n fetch(`/attachments/${uuid}`, {\n method: 'delete',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n })\n }\n\n findObjectIndexByKey(array, key, value) {\n for (let i = 0; i < array.length; i++) {\n if (array[i][key] === value) {\n return i;\n }\n }\n return null;\n }\n\n async upload(event) {\n const files = event.target.files;\n let files_array = Array.from(files)\n new Promise((resolve) => {\n for (let i = 0; i < files_array.length; i++) {\n let params = {\n name: files_array[i].name,\n size: (files_array[i].size / 1024 / 1024).toFixed(2) + ' MB',\n index: this.file_count,\n state: 'creation'\n }\n if (files_array[i].size / 1024 / 1024 > 10) {\n return\n }\n let formData = new FormData();\n formData.append('data', JSON.stringify(params));\n fetch('/attachments/uploader_template', {\n method: 'post',\n body: formData,\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if (response.ok) {\n response.text().then(value => {\n let elementDom = document.createElement('div')\n elementDom.innerHTML = value\n document.getElementById('uploader_content')?.appendChild(elementDom.children[0])\n elementDom.innerHTML = value\n document.getElementById('phone_uploader_content')?.appendChild(elementDom.children[0])\n });\n }\n })\n\n let data = new FormData()\n let current_index = this.file_count\n let file_array = this.state.attachments\n data.append('upload[file]', files_array[i])\n data.append('upload[attachment_type]', 'attachment')\n data.append('upload[file_name]', files_array[i].name)\n data.append('upload[size]', (files_array[i].size / 1024 / 1024).toFixed(2) + ' MB')\n let xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function (e) {\n if (xhr.readyState == 4) {\n if (xhr.status == 200) {\n let response = JSON.parse(xhr.response)\n file_array.push(\n {\n name: files_array[i].name,\n size: (files_array[i].size / (1024 * 1024)).toFixed(2) + ' MB',\n id: response.id,\n index: current_index\n }\n )\n document.getElementById('attachments_param').value = JSON.stringify(file_array)\n if (document.getElementById('phone_attachments_param')) {\n document.getElementById('phone_attachments_param').value = JSON.stringify(file_array)\n }\n document.querySelectorAll(`#cancel_${current_index}`).forEach(elem => {\n elem.dataset.uuid = response.id\n elem.removeAttribute('hidden')\n\n })\n } else {\n document.querySelectorAll(`#error_${current_index}`).forEach(elem => {\n elem.removeAttribute('hidden')\n })\n document.querySelectorAll(`#error_message_${current_index}`).forEach(elem => {\n elem.removeAttribute('hidden')\n elem.innerText = 'Error Uploading File'\n })\n }\n }\n };\n xhr.upload.onprogress = function (e) {\n if (e.lengthComputable) {\n let percentComplete = parseInt((e.loaded / e.total) * 100);\n let chart = document.getElementById('loader_' + current_index);\n if (chart) {\n let percent = String(percentComplete);\n let color = ('color' in chart.dataset) ? chart.dataset.color : \"#2F4F4F\";\n let size = ('size' in chart.dataset) ? chart.dataset.size : \"100\";\n let stroke = ('stroke' in chart.dataset) ? chart.dataset.stroke : \"1\";\n chart.innerHTML = `\n \n \n ${percent}%\n `\n if (+percentComplete === 100) {\n chart.setAttribute('hidden', true)\n }\n }\n }\n }\n xhr.open(\"POST\", '/attachments', true);\n xhr.setRequestHeader('X-CSRF-Token', document.querySelector('meta[name=\"csrf-token\"]').content)\n xhr.send(data);\n this.file_count += 1\n }\n })\n this.state.attachments = this.state.attachments;\n document.getElementById('attachments_param').value = JSON.stringify(this.state.attachments)\n if (document.getElementById('phone_attachments_param')) {\n document.getElementById('phone_attachments_param').value = JSON.stringify(this.state.attachments)\n }\n }\n\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n selectedUsers = []\n originalLink = document.getElementById('bulk-delete-button')?.href\n\n selectAll(event) {\n if (event.currentTarget.checked) {\n this.selectedUsers = []\n document.querySelectorAll('.user_checkbox').forEach(element => {\n element.checked = true\n this.selectedUsers.push(element.dataset.userId)\n document.getElementById('bulk-delete-header').removeAttribute('hidden')\n document.getElementById('bulk-delete-header-text').innerHTML = `${this.selectedUsers.length.toString()} selected`\n })\n } else {\n document.querySelectorAll('.user_checkbox').forEach(element => {\n element.checked = false\n this.selectedUsers = []\n document.getElementById('bulk-delete-header').setAttribute('hidden', 'true')\n document.getElementById('bulk-delete-header-text').innerHTML = ''\n })\n }\n this.modifyLink()\n }\n\n selectUser(event) {\n if (event.currentTarget.checked) {\n this.selectedUsers.push(event.currentTarget.dataset.userId)\n document.getElementById('bulk-delete-header').removeAttribute('hidden')\n document.getElementById('bulk-delete-header-text').innerHTML = `${this.selectedUsers.length.toString()} selected`\n if (this.selectedUsers.length === +this.element.dataset.usersCount) {\n document.getElementById('select_all_users').checked = true\n }\n } else {\n this.selectedUsers = this.selectedUsers.filter(function (value, index, array) {\n return value !== event.currentTarget.dataset.userId\n })\n if (this.selectedUsers.length === 0) {\n document.getElementById('bulk-delete-header').setAttribute('hidden', 'true')\n document.getElementById('bulk-delete-header-text').innerHTML = ''\n } else {\n document.getElementById('bulk-delete-header').removeAttribute('hidden')\n document.getElementById('bulk-delete-header-text').innerHTML = `${this.selectedUsers.length.toString()} selected`\n }\n if (this.selectedUsers.length !== +this.element.dataset.usersCount) {\n document.getElementById('select_all_users').checked = false\n }\n }\n this.modifyLink()\n }\n\n modifyLink() {\n let element = document.getElementById('bulk-delete-button')\n if (element) {\n element.href = `${this.originalLink}?${this.getUserIds()}`\n }\n }\n\n getUserIds() {\n let str = '&user_ids[]='\n let users = this.selectedUsers\n if (users.length === 0) {\n return ''\n }\n for (let i = 0; i < users.length; i++) {\n str += (users.length - 1) === i ? users[i] : `${users[i]}&user_ids[]=`\n }\n return str\n }\n\n deleteUsers(event) {\n let idDom = document.getElementById('delete_user_ids')\n let param = '&user_ids[]='\n if (idDom) {\n let ids = JSON.parse(idDom.dataset.value)\n for (let i = 0; i < ids.length; i++) {\n param += (ids.length - 1) === i ? ids[i] : `${ids[i]}&user_ids[]=`\n }\n }\n fetch('/admin/users/bulk_delete?' + param, {\n method: 'DELETE',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n response.text().then(text => {\n let vDom = document.createElement('div')\n vDom.innerHTML = text\n if (document.getElementById('user_list')) {\n document.getElementById('user_list').replaceWith(vDom.children[0])\n }\n })\n })\n }\n}\n","import {Controller} from 'stimulus'\nimport {projectStatusMenu} from \"../services/project-status-menu_service\";\n\nexport default class extends Controller {\n static targets = ['statusMenu']\n\n changeStatus(event) {\n let contentDom = document.getElementById('status_change_project_id')\n let id = contentDom.dataset.id\n let status = contentDom.dataset.status\n let type = event.currentTarget.dataset.type\n fetch(`/projects/change_status/${id}?new_status=${status}&type=${type}`, {\n method: 'PUT',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if (type === 'list') {\n response.text().then(text => {\n let vDom = document.createElement('div')\n vDom.innerHTML = text\n if (document.getElementById('project_list')) {\n document.getElementById('project_list').replaceWith(vDom.children[0])\n }\n })\n }\n if (type === 'detail') {\n response.json().then(json => {\n if (document.getElementById('project_detail_status')) {\n let statusDom = document.getElementById('project_detail_status')\n statusDom.innerHTML = json.status\n let colors = ['text-cyan-700', 'text-amber-700', 'text-gray-700', 'text-green-700']\n colors.forEach(token => {\n statusDom.classList.remove(`!${token}`)\n })\n statusDom.classList.add(this.statusTextClass(json.status_value))\n }\n if (document.getElementById('project_detail_status_button')) {\n ['bg-cyan-100', 'bg-amber-100', 'bg-gray-100', 'bg-green-200'].forEach(token => {\n document.getElementById('project_detail_status_button').classList.remove(`!${token}`)\n })\n document.getElementById('project_detail_status_button').classList.add(`!${this.statusDivClass(json.status_value)}`)\n }\n if (document.getElementById('project_detail_status_dropdown')) {\n ['bg-cyan-200', 'bg-amber-200', 'bg-gray-200', 'bg-green-300'].forEach(token => {\n document.getElementById('project_detail_status_dropdown').classList.remove(`!${token}`)\n })\n document.getElementById('project_detail_status_dropdown').classList.add(`!${this.statusDropdownClass(json.status_value)}`)\n }\n if (document.getElementById('sm-project_detail_status')) {\n document.getElementById('sm-project_detail_status').innerText = json.status\n }\n if (document.getElementById('sm-project_status')) {\n const statusList = ['draft', 'archived', 'completed', 'published'].filter(obj => json.status.toLowerCase() !== obj)\n const props = {\n statuses: statusList,\n projectId: id\n }\n document.getElementById('sm-project_status').innerHTML = projectStatusMenu(props);\n }\n }\n )\n }\n })\n }\n\n statusDivClass(status) {\n switch (status) {\n case 'completed':\n return 'bg-cyan-100'\n case 'draft':\n return 'bg-amber-100'\n case 'archived':\n return 'bg-gray-100'\n case 'published':\n return 'bg-green-200'\n default:\n return ''\n }\n }\n\n statusDropdownClass(status) {\n switch (status) {\n case 'completed':\n return 'bg-cyan-200'\n case 'draft':\n return 'bg-amber-200'\n case 'archived':\n return 'bg-gray-200'\n case 'published':\n return 'bg-green-300'\n default:\n return ''\n }\n }\n\n statusTextClass(status) {\n switch (status) {\n case 'completed':\n return 'text-cyan-700'\n case 'draft':\n return 'text-amber-700'\n case 'archived':\n return 'text-gray-700'\n case 'published':\n return 'text-green-700'\n default:\n return ''\n }\n }\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n change(event) {\n event.preventDefault();\n let type = document.getElementById('proposal_status_type').value\n let id = document.getElementById('proposal_id').value\n let status = document.getElementById('proposal_status_value').value\n let rejectionNote = document.getElementById('rejection_note')?.value\n if (type === 'detail') {\n this.fromDetail(id, status, type, rejectionNote)\n } else {\n this.fromList(id, status, rejectionNote)\n }\n }\n\n fromList(id, status, rejectionNote) {\n let status_selected = 'all'\n document.getElementById('proposal_filter_form').elements['status'].forEach(element => {\n if (element.checked) {\n status_selected = element.value\n }\n })\n let _this = this\n fetch(`/proposals/update/change_status?id=${id}&status=${status}&selected=${status_selected}&rejection_note=${rejectionNote}`, {\n method: 'PUT',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if (response.ok) {\n _this.resolvePromise(response, 'proposals_content')\n }\n })\n }\n\n fromDetail(id, status, type, rejectionNote) {\n let _this = this\n fetch(`/proposals/change_status?id=${id}&status=${status}&type=${type}&rejection_note=${rejectionNote}`, {\n method: 'PUT',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if (response.ok) {\n _this.resolvePromise(response, 'proposal_detail_status')\n }\n })\n }\n\n resolvePromise(response, id) {\n response.text().then(value => {\n let elementDom = document.createElement('div')\n elementDom.innerHTML = value\n document.getElementById(id).replaceWith(elementDom.children[0])\n });\n }\n}","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n role_id = ''\n user_id = ''\n\n roleSelected(event) {\n this.role_id = event.currentTarget.dataset.roleId\n this.user_id = event.currentTarget.dataset.userId\n }\n\n changeRole() {\n fetch(`/admin/users/change_role/${this.user_id}/${this.role_id}?turbo=false`, {\n method: 'PUT',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n response.text().then(text => {\n let vDom = document.createElement('div')\n vDom.innerHTML = text\n if (document.getElementById('user_list')) {\n document.getElementById('user_list').replaceWith(vDom.children[0])\n }\n })\n })\n }\n}\n","import {Controller} from 'stimulus';\nimport {Turbo} from \"@hotwired/turbo-rails\";\n\nexport default class extends Controller {\n static targets = ['form']\n totalResponded = +this.element.dataset.responded\n total = +this.element.dataset.totalAcceptedComments;\n\n commentResponse(event) {\n let perspectiveInterval = Number(event.currentTarget.dataset.perspectiveIntrvl);\n let responded = event.currentTarget.dataset.dgResponded === 'true';\n\n if (this.totalResponded === 0 && !responded && +event.currentTarget.dataset.dgCount > 0) {\n document.getElementById('dg-modal-trigger-btn').click();\n }\n\n if (perspectiveInterval / 3 === 1) {\n document.getElementById('modal-convo_perspective').click()\n }\n this.totalResponded += 1;\n\n if (this.totalResponded === this.total) {\n if (document.getElementById('completed_view_result')) {\n document.getElementById('completed_view_result').href = `/analytics?activity_id=${this.element.dataset.activityId}`\n }\n document.getElementById('response-complete').classList.remove('hidden');\n document.getElementById('response-complete-audio').play();\n document.getElementById('response-complete-audio').loop = true;\n }\n }\n}\n","import {Controller} from 'stimulus';\nimport {Turbo} from \"@hotwired/turbo-rails\";\n\nexport default class extends Controller {\n\n\n connect() {\n const Confettiful = function (el) {\n this.el = el;\n this.containerEl = null;\n\n this.confettiFrequency = 3;\n this.confettiColors = ['#EF2964', '#00C09D', '#2D87B0', '#48485E', '#EFFF1D'];\n this.confettiAnimations = ['slow', 'medium', 'fast'];\n\n this._setupElements();\n this._renderConfetti();\n };\n\n Confettiful.prototype._setupElements = function () {\n const containerEl = document.createElement('div');\n const elPosition = this.el.style.position;\n\n\n containerEl.classList.add('un-confetti-container');\n\n this.el.appendChild(containerEl);\n\n this.containerEl = containerEl;\n };\n\n Confettiful.prototype._renderConfetti = function () {\n this.confettiInterval = setInterval(() => {\n const confettiEl = document.createElement('div');\n const confettiSize = (Math.floor(Math.random() * 3) + 7) + 'px';\n const confettiBackground = this.confettiColors[Math.floor(Math.random() * this.confettiColors.length)];\n const confettiLeft = (Math.floor(Math.random() * this.el.offsetWidth)) + 'px';\n const confettiAnimation = this.confettiAnimations[Math.floor(Math.random() * this.confettiAnimations.length)];\n\n confettiEl.classList.add('un-confetti', 'un-confetti--animation-' + confettiAnimation);\n confettiEl.style.left = confettiLeft;\n confettiEl.style.width = confettiSize;\n confettiEl.style.height = confettiSize;\n confettiEl.style.backgroundColor = confettiBackground;\n\n confettiEl.removeTimeout = setTimeout(function () {\n confettiEl.parentNode.removeChild(confettiEl);\n }, 3000);\n\n this.containerEl.appendChild(confettiEl);\n }, 25);\n };\n\n window.confettiful = new Confettiful(document.querySelector('.un-complete-response-container'));\n\n }\n\n closeModal(event) {\n document.getElementById('response-complete').classList.add('hidden');\n document.getElementById('response-complete-audio').pause();\n document.getElementById('scrollable-activity-container').scrollTop = 0;\n }\n}\n","import {Controller} from 'stimulus';\nimport Chart from 'chart.js/auto';\nimport {configMapper} from \"../services/graph_service\";\n\nexport default class extends Controller {\n\n connect() {\n const data = {\n datasets: [{\n data: JSON.parse(this.element.dataset.graphData),\n backgroundColor: [\n 'rgb(10, 172, 165)'\n ],\n borderWidth: 1\n }]\n };\n let chart = 'conversation-graph';\n const myChart = new Chart(chart, {\n type: 'bar',\n data: data,\n options: {\n plugins: {\n legend: {\n display: false\n }\n },\n scales: {\n x: configMapper(this.element.dataset.type, this.element.dataset.week),\n y: {\n title: {\n display: true,\n text: 'Conversations Count'\n },\n beginAtZero: true\n }\n }\n }\n }\n );\n }\n\n generateReport() {\n const element = document.getElementById('conversation-chart-content').cloneNode(true);\n let graphs = element.getElementsByTagName('canvas');\n let graphCallback = replaceGraphs();\n\n const opt = {\n margin: 1,\n filename: 'conversation.pdf',\n image: {type: 'jpeg', quality: 1},\n html2canvas: {scale: 2},\n pagebreak: {mode: 'avoid-all'},\n jsPDF: {unit: 'pt', format: 'a4', orientation: 'portrait', precision: '12'},\n };\n\n function replaceGraphs() {\n const image = document.createElement('img');\n image.src = document.getElementById('conversation-graph').toDataURL();\n graphs[0].parentElement.replaceChild(image, graphs[0]);\n html2pdf().set(opt).from(element).save();\n }\n\n }\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n filter(event) {\n document.getElementById(`${event.currentTarget.dataset.status}_button`)?.click()\n }\n}","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n stepperController\n\n seedComments = [{index: 0, content: ''}]\n\n connect() {\n this.stepperController = this.application.getControllerForElementAndIdentifier(document.getElementById('activityCreateComp'), 'stepper')\n if (this.element.dataset.comments && this.element.dataset.comments !== '[]') {\n this.seedComments = JSON.parse(this.element.dataset.comments.replaceAll('=>', ':'))\n this.validateSeedResponses()\n }\n }\n\n inputComment(event) {\n let index = this.seedComments.findIndex(comment => comment.index === +event.currentTarget.dataset.index);\n this.seedComments[index].content = event.currentTarget.value\n document.getElementById('seed_comments').value = JSON.stringify(this.seedComments)\n this.validateSeedResponses()\n }\n\n addComment(event) {\n if(this.validateSeedResponses()) return\n\n let currentIndex = this.seedComments.length\n let elem = document.createElement('div')\n elem.innerHTML = `
\n
\n
\n conversation#inputComment\"\n id=\"comment${currentIndex}\"\n type=\"text\"\n data-stepper-target=\"seedResp\"\n data-index=\"${currentIndex}\">\n \n
\n \n
\n conversation#deleteComment\">delete\n
`\n document.getElementById('seed_comment_contents').appendChild(elem.children[0])\n this.seedComments.push({index: currentIndex, content: ''})\n document.getElementById('seed_comments').value = JSON.stringify(this.seedComments)\n this.validateSeedResponses()\n }\n\n deleteComment(event) {\n let index = this.seedComments.findIndex(comment => comment.index === +event.currentTarget.dataset.index);\n document.getElementById(`comment_${event.currentTarget.dataset.index}`).remove()\n if (this.seedComments[index].id) {\n this.seedComments[index]['_destroy'] = 1\n } else {\n this.seedComments.splice(index, 1)\n this.validateSeedResponses()\n }\n document.getElementById('seed_comments').value = JSON.stringify(this.seedComments)\n }\n\n validateSeedResponses() {\n return this.stepperController.validateSeedResponses()\n }\n}\n","import {Controller} from \"stimulus\";\nimport {de, tr} from \"date-fns/locale\";\n\nexport default class extends Controller {\n copy(event) {\n let currentElement = event.currentTarget\n let value = document.getElementById(currentElement.dataset.target).value\n navigator.clipboard.writeText(value)\n currentElement.classList.add('!hidden')\n let toggleElement = document.getElementById(currentElement.dataset.toggleId)\n toggleElement.removeAttribute('hidden')\n setTimeout(() => {\n currentElement.classList.remove('!hidden')\n toggleElement.hidden = true\n }, 5000)\n }\n}","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n connect() {\n let date = this.element.dataset.endDate;\n let countDownDate = new Date(date).getTime();\n let _this = this;\n let interval = setInterval(function () {\n let now = new Date().getTime();\n let distance = countDownDate - now;\n if (distance < 0) {\n clearInterval(interval);\n _this.setDates();\n } else {\n const splitDifference = {\n days: Math.floor(distance / (1000 * 60 * 60 * 24)),\n hours: Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)),\n minutes: Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)),\n seconds: Math.floor((distance % (1000 * 60)) / 1000),\n };\n _this.setDates(splitDifference);\n }\n }, 1000);\n }\n\n setDates(date) {\n ['days', 'hours', 'minutes', 'seconds'].forEach(attrib => {\n document.querySelectorAll(`#${attrib}`).forEach(el => el.innerHTML = date ? date[attrib] : 0)\n });\n }\n}\n","import {Controller} from 'stimulus';\nimport Cropper from 'cropperjs';\nimport {loadXHR} from \"../services/cropper_service\";\n\nexport default class extends Controller {\n\n connect() {\n if (document.getElementById('cropper_dropzone')) {\n document.getElementById('cropper_dropzone').addEventListener('change', (event) => {\n this.initializeCrop(event)\n });\n }\n if (document.getElementById('replace_image')) {\n document.getElementById('replace_image').addEventListener('change', (event) => {\n this.initializeCrop(event)\n });\n }\n }\n\n initializeCrop(event) {\n const image = document.getElementById(`project_image`);\n const file = event.target.files?.[0];\n if (file) {\n if (file.size / 1024 / 1024 > 10) {\n document.getElementById('banner_image_error').removeAttribute('hidden')\n return\n } else {\n document.getElementById('banner_image_error').setAttribute('hidden', true)\n document.getElementById(`project_banner_cropper`).click();\n }\n document.getElementById('cropper_control').style.display = 'block'\n const url = URL.createObjectURL(file);\n image.src = url;\n image.onload = () => {\n this.cropImage(image);\n };\n }\n }\n\n addReplaceListener() {\n document.getElementById('replace_image').addEventListener('change', (event) => {\n this.initializeCrop(event)\n });\n }\n\n cropImage(image) {\n let croppedData;\n let aspectHeight = +this.element.dataset.aspectRatioHeight\n let aspectWidth = +this.element.dataset.aspectRatioWidth\n const cropper = new Cropper(image, {\n zoomable: true,\n aspectRatio: aspectWidth / aspectHeight,\n viewMode: 1,\n crop(event) {\n croppedData = {\n width: event.detail.width,\n height: event.detail.height\n };\n },\n ready() {\n document.getElementById(`crop-btn`).addEventListener('click', (evt) => {\n evt.preventDefault()\n const canvas = cropper.getCroppedCanvas();\n const image = document.getElementById(`project_image`);\n image.src = canvas.toDataURL();\n image.onload = () => {\n cropper.destroy();\n document.getElementById('cropper_control').style.display = 'none'\n document.getElementById('cropper_done').removeAttribute('disabled')\n };\n });\n document.getElementById(`rotate-btn`).addEventListener('click', (evt) => {\n evt.preventDefault()\n cropper.rotate(90);\n });\n document.getElementById(`cancel-btn`).addEventListener('click', (event) => {\n event.preventDefault()\n cropper.destroy();\n });\n },\n });\n }\n\n saveImage(event) {\n event.preventDefault()\n const imgEl = document.getElementById('project_image');\n const imgUrl = imgEl.src;\n let type = event.currentTarget.dataset.type;\n loadXHR(imgUrl).then((imgBlob) => {\n imgBlob.filename = `new_name_secure.${imgBlob.type.split('/')[1]}`\n let data = new FormData()\n data.append('upload[file]', imgBlob)\n data.append('upload[attachment_type]', 'banner_image')\n data.append('upload[file_name]', imgBlob.name)\n data.append('upload[type]', type)\n data.append('upload[size]', (imgBlob.size / (1024 * 1024)).toFixed(2) + ' MB')\n fetch('/attachments', {\n method: 'post',\n body: data,\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if (response.ok) {\n response.json().then(value => {\n document.getElementById('banner_image_param').value = value.id\n let elementDom = document.createElement('div')\n elementDom.innerHTML = value.html\n document.getElementById('project_banner_image_content').replaceWith(elementDom.children[0])\n this.addReplaceListener()\n });\n }\n })\n });\n }\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n\n params = {\n type: 'year',\n date: '2022',\n project: 'all',\n conversation_type: 'all'\n }\n\n typeSelected(event) {\n if (event.currentTarget.checked && this.params.type !== event.currentTarget.dataset.key) {\n this.params.type = event.currentTarget.dataset.key\n this.params.date = document.getElementById('dashboard-date-swiper-value').innerText\n this.filter()\n }\n }\n\n dateChanged(event) {\n if (this.params.date !== document.getElementById('dashboard-date-swiper-value').innerText) {\n this.params.date = document.getElementById('dashboard-date-swiper-value').innerText\n this.filter()\n }\n }\n\n projectSelected(event) {\n let inputElement = document.getElementById('project_filter')\n inputElement.value = event.currentTarget.innerText\n inputElement.dataset.value = event.currentTarget.dataset.id\n if (this.params.project !== inputElement.dataset.value) {\n this.params.project = event.currentTarget.dataset.id\n this.filter()\n }\n }\n\n conversationTypeSelected(event) {\n let inputElement = document.getElementById('conversation_filter')\n inputElement.value = event.currentTarget.innerText\n inputElement.dataset.value = event.currentTarget.dataset.id\n if (this.params.conversation_type !== inputElement.dataset.value) {\n this.params.conversation_type = event.currentTarget.dataset.id\n this.filter()\n }\n }\n\n filter() {\n let url_params = new URLSearchParams(this.params).toString();\n let url = `/dashboard/graphs?${url_params}`\n fetch(url).then(response => {\n response.text().then(text => {\n let vDom = document.createElement('div')\n vDom.innerHTML = text\n if (document.getElementById('dash_board_graphs')) {\n document.getElementById('dash_board_graphs').replaceWith(vDom.children[0])\n }\n })\n })\n }\n}","import {Controller} from 'stimulus';\n\nconst dayjs = require('dayjs');\nlet duration = require('dayjs/plugin/duration');\n\n\ndayjs.extend(duration)\n\nexport default class extends Controller {\n static targets = ['currentDate'];\n\n nowDate = dayjs().format('YYYY');\n dateFilter = 'year';\n previousDate = dayjs().format();\n map = {\n year: 'YYYY',\n month: 'MMMM, YYYY',\n week: 'ddd',\n day: 'MMMM DD, YYYY'\n }\n mapDuration = {\n year: 'years',\n month: 'months',\n week: 'weeks',\n day: 'days'\n }\n\n connect() {\n this.currentDateTarget.innerHTML = this.nowDate;\n }\n\n dateSelect(event) {\n this.dateFilter = event.target.dataset.key;\n this.nowDate = dayjs(this.previousDate).format(this.map[this.dateFilter]);\n this.currentDateTarget.innerHTML = this.nowDate;\n this.dateFilter==='week' && this.forWeekDisplay(this.nowDate);\n }\n\n datefront() {\n this.swipeDate();\n }\n\n dateBack() {\n this.swipeDate(true);\n }\n\n swipeDate(sub) {\n let format = this.mapDuration[this.dateFilter];\n let date = sub ? dayjs(this.previousDate).subtract(1, [format]) : dayjs(this.previousDate).add(dayjs.duration({[format]: 1}));\n let currentDate = date.format(this.map[this.dateFilter]);\n this.previousDate = date.format();\n this.nowDate = this.currentDateTarget.innerHTML = currentDate;\n this.dateFilter==='week' && this.forWeekDisplay(currentDate);\n }\n\n\n forWeekDisplay(currentDate) {\n let pDate = new Date(dayjs(this.previousDate).format('YYYY-MM-DD'));\n let date = pDate.getDate();\n let weekNo = Math.ceil(pDate.getDate() / 7);\n let tempDate = new Date(pDate);\n let lastDay = new Date(tempDate.setDate(date + 6));\n this.currentDateTarget.innerHTML = `Week ${weekNo}, ${dayjs(pDate).format('DD MMM, YYYY')} - ${dayjs(lastDay).format('DD MMM, YYYY')}`;\n }\n\n generateDashboardPDF() {\n const element = document.getElementById('dashboard-report-print').cloneNode(true);\n let graphs = element.getElementsByTagName('canvas');\n let images = [];\n let temp;\n let graphCallback = replaceGraphs();\n\n let imgs = element.getElementsByTagName('img');\n for (let i = 0; i < imgs.length; i++) {\n imgs[i].crossOrigin = 'anonymous';\n let imgCanvas = document.createElement(\"canvas\");\n imgCanvas.width = imgs[i].width;\n imgCanvas.height = imgs[i].height;\n let imgContext = imgCanvas.getContext(\"2d\");\n imgContext.drawImage(imgs[i], 0, 0, imgs[i].width, imgs[i].height);\n let imgInfom = imgCanvas.toDataURL(\"image/png\");\n const base64 = getBase64StringFromDataURL(imgInfom);\n imgs[i].src = base64;\n }\n\n function replaceGraphs() {\n graphs = [].slice.call(graphs);\n element.classList.add('un-dashboard-report--pdf');\n for (let i = 0; i < graphs.length; i++) {\n images.push(document.createElement('img'));\n images[i].src = document.getElementsByTagName('canvas')[i].toDataURL();\n images[i].classList = ['object-contain'];\n graphs[i].parentElement.replaceChild(images[i], graphs[i]);\n }\n html2pdf().from(element).set({\n margin: 1,\n filename: 'dashboardReport.pdf',\n image: {type: 'jpeg', quality: 1},\n html2canvas: {scale: 2, useCORS: true},\n pagebreak: {mode: 'avoid-all'},\n jsPDF: {unit: 'pt', format: 'a4', orientation: 'portrait', precision: '12'},\n }).save();\n }\n }\n}\n\n\n","import {Controller} from 'stimulus'\nimport {popSnackbar} from \"../services/snackbar\";\n\nexport default class extends Controller {\n deleteProject(event) {\n let type = event.currentTarget.dataset.type\n let id = document.getElementById('project_id').dataset.value\n fetch(`/projects/${id}?type=${type}`, {\n method: 'DELETE',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if (response.redirected) {\n popSnackbar('success', 'Project and corresponding activities deleted successfully')\n window.location.href = response.url;\n } else {\n response.text().then(text => {\n let vDom = document.createElement('div')\n vDom.innerHTML = text\n if (document.getElementById('project_list')) {\n document.getElementById('project_list').replaceWith(vDom.children[0])\n }\n })\n popSnackbar('success', 'Project and corresponding activities deleted successfully')\n }\n })\n }\n}\n","import {Controller} from 'stimulus';\n\nexport default class extends Controller {\n submitDemography() {\n document.getElementById('dg-cancel-btn').click();\n }\n}","import {Controller} from 'stimulus';\nimport Chart from 'chart.js/auto';\nimport {setPositions} from \"../services/tooltip-position_service\";\n\nexport default class extends Controller {\n\n connect() {\n const getOrCreateTooltip = (chart) => {\n let tooltipEl = chart.canvas.parentNode.querySelector('div');\n if (!tooltipEl) {\n tooltipEl = document.createElement('div');\n tooltipEl.style.opacity = 1;\n tooltipEl.style.pointerEvents = 'none';\n tooltipEl.style.position = 'absolute';\n tooltipEl.style.transform = 'translate(-50%, 0)';\n tooltipEl.style.transition = 'all .1s ease';\n tooltipEl.setAttribute('id', 'divisive-tooltip');\n chart.canvas.parentNode.appendChild(tooltipEl);\n }\n return tooltipEl;\n };\n\n const externalTooltipHandler = (context) => {\n const {chart, tooltip} = context;\n const tooltipEl = getOrCreateTooltip(chart);\n\n // Hide if no tooltip\n if (tooltip.opacity === 0) {\n tooltipEl.style.opacity = 0;\n return;\n }\n\n // Set Text\n if (tooltip.body) {\n const bodyLines = tooltip.body.map(b => b.lines);\n bodyLines.forEach(value => {\n fetch(`/analytics/comment/detail/${tooltip.dataPoints[0].raw.id}`).then(response => response.text()).then(data => {\n document.getElementById('divisive-tooltip').innerHTML = data;\n setPositions(chart, 'divisive-tooltip', tooltipEl, tooltip);\n })\n });\n }\n\n\n };\n\n let dataset = JSON.parse(this.element.dataset.dataset)\n const data = {\n datasets: [{\n showLine: false,\n backgroundColor: '#53B568',\n pointRadius: 5,\n data: dataset,\n }],\n };\n let ctx = 'divisive-graph';\n const myChart = new Chart(ctx, {\n type: 'scatter',\n data,\n options: {\n scales: {\n x: {\n grid: {\n display: false,\n\n },\n ticks: {\n display: false,\n stepSize: 0.1\n }\n },\n y: {\n beginAtZero: true,\n grid: {\n display: false,\n borderWidth: 0\n },\n ticks: {\n display: false,\n }\n }\n },\n plugins: {\n tooltip: {\n enabled: false,\n position: 'nearest',\n external: externalTooltipHandler\n },\n legend: {\n display: false\n }\n },\n }\n\n });\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n select(event) {\n let dataset = event.currentTarget.dataset\n document.getElementById(dataset.valueId).value = dataset.value\n document.getElementById(dataset.elementId).value = dataset.display\n }\n}\n","import {Controller} from \"stimulus\";\n\nimport flatpickr from \"flatpickr\";\n\nexport default class extends Controller {\n static targets = ['field', 'dateLabel']\n fp\n\n connect() {\n this.fp = flatpickr(\"#end_date\", {\n dateFormat: \"d.m.Y\",\n allowInput: true,\n disableMobile: true\n });\n }\n}\n","import {Controller} from 'stimulus'\nimport {ValidationsMapper} from \"../services/validations_mapper\";\n\nexport default class extends Controller {\n connect() {\n let data = JSON.parse(this.element.dataset.validations)\n this.listenToClick(data.controls, data.button)\n }\n\n listenToClick(controls, buttonId) {\n let _this = this\n document.getElementById(buttonId).addEventListener(\n 'click',\n function (evt) {\n let validity = []\n for (let i = 0; i < controls.length; i++) {\n let flag = false\n flag = ValidationsMapper[controls[i].type](controls, i)\n validity.push(flag)\n }\n if (validity.includes(false)) {\n evt.preventDefault()\n evt.stopImmediatePropagation()\n }\n },\n false\n );\n }\n}\n","import {Controller} from 'stimulus';\n\nexport default class extends Controller {\n\n connect() {\n }\n\n generatePDF() {\n const element = document.getElementById('print-pdf').cloneNode(true);\n let graphs = element.getElementsByTagName('canvas');\n let images = [];\n let temp;\n let graphCallback = replaceGraphs();\n\n const opt = {\n margin: 1,\n filename: 'myfile.pdf',\n image: {type: 'jpeg', quality: 1},\n html2canvas: {scale: 2},\n pagebreak: {mode: 'avoid-all'},\n jsPDF: {unit: 'pt', format: 'a4', orientation: 'portrait', precision: '12'},\n };\n\n function replaceGraphs() {\n graphs = [].slice.call(graphs);\n element.classList.add('un-analytics--pdf');\n for (let i = 0; i < graphs.length; i++) {\n images.push(document.createElement('img'));\n images[i].src = document.getElementsByTagName('canvas')[i].toDataURL();\n graphs[i].parentElement.replaceChild(images[i], graphs[i]);\n }\n html2pdf().set(opt).from(element).save();\n }\n }\n\n\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n\n connect() {\n this.checkIntersection();\n }\n\n checkIntersection() {\n window.localLibrary = {}\n window.localLibrary['homeCarouselPage']=0\n document.querySelectorAll('.un-home-carousel__list').forEach((element, i) => {\n let observer = new IntersectionObserver(function (entries) {\n if (entries[0].isIntersecting === true) {\n localLibrary.homeCarouselPage = i + 1;\n let scrollLeft = document.getElementById('scroll-left');\n let scrollRight = document.getElementById('scroll-right');\n i === 0 ? scrollLeft.classList.add('hidden') : scrollLeft.classList.remove('hidden');\n i === (document.querySelectorAll('.un-home-carousel__list').length - 1) ? scrollRight.classList.add('hidden') : scrollRight.classList.remove('hidden');\n }\n\n\n }, {threshold: [0.5]});\n observer.observe(element);\n });\n }\n\n slideNextPage(evt) {\n const nextPage = localLibrary.homeCarouselPage + 1;\n document.querySelectorAll('.un-home-carousel__list').forEach((element, i) => {\n if (i + 1 === nextPage) {\n element.scrollIntoView(true);\n let scrolledY = window.scrollY;\n if (scrolledY) {\n window.scroll(0, scrolledY - 56);\n }\n }\n });\n\n }\n\n slideFirstPage() {\n document.querySelectorAll('.un-home-carousel__list')[0].scrollIntoView(true);\n let scrolledY = window.scrollY;\n if (scrolledY) {\n window.scroll(0, scrolledY - 56);\n }\n }\n}\n","// Load all the controllers within this directory and all subdirectories. \n// Controller files must be named *_controller.js.\n\nimport { Application } from \"stimulus\"\nimport { definitionsFromContext } from \"stimulus/webpack-helpers\"\n\nconst application = Application.start()\nconst context = require.context(\"controllers\", true, /_controller\\.js$/)\napplication.load(definitionsFromContext(context))\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n static targets = ['fieldInput', 'countContent']\n\n connect() {\n\n }\n\n countTextLength(evt) {\n const inputTextLength = evt.currentTarget.value.length;\n const maxTextCount = evt.currentTarget.dataset.maxtextcount\n const resultDisplay = this.countContentTarget;\n resultDisplay.textContent = inputTextLength + '/' + maxTextCount;\n }\n}","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n static targets = ['detail', 'linkText', 'linkIcon'];\n detail = this.detailTarget;\n linkText = this.linkTextTarget;\n linkIcon = this.linkIconTarget;\n\n connect() {\n }\n\n readMore(evt) {\n let currentText = evt.currentTarget.dataset.id;\n let readMoreText = evt.currentTarget.dataset.readMore;\n let readLessText = evt.currentTarget.dataset.readLess;\n\n if (currentText === 'readmore') {\n evt.currentTarget.innerHTML = readLessText;\n this.linkIcon.innerHTML = 'expand_less';\n evt.currentTarget.setAttribute('data-id', 'readless');\n this.detail.classList.remove('hidden')\n } else {\n evt.currentTarget.innerHTML = readMoreText;\n this.linkIcon.innerHTML = 'expand_more';\n evt.currentTarget.setAttribute('data-id', 'readmore');\n this.detail.classList.add('hidden')\n\n }\n\n }\n}","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n\n connect() {\n const urlList = document.getElementById(\"navList\");\n const navLink = urlList.getElementsByClassName(\"un-nav-link\");\n const urlArray = location.pathname.split('/');\n const url = urlArray[urlArray.length - 1];\n for (let i = 0; i < navLink.length; i++) {\n if (document.getElementById(url)) {\n document.getElementById(url).classList.add(\"un-nav-link--active\");\n }\n }\n\n urlList.querySelectorAll('[id*=\"rectangle\"]').forEach(item => {\n item.classList?.remove('bg-primary');\n });\n let activeRect = urlList.querySelector(`.un-rectangle-${url}`);\n if (activeRect) {\n activeRect.classList.add('bg-primary');\n }\n }\n}","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n connect() {\n let locationPath = location.pathname\n if (locationPath.includes('project') || locationPath.includes('activities') || locationPath.includes('analytics')) {\n document.getElementById('web_projects')?.classList?.add('sm:bg-light-white/[0.1]')\n } else if (locationPath.includes('user')) {\n document.getElementById('web_users')?.classList?.add('sm:bg-light-white/[0.1]')\n } else if (locationPath.includes('dashboard')) {\n document.getElementById('web_dashboard')?.classList?.add('sm:bg-light-white/[0.1]')\n } else if (locationPath.includes('about_us')) {\n document.getElementById('web_about_us')?.classList?.add('sm:bg-light-white/[0.1]')\n } else if (locationPath.includes('proposals')) {\n document.getElementById('web_proposals')?.classList?.add('sm:bg-light-white/[0.1]')\n } else if (locationPath.includes('terms_conditions')) {\n document.getElementById('web_terms_conditions')?.classList?.add('sm:bg-light-white/[0.1]')\n }else {\n document.getElementById('web_home')?.classList?.add('sm:bg-light-white/[0.1]')\n }\n }\n}","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n static targets = ['icon', 'createContent'];\n createContent = this.createContentTarget;\n\n officialUpdateCreate() {\n this.createContent.classList.contains('hidden') ? this.createContent.classList.remove('hidden') : this.createContent.classList.add('hidden');\n }\n\n cancelCreate() {\n this.createContent.classList.add('hidden')\n }\n\n open(evt) {\n let icon = evt.currentTarget.querySelector(\"[data-official-update-target='icon']\");\n let iconValue = icon.textContent;\n iconValue === 'expand_more' ? icon.innerHTML = 'expand_less' : icon.innerHTML = 'expand_more';\n }\n\n updated(event) {\n let frame_id = event.currentTarget.dataset.id\n event.detail.fetchResponse.response.text().then(value => {\n let elem = document.createElement('div');\n let _value = value\n document.querySelectorAll(`#${frame_id}`).forEach(element => {\n elem.innerHTML = _value\n element.replaceWith(elem.firstChild)\n })\n })\n }\n}\n","import {Controller} from 'stimulus';\nimport Chart from 'chart.js/auto'\nimport {setPositions} from \"../services/tooltip-position_service\";\n\nexport default class extends Controller {\n\n connect() {\n const getOrCreateTooltip = (chart) => {\n let tooltipEl = chart.canvas.parentNode.querySelector('div');\n if (!tooltipEl) {\n tooltipEl = document.createElement('div');\n tooltipEl.style.opacity = 1;\n tooltipEl.style.pointerEvents = 'none';\n tooltipEl.style.position = 'absolute';\n tooltipEl.style.transform = 'translate(-50%, 0)';\n tooltipEl.style.transition = 'all .1s ease';\n tooltipEl.setAttribute('id', 'opinion-tooltip');\n chart.canvas.parentNode.appendChild(tooltipEl);\n }\n\n return tooltipEl;\n };\n\n const externalTooltipHandler = (context) => {\n // Tooltip Element\n const {chart, tooltip} = context;\n const tooltipEl = getOrCreateTooltip(chart);\n\n // Hide if no tooltip\n if (tooltip.opacity === 0) {\n tooltipEl.style.opacity = 0;\n return;\n }\n\n // Set Text\n if (tooltip.body) {\n const bodyLines = tooltip.body.map(b => b.lines);\n bodyLines.forEach(value => {\n if (tooltip.dataPoints[0].raw.id) {\n fetch(`/analytics/comment/detail/${tooltip.dataPoints[0].raw.id}`).then(response => response.text()).then(data => {\n document.getElementById('opinion-tooltip').innerHTML = data;\n setPositions(chart, 'opinion-tooltip', tooltipEl, tooltip);\n });\n }\n else {\n document.getElementById('opinion-tooltip').innerHTML = '';\n }\n });\n\n }\n };\n const DATA_COUNT = 7;\n const NUMBER_CFG = {count: DATA_COUNT, min: -100, max: 100};\n const scaleConfig = {\n position: 'center',\n beginAtZero: true,\n min: -30,\n max: 30,\n grid: {\n display: false,\n },\n ticks: {\n display: false\n }\n }\n let dataset = JSON.parse(this.element.dataset.dataset)\n const data = {\n datasets: dataset\n };\n const ChartDataLabels = {\n id: 'ChartDataLabels',\n afterDatasetsDraw(chart, args, options) {\n const {ctx} = chart;\n ctx.save();\n for (let n = 0; n < chart.config.data.datasets[0]?.data?.length; n++) {\n ctx.fillText(chart.config.data.datasets[0].data[n].index, chart.getDatasetMeta(0).data[n].x, chart.getDatasetMeta(0).data[n].y);\n }\n let labelIndex = chart.config.data.datasets.findIndex(el => {\n return el.label === 'GrpLabel';\n });\n\n labelIndex = Math.abs(labelIndex)\n\n for (let n = 0; n < chart.config.data.datasets[labelIndex]?.data?.length; n++) {\n ctx.font = '20px san sarif';\n ctx.fillText(chart.config.data.datasets[labelIndex].data[n]?.index, chart.getDatasetMeta(0).data[n]?.x, chart.getDatasetMeta(0).data[n]?.y);\n }\n ctx.restore();\n }\n }\n const quadrants = {\n id: 'quadrants',\n beforeDraw(chart, args, options) {\n const {ctx, chartArea: {left, top, right, bottom}, scales: {x, y}} = chart;\n const midX = x.getPixelForValue(0);\n const midY = y.getPixelForValue(0);\n ctx.save();\n ctx.restore();\n }\n };\n let ctx = 'opinion-graph';\n const myChart = new Chart(ctx, {\n data: data,\n options: {\n plugins: {\n quadrants: {\n topLeft: 'red',\n topRight: 'white',\n bottomRight: 'blue',\n bottomLeft: 'pink',\n },\n tooltip: {\n enabled: false,\n position: 'nearest',\n external: externalTooltipHandler\n },\n legend: {\n display: false\n }\n\n },\n scales: {\n x: scaleConfig,\n y: scaleConfig,\n r: {\n min: 0,\n max: 60,\n ticks: {\n display: false,\n autoSkip: false,\n stepSize: 20,\n }\n }\n\n },\n\n },\n\n plugins: [quadrants, ChartDataLabels]\n\n });\n }\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n static targets = ['checkbox']\n overallFilter(event) {\n event.currentTarget.querySelector('input').checked = true;\n this.apiCall(event)\n }\n\n apiCall(event) {\n const filters = this.application.getControllerForElementAndIdentifier(document.getElementById('analytics-page'), 'activity-analytics-filter').filters;\n const activityId = event.currentTarget.dataset.activityId;\n const interval = event.currentTarget.dataset.interval;\n\n fetch(`analytics/filter?activity_id=${activityId}&interval=${interval}`, {\n method: \"POST\",\n body: JSON.stringify({filters: filters}),\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content,\n 'Content-Type': 'application/json',\n },\n }).then(response => response.text())\n .then(html => {\n document.getElementById('participant_graph').outerHTML = html;\n })\n }\n}\n","import {Controller} from 'stimulus';\nimport Chart from 'chart.js/auto';\nimport 'chartjs-adapter-date-fns';\n\nexport default class extends Controller {\n displayMapper = {\n month: {month: 'MMM'},\n day: {day: 'MMM dd'},\n week: {week: 'MMM dd'}\n }\n\n connect() {\n const dataContent = JSON.parse(this.element.dataset.graphData);\n const data = {\n datasets: [{\n xAxisID: 'x',\n label: 'Data',\n data: dataContent,\n fill: false,\n borderColor: 'rgb(75, 192, 192)',\n },\n {\n xAxisID: 'x1',\n label: 'Data',\n data: dataContent,\n fill: false,\n borderColor: 'rgb(75, 192, 192)',\n }\n ]\n };\n let chart = 'overall-graph';\n const myChart = new Chart(chart, {\n type: 'line',\n data: data,\n options: {\n plugins: {\n legend: {\n display: false\n }\n },\n scales: {\n x: {\n type: 'time',\n time: {\n unit: this.element.dataset.interval,\n displayFormats: this.displayMapper[this.element.dataset.interval]\n }\n },\n x1: {\n beginAtZero: true,\n type: 'time',\n time: {\n unit: 'year',\n displayFormats: {\n year: 'yyyy'\n }\n },\n grid: {\n offset: true\n },\n ticks: {\n color: 'black'\n }\n },\n y: {\n beginAtZero: true,\n ticks: {\n precision: 0\n },\n title: {\n display: true,\n text: 'Numbers of Participants'\n },\n }\n }\n\n }\n\n });\n }\n}\n","import {Controller} from 'stimulus';\nimport Chart from 'chart.js/auto';\nimport {configMapper} from \"../services/graph_service\";\n\nexport default class extends Controller {\n\n connect() {\n const data = {\n datasets: [{\n data: JSON.parse(this.element.dataset.graphData),\n backgroundColor: [\n 'rgb(242, 179, 15)'\n ],\n borderWidth: 1\n }]\n };\n let chart = 'participants-graph';\n const myChart = new Chart(chart, {\n type: 'bar',\n data: data,\n options: {\n plugins: {\n\n legend: {\n display: false\n }\n },\n scales: {\n x: configMapper(this.element.dataset.type, this.element.dataset.week),\n y: {\n title: {\n display: true,\n text: 'Participants Count'\n },\n beginAtZero: true\n }\n }\n }\n }\n );\n }\n\n generatePartReport() {\n const element = document.getElementById('participant-chart-content').cloneNode(true);\n let graphs = element.getElementsByTagName('canvas');\n let images = [];\n let temp;\n let graphCallback = replaceGraphs();\n\n const opt = {\n margin: 1,\n filename: 'participant.pdf',\n image: {type: 'jpeg', quality: 1},\n html2canvas: {scale: 2},\n pagebreak: {mode: 'avoid-all'},\n jsPDF: {unit: 'pt', format: 'a4', orientation: 'portrait', precision: '12'},\n };\n\n function replaceGraphs() {\n const image = document.createElement('img');\n image.src = document.getElementById('participants-graph').toDataURL();\n graphs[0].parentElement.replaceChild(image, graphs[0]);\n html2pdf().set(opt).from(element).save();\n }\n }\n}\n\n\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n params\n\n connect() {\n this.params = {\n statements: true,\n participant: true,\n group: true\n }\n }\n\n check(event) {\n const filters = this.application.getControllerForElementAndIdentifier(document.getElementById('analytics-page'), 'activity-analytics-filter').filters;\n if (event.currentTarget.checked) {\n this.params[event.currentTarget.id] = true;\n } else {\n this.params[event.currentTarget.id] = false;\n }\n let formData = new FormData();\n formData.append('filter', JSON.stringify(this.params));\n formData.append('filters', JSON.stringify(filters));\n fetch(`/analytics/pca_filter/${this.element.dataset.activityId}`,\n {\n method: \"POST\",\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n },\n body: formData\n }).then(response => {\n response.text().then(text => {\n let element = document.createElement('div');\n element.innerHTML = text;\n document.getElementById('pca_graph').replaceWith(element.children[0]);\n })\n })\n }\n}\n","import {Controller} from \"stimulus\";\nimport {popSnackbar} from \"../services/snackbar\";\n\nexport default class extends Controller {\n static targets = ['actionBtns', 'hint', 'input'];\n\n connect() {\n }\n\n expand(evt) {\n this.actionBtnsTarget.classList.remove('hidden');\n this.hintTarget.classList.remove('hidden');\n this.inputTarget.setAttribute('rows', 5)\n }\n close(evt) {\n this.actionBtnsTarget.classList.add('hidden');\n this.hintTarget.classList.add('hidden');\n this.inputTarget.setAttribute('rows', 2)\n if(evt.target.dataset.btnName == 'submit') {\n popSnackbar('success', 'Opinion Submitted.')\n }\n }\n}\n","import {Controller} from 'stimulus';\n\nexport default class extends Controller {\n connect() {\n let perspectiveDom = document.getElementById('perspective');\n perspectiveDom.addEventListener('turbo:submit-start', (event) => {\n let projectSetting = JSON.parse(event.currentTarget.dataset.projectSetting);\n let currentUserPresence = Boolean(event.currentTarget.dataset.currentUserPresence);\n\n if(projectSetting.authenticate && !currentUserPresence) {\n event.detail.formSubmission.stop();\n window.location.href = '/users/sign_in';\n }\n })\n }\n\n submitPerspective() {\n document.getElementById('perspective-form').addEventListener('turbo:submit-end', (e) => {\n document.getElementById('perspective-reset-btn').click();\n })\n }\n}","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n static targets = ['accHeader', 'description', 'field']\n\n connect() {\n this.disableDesc(0, 'true');\n this.disableField(0, 'true');\n }\n\n openAcc(event) {\n event.target.innerHTML = event.target.innerHTML === 'expand_more' ? 'expand_less' : 'expand_more';\n let accHeader = event.currentTarget;\n this.disableDesc(accHeader.dataset.pollDesc, accHeader.ariaExpanded);\n this.disableField(accHeader.dataset.pollDesc, accHeader.ariaExpanded);\n }\n\n inputOpen(event) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n disableDesc(id, state) {\n document.querySelectorAll('.un-accordion__poll-title').forEach(element => {\n element.style.display = (element.id === 'poll-desc-' + id && state === 'true') ? 'none' : 'block'\n })\n\n }\n\n disableField(id, state) {\n document.querySelectorAll('.un-accordion__poll-field').forEach(element => {\n element.style.display = (element.id === 'poll-field-' + id && state === 'true') ? 'block' : 'none';\n })\n }\n\n\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n static targets = ['page']\n total = +this.element.dataset.totalPolls\n totalResponded = +this.element.dataset.responded\n\n connect() {\n let _this = this\n let radios = document.querySelectorAll(\"input[type=radio]\");\n for (let i = 0, iLen = radios.length; i < iLen; i++) {\n if (!(radios[i].dataset.disable && radios[i].dataset.disable === 'false')) {\n radios[i].onclick = function () {\n _this.disableAnswered(this.name);\n }\n }\n }\n }\n\n respond(event) {\n let elem = event.currentTarget\n let responded = event.currentTarget.dataset.dgResponded === 'true';\n if (this.totalResponded === 0 && !responded && +event.currentTarget.dataset.dgCount > 0) {\n document.getElementById('dg-modal-trigger-btn').click();\n }\n\n fetch(`/responses?option_id=${elem.id}&question_id=${elem.name}&responder=${elem.dataset.responder}`, {\n method: 'post',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if (response.ok) {\n this.totalResponded += 1;\n if (response.redirected) {\n location.href = response.url\n } else {\n if (this.totalResponded === this.total) {\n document.getElementById('response-complete').classList.remove('hidden');\n document.getElementById('poll-complete').classList.remove('hidden');\n document.getElementById('response-complete-audio').play();\n document.getElementById('response-complete-audio').loop = true;\n if (document.getElementById('completed_view_result')) {\n document.getElementById('completed_view_result').href = `/analytics?activity_id=${this.element.dataset.activity_id}`\n }\n }\n }\n }\n })\n }\n\n disableAnswered(name) {\n let x = document.getElementsByName(name);\n for (let i = 0; i < x.length; i++) {\n x[i].disabled = true;\n }\n }\n}\n","import {Controller} from 'stimulus';\nimport Chart from 'chart.js/auto';\nimport ChartDataLabels from 'chartjs-plugin-datalabels';\n\nexport default class extends Controller {\n\n connect() {\n let data = JSON.parse(this.element.dataset.pollData.replaceAll('=>', ':'));\n let chart = data.chart;\n const myChart = new Chart(chart, {\n type: 'doughnut',\n data: data.data,\n plugins: [ChartDataLabels],\n options: {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: {\n position: 'right'\n }\n },\n cutout: '60%'\n },});\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n static targets = ['page']\n\n connect() {\n }\n\n next(event) {\n const pageTotal = +event.currentTarget.dataset.page;\n let currentValue = +this.pageTarget.innerHTML;\n currentValue < pageTotal ? currentValue += 1 : currentValue = 1;\n document.getElementById('slide-next-btn').click();\n setTimeout(() => {\n this.pageTarget.innerHTML = currentValue.toString();\n }, 500);\n }\n\n previous(event) {\n const pageTotal = +event.currentTarget.dataset.page;\n let currentValue = +this.pageTarget.innerHTML;\n currentValue <= pageTotal && currentValue !== 1 ? currentValue -= 1 : currentValue = pageTotal;\n document.getElementById('slide-prev-btn').click();\n setTimeout(() => {\n this.pageTarget.innerHTML = currentValue.toString();\n }, 500)\n }\n}\n","import {Controller} from \"stimulus\";\nimport {optionHtml, questionHtml} from \"../services/questions_service\";\nimport {de} from \"date-fns/locale\";\n\nexport default class extends Controller {\n stepperController\n\n pollQuestions = [\n {\n index: 0,\n question: '',\n question_type: 'poll',\n options_attributes: [\n {index: 0, option: ''},\n {index: 1, option: ''}\n ]\n }\n ]\n\n connect() {\n this.stepperController = this.application.getControllerForElementAndIdentifier(document.getElementById('activityCreateComp'), 'stepper')\n if (this.element.dataset.polls && this.element.dataset.polls !== '[]') {\n this.pollQuestions = JSON.parse(this.element.dataset.polls.replaceAll('=>', ':'))\n this.validatePollInputs()\n }\n }\n\n\n addQuestion(event) {\n if(this.validatePollInputs()) return\n\n let currentIndex = this.pollQuestions.length > 0 ? this.pollQuestions[this.pollQuestions.length - 1].index + 1 : 0\n let elem = document.createElement('div')\n elem.innerHTML = questionHtml('poll', 'poll', currentIndex)\n document.getElementById('poll-accordion').appendChild(elem.children[0])\n this.pollQuestions.push(\n {\n index: currentIndex,\n question: '',\n question_type: 'poll',\n options_attributes: [\n {index: 0, option: ''},\n {index: 1, option: ''}\n ]\n }\n )\n document.getElementById('poll_questions_json').value = JSON.stringify(this.pollQuestions)\n this.validatePollInputs()\n }\n\n\n addOption(event) {\n if(this.validatePollInputs()) return\n\n let questionIndex = this.pollQuestions.findIndex(question => question.index === +event.currentTarget.dataset.questionId)\n let currentIndex = this.pollQuestions[questionIndex].options_attributes.length > 0 ? this.pollQuestions[questionIndex].options_attributes[this.pollQuestions[questionIndex].options_attributes.length - 1].index + 1 : 0\n let elem = document.createElement('div')\n elem.innerHTML = optionHtml('poll', 'poll', event.currentTarget.dataset.questionId, currentIndex)\n document.getElementById(`poll-poll-options-${event.currentTarget.dataset.questionId}`).appendChild(elem.children[0])\n this.pollQuestions[questionIndex].options_attributes.push({index: currentIndex, option: ''})\n document.getElementById('poll_questions_json').value = JSON.stringify(this.pollQuestions)\n this.validatePollInputs()\n }\n\n removeOption(event) {\n let questionIndex = this.pollQuestions.findIndex(question => question.index === +event.currentTarget.dataset.questionId)\n let optionIndex = this.pollQuestions[questionIndex].options_attributes.findIndex(option => option.index === +event.currentTarget.dataset.optionId)\n document.getElementById(`pollOptionDiv${event.currentTarget.dataset.questionId}${event.currentTarget.dataset.optionId}`).remove()\n if (this.pollQuestions[questionIndex].options_attributes[optionIndex].id) {\n this.pollQuestions[questionIndex].options_attributes[optionIndex]['_destroy'] = 1\n } else {\n this.pollQuestions[questionIndex].options_attributes.splice(optionIndex, 1)\n this.validatePollInputs()\n }\n document.getElementById('poll_questions_json').value = JSON.stringify(this.pollQuestions)\n }\n\n removeQuestion(event) {\n let questionIndex = this.pollQuestions.findIndex(question => question.index === +event.currentTarget.dataset.questionId)\n document.getElementById(`poll_question${event.currentTarget.dataset.questionId}`).remove()\n if (this.pollQuestions[questionIndex].id) {\n this.pollQuestions[questionIndex]['_destroy'] = 1\n } else {\n this.pollQuestions.splice(questionIndex, 1)\n this.validatePollInputs()\n }\n document.getElementById('poll_questions_json').value = JSON.stringify(this.pollQuestions)\n }\n\n inputQuestion(event) {\n let index = this.pollQuestions.findIndex(question => question.index === +event.currentTarget.dataset.questionId)\n this.pollQuestions[index].question = event.currentTarget.value\n document.getElementById('poll_questions_json').value = JSON.stringify(this.pollQuestions)\n document.getElementById(`poll-desc-${event.currentTarget.dataset.questionId}`).innerText = event.currentTarget.value\n this.validatePollInputs()\n }\n\n inputOption(event) {\n let questionIndex = this.pollQuestions.findIndex(question => question.index === +event.currentTarget.dataset.questionId)\n let optionIndex = this.pollQuestions[questionIndex].options_attributes.findIndex(option => option.index === +event.currentTarget.dataset.optionId)\n this.pollQuestions[questionIndex].options_attributes[optionIndex].option = event.currentTarget.value\n document.getElementById('poll_questions_json').value = JSON.stringify(this.pollQuestions)\n this.validatePollInputs()\n }\n\n validatePollInputs() {\n return this.stepperController.validatePollOptions() && this.stepperController.validatePollQuestions()\n }\n}\n","import {Controller} from 'stimulus';\nimport Cropper from 'cropperjs';\nimport {loadXHR} from \"../services/cropper_service\";\n\nexport default class extends Controller {\n\n connect() {\n if (document.getElementById('profile_upload')) {\n document.getElementById('profile_upload').addEventListener('change', (event) => {\n this.initializeCrop(event)\n });\n }\n }\n\n initializeCrop(event) {\n const image = document.getElementById(`project_image`);\n const file = event.target.files?.[0];\n if (file) {\n if (file.size / 1024 / 1024 > 10) {\n document.getElementById('profile_image_error').removeAttribute('hidden')\n return\n } else {\n document.getElementById('profile_image_error').setAttribute('hidden', true)\n document.getElementById(`profile_cropper`).click();\n }\n document.getElementById('cropper_control').style.display = 'block'\n const url = URL.createObjectURL(file);\n image.src = url;\n image.onload = () => {\n this.cropImage(image);\n };\n }\n }\n\n cropImage(image) {\n let croppedData;\n let aspectHeight = +this.element.dataset.aspectRatioHeight\n let aspectWidth = +this.element.dataset.aspectRatioWidth\n const cropper = new Cropper(image, {\n zoomable: true,\n aspectRatio: aspectWidth / aspectHeight,\n viewMode: 1,\n crop(event) {\n croppedData = {\n width: event.detail.width,\n height: event.detail.height\n };\n },\n ready() {\n document.getElementById(`crop-btn`).addEventListener('click', (evt) => {\n evt.preventDefault()\n const canvas = cropper.getCroppedCanvas();\n const image = document.getElementById(`project_image`);\n image.src = canvas.toDataURL();\n image.onload = () => {\n cropper.destroy();\n document.getElementById('cropper_control').style.display = 'none'\n document.getElementById('cropper_done').removeAttribute('disabled')\n };\n });\n document.getElementById(`rotate-btn`).addEventListener('click', (evt) => {\n evt.preventDefault()\n cropper.rotate(90);\n });\n document.getElementById(`cancel-btn`).addEventListener('click', (event) => {\n event.preventDefault()\n cropper.destroy();\n });\n },\n });\n }\n\n saveImage(event) {\n event.preventDefault()\n const imgEl = document.getElementById('project_image');\n const imgUrl = imgEl.src;\n loadXHR(imgUrl).then((imgBlob) => {\n imgBlob.filename = `new_name_secure.${imgBlob.type.split('/')[1]}`\n let data = new FormData()\n data.append('profile[picture]', imgBlob)\n data.append('profile[user_id]', this.element.dataset.userId)\n fetch('/admin/users/update_profile_picture', {\n method: 'post',\n body: data,\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if (response.ok) {\n response.json().then(value => {\n document.getElementById('profile_image').src = value.url\n if (document.getElementById('navbar_profile_image')) {\n document.getElementById('navbar_profile_image').src = value.url\n }\n });\n }\n })\n });\n }\n}\n","import {Controller} from 'stimulus';\nimport Chart from 'chart.js/auto';\n\nexport default class extends Controller {\n\n connect() {\n let data = JSON.parse(this.element.dataset.chartData)\n let pollData = [\n {\n data: {\n datasets: [{\n label: 'Data',\n data: data,\n backgroundColor: [\n 'rgb(242, 179, 15)',\n 'rgb(256, 256, 256)',\n 'rgb(256, 256, 256)'\n ],\n hoverOffset: 3,\n borderWidth: 0.2,\n weight: 0.01\n }]\n },\n chart: 'project-graph-1'\n },\n {\n data: {\n datasets: [{\n label: 'Data',\n data: data,\n backgroundColor: [\n 'rgb(256, 256, 256)',\n 'rgb(10, 172, 165)',\n 'rgb(256, 256, 256)'\n ],\n hoverOffset: 3,\n borderWidth: 0.2,\n weight: 0.01\n }]\n },\n chart: 'project-graph-2'\n },\n {\n data: {\n datasets: [{\n label: 'Data',\n data: data,\n backgroundColor: [\n 'rgb(256, 256, 256)',\n 'rgb(256, 256, 256)',\n 'rgb(123, 104, 238)'\n ],\n hoverOffset: 3,\n borderWidth: 0.2,\n weight: 0.01\n }]\n },\n chart: 'project-graph-3'\n }\n\n ]\n\n const count = this.element.dataset.count;\n pollData.forEach(element => {\n let chart = element.chart;\n const myChart = new Chart(chart, {\n type: 'doughnut',\n data: element.data,\n options: {\n plugins: {\n legend: {\n display: false\n },\n\n },\n cutout: '70%',\n },\n });\n });\n\n\n }\n\n\n generateReport() {\n const element = document.getElementById('project-chart-content').cloneNode(true);\n let graphs = element.getElementsByTagName('canvas');\n let images = [];\n let temp;\n let graphCallback = replaceGraphs();\n\n const opt = {\n margin: 1,\n filename: 'myfile.pdf',\n image: {type: 'jpeg', quality: 1},\n html2canvas: {scale: 2},\n pagebreak: {mode: 'avoid-all'},\n jsPDF: {unit: 'pt', format: 'a4', orientation: 'portrait', precision: '12'},\n };\n\n function replaceGraphs() {\n graphs = [].slice.call(graphs);\n for (let i = 0; i < graphs.length; i++) {\n images.push(document.createElement('img'));\n images[i].src = document.getElementsByTagName('canvas')[i].toDataURL();\n graphs[i].parentElement.replaceChild(images[i], graphs[i]);\n }\n html2pdf().set(opt).from(element).save();\n }\n\n }\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n connect(){\n }\n enableAnomy(evt){\n evt.currentTarget.checked ? document.getElementById('project-config-anomy').classList.replace('hidden', 'block'): document.getElementById('project-config-anomy').classList.replace('block','hidden');\n }\n}","import { Controller } from \"stimulus\";\nimport Quill from \"quill\";\n\nexport default class extends Controller {\n quill;\n toolbarOptions = [\n [{ header: [1, 2, 3, 4, 5, 6, false] }],\n [\"bold\", \"italic\", \"underline\"],\n [\"link\"],\n [{ list: \"ordered\" }, { list: \"bullet\" }],\n ];\n connect() {\n let existingData = this.element.dataset.description;\n this.quill = new Quill(\"#project_description_editor\", {\n theme: \"snow\",\n modules: {\n toolbar: this.toolbarOptions,\n },\n });\n if (existingData) {\n let element = document.createElement(\"div\");\n element.innerHTML = existingData;\n this.quill.root.innerHTML = element.children[0].innerHTML;\n }\n let _this = this;\n this.quill.on(\"text-change\", function () {\n _this.setValue();\n });\n }\n\n setValue() {\n if (document.getElementById(this.element.dataset.valueId)) {\n document.getElementById(\n this.element.dataset.valueId\n ).value = `
${this.quill.root.innerHTML}
`;\n }\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n adminsList = JSON.parse(this.element.dataset.admins)\n queryParams = {\n q: '',\n page: 1,\n admins: [],\n status: 'all',\n active_tab: ''\n }\n\n enterPressed(event) {\n // if (event.key === 'Enter') {\n // this.queryParams.q = event.currentTarget.value\n // this.runQuery()\n // } else {\n // this.queryParams.q = event.currentTarget.value\n // }\n\n clearTimeout(this.timeout)\n let _this = this\n this.timeout = setTimeout(() => {\n _this.queryParams.q = document.getElementById('search_project').value;\n if (document.getElementById('user_project_list_tab')) {\n _this.queryParams.active_tab = document.getElementById('user_project_list_tab').querySelector('.active').dataset.tab;\n }\n this.runQuery();\n }, 200)\n }\n\n searchIconPressed(event) {\n if (document.getElementById(event.currentTarget.dataset.valueId)) {\n this.queryParams.q = document.getElementById(event.currentTarget.dataset.valueId).value\n }\n this.runQuery()\n }\n\n adminSelected(event) {\n if (event.currentTarget.checked) {\n this.queryParams.admins.push(+event.currentTarget.dataset.value)\n } else {\n this.queryParams.admins = this.queryParams.admins.filter(function (value, index, array) {\n return value !== +event.currentTarget.dataset.value\n })\n }\n }\n\n statusSelected(event) {\n if (event.currentTarget.checked) {\n this.queryParams.status = event.currentTarget.dataset.value\n } else {\n this.queryParams.status = 'all'\n }\n this.runQuery()\n }\n\n paginate(event) {\n this.queryParams.page = +event.currentTarget.dataset.page || 1\n this.runQuery()\n }\n\n searchAdmin(event) {\n let searchValue = event.currentTarget.value;\n let result = []\n this.adminsList.filter((v, i) => {\n let value = v.name\n if (value.toLowerCase().includes(searchValue.toLowerCase())) {\n if (document.getElementById(`admin_${v.ref_id}`)) {\n document.getElementById(`admin_${v.ref_id}`).style.display = \"block\"\n result.push(v.ref_id)\n }\n } else {\n if (document.getElementById(`admin_${v.ref_id}`))\n document.getElementById(`admin_${v.ref_id}`).style.display = \"none\"\n }\n })\n }\n\n getAdmins() {\n let str = '&admins[]='\n let admins = this.queryParams.admins\n if (admins.length === 0) {\n return ''\n }\n for (let i = 0; i < admins.length; i++) {\n str += (admins.length - 1) === i ? +admins[i] : `${+admins[i]}&admins[]=`\n }\n return str\n }\n\n runQuery(event) {\n let url = `/projects/list/filter?q=${this.queryParams.q}&page=${this.queryParams.page}&status=${this.queryParams.status}${this.getAdmins()}&active_tab=${this.queryParams.active_tab}`\n fetch(url).then(response => {\n response.text().then(text => {\n let vDom = document.createElement('div')\n vDom.innerHTML = text\n if (document.getElementById('project_list')) {\n document.getElementById('project_list').replaceWith(vDom.children[0])\n } else {\n document.getElementById('user_project_list').replaceWith(vDom.children[0])\n }\n })\n })\n }\n\n clearFilter(event) {\n this.queryParams.admins.forEach(admin => {\n if (document.getElementById(`admin_checkbox_${admin}`)) {\n document.getElementById(`admin_checkbox_${admin}`).checked = false\n }\n })\n this.queryParams.admins = []\n this.runQuery()\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n reset(event) {\n event.currentTarget.reset();\n }\n\n editComment(event) {\n let id = event.currentTarget.dataset.id\n document.getElementById(`proposal-comment-edit_${id}`).style.display = 'block';\n document.getElementById(`proposal-comment-content_${id}`).style.display = 'none';\n }\n\n reply(event) {\n let elem = document.getElementById(`proposal_reply_${event.currentTarget.dataset.id}`)\n if (elem) {\n elem.style.display = elem.style.display === 'block' ? 'none' : 'block';\n }\n }\n}\n","import {Controller} from 'stimulus'\nimport Quill from 'quill'\n\nexport default class extends Controller {\n quill\n toolbarOptions = [\n [{ header: [1, 2, 3, 4, 5, 6, false] }],\n [\"bold\", \"italic\", \"underline\"],\n [\"link\"],\n [{ list: \"ordered\" }, { list: \"bullet\" }],\n ];\n\n connect() {\n let existingData = this.element.dataset.value\n this.quill = new Quill('#proposal_description_editor', {\n theme: 'snow',\n modules: {\n toolbar: this.toolbarOptions,\n },\n });\n if (existingData) {\n let element = document.createElement('div')\n element.innerHTML = existingData\n this.quill.root.innerHTML = element.children[0].innerHTML\n }\n let _this = this\n this.quill.on('text-change', function () {\n _this.setValue()\n })\n }\n\n setValue() {\n if (document.getElementById(this.element.dataset.valueId)) {\n document.getElementById(this.element.dataset.valueId).value = `
${this.quill.root.innerHTML}
`\n }\n let form = document.getElementById('create_proposal_form')\n let formData = new FormData(form);\n if (formData.get('proposal[description]').replace(/<\\/?(\"[^\"]*\"|'[^']*'|[^>])*(>|$)/g, \"\").length > 5) {\n document.getElementById('proposal_description_errors').setAttribute('hidden', true)\n }\n }\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n voted() {\n ['proposal_vote_phone', 'proposal_vote_web'].forEach(id => {\n document.getElementById(id).setAttribute('disabled', true)\n })\n }\n}","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n tags = []\n\n statusSelected(event) {\n if (event.currentTarget.checked) {\n if (document.getElementById('status_value')) {\n document.getElementById('status_value').value = event.currentTarget.dataset.value\n }\n document.getElementById('proposal_filter_form').dispatchEvent(new CustomEvent('submit', {bubbles: true}))\n }\n }\n\n queryEntered(event) {\n document.getElementById('proposal_filter_form').dispatchEvent(new CustomEvent('submit', {bubbles: true}))\n }\n\n searchIconPressed() {\n document.getElementById('proposal_filter_form').dispatchEvent(new CustomEvent('submit', {bubbles: true}))\n }\n\n toggleOwner(event) {\n let form = document.getElementById('proposal_filter_form')\n document.getElementById('owner_value').value = event.currentTarget.dataset.value\n form.dispatchEvent(new CustomEvent('submit', {bubbles: true}))\n }\n\n paginate(event) {\n document.getElementById('proposal_page').value = event.currentTarget.dataset.page\n document.getElementById('proposal_filter_form').dispatchEvent(new CustomEvent('submit', {bubbles: true}))\n }\n\n tagSelected(event) {\n if (event.currentTarget.checked) {\n this.tags.push(event.currentTarget.dataset.key)\n } else {\n let index = this.tags.indexOf(event.currentTarget.dataset.key);\n this.tags.splice(index, 1);\n }\n document.querySelectorAll('#tag_filter').forEach(tag => {\n tag.value = JSON.stringify(this.tags)\n })\n document.getElementById('proposal_filter_form').dispatchEvent(new CustomEvent('submit', {bubbles: true}))\n }\n}","import {Controller} from 'stimulus'\nimport {btnSpinnerAndDisable} from \"../services/btn-disable-loader_service\";\n\nexport default class extends Controller {\n preview(event) {\n event.preventDefault();\n let form = document.getElementById('create_proposal_form')\n const formData = new FormData(form);\n formData.set('_method', 'post');\n fetch('/proposals_preview',\n {\n method: \"POST\",\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n },\n body: formData\n }).then(response => {\n response.text().then(text => {\n let element = document.createElement('div');\n element.innerHTML = text;\n document.getElementById('proposal_creation_preview').replaceWith(element.children[0]);\n })\n })\n event.preventDefault();\n }\n\n validateTitle() {\n let form = document.getElementById('create_proposal_form')\n let formData = new FormData(form);\n if (formData.get('proposal[title]').length > 3) {\n document.getElementById('proposal_title_errors').setAttribute('hidden', true)\n }\n }\n\n validate(event) {\n let form = document.getElementById('create_proposal_form')\n let formData = new FormData(form);\n let valid = formData.get('proposal[title]').length > 3 && formData.get('proposal[description]').replace(/<\\/?(\"[^\"]*\"|'[^']*'|[^>])*(>|$)/g, \"\").length > 5 && formData.get('proposal[tags][]').length >= 5\n if (formData.get('proposal[title]').length > 3) {\n document.getElementById('proposal_title_errors').setAttribute('hidden', true)\n } else {\n document.getElementById('proposal_title_errors').removeAttribute('hidden')\n }\n if (formData.get('proposal[description]').replace(/<\\/?(\"[^\"]*\"|'[^']*'|[^>])*(>|$)/g, \"\").length > 5) {\n document.getElementById('proposal_description_errors').setAttribute('hidden', true)\n } else {\n document.getElementById('proposal_description_errors').removeAttribute('hidden')\n }\n if (formData.get('proposal[tags][]').length >= 5) {\n document.getElementById('proposal_tag_errors').setAttribute('hidden', true)\n } else {\n document.getElementById('proposal_tag_errors').removeAttribute('hidden')\n }\n if (valid) {\n if (event.currentTarget.dataset.showModal === 'true') {\n document.getElementById('proposal-submit-button').click()\n }\n }\n }\n\n saveAsDraft(event) {\n btnSpinnerAndDisable(event);\n }\n}\n","import {Controller} from 'stimulus';\n\nexport default class extends Controller {\n tags = []\n\n connect() {\n if (this.element.dataset.value) {\n let existingTags = JSON.parse(this.element.dataset.value)\n if (existingTags) {\n this.tags = existingTags\n document.getElementById('tag_param').value = JSON.stringify(this.tags)\n existingTags.forEach(tag => {\n document.getElementById(`tag_${tag}`).classList.add('!bg-light-primary/[0.1]')\n document.getElementById(`close_tag_${tag}`).classList.remove('!hidden')\n })\n }\n }\n }\n\n selectTag(event) {\n if (!this.tags.includes(event.currentTarget.dataset.id)) {\n this.tags.push(event.currentTarget.dataset.id)\n }\n event.currentTarget.classList.add('!bg-light-primary/[0.1]')\n document.getElementById(`close_tag_${event.currentTarget.dataset.id}`).classList.remove('!hidden')\n document.getElementById('tag_param').value = JSON.stringify(this.tags)\n let form = document.getElementById('create_proposal_form')\n let formData = new FormData(form);\n if (formData.get('proposal[tags][]').length >= 5) {\n document.getElementById('proposal_tag_errors').setAttribute('hidden', true)\n }\n }\n\n removeTag(event) {\n event.preventDefault()\n event.stopImmediatePropagation()\n this.tags = this.tags.filter(tag => tag !== event.currentTarget.dataset.id)\n event.currentTarget.classList.add('!hidden')\n document.getElementById(`tag_${event.currentTarget.dataset.id}`).classList.remove('!bg-light-primary/[0.1]')\n document.getElementById('tag_param').value = JSON.stringify(this.tags)\n }\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n static targets = ['radio'];\n state = {\n old: '',\n new: ''\n }\n\n connect() {\n this.state.new = this.element.dataset.type\n this.state.old = this.element.dataset.type\n if (document.getElementById('activity_type')) {\n document.getElementById('activity_type').value = this.element.dataset.type;\n }\n\n this.element.querySelectorAll('.un-radio-chip').forEach(el => {\n el.addEventListener('click', evt => {\n this.element.querySelectorAll('.un-radio-chip').forEach(el => {\n let clickId = evt.currentTarget.dataset.id;\n let elementId = el.dataset.id;\n el.querySelector(`.un-radio-chip__input-${elementId}`).checked = clickId === elementId;\n let id = el.dataset.id;\n\n if (el.querySelector(`.un-radio-chip__input-${id}`).checked) {\n el.classList.add('!text-primary', '!border-primary');\n\n } else {\n el.classList.remove('!text-primary', '!border-primary')\n el.classList.add('text-gray-700', 'border-gray-400')\n }\n });\n })\n });\n }\n\n activityName(evt) {\n let activityField = document.getElementById('activity_name_field');\n evt.currentTarget.dataset.id === 'conversation' ? activityField.innerText = 'Seed Question' : activityField.innerText = 'Activity Name';\n\n if (document.getElementById('activity_type')) {\n const id = evt.currentTarget.dataset.id;\n this.state.old = this.state.new || id;\n this.state.new = id;\n document.getElementById('activity_type').value = id;\n }\n\n }\n}","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n connect() {\n window.location.href = this.element.dataset.path;\n }\n}","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n reset() {\n this.element.reset()\n }\n}","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n adminsList = JSON.parse(this.element.dataset.admins)\n type = this.element.dataset.type\n\n setValue(event) {\n let data = event.currentTarget.dataset\n let display = document.getElementById(data.displayId)\n let value = document.getElementById(data.valueId)\n display.value = data.display\n value.value = JSON.stringify([data.value])\n }\n\n searchAdmin(event) {\n let searchValue = event.currentTarget.value;\n let result = []\n let menuDom = document.getElementById(`admins_dom_${this.type}`)\n let adminDom = document.getElementById(`admins_menu_${this.type}`)\n this.adminsList.filter((v, i) => {\n let value = v.name\n if (value.toLowerCase().includes(searchValue.toLowerCase())) {\n if (document.getElementById(`${this.type}_admin_list_${v.ref_id}`)) {\n document.getElementById(`${this.type}_admin_list_${v.ref_id}`).style.display = \"block\"\n result.push(v.ref_id)\n }\n } else {\n if (document.getElementById(`${this.type}_admin_list_${v.ref_id}`))\n document.getElementById(`${this.type}_admin_list_${v.ref_id}`).style.display = \"none\"\n }\n })\n if (menuDom) {\n if (result.length < 1) {\n adminDom.classList.contains('show') ? adminDom.classList.remove('show') : null\n menuDom.classList.contains('show') ? menuDom.classList.remove('show') : null\n } else {\n adminDom.classList.contains('show') ? null : adminDom.classList.add('show')\n menuDom.classList.contains('show') ? null : menuDom.classList.add('show')\n }\n }\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n logOut() {\n fetch(`/users/sign_out`, {\n method: 'DELETE',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then(response => {\n if(response.ok) window.location.href = '/users/sign_in'\n })\n }\n}\n","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n connect() {\n if (!(this.element.dataset.type === 'keep_success')) {\n setTimeout(closeSnackbar, 10000);\n\n function closeSnackbar() {\n document.getElementById(\"close_snackbar\").click()\n }\n }\n }\n\n close() {\n document.getElementById('snackbar').classList.add('hidden')\n }\n}","import {Controller} from \"stimulus\";\n\nexport default class extends Controller {\n connect() {\n const btn = document.getElementById('modal-sso-term');\n btn.click();\n }\n\n agreeToTermsOfService(){\n const id = this.element.dataset.userId\n fetch(`/users/update_terms_of_service/${id}`,{\n method: 'put',\n headers: {\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }\n })\n }\n}\n","import {Controller} from \"stimulus\";\n\nimport flatpickr from \"flatpickr\";\n\nexport default class extends Controller {\n static targets = ['field', 'dateLabel']\n\n connect() {\n flatpickr(\"#start_date\", {\n dateFormat: \"d.m.Y\",\n allowInput: true,\n minDate: this.element.dataset.minDate || 'today',\n disableMobile: true\n });\n }\n\n changeStartDate(event) {\n let endDateController = this.application.getControllerForElementAndIdentifier(document.getElementById('end_date_element'), 'end-date-time-picker')\n if (endDateController.fp) {\n endDateController.fp.set('minDate', event.target.value);\n }\n }\n}\n","import {Controller} from 'stimulus'\nimport {btnSpinnerAndDisable} from \"../services/btn-disable-loader_service\";\n\nexport default class extends Controller {\n static targets = ['pollOption', 'pollOptErrorLabel', 'pollQuestion', 'pollQueErrorLabel', 'additionalInput', 'additionalInputErrorLabel', 'seedResp', 'seedRespErrorLabel', 'nextBtn', 'activityCreateBtn']\n\n state = {\n allOptionValid: true,\n allQuestionValid: true,\n allAdditionalInputValid: true,\n allSeedResponseValid: true\n }\n\n connect() {\n const nextButton1 = document.getElementById(\"un-stepper-next-1\");\n const previousButton = document.getElementById(\"un-stepper-previous\");\n const nextButton = document.getElementById('un-stepper-next');\n const prevButton2 = document.getElementById('un-stepper-next-2');\n const step1 = document.querySelector('.un-stepper__step-1');\n const step2 = document.querySelector('.un-stepper__step-2');\n const step3 = document.querySelector('.un-stepper__step-3');\n const stepperAccordionHeaderText = document.querySelector('.un-stepper__accordion-header-text');\n const stepperAccordionCollapse = document.querySelector('.accordion-collapse');\n const stepperLine = document.querySelectorAll('.un-stepper__step');\n const doneButton = document.getElementById('un-btn-done');\n\n function setHeaderText(event) {\n stepperAccordionHeaderText.innerText = event.target.lastElementChild.innerText;\n }\n\n window.addEventListener('click', function(e) {\n let screenSize = screen.width;\n screenSize < 1024 ? stepperAccordionCollapse.classList.remove('show') : '';\n });\n\n step1.addEventListener('click', (e) => {\n stepperLine[0].style.setProperty('--activeColor', '#60AA50')\n showStepper(1, 2, 3);\n setHeaderText(e);\n doneButton.classList.add('hidden');\n });\n\n step2.addEventListener('click', (e) => {\n stepperLine[1].style.setProperty('--activeColor', '#60AA50')\n showStepper(2, 1, 3)\n setHeaderText(e);\n doneButton.classList.add('hidden');\n });\n\n step3.addEventListener('click', (e) => {\n showStepper(3, 1, 2);\n setHeaderText(e);\n doneButton.classList.remove('hidden');\n });\n\n nextButton1.addEventListener('click', function (e) {\n e.preventDefault();\n goToNextStep(1, 2);\n stepperLine[0].style.setProperty('--activeColor', '#60AA50')\n document.documentElement.scrollTop = 0\n });\n\n nextButton.addEventListener('click', function (e) {\n e.preventDefault();\n goToNextStep(2, 3);\n stepperLine[1].style.setProperty('--activeColor', '#60AA50')\n document.documentElement.scrollTop = 0\n });\n\n previousButton.addEventListener('click', function (e) {\n e.preventDefault();\n goToNextStep(2, 1);\n stepperLine[1].style.setProperty('--activeColor', '#E0E0E0')\n document.documentElement.scrollTop = 0\n });\n\n prevButton2.addEventListener('click', function (e) {\n e.preventDefault();\n goToNextStep(3, 2);\n stepperLine[0].style.setProperty('--activeColor', '#E0E0E0')\n })\n\n function goToNextStep(stepPrev, stepNext) {\n const prevForm = document.querySelector(`.un-stepper__list-${stepPrev}`);\n const nextForm = document.querySelector(`.un-stepper__list-${stepNext}`);\n const nextStep = document.querySelector(`.un-stepper__step-${stepNext}`);\n const prevStep = document.querySelector(`.un-stepper__step-${stepPrev}`);\n const activeIcon = document.querySelector(`.stepper-step__icon--${stepNext}`)\n const inactiveIcon = document.querySelector(`.stepper-step__icon--${stepPrev}`);\n const activeStep = inactiveIcon.parentElement;\n\n nextForm.classList.add('un-stepper__list--active');\n prevForm.classList.remove('un-stepper__list--active');\n\n prevStep.classList.remove('un-stepper__step--active');\n nextStep.classList.add('un-stepper__step--active');\n\n activeStep.classList.remove('bg-gray-500');\n activeStep.classList.add('bg-primary');\n activeIcon.textContent = 'edit';\n inactiveIcon.textContent = 'done'\n\n if(stepNext === 3) {\n doneButton.classList.remove('hidden');\n }\n }\n\n function showStepper(step1, step2, step3) {\n const stepper1 = document.querySelector(`.un-stepper__list-${step1}`);\n const stepper2 = document.querySelector(`.un-stepper__list-${step2}`);\n const stepper3 = document.querySelector(`.un-stepper__list-${step3}`);\n const stepperIcon = document.querySelector(`.stepper-step__icon--${step1}`);\n const stepperActiveColor = stepperIcon.parentElement;\n\n stepper1.classList.add('un-stepper__list--active');\n stepper2.classList.remove('un-stepper__list--active');\n stepper3.classList.remove('un-stepper__list--active');\n\n stepperIcon.textContent = 'done';\n stepperActiveColor.classList.remove('bg-gray-500');\n stepperActiveColor.classList.add('bg-primary');\n }\n }\n\n validatePollOptions() {\n const pollOptionsValidity = [...this.pollOptionTargets].map((pollOption, index) => {\n const optionValueIsEmpty = !pollOption.value\n this.pollOptErrorLabelTargets[index].hidden = !optionValueIsEmpty\n return !optionValueIsEmpty\n })\n\n this.state.allOptionValid = !pollOptionsValidity.includes(false)\n this.disableNextBtn()\n\n return pollOptionsValidity.includes(false)\n }\n\n validatePollQuestions() {\n const pollQuestionsValidity = [...this.pollQuestionTargets].map((pollQuestion, index) => {\n const questionIsEmpty = !pollQuestion.value\n this.pollQueErrorLabelTargets[index].hidden = !questionIsEmpty\n return !questionIsEmpty\n })\n\n this.state.allQuestionValid = !pollQuestionsValidity.includes(false)\n this.disableNextBtn()\n\n return pollQuestionsValidity.includes(false)\n }\n\n disableNextBtn() {\n this.nextBtnTarget.disabled = !(this.state.allOptionValid === true && this.state.allQuestionValid === true);\n }\n\n validateAdditionalInputs() {\n const additionalInputsValidity = [...this.additionalInputTargets].map((additionalInput, index) => {\n const additionalInputIsEmpty = !additionalInput.value\n this.additionalInputErrorLabelTargets[index].hidden = !additionalInputIsEmpty\n return !additionalInputIsEmpty\n })\n\n this.state.allAdditionalInputValid = !additionalInputsValidity.includes(false)\n\n console.log(`vals => ${additionalInputsValidity}`)\n console.log(`state => ${this.state.allAdditionalInputValid}`)\n console.log(`btn disabled => ${!this.state.allAdditionalInputValid}`)\n\n this.activityCreateBtnTarget.disabled = !this.state.allAdditionalInputValid;\n\n return additionalInputsValidity.includes(false)\n }\n\n validateSeedResponses() {\n const seedResponseValidity = [...this.seedRespTargets].map((seedResp, index) => {\n const seedRespIsEmpty = !seedResp.value\n this.seedRespErrorLabelTargets[index].hidden = !seedRespIsEmpty\n return !seedRespIsEmpty\n })\n\n this.state.allSeedResponseValid = !seedResponseValidity.includes(false)\n\n console.log(`vals => ${seedResponseValidity}`)\n console.log(`state => ${this.state.allSeedResponseValid}`)\n console.log(`btn disabled => ${!this.state.allSeedResponseValid}`)\n\n this.nextBtnTarget.disabled = !this.state.allSeedResponseValid;\n\n return seedResponseValidity.includes(false)\n }\n\n saveAsDraft(e) {\n btnSpinnerAndDisable(e);\n }\n\n createOrUpdateComponent(e) {\n btnSpinnerAndDisable(e);\n }\n}\n","import {Controller} from 'stimulus'\n\nexport default class extends Controller {\n queryParams = {\n query: '',\n page: 1,\n roles: [],\n statuses: [],\n steps: []\n }\n\n enterPressed(event) {\n if (event.key === 'Enter') {\n this.queryParams.query = event.currentTarget.value\n this.runQuery()\n } else {\n this.queryParams.query = event.currentTarget.value\n }\n }\n\n searchIconPressed(event) {\n if (document.getElementById(event.currentTarget.dataset.valueId)) {\n this.queryParams.query = document.getElementById(event.currentTarget.dataset.valueId).value\n }\n this.runQuery()\n }\n\n roleSelected(event) {\n if (event.currentTarget.checked) {\n this.queryParams.roles.push(+event.currentTarget.dataset.value)\n } else {\n this.queryParams.roles = this.queryParams.roles.filter(function (value, index, array) {\n return value !== +event.currentTarget.dataset.value\n })\n }\n }\n\n statusSelected(event) {\n if (event.currentTarget.checked) {\n this.queryParams.statuses.push(event.currentTarget.dataset.value)\n } else {\n this.queryParams.statuses = this.queryParams.statuses.filter(function (value, index, array) {\n return value !== event.currentTarget.dataset.value\n })\n }\n }\n\n stepSelected(event) {\n if (event.currentTarget.checked) {\n this.queryParams.steps.push(event.currentTarget.dataset.value)\n } else {\n this.queryParams.steps = this.queryParams.steps.filter(function (value, index, array) {\n return value !== event.currentTarget.dataset.value\n })\n }\n }\n\n getRoles() {\n let str = '&roles[]='\n let roles = this.queryParams.roles\n if (roles.length === 0) {\n return ''\n }\n for (let i = 0; i < roles.length; i++) {\n str += (roles.length - 1) === i ? +roles[i] : `${+roles[i]}&roles[]=`\n }\n return str\n }\n\n getStatuses() {\n let str = '&statuses[]='\n let statuses = this.queryParams.statuses\n\n if (statuses.length === 0) {\n return ''\n }\n for (let i = 0; i < statuses.length; i++) {\n str += (statuses.length - 1) === i ? statuses[i] : `${statuses[i]}&statuses[]=`\n }\n return str\n }\n\n getSteps() {\n let str = '&steps[]='\n let steps = this.queryParams.steps\n if (steps.length === 0) {\n return ''\n }\n for (let i = 0; i < steps.length; i++) {\n str += (steps.length - 1) === i ? steps[i] : `${steps[i]}&steps[]=`\n }\n return str\n }\n\n runQuery(event) {\n let url = `/admin/users/list/filter?query=${this.queryParams.query}&page=${this.queryParams.page}${this.getStatuses()}${this.getSteps()}${this.getRoles()}`\n fetch(url).then(response => {\n response.text().then(text => {\n let vDom = document.createElement('div')\n vDom.innerHTML = text\n if (document.getElementById('user_list')) {\n document.getElementById('user_list').replaceWith(vDom.children[0])\n }\n })\n })\n if (document.getElementById('bulk-delete-header')) {\n document.getElementById('bulk-delete-header').setAttribute('hidden', 'true')\n let bulkController = this.application.getControllerForElementAndIdentifier(document.getElementById('user_list_element'), 'bulk-delete-user')\n if (bulkController && bulkController.selectedUsers) {\n bulkController.selectedUsers = []\n }\n }\n }\n\n clearFilter(event) {\n this.queryParams.roles.forEach(role => {\n if (document.getElementById(`role_${role}`)) {\n document.getElementById(`role_${role}`).checked = false\n }\n })\n this.queryParams.statuses.forEach(status => {\n if (document.getElementById(status)) {\n document.getElementById(status).checked = false\n }\n })\n this.queryParams.steps.forEach(step => {\n if (document.getElementById(step)) {\n document.getElementById(step).checked = false\n }\n })\n this.queryParams.roles = []\n this.queryParams.statuses = []\n this.queryParams.steps = []\n this.runQuery()\n }\n}\n","import {Controller} from 'stimulus';\nimport Chart from 'chart.js/auto';\nimport {configMapper} from \"../services/graph_service\";\n\nexport default class extends Controller {\n\n connect() {\n const data = {\n datasets: [{\n data: JSON.parse(this.element.dataset.graphData),\n backgroundColor: [\n 'rgb(123, 104, 238)'\n ],\n borderWidth: 1\n }]\n };\n let chart = 'votes-graph';\n const myChart = new Chart(chart, {\n type: 'bar',\n data: data,\n options: {\n plugins: {\n legend: {\n display: false\n }\n },\n scales: {\n x: configMapper(this.element.dataset.type, this.element.dataset.week),\n y: {\n title: {\n display: true,\n text: 'Votes Count'\n },\n beginAtZero: true\n }\n }\n }\n }\n );\n }\n\n generateReport() {\n const element = document.getElementById('vote-chart-content').cloneNode(true);\n let graphs = element.getElementsByTagName('canvas');\n let graphCallback = replaceGraphs();\n\n const opt = {\n margin: 1,\n filename: 'vote.pdf',\n image: {type: 'jpeg', quality: 1},\n html2canvas: {scale: 2},\n pagebreak: {mode: 'avoid-all'},\n jsPDF: {unit: 'pt', format: 'a4', orientation: 'portrait', precision: '12'},\n };\n\n function replaceGraphs() {\n const image = document.createElement('img');\n image.src = document.getElementById('votes-graph').toDataURL();\n graphs[0].parentElement.replaceChild(image, graphs[0]);\n html2pdf().set(opt).from(element).save();\n }\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.\nimport \"./stylesheets/application.tailwind.scss\"\n\nimport Rails from \"@rails/ujs\"\nimport * as ActiveStorage from \"@rails/activestorage\"\nimport \"@hotwired/turbo-rails\"\n\nRails.start();\nActiveStorage.start();\n\nimport \"controllers\"\nimport \"tw-elements\"\n","// extracted by mini-css-extract-plugin","export const additionalQuestionHtml = function (type, controller, index) {\n return `
\n
\n \n
\n
\n
\n
\n

Answer Options

\n
\n
\n
\n
\n \n \n
\n ${controller}#removeOption\"\n data-question-id=\"${index}\"\n data-option-id=\"0\">close\n
\n
\n
\n
\n \n \n
\n ${controller}#removeOption\"\n data-question-id=\"${index}\"\n data-option-id=\"1\">close\n
\n
\n \n
\n
\n
\n
`\n}\n\nexport const additionalOptionHtml = function (type, controller, questionIndex, optionIndex) {\n return `
\n
\n
\n \n \n
\n ${controller}#removeOption\"\n data-question-id=\"${questionIndex}\"\n data-option-id=\"${optionIndex}\">close\n
`\n}\n","export const btnSpinnerAndDisable = (event) => {\n event.target.disabled = true\n event.target.innerHTML = `
\n
\n Loading...\n
\n
`\n\n document.getElementById(event.target.dataset.btnId).click();\n};\n","export const loadXHR = function (url) {\n return new Promise(function (resolve, reject) {\n try {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n xhr.responseType = \"blob\";\n xhr.onerror = function () {\n reject(\"Network error.\")\n };\n xhr.onload = function () {\n if (xhr.status === 200) {\n resolve(xhr.response)\n } else {\n reject(\"Loading error:\" + xhr.statusText)\n }\n };\n xhr.send();\n } catch (err) {\n reject(err.message)\n }\n });\n}\n","export const configMapper = function (time, week) {\n let data = {}\n switch (time) {\n case 'year':\n data = {\n title: {\n display: true,\n text: 'Months'\n },\n type: 'time',\n time: {\n round: 'month',\n unit: 'month',\n displayFormats: {\n month: 'MMM'\n }\n },\n grid: {\n display: false\n }\n }\n break;\n case 'month':\n data = {\n title: {\n display: true,\n text: 'Weeks'\n },\n grid: {\n display: false\n }\n }\n break;\n case 'week':\n data = {\n title: {\n display: true,\n text: week\n },\n grid: {\n display: false\n }\n }\n break;\n case 'day':\n data = {\n title: {\n display: true,\n text: 'Hours'\n },\n grid: {\n display: false\n }\n }\n break;\n default:\n data = {}\n }\n return data\n}","export const projectStatusMenu = function (props) {\n return `\n ${props.statuses.map(status => `\n \n
\n
${capitalizeFirstLetter(status)}
\n
\n
\n `).join('')}\n `\n\n function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n}\n","export const questionHtml = function (type, controller, index) {\n return `
\n
\n \n
\n
\n
\n
\n

Answer Options

\n
\n
\n
\n
\n \n \n
\n ${controller}#removeOption\"\n data-question-id=\"${index}\"\n data-option-id=\"0\">close\n
\n
\n
\n
\n \n \n
\n ${controller}#removeOption\"\n data-question-id=\"${index}\"\n data-option-id=\"1\">close\n
\n
\n \n
\n
\n
\n
`\n}\n\nexport const optionHtml = function (type, controller, questionIndex, optionIndex) {\n return `
\n
\n
\n \n \n
\n ${controller}#removeOption\"\n data-question-id=\"${questionIndex}\"\n data-option-id=\"${optionIndex}\">close\n
`\n}\n","export const overlayLoader = () => {\n document.getElementById('screen-loader').click();\n};\n\nexport const disposeOverlayLoader= () => {\n document.getElementById('screen-overlay-disposer').click();\n}\n\n","export const popSnackbar = (type, msg) => {\n document.getElementById('flash').innerHTML = `
\n
\n
\n ${msg}\n
\n snackbar#close\">\n close\n
\n
\n`;\n};\n\n","export const setPositions = function (chart, chartId, tooltipEl, tooltip) {\n const tooltipWidth = document.getElementById(chartId).clientWidth;\n const chartWidth = chart.chartArea.width;\n\n const {offsetLeft: positionX, offsetTop: positionY} = chart.canvas;\n\n// Display, position, and set styles for font\n const pixelDiff = chartWidth - tooltipLeft;\n\n const tooltipLeft = positionX + tooltip.caretX\n tooltipEl.style.left = tooltipLeft + 'px';\n if(tooltipLeft < tooltipWidth/2) {\n tooltipEl.style.left = tooltipWidth/2 + 'px';\n }\n\n else if(pixelDiff < tooltipWidth/2) {\n tooltipEl.style.left = tooltipLeft - (tooltipWidth/2 - pixelDiff) + 'px';\n }\n tooltipEl.style.opacity = 1;\n\n tooltipEl.style.top = positionY + tooltip.caretY + 'px';\n tooltipEl.style.font = tooltip.options.bodyFont.string;\n tooltipEl.style.padding = tooltip.options.padding + 'px ' + tooltip.options.padding + 'px';\n return tooltipEl\n}\n","const addRequired = function (controls, index) {\n if (document.getElementById(controls[index].name).value) {\n document.getElementById(controls[index].error).setAttribute('hidden', true)\n return true\n } else {\n if (document.getElementById(controls[index].error)) {\n document.getElementById(controls[index].error).removeAttribute('hidden')\n }\n return false\n }\n}\n\nconst checkedValidator = function (controls, index) {\n if (document.getElementById(controls[index].name).checked) {\n document.getElementById(controls[index].error).setAttribute('hidden', true)\n return true\n } else {\n if (document.getElementById(controls[index].error)) {\n document.getElementById(controls[index].error).removeAttribute('hidden')\n }\n return false\n }\n}\n\nconst patternValidator = function (controls, index) {\n if (document.getElementById(controls[index].name).value && regexCheck(document.getElementById(controls[index].name).value, controls[index].meta.regex)) {\n document.getElementById(controls[index].error).setAttribute('hidden', true)\n return true\n } else {\n if (document.getElementById(controls[index].error)) {\n document.getElementById(controls[index].error).removeAttribute('hidden')\n }\n return false\n }\n}\n\nconst checkRecaptcha = function (controls, index) {\n if (grecaptcha && grecaptcha.getResponse().length <= 0) {\n document.getElementById(controls[index].error).removeAttribute('hidden')\n return false\n } else {\n document.getElementById(controls[index].error).setAttribute('hidden', true)\n return true\n }\n}\n\nconst regexCheck = function (value, expression) {\n let regex = new RegExp(expression)\n return regex.test(value)\n}\n\nexport const ValidationsMapper = {\n required: addRequired,\n pattern: patternValidator,\n checked: checkedValidator,\n recaptcha: checkRecaptcha\n}\n","/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n return context.keys().map(function (key) {\n return definitionForModuleWithContextAndKey(context, key);\n }).filter(function (value) {\n return value;\n });\n}\n\nfunction definitionForModuleWithContextAndKey(context, key) {\n var identifier = identifierForContextKey(key);\n\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\n\nfunction definitionForModuleAndIdentifier(module, identifier) {\n var controllerConstructor = module.default;\n\n if (typeof controllerConstructor == \"function\") {\n return {\n identifier: identifier,\n controllerConstructor: controllerConstructor\n };\n }\n}\n\nfunction identifierForContextKey(key) {\n var logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\n\nexport { definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey };","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator.return && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n/*\nStimulus 3.0.1\nCopyright © 2021 Basecamp, LLC\n */\nvar EventListener = /*#__PURE__*/function () {\n function EventListener(eventTarget, eventName, eventOptions) {\n _classCallCheck(this, EventListener);\n\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n\n _createClass(EventListener, [{\n key: \"connect\",\n value: function connect() {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n }\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n }\n }, {\n key: \"bindingConnected\",\n value: function bindingConnected(binding) {\n this.unorderedBindings.add(binding);\n }\n }, {\n key: \"bindingDisconnected\",\n value: function bindingDisconnected(binding) {\n this.unorderedBindings.delete(binding);\n }\n }, {\n key: \"handleEvent\",\n value: function handleEvent(event) {\n var extendedEvent = extendEvent(event);\n\n var _iterator = _createForOfIteratorHelper(this.bindings),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var binding = _step.value;\n\n if (extendedEvent.immediatePropagationStopped) {\n break;\n } else {\n binding.handleEvent(extendedEvent);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }, {\n key: \"bindings\",\n get: function get() {\n return Array.from(this.unorderedBindings).sort(function (left, right) {\n var leftIndex = left.index,\n rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n }\n }]);\n\n return EventListener;\n}();\n\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n } else {\n var _stopImmediatePropagation = event.stopImmediatePropagation;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation: function stopImmediatePropagation() {\n this.immediatePropagationStopped = true;\n\n _stopImmediatePropagation.call(this);\n }\n });\n }\n}\n\nvar Dispatcher = /*#__PURE__*/function () {\n function Dispatcher(application) {\n _classCallCheck(this, Dispatcher);\n\n this.application = application;\n this.eventListenerMaps = new Map();\n this.started = false;\n }\n\n _createClass(Dispatcher, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach(function (eventListener) {\n return eventListener.connect();\n });\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach(function (eventListener) {\n return eventListener.disconnect();\n });\n }\n }\n }, {\n key: \"eventListeners\",\n get: function get() {\n return Array.from(this.eventListenerMaps.values()).reduce(function (listeners, map) {\n return listeners.concat(Array.from(map.values()));\n }, []);\n }\n }, {\n key: \"bindingConnected\",\n value: function bindingConnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n }\n }, {\n key: \"bindingDisconnected\",\n value: function bindingDisconnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n }\n }, {\n key: \"handleError\",\n value: function handleError(error, message) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n this.application.handleError(error, \"Error \".concat(message), detail);\n }\n }, {\n key: \"fetchEventListenerForBinding\",\n value: function fetchEventListenerForBinding(binding) {\n var eventTarget = binding.eventTarget,\n eventName = binding.eventName,\n eventOptions = binding.eventOptions;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n }\n }, {\n key: \"fetchEventListener\",\n value: function fetchEventListener(eventTarget, eventName, eventOptions) {\n var eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n var cacheKey = this.cacheKey(eventName, eventOptions);\n var eventListener = eventListenerMap.get(cacheKey);\n\n if (!eventListener) {\n eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n eventListenerMap.set(cacheKey, eventListener);\n }\n\n return eventListener;\n }\n }, {\n key: \"createEventListener\",\n value: function createEventListener(eventTarget, eventName, eventOptions) {\n var eventListener = new EventListener(eventTarget, eventName, eventOptions);\n\n if (this.started) {\n eventListener.connect();\n }\n\n return eventListener;\n }\n }, {\n key: \"fetchEventListenerMapForEventTarget\",\n value: function fetchEventListenerMapForEventTarget(eventTarget) {\n var eventListenerMap = this.eventListenerMaps.get(eventTarget);\n\n if (!eventListenerMap) {\n eventListenerMap = new Map();\n this.eventListenerMaps.set(eventTarget, eventListenerMap);\n }\n\n return eventListenerMap;\n }\n }, {\n key: \"cacheKey\",\n value: function cacheKey(eventName, eventOptions) {\n var parts = [eventName];\n Object.keys(eventOptions).sort().forEach(function (key) {\n parts.push(\"\".concat(eventOptions[key] ? \"\" : \"!\").concat(key));\n });\n return parts.join(\":\");\n }\n }]);\n\n return Dispatcher;\n}();\n\nvar descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;\n\nfunction parseActionDescriptorString(descriptorString) {\n var source = descriptorString.trim();\n var matches = source.match(descriptorPattern) || [];\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName: matches[2],\n eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},\n identifier: matches[5],\n methodName: matches[7]\n };\n}\n\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n } else if (eventTargetName == \"document\") {\n return document;\n }\n}\n\nfunction parseEventOptions(eventOptions) {\n return eventOptions.split(\":\").reduce(function (options, token) {\n return Object.assign(options, _defineProperty({}, token.replace(/^!/, \"\"), !/^!/.test(token)));\n }, {});\n}\n\nfunction stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n } else if (eventTarget == document) {\n return \"document\";\n }\n}\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, function (_, char) {\n return char.toUpperCase();\n });\n}\n\nfunction capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\n\nfunction dasherize(value) {\n return value.replace(/([A-Z])/g, function (_, char) {\n return \"-\".concat(char.toLowerCase());\n });\n}\n\nfunction tokenize(value) {\n return value.match(/[^\\s]+/g) || [];\n}\n\nvar Action = /*#__PURE__*/function () {\n function Action(element, index, descriptor) {\n _classCallCheck(this, Action);\n\n this.element = element;\n this.index = index;\n this.eventTarget = descriptor.eventTarget || element;\n this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n this.eventOptions = descriptor.eventOptions || {};\n this.identifier = descriptor.identifier || error(\"missing identifier\");\n this.methodName = descriptor.methodName || error(\"missing method name\");\n }\n\n _createClass(Action, [{\n key: \"toString\",\n value: function toString() {\n var eventNameSuffix = this.eventTargetName ? \"@\".concat(this.eventTargetName) : \"\";\n return \"\".concat(this.eventName).concat(eventNameSuffix, \"->\").concat(this.identifier, \"#\").concat(this.methodName);\n }\n }, {\n key: \"params\",\n get: function get() {\n if (this.eventTarget instanceof Element) {\n return this.getParamsFromEventTargetAttributes(this.eventTarget);\n } else {\n return {};\n }\n }\n }, {\n key: \"getParamsFromEventTargetAttributes\",\n value: function getParamsFromEventTargetAttributes(eventTarget) {\n var params = {};\n var pattern = new RegExp(\"^data-\".concat(this.identifier, \"-(.+)-param$\"));\n var attributes = Array.from(eventTarget.attributes);\n attributes.forEach(function (_ref) {\n var name = _ref.name,\n value = _ref.value;\n var match = name.match(pattern);\n var key = match && match[1];\n\n if (key) {\n Object.assign(params, _defineProperty({}, camelize(key), typecast(value)));\n }\n });\n return params;\n }\n }, {\n key: \"eventTargetName\",\n get: function get() {\n return stringifyEventTarget(this.eventTarget);\n }\n }], [{\n key: \"forToken\",\n value: function forToken(token) {\n return new this(token.element, token.index, parseActionDescriptorString(token.content));\n }\n }]);\n\n return Action;\n}();\n\nvar defaultEventNames = {\n \"a\": function a(e) {\n return \"click\";\n },\n \"button\": function button(e) {\n return \"click\";\n },\n \"form\": function form(e) {\n return \"submit\";\n },\n \"details\": function details(e) {\n return \"toggle\";\n },\n \"input\": function input(e) {\n return e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\";\n },\n \"select\": function select(e) {\n return \"change\";\n },\n \"textarea\": function textarea(e) {\n return \"input\";\n }\n};\n\nfunction getDefaultEventNameForElement(element) {\n var tagName = element.tagName.toLowerCase();\n\n if (tagName in defaultEventNames) {\n return defaultEventNames[tagName](element);\n }\n}\n\nfunction error(message) {\n throw new Error(message);\n}\n\nfunction typecast(value) {\n try {\n return JSON.parse(value);\n } catch (o_O) {\n return value;\n }\n}\n\nvar Binding = /*#__PURE__*/function () {\n function Binding(context, action) {\n _classCallCheck(this, Binding);\n\n this.context = context;\n this.action = action;\n }\n\n _createClass(Binding, [{\n key: \"index\",\n get: function get() {\n return this.action.index;\n }\n }, {\n key: \"eventTarget\",\n get: function get() {\n return this.action.eventTarget;\n }\n }, {\n key: \"eventOptions\",\n get: function get() {\n return this.action.eventOptions;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.context.identifier;\n }\n }, {\n key: \"handleEvent\",\n value: function handleEvent(event) {\n if (this.willBeInvokedByEvent(event)) {\n this.invokeWithEvent(event);\n }\n }\n }, {\n key: \"eventName\",\n get: function get() {\n return this.action.eventName;\n }\n }, {\n key: \"method\",\n get: function get() {\n var method = this.controller[this.methodName];\n\n if (typeof method == \"function\") {\n return method;\n }\n\n throw new Error(\"Action \\\"\".concat(this.action, \"\\\" references undefined method \\\"\").concat(this.methodName, \"\\\"\"));\n }\n }, {\n key: \"invokeWithEvent\",\n value: function invokeWithEvent(event) {\n var target = event.target,\n currentTarget = event.currentTarget;\n\n try {\n var params = this.action.params;\n var actionEvent = Object.assign(event, {\n params: params\n });\n this.method.call(this.controller, actionEvent);\n this.context.logDebugActivity(this.methodName, {\n event: event,\n target: target,\n currentTarget: currentTarget,\n action: this.methodName\n });\n } catch (error) {\n var identifier = this.identifier,\n controller = this.controller,\n element = this.element,\n index = this.index;\n var detail = {\n identifier: identifier,\n controller: controller,\n element: element,\n index: index,\n event: event\n };\n this.context.handleError(error, \"invoking action \\\"\".concat(this.action, \"\\\"\"), detail);\n }\n }\n }, {\n key: \"willBeInvokedByEvent\",\n value: function willBeInvokedByEvent(event) {\n var eventTarget = event.target;\n\n if (this.element === eventTarget) {\n return true;\n } else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n } else {\n return this.scope.containsElement(this.action.element);\n }\n }\n }, {\n key: \"controller\",\n get: function get() {\n return this.context.controller;\n }\n }, {\n key: \"methodName\",\n get: function get() {\n return this.action.methodName;\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"scope\",\n get: function get() {\n return this.context.scope;\n }\n }]);\n\n return Binding;\n}();\n\nvar ElementObserver = /*#__PURE__*/function () {\n function ElementObserver(element, delegate) {\n var _this = this;\n\n _classCallCheck(this, ElementObserver);\n\n this.mutationObserverInit = {\n attributes: true,\n childList: true,\n subtree: true\n };\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set();\n this.mutationObserver = new MutationObserver(function (mutations) {\n return _this.processMutations(mutations);\n });\n }\n\n _createClass(ElementObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.refresh();\n }\n }\n }, {\n key: \"pause\",\n value: function pause(callback) {\n if (this.started) {\n this.mutationObserver.disconnect();\n this.started = false;\n }\n\n callback();\n\n if (!this.started) {\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.started = true;\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n if (this.started) {\n var matches = new Set(this.matchElementsInTree());\n\n for (var _i = 0, _Array$from = Array.from(this.elements); _i < _Array$from.length; _i++) {\n var element = _Array$from[_i];\n\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n\n for (var _i2 = 0, _Array$from2 = Array.from(matches); _i2 < _Array$from2.length; _i2++) {\n var _element = _Array$from2[_i2];\n this.addElement(_element);\n }\n }\n }\n }, {\n key: \"processMutations\",\n value: function processMutations(mutations) {\n if (this.started) {\n var _iterator2 = _createForOfIteratorHelper(mutations),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var mutation = _step2.value;\n this.processMutation(mutation);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n }\n }, {\n key: \"processMutation\",\n value: function processMutation(mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n } else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n }\n }, {\n key: \"processAttributeChange\",\n value: function processAttributeChange(node, attributeName) {\n var element = node;\n\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n } else {\n this.removeElement(element);\n }\n } else if (this.matchElement(element)) {\n this.addElement(element);\n }\n }\n }, {\n key: \"processRemovedNodes\",\n value: function processRemovedNodes(nodes) {\n for (var _i3 = 0, _Array$from3 = Array.from(nodes); _i3 < _Array$from3.length; _i3++) {\n var node = _Array$from3[_i3];\n var element = this.elementFromNode(node);\n\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n }\n }, {\n key: \"processAddedNodes\",\n value: function processAddedNodes(nodes) {\n for (var _i4 = 0, _Array$from4 = Array.from(nodes); _i4 < _Array$from4.length; _i4++) {\n var node = _Array$from4[_i4];\n var element = this.elementFromNode(node);\n\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n }\n }, {\n key: \"matchElement\",\n value: function matchElement(element) {\n return this.delegate.matchElement(element);\n }\n }, {\n key: \"matchElementsInTree\",\n value: function matchElementsInTree() {\n var tree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n return this.delegate.matchElementsInTree(tree);\n }\n }, {\n key: \"processTree\",\n value: function processTree(tree, processor) {\n var _iterator3 = _createForOfIteratorHelper(this.matchElementsInTree(tree)),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var element = _step3.value;\n processor.call(this, element);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }, {\n key: \"elementFromNode\",\n value: function elementFromNode(node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n }\n }, {\n key: \"elementIsActive\",\n value: function elementIsActive(element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n } else {\n return this.element.contains(element);\n }\n }\n }, {\n key: \"addElement\",\n value: function addElement(element) {\n if (!this.elements.has(element)) {\n if (this.elementIsActive(element)) {\n this.elements.add(element);\n\n if (this.delegate.elementMatched) {\n this.delegate.elementMatched(element);\n }\n }\n }\n }\n }, {\n key: \"removeElement\",\n value: function removeElement(element) {\n if (this.elements.has(element)) {\n this.elements.delete(element);\n\n if (this.delegate.elementUnmatched) {\n this.delegate.elementUnmatched(element);\n }\n }\n }\n }]);\n\n return ElementObserver;\n}();\n\nvar AttributeObserver = /*#__PURE__*/function () {\n function AttributeObserver(element, attributeName, delegate) {\n _classCallCheck(this, AttributeObserver);\n\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new ElementObserver(element, this);\n }\n\n _createClass(AttributeObserver, [{\n key: \"element\",\n get: function get() {\n return this.elementObserver.element;\n }\n }, {\n key: \"selector\",\n get: function get() {\n return \"[\".concat(this.attributeName, \"]\");\n }\n }, {\n key: \"start\",\n value: function start() {\n this.elementObserver.start();\n }\n }, {\n key: \"pause\",\n value: function pause(callback) {\n this.elementObserver.pause(callback);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.elementObserver.stop();\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.elementObserver.refresh();\n }\n }, {\n key: \"started\",\n get: function get() {\n return this.elementObserver.started;\n }\n }, {\n key: \"matchElement\",\n value: function matchElement(element) {\n return element.hasAttribute(this.attributeName);\n }\n }, {\n key: \"matchElementsInTree\",\n value: function matchElementsInTree(tree) {\n var match = this.matchElement(tree) ? [tree] : [];\n var matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n }\n }, {\n key: \"elementMatched\",\n value: function elementMatched(element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n }\n }, {\n key: \"elementUnmatched\",\n value: function elementUnmatched(element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n }\n }, {\n key: \"elementAttributeChanged\",\n value: function elementAttributeChanged(element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n }\n }]);\n\n return AttributeObserver;\n}();\n\nvar StringMapObserver = /*#__PURE__*/function () {\n function StringMapObserver(element, delegate) {\n var _this2 = this;\n\n _classCallCheck(this, StringMapObserver);\n\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map();\n this.mutationObserver = new MutationObserver(function (mutations) {\n return _this2.processMutations(mutations);\n });\n }\n\n _createClass(StringMapObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, {\n attributes: true,\n attributeOldValue: true\n });\n this.refresh();\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n if (this.started) {\n var _iterator4 = _createForOfIteratorHelper(this.knownAttributeNames),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var attributeName = _step4.value;\n this.refreshAttribute(attributeName, null);\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n }\n }\n }, {\n key: \"processMutations\",\n value: function processMutations(mutations) {\n if (this.started) {\n var _iterator5 = _createForOfIteratorHelper(mutations),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var mutation = _step5.value;\n this.processMutation(mutation);\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n }\n }\n }, {\n key: \"processMutation\",\n value: function processMutation(mutation) {\n var attributeName = mutation.attributeName;\n\n if (attributeName) {\n this.refreshAttribute(attributeName, mutation.oldValue);\n }\n }\n }, {\n key: \"refreshAttribute\",\n value: function refreshAttribute(attributeName, oldValue) {\n var key = this.delegate.getStringMapKeyForAttribute(attributeName);\n\n if (key != null) {\n if (!this.stringMap.has(attributeName)) {\n this.stringMapKeyAdded(key, attributeName);\n }\n\n var value = this.element.getAttribute(attributeName);\n\n if (this.stringMap.get(attributeName) != value) {\n this.stringMapValueChanged(value, key, oldValue);\n }\n\n if (value == null) {\n var _oldValue = this.stringMap.get(attributeName);\n\n this.stringMap.delete(attributeName);\n if (_oldValue) this.stringMapKeyRemoved(key, attributeName, _oldValue);\n } else {\n this.stringMap.set(attributeName, value);\n }\n }\n }\n }, {\n key: \"stringMapKeyAdded\",\n value: function stringMapKeyAdded(key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n }\n }, {\n key: \"stringMapValueChanged\",\n value: function stringMapValueChanged(value, key, oldValue) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key, oldValue);\n }\n }\n }, {\n key: \"stringMapKeyRemoved\",\n value: function stringMapKeyRemoved(key, attributeName, oldValue) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n }\n }, {\n key: \"knownAttributeNames\",\n get: function get() {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n }\n }, {\n key: \"currentAttributeNames\",\n get: function get() {\n return Array.from(this.element.attributes).map(function (attribute) {\n return attribute.name;\n });\n }\n }, {\n key: \"recordedAttributeNames\",\n get: function get() {\n return Array.from(this.stringMap.keys());\n }\n }]);\n\n return StringMapObserver;\n}();\n\nfunction _add(map, key, value) {\n fetch(map, key).add(value);\n}\n\nfunction del(map, key, value) {\n fetch(map, key).delete(value);\n prune(map, key);\n}\n\nfunction fetch(map, key) {\n var values = map.get(key);\n\n if (!values) {\n values = new Set();\n map.set(key, values);\n }\n\n return values;\n}\n\nfunction prune(map, key) {\n var values = map.get(key);\n\n if (values != null && values.size == 0) {\n map.delete(key);\n }\n}\n\nvar Multimap = /*#__PURE__*/function () {\n function Multimap() {\n _classCallCheck(this, Multimap);\n\n this.valuesByKey = new Map();\n }\n\n _createClass(Multimap, [{\n key: \"keys\",\n get: function get() {\n return Array.from(this.valuesByKey.keys());\n }\n }, {\n key: \"values\",\n get: function get() {\n var sets = Array.from(this.valuesByKey.values());\n return sets.reduce(function (values, set) {\n return values.concat(Array.from(set));\n }, []);\n }\n }, {\n key: \"size\",\n get: function get() {\n var sets = Array.from(this.valuesByKey.values());\n return sets.reduce(function (size, set) {\n return size + set.size;\n }, 0);\n }\n }, {\n key: \"add\",\n value: function add(key, value) {\n _add(this.valuesByKey, key, value);\n }\n }, {\n key: \"delete\",\n value: function _delete(key, value) {\n del(this.valuesByKey, key, value);\n }\n }, {\n key: \"has\",\n value: function has(key, value) {\n var values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n }\n }, {\n key: \"hasKey\",\n value: function hasKey(key) {\n return this.valuesByKey.has(key);\n }\n }, {\n key: \"hasValue\",\n value: function hasValue(value) {\n var sets = Array.from(this.valuesByKey.values());\n return sets.some(function (set) {\n return set.has(value);\n });\n }\n }, {\n key: \"getValuesForKey\",\n value: function getValuesForKey(key) {\n var values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n }\n }, {\n key: \"getKeysForValue\",\n value: function getKeysForValue(value) {\n return Array.from(this.valuesByKey).filter(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n values = _ref3[1];\n\n return values.has(value);\n }).map(function (_ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n key = _ref5[0],\n values = _ref5[1];\n\n return key;\n });\n }\n }]);\n\n return Multimap;\n}();\n\nvar IndexedMultimap = /*#__PURE__*/function (_Multimap) {\n _inherits(IndexedMultimap, _Multimap);\n\n var _super = _createSuper(IndexedMultimap);\n\n function IndexedMultimap() {\n var _this3;\n\n _classCallCheck(this, IndexedMultimap);\n\n _this3 = _super.call(this);\n _this3.keysByValue = new Map();\n return _this3;\n }\n\n _createClass(IndexedMultimap, [{\n key: \"values\",\n get: function get() {\n return Array.from(this.keysByValue.keys());\n }\n }, {\n key: \"add\",\n value: function add(key, value) {\n _get(_getPrototypeOf(IndexedMultimap.prototype), \"add\", this).call(this, key, value);\n\n _add(this.keysByValue, value, key);\n }\n }, {\n key: \"delete\",\n value: function _delete(key, value) {\n _get(_getPrototypeOf(IndexedMultimap.prototype), \"delete\", this).call(this, key, value);\n\n del(this.keysByValue, value, key);\n }\n }, {\n key: \"hasValue\",\n value: function hasValue(value) {\n return this.keysByValue.has(value);\n }\n }, {\n key: \"getKeysForValue\",\n value: function getKeysForValue(value) {\n var set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n }\n }]);\n\n return IndexedMultimap;\n}(Multimap);\n\nvar TokenListObserver = /*#__PURE__*/function () {\n function TokenListObserver(element, attributeName, delegate) {\n _classCallCheck(this, TokenListObserver);\n\n this.attributeObserver = new AttributeObserver(element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new Multimap();\n }\n\n _createClass(TokenListObserver, [{\n key: \"started\",\n get: function get() {\n return this.attributeObserver.started;\n }\n }, {\n key: \"start\",\n value: function start() {\n this.attributeObserver.start();\n }\n }, {\n key: \"pause\",\n value: function pause(callback) {\n this.attributeObserver.pause(callback);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.attributeObserver.stop();\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.attributeObserver.refresh();\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.attributeObserver.element;\n }\n }, {\n key: \"attributeName\",\n get: function get() {\n return this.attributeObserver.attributeName;\n }\n }, {\n key: \"elementMatchedAttribute\",\n value: function elementMatchedAttribute(element) {\n this.tokensMatched(this.readTokensForElement(element));\n }\n }, {\n key: \"elementAttributeValueChanged\",\n value: function elementAttributeValueChanged(element) {\n var _this$refreshTokensFo = this.refreshTokensForElement(element),\n _this$refreshTokensFo2 = _slicedToArray(_this$refreshTokensFo, 2),\n unmatchedTokens = _this$refreshTokensFo2[0],\n matchedTokens = _this$refreshTokensFo2[1];\n\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n }\n }, {\n key: \"elementUnmatchedAttribute\",\n value: function elementUnmatchedAttribute(element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n }\n }, {\n key: \"tokensMatched\",\n value: function tokensMatched(tokens) {\n var _this4 = this;\n\n tokens.forEach(function (token) {\n return _this4.tokenMatched(token);\n });\n }\n }, {\n key: \"tokensUnmatched\",\n value: function tokensUnmatched(tokens) {\n var _this5 = this;\n\n tokens.forEach(function (token) {\n return _this5.tokenUnmatched(token);\n });\n }\n }, {\n key: \"tokenMatched\",\n value: function tokenMatched(token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n }\n }, {\n key: \"tokenUnmatched\",\n value: function tokenUnmatched(token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n }\n }, {\n key: \"refreshTokensForElement\",\n value: function refreshTokensForElement(element) {\n var previousTokens = this.tokensByElement.getValuesForKey(element);\n var currentTokens = this.readTokensForElement(element);\n var firstDifferingIndex = zip(previousTokens, currentTokens).findIndex(function (_ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n previousToken = _ref7[0],\n currentToken = _ref7[1];\n\n return !tokensAreEqual(previousToken, currentToken);\n });\n\n if (firstDifferingIndex == -1) {\n return [[], []];\n } else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n }\n }, {\n key: \"readTokensForElement\",\n value: function readTokensForElement(element) {\n var attributeName = this.attributeName;\n var tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n }\n }]);\n\n return TokenListObserver;\n}();\n\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString.trim().split(/\\s+/).filter(function (content) {\n return content.length;\n }).map(function (content, index) {\n return {\n element: element,\n attributeName: attributeName,\n content: content,\n index: index\n };\n });\n}\n\nfunction zip(left, right) {\n var length = Math.max(left.length, right.length);\n return Array.from({\n length: length\n }, function (_, index) {\n return [left[index], right[index]];\n });\n}\n\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}\n\nvar ValueListObserver = /*#__PURE__*/function () {\n function ValueListObserver(element, attributeName, delegate) {\n _classCallCheck(this, ValueListObserver);\n\n this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap();\n this.valuesByTokenByElement = new WeakMap();\n }\n\n _createClass(ValueListObserver, [{\n key: \"started\",\n get: function get() {\n return this.tokenListObserver.started;\n }\n }, {\n key: \"start\",\n value: function start() {\n this.tokenListObserver.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.tokenListObserver.stop();\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.tokenListObserver.refresh();\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.tokenListObserver.element;\n }\n }, {\n key: \"attributeName\",\n get: function get() {\n return this.tokenListObserver.attributeName;\n }\n }, {\n key: \"tokenMatched\",\n value: function tokenMatched(token) {\n var element = token.element;\n\n var _this$fetchParseResul = this.fetchParseResultForToken(token),\n value = _this$fetchParseResul.value;\n\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n }\n }, {\n key: \"tokenUnmatched\",\n value: function tokenUnmatched(token) {\n var element = token.element;\n\n var _this$fetchParseResul2 = this.fetchParseResultForToken(token),\n value = _this$fetchParseResul2.value;\n\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n }\n }, {\n key: \"fetchParseResultForToken\",\n value: function fetchParseResultForToken(token) {\n var parseResult = this.parseResultsByToken.get(token);\n\n if (!parseResult) {\n parseResult = this.parseToken(token);\n this.parseResultsByToken.set(token, parseResult);\n }\n\n return parseResult;\n }\n }, {\n key: \"fetchValuesByTokenForElement\",\n value: function fetchValuesByTokenForElement(element) {\n var valuesByToken = this.valuesByTokenByElement.get(element);\n\n if (!valuesByToken) {\n valuesByToken = new Map();\n this.valuesByTokenByElement.set(element, valuesByToken);\n }\n\n return valuesByToken;\n }\n }, {\n key: \"parseToken\",\n value: function parseToken(token) {\n try {\n var value = this.delegate.parseValueForToken(token);\n return {\n value: value\n };\n } catch (error) {\n return {\n error: error\n };\n }\n }\n }]);\n\n return ValueListObserver;\n}();\n\nvar BindingObserver = /*#__PURE__*/function () {\n function BindingObserver(context, delegate) {\n _classCallCheck(this, BindingObserver);\n\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map();\n }\n\n _createClass(BindingObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.valueListObserver) {\n this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.context.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.context.identifier;\n }\n }, {\n key: \"actionAttribute\",\n get: function get() {\n return this.schema.actionAttribute;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.context.schema;\n }\n }, {\n key: \"bindings\",\n get: function get() {\n return Array.from(this.bindingsByAction.values());\n }\n }, {\n key: \"connectAction\",\n value: function connectAction(action) {\n var binding = new Binding(this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n }\n }, {\n key: \"disconnectAction\",\n value: function disconnectAction(action) {\n var binding = this.bindingsByAction.get(action);\n\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n }\n }, {\n key: \"disconnectAllActions\",\n value: function disconnectAllActions() {\n var _this6 = this;\n\n this.bindings.forEach(function (binding) {\n return _this6.delegate.bindingDisconnected(binding);\n });\n this.bindingsByAction.clear();\n }\n }, {\n key: \"parseValueForToken\",\n value: function parseValueForToken(token) {\n var action = Action.forToken(token);\n\n if (action.identifier == this.identifier) {\n return action;\n }\n }\n }, {\n key: \"elementMatchedValue\",\n value: function elementMatchedValue(element, action) {\n this.connectAction(action);\n }\n }, {\n key: \"elementUnmatchedValue\",\n value: function elementUnmatchedValue(element, action) {\n this.disconnectAction(action);\n }\n }]);\n\n return BindingObserver;\n}();\n\nvar ValueObserver = /*#__PURE__*/function () {\n function ValueObserver(context, receiver) {\n _classCallCheck(this, ValueObserver);\n\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new StringMapObserver(this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n this.invokeChangedCallbacksForDefaultValues();\n }\n\n _createClass(ValueObserver, [{\n key: \"start\",\n value: function start() {\n this.stringMapObserver.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.stringMapObserver.stop();\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.context.element;\n }\n }, {\n key: \"controller\",\n get: function get() {\n return this.context.controller;\n }\n }, {\n key: \"getStringMapKeyForAttribute\",\n value: function getStringMapKeyForAttribute(attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n }\n }, {\n key: \"stringMapKeyAdded\",\n value: function stringMapKeyAdded(key, attributeName) {\n var descriptor = this.valueDescriptorMap[attributeName];\n\n if (!this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n }\n }\n }, {\n key: \"stringMapValueChanged\",\n value: function stringMapValueChanged(value, name, oldValue) {\n var descriptor = this.valueDescriptorNameMap[name];\n if (value === null) return;\n\n if (oldValue === null) {\n oldValue = descriptor.writer(descriptor.defaultValue);\n }\n\n this.invokeChangedCallback(name, value, oldValue);\n }\n }, {\n key: \"stringMapKeyRemoved\",\n value: function stringMapKeyRemoved(key, attributeName, oldValue) {\n var descriptor = this.valueDescriptorNameMap[key];\n\n if (this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n } else {\n this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n }\n }\n }, {\n key: \"invokeChangedCallbacksForDefaultValues\",\n value: function invokeChangedCallbacksForDefaultValues() {\n var _iterator6 = _createForOfIteratorHelper(this.valueDescriptors),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var _ref9 = _step6.value;\n var key = _ref9.key;\n var name = _ref9.name;\n var defaultValue = _ref9.defaultValue;\n var writer = _ref9.writer;\n\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallback(name, writer(defaultValue), undefined);\n }\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n }\n }, {\n key: \"invokeChangedCallback\",\n value: function invokeChangedCallback(name, rawValue, rawOldValue) {\n var changedMethodName = \"\".concat(name, \"Changed\");\n var changedMethod = this.receiver[changedMethodName];\n\n if (typeof changedMethod == \"function\") {\n var descriptor = this.valueDescriptorNameMap[name];\n var value = descriptor.reader(rawValue);\n var oldValue = rawOldValue;\n\n if (rawOldValue) {\n oldValue = descriptor.reader(rawOldValue);\n }\n\n changedMethod.call(this.receiver, value, oldValue);\n }\n }\n }, {\n key: \"valueDescriptors\",\n get: function get() {\n var valueDescriptorMap = this.valueDescriptorMap;\n return Object.keys(valueDescriptorMap).map(function (key) {\n return valueDescriptorMap[key];\n });\n }\n }, {\n key: \"valueDescriptorNameMap\",\n get: function get() {\n var _this7 = this;\n\n var descriptors = {};\n Object.keys(this.valueDescriptorMap).forEach(function (key) {\n var descriptor = _this7.valueDescriptorMap[key];\n descriptors[descriptor.name] = descriptor;\n });\n return descriptors;\n }\n }, {\n key: \"hasValue\",\n value: function hasValue(attributeName) {\n var descriptor = this.valueDescriptorNameMap[attributeName];\n var hasMethodName = \"has\".concat(capitalize(descriptor.name));\n return this.receiver[hasMethodName];\n }\n }]);\n\n return ValueObserver;\n}();\n\nvar TargetObserver = /*#__PURE__*/function () {\n function TargetObserver(context, delegate) {\n _classCallCheck(this, TargetObserver);\n\n this.context = context;\n this.delegate = delegate;\n this.targetsByName = new Multimap();\n }\n\n _createClass(TargetObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.tokenListObserver) {\n this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n this.tokenListObserver.start();\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.tokenListObserver) {\n this.disconnectAllTargets();\n this.tokenListObserver.stop();\n delete this.tokenListObserver;\n }\n }\n }, {\n key: \"tokenMatched\",\n value: function tokenMatched(_ref10) {\n var element = _ref10.element,\n name = _ref10.content;\n\n if (this.scope.containsElement(element)) {\n this.connectTarget(element, name);\n }\n }\n }, {\n key: \"tokenUnmatched\",\n value: function tokenUnmatched(_ref11) {\n var element = _ref11.element,\n name = _ref11.content;\n this.disconnectTarget(element, name);\n }\n }, {\n key: \"connectTarget\",\n value: function connectTarget(element, name) {\n var _this8 = this;\n\n var _a;\n\n if (!this.targetsByName.has(name, element)) {\n this.targetsByName.add(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(function () {\n return _this8.delegate.targetConnected(element, name);\n });\n }\n }\n }, {\n key: \"disconnectTarget\",\n value: function disconnectTarget(element, name) {\n var _this9 = this;\n\n var _a;\n\n if (this.targetsByName.has(name, element)) {\n this.targetsByName.delete(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(function () {\n return _this9.delegate.targetDisconnected(element, name);\n });\n }\n }\n }, {\n key: \"disconnectAllTargets\",\n value: function disconnectAllTargets() {\n var _iterator7 = _createForOfIteratorHelper(this.targetsByName.keys),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var name = _step7.value;\n\n var _iterator8 = _createForOfIteratorHelper(this.targetsByName.getValuesForKey(name)),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var element = _step8.value;\n this.disconnectTarget(element, name);\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n }\n }, {\n key: \"attributeName\",\n get: function get() {\n return \"data-\".concat(this.context.identifier, \"-target\");\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.context.element;\n }\n }, {\n key: \"scope\",\n get: function get() {\n return this.context.scope;\n }\n }]);\n\n return TargetObserver;\n}();\n\nvar Context = /*#__PURE__*/function () {\n function Context(module, scope) {\n var _this10 = this;\n\n _classCallCheck(this, Context);\n\n this.logDebugActivity = function (functionName) {\n var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var identifier = _this10.identifier,\n controller = _this10.controller,\n element = _this10.element;\n detail = Object.assign({\n identifier: identifier,\n controller: controller,\n element: element\n }, detail);\n\n _this10.application.logDebugActivity(_this10.identifier, functionName, detail);\n };\n\n this.module = module;\n this.scope = scope;\n this.controller = new module.controllerConstructor(this);\n this.bindingObserver = new BindingObserver(this, this.dispatcher);\n this.valueObserver = new ValueObserver(this, this.controller);\n this.targetObserver = new TargetObserver(this, this);\n\n try {\n this.controller.initialize();\n this.logDebugActivity(\"initialize\");\n } catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n\n _createClass(Context, [{\n key: \"connect\",\n value: function connect() {\n this.bindingObserver.start();\n this.valueObserver.start();\n this.targetObserver.start();\n\n try {\n this.controller.connect();\n this.logDebugActivity(\"connect\");\n } catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n }\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n try {\n this.controller.disconnect();\n this.logDebugActivity(\"disconnect\");\n } catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n\n this.targetObserver.stop();\n this.valueObserver.stop();\n this.bindingObserver.stop();\n }\n }, {\n key: \"application\",\n get: function get() {\n return this.module.application;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.module.identifier;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.application.schema;\n }\n }, {\n key: \"dispatcher\",\n get: function get() {\n return this.application.dispatcher;\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"parentElement\",\n get: function get() {\n return this.element.parentElement;\n }\n }, {\n key: \"handleError\",\n value: function handleError(error, message) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var identifier = this.identifier,\n controller = this.controller,\n element = this.element;\n detail = Object.assign({\n identifier: identifier,\n controller: controller,\n element: element\n }, detail);\n this.application.handleError(error, \"Error \".concat(message), detail);\n }\n }, {\n key: \"targetConnected\",\n value: function targetConnected(element, name) {\n this.invokeControllerMethod(\"\".concat(name, \"TargetConnected\"), element);\n }\n }, {\n key: \"targetDisconnected\",\n value: function targetDisconnected(element, name) {\n this.invokeControllerMethod(\"\".concat(name, \"TargetDisconnected\"), element);\n }\n }, {\n key: \"invokeControllerMethod\",\n value: function invokeControllerMethod(methodName) {\n var controller = this.controller;\n\n if (typeof controller[methodName] == \"function\") {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n controller[methodName].apply(controller, args);\n }\n }\n }]);\n\n return Context;\n}();\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n var ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce(function (values, constructor) {\n getOwnStaticArrayValues(constructor, propertyName).forEach(function (name) {\n return values.add(name);\n });\n return values;\n }, new Set()));\n}\n\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n var ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce(function (pairs, constructor) {\n pairs.push.apply(pairs, _toConsumableArray(getOwnStaticObjectPairs(constructor, propertyName)));\n return pairs;\n }, []);\n}\n\nfunction getAncestorsForConstructor(constructor) {\n var ancestors = [];\n\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n\n return ancestors.reverse();\n}\n\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n var definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\n\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n var definition = constructor[propertyName];\n return definition ? Object.keys(definition).map(function (key) {\n return [key, definition[key]];\n }) : [];\n}\n\nfunction bless(constructor) {\n return shadow(constructor, getBlessedProperties(constructor));\n}\n\nfunction shadow(constructor, properties) {\n var shadowConstructor = extend(constructor);\n var shadowProperties = getShadowProperties(constructor.prototype, properties);\n Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n return shadowConstructor;\n}\n\nfunction getBlessedProperties(constructor) {\n var blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n return blessings.reduce(function (blessedProperties, blessing) {\n var properties = blessing(constructor);\n\n for (var key in properties) {\n var descriptor = blessedProperties[key] || {};\n blessedProperties[key] = Object.assign(descriptor, properties[key]);\n }\n\n return blessedProperties;\n }, {});\n}\n\nfunction getShadowProperties(prototype, properties) {\n return getOwnKeys(properties).reduce(function (shadowProperties, key) {\n var descriptor = getShadowedDescriptor(prototype, properties, key);\n\n if (descriptor) {\n Object.assign(shadowProperties, _defineProperty({}, key, descriptor));\n }\n\n return shadowProperties;\n }, {});\n}\n\nfunction getShadowedDescriptor(prototype, properties, key) {\n var shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n var shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n\n if (!shadowedByValue) {\n var descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n\n if (shadowingDescriptor) {\n descriptor.get = shadowingDescriptor.get || descriptor.get;\n descriptor.set = shadowingDescriptor.set || descriptor.set;\n }\n\n return descriptor;\n }\n}\n\nvar getOwnKeys = function () {\n if (typeof Object.getOwnPropertySymbols == \"function\") {\n return function (object) {\n return [].concat(_toConsumableArray(Object.getOwnPropertyNames(object)), _toConsumableArray(Object.getOwnPropertySymbols(object)));\n };\n } else {\n return Object.getOwnPropertyNames;\n }\n}();\n\nvar extend = function () {\n function extendWithReflect(constructor) {\n function extended() {\n return Reflect.construct(constructor, arguments, this instanceof extended ? this.constructor : void 0);\n }\n\n extended.prototype = Object.create(constructor.prototype, {\n constructor: {\n value: extended\n }\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n\n function testReflectExtension() {\n var a = function a() {\n this.a.call(this);\n };\n\n var b = extendWithReflect(a);\n\n b.prototype.a = function () {};\n\n return new b();\n }\n\n try {\n testReflectExtension();\n return extendWithReflect;\n } catch (error) {\n return function (constructor) {\n return /*#__PURE__*/function (_constructor) {\n _inherits(extended, _constructor);\n\n var _super2 = _createSuper(extended);\n\n function extended() {\n _classCallCheck(this, extended);\n\n return _super2.apply(this, arguments);\n }\n\n return _createClass(extended);\n }(constructor);\n };\n }\n}();\n\nfunction blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: bless(definition.controllerConstructor)\n };\n}\n\nvar Module = /*#__PURE__*/function () {\n function Module(application, definition) {\n _classCallCheck(this, Module);\n\n this.application = application;\n this.definition = blessDefinition(definition);\n this.contextsByScope = new WeakMap();\n this.connectedContexts = new Set();\n }\n\n _createClass(Module, [{\n key: \"identifier\",\n get: function get() {\n return this.definition.identifier;\n }\n }, {\n key: \"controllerConstructor\",\n get: function get() {\n return this.definition.controllerConstructor;\n }\n }, {\n key: \"contexts\",\n get: function get() {\n return Array.from(this.connectedContexts);\n }\n }, {\n key: \"connectContextForScope\",\n value: function connectContextForScope(scope) {\n var context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n }\n }, {\n key: \"disconnectContextForScope\",\n value: function disconnectContextForScope(scope) {\n var context = this.contextsByScope.get(scope);\n\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n }\n }, {\n key: \"fetchContextForScope\",\n value: function fetchContextForScope(scope) {\n var context = this.contextsByScope.get(scope);\n\n if (!context) {\n context = new Context(this, scope);\n this.contextsByScope.set(scope, context);\n }\n\n return context;\n }\n }]);\n\n return Module;\n}();\n\nvar ClassMap = /*#__PURE__*/function () {\n function ClassMap(scope) {\n _classCallCheck(this, ClassMap);\n\n this.scope = scope;\n }\n\n _createClass(ClassMap, [{\n key: \"has\",\n value: function has(name) {\n return this.data.has(this.getDataKey(name));\n }\n }, {\n key: \"get\",\n value: function get(name) {\n return this.getAll(name)[0];\n }\n }, {\n key: \"getAll\",\n value: function getAll(name) {\n var tokenString = this.data.get(this.getDataKey(name)) || \"\";\n return tokenize(tokenString);\n }\n }, {\n key: \"getAttributeName\",\n value: function getAttributeName(name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n }\n }, {\n key: \"getDataKey\",\n value: function getDataKey(name) {\n return \"\".concat(name, \"-class\");\n }\n }, {\n key: \"data\",\n get: function get() {\n return this.scope.data;\n }\n }]);\n\n return ClassMap;\n}();\n\nvar DataMap = /*#__PURE__*/function () {\n function DataMap(scope) {\n _classCallCheck(this, DataMap);\n\n this.scope = scope;\n }\n\n _createClass(DataMap, [{\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.scope.identifier;\n }\n }, {\n key: \"get\",\n value: function get(key) {\n var name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n var name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n }\n }, {\n key: \"has\",\n value: function has(key) {\n var name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n if (this.has(key)) {\n var name = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name);\n return true;\n } else {\n return false;\n }\n }\n }, {\n key: \"getAttributeNameForKey\",\n value: function getAttributeNameForKey(key) {\n return \"data-\".concat(this.identifier, \"-\").concat(dasherize(key));\n }\n }]);\n\n return DataMap;\n}();\n\nvar Guide = /*#__PURE__*/function () {\n function Guide(logger) {\n _classCallCheck(this, Guide);\n\n this.warnedKeysByObject = new WeakMap();\n this.logger = logger;\n }\n\n _createClass(Guide, [{\n key: \"warn\",\n value: function warn(object, key, message) {\n var warnedKeys = this.warnedKeysByObject.get(object);\n\n if (!warnedKeys) {\n warnedKeys = new Set();\n this.warnedKeysByObject.set(object, warnedKeys);\n }\n\n if (!warnedKeys.has(key)) {\n warnedKeys.add(key);\n this.logger.warn(message, object);\n }\n }\n }]);\n\n return Guide;\n}();\n\nfunction attributeValueContainsToken(attributeName, token) {\n return \"[\".concat(attributeName, \"~=\\\"\").concat(token, \"\\\"]\");\n}\n\nvar TargetSet = /*#__PURE__*/function () {\n function TargetSet(scope) {\n _classCallCheck(this, TargetSet);\n\n this.scope = scope;\n }\n\n _createClass(TargetSet, [{\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.scope.identifier;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.scope.schema;\n }\n }, {\n key: \"has\",\n value: function has(targetName) {\n return this.find(targetName) != null;\n }\n }, {\n key: \"find\",\n value: function find() {\n var _this11 = this;\n\n for (var _len2 = arguments.length, targetNames = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n targetNames[_key2] = arguments[_key2];\n }\n\n return targetNames.reduce(function (target, targetName) {\n return target || _this11.findTarget(targetName) || _this11.findLegacyTarget(targetName);\n }, undefined);\n }\n }, {\n key: \"findAll\",\n value: function findAll() {\n var _this12 = this;\n\n for (var _len3 = arguments.length, targetNames = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n targetNames[_key3] = arguments[_key3];\n }\n\n return targetNames.reduce(function (targets, targetName) {\n return [].concat(_toConsumableArray(targets), _toConsumableArray(_this12.findAllTargets(targetName)), _toConsumableArray(_this12.findAllLegacyTargets(targetName)));\n }, []);\n }\n }, {\n key: \"findTarget\",\n value: function findTarget(targetName) {\n var selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n }\n }, {\n key: \"findAllTargets\",\n value: function findAllTargets(targetName) {\n var selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n }\n }, {\n key: \"getSelectorForTargetName\",\n value: function getSelectorForTargetName(targetName) {\n var attributeName = this.schema.targetAttributeForScope(this.identifier);\n return attributeValueContainsToken(attributeName, targetName);\n }\n }, {\n key: \"findLegacyTarget\",\n value: function findLegacyTarget(targetName) {\n var selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n }\n }, {\n key: \"findAllLegacyTargets\",\n value: function findAllLegacyTargets(targetName) {\n var _this13 = this;\n\n var selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map(function (element) {\n return _this13.deprecate(element, targetName);\n });\n }\n }, {\n key: \"getLegacySelectorForTargetName\",\n value: function getLegacySelectorForTargetName(targetName) {\n var targetDescriptor = \"\".concat(this.identifier, \".\").concat(targetName);\n return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n }\n }, {\n key: \"deprecate\",\n value: function deprecate(element, targetName) {\n if (element) {\n var identifier = this.identifier;\n var attributeName = this.schema.targetAttribute;\n var revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n this.guide.warn(element, \"target:\".concat(targetName), \"Please replace \".concat(attributeName, \"=\\\"\").concat(identifier, \".\").concat(targetName, \"\\\" with \").concat(revisedAttributeName, \"=\\\"\").concat(targetName, \"\\\". \") + \"The \".concat(attributeName, \" attribute is deprecated and will be removed in a future version of Stimulus.\"));\n }\n\n return element;\n }\n }, {\n key: \"guide\",\n get: function get() {\n return this.scope.guide;\n }\n }]);\n\n return TargetSet;\n}();\n\nvar Scope = /*#__PURE__*/function () {\n function Scope(schema, element, identifier, logger) {\n var _this14 = this;\n\n _classCallCheck(this, Scope);\n\n this.targets = new TargetSet(this);\n this.classes = new ClassMap(this);\n this.data = new DataMap(this);\n\n this.containsElement = function (element) {\n return element.closest(_this14.controllerSelector) === _this14.element;\n };\n\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new Guide(logger);\n }\n\n _createClass(Scope, [{\n key: \"findElement\",\n value: function findElement(selector) {\n return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);\n }\n }, {\n key: \"findAllElements\",\n value: function findAllElements(selector) {\n return [].concat(_toConsumableArray(this.element.matches(selector) ? [this.element] : []), _toConsumableArray(this.queryElements(selector).filter(this.containsElement)));\n }\n }, {\n key: \"queryElements\",\n value: function queryElements(selector) {\n return Array.from(this.element.querySelectorAll(selector));\n }\n }, {\n key: \"controllerSelector\",\n get: function get() {\n return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n }\n }]);\n\n return Scope;\n}();\n\nvar ScopeObserver = /*#__PURE__*/function () {\n function ScopeObserver(element, schema, delegate) {\n _classCallCheck(this, ScopeObserver);\n\n this.element = element;\n this.schema = schema;\n this.delegate = delegate;\n this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n this.scopesByIdentifierByElement = new WeakMap();\n this.scopeReferenceCounts = new WeakMap();\n }\n\n _createClass(ScopeObserver, [{\n key: \"start\",\n value: function start() {\n this.valueListObserver.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.valueListObserver.stop();\n }\n }, {\n key: \"controllerAttribute\",\n get: function get() {\n return this.schema.controllerAttribute;\n }\n }, {\n key: \"parseValueForToken\",\n value: function parseValueForToken(token) {\n var element = token.element,\n identifier = token.content;\n var scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n var scope = scopesByIdentifier.get(identifier);\n\n if (!scope) {\n scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n scopesByIdentifier.set(identifier, scope);\n }\n\n return scope;\n }\n }, {\n key: \"elementMatchedValue\",\n value: function elementMatchedValue(element, value) {\n var referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n this.scopeReferenceCounts.set(value, referenceCount);\n\n if (referenceCount == 1) {\n this.delegate.scopeConnected(value);\n }\n }\n }, {\n key: \"elementUnmatchedValue\",\n value: function elementUnmatchedValue(element, value) {\n var referenceCount = this.scopeReferenceCounts.get(value);\n\n if (referenceCount) {\n this.scopeReferenceCounts.set(value, referenceCount - 1);\n\n if (referenceCount == 1) {\n this.delegate.scopeDisconnected(value);\n }\n }\n }\n }, {\n key: \"fetchScopesByIdentifierForElement\",\n value: function fetchScopesByIdentifierForElement(element) {\n var scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n\n if (!scopesByIdentifier) {\n scopesByIdentifier = new Map();\n this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n }\n\n return scopesByIdentifier;\n }\n }]);\n\n return ScopeObserver;\n}();\n\nvar Router = /*#__PURE__*/function () {\n function Router(application) {\n _classCallCheck(this, Router);\n\n this.application = application;\n this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n this.scopesByIdentifier = new Multimap();\n this.modulesByIdentifier = new Map();\n }\n\n _createClass(Router, [{\n key: \"element\",\n get: function get() {\n return this.application.element;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.application.schema;\n }\n }, {\n key: \"logger\",\n get: function get() {\n return this.application.logger;\n }\n }, {\n key: \"controllerAttribute\",\n get: function get() {\n return this.schema.controllerAttribute;\n }\n }, {\n key: \"modules\",\n get: function get() {\n return Array.from(this.modulesByIdentifier.values());\n }\n }, {\n key: \"contexts\",\n get: function get() {\n return this.modules.reduce(function (contexts, module) {\n return contexts.concat(module.contexts);\n }, []);\n }\n }, {\n key: \"start\",\n value: function start() {\n this.scopeObserver.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.scopeObserver.stop();\n }\n }, {\n key: \"loadDefinition\",\n value: function loadDefinition(definition) {\n this.unloadIdentifier(definition.identifier);\n var module = new Module(this.application, definition);\n this.connectModule(module);\n }\n }, {\n key: \"unloadIdentifier\",\n value: function unloadIdentifier(identifier) {\n var module = this.modulesByIdentifier.get(identifier);\n\n if (module) {\n this.disconnectModule(module);\n }\n }\n }, {\n key: \"getContextForElementAndIdentifier\",\n value: function getContextForElementAndIdentifier(element, identifier) {\n var module = this.modulesByIdentifier.get(identifier);\n\n if (module) {\n return module.contexts.find(function (context) {\n return context.element == element;\n });\n }\n }\n }, {\n key: \"handleError\",\n value: function handleError(error, message, detail) {\n this.application.handleError(error, message, detail);\n }\n }, {\n key: \"createScopeForElementAndIdentifier\",\n value: function createScopeForElementAndIdentifier(element, identifier) {\n return new Scope(this.schema, element, identifier, this.logger);\n }\n }, {\n key: \"scopeConnected\",\n value: function scopeConnected(scope) {\n this.scopesByIdentifier.add(scope.identifier, scope);\n var module = this.modulesByIdentifier.get(scope.identifier);\n\n if (module) {\n module.connectContextForScope(scope);\n }\n }\n }, {\n key: \"scopeDisconnected\",\n value: function scopeDisconnected(scope) {\n this.scopesByIdentifier.delete(scope.identifier, scope);\n var module = this.modulesByIdentifier.get(scope.identifier);\n\n if (module) {\n module.disconnectContextForScope(scope);\n }\n }\n }, {\n key: \"connectModule\",\n value: function connectModule(module) {\n this.modulesByIdentifier.set(module.identifier, module);\n var scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(function (scope) {\n return module.connectContextForScope(scope);\n });\n }\n }, {\n key: \"disconnectModule\",\n value: function disconnectModule(module) {\n this.modulesByIdentifier.delete(module.identifier);\n var scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(function (scope) {\n return module.disconnectContextForScope(scope);\n });\n }\n }]);\n\n return Router;\n}();\n\nvar defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\",\n targetAttributeForScope: function targetAttributeForScope(identifier) {\n return \"data-\".concat(identifier, \"-target\");\n }\n};\n\nvar Application = /*#__PURE__*/function () {\n function Application() {\n var _this15 = this;\n\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;\n var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultSchema;\n\n _classCallCheck(this, Application);\n\n this.logger = console;\n this.debug = false;\n\n this.logDebugActivity = function (identifier, functionName) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (_this15.debug) {\n _this15.logFormattedMessage(identifier, functionName, detail);\n }\n };\n\n this.element = element;\n this.schema = schema;\n this.dispatcher = new Dispatcher(this);\n this.router = new Router(this);\n }\n\n _createClass(Application, [{\n key: \"start\",\n value: function () {\n var _start = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return domReady();\n\n case 2:\n this.logDebugActivity(\"application\", \"starting\");\n this.dispatcher.start();\n this.router.start();\n this.logDebugActivity(\"application\", \"start\");\n\n case 6:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function start() {\n return _start.apply(this, arguments);\n }\n\n return start;\n }()\n }, {\n key: \"stop\",\n value: function stop() {\n this.logDebugActivity(\"application\", \"stopping\");\n this.dispatcher.stop();\n this.router.stop();\n this.logDebugActivity(\"application\", \"stop\");\n }\n }, {\n key: \"register\",\n value: function register(identifier, controllerConstructor) {\n if (controllerConstructor.shouldLoad) {\n this.load({\n identifier: identifier,\n controllerConstructor: controllerConstructor\n });\n }\n }\n }, {\n key: \"load\",\n value: function load(head) {\n var _this16 = this;\n\n for (var _len4 = arguments.length, rest = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n rest[_key4 - 1] = arguments[_key4];\n }\n\n var definitions = Array.isArray(head) ? head : [head].concat(rest);\n definitions.forEach(function (definition) {\n return _this16.router.loadDefinition(definition);\n });\n }\n }, {\n key: \"unload\",\n value: function unload(head) {\n var _this17 = this;\n\n for (var _len5 = arguments.length, rest = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n rest[_key5 - 1] = arguments[_key5];\n }\n\n var identifiers = Array.isArray(head) ? head : [head].concat(rest);\n identifiers.forEach(function (identifier) {\n return _this17.router.unloadIdentifier(identifier);\n });\n }\n }, {\n key: \"controllers\",\n get: function get() {\n return this.router.contexts.map(function (context) {\n return context.controller;\n });\n }\n }, {\n key: \"getControllerForElementAndIdentifier\",\n value: function getControllerForElementAndIdentifier(element, identifier) {\n var context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n }\n }, {\n key: \"handleError\",\n value: function handleError(error, message, detail) {\n var _a;\n\n this.logger.error(\"%s\\n\\n%o\\n\\n%o\", message, error, detail);\n (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n }\n }, {\n key: \"logFormattedMessage\",\n value: function logFormattedMessage(identifier, functionName) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n detail = Object.assign({\n application: this\n }, detail);\n this.logger.groupCollapsed(\"\".concat(identifier, \" #\").concat(functionName));\n this.logger.log(\"details:\", Object.assign({}, detail));\n this.logger.groupEnd();\n }\n }], [{\n key: \"start\",\n value: function start(element, schema) {\n var application = new Application(element, schema);\n application.start();\n return application;\n }\n }]);\n\n return Application;\n}();\n\nfunction domReady() {\n return new Promise(function (resolve) {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", function () {\n return resolve();\n });\n } else {\n resolve();\n }\n });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n var classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce(function (properties, classDefinition) {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\n\nfunction propertiesForClassDefinition(key) {\n var _ref12;\n\n return _ref12 = {}, _defineProperty(_ref12, \"\".concat(key, \"Class\"), {\n get: function get() {\n var classes = this.classes;\n\n if (classes.has(key)) {\n return classes.get(key);\n } else {\n var attribute = classes.getAttributeName(key);\n throw new Error(\"Missing attribute \\\"\".concat(attribute, \"\\\"\"));\n }\n }\n }), _defineProperty(_ref12, \"\".concat(key, \"Classes\"), {\n get: function get() {\n return this.classes.getAll(key);\n }\n }), _defineProperty(_ref12, \"has\".concat(capitalize(key), \"Class\"), {\n get: function get() {\n return this.classes.has(key);\n }\n }), _ref12;\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n var targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce(function (properties, targetDefinition) {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\n\nfunction propertiesForTargetDefinition(name) {\n var _ref13;\n\n return _ref13 = {}, _defineProperty(_ref13, \"\".concat(name, \"Target\"), {\n get: function get() {\n var target = this.targets.find(name);\n\n if (target) {\n return target;\n } else {\n throw new Error(\"Missing target element \\\"\".concat(name, \"\\\" for \\\"\").concat(this.identifier, \"\\\" controller\"));\n }\n }\n }), _defineProperty(_ref13, \"\".concat(name, \"Targets\"), {\n get: function get() {\n return this.targets.findAll(name);\n }\n }), _defineProperty(_ref13, \"has\".concat(capitalize(name), \"Target\"), {\n get: function get() {\n return this.targets.has(name);\n }\n }), _ref13;\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n var valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n var propertyDescriptorMap = {\n valueDescriptorMap: {\n get: function get() {\n var _this18 = this;\n\n return valueDefinitionPairs.reduce(function (result, valueDefinitionPair) {\n var valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);\n\n var attributeName = _this18.data.getAttributeNameForKey(valueDescriptor.key);\n\n return Object.assign(result, _defineProperty({}, attributeName, valueDescriptor));\n }, {});\n }\n }\n };\n return valueDefinitionPairs.reduce(function (properties, valueDefinitionPair) {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\n\nfunction propertiesForValueDefinitionPair(valueDefinitionPair) {\n var _ref14;\n\n var definition = parseValueDefinitionPair(valueDefinitionPair);\n var key = definition.key,\n name = definition.name,\n read = definition.reader,\n write = definition.writer;\n return _ref14 = {}, _defineProperty(_ref14, name, {\n get: function get() {\n var value = this.data.get(key);\n\n if (value !== null) {\n return read(value);\n } else {\n return definition.defaultValue;\n }\n },\n set: function set(value) {\n if (value === undefined) {\n this.data.delete(key);\n } else {\n this.data.set(key, write(value));\n }\n }\n }), _defineProperty(_ref14, \"has\".concat(capitalize(name)), {\n get: function get() {\n return this.data.has(key) || definition.hasCustomDefaultValue;\n }\n }), _ref14;\n}\n\nfunction parseValueDefinitionPair(_ref15) {\n var _ref16 = _slicedToArray(_ref15, 2),\n token = _ref16[0],\n typeDefinition = _ref16[1];\n\n return valueDescriptorForTokenAndTypeDefinition(token, typeDefinition);\n}\n\nfunction parseValueTypeConstant(constant) {\n switch (constant) {\n case Array:\n return \"array\";\n\n case Boolean:\n return \"boolean\";\n\n case Number:\n return \"number\";\n\n case Object:\n return \"object\";\n\n case String:\n return \"string\";\n }\n}\n\nfunction parseValueTypeDefault(defaultValue) {\n switch (_typeof(defaultValue)) {\n case \"boolean\":\n return \"boolean\";\n\n case \"number\":\n return \"number\";\n\n case \"string\":\n return \"string\";\n }\n\n if (Array.isArray(defaultValue)) return \"array\";\n if (Object.prototype.toString.call(defaultValue) === \"[object Object]\") return \"object\";\n}\n\nfunction parseValueTypeObject(typeObject) {\n var typeFromObject = parseValueTypeConstant(typeObject.type);\n\n if (typeFromObject) {\n var defaultValueType = parseValueTypeDefault(typeObject.default);\n\n if (typeFromObject !== defaultValueType) {\n throw new Error(\"Type \\\"\".concat(typeFromObject, \"\\\" must match the type of the default value. Given default value: \\\"\").concat(typeObject.default, \"\\\" as \\\"\").concat(defaultValueType, \"\\\"\"));\n }\n\n return typeFromObject;\n }\n}\n\nfunction parseValueTypeDefinition(typeDefinition) {\n var typeFromObject = parseValueTypeObject(typeDefinition);\n var typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n var typeFromConstant = parseValueTypeConstant(typeDefinition);\n var type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n if (type) return type;\n throw new Error(\"Unknown value type \\\"\".concat(typeDefinition, \"\\\"\"));\n}\n\nfunction defaultValueForDefinition(typeDefinition) {\n var constant = parseValueTypeConstant(typeDefinition);\n if (constant) return defaultValuesByType[constant];\n var defaultValue = typeDefinition.default;\n if (defaultValue !== undefined) return defaultValue;\n return typeDefinition;\n}\n\nfunction valueDescriptorForTokenAndTypeDefinition(token, typeDefinition) {\n var key = \"\".concat(dasherize(token), \"-value\");\n var type = parseValueTypeDefinition(typeDefinition);\n return {\n type: type,\n key: key,\n name: camelize(key),\n\n get defaultValue() {\n return defaultValueForDefinition(typeDefinition);\n },\n\n get hasCustomDefaultValue() {\n return parseValueTypeDefault(typeDefinition) !== undefined;\n },\n\n reader: readers[type],\n writer: writers[type] || writers.default\n };\n}\n\nvar defaultValuesByType = {\n get array() {\n return [];\n },\n\n boolean: false,\n number: 0,\n\n get object() {\n return {};\n },\n\n string: \"\"\n};\nvar readers = {\n array: function array(value) {\n var array = JSON.parse(value);\n\n if (!Array.isArray(array)) {\n throw new TypeError(\"Expected array\");\n }\n\n return array;\n },\n boolean: function boolean(value) {\n return !(value == \"0\" || value == \"false\");\n },\n number: function number(value) {\n return Number(value);\n },\n object: function object(value) {\n var object = JSON.parse(value);\n\n if (object === null || _typeof(object) != \"object\" || Array.isArray(object)) {\n throw new TypeError(\"Expected object\");\n }\n\n return object;\n },\n string: function string(value) {\n return value;\n }\n};\nvar writers = {\n default: writeString,\n array: writeJSON,\n object: writeJSON\n};\n\nfunction writeJSON(value) {\n return JSON.stringify(value);\n}\n\nfunction writeString(value) {\n return \"\".concat(value);\n}\n\nvar Controller = /*#__PURE__*/function () {\n function Controller(context) {\n _classCallCheck(this, Controller);\n\n this.context = context;\n }\n\n _createClass(Controller, [{\n key: \"application\",\n get: function get() {\n return this.context.application;\n }\n }, {\n key: \"scope\",\n get: function get() {\n return this.context.scope;\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.scope.identifier;\n }\n }, {\n key: \"targets\",\n get: function get() {\n return this.scope.targets;\n }\n }, {\n key: \"classes\",\n get: function get() {\n return this.scope.classes;\n }\n }, {\n key: \"data\",\n get: function get() {\n return this.scope.data;\n }\n }, {\n key: \"initialize\",\n value: function initialize() {}\n }, {\n key: \"connect\",\n value: function connect() {}\n }, {\n key: \"disconnect\",\n value: function disconnect() {}\n }, {\n key: \"dispatch\",\n value: function dispatch(eventName) {\n var _ref17 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref17$target = _ref17.target,\n target = _ref17$target === void 0 ? this.element : _ref17$target,\n _ref17$detail = _ref17.detail,\n detail = _ref17$detail === void 0 ? {} : _ref17$detail,\n _ref17$prefix = _ref17.prefix,\n prefix = _ref17$prefix === void 0 ? this.identifier : _ref17$prefix,\n _ref17$bubbles = _ref17.bubbles,\n bubbles = _ref17$bubbles === void 0 ? true : _ref17$bubbles,\n _ref17$cancelable = _ref17.cancelable,\n cancelable = _ref17$cancelable === void 0 ? true : _ref17$cancelable;\n\n var type = prefix ? \"\".concat(prefix, \":\").concat(eventName) : eventName;\n var event = new CustomEvent(type, {\n detail: detail,\n bubbles: bubbles,\n cancelable: cancelable\n });\n target.dispatchEvent(event);\n return event;\n }\n }], [{\n key: \"shouldLoad\",\n get: function get() {\n return true;\n }\n }]);\n\n return Controller;\n}();\n\nController.blessings = [ClassPropertiesBlessing, TargetPropertiesBlessing, ValuePropertiesBlessing];\nController.targets = [];\nController.values = {};\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, StringMapObserver, TokenListObserver, ValueListObserver, _add as add, defaultSchema, del, fetch, prune };","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator.return && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nvar consumer;\nexport function getConsumer() {\n return _getConsumer.apply(this, arguments);\n}\n\nfunction _getConsumer() {\n _getConsumer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", consumer || setConsumer(createConsumer().then(setConsumer)));\n\n case 1:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _getConsumer.apply(this, arguments);\n}\n\nexport function setConsumer(newConsumer) {\n return consumer = newConsumer;\n}\nexport function createConsumer() {\n return _createConsumer.apply(this, arguments);\n}\n\nfunction _createConsumer() {\n _createConsumer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _yield$import, createConsumer;\n\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return import(\n /* webpackChunkName: \"actioncable\" */\n \"@rails/actioncable/src\");\n\n case 2:\n _yield$import = _context2.sent;\n createConsumer = _yield$import.createConsumer;\n return _context2.abrupt(\"return\", createConsumer());\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return _createConsumer.apply(this, arguments);\n}\n\nexport function subscribeTo(_x, _x2) {\n return _subscribeTo.apply(this, arguments);\n}\n\nfunction _subscribeTo() {\n _subscribeTo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(channel, mixin) {\n var _yield$getConsumer, subscriptions;\n\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return getConsumer();\n\n case 2:\n _yield$getConsumer = _context3.sent;\n subscriptions = _yield$getConsumer.subscriptions;\n return _context3.abrupt(\"return\", subscriptions.create(channel, mixin));\n\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n return _subscribeTo.apply(this, arguments);\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator.return && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { connectStreamSource, disconnectStreamSource } from \"@hotwired/turbo\";\nimport { subscribeTo } from \"./cable\";\nimport snakeize from \"./snakeize\";\n\nvar TurboCableStreamSourceElement = /*#__PURE__*/function (_HTMLElement) {\n _inherits(TurboCableStreamSourceElement, _HTMLElement);\n\n var _super = _createSuper(TurboCableStreamSourceElement);\n\n function TurboCableStreamSourceElement() {\n _classCallCheck(this, TurboCableStreamSourceElement);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(TurboCableStreamSourceElement, [{\n key: \"connectedCallback\",\n value: function () {\n var _connectedCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n connectStreamSource(this);\n _context.next = 3;\n return subscribeTo(this.channel, {\n received: this.dispatchMessageEvent.bind(this)\n });\n\n case 3:\n this.subscription = _context.sent;\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function connectedCallback() {\n return _connectedCallback.apply(this, arguments);\n }\n\n return connectedCallback;\n }()\n }, {\n key: \"disconnectedCallback\",\n value: function disconnectedCallback() {\n disconnectStreamSource(this);\n if (this.subscription) this.subscription.unsubscribe();\n }\n }, {\n key: \"dispatchMessageEvent\",\n value: function dispatchMessageEvent(data) {\n var event = new MessageEvent(\"message\", {\n data: data\n });\n return this.dispatchEvent(event);\n }\n }, {\n key: \"channel\",\n get: function get() {\n var channel = this.getAttribute(\"channel\");\n var signed_stream_name = this.getAttribute(\"signed-stream-name\");\n return _objectSpread({\n channel: channel,\n signed_stream_name: signed_stream_name\n }, snakeize(_objectSpread({}, this.dataset)));\n }\n }]);\n\n return TurboCableStreamSourceElement;\n}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));\n\ncustomElements.define(\"turbo-cable-stream-source\", TurboCableStreamSourceElement);","export function overrideMethodWithFormmethod(_ref) {\n var _ref$detail$formSubmi = _ref.detail.formSubmission,\n fetchRequest = _ref$detail$formSubmi.fetchRequest,\n submitter = _ref$detail$formSubmi.submitter;\n\n if (submitter && submitter.formMethod && fetchRequest.body.has(\"_method\")) {\n fetchRequest.body.set(\"_method\", submitter.formMethod);\n }\n}","import \"./cable_stream_source_element\";\nimport { overrideMethodWithFormmethod } from \"./form_submissions\";\nimport * as Turbo from \"@hotwired/turbo\";\nexport { Turbo };\nimport * as cable from \"./cable\";\nexport { cable };\naddEventListener(\"turbo:submit-start\", overrideMethodWithFormmethod);","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n// Based on https://github.com/nathan7/snakeize\n//\n// This software is released under the MIT license:\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nexport default function walk(obj) {\n if (!obj || _typeof(obj) !== 'object') return obj;\n if (obj instanceof Date || obj instanceof RegExp) return obj;\n if (Array.isArray(obj)) return obj.map(walk);\n return Object.keys(obj).reduce(function (acc, key) {\n var camel = key[0].toLowerCase() + key.slice(1).replace(/([A-Z]+)/g, function (m, x) {\n return '_' + x.toLowerCase();\n });\n acc[camel] = walk(obj[key]);\n return acc;\n }, {});\n}\n;","var _templateObject, _templateObject2;\n\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator.return && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/*\nTurbo 7.1.0\nCopyright © 2021 Basecamp, LLC\n */\n(function () {\n if (window.Reflect === undefined || window.customElements === undefined || window.customElements.polyfillWrapFlushCallback) {\n return;\n }\n\n var BuiltInHTMLElement = HTMLElement;\n var wrapperForTheName = {\n 'HTMLElement': function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor);\n }\n };\n window.HTMLElement = wrapperForTheName['HTMLElement'];\n HTMLElement.prototype = BuiltInHTMLElement.prototype;\n HTMLElement.prototype.constructor = HTMLElement;\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);\n})();\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2019 Javan Makhmali\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n(function (prototype) {\n if (typeof prototype.requestSubmit == \"function\") return;\n\n prototype.requestSubmit = function (submitter) {\n if (submitter) {\n validateSubmitter(submitter, this);\n submitter.click();\n } else {\n submitter = document.createElement(\"input\");\n submitter.type = \"submit\";\n submitter.hidden = true;\n this.appendChild(submitter);\n submitter.click();\n this.removeChild(submitter);\n }\n };\n\n function validateSubmitter(submitter, form) {\n submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\");\n submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\");\n submitter.form == form || raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\");\n }\n\n function raise(errorConstructor, message, name) {\n throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name);\n }\n})(HTMLFormElement.prototype);\n\nvar submittersByForm = new WeakMap();\n\nfunction findSubmitterFromClickTarget(target) {\n var element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n var candidate = element ? element.closest(\"input, button\") : null;\n return (candidate === null || candidate === void 0 ? void 0 : candidate.type) == \"submit\" ? candidate : null;\n}\n\nfunction clickCaptured(event) {\n var submitter = findSubmitterFromClickTarget(event.target);\n\n if (submitter && submitter.form) {\n submittersByForm.set(submitter.form, submitter);\n }\n}\n\n(function () {\n if (\"submitter\" in Event.prototype) return;\n var prototype;\n\n if (\"SubmitEvent\" in window && /Apple Computer/.test(navigator.vendor)) {\n prototype = window.SubmitEvent.prototype;\n } else if (\"SubmitEvent\" in window) {\n return;\n } else {\n prototype = window.Event.prototype;\n }\n\n addEventListener(\"click\", clickCaptured, true);\n Object.defineProperty(prototype, \"submitter\", {\n get: function get() {\n if (this.type == \"submit\" && this.target instanceof HTMLFormElement) {\n return submittersByForm.get(this.target);\n }\n }\n });\n})();\n\nvar FrameLoadingStyle;\n\n(function (FrameLoadingStyle) {\n FrameLoadingStyle[\"eager\"] = \"eager\";\n FrameLoadingStyle[\"lazy\"] = \"lazy\";\n})(FrameLoadingStyle || (FrameLoadingStyle = {}));\n\nvar FrameElement = /*#__PURE__*/function (_HTMLElement) {\n _inherits(FrameElement, _HTMLElement);\n\n var _super = _createSuper(FrameElement);\n\n function FrameElement() {\n var _this;\n\n _classCallCheck(this, FrameElement);\n\n _this = _super.call(this);\n _this.loaded = Promise.resolve();\n _this.delegate = new FrameElement.delegateConstructor(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(FrameElement, [{\n key: \"connectedCallback\",\n value: function connectedCallback() {\n this.delegate.connect();\n }\n }, {\n key: \"disconnectedCallback\",\n value: function disconnectedCallback() {\n this.delegate.disconnect();\n }\n }, {\n key: \"reload\",\n value: function reload() {\n var src = this.src;\n this.src = null;\n this.src = src;\n }\n }, {\n key: \"attributeChangedCallback\",\n value: function attributeChangedCallback(name) {\n if (name == \"loading\") {\n this.delegate.loadingStyleChanged();\n } else if (name == \"src\") {\n this.delegate.sourceURLChanged();\n } else {\n this.delegate.disabledChanged();\n }\n }\n }, {\n key: \"src\",\n get: function get() {\n return this.getAttribute(\"src\");\n },\n set: function set(value) {\n if (value) {\n this.setAttribute(\"src\", value);\n } else {\n this.removeAttribute(\"src\");\n }\n }\n }, {\n key: \"loading\",\n get: function get() {\n return frameLoadingStyleFromString(this.getAttribute(\"loading\") || \"\");\n },\n set: function set(value) {\n if (value) {\n this.setAttribute(\"loading\", value);\n } else {\n this.removeAttribute(\"loading\");\n }\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return this.hasAttribute(\"disabled\");\n },\n set: function set(value) {\n if (value) {\n this.setAttribute(\"disabled\", \"\");\n } else {\n this.removeAttribute(\"disabled\");\n }\n }\n }, {\n key: \"autoscroll\",\n get: function get() {\n return this.hasAttribute(\"autoscroll\");\n },\n set: function set(value) {\n if (value) {\n this.setAttribute(\"autoscroll\", \"\");\n } else {\n this.removeAttribute(\"autoscroll\");\n }\n }\n }, {\n key: \"complete\",\n get: function get() {\n return !this.delegate.isLoading;\n }\n }, {\n key: \"isActive\",\n get: function get() {\n return this.ownerDocument === document && !this.isPreview;\n }\n }, {\n key: \"isPreview\",\n get: function get() {\n var _a, _b;\n\n return (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.hasAttribute(\"data-turbo-preview\");\n }\n }], [{\n key: \"observedAttributes\",\n get: function get() {\n return [\"disabled\", \"loading\", \"src\"];\n }\n }]);\n\n return FrameElement;\n}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));\n\nfunction frameLoadingStyleFromString(style) {\n switch (style.toLowerCase()) {\n case \"lazy\":\n return FrameLoadingStyle.lazy;\n\n default:\n return FrameLoadingStyle.eager;\n }\n}\n\nfunction expandURL(locatable) {\n return new URL(locatable.toString(), document.baseURI);\n}\n\nfunction getAnchor(url) {\n var anchorMatch;\n\n if (url.hash) {\n return url.hash.slice(1);\n } else if (anchorMatch = url.href.match(/#(.*)$/)) {\n return anchorMatch[1];\n }\n}\n\nfunction getAction(form, submitter) {\n var action = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formaction\")) || form.getAttribute(\"action\") || form.action;\n return expandURL(action);\n}\n\nfunction getExtension(url) {\n return (getLastPathComponent(url).match(/\\.[^.]*$/) || [])[0] || \"\";\n}\n\nfunction isHTML(url) {\n return !!getExtension(url).match(/^(?:|\\.(?:htm|html|xhtml))$/);\n}\n\nfunction isPrefixedBy(baseURL, url) {\n var prefix = getPrefix(url);\n return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix);\n}\n\nfunction locationIsVisitable(location, rootLocation) {\n return isPrefixedBy(location, rootLocation) && isHTML(location);\n}\n\nfunction getRequestURL(url) {\n var anchor = getAnchor(url);\n return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href;\n}\n\nfunction toCacheKey(url) {\n return getRequestURL(url);\n}\n\nfunction urlsAreEqual(left, right) {\n return expandURL(left).href == expandURL(right).href;\n}\n\nfunction getPathComponents(url) {\n return url.pathname.split(\"/\").slice(1);\n}\n\nfunction getLastPathComponent(url) {\n return getPathComponents(url).slice(-1)[0];\n}\n\nfunction getPrefix(url) {\n return addTrailingSlash(url.origin + url.pathname);\n}\n\nfunction addTrailingSlash(value) {\n return value.endsWith(\"/\") ? value : value + \"/\";\n}\n\nvar FetchResponse = /*#__PURE__*/function () {\n function FetchResponse(response) {\n _classCallCheck(this, FetchResponse);\n\n this.response = response;\n }\n\n _createClass(FetchResponse, [{\n key: \"succeeded\",\n get: function get() {\n return this.response.ok;\n }\n }, {\n key: \"failed\",\n get: function get() {\n return !this.succeeded;\n }\n }, {\n key: \"clientError\",\n get: function get() {\n return this.statusCode >= 400 && this.statusCode <= 499;\n }\n }, {\n key: \"serverError\",\n get: function get() {\n return this.statusCode >= 500 && this.statusCode <= 599;\n }\n }, {\n key: \"redirected\",\n get: function get() {\n return this.response.redirected;\n }\n }, {\n key: \"location\",\n get: function get() {\n return expandURL(this.response.url);\n }\n }, {\n key: \"isHTML\",\n get: function get() {\n return this.contentType && this.contentType.match(/^(?:text\\/([^\\s;,]+\\b)?html|application\\/xhtml\\+xml)\\b/);\n }\n }, {\n key: \"statusCode\",\n get: function get() {\n return this.response.status;\n }\n }, {\n key: \"contentType\",\n get: function get() {\n return this.header(\"Content-Type\");\n }\n }, {\n key: \"responseText\",\n get: function get() {\n return this.response.clone().text();\n }\n }, {\n key: \"responseHTML\",\n get: function get() {\n if (this.isHTML) {\n return this.response.clone().text();\n } else {\n return Promise.resolve(undefined);\n }\n }\n }, {\n key: \"header\",\n value: function header(name) {\n return this.response.headers.get(name);\n }\n }]);\n\n return FetchResponse;\n}();\n\nfunction dispatch(eventName) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n target = _ref.target,\n cancelable = _ref.cancelable,\n detail = _ref.detail;\n\n var event = new CustomEvent(eventName, {\n cancelable: cancelable,\n bubbles: true,\n detail: detail\n });\n\n if (target && target.isConnected) {\n target.dispatchEvent(event);\n } else {\n document.documentElement.dispatchEvent(event);\n }\n\n return event;\n}\n\nfunction nextAnimationFrame() {\n return new Promise(function (resolve) {\n return requestAnimationFrame(function () {\n return resolve();\n });\n });\n}\n\nfunction nextEventLoopTick() {\n return new Promise(function (resolve) {\n return setTimeout(function () {\n return resolve();\n }, 0);\n });\n}\n\nfunction nextMicrotask() {\n return Promise.resolve();\n}\n\nfunction parseHTMLDocument() {\n var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n return new DOMParser().parseFromString(html, \"text/html\");\n}\n\nfunction unindent(strings) {\n for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n values[_key - 1] = arguments[_key];\n }\n\n var lines = interpolate(strings, values).replace(/^\\n/, \"\").split(\"\\n\");\n var match = lines[0].match(/^\\s+/);\n var indent = match ? match[0].length : 0;\n return lines.map(function (line) {\n return line.slice(indent);\n }).join(\"\\n\");\n}\n\nfunction interpolate(strings, values) {\n return strings.reduce(function (result, string, i) {\n var value = values[i] == undefined ? \"\" : values[i];\n return result + string + value;\n }, \"\");\n}\n\nfunction uuid() {\n return Array.apply(null, {\n length: 36\n }).map(function (_, i) {\n if (i == 8 || i == 13 || i == 18 || i == 23) {\n return \"-\";\n } else if (i == 14) {\n return \"4\";\n } else if (i == 19) {\n return (Math.floor(Math.random() * 4) + 8).toString(16);\n } else {\n return Math.floor(Math.random() * 15).toString(16);\n }\n }).join(\"\");\n}\n\nfunction getAttribute(attributeName) {\n for (var _len2 = arguments.length, elements = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n elements[_key2 - 1] = arguments[_key2];\n }\n\n var _iterator = _createForOfIteratorHelper(elements.map(function (element) {\n return element === null || element === void 0 ? void 0 : element.getAttribute(attributeName);\n })),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var value = _step.value;\n if (typeof value == \"string\") return value;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return null;\n}\n\nfunction markAsBusy() {\n for (var _len3 = arguments.length, elements = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n elements[_key3] = arguments[_key3];\n }\n\n for (var _i = 0, _elements = elements; _i < _elements.length; _i++) {\n var element = _elements[_i];\n\n if (element.localName == \"turbo-frame\") {\n element.setAttribute(\"busy\", \"\");\n }\n\n element.setAttribute(\"aria-busy\", \"true\");\n }\n}\n\nfunction clearBusyState() {\n for (var _len4 = arguments.length, elements = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n elements[_key4] = arguments[_key4];\n }\n\n for (var _i2 = 0, _elements2 = elements; _i2 < _elements2.length; _i2++) {\n var element = _elements2[_i2];\n\n if (element.localName == \"turbo-frame\") {\n element.removeAttribute(\"busy\");\n }\n\n element.removeAttribute(\"aria-busy\");\n }\n}\n\nvar FetchMethod;\n\n(function (FetchMethod) {\n FetchMethod[FetchMethod[\"get\"] = 0] = \"get\";\n FetchMethod[FetchMethod[\"post\"] = 1] = \"post\";\n FetchMethod[FetchMethod[\"put\"] = 2] = \"put\";\n FetchMethod[FetchMethod[\"patch\"] = 3] = \"patch\";\n FetchMethod[FetchMethod[\"delete\"] = 4] = \"delete\";\n})(FetchMethod || (FetchMethod = {}));\n\nfunction fetchMethodFromString(method) {\n switch (method.toLowerCase()) {\n case \"get\":\n return FetchMethod.get;\n\n case \"post\":\n return FetchMethod.post;\n\n case \"put\":\n return FetchMethod.put;\n\n case \"patch\":\n return FetchMethod.patch;\n\n case \"delete\":\n return FetchMethod.delete;\n }\n}\n\nvar FetchRequest = /*#__PURE__*/function () {\n function FetchRequest(delegate, method, location) {\n var body = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new URLSearchParams();\n var target = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;\n\n _classCallCheck(this, FetchRequest);\n\n this.abortController = new AbortController();\n\n this.resolveRequestPromise = function (value) {};\n\n this.delegate = delegate;\n this.method = method;\n this.headers = this.defaultHeaders;\n this.body = body;\n this.url = location;\n this.target = target;\n }\n\n _createClass(FetchRequest, [{\n key: \"location\",\n get: function get() {\n return this.url;\n }\n }, {\n key: \"params\",\n get: function get() {\n return this.url.searchParams;\n }\n }, {\n key: \"entries\",\n get: function get() {\n return this.body ? Array.from(this.body.entries()) : [];\n }\n }, {\n key: \"cancel\",\n value: function cancel() {\n this.abortController.abort();\n }\n }, {\n key: \"perform\",\n value: function () {\n var _perform = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _a, _b, fetchOptions, response;\n\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n fetchOptions = this.fetchOptions;\n (_b = (_a = this.delegate).prepareHeadersForRequest) === null || _b === void 0 ? void 0 : _b.call(_a, this.headers, this);\n _context.next = 4;\n return this.allowRequestToBeIntercepted(fetchOptions);\n\n case 4:\n _context.prev = 4;\n this.delegate.requestStarted(this);\n _context.next = 8;\n return fetch(this.url.href, fetchOptions);\n\n case 8:\n response = _context.sent;\n _context.next = 11;\n return this.receive(response);\n\n case 11:\n return _context.abrupt(\"return\", _context.sent);\n\n case 14:\n _context.prev = 14;\n _context.t0 = _context[\"catch\"](4);\n\n if (!(_context.t0.name !== 'AbortError')) {\n _context.next = 19;\n break;\n }\n\n this.delegate.requestErrored(this, _context.t0);\n throw _context.t0;\n\n case 19:\n _context.prev = 19;\n this.delegate.requestFinished(this);\n return _context.finish(19);\n\n case 22:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[4, 14, 19, 22]]);\n }));\n\n function perform() {\n return _perform.apply(this, arguments);\n }\n\n return perform;\n }()\n }, {\n key: \"receive\",\n value: function () {\n var _receive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(response) {\n var fetchResponse, event;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n fetchResponse = new FetchResponse(response);\n event = dispatch(\"turbo:before-fetch-response\", {\n cancelable: true,\n detail: {\n fetchResponse: fetchResponse\n },\n target: this.target\n });\n\n if (event.defaultPrevented) {\n this.delegate.requestPreventedHandlingResponse(this, fetchResponse);\n } else if (fetchResponse.succeeded) {\n this.delegate.requestSucceededWithResponse(this, fetchResponse);\n } else {\n this.delegate.requestFailedWithResponse(this, fetchResponse);\n }\n\n return _context2.abrupt(\"return\", fetchResponse);\n\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function receive(_x) {\n return _receive.apply(this, arguments);\n }\n\n return receive;\n }()\n }, {\n key: \"fetchOptions\",\n get: function get() {\n var _a;\n\n return {\n method: FetchMethod[this.method].toUpperCase(),\n credentials: \"same-origin\",\n headers: this.headers,\n redirect: \"follow\",\n body: this.isIdempotent ? null : this.body,\n signal: this.abortSignal,\n referrer: (_a = this.delegate.referrer) === null || _a === void 0 ? void 0 : _a.href\n };\n }\n }, {\n key: \"defaultHeaders\",\n get: function get() {\n return {\n \"Accept\": \"text/html, application/xhtml+xml\"\n };\n }\n }, {\n key: \"isIdempotent\",\n get: function get() {\n return this.method == FetchMethod.get;\n }\n }, {\n key: \"abortSignal\",\n get: function get() {\n return this.abortController.signal;\n }\n }, {\n key: \"allowRequestToBeIntercepted\",\n value: function () {\n var _allowRequestToBeIntercepted = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(fetchOptions) {\n var _this2 = this;\n\n var requestInterception, event;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n requestInterception = new Promise(function (resolve) {\n return _this2.resolveRequestPromise = resolve;\n });\n event = dispatch(\"turbo:before-fetch-request\", {\n cancelable: true,\n detail: {\n fetchOptions: fetchOptions,\n url: this.url,\n resume: this.resolveRequestPromise\n },\n target: this.target\n });\n\n if (!event.defaultPrevented) {\n _context3.next = 5;\n break;\n }\n\n _context3.next = 5;\n return requestInterception;\n\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function allowRequestToBeIntercepted(_x2) {\n return _allowRequestToBeIntercepted.apply(this, arguments);\n }\n\n return allowRequestToBeIntercepted;\n }()\n }]);\n\n return FetchRequest;\n}();\n\nvar AppearanceObserver = /*#__PURE__*/function () {\n function AppearanceObserver(delegate, element) {\n var _this3 = this;\n\n _classCallCheck(this, AppearanceObserver);\n\n this.started = false;\n\n this.intersect = function (entries) {\n var lastEntry = entries.slice(-1)[0];\n\n if (lastEntry === null || lastEntry === void 0 ? void 0 : lastEntry.isIntersecting) {\n _this3.delegate.elementAppearedInViewport(_this3.element);\n }\n };\n\n this.delegate = delegate;\n this.element = element;\n this.intersectionObserver = new IntersectionObserver(this.intersect);\n }\n\n _createClass(AppearanceObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n this.intersectionObserver.observe(this.element);\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.started = false;\n this.intersectionObserver.unobserve(this.element);\n }\n }\n }]);\n\n return AppearanceObserver;\n}();\n\nvar StreamMessage = /*#__PURE__*/function () {\n function StreamMessage(html) {\n _classCallCheck(this, StreamMessage);\n\n this.templateElement = document.createElement(\"template\");\n this.templateElement.innerHTML = html;\n }\n\n _createClass(StreamMessage, [{\n key: \"fragment\",\n get: function get() {\n var fragment = document.createDocumentFragment();\n\n var _iterator2 = _createForOfIteratorHelper(this.foreignElements),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var element = _step2.value;\n fragment.appendChild(document.importNode(element, true));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return fragment;\n }\n }, {\n key: \"foreignElements\",\n get: function get() {\n return this.templateChildren.reduce(function (streamElements, child) {\n if (child.tagName.toLowerCase() == \"turbo-stream\") {\n return [].concat(_toConsumableArray(streamElements), [child]);\n } else {\n return streamElements;\n }\n }, []);\n }\n }, {\n key: \"templateChildren\",\n get: function get() {\n return Array.from(this.templateElement.content.children);\n }\n }], [{\n key: \"wrap\",\n value: function wrap(message) {\n if (typeof message == \"string\") {\n return new this(message);\n } else {\n return message;\n }\n }\n }]);\n\n return StreamMessage;\n}();\n\nStreamMessage.contentType = \"text/vnd.turbo-stream.html\";\nvar FormSubmissionState;\n\n(function (FormSubmissionState) {\n FormSubmissionState[FormSubmissionState[\"initialized\"] = 0] = \"initialized\";\n FormSubmissionState[FormSubmissionState[\"requesting\"] = 1] = \"requesting\";\n FormSubmissionState[FormSubmissionState[\"waiting\"] = 2] = \"waiting\";\n FormSubmissionState[FormSubmissionState[\"receiving\"] = 3] = \"receiving\";\n FormSubmissionState[FormSubmissionState[\"stopping\"] = 4] = \"stopping\";\n FormSubmissionState[FormSubmissionState[\"stopped\"] = 5] = \"stopped\";\n})(FormSubmissionState || (FormSubmissionState = {}));\n\nvar FormEnctype;\n\n(function (FormEnctype) {\n FormEnctype[\"urlEncoded\"] = \"application/x-www-form-urlencoded\";\n FormEnctype[\"multipart\"] = \"multipart/form-data\";\n FormEnctype[\"plain\"] = \"text/plain\";\n})(FormEnctype || (FormEnctype = {}));\n\nfunction formEnctypeFromString(encoding) {\n switch (encoding.toLowerCase()) {\n case FormEnctype.multipart:\n return FormEnctype.multipart;\n\n case FormEnctype.plain:\n return FormEnctype.plain;\n\n default:\n return FormEnctype.urlEncoded;\n }\n}\n\nvar FormSubmission = /*#__PURE__*/function () {\n function FormSubmission(delegate, formElement, submitter) {\n var mustRedirect = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n _classCallCheck(this, FormSubmission);\n\n this.state = FormSubmissionState.initialized;\n this.delegate = delegate;\n this.formElement = formElement;\n this.submitter = submitter;\n this.formData = buildFormData(formElement, submitter);\n this.location = expandURL(this.action);\n\n if (this.method == FetchMethod.get) {\n mergeFormDataEntries(this.location, _toConsumableArray(this.body.entries()));\n }\n\n this.fetchRequest = new FetchRequest(this, this.method, this.location, this.body, this.formElement);\n this.mustRedirect = mustRedirect;\n }\n\n _createClass(FormSubmission, [{\n key: \"method\",\n get: function get() {\n var _a;\n\n var method = ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formmethod\")) || this.formElement.getAttribute(\"method\") || \"\";\n return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get;\n }\n }, {\n key: \"action\",\n get: function get() {\n var _a;\n\n var formElementAction = typeof this.formElement.action === 'string' ? this.formElement.action : null;\n return ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formaction\")) || this.formElement.getAttribute(\"action\") || formElementAction || \"\";\n }\n }, {\n key: \"body\",\n get: function get() {\n if (this.enctype == FormEnctype.urlEncoded || this.method == FetchMethod.get) {\n return new URLSearchParams(this.stringFormData);\n } else {\n return this.formData;\n }\n }\n }, {\n key: \"enctype\",\n get: function get() {\n var _a;\n\n return formEnctypeFromString(((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formenctype\")) || this.formElement.enctype);\n }\n }, {\n key: \"isIdempotent\",\n get: function get() {\n return this.fetchRequest.isIdempotent;\n }\n }, {\n key: \"stringFormData\",\n get: function get() {\n return _toConsumableArray(this.formData).reduce(function (entries, _ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n name = _ref3[0],\n value = _ref3[1];\n\n return entries.concat(typeof value == \"string\" ? [[name, value]] : []);\n }, []);\n }\n }, {\n key: \"confirmationMessage\",\n get: function get() {\n return this.formElement.getAttribute(\"data-turbo-confirm\");\n }\n }, {\n key: \"needsConfirmation\",\n get: function get() {\n return this.confirmationMessage !== null;\n }\n }, {\n key: \"start\",\n value: function () {\n var _start = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _FormSubmissionState, initialized, requesting, answer;\n\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _FormSubmissionState = FormSubmissionState, initialized = _FormSubmissionState.initialized, requesting = _FormSubmissionState.requesting;\n\n if (!this.needsConfirmation) {\n _context4.next = 5;\n break;\n }\n\n answer = FormSubmission.confirmMethod(this.confirmationMessage, this.formElement);\n\n if (answer) {\n _context4.next = 5;\n break;\n }\n\n return _context4.abrupt(\"return\");\n\n case 5:\n if (!(this.state == initialized)) {\n _context4.next = 8;\n break;\n }\n\n this.state = requesting;\n return _context4.abrupt(\"return\", this.fetchRequest.perform());\n\n case 8:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function start() {\n return _start.apply(this, arguments);\n }\n\n return start;\n }()\n }, {\n key: \"stop\",\n value: function stop() {\n var _FormSubmissionState2 = FormSubmissionState,\n stopping = _FormSubmissionState2.stopping,\n stopped = _FormSubmissionState2.stopped;\n\n if (this.state != stopping && this.state != stopped) {\n this.state = stopping;\n this.fetchRequest.cancel();\n return true;\n }\n }\n }, {\n key: \"prepareHeadersForRequest\",\n value: function prepareHeadersForRequest(headers, request) {\n if (!request.isIdempotent) {\n var token = getCookieValue(getMetaContent(\"csrf-param\")) || getMetaContent(\"csrf-token\");\n\n if (token) {\n headers[\"X-CSRF-Token\"] = token;\n }\n\n headers[\"Accept\"] = [StreamMessage.contentType, headers[\"Accept\"]].join(\", \");\n }\n }\n }, {\n key: \"requestStarted\",\n value: function requestStarted(request) {\n var _a;\n\n this.state = FormSubmissionState.waiting;\n (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.setAttribute(\"disabled\", \"\");\n dispatch(\"turbo:submit-start\", {\n target: this.formElement,\n detail: {\n formSubmission: this\n }\n });\n this.delegate.formSubmissionStarted(this);\n }\n }, {\n key: \"requestPreventedHandlingResponse\",\n value: function requestPreventedHandlingResponse(request, response) {\n this.result = {\n success: response.succeeded,\n fetchResponse: response\n };\n }\n }, {\n key: \"requestSucceededWithResponse\",\n value: function requestSucceededWithResponse(request, response) {\n if (response.clientError || response.serverError) {\n this.delegate.formSubmissionFailedWithResponse(this, response);\n } else if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {\n var error = new Error(\"Form responses must redirect to another location\");\n this.delegate.formSubmissionErrored(this, error);\n } else {\n this.state = FormSubmissionState.receiving;\n this.result = {\n success: true,\n fetchResponse: response\n };\n this.delegate.formSubmissionSucceededWithResponse(this, response);\n }\n }\n }, {\n key: \"requestFailedWithResponse\",\n value: function requestFailedWithResponse(request, response) {\n this.result = {\n success: false,\n fetchResponse: response\n };\n this.delegate.formSubmissionFailedWithResponse(this, response);\n }\n }, {\n key: \"requestErrored\",\n value: function requestErrored(request, error) {\n this.result = {\n success: false,\n error: error\n };\n this.delegate.formSubmissionErrored(this, error);\n }\n }, {\n key: \"requestFinished\",\n value: function requestFinished(request) {\n var _a;\n\n this.state = FormSubmissionState.stopped;\n (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.removeAttribute(\"disabled\");\n dispatch(\"turbo:submit-end\", {\n target: this.formElement,\n detail: Object.assign({\n formSubmission: this\n }, this.result)\n });\n this.delegate.formSubmissionFinished(this);\n }\n }, {\n key: \"requestMustRedirect\",\n value: function requestMustRedirect(request) {\n return !request.isIdempotent && this.mustRedirect;\n }\n }], [{\n key: \"confirmMethod\",\n value: function confirmMethod(message, element) {\n return confirm(message);\n }\n }]);\n\n return FormSubmission;\n}();\n\nfunction buildFormData(formElement, submitter) {\n var formData = new FormData(formElement);\n var name = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"name\");\n var value = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"value\");\n\n if (name && value != null && formData.get(name) != value) {\n formData.append(name, value);\n }\n\n return formData;\n}\n\nfunction getCookieValue(cookieName) {\n if (cookieName != null) {\n var cookies = document.cookie ? document.cookie.split(\"; \") : [];\n var cookie = cookies.find(function (cookie) {\n return cookie.startsWith(cookieName);\n });\n\n if (cookie) {\n var value = cookie.split(\"=\").slice(1).join(\"=\");\n return value ? decodeURIComponent(value) : undefined;\n }\n }\n}\n\nfunction getMetaContent(name) {\n var element = document.querySelector(\"meta[name=\\\"\".concat(name, \"\\\"]\"));\n return element && element.content;\n}\n\nfunction responseSucceededWithoutRedirect(response) {\n return response.statusCode == 200 && !response.redirected;\n}\n\nfunction mergeFormDataEntries(url, entries) {\n var searchParams = new URLSearchParams();\n\n var _iterator3 = _createForOfIteratorHelper(entries),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _ref6 = _step3.value;\n\n var _ref5 = _slicedToArray(_ref6, 2);\n\n var name = _ref5[0];\n var value = _ref5[1];\n if (value instanceof File) continue;\n searchParams.append(name, value);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n url.search = searchParams.toString();\n return url;\n}\n\nvar Snapshot = /*#__PURE__*/function () {\n function Snapshot(element) {\n _classCallCheck(this, Snapshot);\n\n this.element = element;\n }\n\n _createClass(Snapshot, [{\n key: \"children\",\n get: function get() {\n return _toConsumableArray(this.element.children);\n }\n }, {\n key: \"hasAnchor\",\n value: function hasAnchor(anchor) {\n return this.getElementForAnchor(anchor) != null;\n }\n }, {\n key: \"getElementForAnchor\",\n value: function getElementForAnchor(anchor) {\n return anchor ? this.element.querySelector(\"[id='\".concat(anchor, \"'], a[name='\").concat(anchor, \"']\")) : null;\n }\n }, {\n key: \"isConnected\",\n get: function get() {\n return this.element.isConnected;\n }\n }, {\n key: \"firstAutofocusableElement\",\n get: function get() {\n return this.element.querySelector(\"[autofocus]\");\n }\n }, {\n key: \"permanentElements\",\n get: function get() {\n return _toConsumableArray(this.element.querySelectorAll(\"[id][data-turbo-permanent]\"));\n }\n }, {\n key: \"getPermanentElementById\",\n value: function getPermanentElementById(id) {\n return this.element.querySelector(\"#\".concat(id, \"[data-turbo-permanent]\"));\n }\n }, {\n key: \"getPermanentElementMapForSnapshot\",\n value: function getPermanentElementMapForSnapshot(snapshot) {\n var permanentElementMap = {};\n\n var _iterator4 = _createForOfIteratorHelper(this.permanentElements),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var currentPermanentElement = _step4.value;\n var id = currentPermanentElement.id;\n var newPermanentElement = snapshot.getPermanentElementById(id);\n\n if (newPermanentElement) {\n permanentElementMap[id] = [currentPermanentElement, newPermanentElement];\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n return permanentElementMap;\n }\n }]);\n\n return Snapshot;\n}();\n\nvar FormInterceptor = /*#__PURE__*/function () {\n function FormInterceptor(delegate, element) {\n var _this4 = this;\n\n _classCallCheck(this, FormInterceptor);\n\n this.submitBubbled = function (event) {\n var form = event.target;\n\n if (!event.defaultPrevented && form instanceof HTMLFormElement && form.closest(\"turbo-frame, html\") == _this4.element) {\n var submitter = event.submitter || undefined;\n var method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formmethod\")) || form.method;\n\n if (method != \"dialog\" && _this4.delegate.shouldInterceptFormSubmission(form, submitter)) {\n event.preventDefault();\n event.stopImmediatePropagation();\n\n _this4.delegate.formSubmissionIntercepted(form, submitter);\n }\n }\n };\n\n this.delegate = delegate;\n this.element = element;\n }\n\n _createClass(FormInterceptor, [{\n key: \"start\",\n value: function start() {\n this.element.addEventListener(\"submit\", this.submitBubbled);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.element.removeEventListener(\"submit\", this.submitBubbled);\n }\n }]);\n\n return FormInterceptor;\n}();\n\nvar View = /*#__PURE__*/function () {\n function View(delegate, element) {\n _classCallCheck(this, View);\n\n this.resolveRenderPromise = function (value) {};\n\n this.resolveInterceptionPromise = function (value) {};\n\n this.delegate = delegate;\n this.element = element;\n }\n\n _createClass(View, [{\n key: \"scrollToAnchor\",\n value: function scrollToAnchor(anchor) {\n var element = this.snapshot.getElementForAnchor(anchor);\n\n if (element) {\n this.scrollToElement(element);\n this.focusElement(element);\n } else {\n this.scrollToPosition({\n x: 0,\n y: 0\n });\n }\n }\n }, {\n key: \"scrollToAnchorFromLocation\",\n value: function scrollToAnchorFromLocation(location) {\n this.scrollToAnchor(getAnchor(location));\n }\n }, {\n key: \"scrollToElement\",\n value: function scrollToElement(element) {\n element.scrollIntoView();\n }\n }, {\n key: \"focusElement\",\n value: function focusElement(element) {\n if (element instanceof HTMLElement) {\n if (element.hasAttribute(\"tabindex\")) {\n element.focus();\n } else {\n element.setAttribute(\"tabindex\", \"-1\");\n element.focus();\n element.removeAttribute(\"tabindex\");\n }\n }\n }\n }, {\n key: \"scrollToPosition\",\n value: function scrollToPosition(_ref7) {\n var x = _ref7.x,\n y = _ref7.y;\n this.scrollRoot.scrollTo(x, y);\n }\n }, {\n key: \"scrollToTop\",\n value: function scrollToTop() {\n this.scrollToPosition({\n x: 0,\n y: 0\n });\n }\n }, {\n key: \"scrollRoot\",\n get: function get() {\n return window;\n }\n }, {\n key: \"render\",\n value: function () {\n var _render = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(renderer) {\n var _this5 = this;\n\n var isPreview, shouldRender, snapshot, renderInterception, immediateRender;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n isPreview = renderer.isPreview, shouldRender = renderer.shouldRender, snapshot = renderer.newSnapshot;\n\n if (!shouldRender) {\n _context5.next = 22;\n break;\n }\n\n _context5.prev = 2;\n this.renderPromise = new Promise(function (resolve) {\n return _this5.resolveRenderPromise = resolve;\n });\n this.renderer = renderer;\n this.prepareToRenderSnapshot(renderer);\n renderInterception = new Promise(function (resolve) {\n return _this5.resolveInterceptionPromise = resolve;\n });\n immediateRender = this.delegate.allowsImmediateRender(snapshot, this.resolveInterceptionPromise);\n\n if (immediateRender) {\n _context5.next = 11;\n break;\n }\n\n _context5.next = 11;\n return renderInterception;\n\n case 11:\n _context5.next = 13;\n return this.renderSnapshot(renderer);\n\n case 13:\n this.delegate.viewRenderedSnapshot(snapshot, isPreview);\n this.finishRenderingSnapshot(renderer);\n\n case 15:\n _context5.prev = 15;\n delete this.renderer;\n this.resolveRenderPromise(undefined);\n delete this.renderPromise;\n return _context5.finish(15);\n\n case 20:\n _context5.next = 23;\n break;\n\n case 22:\n this.invalidate();\n\n case 23:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this, [[2,, 15, 20]]);\n }));\n\n function render(_x3) {\n return _render.apply(this, arguments);\n }\n\n return render;\n }()\n }, {\n key: \"invalidate\",\n value: function invalidate() {\n this.delegate.viewInvalidated();\n }\n }, {\n key: \"prepareToRenderSnapshot\",\n value: function prepareToRenderSnapshot(renderer) {\n this.markAsPreview(renderer.isPreview);\n renderer.prepareToRender();\n }\n }, {\n key: \"markAsPreview\",\n value: function markAsPreview(isPreview) {\n if (isPreview) {\n this.element.setAttribute(\"data-turbo-preview\", \"\");\n } else {\n this.element.removeAttribute(\"data-turbo-preview\");\n }\n }\n }, {\n key: \"renderSnapshot\",\n value: function () {\n var _renderSnapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(renderer) {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return renderer.render();\n\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6);\n }));\n\n function renderSnapshot(_x4) {\n return _renderSnapshot.apply(this, arguments);\n }\n\n return renderSnapshot;\n }()\n }, {\n key: \"finishRenderingSnapshot\",\n value: function finishRenderingSnapshot(renderer) {\n renderer.finishRendering();\n }\n }]);\n\n return View;\n}();\n\nvar FrameView = /*#__PURE__*/function (_View) {\n _inherits(FrameView, _View);\n\n var _super2 = _createSuper(FrameView);\n\n function FrameView() {\n _classCallCheck(this, FrameView);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(FrameView, [{\n key: \"invalidate\",\n value: function invalidate() {\n this.element.innerHTML = \"\";\n }\n }, {\n key: \"snapshot\",\n get: function get() {\n return new Snapshot(this.element);\n }\n }]);\n\n return FrameView;\n}(View);\n\nvar LinkInterceptor = /*#__PURE__*/function () {\n function LinkInterceptor(delegate, element) {\n var _this6 = this;\n\n _classCallCheck(this, LinkInterceptor);\n\n this.clickBubbled = function (event) {\n if (_this6.respondsToEventTarget(event.target)) {\n _this6.clickEvent = event;\n } else {\n delete _this6.clickEvent;\n }\n };\n\n this.linkClicked = function (event) {\n if (_this6.clickEvent && _this6.respondsToEventTarget(event.target) && event.target instanceof Element) {\n if (_this6.delegate.shouldInterceptLinkClick(event.target, event.detail.url)) {\n _this6.clickEvent.preventDefault();\n\n event.preventDefault();\n\n _this6.delegate.linkClickIntercepted(event.target, event.detail.url);\n }\n }\n\n delete _this6.clickEvent;\n };\n\n this.willVisit = function () {\n delete _this6.clickEvent;\n };\n\n this.delegate = delegate;\n this.element = element;\n }\n\n _createClass(LinkInterceptor, [{\n key: \"start\",\n value: function start() {\n this.element.addEventListener(\"click\", this.clickBubbled);\n document.addEventListener(\"turbo:click\", this.linkClicked);\n document.addEventListener(\"turbo:before-visit\", this.willVisit);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.element.removeEventListener(\"click\", this.clickBubbled);\n document.removeEventListener(\"turbo:click\", this.linkClicked);\n document.removeEventListener(\"turbo:before-visit\", this.willVisit);\n }\n }, {\n key: \"respondsToEventTarget\",\n value: function respondsToEventTarget(target) {\n var element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n return element && element.closest(\"turbo-frame, html\") == this.element;\n }\n }]);\n\n return LinkInterceptor;\n}();\n\nvar Bardo = /*#__PURE__*/function () {\n function Bardo(permanentElementMap) {\n _classCallCheck(this, Bardo);\n\n this.permanentElementMap = permanentElementMap;\n }\n\n _createClass(Bardo, [{\n key: \"enter\",\n value: function enter() {\n for (var id in this.permanentElementMap) {\n var _this$permanentElemen = _slicedToArray(this.permanentElementMap[id], 2),\n newPermanentElement = _this$permanentElemen[1];\n\n this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);\n }\n }\n }, {\n key: \"leave\",\n value: function leave() {\n for (var id in this.permanentElementMap) {\n var _this$permanentElemen2 = _slicedToArray(this.permanentElementMap[id], 1),\n currentPermanentElement = _this$permanentElemen2[0];\n\n this.replaceCurrentPermanentElementWithClone(currentPermanentElement);\n this.replacePlaceholderWithPermanentElement(currentPermanentElement);\n }\n }\n }, {\n key: \"replaceNewPermanentElementWithPlaceholder\",\n value: function replaceNewPermanentElementWithPlaceholder(permanentElement) {\n var placeholder = createPlaceholderForPermanentElement(permanentElement);\n permanentElement.replaceWith(placeholder);\n }\n }, {\n key: \"replaceCurrentPermanentElementWithClone\",\n value: function replaceCurrentPermanentElementWithClone(permanentElement) {\n var clone = permanentElement.cloneNode(true);\n permanentElement.replaceWith(clone);\n }\n }, {\n key: \"replacePlaceholderWithPermanentElement\",\n value: function replacePlaceholderWithPermanentElement(permanentElement) {\n var placeholder = this.getPlaceholderById(permanentElement.id);\n placeholder === null || placeholder === void 0 ? void 0 : placeholder.replaceWith(permanentElement);\n }\n }, {\n key: \"getPlaceholderById\",\n value: function getPlaceholderById(id) {\n return this.placeholders.find(function (element) {\n return element.content == id;\n });\n }\n }, {\n key: \"placeholders\",\n get: function get() {\n return _toConsumableArray(document.querySelectorAll(\"meta[name=turbo-permanent-placeholder][content]\"));\n }\n }], [{\n key: \"preservingPermanentElements\",\n value: function preservingPermanentElements(permanentElementMap, callback) {\n var bardo = new this(permanentElementMap);\n bardo.enter();\n callback();\n bardo.leave();\n }\n }]);\n\n return Bardo;\n}();\n\nfunction createPlaceholderForPermanentElement(permanentElement) {\n var element = document.createElement(\"meta\");\n element.setAttribute(\"name\", \"turbo-permanent-placeholder\");\n element.setAttribute(\"content\", permanentElement.id);\n return element;\n}\n\nvar Renderer = /*#__PURE__*/function () {\n function Renderer(currentSnapshot, newSnapshot, isPreview) {\n var _this7 = this;\n\n var willRender = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n\n _classCallCheck(this, Renderer);\n\n this.currentSnapshot = currentSnapshot;\n this.newSnapshot = newSnapshot;\n this.isPreview = isPreview;\n this.willRender = willRender;\n this.promise = new Promise(function (resolve, reject) {\n return _this7.resolvingFunctions = {\n resolve: resolve,\n reject: reject\n };\n });\n }\n\n _createClass(Renderer, [{\n key: \"shouldRender\",\n get: function get() {\n return true;\n }\n }, {\n key: \"prepareToRender\",\n value: function prepareToRender() {\n return;\n }\n }, {\n key: \"finishRendering\",\n value: function finishRendering() {\n if (this.resolvingFunctions) {\n this.resolvingFunctions.resolve();\n delete this.resolvingFunctions;\n }\n }\n }, {\n key: \"createScriptElement\",\n value: function createScriptElement(element) {\n if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n return element;\n } else {\n var createdScriptElement = document.createElement(\"script\");\n\n if (this.cspNonce) {\n createdScriptElement.nonce = this.cspNonce;\n }\n\n createdScriptElement.textContent = element.textContent;\n createdScriptElement.async = false;\n copyElementAttributes(createdScriptElement, element);\n return createdScriptElement;\n }\n }\n }, {\n key: \"preservingPermanentElements\",\n value: function preservingPermanentElements(callback) {\n Bardo.preservingPermanentElements(this.permanentElementMap, callback);\n }\n }, {\n key: \"focusFirstAutofocusableElement\",\n value: function focusFirstAutofocusableElement() {\n var element = this.connectedSnapshot.firstAutofocusableElement;\n\n if (elementIsFocusable(element)) {\n element.focus();\n }\n }\n }, {\n key: \"connectedSnapshot\",\n get: function get() {\n return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot;\n }\n }, {\n key: \"currentElement\",\n get: function get() {\n return this.currentSnapshot.element;\n }\n }, {\n key: \"newElement\",\n get: function get() {\n return this.newSnapshot.element;\n }\n }, {\n key: \"permanentElementMap\",\n get: function get() {\n return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot);\n }\n }, {\n key: \"cspNonce\",\n get: function get() {\n var _a;\n\n return (_a = document.head.querySelector('meta[name=\"csp-nonce\"]')) === null || _a === void 0 ? void 0 : _a.getAttribute(\"content\");\n }\n }]);\n\n return Renderer;\n}();\n\nfunction copyElementAttributes(destinationElement, sourceElement) {\n for (var _i3 = 0, _arr2 = _toConsumableArray(sourceElement.attributes); _i3 < _arr2.length; _i3++) {\n var _ref9 = _arr2[_i3];\n var name = _ref9.name;\n var value = _ref9.value;\n destinationElement.setAttribute(name, value);\n }\n}\n\nfunction elementIsFocusable(element) {\n return element && typeof element.focus == \"function\";\n}\n\nvar FrameRenderer = /*#__PURE__*/function (_Renderer) {\n _inherits(FrameRenderer, _Renderer);\n\n var _super3 = _createSuper(FrameRenderer);\n\n function FrameRenderer() {\n _classCallCheck(this, FrameRenderer);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(FrameRenderer, [{\n key: \"shouldRender\",\n get: function get() {\n return true;\n }\n }, {\n key: \"render\",\n value: function () {\n var _render2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n var _this8 = this;\n\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return nextAnimationFrame();\n\n case 2:\n this.preservingPermanentElements(function () {\n _this8.loadFrameElement();\n });\n this.scrollFrameIntoView();\n _context7.next = 6;\n return nextAnimationFrame();\n\n case 6:\n this.focusFirstAutofocusableElement();\n _context7.next = 9;\n return nextAnimationFrame();\n\n case 9:\n this.activateScriptElements();\n\n case 10:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7, this);\n }));\n\n function render() {\n return _render2.apply(this, arguments);\n }\n\n return render;\n }()\n }, {\n key: \"loadFrameElement\",\n value: function loadFrameElement() {\n var _a;\n\n var destinationRange = document.createRange();\n destinationRange.selectNodeContents(this.currentElement);\n destinationRange.deleteContents();\n var frameElement = this.newElement;\n var sourceRange = (_a = frameElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.createRange();\n\n if (sourceRange) {\n sourceRange.selectNodeContents(frameElement);\n this.currentElement.appendChild(sourceRange.extractContents());\n }\n }\n }, {\n key: \"scrollFrameIntoView\",\n value: function scrollFrameIntoView() {\n if (this.currentElement.autoscroll || this.newElement.autoscroll) {\n var element = this.currentElement.firstElementChild;\n var block = readScrollLogicalPosition(this.currentElement.getAttribute(\"data-autoscroll-block\"), \"end\");\n\n if (element) {\n element.scrollIntoView({\n block: block\n });\n return true;\n }\n }\n\n return false;\n }\n }, {\n key: \"activateScriptElements\",\n value: function activateScriptElements() {\n var _iterator5 = _createForOfIteratorHelper(this.newScriptElements),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var inertScriptElement = _step5.value;\n var activatedScriptElement = this.createScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n }\n }, {\n key: \"newScriptElements\",\n get: function get() {\n return this.currentElement.querySelectorAll(\"script\");\n }\n }]);\n\n return FrameRenderer;\n}(Renderer);\n\nfunction readScrollLogicalPosition(value, defaultValue) {\n if (value == \"end\" || value == \"start\" || value == \"center\" || value == \"nearest\") {\n return value;\n } else {\n return defaultValue;\n }\n}\n\nvar ProgressBar = /*#__PURE__*/function () {\n function ProgressBar() {\n var _this9 = this;\n\n _classCallCheck(this, ProgressBar);\n\n this.hiding = false;\n this.value = 0;\n this.visible = false;\n\n this.trickle = function () {\n _this9.setValue(_this9.value + Math.random() / 100);\n };\n\n this.stylesheetElement = this.createStylesheetElement();\n this.progressElement = this.createProgressElement();\n this.installStylesheetElement();\n this.setValue(0);\n }\n\n _createClass(ProgressBar, [{\n key: \"show\",\n value: function show() {\n if (!this.visible) {\n this.visible = true;\n this.installProgressElement();\n this.startTrickling();\n }\n }\n }, {\n key: \"hide\",\n value: function hide() {\n var _this10 = this;\n\n if (this.visible && !this.hiding) {\n this.hiding = true;\n this.fadeProgressElement(function () {\n _this10.uninstallProgressElement();\n\n _this10.stopTrickling();\n\n _this10.visible = false;\n _this10.hiding = false;\n });\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n this.value = value;\n this.refresh();\n }\n }, {\n key: \"installStylesheetElement\",\n value: function installStylesheetElement() {\n document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n }\n }, {\n key: \"installProgressElement\",\n value: function installProgressElement() {\n this.progressElement.style.width = \"0\";\n this.progressElement.style.opacity = \"1\";\n document.documentElement.insertBefore(this.progressElement, document.body);\n this.refresh();\n }\n }, {\n key: \"fadeProgressElement\",\n value: function fadeProgressElement(callback) {\n this.progressElement.style.opacity = \"0\";\n setTimeout(callback, ProgressBar.animationDuration * 1.5);\n }\n }, {\n key: \"uninstallProgressElement\",\n value: function uninstallProgressElement() {\n if (this.progressElement.parentNode) {\n document.documentElement.removeChild(this.progressElement);\n }\n }\n }, {\n key: \"startTrickling\",\n value: function startTrickling() {\n if (!this.trickleInterval) {\n this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);\n }\n }\n }, {\n key: \"stopTrickling\",\n value: function stopTrickling() {\n window.clearInterval(this.trickleInterval);\n delete this.trickleInterval;\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n var _this11 = this;\n\n requestAnimationFrame(function () {\n _this11.progressElement.style.width = \"\".concat(10 + _this11.value * 90, \"%\");\n });\n }\n }, {\n key: \"createStylesheetElement\",\n value: function createStylesheetElement() {\n var element = document.createElement(\"style\");\n element.type = \"text/css\";\n element.textContent = ProgressBar.defaultCSS;\n return element;\n }\n }, {\n key: \"createProgressElement\",\n value: function createProgressElement() {\n var element = document.createElement(\"div\");\n element.className = \"turbo-progress-bar\";\n return element;\n }\n }], [{\n key: \"defaultCSS\",\n get: function get() {\n return unindent(_templateObject || (_templateObject = _taggedTemplateLiteral([\"\\n .turbo-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:\\n width \", \"ms ease-out,\\n opacity \", \"ms \", \"ms ease-in;\\n transform: translate3d(0, 0, 0);\\n }\\n \"])), ProgressBar.animationDuration, ProgressBar.animationDuration / 2, ProgressBar.animationDuration / 2);\n }\n }]);\n\n return ProgressBar;\n}();\n\nProgressBar.animationDuration = 300;\n\nvar HeadSnapshot = /*#__PURE__*/function (_Snapshot) {\n _inherits(HeadSnapshot, _Snapshot);\n\n var _super4 = _createSuper(HeadSnapshot);\n\n function HeadSnapshot() {\n var _this12;\n\n _classCallCheck(this, HeadSnapshot);\n\n _this12 = _super4.apply(this, arguments);\n _this12.detailsByOuterHTML = _this12.children.filter(function (element) {\n return !elementIsNoscript(element);\n }).map(function (element) {\n return elementWithoutNonce(element);\n }).reduce(function (result, element) {\n var outerHTML = element.outerHTML;\n var details = outerHTML in result ? result[outerHTML] : {\n type: elementType(element),\n tracked: elementIsTracked(element),\n elements: []\n };\n return Object.assign(Object.assign({}, result), _defineProperty({}, outerHTML, Object.assign(Object.assign({}, details), {\n elements: [].concat(_toConsumableArray(details.elements), [element])\n })));\n }, {});\n return _this12;\n }\n\n _createClass(HeadSnapshot, [{\n key: \"trackedElementSignature\",\n get: function get() {\n var _this13 = this;\n\n return Object.keys(this.detailsByOuterHTML).filter(function (outerHTML) {\n return _this13.detailsByOuterHTML[outerHTML].tracked;\n }).join(\"\");\n }\n }, {\n key: \"getScriptElementsNotInSnapshot\",\n value: function getScriptElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"script\", snapshot);\n }\n }, {\n key: \"getStylesheetElementsNotInSnapshot\",\n value: function getStylesheetElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"stylesheet\", snapshot);\n }\n }, {\n key: \"getElementsMatchingTypeNotInSnapshot\",\n value: function getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {\n var _this14 = this;\n\n return Object.keys(this.detailsByOuterHTML).filter(function (outerHTML) {\n return !(outerHTML in snapshot.detailsByOuterHTML);\n }).map(function (outerHTML) {\n return _this14.detailsByOuterHTML[outerHTML];\n }).filter(function (_ref10) {\n var type = _ref10.type;\n return type == matchedType;\n }).map(function (_ref11) {\n var _ref11$elements = _slicedToArray(_ref11.elements, 1),\n element = _ref11$elements[0];\n\n return element;\n });\n }\n }, {\n key: \"provisionalElements\",\n get: function get() {\n var _this15 = this;\n\n return Object.keys(this.detailsByOuterHTML).reduce(function (result, outerHTML) {\n var _this15$detailsByOute = _this15.detailsByOuterHTML[outerHTML],\n type = _this15$detailsByOute.type,\n tracked = _this15$detailsByOute.tracked,\n elements = _this15$detailsByOute.elements;\n\n if (type == null && !tracked) {\n return [].concat(_toConsumableArray(result), _toConsumableArray(elements));\n } else if (elements.length > 1) {\n return [].concat(_toConsumableArray(result), _toConsumableArray(elements.slice(1)));\n } else {\n return result;\n }\n }, []);\n }\n }, {\n key: \"getMetaValue\",\n value: function getMetaValue(name) {\n var element = this.findMetaElementByName(name);\n return element ? element.getAttribute(\"content\") : null;\n }\n }, {\n key: \"findMetaElementByName\",\n value: function findMetaElementByName(name) {\n var _this16 = this;\n\n return Object.keys(this.detailsByOuterHTML).reduce(function (result, outerHTML) {\n var _this16$detailsByOute = _slicedToArray(_this16.detailsByOuterHTML[outerHTML].elements, 1),\n element = _this16$detailsByOute[0];\n\n return elementIsMetaElementWithName(element, name) ? element : result;\n }, undefined);\n }\n }]);\n\n return HeadSnapshot;\n}(Snapshot);\n\nfunction elementType(element) {\n if (elementIsScript(element)) {\n return \"script\";\n } else if (elementIsStylesheet(element)) {\n return \"stylesheet\";\n }\n}\n\nfunction elementIsTracked(element) {\n return element.getAttribute(\"data-turbo-track\") == \"reload\";\n}\n\nfunction elementIsScript(element) {\n var tagName = element.tagName.toLowerCase();\n return tagName == \"script\";\n}\n\nfunction elementIsNoscript(element) {\n var tagName = element.tagName.toLowerCase();\n return tagName == \"noscript\";\n}\n\nfunction elementIsStylesheet(element) {\n var tagName = element.tagName.toLowerCase();\n return tagName == \"style\" || tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\";\n}\n\nfunction elementIsMetaElementWithName(element, name) {\n var tagName = element.tagName.toLowerCase();\n return tagName == \"meta\" && element.getAttribute(\"name\") == name;\n}\n\nfunction elementWithoutNonce(element) {\n if (element.hasAttribute(\"nonce\")) {\n element.setAttribute(\"nonce\", \"\");\n }\n\n return element;\n}\n\nvar PageSnapshot = /*#__PURE__*/function (_Snapshot2) {\n _inherits(PageSnapshot, _Snapshot2);\n\n var _super5 = _createSuper(PageSnapshot);\n\n function PageSnapshot(element, headSnapshot) {\n var _this17;\n\n _classCallCheck(this, PageSnapshot);\n\n _this17 = _super5.call(this, element);\n _this17.headSnapshot = headSnapshot;\n return _this17;\n }\n\n _createClass(PageSnapshot, [{\n key: \"clone\",\n value: function clone() {\n return new PageSnapshot(this.element.cloneNode(true), this.headSnapshot);\n }\n }, {\n key: \"headElement\",\n get: function get() {\n return this.headSnapshot.element;\n }\n }, {\n key: \"rootLocation\",\n get: function get() {\n var _a;\n\n var root = (_a = this.getSetting(\"root\")) !== null && _a !== void 0 ? _a : \"/\";\n return expandURL(root);\n }\n }, {\n key: \"cacheControlValue\",\n get: function get() {\n return this.getSetting(\"cache-control\");\n }\n }, {\n key: \"isPreviewable\",\n get: function get() {\n return this.cacheControlValue != \"no-preview\";\n }\n }, {\n key: \"isCacheable\",\n get: function get() {\n return this.cacheControlValue != \"no-cache\";\n }\n }, {\n key: \"isVisitable\",\n get: function get() {\n return this.getSetting(\"visit-control\") != \"reload\";\n }\n }, {\n key: \"getSetting\",\n value: function getSetting(name) {\n return this.headSnapshot.getMetaValue(\"turbo-\".concat(name));\n }\n }], [{\n key: \"fromHTMLString\",\n value: function fromHTMLString() {\n var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n return this.fromDocument(parseHTMLDocument(html));\n }\n }, {\n key: \"fromElement\",\n value: function fromElement(element) {\n return this.fromDocument(element.ownerDocument);\n }\n }, {\n key: \"fromDocument\",\n value: function fromDocument(_ref12) {\n var head = _ref12.head,\n body = _ref12.body;\n return new this(body, new HeadSnapshot(head));\n }\n }]);\n\n return PageSnapshot;\n}(Snapshot);\n\nvar TimingMetric;\n\n(function (TimingMetric) {\n TimingMetric[\"visitStart\"] = \"visitStart\";\n TimingMetric[\"requestStart\"] = \"requestStart\";\n TimingMetric[\"requestEnd\"] = \"requestEnd\";\n TimingMetric[\"visitEnd\"] = \"visitEnd\";\n})(TimingMetric || (TimingMetric = {}));\n\nvar VisitState;\n\n(function (VisitState) {\n VisitState[\"initialized\"] = \"initialized\";\n VisitState[\"started\"] = \"started\";\n VisitState[\"canceled\"] = \"canceled\";\n VisitState[\"failed\"] = \"failed\";\n VisitState[\"completed\"] = \"completed\";\n})(VisitState || (VisitState = {}));\n\nvar defaultOptions = {\n action: \"advance\",\n historyChanged: false,\n visitCachedSnapshot: function visitCachedSnapshot() {},\n willRender: true\n};\nvar SystemStatusCode;\n\n(function (SystemStatusCode) {\n SystemStatusCode[SystemStatusCode[\"networkFailure\"] = 0] = \"networkFailure\";\n SystemStatusCode[SystemStatusCode[\"timeoutFailure\"] = -1] = \"timeoutFailure\";\n SystemStatusCode[SystemStatusCode[\"contentTypeMismatch\"] = -2] = \"contentTypeMismatch\";\n})(SystemStatusCode || (SystemStatusCode = {}));\n\nvar Visit = /*#__PURE__*/function () {\n function Visit(delegate, location, restorationIdentifier) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n _classCallCheck(this, Visit);\n\n this.identifier = uuid();\n this.timingMetrics = {};\n this.followedRedirect = false;\n this.historyChanged = false;\n this.scrolled = false;\n this.snapshotCached = false;\n this.state = VisitState.initialized;\n this.delegate = delegate;\n this.location = location;\n this.restorationIdentifier = restorationIdentifier || uuid();\n\n var _Object$assign2 = Object.assign(Object.assign({}, defaultOptions), options),\n action = _Object$assign2.action,\n historyChanged = _Object$assign2.historyChanged,\n referrer = _Object$assign2.referrer,\n snapshotHTML = _Object$assign2.snapshotHTML,\n response = _Object$assign2.response,\n visitCachedSnapshot = _Object$assign2.visitCachedSnapshot,\n willRender = _Object$assign2.willRender;\n\n this.action = action;\n this.historyChanged = historyChanged;\n this.referrer = referrer;\n this.snapshotHTML = snapshotHTML;\n this.response = response;\n this.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);\n this.visitCachedSnapshot = visitCachedSnapshot;\n this.willRender = willRender;\n this.scrolled = !willRender;\n }\n\n _createClass(Visit, [{\n key: \"adapter\",\n get: function get() {\n return this.delegate.adapter;\n }\n }, {\n key: \"view\",\n get: function get() {\n return this.delegate.view;\n }\n }, {\n key: \"history\",\n get: function get() {\n return this.delegate.history;\n }\n }, {\n key: \"restorationData\",\n get: function get() {\n return this.history.getRestorationDataForIdentifier(this.restorationIdentifier);\n }\n }, {\n key: \"silent\",\n get: function get() {\n return this.isSamePage;\n }\n }, {\n key: \"start\",\n value: function start() {\n if (this.state == VisitState.initialized) {\n this.recordTimingMetric(TimingMetric.visitStart);\n this.state = VisitState.started;\n this.adapter.visitStarted(this);\n this.delegate.visitStarted(this);\n }\n }\n }, {\n key: \"cancel\",\n value: function cancel() {\n if (this.state == VisitState.started) {\n if (this.request) {\n this.request.cancel();\n }\n\n this.cancelRender();\n this.state = VisitState.canceled;\n }\n }\n }, {\n key: \"complete\",\n value: function complete() {\n if (this.state == VisitState.started) {\n this.recordTimingMetric(TimingMetric.visitEnd);\n this.state = VisitState.completed;\n this.adapter.visitCompleted(this);\n this.delegate.visitCompleted(this);\n this.followRedirect();\n }\n }\n }, {\n key: \"fail\",\n value: function fail() {\n if (this.state == VisitState.started) {\n this.state = VisitState.failed;\n this.adapter.visitFailed(this);\n }\n }\n }, {\n key: \"changeHistory\",\n value: function changeHistory() {\n var _a;\n\n if (!this.historyChanged) {\n var actionForHistory = this.location.href === ((_a = this.referrer) === null || _a === void 0 ? void 0 : _a.href) ? \"replace\" : this.action;\n var method = this.getHistoryMethodForAction(actionForHistory);\n this.history.update(method, this.location, this.restorationIdentifier);\n this.historyChanged = true;\n }\n }\n }, {\n key: \"issueRequest\",\n value: function issueRequest() {\n if (this.hasPreloadedResponse()) {\n this.simulateRequest();\n } else if (this.shouldIssueRequest() && !this.request) {\n this.request = new FetchRequest(this, FetchMethod.get, this.location);\n this.request.perform();\n }\n }\n }, {\n key: \"simulateRequest\",\n value: function simulateRequest() {\n if (this.response) {\n this.startRequest();\n this.recordResponse();\n this.finishRequest();\n }\n }\n }, {\n key: \"startRequest\",\n value: function startRequest() {\n this.recordTimingMetric(TimingMetric.requestStart);\n this.adapter.visitRequestStarted(this);\n }\n }, {\n key: \"recordResponse\",\n value: function recordResponse() {\n var response = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.response;\n this.response = response;\n\n if (response) {\n var statusCode = response.statusCode;\n\n if (isSuccessful(statusCode)) {\n this.adapter.visitRequestCompleted(this);\n } else {\n this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n }\n }\n }\n }, {\n key: \"finishRequest\",\n value: function finishRequest() {\n this.recordTimingMetric(TimingMetric.requestEnd);\n this.adapter.visitRequestFinished(this);\n }\n }, {\n key: \"loadResponse\",\n value: function loadResponse() {\n var _this18 = this;\n\n if (this.response) {\n var _this$response = this.response,\n statusCode = _this$response.statusCode,\n responseHTML = _this$response.responseHTML;\n this.render( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) {\n switch (_context8.prev = _context8.next) {\n case 0:\n _this18.cacheSnapshot();\n\n if (!_this18.view.renderPromise) {\n _context8.next = 4;\n break;\n }\n\n _context8.next = 4;\n return _this18.view.renderPromise;\n\n case 4:\n if (!(isSuccessful(statusCode) && responseHTML != null)) {\n _context8.next = 11;\n break;\n }\n\n _context8.next = 7;\n return _this18.view.renderPage(PageSnapshot.fromHTMLString(responseHTML), false, _this18.willRender);\n\n case 7:\n _this18.adapter.visitRendered(_this18);\n\n _this18.complete();\n\n _context8.next = 15;\n break;\n\n case 11:\n _context8.next = 13;\n return _this18.view.renderError(PageSnapshot.fromHTMLString(responseHTML));\n\n case 13:\n _this18.adapter.visitRendered(_this18);\n\n _this18.fail();\n\n case 15:\n case \"end\":\n return _context8.stop();\n }\n }\n }, _callee8);\n })));\n }\n }\n }, {\n key: \"getCachedSnapshot\",\n value: function getCachedSnapshot() {\n var snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();\n\n if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {\n if (this.action == \"restore\" || snapshot.isPreviewable) {\n return snapshot;\n }\n }\n }\n }, {\n key: \"getPreloadedSnapshot\",\n value: function getPreloadedSnapshot() {\n if (this.snapshotHTML) {\n return PageSnapshot.fromHTMLString(this.snapshotHTML);\n }\n }\n }, {\n key: \"hasCachedSnapshot\",\n value: function hasCachedSnapshot() {\n return this.getCachedSnapshot() != null;\n }\n }, {\n key: \"loadCachedSnapshot\",\n value: function loadCachedSnapshot() {\n var _this19 = this;\n\n var snapshot = this.getCachedSnapshot();\n\n if (snapshot) {\n var isPreview = this.shouldIssueRequest();\n this.render( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {\n return _regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) {\n switch (_context9.prev = _context9.next) {\n case 0:\n _this19.cacheSnapshot();\n\n if (!_this19.isSamePage) {\n _context9.next = 5;\n break;\n }\n\n _this19.adapter.visitRendered(_this19);\n\n _context9.next = 12;\n break;\n\n case 5:\n if (!_this19.view.renderPromise) {\n _context9.next = 8;\n break;\n }\n\n _context9.next = 8;\n return _this19.view.renderPromise;\n\n case 8:\n _context9.next = 10;\n return _this19.view.renderPage(snapshot, isPreview, _this19.willRender);\n\n case 10:\n _this19.adapter.visitRendered(_this19);\n\n if (!isPreview) {\n _this19.complete();\n }\n\n case 12:\n case \"end\":\n return _context9.stop();\n }\n }\n }, _callee9);\n })));\n }\n }\n }, {\n key: \"followRedirect\",\n value: function followRedirect() {\n var _a;\n\n if (this.redirectedToLocation && !this.followedRedirect && ((_a = this.response) === null || _a === void 0 ? void 0 : _a.redirected)) {\n this.adapter.visitProposedToLocation(this.redirectedToLocation, {\n action: 'replace',\n response: this.response\n });\n this.followedRedirect = true;\n }\n }\n }, {\n key: \"goToSamePageAnchor\",\n value: function goToSamePageAnchor() {\n var _this20 = this;\n\n if (this.isSamePage) {\n this.render( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {\n return _regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) {\n switch (_context10.prev = _context10.next) {\n case 0:\n _this20.cacheSnapshot();\n\n _this20.adapter.visitRendered(_this20);\n\n case 2:\n case \"end\":\n return _context10.stop();\n }\n }\n }, _callee10);\n })));\n }\n }\n }, {\n key: \"requestStarted\",\n value: function requestStarted() {\n this.startRequest();\n }\n }, {\n key: \"requestPreventedHandlingResponse\",\n value: function requestPreventedHandlingResponse(request, response) {}\n }, {\n key: \"requestSucceededWithResponse\",\n value: function () {\n var _requestSucceededWithResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(request, response) {\n var responseHTML, redirected, statusCode;\n return _regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) {\n switch (_context11.prev = _context11.next) {\n case 0:\n _context11.next = 2;\n return response.responseHTML;\n\n case 2:\n responseHTML = _context11.sent;\n redirected = response.redirected, statusCode = response.statusCode;\n\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected: redirected\n });\n } else {\n this.redirectedToLocation = response.redirected ? response.location : undefined;\n this.recordResponse({\n statusCode: statusCode,\n responseHTML: responseHTML,\n redirected: redirected\n });\n }\n\n case 5:\n case \"end\":\n return _context11.stop();\n }\n }\n }, _callee11, this);\n }));\n\n function requestSucceededWithResponse(_x5, _x6) {\n return _requestSucceededWithResponse.apply(this, arguments);\n }\n\n return requestSucceededWithResponse;\n }()\n }, {\n key: \"requestFailedWithResponse\",\n value: function () {\n var _requestFailedWithResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(request, response) {\n var responseHTML, redirected, statusCode;\n return _regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) {\n switch (_context12.prev = _context12.next) {\n case 0:\n _context12.next = 2;\n return response.responseHTML;\n\n case 2:\n responseHTML = _context12.sent;\n redirected = response.redirected, statusCode = response.statusCode;\n\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected: redirected\n });\n } else {\n this.recordResponse({\n statusCode: statusCode,\n responseHTML: responseHTML,\n redirected: redirected\n });\n }\n\n case 5:\n case \"end\":\n return _context12.stop();\n }\n }\n }, _callee12, this);\n }));\n\n function requestFailedWithResponse(_x7, _x8) {\n return _requestFailedWithResponse.apply(this, arguments);\n }\n\n return requestFailedWithResponse;\n }()\n }, {\n key: \"requestErrored\",\n value: function requestErrored(request, error) {\n this.recordResponse({\n statusCode: SystemStatusCode.networkFailure,\n redirected: false\n });\n }\n }, {\n key: \"requestFinished\",\n value: function requestFinished() {\n this.finishRequest();\n }\n }, {\n key: \"performScroll\",\n value: function performScroll() {\n if (!this.scrolled) {\n if (this.action == \"restore\") {\n this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();\n } else {\n this.scrollToAnchor() || this.view.scrollToTop();\n }\n\n if (this.isSamePage) {\n this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);\n }\n\n this.scrolled = true;\n }\n }\n }, {\n key: \"scrollToRestoredPosition\",\n value: function scrollToRestoredPosition() {\n var scrollPosition = this.restorationData.scrollPosition;\n\n if (scrollPosition) {\n this.view.scrollToPosition(scrollPosition);\n return true;\n }\n }\n }, {\n key: \"scrollToAnchor\",\n value: function scrollToAnchor() {\n var anchor = getAnchor(this.location);\n\n if (anchor != null) {\n this.view.scrollToAnchor(anchor);\n return true;\n }\n }\n }, {\n key: \"recordTimingMetric\",\n value: function recordTimingMetric(metric) {\n this.timingMetrics[metric] = new Date().getTime();\n }\n }, {\n key: \"getTimingMetrics\",\n value: function getTimingMetrics() {\n return Object.assign({}, this.timingMetrics);\n }\n }, {\n key: \"getHistoryMethodForAction\",\n value: function getHistoryMethodForAction(action) {\n switch (action) {\n case \"replace\":\n return history.replaceState;\n\n case \"advance\":\n case \"restore\":\n return history.pushState;\n }\n }\n }, {\n key: \"hasPreloadedResponse\",\n value: function hasPreloadedResponse() {\n return _typeof(this.response) == \"object\";\n }\n }, {\n key: \"shouldIssueRequest\",\n value: function shouldIssueRequest() {\n if (this.isSamePage) {\n return false;\n } else if (this.action == \"restore\") {\n return !this.hasCachedSnapshot();\n } else {\n return this.willRender;\n }\n }\n }, {\n key: \"cacheSnapshot\",\n value: function cacheSnapshot() {\n var _this21 = this;\n\n if (!this.snapshotCached) {\n this.view.cacheSnapshot().then(function (snapshot) {\n return snapshot && _this21.visitCachedSnapshot(snapshot);\n });\n this.snapshotCached = true;\n }\n }\n }, {\n key: \"render\",\n value: function () {\n var _render3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(callback) {\n var _this22 = this;\n\n return _regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) {\n switch (_context13.prev = _context13.next) {\n case 0:\n this.cancelRender();\n _context13.next = 3;\n return new Promise(function (resolve) {\n _this22.frame = requestAnimationFrame(function () {\n return resolve();\n });\n });\n\n case 3:\n _context13.next = 5;\n return callback();\n\n case 5:\n delete this.frame;\n this.performScroll();\n\n case 7:\n case \"end\":\n return _context13.stop();\n }\n }\n }, _callee13, this);\n }));\n\n function render(_x9) {\n return _render3.apply(this, arguments);\n }\n\n return render;\n }()\n }, {\n key: \"cancelRender\",\n value: function cancelRender() {\n if (this.frame) {\n cancelAnimationFrame(this.frame);\n delete this.frame;\n }\n }\n }]);\n\n return Visit;\n}();\n\nfunction isSuccessful(statusCode) {\n return statusCode >= 200 && statusCode < 300;\n}\n\nvar BrowserAdapter = /*#__PURE__*/function () {\n function BrowserAdapter(session) {\n var _this23 = this;\n\n _classCallCheck(this, BrowserAdapter);\n\n this.progressBar = new ProgressBar();\n\n this.showProgressBar = function () {\n _this23.progressBar.show();\n };\n\n this.session = session;\n }\n\n _createClass(BrowserAdapter, [{\n key: \"visitProposedToLocation\",\n value: function visitProposedToLocation(location, options) {\n this.navigator.startVisit(location, uuid(), options);\n }\n }, {\n key: \"visitStarted\",\n value: function visitStarted(visit) {\n visit.loadCachedSnapshot();\n visit.issueRequest();\n visit.changeHistory();\n visit.goToSamePageAnchor();\n }\n }, {\n key: \"visitRequestStarted\",\n value: function visitRequestStarted(visit) {\n this.progressBar.setValue(0);\n\n if (visit.hasCachedSnapshot() || visit.action != \"restore\") {\n this.showVisitProgressBarAfterDelay();\n } else {\n this.showProgressBar();\n }\n }\n }, {\n key: \"visitRequestCompleted\",\n value: function visitRequestCompleted(visit) {\n visit.loadResponse();\n }\n }, {\n key: \"visitRequestFailedWithStatusCode\",\n value: function visitRequestFailedWithStatusCode(visit, statusCode) {\n switch (statusCode) {\n case SystemStatusCode.networkFailure:\n case SystemStatusCode.timeoutFailure:\n case SystemStatusCode.contentTypeMismatch:\n return this.reload();\n\n default:\n return visit.loadResponse();\n }\n }\n }, {\n key: \"visitRequestFinished\",\n value: function visitRequestFinished(visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n }, {\n key: \"visitCompleted\",\n value: function visitCompleted(visit) {}\n }, {\n key: \"pageInvalidated\",\n value: function pageInvalidated() {\n this.reload();\n }\n }, {\n key: \"visitFailed\",\n value: function visitFailed(visit) {}\n }, {\n key: \"visitRendered\",\n value: function visitRendered(visit) {}\n }, {\n key: \"formSubmissionStarted\",\n value: function formSubmissionStarted(formSubmission) {\n this.progressBar.setValue(0);\n this.showFormProgressBarAfterDelay();\n }\n }, {\n key: \"formSubmissionFinished\",\n value: function formSubmissionFinished(formSubmission) {\n this.progressBar.setValue(1);\n this.hideFormProgressBar();\n }\n }, {\n key: \"showVisitProgressBarAfterDelay\",\n value: function showVisitProgressBarAfterDelay() {\n this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n }, {\n key: \"hideVisitProgressBar\",\n value: function hideVisitProgressBar() {\n this.progressBar.hide();\n\n if (this.visitProgressBarTimeout != null) {\n window.clearTimeout(this.visitProgressBarTimeout);\n delete this.visitProgressBarTimeout;\n }\n }\n }, {\n key: \"showFormProgressBarAfterDelay\",\n value: function showFormProgressBarAfterDelay() {\n if (this.formProgressBarTimeout == null) {\n this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n }\n }, {\n key: \"hideFormProgressBar\",\n value: function hideFormProgressBar() {\n this.progressBar.hide();\n\n if (this.formProgressBarTimeout != null) {\n window.clearTimeout(this.formProgressBarTimeout);\n delete this.formProgressBarTimeout;\n }\n }\n }, {\n key: \"reload\",\n value: function reload() {\n window.location.reload();\n }\n }, {\n key: \"navigator\",\n get: function get() {\n return this.session.navigator;\n }\n }]);\n\n return BrowserAdapter;\n}();\n\nvar CacheObserver = /*#__PURE__*/function () {\n function CacheObserver() {\n _classCallCheck(this, CacheObserver);\n\n this.started = false;\n }\n\n _createClass(CacheObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-cache\", this.removeStaleElements, false);\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-cache\", this.removeStaleElements, false);\n }\n }\n }, {\n key: \"removeStaleElements\",\n value: function removeStaleElements() {\n var staleElements = _toConsumableArray(document.querySelectorAll('[data-turbo-cache=\"false\"]'));\n\n var _iterator6 = _createForOfIteratorHelper(staleElements),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var element = _step6.value;\n element.remove();\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n }\n }]);\n\n return CacheObserver;\n}();\n\nvar FormSubmitObserver = /*#__PURE__*/function () {\n function FormSubmitObserver(delegate) {\n var _this24 = this;\n\n _classCallCheck(this, FormSubmitObserver);\n\n this.started = false;\n\n this.submitCaptured = function () {\n removeEventListener(\"submit\", _this24.submitBubbled, false);\n addEventListener(\"submit\", _this24.submitBubbled, false);\n };\n\n this.submitBubbled = function (event) {\n if (!event.defaultPrevented) {\n var form = event.target instanceof HTMLFormElement ? event.target : undefined;\n var submitter = event.submitter || undefined;\n\n if (form) {\n var method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formmethod\")) || form.getAttribute(\"method\");\n\n if (method != \"dialog\" && _this24.delegate.willSubmitForm(form, submitter)) {\n event.preventDefault();\n\n _this24.delegate.formSubmitted(form, submitter);\n }\n }\n }\n };\n\n this.delegate = delegate;\n }\n\n _createClass(FormSubmitObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n addEventListener(\"submit\", this.submitCaptured, true);\n this.started = true;\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n removeEventListener(\"submit\", this.submitCaptured, true);\n this.started = false;\n }\n }\n }]);\n\n return FormSubmitObserver;\n}();\n\nvar FrameRedirector = /*#__PURE__*/function () {\n function FrameRedirector(element) {\n _classCallCheck(this, FrameRedirector);\n\n this.element = element;\n this.linkInterceptor = new LinkInterceptor(this, element);\n this.formInterceptor = new FormInterceptor(this, element);\n }\n\n _createClass(FrameRedirector, [{\n key: \"start\",\n value: function start() {\n this.linkInterceptor.start();\n this.formInterceptor.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.linkInterceptor.stop();\n this.formInterceptor.stop();\n }\n }, {\n key: \"shouldInterceptLinkClick\",\n value: function shouldInterceptLinkClick(element, url) {\n return this.shouldRedirect(element);\n }\n }, {\n key: \"linkClickIntercepted\",\n value: function linkClickIntercepted(element, url) {\n var frame = this.findFrameElement(element);\n\n if (frame) {\n frame.delegate.linkClickIntercepted(element, url);\n }\n }\n }, {\n key: \"shouldInterceptFormSubmission\",\n value: function shouldInterceptFormSubmission(element, submitter) {\n return this.shouldSubmit(element, submitter);\n }\n }, {\n key: \"formSubmissionIntercepted\",\n value: function formSubmissionIntercepted(element, submitter) {\n var frame = this.findFrameElement(element, submitter);\n\n if (frame) {\n frame.removeAttribute(\"reloadable\");\n frame.delegate.formSubmissionIntercepted(element, submitter);\n }\n }\n }, {\n key: \"shouldSubmit\",\n value: function shouldSubmit(form, submitter) {\n var _a;\n\n var action = getAction(form, submitter);\n var meta = this.element.ownerDocument.querySelector(\"meta[name=\\\"turbo-root\\\"]\");\n var rootLocation = expandURL((_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\");\n return this.shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation);\n }\n }, {\n key: \"shouldRedirect\",\n value: function shouldRedirect(element, submitter) {\n var frame = this.findFrameElement(element, submitter);\n return frame ? frame != element.closest(\"turbo-frame\") : false;\n }\n }, {\n key: \"findFrameElement\",\n value: function findFrameElement(element, submitter) {\n var id = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"data-turbo-frame\")) || element.getAttribute(\"data-turbo-frame\");\n\n if (id && id != \"_top\") {\n var frame = this.element.querySelector(\"#\".concat(id, \":not([disabled])\"));\n\n if (frame instanceof FrameElement) {\n return frame;\n }\n }\n }\n }]);\n\n return FrameRedirector;\n}();\n\nvar History = /*#__PURE__*/function () {\n function History(delegate) {\n var _this25 = this;\n\n _classCallCheck(this, History);\n\n this.restorationIdentifier = uuid();\n this.restorationData = {};\n this.started = false;\n this.pageLoaded = false;\n\n this.onPopState = function (event) {\n if (_this25.shouldHandlePopState()) {\n var _ref16 = event.state || {},\n turbo = _ref16.turbo;\n\n if (turbo) {\n _this25.location = new URL(window.location.href);\n var restorationIdentifier = turbo.restorationIdentifier;\n _this25.restorationIdentifier = restorationIdentifier;\n\n _this25.delegate.historyPoppedToLocationWithRestorationIdentifier(_this25.location, restorationIdentifier);\n }\n }\n };\n\n this.onPageLoad = /*#__PURE__*/function () {\n var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(event) {\n return _regeneratorRuntime().wrap(function _callee14$(_context14) {\n while (1) {\n switch (_context14.prev = _context14.next) {\n case 0:\n _context14.next = 2;\n return nextMicrotask();\n\n case 2:\n _this25.pageLoaded = true;\n\n case 3:\n case \"end\":\n return _context14.stop();\n }\n }\n }, _callee14);\n }));\n\n return function (_x10) {\n return _ref17.apply(this, arguments);\n };\n }();\n\n this.delegate = delegate;\n }\n\n _createClass(History, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n addEventListener(\"popstate\", this.onPopState, false);\n addEventListener(\"load\", this.onPageLoad, false);\n this.started = true;\n this.replace(new URL(window.location.href));\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n removeEventListener(\"popstate\", this.onPopState, false);\n removeEventListener(\"load\", this.onPageLoad, false);\n this.started = false;\n }\n }\n }, {\n key: \"push\",\n value: function push(location, restorationIdentifier) {\n this.update(history.pushState, location, restorationIdentifier);\n }\n }, {\n key: \"replace\",\n value: function replace(location, restorationIdentifier) {\n this.update(history.replaceState, location, restorationIdentifier);\n }\n }, {\n key: \"update\",\n value: function update(method, location) {\n var restorationIdentifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : uuid();\n var state = {\n turbo: {\n restorationIdentifier: restorationIdentifier\n }\n };\n method.call(history, state, \"\", location.href);\n this.location = location;\n this.restorationIdentifier = restorationIdentifier;\n }\n }, {\n key: \"getRestorationDataForIdentifier\",\n value: function getRestorationDataForIdentifier(restorationIdentifier) {\n return this.restorationData[restorationIdentifier] || {};\n }\n }, {\n key: \"updateRestorationData\",\n value: function updateRestorationData(additionalData) {\n var restorationIdentifier = this.restorationIdentifier;\n var restorationData = this.restorationData[restorationIdentifier];\n this.restorationData[restorationIdentifier] = Object.assign(Object.assign({}, restorationData), additionalData);\n }\n }, {\n key: \"assumeControlOfScrollRestoration\",\n value: function assumeControlOfScrollRestoration() {\n var _a;\n\n if (!this.previousScrollRestoration) {\n this.previousScrollRestoration = (_a = history.scrollRestoration) !== null && _a !== void 0 ? _a : \"auto\";\n history.scrollRestoration = \"manual\";\n }\n }\n }, {\n key: \"relinquishControlOfScrollRestoration\",\n value: function relinquishControlOfScrollRestoration() {\n if (this.previousScrollRestoration) {\n history.scrollRestoration = this.previousScrollRestoration;\n delete this.previousScrollRestoration;\n }\n }\n }, {\n key: \"shouldHandlePopState\",\n value: function shouldHandlePopState() {\n return this.pageIsLoaded();\n }\n }, {\n key: \"pageIsLoaded\",\n value: function pageIsLoaded() {\n return this.pageLoaded || document.readyState == \"complete\";\n }\n }]);\n\n return History;\n}();\n\nvar LinkClickObserver = /*#__PURE__*/function () {\n function LinkClickObserver(delegate) {\n var _this26 = this;\n\n _classCallCheck(this, LinkClickObserver);\n\n this.started = false;\n\n this.clickCaptured = function () {\n removeEventListener(\"click\", _this26.clickBubbled, false);\n addEventListener(\"click\", _this26.clickBubbled, false);\n };\n\n this.clickBubbled = function (event) {\n if (_this26.clickEventIsSignificant(event)) {\n var target = event.composedPath && event.composedPath()[0] || event.target;\n\n var link = _this26.findLinkFromClickTarget(target);\n\n if (link) {\n var _location = _this26.getLocationForLink(link);\n\n if (_this26.delegate.willFollowLinkToLocation(link, _location)) {\n event.preventDefault();\n\n _this26.delegate.followedLinkToLocation(link, _location);\n }\n }\n }\n };\n\n this.delegate = delegate;\n }\n\n _createClass(LinkClickObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n addEventListener(\"click\", this.clickCaptured, true);\n this.started = true;\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n removeEventListener(\"click\", this.clickCaptured, true);\n this.started = false;\n }\n }\n }, {\n key: \"clickEventIsSignificant\",\n value: function clickEventIsSignificant(event) {\n return !(event.target && event.target.isContentEditable || event.defaultPrevented || event.which > 1 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);\n }\n }, {\n key: \"findLinkFromClickTarget\",\n value: function findLinkFromClickTarget(target) {\n if (target instanceof Element) {\n return target.closest(\"a[href]:not([target^=_]):not([download])\");\n }\n }\n }, {\n key: \"getLocationForLink\",\n value: function getLocationForLink(link) {\n return expandURL(link.getAttribute(\"href\") || \"\");\n }\n }]);\n\n return LinkClickObserver;\n}();\n\nfunction isAction(action) {\n return action == \"advance\" || action == \"replace\" || action == \"restore\";\n}\n\nvar Navigator = /*#__PURE__*/function () {\n function Navigator(delegate) {\n _classCallCheck(this, Navigator);\n\n this.delegate = delegate;\n }\n\n _createClass(Navigator, [{\n key: \"proposeVisit\",\n value: function proposeVisit(location) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {\n if (locationIsVisitable(location, this.view.snapshot.rootLocation)) {\n this.delegate.visitProposedToLocation(location, options);\n } else {\n window.location.href = location.toString();\n }\n }\n }\n }, {\n key: \"startVisit\",\n value: function startVisit(locatable, restorationIdentifier) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n this.stop();\n this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, Object.assign({\n referrer: this.location\n }, options));\n this.currentVisit.start();\n }\n }, {\n key: \"submitForm\",\n value: function submitForm(form, submitter) {\n this.stop();\n this.formSubmission = new FormSubmission(this, form, submitter, true);\n this.formSubmission.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.formSubmission) {\n this.formSubmission.stop();\n delete this.formSubmission;\n }\n\n if (this.currentVisit) {\n this.currentVisit.cancel();\n delete this.currentVisit;\n }\n }\n }, {\n key: \"adapter\",\n get: function get() {\n return this.delegate.adapter;\n }\n }, {\n key: \"view\",\n get: function get() {\n return this.delegate.view;\n }\n }, {\n key: \"history\",\n get: function get() {\n return this.delegate.history;\n }\n }, {\n key: \"formSubmissionStarted\",\n value: function formSubmissionStarted(formSubmission) {\n if (typeof this.adapter.formSubmissionStarted === 'function') {\n this.adapter.formSubmissionStarted(formSubmission);\n }\n }\n }, {\n key: \"formSubmissionSucceededWithResponse\",\n value: function () {\n var _formSubmissionSucceededWithResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(formSubmission, fetchResponse) {\n var responseHTML, statusCode, redirected, action, visitOptions;\n return _regeneratorRuntime().wrap(function _callee15$(_context15) {\n while (1) {\n switch (_context15.prev = _context15.next) {\n case 0:\n if (!(formSubmission == this.formSubmission)) {\n _context15.next = 5;\n break;\n }\n\n _context15.next = 3;\n return fetchResponse.responseHTML;\n\n case 3:\n responseHTML = _context15.sent;\n\n if (responseHTML) {\n if (formSubmission.method != FetchMethod.get) {\n this.view.clearSnapshotCache();\n }\n\n statusCode = fetchResponse.statusCode, redirected = fetchResponse.redirected;\n action = this.getActionForFormSubmission(formSubmission);\n visitOptions = {\n action: action,\n response: {\n statusCode: statusCode,\n responseHTML: responseHTML,\n redirected: redirected\n }\n };\n this.proposeVisit(fetchResponse.location, visitOptions);\n }\n\n case 5:\n case \"end\":\n return _context15.stop();\n }\n }\n }, _callee15, this);\n }));\n\n function formSubmissionSucceededWithResponse(_x11, _x12) {\n return _formSubmissionSucceededWithResponse.apply(this, arguments);\n }\n\n return formSubmissionSucceededWithResponse;\n }()\n }, {\n key: \"formSubmissionFailedWithResponse\",\n value: function () {\n var _formSubmissionFailedWithResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(formSubmission, fetchResponse) {\n var responseHTML, snapshot;\n return _regeneratorRuntime().wrap(function _callee16$(_context16) {\n while (1) {\n switch (_context16.prev = _context16.next) {\n case 0:\n _context16.next = 2;\n return fetchResponse.responseHTML;\n\n case 2:\n responseHTML = _context16.sent;\n\n if (!responseHTML) {\n _context16.next = 14;\n break;\n }\n\n snapshot = PageSnapshot.fromHTMLString(responseHTML);\n\n if (!fetchResponse.serverError) {\n _context16.next = 10;\n break;\n }\n\n _context16.next = 8;\n return this.view.renderError(snapshot);\n\n case 8:\n _context16.next = 12;\n break;\n\n case 10:\n _context16.next = 12;\n return this.view.renderPage(snapshot);\n\n case 12:\n this.view.scrollToTop();\n this.view.clearSnapshotCache();\n\n case 14:\n case \"end\":\n return _context16.stop();\n }\n }\n }, _callee16, this);\n }));\n\n function formSubmissionFailedWithResponse(_x13, _x14) {\n return _formSubmissionFailedWithResponse.apply(this, arguments);\n }\n\n return formSubmissionFailedWithResponse;\n }()\n }, {\n key: \"formSubmissionErrored\",\n value: function formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n }, {\n key: \"formSubmissionFinished\",\n value: function formSubmissionFinished(formSubmission) {\n if (typeof this.adapter.formSubmissionFinished === 'function') {\n this.adapter.formSubmissionFinished(formSubmission);\n }\n }\n }, {\n key: \"visitStarted\",\n value: function visitStarted(visit) {\n this.delegate.visitStarted(visit);\n }\n }, {\n key: \"visitCompleted\",\n value: function visitCompleted(visit) {\n this.delegate.visitCompleted(visit);\n }\n }, {\n key: \"locationWithActionIsSamePage\",\n value: function locationWithActionIsSamePage(location, action) {\n var anchor = getAnchor(location);\n var currentAnchor = getAnchor(this.view.lastRenderedLocation);\n var isRestorationToTop = action === 'restore' && typeof anchor === 'undefined';\n return action !== \"replace\" && getRequestURL(location) === getRequestURL(this.view.lastRenderedLocation) && (isRestorationToTop || anchor != null && anchor !== currentAnchor);\n }\n }, {\n key: \"visitScrolledToSamePageLocation\",\n value: function visitScrolledToSamePageLocation(oldURL, newURL) {\n this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);\n }\n }, {\n key: \"location\",\n get: function get() {\n return this.history.location;\n }\n }, {\n key: \"restorationIdentifier\",\n get: function get() {\n return this.history.restorationIdentifier;\n }\n }, {\n key: \"getActionForFormSubmission\",\n value: function getActionForFormSubmission(formSubmission) {\n var formElement = formSubmission.formElement,\n submitter = formSubmission.submitter;\n var action = getAttribute(\"data-turbo-action\", submitter, formElement);\n return isAction(action) ? action : \"advance\";\n }\n }]);\n\n return Navigator;\n}();\n\nvar PageStage;\n\n(function (PageStage) {\n PageStage[PageStage[\"initial\"] = 0] = \"initial\";\n PageStage[PageStage[\"loading\"] = 1] = \"loading\";\n PageStage[PageStage[\"interactive\"] = 2] = \"interactive\";\n PageStage[PageStage[\"complete\"] = 3] = \"complete\";\n})(PageStage || (PageStage = {}));\n\nvar PageObserver = /*#__PURE__*/function () {\n function PageObserver(delegate) {\n var _this27 = this;\n\n _classCallCheck(this, PageObserver);\n\n this.stage = PageStage.initial;\n this.started = false;\n\n this.interpretReadyState = function () {\n var readyState = _this27.readyState;\n\n if (readyState == \"interactive\") {\n _this27.pageIsInteractive();\n } else if (readyState == \"complete\") {\n _this27.pageIsComplete();\n }\n };\n\n this.pageWillUnload = function () {\n _this27.delegate.pageWillUnload();\n };\n\n this.delegate = delegate;\n }\n\n _createClass(PageObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n if (this.stage == PageStage.initial) {\n this.stage = PageStage.loading;\n }\n\n document.addEventListener(\"readystatechange\", this.interpretReadyState, false);\n addEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = true;\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n document.removeEventListener(\"readystatechange\", this.interpretReadyState, false);\n removeEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = false;\n }\n }\n }, {\n key: \"pageIsInteractive\",\n value: function pageIsInteractive() {\n if (this.stage == PageStage.loading) {\n this.stage = PageStage.interactive;\n this.delegate.pageBecameInteractive();\n }\n }\n }, {\n key: \"pageIsComplete\",\n value: function pageIsComplete() {\n this.pageIsInteractive();\n\n if (this.stage == PageStage.interactive) {\n this.stage = PageStage.complete;\n this.delegate.pageLoaded();\n }\n }\n }, {\n key: \"readyState\",\n get: function get() {\n return document.readyState;\n }\n }]);\n\n return PageObserver;\n}();\n\nvar ScrollObserver = /*#__PURE__*/function () {\n function ScrollObserver(delegate) {\n var _this28 = this;\n\n _classCallCheck(this, ScrollObserver);\n\n this.started = false;\n\n this.onScroll = function () {\n _this28.updatePosition({\n x: window.pageXOffset,\n y: window.pageYOffset\n });\n };\n\n this.delegate = delegate;\n }\n\n _createClass(ScrollObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n addEventListener(\"scroll\", this.onScroll, false);\n this.onScroll();\n this.started = true;\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n removeEventListener(\"scroll\", this.onScroll, false);\n this.started = false;\n }\n }\n }, {\n key: \"updatePosition\",\n value: function updatePosition(position) {\n this.delegate.scrollPositionChanged(position);\n }\n }]);\n\n return ScrollObserver;\n}();\n\nvar StreamObserver = /*#__PURE__*/function () {\n function StreamObserver(delegate) {\n var _this29 = this;\n\n _classCallCheck(this, StreamObserver);\n\n this.sources = new Set();\n this.started = false;\n\n this.inspectFetchResponse = function (event) {\n var response = fetchResponseFromEvent(event);\n\n if (response && fetchResponseIsStream(response)) {\n event.preventDefault();\n\n _this29.receiveMessageResponse(response);\n }\n };\n\n this.receiveMessageEvent = function (event) {\n if (_this29.started && typeof event.data == \"string\") {\n _this29.receiveMessageHTML(event.data);\n }\n };\n\n this.delegate = delegate;\n }\n\n _createClass(StreamObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n }, {\n key: \"connectStreamSource\",\n value: function connectStreamSource(source) {\n if (!this.streamSourceIsConnected(source)) {\n this.sources.add(source);\n source.addEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n }, {\n key: \"disconnectStreamSource\",\n value: function disconnectStreamSource(source) {\n if (this.streamSourceIsConnected(source)) {\n this.sources.delete(source);\n source.removeEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n }, {\n key: \"streamSourceIsConnected\",\n value: function streamSourceIsConnected(source) {\n return this.sources.has(source);\n }\n }, {\n key: \"receiveMessageResponse\",\n value: function () {\n var _receiveMessageResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(response) {\n var html;\n return _regeneratorRuntime().wrap(function _callee17$(_context17) {\n while (1) {\n switch (_context17.prev = _context17.next) {\n case 0:\n _context17.next = 2;\n return response.responseHTML;\n\n case 2:\n html = _context17.sent;\n\n if (html) {\n this.receiveMessageHTML(html);\n }\n\n case 4:\n case \"end\":\n return _context17.stop();\n }\n }\n }, _callee17, this);\n }));\n\n function receiveMessageResponse(_x15) {\n return _receiveMessageResponse.apply(this, arguments);\n }\n\n return receiveMessageResponse;\n }()\n }, {\n key: \"receiveMessageHTML\",\n value: function receiveMessageHTML(html) {\n this.delegate.receivedMessageFromStream(new StreamMessage(html));\n }\n }]);\n\n return StreamObserver;\n}();\n\nfunction fetchResponseFromEvent(event) {\n var _a;\n\n var fetchResponse = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.fetchResponse;\n\n if (fetchResponse instanceof FetchResponse) {\n return fetchResponse;\n }\n}\n\nfunction fetchResponseIsStream(response) {\n var _a;\n\n var contentType = (_a = response.contentType) !== null && _a !== void 0 ? _a : \"\";\n return contentType.startsWith(StreamMessage.contentType);\n}\n\nvar ErrorRenderer = /*#__PURE__*/function (_Renderer2) {\n _inherits(ErrorRenderer, _Renderer2);\n\n var _super6 = _createSuper(ErrorRenderer);\n\n function ErrorRenderer() {\n _classCallCheck(this, ErrorRenderer);\n\n return _super6.apply(this, arguments);\n }\n\n _createClass(ErrorRenderer, [{\n key: \"render\",\n value: function () {\n var _render4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {\n return _regeneratorRuntime().wrap(function _callee18$(_context18) {\n while (1) {\n switch (_context18.prev = _context18.next) {\n case 0:\n this.replaceHeadAndBody();\n this.activateScriptElements();\n\n case 2:\n case \"end\":\n return _context18.stop();\n }\n }\n }, _callee18, this);\n }));\n\n function render() {\n return _render4.apply(this, arguments);\n }\n\n return render;\n }()\n }, {\n key: \"replaceHeadAndBody\",\n value: function replaceHeadAndBody() {\n var _document = document,\n documentElement = _document.documentElement,\n head = _document.head,\n body = _document.body;\n documentElement.replaceChild(this.newHead, head);\n documentElement.replaceChild(this.newElement, body);\n }\n }, {\n key: \"activateScriptElements\",\n value: function activateScriptElements() {\n var _iterator7 = _createForOfIteratorHelper(this.scriptElements),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var replaceableElement = _step7.value;\n var parentNode = replaceableElement.parentNode;\n\n if (parentNode) {\n var element = this.createScriptElement(replaceableElement);\n parentNode.replaceChild(element, replaceableElement);\n }\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n }\n }, {\n key: \"newHead\",\n get: function get() {\n return this.newSnapshot.headSnapshot.element;\n }\n }, {\n key: \"scriptElements\",\n get: function get() {\n return _toConsumableArray(document.documentElement.querySelectorAll(\"script\"));\n }\n }]);\n\n return ErrorRenderer;\n}(Renderer);\n\nvar PageRenderer = /*#__PURE__*/function (_Renderer3) {\n _inherits(PageRenderer, _Renderer3);\n\n var _super7 = _createSuper(PageRenderer);\n\n function PageRenderer() {\n _classCallCheck(this, PageRenderer);\n\n return _super7.apply(this, arguments);\n }\n\n _createClass(PageRenderer, [{\n key: \"shouldRender\",\n get: function get() {\n return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical;\n }\n }, {\n key: \"prepareToRender\",\n value: function prepareToRender() {\n this.mergeHead();\n }\n }, {\n key: \"render\",\n value: function () {\n var _render5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {\n return _regeneratorRuntime().wrap(function _callee19$(_context19) {\n while (1) {\n switch (_context19.prev = _context19.next) {\n case 0:\n if (this.willRender) {\n this.replaceBody();\n }\n\n case 1:\n case \"end\":\n return _context19.stop();\n }\n }\n }, _callee19, this);\n }));\n\n function render() {\n return _render5.apply(this, arguments);\n }\n\n return render;\n }()\n }, {\n key: \"finishRendering\",\n value: function finishRendering() {\n _get(_getPrototypeOf(PageRenderer.prototype), \"finishRendering\", this).call(this);\n\n if (!this.isPreview) {\n this.focusFirstAutofocusableElement();\n }\n }\n }, {\n key: \"currentHeadSnapshot\",\n get: function get() {\n return this.currentSnapshot.headSnapshot;\n }\n }, {\n key: \"newHeadSnapshot\",\n get: function get() {\n return this.newSnapshot.headSnapshot;\n }\n }, {\n key: \"newElement\",\n get: function get() {\n return this.newSnapshot.element;\n }\n }, {\n key: \"mergeHead\",\n value: function mergeHead() {\n this.copyNewHeadStylesheetElements();\n this.copyNewHeadScriptElements();\n this.removeCurrentHeadProvisionalElements();\n this.copyNewHeadProvisionalElements();\n }\n }, {\n key: \"replaceBody\",\n value: function replaceBody() {\n var _this30 = this;\n\n this.preservingPermanentElements(function () {\n _this30.activateNewBody();\n\n _this30.assignNewBody();\n });\n }\n }, {\n key: \"trackedElementsAreIdentical\",\n get: function get() {\n return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature;\n }\n }, {\n key: \"copyNewHeadStylesheetElements\",\n value: function copyNewHeadStylesheetElements() {\n var _iterator8 = _createForOfIteratorHelper(this.newHeadStylesheetElements),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var element = _step8.value;\n document.head.appendChild(element);\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n }\n }, {\n key: \"copyNewHeadScriptElements\",\n value: function copyNewHeadScriptElements() {\n var _iterator9 = _createForOfIteratorHelper(this.newHeadScriptElements),\n _step9;\n\n try {\n for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n var element = _step9.value;\n document.head.appendChild(this.createScriptElement(element));\n }\n } catch (err) {\n _iterator9.e(err);\n } finally {\n _iterator9.f();\n }\n }\n }, {\n key: \"removeCurrentHeadProvisionalElements\",\n value: function removeCurrentHeadProvisionalElements() {\n var _iterator10 = _createForOfIteratorHelper(this.currentHeadProvisionalElements),\n _step10;\n\n try {\n for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n var element = _step10.value;\n document.head.removeChild(element);\n }\n } catch (err) {\n _iterator10.e(err);\n } finally {\n _iterator10.f();\n }\n }\n }, {\n key: \"copyNewHeadProvisionalElements\",\n value: function copyNewHeadProvisionalElements() {\n var _iterator11 = _createForOfIteratorHelper(this.newHeadProvisionalElements),\n _step11;\n\n try {\n for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {\n var element = _step11.value;\n document.head.appendChild(element);\n }\n } catch (err) {\n _iterator11.e(err);\n } finally {\n _iterator11.f();\n }\n }\n }, {\n key: \"activateNewBody\",\n value: function activateNewBody() {\n document.adoptNode(this.newElement);\n this.activateNewBodyScriptElements();\n }\n }, {\n key: \"activateNewBodyScriptElements\",\n value: function activateNewBodyScriptElements() {\n var _iterator12 = _createForOfIteratorHelper(this.newBodyScriptElements),\n _step12;\n\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n var inertScriptElement = _step12.value;\n var activatedScriptElement = this.createScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n }\n }, {\n key: \"assignNewBody\",\n value: function assignNewBody() {\n if (document.body && this.newElement instanceof HTMLBodyElement) {\n document.body.replaceWith(this.newElement);\n } else {\n document.documentElement.appendChild(this.newElement);\n }\n }\n }, {\n key: \"newHeadStylesheetElements\",\n get: function get() {\n return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot);\n }\n }, {\n key: \"newHeadScriptElements\",\n get: function get() {\n return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot);\n }\n }, {\n key: \"currentHeadProvisionalElements\",\n get: function get() {\n return this.currentHeadSnapshot.provisionalElements;\n }\n }, {\n key: \"newHeadProvisionalElements\",\n get: function get() {\n return this.newHeadSnapshot.provisionalElements;\n }\n }, {\n key: \"newBodyScriptElements\",\n get: function get() {\n return this.newElement.querySelectorAll(\"script\");\n }\n }]);\n\n return PageRenderer;\n}(Renderer);\n\nvar SnapshotCache = /*#__PURE__*/function () {\n function SnapshotCache(size) {\n _classCallCheck(this, SnapshotCache);\n\n this.keys = [];\n this.snapshots = {};\n this.size = size;\n }\n\n _createClass(SnapshotCache, [{\n key: \"has\",\n value: function has(location) {\n return toCacheKey(location) in this.snapshots;\n }\n }, {\n key: \"get\",\n value: function get(location) {\n if (this.has(location)) {\n var snapshot = this.read(location);\n this.touch(location);\n return snapshot;\n }\n }\n }, {\n key: \"put\",\n value: function put(location, snapshot) {\n this.write(location, snapshot);\n this.touch(location);\n return snapshot;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.snapshots = {};\n }\n }, {\n key: \"read\",\n value: function read(location) {\n return this.snapshots[toCacheKey(location)];\n }\n }, {\n key: \"write\",\n value: function write(location, snapshot) {\n this.snapshots[toCacheKey(location)] = snapshot;\n }\n }, {\n key: \"touch\",\n value: function touch(location) {\n var key = toCacheKey(location);\n var index = this.keys.indexOf(key);\n if (index > -1) this.keys.splice(index, 1);\n this.keys.unshift(key);\n this.trim();\n }\n }, {\n key: \"trim\",\n value: function trim() {\n var _iterator13 = _createForOfIteratorHelper(this.keys.splice(this.size)),\n _step13;\n\n try {\n for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {\n var key = _step13.value;\n delete this.snapshots[key];\n }\n } catch (err) {\n _iterator13.e(err);\n } finally {\n _iterator13.f();\n }\n }\n }]);\n\n return SnapshotCache;\n}();\n\nvar PageView = /*#__PURE__*/function (_View2) {\n _inherits(PageView, _View2);\n\n var _super8 = _createSuper(PageView);\n\n function PageView() {\n var _this31;\n\n _classCallCheck(this, PageView);\n\n _this31 = _super8.apply(this, arguments);\n _this31.snapshotCache = new SnapshotCache(10);\n _this31.lastRenderedLocation = new URL(location.href);\n return _this31;\n }\n\n _createClass(PageView, [{\n key: \"renderPage\",\n value: function renderPage(snapshot) {\n var isPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var willRender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var renderer = new PageRenderer(this.snapshot, snapshot, isPreview, willRender);\n return this.render(renderer);\n }\n }, {\n key: \"renderError\",\n value: function renderError(snapshot) {\n var renderer = new ErrorRenderer(this.snapshot, snapshot, false);\n return this.render(renderer);\n }\n }, {\n key: \"clearSnapshotCache\",\n value: function clearSnapshotCache() {\n this.snapshotCache.clear();\n }\n }, {\n key: \"cacheSnapshot\",\n value: function () {\n var _cacheSnapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {\n var snapshot, _location2, cachedSnapshot;\n\n return _regeneratorRuntime().wrap(function _callee20$(_context20) {\n while (1) {\n switch (_context20.prev = _context20.next) {\n case 0:\n if (!this.shouldCacheSnapshot) {\n _context20.next = 8;\n break;\n }\n\n this.delegate.viewWillCacheSnapshot();\n snapshot = this.snapshot, _location2 = this.lastRenderedLocation;\n _context20.next = 5;\n return nextEventLoopTick();\n\n case 5:\n cachedSnapshot = snapshot.clone();\n this.snapshotCache.put(_location2, cachedSnapshot);\n return _context20.abrupt(\"return\", cachedSnapshot);\n\n case 8:\n case \"end\":\n return _context20.stop();\n }\n }\n }, _callee20, this);\n }));\n\n function cacheSnapshot() {\n return _cacheSnapshot.apply(this, arguments);\n }\n\n return cacheSnapshot;\n }()\n }, {\n key: \"getCachedSnapshotForLocation\",\n value: function getCachedSnapshotForLocation(location) {\n return this.snapshotCache.get(location);\n }\n }, {\n key: \"snapshot\",\n get: function get() {\n return PageSnapshot.fromElement(this.element);\n }\n }, {\n key: \"shouldCacheSnapshot\",\n get: function get() {\n return this.snapshot.isCacheable;\n }\n }]);\n\n return PageView;\n}(View);\n\nvar Session = /*#__PURE__*/function () {\n function Session() {\n _classCallCheck(this, Session);\n\n this.navigator = new Navigator(this);\n this.history = new History(this);\n this.view = new PageView(this, document.documentElement);\n this.adapter = new BrowserAdapter(this);\n this.pageObserver = new PageObserver(this);\n this.cacheObserver = new CacheObserver();\n this.linkClickObserver = new LinkClickObserver(this);\n this.formSubmitObserver = new FormSubmitObserver(this);\n this.scrollObserver = new ScrollObserver(this);\n this.streamObserver = new StreamObserver(this);\n this.frameRedirector = new FrameRedirector(document.documentElement);\n this.drive = true;\n this.enabled = true;\n this.progressBarDelay = 500;\n this.started = false;\n }\n\n _createClass(Session, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.pageObserver.start();\n this.cacheObserver.start();\n this.linkClickObserver.start();\n this.formSubmitObserver.start();\n this.scrollObserver.start();\n this.streamObserver.start();\n this.frameRedirector.start();\n this.history.start();\n this.started = true;\n this.enabled = true;\n }\n }\n }, {\n key: \"disable\",\n value: function disable() {\n this.enabled = false;\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.pageObserver.stop();\n this.cacheObserver.stop();\n this.linkClickObserver.stop();\n this.formSubmitObserver.stop();\n this.scrollObserver.stop();\n this.streamObserver.stop();\n this.frameRedirector.stop();\n this.history.stop();\n this.started = false;\n }\n }\n }, {\n key: \"registerAdapter\",\n value: function registerAdapter(adapter) {\n this.adapter = adapter;\n }\n }, {\n key: \"visit\",\n value: function visit(location) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.navigator.proposeVisit(expandURL(location), options);\n }\n }, {\n key: \"connectStreamSource\",\n value: function connectStreamSource(source) {\n this.streamObserver.connectStreamSource(source);\n }\n }, {\n key: \"disconnectStreamSource\",\n value: function disconnectStreamSource(source) {\n this.streamObserver.disconnectStreamSource(source);\n }\n }, {\n key: \"renderStreamMessage\",\n value: function renderStreamMessage(message) {\n document.documentElement.appendChild(StreamMessage.wrap(message).fragment);\n }\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n this.view.clearSnapshotCache();\n }\n }, {\n key: \"setProgressBarDelay\",\n value: function setProgressBarDelay(delay) {\n this.progressBarDelay = delay;\n }\n }, {\n key: \"location\",\n get: function get() {\n return this.history.location;\n }\n }, {\n key: \"restorationIdentifier\",\n get: function get() {\n return this.history.restorationIdentifier;\n }\n }, {\n key: \"historyPoppedToLocationWithRestorationIdentifier\",\n value: function historyPoppedToLocationWithRestorationIdentifier(location, restorationIdentifier) {\n if (this.enabled) {\n this.navigator.startVisit(location, restorationIdentifier, {\n action: \"restore\",\n historyChanged: true\n });\n } else {\n this.adapter.pageInvalidated();\n }\n }\n }, {\n key: \"scrollPositionChanged\",\n value: function scrollPositionChanged(position) {\n this.history.updateRestorationData({\n scrollPosition: position\n });\n }\n }, {\n key: \"willFollowLinkToLocation\",\n value: function willFollowLinkToLocation(link, location) {\n return this.elementDriveEnabled(link) && locationIsVisitable(location, this.snapshot.rootLocation) && this.applicationAllowsFollowingLinkToLocation(link, location);\n }\n }, {\n key: \"followedLinkToLocation\",\n value: function followedLinkToLocation(link, location) {\n var action = this.getActionForLink(link);\n this.convertLinkWithMethodClickToFormSubmission(link) || this.visit(location.href, {\n action: action\n });\n }\n }, {\n key: \"convertLinkWithMethodClickToFormSubmission\",\n value: function convertLinkWithMethodClickToFormSubmission(link) {\n var linkMethod = link.getAttribute(\"data-turbo-method\");\n\n if (linkMethod) {\n var form = document.createElement(\"form\");\n form.method = linkMethod;\n form.action = link.getAttribute(\"href\") || \"undefined\";\n form.hidden = true;\n\n if (link.hasAttribute(\"data-turbo-confirm\")) {\n form.setAttribute(\"data-turbo-confirm\", link.getAttribute(\"data-turbo-confirm\"));\n }\n\n var frame = this.getTargetFrameForLink(link);\n\n if (frame) {\n form.setAttribute(\"data-turbo-frame\", frame);\n form.addEventListener(\"turbo:submit-start\", function () {\n return form.remove();\n });\n } else {\n form.addEventListener(\"submit\", function () {\n return form.remove();\n });\n }\n\n document.body.appendChild(form);\n return dispatch(\"submit\", {\n cancelable: true,\n target: form\n });\n } else {\n return false;\n }\n }\n }, {\n key: \"allowsVisitingLocationWithAction\",\n value: function allowsVisitingLocationWithAction(location, action) {\n return this.locationWithActionIsSamePage(location, action) || this.applicationAllowsVisitingLocation(location);\n }\n }, {\n key: \"visitProposedToLocation\",\n value: function visitProposedToLocation(location, options) {\n extendURLWithDeprecatedProperties(location);\n this.adapter.visitProposedToLocation(location, options);\n }\n }, {\n key: \"visitStarted\",\n value: function visitStarted(visit) {\n extendURLWithDeprecatedProperties(visit.location);\n\n if (!visit.silent) {\n this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n }\n }\n }, {\n key: \"visitCompleted\",\n value: function visitCompleted(visit) {\n this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n }\n }, {\n key: \"locationWithActionIsSamePage\",\n value: function locationWithActionIsSamePage(location, action) {\n return this.navigator.locationWithActionIsSamePage(location, action);\n }\n }, {\n key: \"visitScrolledToSamePageLocation\",\n value: function visitScrolledToSamePageLocation(oldURL, newURL) {\n this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);\n }\n }, {\n key: \"willSubmitForm\",\n value: function willSubmitForm(form, submitter) {\n var action = getAction(form, submitter);\n return this.elementDriveEnabled(form) && (!submitter || this.elementDriveEnabled(submitter)) && locationIsVisitable(expandURL(action), this.snapshot.rootLocation);\n }\n }, {\n key: \"formSubmitted\",\n value: function formSubmitted(form, submitter) {\n this.navigator.submitForm(form, submitter);\n }\n }, {\n key: \"pageBecameInteractive\",\n value: function pageBecameInteractive() {\n this.view.lastRenderedLocation = this.location;\n this.notifyApplicationAfterPageLoad();\n }\n }, {\n key: \"pageLoaded\",\n value: function pageLoaded() {\n this.history.assumeControlOfScrollRestoration();\n }\n }, {\n key: \"pageWillUnload\",\n value: function pageWillUnload() {\n this.history.relinquishControlOfScrollRestoration();\n }\n }, {\n key: \"receivedMessageFromStream\",\n value: function receivedMessageFromStream(message) {\n this.renderStreamMessage(message);\n }\n }, {\n key: \"viewWillCacheSnapshot\",\n value: function viewWillCacheSnapshot() {\n var _a;\n\n if (!((_a = this.navigator.currentVisit) === null || _a === void 0 ? void 0 : _a.silent)) {\n this.notifyApplicationBeforeCachingSnapshot();\n }\n }\n }, {\n key: \"allowsImmediateRender\",\n value: function allowsImmediateRender(_ref18, resume) {\n var element = _ref18.element;\n var event = this.notifyApplicationBeforeRender(element, resume);\n return !event.defaultPrevented;\n }\n }, {\n key: \"viewRenderedSnapshot\",\n value: function viewRenderedSnapshot(snapshot, isPreview) {\n this.view.lastRenderedLocation = this.history.location;\n this.notifyApplicationAfterRender();\n }\n }, {\n key: \"viewInvalidated\",\n value: function viewInvalidated() {\n this.adapter.pageInvalidated();\n }\n }, {\n key: \"frameLoaded\",\n value: function frameLoaded(frame) {\n this.notifyApplicationAfterFrameLoad(frame);\n }\n }, {\n key: \"frameRendered\",\n value: function frameRendered(fetchResponse, frame) {\n this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n }\n }, {\n key: \"applicationAllowsFollowingLinkToLocation\",\n value: function applicationAllowsFollowingLinkToLocation(link, location) {\n var event = this.notifyApplicationAfterClickingLinkToLocation(link, location);\n return !event.defaultPrevented;\n }\n }, {\n key: \"applicationAllowsVisitingLocation\",\n value: function applicationAllowsVisitingLocation(location) {\n var event = this.notifyApplicationBeforeVisitingLocation(location);\n return !event.defaultPrevented;\n }\n }, {\n key: \"notifyApplicationAfterClickingLinkToLocation\",\n value: function notifyApplicationAfterClickingLinkToLocation(link, location) {\n return dispatch(\"turbo:click\", {\n target: link,\n detail: {\n url: location.href\n },\n cancelable: true\n });\n }\n }, {\n key: \"notifyApplicationBeforeVisitingLocation\",\n value: function notifyApplicationBeforeVisitingLocation(location) {\n return dispatch(\"turbo:before-visit\", {\n detail: {\n url: location.href\n },\n cancelable: true\n });\n }\n }, {\n key: \"notifyApplicationAfterVisitingLocation\",\n value: function notifyApplicationAfterVisitingLocation(location, action) {\n markAsBusy(document.documentElement);\n return dispatch(\"turbo:visit\", {\n detail: {\n url: location.href,\n action: action\n }\n });\n }\n }, {\n key: \"notifyApplicationBeforeCachingSnapshot\",\n value: function notifyApplicationBeforeCachingSnapshot() {\n return dispatch(\"turbo:before-cache\");\n }\n }, {\n key: \"notifyApplicationBeforeRender\",\n value: function notifyApplicationBeforeRender(newBody, resume) {\n return dispatch(\"turbo:before-render\", {\n detail: {\n newBody: newBody,\n resume: resume\n },\n cancelable: true\n });\n }\n }, {\n key: \"notifyApplicationAfterRender\",\n value: function notifyApplicationAfterRender() {\n return dispatch(\"turbo:render\");\n }\n }, {\n key: \"notifyApplicationAfterPageLoad\",\n value: function notifyApplicationAfterPageLoad() {\n var timing = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n clearBusyState(document.documentElement);\n return dispatch(\"turbo:load\", {\n detail: {\n url: this.location.href,\n timing: timing\n }\n });\n }\n }, {\n key: \"notifyApplicationAfterVisitingSamePageLocation\",\n value: function notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {\n dispatchEvent(new HashChangeEvent(\"hashchange\", {\n oldURL: oldURL.toString(),\n newURL: newURL.toString()\n }));\n }\n }, {\n key: \"notifyApplicationAfterFrameLoad\",\n value: function notifyApplicationAfterFrameLoad(frame) {\n return dispatch(\"turbo:frame-load\", {\n target: frame\n });\n }\n }, {\n key: \"notifyApplicationAfterFrameRender\",\n value: function notifyApplicationAfterFrameRender(fetchResponse, frame) {\n return dispatch(\"turbo:frame-render\", {\n detail: {\n fetchResponse: fetchResponse\n },\n target: frame,\n cancelable: true\n });\n }\n }, {\n key: \"elementDriveEnabled\",\n value: function elementDriveEnabled(element) {\n var container = element === null || element === void 0 ? void 0 : element.closest(\"[data-turbo]\");\n\n if (this.drive) {\n if (container) {\n return container.getAttribute(\"data-turbo\") != \"false\";\n } else {\n return true;\n }\n } else {\n if (container) {\n return container.getAttribute(\"data-turbo\") == \"true\";\n } else {\n return false;\n }\n }\n }\n }, {\n key: \"getActionForLink\",\n value: function getActionForLink(link) {\n var action = link.getAttribute(\"data-turbo-action\");\n return isAction(action) ? action : \"advance\";\n }\n }, {\n key: \"getTargetFrameForLink\",\n value: function getTargetFrameForLink(link) {\n var frame = link.getAttribute(\"data-turbo-frame\");\n\n if (frame) {\n return frame;\n } else {\n var container = link.closest(\"turbo-frame\");\n\n if (container) {\n return container.id;\n }\n }\n }\n }, {\n key: \"snapshot\",\n get: function get() {\n return this.view.snapshot;\n }\n }]);\n\n return Session;\n}();\n\nfunction extendURLWithDeprecatedProperties(url) {\n Object.defineProperties(url, deprecatedLocationPropertyDescriptors);\n}\n\nvar deprecatedLocationPropertyDescriptors = {\n absoluteURL: {\n get: function get() {\n return this.toString();\n }\n }\n};\nvar session = new Session();\nvar navigator$1 = session.navigator;\n\nfunction start() {\n session.start();\n}\n\nfunction registerAdapter(adapter) {\n session.registerAdapter(adapter);\n}\n\nfunction visit(location, options) {\n session.visit(location, options);\n}\n\nfunction connectStreamSource(source) {\n session.connectStreamSource(source);\n}\n\nfunction disconnectStreamSource(source) {\n session.disconnectStreamSource(source);\n}\n\nfunction renderStreamMessage(message) {\n session.renderStreamMessage(message);\n}\n\nfunction clearCache() {\n session.clearCache();\n}\n\nfunction setProgressBarDelay(delay) {\n session.setProgressBarDelay(delay);\n}\n\nfunction setConfirmMethod(confirmMethod) {\n FormSubmission.confirmMethod = confirmMethod;\n}\n\nvar Turbo = /*#__PURE__*/Object.freeze({\n __proto__: null,\n navigator: navigator$1,\n session: session,\n PageRenderer: PageRenderer,\n PageSnapshot: PageSnapshot,\n start: start,\n registerAdapter: registerAdapter,\n visit: visit,\n connectStreamSource: connectStreamSource,\n disconnectStreamSource: disconnectStreamSource,\n renderStreamMessage: renderStreamMessage,\n clearCache: clearCache,\n setProgressBarDelay: setProgressBarDelay,\n setConfirmMethod: setConfirmMethod\n});\n\nvar FrameController = /*#__PURE__*/function () {\n function FrameController(element) {\n _classCallCheck(this, FrameController);\n\n this.fetchResponseLoaded = function (fetchResponse) {};\n\n this.currentFetchRequest = null;\n\n this.resolveVisitPromise = function () {};\n\n this.connected = false;\n this.hasBeenLoaded = false;\n this.settingSourceURL = false;\n this.element = element;\n this.view = new FrameView(this, this.element);\n this.appearanceObserver = new AppearanceObserver(this, this.element);\n this.linkInterceptor = new LinkInterceptor(this, this.element);\n this.formInterceptor = new FormInterceptor(this, this.element);\n }\n\n _createClass(FrameController, [{\n key: \"connect\",\n value: function connect() {\n if (!this.connected) {\n this.connected = true;\n this.reloadable = false;\n\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n }\n\n this.linkInterceptor.start();\n this.formInterceptor.start();\n this.sourceURLChanged();\n }\n }\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n if (this.connected) {\n this.connected = false;\n this.appearanceObserver.stop();\n this.linkInterceptor.stop();\n this.formInterceptor.stop();\n }\n }\n }, {\n key: \"disabledChanged\",\n value: function disabledChanged() {\n if (this.loadingStyle == FrameLoadingStyle.eager) {\n this.loadSourceURL();\n }\n }\n }, {\n key: \"sourceURLChanged\",\n value: function sourceURLChanged() {\n if (this.loadingStyle == FrameLoadingStyle.eager || this.hasBeenLoaded) {\n this.loadSourceURL();\n }\n }\n }, {\n key: \"loadingStyleChanged\",\n value: function loadingStyleChanged() {\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.appearanceObserver.stop();\n this.loadSourceURL();\n }\n }\n }, {\n key: \"loadSourceURL\",\n value: function () {\n var _loadSourceURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {\n var previousURL;\n return _regeneratorRuntime().wrap(function _callee21$(_context21) {\n while (1) {\n switch (_context21.prev = _context21.next) {\n case 0:\n if (!(!this.settingSourceURL && this.enabled && this.isActive && (this.reloadable || this.sourceURL != this.currentURL))) {\n _context21.next = 16;\n break;\n }\n\n previousURL = this.currentURL;\n this.currentURL = this.sourceURL;\n\n if (!this.sourceURL) {\n _context21.next = 16;\n break;\n }\n\n _context21.prev = 4;\n this.element.loaded = this.visit(expandURL(this.sourceURL));\n this.appearanceObserver.stop();\n _context21.next = 9;\n return this.element.loaded;\n\n case 9:\n this.hasBeenLoaded = true;\n _context21.next = 16;\n break;\n\n case 12:\n _context21.prev = 12;\n _context21.t0 = _context21[\"catch\"](4);\n this.currentURL = previousURL;\n throw _context21.t0;\n\n case 16:\n case \"end\":\n return _context21.stop();\n }\n }\n }, _callee21, this, [[4, 12]]);\n }));\n\n function loadSourceURL() {\n return _loadSourceURL.apply(this, arguments);\n }\n\n return loadSourceURL;\n }()\n }, {\n key: \"loadResponse\",\n value: function () {\n var _loadResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(fetchResponse) {\n var html, _parseHTMLDocument, body, snapshot, renderer;\n\n return _regeneratorRuntime().wrap(function _callee22$(_context22) {\n while (1) {\n switch (_context22.prev = _context22.next) {\n case 0:\n if (fetchResponse.redirected || fetchResponse.succeeded && fetchResponse.isHTML) {\n this.sourceURL = fetchResponse.response.url;\n }\n\n _context22.prev = 1;\n _context22.next = 4;\n return fetchResponse.responseHTML;\n\n case 4:\n html = _context22.sent;\n\n if (!html) {\n _context22.next = 21;\n break;\n }\n\n _parseHTMLDocument = parseHTMLDocument(html), body = _parseHTMLDocument.body;\n _context22.t0 = Snapshot;\n _context22.next = 10;\n return this.extractForeignFrameElement(body);\n\n case 10:\n _context22.t1 = _context22.sent;\n snapshot = new _context22.t0(_context22.t1);\n renderer = new FrameRenderer(this.view.snapshot, snapshot, false, false);\n\n if (!this.view.renderPromise) {\n _context22.next = 16;\n break;\n }\n\n _context22.next = 16;\n return this.view.renderPromise;\n\n case 16:\n _context22.next = 18;\n return this.view.render(renderer);\n\n case 18:\n session.frameRendered(fetchResponse, this.element);\n session.frameLoaded(this.element);\n this.fetchResponseLoaded(fetchResponse);\n\n case 21:\n _context22.next = 27;\n break;\n\n case 23:\n _context22.prev = 23;\n _context22.t2 = _context22[\"catch\"](1);\n console.error(_context22.t2);\n this.view.invalidate();\n\n case 27:\n _context22.prev = 27;\n\n this.fetchResponseLoaded = function () {};\n\n return _context22.finish(27);\n\n case 30:\n case \"end\":\n return _context22.stop();\n }\n }\n }, _callee22, this, [[1, 23, 27, 30]]);\n }));\n\n function loadResponse(_x16) {\n return _loadResponse.apply(this, arguments);\n }\n\n return loadResponse;\n }()\n }, {\n key: \"elementAppearedInViewport\",\n value: function elementAppearedInViewport(element) {\n this.loadSourceURL();\n }\n }, {\n key: \"shouldInterceptLinkClick\",\n value: function shouldInterceptLinkClick(element, url) {\n if (element.hasAttribute(\"data-turbo-method\")) {\n return false;\n } else {\n return this.shouldInterceptNavigation(element);\n }\n }\n }, {\n key: \"linkClickIntercepted\",\n value: function linkClickIntercepted(element, url) {\n this.reloadable = true;\n this.navigateFrame(element, url);\n }\n }, {\n key: \"shouldInterceptFormSubmission\",\n value: function shouldInterceptFormSubmission(element, submitter) {\n return this.shouldInterceptNavigation(element, submitter);\n }\n }, {\n key: \"formSubmissionIntercepted\",\n value: function formSubmissionIntercepted(element, submitter) {\n if (this.formSubmission) {\n this.formSubmission.stop();\n }\n\n this.reloadable = false;\n this.formSubmission = new FormSubmission(this, element, submitter);\n var fetchRequest = this.formSubmission.fetchRequest;\n this.prepareHeadersForRequest(fetchRequest.headers, fetchRequest);\n this.formSubmission.start();\n }\n }, {\n key: \"prepareHeadersForRequest\",\n value: function prepareHeadersForRequest(headers, request) {\n headers[\"Turbo-Frame\"] = this.id;\n }\n }, {\n key: \"requestStarted\",\n value: function requestStarted(request) {\n markAsBusy(this.element);\n }\n }, {\n key: \"requestPreventedHandlingResponse\",\n value: function requestPreventedHandlingResponse(request, response) {\n this.resolveVisitPromise();\n }\n }, {\n key: \"requestSucceededWithResponse\",\n value: function () {\n var _requestSucceededWithResponse2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(request, response) {\n return _regeneratorRuntime().wrap(function _callee23$(_context23) {\n while (1) {\n switch (_context23.prev = _context23.next) {\n case 0:\n _context23.next = 2;\n return this.loadResponse(response);\n\n case 2:\n this.resolveVisitPromise();\n\n case 3:\n case \"end\":\n return _context23.stop();\n }\n }\n }, _callee23, this);\n }));\n\n function requestSucceededWithResponse(_x17, _x18) {\n return _requestSucceededWithResponse2.apply(this, arguments);\n }\n\n return requestSucceededWithResponse;\n }()\n }, {\n key: \"requestFailedWithResponse\",\n value: function requestFailedWithResponse(request, response) {\n console.error(response);\n this.resolveVisitPromise();\n }\n }, {\n key: \"requestErrored\",\n value: function requestErrored(request, error) {\n console.error(error);\n this.resolveVisitPromise();\n }\n }, {\n key: \"requestFinished\",\n value: function requestFinished(request) {\n clearBusyState(this.element);\n }\n }, {\n key: \"formSubmissionStarted\",\n value: function formSubmissionStarted(_ref4) {\n var formElement = _ref4.formElement;\n markAsBusy(formElement, this.findFrameElement(formElement));\n }\n }, {\n key: \"formSubmissionSucceededWithResponse\",\n value: function formSubmissionSucceededWithResponse(formSubmission, response) {\n var frame = this.findFrameElement(formSubmission.formElement, formSubmission.submitter);\n this.proposeVisitIfNavigatedWithAction(frame, formSubmission.formElement, formSubmission.submitter);\n frame.delegate.loadResponse(response);\n }\n }, {\n key: \"formSubmissionFailedWithResponse\",\n value: function formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n this.element.delegate.loadResponse(fetchResponse);\n }\n }, {\n key: \"formSubmissionErrored\",\n value: function formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n }, {\n key: \"formSubmissionFinished\",\n value: function formSubmissionFinished(_ref8) {\n var formElement = _ref8.formElement;\n clearBusyState(formElement, this.findFrameElement(formElement));\n }\n }, {\n key: \"allowsImmediateRender\",\n value: function allowsImmediateRender(snapshot, resume) {\n return true;\n }\n }, {\n key: \"viewRenderedSnapshot\",\n value: function viewRenderedSnapshot(snapshot, isPreview) {}\n }, {\n key: \"viewInvalidated\",\n value: function viewInvalidated() {}\n }, {\n key: \"visit\",\n value: function () {\n var _visit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(url) {\n var _this32 = this;\n\n var _a, request;\n\n return _regeneratorRuntime().wrap(function _callee24$(_context24) {\n while (1) {\n switch (_context24.prev = _context24.next) {\n case 0:\n request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);\n (_a = this.currentFetchRequest) === null || _a === void 0 ? void 0 : _a.cancel();\n this.currentFetchRequest = request;\n return _context24.abrupt(\"return\", new Promise(function (resolve) {\n _this32.resolveVisitPromise = function () {\n _this32.resolveVisitPromise = function () {};\n\n _this32.currentFetchRequest = null;\n resolve();\n };\n\n request.perform();\n }));\n\n case 4:\n case \"end\":\n return _context24.stop();\n }\n }\n }, _callee24, this);\n }));\n\n function visit(_x19) {\n return _visit.apply(this, arguments);\n }\n\n return visit;\n }()\n }, {\n key: \"navigateFrame\",\n value: function navigateFrame(element, url, submitter) {\n var frame = this.findFrameElement(element, submitter);\n this.proposeVisitIfNavigatedWithAction(frame, element, submitter);\n frame.setAttribute(\"reloadable\", \"\");\n frame.src = url;\n }\n }, {\n key: \"proposeVisitIfNavigatedWithAction\",\n value: function proposeVisitIfNavigatedWithAction(frame, element, submitter) {\n var action = getAttribute(\"data-turbo-action\", submitter, element, frame);\n\n if (isAction(action)) {\n var _SnapshotSubstitution = new SnapshotSubstitution(frame),\n visitCachedSnapshot = _SnapshotSubstitution.visitCachedSnapshot;\n\n frame.delegate.fetchResponseLoaded = function (fetchResponse) {\n if (frame.src) {\n var statusCode = fetchResponse.statusCode,\n redirected = fetchResponse.redirected;\n var responseHTML = frame.ownerDocument.documentElement.outerHTML;\n var response = {\n statusCode: statusCode,\n redirected: redirected,\n responseHTML: responseHTML\n };\n session.visit(frame.src, {\n action: action,\n response: response,\n visitCachedSnapshot: visitCachedSnapshot,\n willRender: false\n });\n }\n };\n }\n }\n }, {\n key: \"findFrameElement\",\n value: function findFrameElement(element, submitter) {\n var _a;\n\n var id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n return (_a = getFrameElementById(id)) !== null && _a !== void 0 ? _a : this.element;\n }\n }, {\n key: \"extractForeignFrameElement\",\n value: function () {\n var _extractForeignFrameElement = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(container) {\n var element, id;\n return _regeneratorRuntime().wrap(function _callee25$(_context25) {\n while (1) {\n switch (_context25.prev = _context25.next) {\n case 0:\n id = CSS.escape(this.id);\n _context25.prev = 1;\n\n if (!(element = activateElement(container.querySelector(\"turbo-frame#\".concat(id)), this.currentURL))) {\n _context25.next = 4;\n break;\n }\n\n return _context25.abrupt(\"return\", element);\n\n case 4:\n if (!(element = activateElement(container.querySelector(\"turbo-frame[src][recurse~=\".concat(id, \"]\")), this.currentURL))) {\n _context25.next = 10;\n break;\n }\n\n _context25.next = 7;\n return element.loaded;\n\n case 7:\n _context25.next = 9;\n return this.extractForeignFrameElement(element);\n\n case 9:\n return _context25.abrupt(\"return\", _context25.sent);\n\n case 10:\n console.error(\"Response has no matching element\"));\n _context25.next = 16;\n break;\n\n case 13:\n _context25.prev = 13;\n _context25.t0 = _context25[\"catch\"](1);\n console.error(_context25.t0);\n\n case 16:\n return _context25.abrupt(\"return\", new FrameElement());\n\n case 17:\n case \"end\":\n return _context25.stop();\n }\n }\n }, _callee25, this, [[1, 13]]);\n }));\n\n function extractForeignFrameElement(_x20) {\n return _extractForeignFrameElement.apply(this, arguments);\n }\n\n return extractForeignFrameElement;\n }()\n }, {\n key: \"formActionIsVisitable\",\n value: function formActionIsVisitable(form, submitter) {\n var action = getAction(form, submitter);\n return locationIsVisitable(expandURL(action), this.rootLocation);\n }\n }, {\n key: \"shouldInterceptNavigation\",\n value: function shouldInterceptNavigation(element, submitter) {\n var id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n\n if (element instanceof HTMLFormElement && !this.formActionIsVisitable(element, submitter)) {\n return false;\n }\n\n if (!this.enabled || id == \"_top\") {\n return false;\n }\n\n if (id) {\n var frameElement = getFrameElementById(id);\n\n if (frameElement) {\n return !frameElement.disabled;\n }\n }\n\n if (!session.elementDriveEnabled(element)) {\n return false;\n }\n\n if (submitter && !session.elementDriveEnabled(submitter)) {\n return false;\n }\n\n return true;\n }\n }, {\n key: \"id\",\n get: function get() {\n return this.element.id;\n }\n }, {\n key: \"enabled\",\n get: function get() {\n return !this.element.disabled;\n }\n }, {\n key: \"sourceURL\",\n get: function get() {\n if (this.element.src) {\n return this.element.src;\n }\n },\n set: function set(sourceURL) {\n this.settingSourceURL = true;\n this.element.src = sourceURL !== null && sourceURL !== void 0 ? sourceURL : null;\n this.currentURL = this.element.src;\n this.settingSourceURL = false;\n }\n }, {\n key: \"reloadable\",\n get: function get() {\n var frame = this.findFrameElement(this.element);\n return frame.hasAttribute(\"reloadable\");\n },\n set: function set(value) {\n var frame = this.findFrameElement(this.element);\n\n if (value) {\n frame.setAttribute(\"reloadable\", \"\");\n } else {\n frame.removeAttribute(\"reloadable\");\n }\n }\n }, {\n key: \"loadingStyle\",\n get: function get() {\n return this.element.loading;\n }\n }, {\n key: \"isLoading\",\n get: function get() {\n return this.formSubmission !== undefined || this.resolveVisitPromise() !== undefined;\n }\n }, {\n key: \"isActive\",\n get: function get() {\n return this.element.isActive && this.connected;\n }\n }, {\n key: \"rootLocation\",\n get: function get() {\n var _a;\n\n var meta = this.element.ownerDocument.querySelector(\"meta[name=\\\"turbo-root\\\"]\");\n var root = (_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\";\n return expandURL(root);\n }\n }]);\n\n return FrameController;\n}();\n\nvar SnapshotSubstitution = /*#__PURE__*/_createClass(function SnapshotSubstitution(element) {\n var _this33 = this;\n\n _classCallCheck(this, SnapshotSubstitution);\n\n this.visitCachedSnapshot = function (_ref13) {\n var element = _ref13.element;\n\n var _a;\n\n var id = _this33.id,\n clone = _this33.clone;\n (_a = element.querySelector(\"#\" + id)) === null || _a === void 0 ? void 0 : _a.replaceWith(clone);\n };\n\n this.clone = element.cloneNode(true);\n this.id = element.id;\n});\n\nfunction getFrameElementById(id) {\n if (id != null) {\n var element = document.getElementById(id);\n\n if (element instanceof FrameElement) {\n return element;\n }\n }\n}\n\nfunction activateElement(element, currentURL) {\n if (element) {\n var src = element.getAttribute(\"src\");\n\n if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {\n throw new Error(\"Matching element has a source URL which references itself\"));\n }\n\n if (element.ownerDocument !== document) {\n element = document.importNode(element, true);\n }\n\n if (element instanceof FrameElement) {\n element.connectedCallback();\n element.disconnectedCallback();\n return element;\n }\n }\n}\n\nvar StreamActions = {\n after: function after() {\n var _this34 = this;\n\n this.targetElements.forEach(function (e) {\n var _a;\n\n return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(_this34.templateContent, e.nextSibling);\n });\n },\n append: function append() {\n var _this35 = this;\n\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach(function (e) {\n return e.append(_this35.templateContent);\n });\n },\n before: function before() {\n var _this36 = this;\n\n this.targetElements.forEach(function (e) {\n var _a;\n\n return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(_this36.templateContent, e);\n });\n },\n prepend: function prepend() {\n var _this37 = this;\n\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach(function (e) {\n return e.prepend(_this37.templateContent);\n });\n },\n remove: function remove() {\n this.targetElements.forEach(function (e) {\n return e.remove();\n });\n },\n replace: function replace() {\n var _this38 = this;\n\n this.targetElements.forEach(function (e) {\n return e.replaceWith(_this38.templateContent);\n });\n },\n update: function update() {\n var _this39 = this;\n\n this.targetElements.forEach(function (e) {\n e.innerHTML = \"\";\n e.append(_this39.templateContent);\n });\n }\n};\n\nvar StreamElement = /*#__PURE__*/function (_HTMLElement2) {\n _inherits(StreamElement, _HTMLElement2);\n\n var _super9 = _createSuper(StreamElement);\n\n function StreamElement() {\n _classCallCheck(this, StreamElement);\n\n return _super9.apply(this, arguments);\n }\n\n _createClass(StreamElement, [{\n key: \"connectedCallback\",\n value: function () {\n var _connectedCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {\n return _regeneratorRuntime().wrap(function _callee26$(_context26) {\n while (1) {\n switch (_context26.prev = _context26.next) {\n case 0:\n _context26.prev = 0;\n _context26.next = 3;\n return this.render();\n\n case 3:\n _context26.next = 8;\n break;\n\n case 5:\n _context26.prev = 5;\n _context26.t0 = _context26[\"catch\"](0);\n console.error(_context26.t0);\n\n case 8:\n _context26.prev = 8;\n this.disconnect();\n return _context26.finish(8);\n\n case 11:\n case \"end\":\n return _context26.stop();\n }\n }\n }, _callee26, this, [[0, 5, 8, 11]]);\n }));\n\n function connectedCallback() {\n return _connectedCallback.apply(this, arguments);\n }\n\n return connectedCallback;\n }()\n }, {\n key: \"render\",\n value: function () {\n var _render6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {\n var _this40 = this;\n\n var _a;\n\n return _regeneratorRuntime().wrap(function _callee28$(_context28) {\n while (1) {\n switch (_context28.prev = _context28.next) {\n case 0:\n return _context28.abrupt(\"return\", (_a = this.renderPromise) !== null && _a !== void 0 ? _a : this.renderPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {\n return _regeneratorRuntime().wrap(function _callee27$(_context27) {\n while (1) {\n switch (_context27.prev = _context27.next) {\n case 0:\n if (!_this40.dispatchEvent(_this40.beforeRenderEvent)) {\n _context27.next = 4;\n break;\n }\n\n _context27.next = 3;\n return nextAnimationFrame();\n\n case 3:\n _this40.performAction();\n\n case 4:\n case \"end\":\n return _context27.stop();\n }\n }\n }, _callee27);\n }))());\n\n case 1:\n case \"end\":\n return _context28.stop();\n }\n }\n }, _callee28, this);\n }));\n\n function render() {\n return _render6.apply(this, arguments);\n }\n\n return render;\n }()\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n try {\n this.remove();\n } catch (_a) {}\n }\n }, {\n key: \"removeDuplicateTargetChildren\",\n value: function removeDuplicateTargetChildren() {\n this.duplicateChildren.forEach(function (c) {\n return c.remove();\n });\n }\n }, {\n key: \"duplicateChildren\",\n get: function get() {\n var _a;\n\n var existingChildren = this.targetElements.flatMap(function (e) {\n return _toConsumableArray(e.children);\n }).filter(function (c) {\n return !!c.id;\n });\n\n var newChildrenIds = _toConsumableArray((_a = this.templateContent) === null || _a === void 0 ? void 0 : _a.children).filter(function (c) {\n return !!c.id;\n }).map(function (c) {\n return c.id;\n });\n\n return existingChildren.filter(function (c) {\n return newChildrenIds.includes(c.id);\n });\n }\n }, {\n key: \"performAction\",\n get: function get() {\n if (this.action) {\n var actionFunction = StreamActions[this.action];\n\n if (actionFunction) {\n return actionFunction;\n }\n\n this.raise(\"unknown action\");\n }\n\n this.raise(\"action attribute is missing\");\n }\n }, {\n key: \"targetElements\",\n get: function get() {\n if (this.target) {\n return this.targetElementsById;\n } else if (this.targets) {\n return this.targetElementsByQuery;\n } else {\n this.raise(\"target or targets attribute is missing\");\n }\n }\n }, {\n key: \"templateContent\",\n get: function get() {\n return this.templateElement.content.cloneNode(true);\n }\n }, {\n key: \"templateElement\",\n get: function get() {\n if (this.firstElementChild instanceof HTMLTemplateElement) {\n return this.firstElementChild;\n }\n\n this.raise(\"first child element must be a