{"version":3,"file":"discourse-local-dates.js","names":["define","_exports","_component","_helper","_modifier","_object","_computed","_runloop","_template","_object2","_calendarDateTimeInput","_dButton","_dModal","_textField","_dIcon","_computed2","_decorators","_environment","_localDates","_text","_comboBox","_multiSelect","_timezoneInput","_discourseI18n","_localDateMarkupGenerator","_templateFactory","Object","defineProperty","value","default","LocalDatesCreate","timeFormat","dateFormat","dateTimeFormat","date","toDate","time","toTime","format","formats","recurring","advancedMode","timezone","fromSelected","toSelected","dt7948","g","this","prototype","notEmpty","fromFilled","i","toFilled","propertyNotEqual","timezoneIsDifferentFromUserTimezone","init","super","arguments","_picker","setProperties","timezones","siteSettings","discourse_local_dates_default_formats","split","filter","f","currentUserTimezone","moment","didInsertElement","send","configChanged","_renderPreview","n","observes","markup","result","cook","set","schedule","applyLocalDates","document","querySelectorAll","debounce","INPUT_DELAY","isRange","isValid","config","fromConfig","from","dateTime","toConfig","to","diff","options","timeInferred","tz","includes","create","range","endOf","computedConfig","currentUser","user_option","guess","allTimezones","names","formattedCurrentUserTimezone","replace","previewedFormats","map","preview","recurringOptions","key","name","i18n","id","_generateDateMarkup","fromDateTime","toDateTime","toggleModeBtnLabel","text","formattedFrom","formattedTo","updateFormat","event","preventDefault","action","selectedDate","selectedTime","changeSelectedDate","changeSelectedTime","eraseToDateTime","focusFrom","minDate","focusTo","get","toggleAdvancedMode","toggleProperty","save","closeModal","model","insertDate","cancel","setComponentTemplate","createTemplateFactory","block","moduleName","scope","hash","fn","htmlSafe","on","isStrictMode","_owner","_service","_bbcodeAttributes","_downloadCalendar","_iconLibrary","_pluginApi","_toMarkdown","_utilities","_localDatesCreate","_localDateBuilder","_richEditorExtension","dates","discourse_local_dates_enabled","currentUserTZ","forEach","element","index","arr","opts","buildOptionsFromElement","attributes","fromElement","toElement","_getDateFromElement","isSame","_rangeIsSameLocalDay","sameLocalDayAsFrom","localDateBuilder","build","innerText","insertAdjacentHTML","iconHTML","formatted","setAttribute","textPreview","classes","pastEvent","push","classList","add","dataset","_rangeElements","length","duration","startDataset","endDataset","dateElement","startDateTime","trim","_calculateDuration","discourse_local_dates_default_timezones","Boolean","calendar","displayedTimezone","countdown","buildOptionsFromMarkdownTag","parentElement","partitions","ranges","Array","children","span","splice","_partitionedRanges","find","pair","initializeDiscourseLocalDates","api","registerRichEditorExtension","modal","container","lookup","defaultTitle","site_name","title","decorateCookedElement","elem","helper","topicTitle","getModel","topic","addComposerToolbarPopupMenuOption","label","icon","show","addText","shortcut","alwaysShowShortcut","shortcutAction","getCurrentUser","addTextDecorateCallback","nextElement","_previousElement","metadata","discourseLocalDateStartRangeOpts","class","addTagDecorateCallback","startRangeOpts","endRangeOpts","prefix","buildHtmlPreview","htmlPreviews","previews","previewNode","createElement","current","timezoneNode","appendChild","dateTimeNode","innerHTML","previewsNode","htmlPreview","calendarNode","startDate","endDate","calculateStartAndEndDate","node","renderIcon","toISOString","ics","_downloadCalendarNode","outerHTML","LocalDatesInit","service","tooltip","constructor","owner","setOwner","window","addEventListener","showDatePopover","passive","withPluginApi","target","contains","icsData","bbcodeAttributeDecode","summaryMatch","match","downloadIcs","startsAt","endsAt","downloadCalendar","close","identifier","content","bind","blob","Blob","type","url","URL","createObjectURL","a","href","fileName","slugify","download","click","setTimeout","revokeObjectURL","teardown","removeEventListener","initialize","instance","DateWithZoneHelper","fromDatetime","datetime","localTimezone","year","month","day","hour","minute","second","params","getProperties","isDST","unitRepetitionsBetweenDates","count","unit","Math","abs","fractional","trunc","parseInt","_fromDatetime","clone","subtract","datetimeWithZone","setup","allowList","registerOptions","datesEmailFormat","discourse_local_dates_email_format","datesEmailTimezone","discourse_local_dates_email_timezone","features","registerPlugin","md","core","textPostProcess","ruler","matcher","onMatch","link","timezoneNames","addLocalDate","state","buffer","applyDataAttributes","join","_default","emailFormat","discourse","defaultFormat","emailTimezone","emailPreview","utc","token","Token","attrs","matches","parseBBCodeTag","parsed","tag","_arrayTools","_dateWithZoneHelper","TIME_FORMAT","Set","x","undefined","localDate","isAfter","repetitionsForType","_generatePreviews","hasTime","_applyFormatting","_generateTextPreviews","_zoneWithoutPrefix","previewedTimezones","_isEqualZones","_createDateTimeRange","some","t","unshift","uniqueItemsFromArray","timezoneA","timezoneB","utcOffset","startRange","_calculateDatesForRange","formatElements","_optionalTimeIcon","concat","_endDateFormat","_shortFormat","reverse","diffTime","humanize","sameTimezone","inCalendarRange","isBetween","_timeOnlyFormat","hours","minutes","_calendarFormats","_formatWithZone","sameDay","_translateCalendarKey","nextDay","lastDay","sameElse","translated","w","_formatTimezone","part1","part2","localTime","_utils","isEmpty","isArray","extension","nodeSpec","local_date","group","inline","parseDOM","getAttrs","dom","getAttribute","toDOM","optionalTime","local_date_range","fromDate","fromTime","fromTimeStr","toTimeStr","parse","span_open","tokens","attrGet","openNode","schema","nodes","__localDateRange","top","span_close","closeNode","serializeNode","utils","isBoundary","parent","flushClose","out","write","optionalTimezone","nextSibling","childCount","child","isText"],"sources":["discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create.js","discourse/plugins/discourse-local-dates/initializers/discourse-local-dates.js","discourse/plugins/discourse-local-dates/lib/date-with-zone-helper.js","discourse/plugins/discourse-local-dates/lib/discourse-markdown/discourse-local-dates.js","discourse/plugins/discourse-local-dates/lib/local-date-builder.js","discourse/plugins/discourse-local-dates/lib/local-date-markup-generator.js","discourse/plugins/discourse-local-dates/lib/rich-editor-extension.js"],"sourcesContent":["define(\"discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create\", [\"exports\", \"@ember/component\", \"@ember/helper\", \"@ember/modifier\", \"@ember/object\", \"@ember/object/computed\", \"@ember/runloop\", \"@ember/template\", \"@ember-decorators/object\", \"discourse/components/calendar-date-time-input\", \"discourse/components/d-button\", \"discourse/components/d-modal\", \"discourse/components/text-field\", \"discourse/helpers/d-icon\", \"discourse/lib/computed\", \"discourse/lib/decorators\", \"discourse/lib/environment\", \"discourse/lib/local-dates\", \"discourse/lib/text\", \"discourse/select-kit/components/combo-box\", \"discourse/select-kit/components/multi-select\", \"discourse/select-kit/components/timezone-input\", \"discourse-i18n\", \"discourse/plugins/discourse-local-dates/lib/local-date-markup-generator\", \"@ember/template-factory\"], function (_exports, _component, _helper, _modifier, _object, _computed, _runloop, _template, _object2, _calendarDateTimeInput, _dButton, _dModal, _textField, _dIcon, _computed2, _decorators, _environment, _localDates, _text, _comboBox, _multiSelect, _timezoneInput, _discourseI18n, _localDateMarkupGenerator, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  /* eslint-disable ember/no-classic-components */\n\n  class LocalDatesCreate extends _component.default {\n    timeFormat = \"HH:mm:ss\";\n    dateFormat = \"YYYY-MM-DD\";\n    dateTimeFormat = \"YYYY-MM-DD HH:mm:ss\";\n    date = null;\n    toDate = null;\n    time = null;\n    toTime = null;\n    format = null;\n    formats = null;\n    recurring = null;\n    advancedMode = false;\n    timezone = null;\n    fromSelected = null;\n    toSelected = null;\n    static {\n      dt7948.g(this.prototype, \"fromFilled\", [(0, _computed.notEmpty)(\"date\")]);\n    }\n    #fromFilled = (dt7948.i(this, \"fromFilled\"), void 0);\n    static {\n      dt7948.g(this.prototype, \"toFilled\", [(0, _computed.notEmpty)(\"toDate\")]);\n    }\n    #toFilled = (dt7948.i(this, \"toFilled\"), void 0);\n    static {\n      dt7948.g(this.prototype, \"timezoneIsDifferentFromUserTimezone\", [(0, _computed2.propertyNotEqual)(\"currentUserTimezone\", \"options.timezone\")]);\n    }\n    #timezoneIsDifferentFromUserTimezone = (dt7948.i(this, \"timezoneIsDifferentFromUserTimezone\"), void 0);\n    init() {\n      super.init(...arguments);\n      this._picker = null;\n      this.setProperties({\n        timezones: [],\n        formats: (this.siteSettings.discourse_local_dates_default_formats || \"\").split(\"|\").filter(f => f),\n        timezone: this.currentUserTimezone,\n        date: moment().format(this.dateFormat)\n      });\n    }\n    didInsertElement() {\n      super.didInsertElement(...arguments);\n      this.send(\"focusFrom\");\n    }\n    configChanged() {\n      this._renderPreview();\n    }\n    static {\n      dt7948.n(this.prototype, \"configChanged\", [(0, _object2.observes)(\"computedConfig.{from,to,options}\", \"options\", \"isValid\", \"isRange\")]);\n    }\n    async _renderPreview() {\n      if (this.markup) {\n        const result = await (0, _text.cook)(this.markup);\n        this.set(\"currentPreview\", result);\n        (0, _runloop.schedule)(\"afterRender\", () => {\n          (0, _localDates.applyLocalDates)(document.querySelectorAll(\".preview .discourse-local-date\"), this.siteSettings);\n        });\n      }\n    }\n    static {\n      dt7948.n(this.prototype, \"_renderPreview\", [(0, _decorators.debounce)(_environment.INPUT_DELAY)]);\n    }\n    isRange(date, toDate, toTime) {\n      return date && (toDate || toTime);\n    }\n    static {\n      dt7948.n(this.prototype, \"isRange\", [(0, _decorators.default)(\"date\", \"toDate\", \"toTime\")]);\n    }\n    isValid(config, isRange) {\n      const fromConfig = config.from;\n      if (!config.from.dateTime || !config.from.dateTime.isValid()) {\n        return false;\n      }\n      if (isRange) {\n        const toConfig = config.to;\n        if (!toConfig.dateTime || !toConfig.dateTime.isValid() || toConfig.dateTime.diff(fromConfig.dateTime) < 0) {\n          return false;\n        }\n      }\n      return true;\n    }\n    static {\n      dt7948.n(this.prototype, \"isValid\", [(0, _decorators.default)(\"computedConfig\", \"isRange\")]);\n    }\n    fromConfig(date, time, isRange, options = {}) {\n      const timeInferred = time ? false : true;\n      let dateTime;\n      if (!timeInferred) {\n        dateTime = moment.tz(`${date} ${time}`, options.timezone);\n      } else {\n        dateTime = moment.tz(date, options.timezone);\n      }\n      if (!timeInferred) {\n        time = dateTime.format(this.timeFormat);\n      }\n      let format = options.format;\n      if (timeInferred && this.formats.includes(format)) {\n        format = \"LL\";\n      }\n      return _object.default.create({\n        date: dateTime.format(this.dateFormat),\n        time,\n        dateTime,\n        format,\n        range: isRange ? \"start\" : false\n      });\n    }\n    static {\n      dt7948.n(this.prototype, \"fromConfig\", [(0, _decorators.default)(\"date\", \"time\", \"isRange\", \"options.{format,timezone}\")]);\n    }\n    toConfig(date, time, isRange, options = {}) {\n      const timeInferred = time ? false : true;\n      if (time && !date) {\n        date = moment().format(this.dateFormat);\n      }\n      let dateTime;\n      if (!timeInferred) {\n        dateTime = moment.tz(`${date} ${time}`, options.timezone);\n      } else {\n        dateTime = moment.tz(date, options.timezone).endOf(\"day\");\n      }\n      if (!timeInferred) {\n        time = dateTime.format(this.timeFormat);\n      }\n      let format = options.format;\n      if (timeInferred && this.formats.includes(format)) {\n        format = \"LL\";\n      }\n      return _object.default.create({\n        date: dateTime.format(this.dateFormat),\n        time,\n        dateTime,\n        format,\n        range: isRange ? \"end\" : false\n      });\n    }\n    static {\n      dt7948.n(this.prototype, \"toConfig\", [(0, _decorators.default)(\"toDate\", \"toTime\", \"isRange\", \"options.{timezone,format}\")]);\n    }\n    options(recurring, timezones, timezone, format) {\n      return _object.default.create({\n        recurring,\n        timezones,\n        timezone,\n        format\n      });\n    }\n    static {\n      dt7948.n(this.prototype, \"options\", [(0, _decorators.default)(\"recurring\", \"timezones\", \"timezone\", \"format\")]);\n    }\n    computedConfig(fromConfig, toConfig, options) {\n      return _object.default.create({\n        from: fromConfig,\n        to: toConfig,\n        options\n      });\n    }\n    static {\n      dt7948.n(this.prototype, \"computedConfig\", [(0, _decorators.default)(\"fromConfig.{date}\", \"toConfig.{date}\", \"options.{recurring,timezones,timezone,format}\")]);\n    }\n    currentUserTimezone() {\n      return this.currentUser.user_option.timezone || moment.tz.guess();\n    }\n    static {\n      dt7948.n(this.prototype, \"currentUserTimezone\", [_decorators.default]);\n    }\n    allTimezones() {\n      return moment.tz.names();\n    }\n    static {\n      dt7948.n(this.prototype, \"allTimezones\", [_decorators.default]);\n    }\n    formattedCurrentUserTimezone(timezone) {\n      return timezone.replace(\"_\", \" \").replace(\"Etc/\", \"\").replace(\"/\", \", \");\n    }\n    static {\n      dt7948.n(this.prototype, \"formattedCurrentUserTimezone\", [(0, _decorators.default)(\"currentUserTimezone\")]);\n    }\n    previewedFormats(formats) {\n      return formats.map(format => {\n        return {\n          format,\n          preview: moment().format(format)\n        };\n      });\n    }\n    static {\n      dt7948.n(this.prototype, \"previewedFormats\", [(0, _decorators.default)(\"formats\")]);\n    }\n    recurringOptions() {\n      const key = \"discourse_local_dates.create.form.recurring\";\n      return [{\n        name: (0, _discourseI18n.i18n)(`${key}.every_day`),\n        id: \"1.days\"\n      }, {\n        name: (0, _discourseI18n.i18n)(`${key}.every_week`),\n        id: \"1.weeks\"\n      }, {\n        name: (0, _discourseI18n.i18n)(`${key}.every_two_weeks`),\n        id: \"2.weeks\"\n      }, {\n        name: (0, _discourseI18n.i18n)(`${key}.every_month`),\n        id: \"1.months\"\n      }, {\n        name: (0, _discourseI18n.i18n)(`${key}.every_two_months`),\n        id: \"2.months\"\n      }, {\n        name: (0, _discourseI18n.i18n)(`${key}.every_three_months`),\n        id: \"3.months\"\n      }, {\n        name: (0, _discourseI18n.i18n)(`${key}.every_six_months`),\n        id: \"6.months\"\n      }, {\n        name: (0, _discourseI18n.i18n)(`${key}.every_year`),\n        id: \"1.years\"\n      }];\n    }\n    static {\n      dt7948.n(this.prototype, \"recurringOptions\", [_decorators.default]);\n    }\n    _generateDateMarkup(fromDateTime, options, isRange, toDateTime) {\n      return (0, _localDateMarkupGenerator.default)(fromDateTime, options, isRange, toDateTime);\n    }\n    toggleModeBtnLabel(advancedMode) {\n      return advancedMode ? \"discourse_local_dates.create.form.simple_mode\" : \"discourse_local_dates.create.form.advanced_mode\";\n    }\n    static {\n      dt7948.n(this.prototype, \"toggleModeBtnLabel\", [(0, _decorators.default)(\"advancedMode\")]);\n    }\n    markup(config, options, isValid, isRange) {\n      let text;\n      if (isValid && config.from) {\n        if (config.to && config.to.range) {\n          text = this._generateDateMarkup(config.from, options, isRange, config.to);\n        } else {\n          text = this._generateDateMarkup(config.from, options, isRange);\n        }\n      }\n      return text;\n    }\n    static {\n      dt7948.n(this.prototype, \"markup\", [(0, _decorators.default)(\"computedConfig.{from,to,options}\", \"options\", \"isValid\", \"isRange\")]);\n    }\n    formattedFrom(dateTime) {\n      return dateTime.format(\"LLLL\");\n    }\n    static {\n      dt7948.n(this.prototype, \"formattedFrom\", [(0, _decorators.default)(\"fromConfig.dateTime\")]);\n    }\n    formattedTo(dateTime) {\n      return dateTime.isValid() ? dateTime.format(\"LLLL\") : (0, _discourseI18n.i18n)(\"discourse_local_dates.create.form.until\");\n    }\n    static {\n      dt7948.n(this.prototype, \"formattedTo\", [(0, _decorators.default)(\"toConfig.dateTime\")]);\n    }\n    updateFormat(format, event) {\n      event?.preventDefault();\n      this.set(\"format\", format);\n    }\n    static {\n      dt7948.n(this.prototype, \"updateFormat\", [_object.action]);\n    }\n    selectedDate(fromSelected) {\n      return fromSelected ? this.date : this.toDate;\n    }\n    static {\n      dt7948.n(this.prototype, \"selectedDate\", [(0, _decorators.default)(\"fromSelected\", \"toSelected\")]);\n    }\n    selectedTime(fromSelected) {\n      return fromSelected ? this.time : this.toTime;\n    }\n    static {\n      dt7948.n(this.prototype, \"selectedTime\", [(0, _decorators.default)(\"fromSelected\", \"toSelected\")]);\n    }\n    changeSelectedDate(date) {\n      if (this.fromSelected) {\n        this.set(\"date\", date);\n      } else {\n        this.set(\"toDate\", date);\n      }\n    }\n    static {\n      dt7948.n(this.prototype, \"changeSelectedDate\", [_object.action]);\n    }\n    changeSelectedTime(time) {\n      if (this.fromSelected) {\n        this.set(\"time\", time);\n      } else {\n        this.set(\"toTime\", time);\n      }\n    }\n    static {\n      dt7948.n(this.prototype, \"changeSelectedTime\", [_object.action]);\n    }\n    eraseToDateTime() {\n      this.setProperties({\n        toDate: null,\n        toTime: null\n      });\n      this.focusFrom();\n    }\n    static {\n      dt7948.n(this.prototype, \"eraseToDateTime\", [_object.action]);\n    }\n    focusFrom() {\n      this.setProperties({\n        fromSelected: true,\n        toSelected: false,\n        minDate: null\n      });\n    }\n    static {\n      dt7948.n(this.prototype, \"focusFrom\", [_object.action]);\n    }\n    focusTo() {\n      this.setProperties({\n        toSelected: true,\n        fromSelected: false,\n        minDate: this.get(\"fromConfig.date\")\n      });\n    }\n    static {\n      dt7948.n(this.prototype, \"focusTo\", [_object.action]);\n    }\n    toggleAdvancedMode() {\n      this.toggleProperty(\"advancedMode\");\n    }\n    static {\n      dt7948.n(this.prototype, \"toggleAdvancedMode\", [_object.action]);\n    }\n    save() {\n      const markup = this.markup;\n      if (markup) {\n        this.closeModal();\n        this.model.insertDate(markup);\n      }\n    }\n    static {\n      dt7948.n(this.prototype, \"save\", [_object.action]);\n    }\n    cancel() {\n      this.closeModal();\n    }\n    static {\n      dt7948.n(this.prototype, \"cancel\", [_object.action]);\n    }\n    static {\n      (0, _component.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n      /*\n        \n          <DModal\n            @title={{i18n \"discourse_local_dates.title\"}}\n            @closeModal={{@closeModal}}\n            class=\"discourse-local-dates-create-modal -large\"\n          >\n            <:body>\n              <div class=\"form\">\n                {{#if this.isValid}}\n                  {{#if this.timezoneIsDifferentFromUserTimezone}}\n                    <div class=\"preview alert alert-info\">\n                      {{i18n \"discourse_local_dates.create.form.current_timezone\"}}\n                      <b\n                      >{{this.formattedCurrentUserTimezone}}</b>{{this.currentPreview}}\n                    </div>\n                  {{/if}}\n                {{else}}\n                  <div class=\"validation-error alert alert-error\">\n                    {{i18n \"discourse_local_dates.create.form.invalid_date\"}}\n                  </div>\n                {{/if}}\n      \n                {{this.computeDate}}\n      \n                <div class=\"date-time-configuration\">\n                  <div class=\"inputs-panel\">\n                    <div\n                      class=\"date-time-control from\n                        {{if this.fromSelected 'is-selected'}}\n                        {{if this.fromFilled 'is-filled'}}\"\n                    >\n                      {{icon \"calendar-days\"}}\n                      <DButton\n                        @action={{this.focusFrom}}\n                        @translatedLabel={{this.formattedFrom}}\n                        id=\"from-date-time\"\n                        class=\"date-time\"\n                        autofocus\n                      />\n                    </div>\n      \n                    <div\n                      class=\"date-time-control to\n                        {{if this.toSelected 'is-selected'}}\n                        {{if this.toFilled 'is-filled'}}\"\n                    >\n                      {{icon \"calendar-days\"}}\n                      <DButton\n                        @action={{this.focusTo}}\n                        @translatedLabel={{this.formattedTo}}\n                        class=\"date-time\"\n                      />\n                      {{#if this.toFilled}}\n                        <DButton\n                          @action={{this.eraseToDateTime}}\n                          @icon=\"xmark\"\n                          class=\"delete-to-date\"\n                        />\n                      {{/if}}\n                    </div>\n      \n                    {{#if this.site.desktopView}}\n                      <TimezoneInput\n                        @options={{hash icon=\"globe\"}}\n                        @value={{this.timezone}}\n                        @onChange={{fn (mut this.timezone)}}\n                      />\n                    {{/if}}\n                  </div>\n      \n                  <div class=\"picker-panel\">\n                    <CalendarDateTimeInput\n                      @datePickerId=\"local-date-create-form\"\n                      @date={{this.selectedDate}}\n                      @time={{this.selectedTime}}\n                      @minDate={{this.minDate}}\n                      @timeFormat={{this.timeFormat}}\n                      @dateFormat={{this.dateFormat}}\n                      @onChangeDate={{this.changeSelectedDate}}\n                      @onChangeTime={{this.changeSelectedTime}}\n                    />\n                  </div>\n      \n                  {{#if this.site.mobileView}}\n                    <TimezoneInput\n                      @value={{this.timezone}}\n                      @options={{hash icon=\"globe\"}}\n                      @onChange={{fn (mut this.timezone)}}\n                    />\n                  {{/if}}\n                </div>\n      \n                {{#if this.advancedMode}}\n                  <div class=\"advanced-options\">\n                    {{#unless this.isRange}}\n                      <div class=\"control-group recurrence\">\n                        <label class=\"control-label\">\n                          {{i18n \"discourse_local_dates.create.form.recurring_title\"}}\n                        </label>\n                        <p>{{htmlSafe\n                            (i18n\n                              \"discourse_local_dates.create.form.recurring_description\"\n                            )\n                          }}</p>\n                        <div class=\"controls\">\n                          <ComboBox\n                            @content={{this.recurringOptions}}\n                            @value={{this.recurring}}\n                            @onChange={{fn (mut this.recurring)}}\n                            @options={{hash\n                              none=\"discourse_local_dates.create.form.recurring_none\"\n                            }}\n                            class=\"recurrence-input\"\n                          />\n                        </div>\n                      </div>\n                    {{/unless}}\n      \n                    <div class=\"control-group timezones\">\n                      <label>{{i18n\n                          \"discourse_local_dates.create.form.timezones_title\"\n                        }}</label>\n                      <p>{{i18n\n                          \"discourse_local_dates.create.form.timezones_description\"\n                        }}</p>\n                      <div class=\"controls\">\n                        <MultiSelect\n                          @valueProperty={{null}}\n                          @nameProperty={{null}}\n                          @content={{this.allTimezones}}\n                          @value={{this.timezones}}\n                          @options={{hash allowAny=false maximum=5}}\n                          class=\"timezones-input\"\n                        />\n                      </div>\n                    </div>\n      \n                    <div class=\"control-group format\">\n                      <label>{{i18n\n                          \"discourse_local_dates.create.form.format_title\"\n                        }}</label>\n                      <p>\n                        {{i18n\n                          \"discourse_local_dates.create.form.format_description\"\n                        }}\n                        <a\n                          target=\"_blank\"\n                          href=\"https://momentjs.com/docs/#/parsing/string-format/\"\n                          rel=\"noopener noreferrer\"\n                        >\n                          {{icon \"circle-question\"}}\n                        </a>\n                      </p>\n                      <div class=\"controls\">\n                        <TextField @value={{this.format}} class=\"format-input\" />\n                      </div>\n                    </div>\n                    <div class=\"control-group\">\n                      <ul class=\"formats\">\n                        {{#each this.previewedFormats as |previewedFormat|}}\n                          <li class=\"format\">\n                            <a\n                              class=\"moment-format\"\n                              href\n                              {{on\n                                \"click\"\n                                (fn this.updateFormat previewedFormat.format)\n                              }}\n                            >\n                              {{previewedFormat.format}}\n                            </a>\n                            <span class=\"previewed-format\">\n                              {{previewedFormat.preview}}\n                            </span>\n                          </li>\n                        {{/each}}\n                      </ul>\n                    </div>\n                  </div>\n                {{/if}}\n              </div>\n            </:body>\n      \n            <:footer>\n      \n              {{#if this.isValid}}\n                <DButton\n                  @action={{this.save}}\n                  @label=\"discourse_local_dates.create.form.insert\"\n                  class=\"btn-primary\"\n                />\n              {{/if}}\n      \n              <DButton\n                @action={{this.cancel}}\n                @translatedLabel={{i18n \"cancel\"}}\n                class=\"btn-flat\"\n              />\n      \n              <DButton\n                @action={{this.toggleAdvancedMode}}\n                @icon=\"gear\"\n                @label={{this.toggleModeBtnLabel}}\n                class=\"btn-default advanced-mode-btn\"\n              />\n            </:footer>\n          </DModal>\n        \n      */\n      {\n        \"id\": \"d3RRPnQa\",\n        \"block\": \"[[[1,\\\"\\\\n    \\\"],[8,[32,0],[[24,0,\\\"discourse-local-dates-create-modal -large\\\"]],[[\\\"@title\\\",\\\"@closeModal\\\"],[[28,[32,1],[\\\"discourse_local_dates.title\\\"],null],[30,1]]],[[\\\"body\\\",\\\"footer\\\"],[[[[1,\\\"\\\\n        \\\"],[10,0],[14,0,\\\"form\\\"],[12],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"isValid\\\"]],[[[41,[30,0,[\\\"timezoneIsDifferentFromUserTimezone\\\"]],[[[1,\\\"              \\\"],[10,0],[14,0,\\\"preview alert alert-info\\\"],[12],[1,\\\"\\\\n                \\\"],[1,[28,[32,1],[\\\"discourse_local_dates.create.form.current_timezone\\\"],null]],[1,\\\"\\\\n                \\\"],[10,\\\"b\\\"],[12],[1,[30,0,[\\\"formattedCurrentUserTimezone\\\"]]],[13],[1,[30,0,[\\\"currentPreview\\\"]]],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null]],[]],[[[1,\\\"            \\\"],[10,0],[14,0,\\\"validation-error alert alert-error\\\"],[12],[1,\\\"\\\\n              \\\"],[1,[28,[32,1],[\\\"discourse_local_dates.create.form.invalid_date\\\"],null]],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n\\\"]],[]]],[1,\\\"\\\\n          \\\"],[1,[30,0,[\\\"computeDate\\\"]]],[1,\\\"\\\\n\\\\n          \\\"],[10,0],[14,0,\\\"date-time-configuration\\\"],[12],[1,\\\"\\\\n            \\\"],[10,0],[14,0,\\\"inputs-panel\\\"],[12],[1,\\\"\\\\n              \\\"],[10,0],[15,0,[29,[\\\"date-time-control from\\\\n                  \\\",[52,[30,0,[\\\"fromSelected\\\"]],\\\"is-selected\\\"],\\\"\\\\n                  \\\",[52,[30,0,[\\\"fromFilled\\\"]],\\\"is-filled\\\"]]]],[12],[1,\\\"\\\\n                \\\"],[1,[28,[32,2],[\\\"calendar-days\\\"],null]],[1,\\\"\\\\n                \\\"],[8,[32,3],[[24,1,\\\"from-date-time\\\"],[24,0,\\\"date-time\\\"],[24,\\\"autofocus\\\",\\\"\\\"]],[[\\\"@action\\\",\\\"@translatedLabel\\\"],[[30,0,[\\\"focusFrom\\\"]],[30,0,[\\\"formattedFrom\\\"]]]],null],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n\\\\n              \\\"],[10,0],[15,0,[29,[\\\"date-time-control to\\\\n                  \\\",[52,[30,0,[\\\"toSelected\\\"]],\\\"is-selected\\\"],\\\"\\\\n                  \\\",[52,[30,0,[\\\"toFilled\\\"]],\\\"is-filled\\\"]]]],[12],[1,\\\"\\\\n                \\\"],[1,[28,[32,2],[\\\"calendar-days\\\"],null]],[1,\\\"\\\\n                \\\"],[8,[32,3],[[24,0,\\\"date-time\\\"]],[[\\\"@action\\\",\\\"@translatedLabel\\\"],[[30,0,[\\\"focusTo\\\"]],[30,0,[\\\"formattedTo\\\"]]]],null],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"toFilled\\\"]],[[[1,\\\"                  \\\"],[8,[32,3],[[24,0,\\\"delete-to-date\\\"]],[[\\\"@action\\\",\\\"@icon\\\"],[[30,0,[\\\"eraseToDateTime\\\"]],\\\"xmark\\\"]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"              \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"site\\\",\\\"desktopView\\\"]],[[[1,\\\"                \\\"],[8,[32,4],null,[[\\\"@options\\\",\\\"@value\\\",\\\"@onChange\\\"],[[28,[32,5],null,[[\\\"icon\\\"],[\\\"globe\\\"]]],[30,0,[\\\"timezone\\\"]],[28,[32,6],[[28,[31,1],[[30,0,[\\\"timezone\\\"]]],null]],null]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"            \\\"],[13],[1,\\\"\\\\n\\\\n            \\\"],[10,0],[14,0,\\\"picker-panel\\\"],[12],[1,\\\"\\\\n              \\\"],[8,[32,7],null,[[\\\"@datePickerId\\\",\\\"@date\\\",\\\"@time\\\",\\\"@minDate\\\",\\\"@timeFormat\\\",\\\"@dateFormat\\\",\\\"@onChangeDate\\\",\\\"@onChangeTime\\\"],[\\\"local-date-create-form\\\",[30,0,[\\\"selectedDate\\\"]],[30,0,[\\\"selectedTime\\\"]],[30,0,[\\\"minDate\\\"]],[30,0,[\\\"timeFormat\\\"]],[30,0,[\\\"dateFormat\\\"]],[30,0,[\\\"changeSelectedDate\\\"]],[30,0,[\\\"changeSelectedTime\\\"]]]],null],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"site\\\",\\\"mobileView\\\"]],[[[1,\\\"              \\\"],[8,[32,4],null,[[\\\"@value\\\",\\\"@options\\\",\\\"@onChange\\\"],[[30,0,[\\\"timezone\\\"]],[28,[32,5],null,[[\\\"icon\\\"],[\\\"globe\\\"]]],[28,[32,6],[[28,[31,1],[[30,0,[\\\"timezone\\\"]]],null]],null]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"          \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"advancedMode\\\"]],[[[1,\\\"            \\\"],[10,0],[14,0,\\\"advanced-options\\\"],[12],[1,\\\"\\\\n\\\"],[41,[51,[30,0,[\\\"isRange\\\"]]],[[[1,\\\"                \\\"],[10,0],[14,0,\\\"control-group recurrence\\\"],[12],[1,\\\"\\\\n                  \\\"],[10,\\\"label\\\"],[14,0,\\\"control-label\\\"],[12],[1,\\\"\\\\n                    \\\"],[1,[28,[32,1],[\\\"discourse_local_dates.create.form.recurring_title\\\"],null]],[1,\\\"\\\\n                  \\\"],[13],[1,\\\"\\\\n                  \\\"],[10,2],[12],[1,[28,[32,8],[[28,[32,1],[\\\"discourse_local_dates.create.form.recurring_description\\\"],null]],null]],[13],[1,\\\"\\\\n                  \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n                    \\\"],[8,[32,9],[[24,0,\\\"recurrence-input\\\"]],[[\\\"@content\\\",\\\"@value\\\",\\\"@onChange\\\",\\\"@options\\\"],[[30,0,[\\\"recurringOptions\\\"]],[30,0,[\\\"recurring\\\"]],[28,[32,6],[[28,[31,1],[[30,0,[\\\"recurring\\\"]]],null]],null],[28,[32,5],null,[[\\\"none\\\"],[\\\"discourse_local_dates.create.form.recurring_none\\\"]]]]],null],[1,\\\"\\\\n                  \\\"],[13],[1,\\\"\\\\n                \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"\\\\n              \\\"],[10,0],[14,0,\\\"control-group timezones\\\"],[12],[1,\\\"\\\\n                \\\"],[10,\\\"label\\\"],[12],[1,[28,[32,1],[\\\"discourse_local_dates.create.form.timezones_title\\\"],null]],[13],[1,\\\"\\\\n                \\\"],[10,2],[12],[1,[28,[32,1],[\\\"discourse_local_dates.create.form.timezones_description\\\"],null]],[13],[1,\\\"\\\\n                \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n                  \\\"],[8,[32,10],[[24,0,\\\"timezones-input\\\"]],[[\\\"@valueProperty\\\",\\\"@nameProperty\\\",\\\"@content\\\",\\\"@value\\\",\\\"@options\\\"],[null,null,[30,0,[\\\"allTimezones\\\"]],[30,0,[\\\"timezones\\\"]],[28,[32,5],null,[[\\\"allowAny\\\",\\\"maximum\\\"],[false,5]]]]],null],[1,\\\"\\\\n                \\\"],[13],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n\\\\n              \\\"],[10,0],[14,0,\\\"control-group format\\\"],[12],[1,\\\"\\\\n                \\\"],[10,\\\"label\\\"],[12],[1,[28,[32,1],[\\\"discourse_local_dates.create.form.format_title\\\"],null]],[13],[1,\\\"\\\\n                \\\"],[10,2],[12],[1,\\\"\\\\n                  \\\"],[1,[28,[32,1],[\\\"discourse_local_dates.create.form.format_description\\\"],null]],[1,\\\"\\\\n                  \\\"],[10,3],[14,\\\"target\\\",\\\"_blank\\\"],[14,6,\\\"https://momentjs.com/docs/#/parsing/string-format/\\\"],[14,\\\"rel\\\",\\\"noopener noreferrer\\\"],[12],[1,\\\"\\\\n                    \\\"],[1,[28,[32,2],[\\\"circle-question\\\"],null]],[1,\\\"\\\\n                  \\\"],[13],[1,\\\"\\\\n                \\\"],[13],[1,\\\"\\\\n                \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n                  \\\"],[8,[32,11],[[24,0,\\\"format-input\\\"]],[[\\\"@value\\\"],[[30,0,[\\\"format\\\"]]]],null],[1,\\\"\\\\n                \\\"],[13],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n              \\\"],[10,0],[14,0,\\\"control-group\\\"],[12],[1,\\\"\\\\n                \\\"],[10,\\\"ul\\\"],[14,0,\\\"formats\\\"],[12],[1,\\\"\\\\n\\\"],[42,[28,[31,4],[[28,[31,4],[[30,0,[\\\"previewedFormats\\\"]]],null]],null],null,[[[1,\\\"                    \\\"],[10,\\\"li\\\"],[14,0,\\\"format\\\"],[12],[1,\\\"\\\\n                      \\\"],[11,3],[24,0,\\\"moment-format\\\"],[24,6,\\\"\\\"],[4,[32,12],[\\\"click\\\",[28,[32,6],[[30,0,[\\\"updateFormat\\\"]],[30,2,[\\\"format\\\"]]],null]],null],[12],[1,\\\"\\\\n                        \\\"],[1,[30,2,[\\\"format\\\"]]],[1,\\\"\\\\n                      \\\"],[13],[1,\\\"\\\\n                      \\\"],[10,1],[14,0,\\\"previewed-format\\\"],[12],[1,\\\"\\\\n                        \\\"],[1,[30,2,[\\\"preview\\\"]]],[1,\\\"\\\\n                      \\\"],[13],[1,\\\"\\\\n                    \\\"],[13],[1,\\\"\\\\n\\\"]],[2]],null],[1,\\\"                \\\"],[13],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"        \\\"],[13],[1,\\\"\\\\n      \\\"]],[]],[[[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"isValid\\\"]],[[[1,\\\"          \\\"],[8,[32,3],[[24,0,\\\"btn-primary\\\"]],[[\\\"@action\\\",\\\"@label\\\"],[[30,0,[\\\"save\\\"]],\\\"discourse_local_dates.create.form.insert\\\"]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"\\\\n        \\\"],[8,[32,3],[[24,0,\\\"btn-flat\\\"]],[[\\\"@action\\\",\\\"@translatedLabel\\\"],[[30,0,[\\\"cancel\\\"]],[28,[32,1],[\\\"cancel\\\"],null]]],null],[1,\\\"\\\\n\\\\n        \\\"],[8,[32,3],[[24,0,\\\"btn-default advanced-mode-btn\\\"]],[[\\\"@action\\\",\\\"@icon\\\",\\\"@label\\\"],[[30,0,[\\\"toggleAdvancedMode\\\"]],\\\"gear\\\",[30,0,[\\\"toggleModeBtnLabel\\\"]]]],null],[1,\\\"\\\\n      \\\"]],[]]]]],[1,\\\"\\\\n  \\\"]],[\\\"@closeModal\\\",\\\"previewedFormat\\\"],[\\\"if\\\",\\\"mut\\\",\\\"unless\\\",\\\"each\\\",\\\"-track-array\\\"]]\",\n        \"moduleName\": \"/var/www/discourse/frontend/discourse/discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create.js\",\n        \"scope\": () => [_dModal.default, _discourseI18n.i18n, _dIcon.default, _dButton.default, _timezoneInput.default, _helper.hash, _helper.fn, _calendarDateTimeInput.default, _template.htmlSafe, _comboBox.default, _multiSelect.default, _textField.default, _modifier.on],\n        \"isStrictMode\": true\n      }), this);\n    }\n  }\n  _exports.default = LocalDatesCreate;\n});","define(\"discourse/plugins/discourse-local-dates/initializers/discourse-local-dates\", [\"exports\", \"@ember/owner\", \"@ember/service\", \"@ember/template\", \"discourse/lib/bbcode-attributes\", \"discourse/lib/decorators\", \"discourse/lib/download-calendar\", \"discourse/lib/icon-library\", \"discourse/lib/plugin-api\", \"discourse/lib/to-markdown\", \"discourse/lib/utilities\", \"discourse-i18n\", \"discourse/plugins/discourse-local-dates/lib/local-date-markup-generator\", \"discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create\", \"discourse/plugins/discourse-local-dates/lib/local-date-builder\", \"discourse/plugins/discourse-local-dates/lib/rich-editor-extension\"], function (_exports, _owner, _service, _template, _bbcodeAttributes, _decorators, _downloadCalendar, _iconLibrary, _pluginApi, _toMarkdown, _utilities, _discourseI18n, _localDateMarkupGenerator, _localDatesCreate, _localDateBuilder, _richEditorExtension) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.applyLocalDates = applyLocalDates;\n  _exports.default = void 0;\n  // Import applyLocalDates from discourse/lib/local-dates instead\n  function applyLocalDates(dates, siteSettings, timezone) {\n    if (!siteSettings.discourse_local_dates_enabled) {\n      return;\n    }\n    const currentUserTZ = timezone || moment.tz.guess();\n    dates.forEach((element, index, arr) => {\n      const opts = buildOptionsFromElement(element, siteSettings);\n      if (element.attributes[\"data-range\"]?.value === \"to\" && index !== 0 && arr[index - 1].attributes[\"data-range\"]?.value === \"from\") {\n        const fromElement = arr[index - 1];\n        if (_rangeIsSameLocalDay(fromElement, element)) {\n          opts.sameLocalDayAsFrom = true;\n        }\n      }\n      const localDateBuilder = new _localDateBuilder.default(opts, currentUserTZ).build();\n      element.innerText = \"\";\n      element.insertAdjacentHTML(\"beforeend\", `${(0, _iconLibrary.iconHTML)(\"earth-americas\")}\n        <span class=\"relative-time\">${localDateBuilder.formatted}</span>`);\n      element.setAttribute(\"aria-label\", localDateBuilder.textPreview);\n      const classes = [\"cooked-date\"];\n      if (localDateBuilder.pastEvent) {\n        classes.push(\"past\");\n      }\n      element.classList.add(...classes);\n    });\n  }\n  function _rangeIsSameLocalDay(fromElement, toElement) {\n    if (!fromElement.attributes[\"data-time\"] || !toElement.attributes[\"data-time\"]) {\n      return false;\n    }\n    const timezone = fromElement.attributes[\"data-timezone\"].value;\n    const from = moment(_getDateFromElement(fromElement)).tz(timezone);\n    const to = moment(_getDateFromElement(toElement)).tz(timezone);\n    return from.isSame(to, \"day\");\n  }\n  function _getDateFromElement(element) {\n    return `${element.attributes[\"data-date\"].value}T${element.attributes[\"data-time\"].value}`;\n  }\n  function buildOptionsFromElement(element, siteSettings) {\n    const opts = {};\n    const dataset = element.dataset;\n    if (_rangeElements(element).length === 2) {\n      opts.duration = _calculateDuration(element);\n    }\n    opts.time = dataset.time;\n    opts.date = dataset.date;\n    opts.recurring = dataset.recurring;\n    opts.timezones = (dataset.timezones || siteSettings.discourse_local_dates_default_timezones || \"Etc/UTC\").split(\"|\").filter(Boolean);\n    opts.timezone = dataset.timezone;\n    opts.calendar = (dataset.calendar || \"on\") === \"on\";\n    opts.displayedTimezone = dataset.displayedTimezone;\n    opts.format = dataset.format || (opts.time ? \"LLL\" : \"LL\");\n    opts.countdown = dataset.countdown;\n    return opts;\n  }\n  function buildOptionsFromMarkdownTag(element) {\n    const opts = {};\n\n    // siteSettings defaults as used by buildOptionsFromElement are purposefully\n    // ommitted to reproduce exactly what was on the original element\n    opts.time = element.attributes[\"data-time\"];\n    opts.date = element.attributes[\"data-date\"];\n    opts.recurring = element.attributes[\"data-recurring\"];\n    opts.timezones = element.attributes[\"data-timezones\"];\n    opts.timezone = element.attributes[\"data-timezone\"];\n    opts.calendar = (element.attributes[\"data-calendar\"] || \"on\") === \"on\";\n    opts.displayedTimezone = element.attributes[\"data-displayed-timezone\"];\n    opts.format = element.attributes[\"data-format\"];\n    opts.countdown = element.attributes[\"data-countdown\"];\n    opts.range = element.attributes[\"data-range\"];\n    return opts;\n  }\n  function _rangeElements(element) {\n    if (!element.parentElement) {\n      return [];\n    }\n    if (element.dataset.range) {\n      return _partitionedRanges(element).find(pair => pair.includes(element));\n    }\n    return [element];\n  }\n  function _partitionedRanges(element) {\n    const partitions = [];\n    const ranges = Array.from(element.parentElement.children).filter(span => span.dataset.range);\n    while (ranges.length > 0) {\n      partitions.push(ranges.splice(0, 2));\n    }\n    return partitions;\n  }\n  function initializeDiscourseLocalDates(api) {\n    api.registerRichEditorExtension(_richEditorExtension.default);\n    const modal = api.container.lookup(\"service:modal\");\n    const siteSettings = api.container.lookup(\"service:site-settings\");\n    const defaultTitle = (0, _discourseI18n.i18n)(\"discourse_local_dates.default_title\", {\n      site_name: siteSettings.title\n    });\n    api.decorateCookedElement((elem, helper) => {\n      const dates = elem.querySelectorAll(\".discourse-local-date\");\n      applyLocalDates(dates, siteSettings);\n      const topicTitle = helper?.getModel()?.topic?.title;\n      dates.forEach(date => {\n        date.dataset.title = date.dataset.title || topicTitle || defaultTitle;\n      });\n    });\n    api.addComposerToolbarPopupMenuOption({\n      name: \"local-dates\",\n      label: \"discourse_local_dates.title\",\n      icon: \"far-clock\",\n      action: event => modal.show(_localDatesCreate.default, {\n        model: {\n          insertDate: markup => event.addText(markup)\n        }\n      }),\n      shortcut: \"Shift+.\",\n      alwaysShowShortcut: true,\n      shortcutAction: event => {\n        const timezone = api.getCurrentUser().user_option.timezone;\n        const time = moment().format(\"HH:mm:ss\");\n        const date = moment().format(\"YYYY-MM-DD\");\n        event.addText(`[date=${date} time=${time} timezone=\"${timezone}\"]`);\n      }\n    });\n    (0, _toMarkdown.addTextDecorateCallback)(function (text, nextElement, _previousElement, metadata) {\n      if (metadata.discourseLocalDateStartRangeOpts && nextElement?.attributes.class?.includes(\"discourse-local-date\") && text === \"→\") {\n        return \"\";\n      }\n    });\n    (0, _toMarkdown.addTagDecorateCallback)(function () {\n      if (this.element.attributes.class?.includes(\"discourse-local-date\")) {\n        if (this.metadata.discourseLocalDateStartRangeOpts) {\n          const startRangeOpts = this.metadata.discourseLocalDateStartRangeOpts;\n          const endRangeOpts = buildOptionsFromMarkdownTag(this.element);\n          const markup = (0, _localDateMarkupGenerator.default)({\n            date: startRangeOpts.date,\n            time: startRangeOpts.time,\n            format: startRangeOpts.format\n          }, endRangeOpts, true, {\n            date: endRangeOpts.date,\n            time: endRangeOpts.time,\n            format: endRangeOpts.format\n          });\n          this.prefix = markup;\n          this.metadata.discourseLocalDateStartRangeOpts = null;\n          return \"\";\n        }\n        if (this.element.attributes[\"data-range\"] === \"true\" || this.element.attributes[\"data-range\"] === \"from\" || this.element.attributes[\"data-range\"] === \"to\") {\n          this.metadata.discourseLocalDateStartRangeOpts = buildOptionsFromMarkdownTag(this.element);\n          return \"\";\n        }\n        const opts = buildOptionsFromMarkdownTag(this.element, siteSettings);\n        const markup = (0, _localDateMarkupGenerator.default)({\n          date: opts.date,\n          time: opts.time,\n          format: opts.format\n        }, opts, false);\n        this.prefix = markup;\n        return \"\";\n      }\n    });\n  }\n  function buildHtmlPreview(element, siteSettings) {\n    const opts = buildOptionsFromElement(element, siteSettings);\n    const localDateBuilder = new _localDateBuilder.default(opts, moment.tz.guess()).build();\n    const htmlPreviews = localDateBuilder.previews.map(preview => {\n      const previewNode = document.createElement(\"div\");\n      previewNode.classList.add(\"preview\");\n      if (preview.current) {\n        previewNode.classList.add(\"current\");\n      }\n      const timezoneNode = document.createElement(\"span\");\n      timezoneNode.classList.add(\"timezone\");\n      timezoneNode.innerText = preview.timezone;\n      previewNode.appendChild(timezoneNode);\n      const dateTimeNode = document.createElement(\"span\");\n      dateTimeNode.classList.add(\"date-time\");\n      dateTimeNode.innerHTML = preview.formatted;\n      previewNode.appendChild(dateTimeNode);\n      return previewNode;\n    });\n    const previewsNode = document.createElement(\"div\");\n    previewsNode.classList.add(\"locale-dates-previews\");\n    htmlPreviews.forEach(htmlPreview => previewsNode.appendChild(htmlPreview));\n    const calendarNode = _downloadCalendarNode(element);\n    if (calendarNode) {\n      previewsNode.appendChild(calendarNode);\n    }\n    return previewsNode.outerHTML;\n  }\n  function calculateStartAndEndDate(startDataset, endDataset) {\n    let startDate, endDate;\n    startDate = moment.tz(`${startDataset.date} ${startDataset.time || \"\"}`.trim(), startDataset.timezone);\n    if (endDataset) {\n      endDate = moment.tz(`${endDataset.date} ${endDataset.time || \"\"}`.trim(), endDataset.timezone);\n    }\n    return [startDate, endDate];\n  }\n  function _downloadCalendarNode(element) {\n    const [startDataset, endDataset] = _rangeElements(element).map(dateElement => dateElement.dataset);\n    const [startDate, endDate] = calculateStartAndEndDate(startDataset, endDataset);\n    if (startDate < moment().tz(startDataset.timezone)) {\n      return false;\n    }\n    const node = document.createElement(\"div\");\n    node.classList.add(\"download-calendar\");\n    node.innerHTML = `${(0, _iconLibrary.renderIcon)(\"string\", \"file\")} ${(0, _discourseI18n.i18n)(\"download_calendar.add_to_calendar\")}`;\n    node.setAttribute(\"data-starts-at\", startDate.toISOString());\n    if (endDataset) {\n      node.setAttribute(\"data-ends-at\", endDate.toISOString());\n    }\n    if (!startDataset.time && !endDataset) {\n      node.setAttribute(\"data-ends-at\", startDate.add(24, \"hours\").toISOString());\n    }\n    if (startDataset.title) {\n      node.setAttribute(\"data-title\", startDataset.title);\n    }\n    if (startDataset.timezone) {\n      node.setAttribute(\"data-timezone\", startDataset.timezone);\n    }\n\n    // If ics data is available, pass it to the download button\n    if (startDataset.ics) {\n      node.setAttribute(\"data-ics\", startDataset.ics);\n    }\n    return node;\n  }\n  function _calculateDuration(element) {\n    const [startDataset, endDataset] = _rangeElements(element).map(dateElement => dateElement.dataset);\n    const startDateTime = moment(`${startDataset.date} ${startDataset.time || \"\"}`.trim());\n    const endDateTime = moment(`${endDataset.date} ${endDataset.time || \"\"}`.trim());\n    const duration = endDateTime.diff(startDateTime, \"minutes\");\n\n    // negative duration is used when we calculate difference for end date from range\n    return element.dataset === startDataset ? duration : -duration;\n  }\n  class LocalDatesInit {\n    static {\n      dt7948.g(this.prototype, \"siteSettings\", [_service.service]);\n    }\n    #siteSettings = (dt7948.i(this, \"siteSettings\"), void 0);\n    static {\n      dt7948.g(this.prototype, \"tooltip\", [_service.service]);\n    }\n    #tooltip = (dt7948.i(this, \"tooltip\"), void 0);\n    constructor(owner) {\n      (0, _owner.setOwner)(this, owner);\n      window.addEventListener(\"click\", this.showDatePopover, {\n        passive: true\n      });\n      if (this.siteSettings.discourse_local_dates_enabled) {\n        (0, _pluginApi.withPluginApi)(initializeDiscourseLocalDates);\n      }\n    }\n    showDatePopover(event) {\n      if (event?.target?.classList?.contains(\"download-calendar\")) {\n        const dataset = event.target.dataset;\n        if (dataset.ics) {\n          const icsData = (0, _bbcodeAttributes.bbcodeAttributeDecode)(dataset.ics);\n          let title;\n          if (dataset.title) {\n            title = dataset.title;\n          } else {\n            // Extract event title from ICS SUMMARY field for filename if title missing\n            const summaryMatch = icsData.match(/SUMMARY:(.+?)[\\r\\n]/);\n            if (summaryMatch && summaryMatch[1]) {\n              title = summaryMatch[1].trim();\n            }\n          }\n          this.downloadIcs(title || \"event\", icsData);\n        } else {\n          const dates = [{\n            startsAt: dataset.startsAt,\n            endsAt: dataset.endsAt\n          }];\n\n          // Add timezone if available\n          if (dataset.timezone) {\n            dates[0].timezone = dataset.timezone;\n          }\n          (0, _downloadCalendar.downloadCalendar)(dataset.title, dates);\n        }\n        return this.tooltip.close(\"local-date\");\n      }\n      if (!event?.target?.classList?.contains(\"discourse-local-date\")) {\n        return;\n      }\n      return this.tooltip.show(event.target, {\n        identifier: \"local-date\",\n        content: (0, _template.htmlSafe)(buildHtmlPreview(event.target, this.siteSettings))\n      });\n    }\n    static {\n      dt7948.n(this.prototype, \"showDatePopover\", [_decorators.bind]);\n    }\n    downloadIcs(title, icsData) {\n      const blob = new Blob([icsData], {\n        type: \"text/calendar;charset=utf-8\"\n      });\n      const url = URL.createObjectURL(blob);\n      try {\n        const a = document.createElement(\"a\");\n        a.href = url;\n        const fileName = (0, _utilities.slugify)(title);\n        a.download = `${fileName}.ics`;\n        // Most browsers allow clicking without attaching to DOM.\n        a.click();\n      } finally {\n        // Revoke on next tick so the download can start.\n        setTimeout(() => URL.revokeObjectURL(url), 0);\n      }\n    }\n    teardown() {\n      window.removeEventListener(\"click\", this.showDatePopover);\n    }\n  }\n  var _default = _exports.default = {\n    initialize(owner) {\n      this.instance = new LocalDatesInit(owner);\n    },\n    teardown() {\n      this.instance.teardown();\n      this.instance = null;\n    }\n  };\n});","define(\"discourse/plugins/discourse-local-dates/lib/date-with-zone-helper\", [\"exports\", \"@ember/object\"], function (_exports, _object) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  /*\n    DateWithZoneHelper provides a limited list of helpers\n    to manipulate a moment object with timezones\n  \n    - add(count unit) adds a COUNT of UNITS to a date\n    - subtract(count unit) subtracts a COUNT of UNITS to a date\n    - format(format) formats a date with zone in a consistent way, optional moment format\n    - isDST() allows to know if a date in a specified timezone is currently under DST\n    - datetimeWithZone(timezone) returns a new moment object with timezone applied\n    - datetime returns the moment object\n    - unitRepetitionsBetweenDates(duration, date) return the number of repetitions of\n    duration between two dates, eg for duration: \"1.weeks\", \"2.months\"...\n  */\n  class DateWithZoneHelper {\n    static fromDatetime(datetime, timezone, localTimezone) {\n      return new DateWithZoneHelper({\n        year: datetime.year(),\n        month: datetime.month(),\n        day: datetime.date(),\n        hour: datetime.hour(),\n        minute: datetime.minute(),\n        second: datetime.second(),\n        timezone,\n        localTimezone\n      });\n    }\n    constructor(params = {}) {\n      this.timezone = params.timezone || \"UTC\";\n      this.localTimezone = params.localTimezone || moment.tz.guess();\n      this.datetime = moment.tz((0, _object.getProperties)(params, [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"]), this.timezone);\n    }\n    isDST() {\n      return this.datetime.tz(this.localTimezone).isDST();\n    }\n    unitRepetitionsBetweenDates(duration, date) {\n      const [count, unit] = duration.split(\".\");\n      // get the diff in the specified units with decimals\n      const diff = Math.abs(this.datetime.diff(date, unit, true));\n      // get integer count of duration in diff, eg: 4 hours diff is 2 for 2.hours duration\n      const integer = Math.trunc(diff / count);\n      // get fractional to define if we have to add one \"duration\"\n      const fractional = diff / count % 1;\n      return integer * parseInt(count, 10) + (fractional > 0 ? parseInt(count, 10) : 0);\n    }\n    add(count, unit) {\n      return this._fromDatetime(this.datetime.clone().add(count, unit), this.timezone, this.localTimezone);\n    }\n    subtract(count, unit) {\n      return this._fromDatetime(this.datetime.clone().subtract(count, unit), this.timezone, this.localTimezone);\n    }\n    datetimeWithZone(timezone) {\n      return this.datetime.clone().tz(timezone);\n    }\n    format(format) {\n      if (format) {\n        return this.datetime.tz(this.localTimezone).format(format);\n      }\n      return this.datetime.tz(this.localTimezone).toISOString(true);\n    }\n    _fromDatetime(datetime, timezone, localTimezone) {\n      return DateWithZoneHelper.fromDatetime(datetime, timezone, localTimezone);\n    }\n  }\n  _exports.default = DateWithZoneHelper;\n});","define(\"discourse/plugins/discourse-local-dates/lib/discourse-markdown/discourse-local-dates\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setup = setup;\n  moment.tz.link([\"Asia/Kolkata|IST\", \"Asia/Seoul|KST\", \"Asia/Tokyo|JST\"]);\n  const timezoneNames = moment.tz.names();\n  function addLocalDate(attributes, state, buffer, applyDataAttributes) {\n    if (attributes.timezone) {\n      if (!timezoneNames.includes(attributes.timezone)) {\n        delete attributes.timezone;\n      }\n    }\n    if (attributes.displayedTimezone) {\n      if (!timezoneNames.includes(attributes.displayedTimezone)) {\n        delete attributes.displayedTimezone;\n      }\n    }\n    if (attributes.timezones) {\n      attributes.timezones = attributes.timezones.split(\"|\").filter(tz => timezoneNames.includes(tz)).join(\"|\");\n    }\n    const dateTime = moment.tz([attributes._default || attributes.date, attributes.time].filter(Boolean).join(\"T\"), attributes.timezone || \"Etc/UTC\");\n    const emailFormat = state.md.options.discourse.datesEmailFormat || moment.defaultFormat;\n    const emailTimezone = state.md.options.discourse.datesEmailTimezone || \"Etc/UTC\";\n    attributes.emailPreview = `${dateTime.utc().tz(emailTimezone).format(emailFormat)}`;\n    let token = new state.Token(\"span_open\", \"span\", 1);\n    token.attrs = [[\"class\", \"discourse-local-date\"]];\n\n    // applyDataAttributes will handle all data-* attributes including data-ics\n    applyDataAttributes(token, attributes, \"date\");\n    buffer.push(token);\n    token = new state.Token(\"text\", \"\", 0);\n    token.content = dateTime.utc().format(attributes.format);\n    buffer.push(token);\n    token = new state.Token(\"span_close\", \"span\", -1);\n    buffer.push(token);\n  }\n  function date(buffer, matches, state, {\n    parseBBCodeTag,\n    applyDataAttributes\n  }) {\n    const parsed = parseBBCodeTag(matches[0], 0, matches[0].length);\n    if (parsed?.tag === \"date\") {\n      addLocalDate(parsed.attrs, state, buffer, applyDataAttributes);\n    } else {\n      let token = new state.Token(\"text\", \"\", 0);\n      token.content = matches[0];\n      buffer.push(token);\n    }\n  }\n  function range(buffer, matches, state, {\n    parseBBCodeTag,\n    applyDataAttributes\n  }) {\n    let token;\n    const parsed = parseBBCodeTag(matches[0], 0, matches[0].length);\n    if (parsed?.tag === \"date-range\") {\n      if (parsed.attrs.from) {\n        const {\n          from,\n          ...attributes\n        } = {\n          ...parsed.attrs,\n          range: \"from\"\n        };\n        delete attributes.to;\n        [attributes.date, attributes.time] = from.split(\"T\");\n        addLocalDate(attributes, state, buffer, applyDataAttributes);\n      }\n      if (parsed.attrs.from && parsed.attrs.to) {\n        token = new state.Token(\"text\", \"\", 0);\n        token.content = \"→\";\n        buffer.push(token);\n      }\n      if (parsed.attrs.to) {\n        const {\n          to,\n          ...attributes\n        } = {\n          ...parsed.attrs,\n          range: \"to\"\n        };\n        delete attributes.from;\n        [attributes.date, attributes.time] = to.split(\"T\");\n        addLocalDate(attributes, state, buffer, applyDataAttributes);\n      }\n    } else {\n      token = new state.Token(\"text\", \"\", 0);\n      token.content = matches[0];\n      buffer.push(token);\n    }\n  }\n  function setup(helper) {\n    helper.allowList([\"span.discourse-local-date\", \"span[aria-label]\", \"span[data-calendar]\", \"span[data-countdown]\", \"span[data-date]\", \"span[data-displayed-timezone]\", \"span[data-email-preview]\", \"span[data-format]\", \"span[data-ics]\", \"span[data-recurring]\", \"span[data-time]\", \"span[data-timezone]\", \"span[data-timezones]\"]);\n    helper.registerOptions((opts, siteSettings) => {\n      opts.datesEmailFormat = siteSettings.discourse_local_dates_email_format;\n      opts.datesEmailTimezone = siteSettings.discourse_local_dates_email_timezone;\n      opts.features[\"discourse-local-dates\"] = !!siteSettings.discourse_local_dates_enabled;\n    });\n    helper.registerPlugin(md => {\n      md.core.textPostProcess.ruler.push(\"date\", {\n        matcher: /\\[date=.+?\\]/,\n        onMatch: date\n      });\n      md.core.textPostProcess.ruler.push(\"date-range\", {\n        matcher: /\\[date-range .+?\\]/,\n        onMatch: range\n      });\n    });\n  }\n});","define(\"discourse/plugins/discourse-local-dates/lib/local-date-builder\", [\"exports\", \"discourse/lib/array-tools\", \"discourse/lib/icon-library\", \"discourse-i18n\", \"discourse/plugins/discourse-local-dates/lib/date-with-zone-helper\"], function (_exports, _arrayTools, _iconLibrary, _discourseI18n, _dateWithZoneHelper) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const DATETIME_FORMAT = \"LLL\";\n  const DATE_FORMAT = \"LL\";\n  const FULL_DATETIME_FORMAT = \"LLLL\";\n  const TIME_FORMAT = \"h:mm A\";\n  const DAY_OF_THE_WEEK_FORMAT = \"dddd\";\n  const RANGE_SEPARATOR = \"→\";\n  const TIME_ICON = \"clock\";\n  const SHORT_FORMAT_DAYS_PERIOD = 1;\n  class LocalDateBuilder {\n    constructor(params = {}, localTimezone) {\n      this.time = params.time;\n      this.date = params.date;\n      this.recurring = params.recurring;\n      this.sameLocalDayAsFrom = params.sameLocalDayAsFrom;\n      this.timezones = Array.from(new Set((params.timezones || []).filter(Boolean)));\n      this.timezone = params.timezone || \"UTC\";\n      this.calendar = typeof params.calendar === \"undefined\" ? true : params.calendar;\n      this.displayedTimezone = params.displayedTimezone;\n      this.format = params.format || (this.time ? DATETIME_FORMAT : DATE_FORMAT);\n      this.countdown = params.countdown;\n      this.duration = params.duration;\n      this.localTimezone = localTimezone;\n    }\n    build() {\n      const [year, month, day] = this.date.split(\"-\").map(x => parseInt(x, 10));\n      const [hour, minute, second] = (this.time || \"\").split(\":\").map(x => x ? parseInt(x, 10) : undefined);\n      let displayedTimezone;\n      if (this.time) {\n        displayedTimezone = this.displayedTimezone || this.localTimezone;\n      } else {\n        displayedTimezone = this.displayedTimezone || this.timezone || this.localTimezone;\n      }\n      let localDate = new _dateWithZoneHelper.default({\n        year,\n        month: month ? month - 1 : null,\n        day,\n        hour,\n        minute,\n        second,\n        timezone: this.timezone,\n        localTimezone: this.localTimezone\n      });\n      if (this.recurring && moment().isAfter(localDate.datetime)) {\n        const type = this.recurring.split(\".\")[1];\n        const repetitionsForType = localDate.unitRepetitionsBetweenDates(this.recurring, moment.tz(this.localTimezone));\n        localDate = localDate.add(repetitionsForType, type);\n      }\n      const previews = this._generatePreviews(localDate, displayedTimezone);\n      const hasTime = hour !== undefined;\n      return {\n        pastEvent: !this.recurring && moment.tz(this.localTimezone).isAfter(localDate.datetime),\n        formatted: this._applyFormatting(localDate, displayedTimezone, hasTime),\n        previews,\n        textPreview: this._generateTextPreviews(previews)\n      };\n    }\n    _generateTextPreviews(previews) {\n      return previews.map(preview => {\n        const formattedZone = this._zoneWithoutPrefix(preview.timezone);\n        return `${formattedZone} ${preview.formatted}`;\n      }).join(\", \");\n    }\n    _generatePreviews(localDate, displayedTimezone) {\n      const previewedTimezones = [];\n      const timezones = this.timezones.filter(timezone => !this._isEqualZones(timezone, this.localTimezone));\n      previewedTimezones.push({\n        timezone: this._zoneWithoutPrefix(this.localTimezone),\n        current: true,\n        formatted: this._createDateTimeRange(_dateWithZoneHelper.default.fromDatetime(localDate.datetime, localDate.timezone, this.localTimezone), this.time, this.duration)\n      });\n      if (this.timezone && displayedTimezone === this.localTimezone && this.timezone !== displayedTimezone && !this._isEqualZones(displayedTimezone, this.timezone) && !this.timezones.some(t => this._isEqualZones(t, this.timezone))) {\n        timezones.unshift(this.timezone);\n      }\n      timezones.forEach(timezone => {\n        if (this._isEqualZones(timezone, displayedTimezone)) {\n          return;\n        }\n        if (this._isEqualZones(timezone, this.localTimezone)) {\n          timezone = this.localTimezone;\n        }\n        previewedTimezones.push({\n          timezone: this._zoneWithoutPrefix(timezone),\n          formatted: this._createDateTimeRange(_dateWithZoneHelper.default.fromDatetime(localDate.datetime, localDate.timezone, timezone), this.time, this.duration)\n        });\n      });\n      return (0, _arrayTools.uniqueItemsFromArray)(previewedTimezones, \"timezone\");\n    }\n    _isEqualZones(timezoneA, timezoneB) {\n      if ((timezoneA || timezoneB) && (!timezoneA || !timezoneB)) {\n        return false;\n      }\n      if (timezoneA.includes(timezoneB) || timezoneB.includes(timezoneA)) {\n        return true;\n      }\n      return moment.tz(timezoneA).utcOffset() === moment.tz(timezoneB).utcOffset();\n    }\n    _createDateTimeRange(startRange, time, duration) {\n      const [startDate, endDate] = this._calculateDatesForRange(startRange, time, duration);\n      let formatElements = [startDate.format(`${DAY_OF_THE_WEEK_FORMAT}, ${DATE_FORMAT}`), this._optionalTimeIcon(startDate, endDate), startDate.format(TIME_FORMAT)];\n      if (endDate) {\n        formatElements = formatElements.concat([RANGE_SEPARATOR, endDate.format(this._endDateFormat(startDate, endDate))]);\n      }\n      return formatElements.filter(Boolean).join(\" \");\n    }\n    _shortFormat(startDate, endDate) {\n      return endDate.datetime.diff(startDate.datetime, \"days\") < SHORT_FORMAT_DAYS_PERIOD;\n    }\n    _optionalTimeIcon(startDate, endDate) {\n      if (!endDate || this._shortFormat(startDate, endDate)) {\n        return `<br />${(0, _iconLibrary.renderIcon)(\"string\", TIME_ICON)}`;\n      }\n    }\n    _endDateFormat(startDate, endDate) {\n      return this._shortFormat(startDate, endDate) ? TIME_FORMAT : FULL_DATETIME_FORMAT;\n    }\n    _calculateDatesForRange(date, time, duration) {\n      // if a time has been given we do not attempt to automatically create a range\n      // instead we show only one date with a format showing the time\n      if (time && !duration) {\n        return [date];\n      }\n      const dates = [date, duration ? date.add(duration, \"minutes\") : date.add(24, \"hours\")];\n      return duration < 0 ? dates.reverse() : dates;\n    }\n    _applyFormatting(localDate, displayedTimezone, hasTime) {\n      if (this.countdown) {\n        const diffTime = moment.tz(this.localTimezone).diff(localDate.datetime);\n        if (diffTime < 0) {\n          return moment.duration(diffTime).humanize();\n        } else {\n          return (0, _discourseI18n.i18n)(\"discourse_local_dates.relative_dates.countdown.passed\");\n        }\n      }\n      const sameTimezone = this._isEqualZones(displayedTimezone, this.localTimezone);\n      if (this.calendar) {\n        const inCalendarRange = moment.tz(this.localTimezone).isBetween(localDate.subtract(2, \"day\").datetime, localDate.add(1, \"day\").datetime.endOf(\"day\"));\n        if (this.sameLocalDayAsFrom) {\n          return this._timeOnlyFormat(localDate, displayedTimezone);\n        }\n        if (inCalendarRange && sameTimezone) {\n          const date = localDate.datetimeWithZone(this.localTimezone);\n          if (hasTime && date.hours() === 0 && date.minutes() === 0) {\n            return date.format(\"dddd\");\n          }\n          return date.calendar(moment.tz(localDate.timezone), this._calendarFormats(this.time ? this.time : null));\n        }\n      }\n      if (!sameTimezone) {\n        return this._formatWithZone(localDate, displayedTimezone, this.format);\n      }\n      return localDate.format(this.format);\n    }\n    _calendarFormats(time) {\n      return {\n        sameDay: this._translateCalendarKey(time, \"today\"),\n        nextDay: this._translateCalendarKey(time, \"tomorrow\"),\n        lastDay: this._translateCalendarKey(time, \"yesterday\"),\n        sameElse: \"L\"\n      };\n    }\n    _translateCalendarKey(time, key) {\n      const translated = (0, _discourseI18n.i18n)(`discourse_local_dates.relative_dates.${key}`, {\n        time: \"LT\"\n      });\n      if (time) {\n        return translated.split(\"LT\").map(w => `[${w}]`).join(\"LT\");\n      } else {\n        return `[${translated.replace(\" LT\", \"\")}]`;\n      }\n    }\n    _formatTimezone(timezone) {\n      return timezone.replace(\"_\", \" \").replace(\"Etc/\", \"\").split(\"/\");\n    }\n    _zoneWithoutPrefix(timezone) {\n      const [part1, part2] = this._formatTimezone(timezone);\n      return part2 || part1;\n    }\n    _formatWithZone(localDate, displayedTimezone, format) {\n      let formatted = localDate.datetimeWithZone(displayedTimezone).format(format);\n      return `${formatted} (${this._zoneWithoutPrefix(displayedTimezone)})`;\n    }\n    _timeOnlyFormat(localTime, displayedTimezone) {\n      return this._formatWithZone(localTime, displayedTimezone, \"LT\");\n    }\n  }\n  _exports.default = LocalDateBuilder;\n});","define(\"discourse/plugins/discourse-local-dates/lib/local-date-markup-generator\", [\"exports\", \"@ember/utils\"], function (_exports, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = generateDateMarkup;\n  function generateDateMarkup(fromDateTime, options, isRange, toDateTime) {\n    let text = ``;\n    if (isRange) {\n      let from = [fromDateTime.date, fromDateTime.time].filter(element => !(0, _utils.isEmpty)(element)).join(\"T\");\n      let to = [toDateTime.date, toDateTime.time].filter(element => !(0, _utils.isEmpty)(element)).join(\"T\");\n      text += `[date-range from=${from} to=${to}`;\n    } else {\n      text += `[date=${fromDateTime.date}`;\n    }\n    if (fromDateTime.time && !isRange) {\n      text += ` time=${fromDateTime.time}`;\n    }\n    if (fromDateTime.format && fromDateTime.format.length) {\n      text += ` format=\"${fromDateTime.format}\"`;\n    }\n    if (options.timezone) {\n      text += ` timezone=\"${options.timezone}\"`;\n    }\n    if (options.countdown) {\n      text += ` countdown=\"${options.countdown}\"`;\n    }\n    if (options.displayedTimezone) {\n      text += ` displayedTimezone=\"${options.displayedTimezone}\"`;\n    }\n    if (options.timezones && options.timezones.length) {\n      if (Array.isArray(options.timezones)) {\n        text += ` timezones=\"${options.timezones.join(\"|\")}\"`;\n      } else {\n        text += ` timezones=\"${options.timezones}\"`;\n      }\n    }\n    if (options.recurring && !isRange) {\n      text += ` recurring=\"${options.recurring}\"`;\n    }\n    text += `]`;\n    return text;\n  }\n});","define(\"discourse/plugins/discourse-local-dates/lib/rich-editor-extension\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  /** @type {RichEditorExtension} */\n  const extension = {\n    // TODO(renato): the rendered date needs to be localized to better match the cooked content\n    nodeSpec: {\n      local_date: {\n        attrs: {\n          date: {},\n          time: {},\n          timezone: {\n            default: null\n          }\n        },\n        group: \"inline\",\n        inline: true,\n        parseDOM: [{\n          tag: \"span.discourse-local-date[data-date]\",\n          getAttrs: dom => {\n            return {\n              date: dom.getAttribute(\"data-date\"),\n              time: dom.getAttribute(\"data-time\"),\n              timezone: dom.getAttribute(\"data-timezone\")\n            };\n          }\n        }],\n        toDOM: node => {\n          const optionalTime = node.attrs.time ? ` ${node.attrs.time}` : \"\";\n          return [\"span\", {\n            class: \"discourse-local-date cooked-date\",\n            \"data-date\": node.attrs.date,\n            \"data-time\": node.attrs.time,\n            \"data-timezone\": node.attrs.timezone\n          }, `${node.attrs.date}${optionalTime}`];\n        }\n      },\n      local_date_range: {\n        attrs: {\n          fromDate: {},\n          toDate: {\n            default: null\n          },\n          fromTime: {},\n          toTime: {},\n          timezone: {\n            default: null\n          }\n        },\n        group: \"inline\",\n        inline: true,\n        parseDOM: [{\n          tag: \"span.discourse-local-date-range\",\n          getAttrs: dom => {\n            return {\n              fromDate: dom.dataset.fromDate,\n              toDate: dom.dataset.toDate,\n              fromTime: dom.dataset.fromTime,\n              toTime: dom.dataset.toTime,\n              timezone: dom.dataset.timezone\n            };\n          }\n        }],\n        toDOM: node => {\n          const fromTimeStr = node.attrs.fromTime ? ` ${node.attrs.fromTime}` : \"\";\n          const toTimeStr = node.attrs.toTime ? ` ${node.attrs.toTime}` : \"\";\n          return [\"span\", {\n            class: \"discourse-local-date-range\"\n          }, [\"span\", {\n            class: \"discourse-local-date cooked-date\",\n            \"data-range\": \"from\",\n            \"data-date\": node.attrs.fromDate,\n            \"data-time\": node.attrs.fromTime,\n            \"data-timezone\": node.attrs.timezone\n          }, `${node.attrs.fromDate}${fromTimeStr}`], \" → \", [\"span\", {\n            class: \"discourse-local-date cooked-date\",\n            \"data-range\": \"to\",\n            \"data-date\": node.attrs.toDate,\n            \"data-time\": node.attrs.toTime,\n            \"data-timezone\": node.attrs.timezone\n          }, `${node.attrs.toDate}${toTimeStr}`]];\n        }\n      }\n    },\n    parse: {\n      span_open(state, token, tokens, i) {\n        if (token.attrGet(\"class\") !== \"discourse-local-date\") {\n          return;\n        }\n        if (token.attrGet(\"data-range\") === \"from\") {\n          state.openNode(state.schema.nodes.local_date_range, {\n            fromDate: token.attrGet(\"data-date\"),\n            fromTime: token.attrGet(\"data-time\"),\n            timezone: token.attrGet(\"data-timezone\")\n          });\n          state.__localDateRange = true;\n          // we depend on the token data being strictly:\n          // [span_open, text, span_close, text, span_open, text, span_close]\n          // removing the text occurrences\n          tokens.splice(i + 1, 1);\n          tokens.splice(i + 2, 1);\n          tokens.splice(i + 3, 1);\n          return true;\n        }\n        if (token.attrGet(\"data-range\") === \"to\") {\n          // In our markdown-it tokens, a range is a series of span_open/span_close/span_open/span_close\n          // We skip opening a node for `to` and set it on the top node\n          state.top().attrs.toDate = token.attrGet(\"data-date\");\n          state.top().attrs.toTime = token.attrGet(\"data-time\");\n          delete state.__localDateRange;\n          return true;\n        }\n        state.openNode(state.schema.nodes.local_date, {\n          date: token.attrGet(\"data-date\"),\n          time: token.attrGet(\"data-time\"),\n          timezone: token.attrGet(\"data-timezone\")\n        });\n        // removing the text occurrence\n        tokens.splice(i + 1, 1);\n        return true;\n      },\n      span_close(state) {\n        if ([\"local_date\", \"local_date_range\"].includes(state.top().type.name)) {\n          if (!state.__localDateRange) {\n            state.closeNode();\n          }\n          return true;\n        }\n      }\n    },\n    serializeNode({\n      utils: {\n        isBoundary\n      }\n    }) {\n      return {\n        local_date(state, node, parent, index) {\n          state.flushClose();\n          if (!isBoundary(state.out, state.out.length - 1)) {\n            state.write(\" \");\n          }\n          const optionalTime = node.attrs.time ? ` time=${node.attrs.time}` : \"\";\n          const optionalTimezone = node.attrs.timezone ? ` timezone=\"${node.attrs.timezone}\"` : \"\";\n          state.write(`[date=${node.attrs.date}${optionalTime}${optionalTimezone}]`);\n          const nextSibling = parent.childCount > index + 1 ? parent.child(index + 1) : null;\n          if (nextSibling?.isText && !isBoundary(nextSibling.text, 0)) {\n            state.write(\" \");\n          }\n        },\n        local_date_range(state, node, parent, index) {\n          state.flushClose();\n          if (!isBoundary(state.out, state.out.length - 1)) {\n            state.write(\" \");\n          }\n          const optionalTimezone = node.attrs.timezone ? ` timezone=\"${node.attrs.timezone}\"` : \"\";\n          const from = node.attrs.fromDate + (node.attrs.fromTime ? `T${node.attrs.fromTime}` : \"\");\n          const to = node.attrs.toDate + (node.attrs.toTime ? `T${node.attrs.toTime}` : \"\");\n          state.write(`[date-range from=${from} to=${to}${optionalTimezone}]`);\n          const nextSibling = parent.childCount > index + 1 ? parent.child(index + 1) : null;\n          if (nextSibling?.isText && !isBoundary(nextSibling.text, 0)) {\n            state.write(\" \");\n          }\n        }\n      };\n    }\n  };\n  var _default = _exports.default = extension;\n});"],"mappings":"AAAAA,OAAA,uzBAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA;AAEAC,OAAAC,eAAA1B,EAAA,cACA2B,OAAA,IAEA3B,EAAA4B,aAAA;AAGA,MAAAC,UAAA5B,EAAA2B,QACAE,WAAA;AACAC,WAAA;AACAC,eAAA;AACAC,KAAA;AACAC,OAAA;AACAC,KAAA;AACAC,OAAA;AACAC,OAAA;AACAC,QAAA;AACAC,UAAA;AACAC,cAAA;AACAC,SAAA;AACAC,aAAA;AACAC,WAAA;OAEAC,OAAAC,EAAAC,KAAAC,UAAA,iBAAA1C,EAAA2C,UAAA,SACA,CACAC,QAAAL,OAAAM,EAAAJ,KAAA;OAEAF,OAAAC,EAAAC,KAAAC,UAAA,eAAA1C,EAAA2C,UAAA,WACA,CACAG,QAAAP,OAAAM,EAAAJ,KAAA;OAEAF,OAAAC,EAAAC,KAAAC,UAAA,0CAAAjC,EAAAsC,kBAAA,2CACA,CACAC,QAAAT,OAAAM,EAAAJ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