{"version":3,"file":"discourse-local-dates.js","names":["define","_exports","_component","_object","_computed","_runloop","_computed2","_localDates","_text","_environment","_decorators","_discourseI18n","_localDateMarkupGenerator","_templateFactory","Object","defineProperty","value","default","__COLOCATED_TEMPLATE__","createTemplateFactory","id","block","moduleName","isStrictMode","setComponentTemplate","extend","dt7948","p","timeFormat","dateFormat","dateTimeFormat","date","toDate","time","toTime","format","formats","recurring","advancedMode","timezone","fromSelected","fromFilled","notEmpty","toSelected","toFilled","init","this","_super","arguments","_picker","setProperties","timezones","siteSettings","discourse_local_dates_default_formats","split","filter","f","currentUserTimezone","moment","didInsertElement","send","configChanged","_renderPreview","markup","result","cook","set","schedule","applyLocalDates","document","querySelectorAll","isRange","isValid","config","fromConfig","from","dateTime","toConfig","to","diff","options","length","undefined","timeInferred","tz","includes","create","range","endOf","computedConfig","currentUser","user_option","guess","allTimezones","names","timezoneIsDifferentFromUserTimezone","propertyNotEqual","formattedCurrentUserTimezone","replace","previewedFormats","map","preview","recurringOptions","key","name","t","_generateDateMarkup","fromDateTime","toDateTime","toggleModeBtnLabel","text","formattedFrom","formattedTo","emptyText","updateFormat","event","preventDefault","selectedDate","selectedTime","changeSelectedDate","changeSelectedTime","eraseToDateTime","focusFrom","minDate","focusTo","get","toggleAdvancedMode","toggleProperty","save","closeModal","model","insertDate","cancel","observes","debounce","INPUT_DELAY","action","_service","_template","_downloadCalendar","_pluginApi","_toMarkdown","_iconLibrary","_localDatesCreate","_localDateBuilder","dates","discourse_local_dates_enabled","currentUserTZ","forEach","element","index","arr","opts","buildOptionsFromElement","attributes","fromElement","toElement","_getDateFromElement","isSame","_rangeIsSameLocalDay","sameLocalDayAsFrom","localDateBuilder","build","innerText","insertAdjacentHTML","formatted","setAttribute","textPreview","classes","pastEvent","push","classList","add","dataset","_rangeElements","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","container","lookup","defaultTitle","site_name","title","decorateCookedElement","elem","helper","topicTitle","getModel","topic","onToolbarCreate","toolbar","addButton","group","icon","sendAction","context","modifyClass","modal","service","pluginId","actions","insertDiscourseLocalDate","toolbarEvent","show","addText","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","_downloadCalendarNode","outerHTML","showDatePopover","tooltip","target","contains","downloadCalendar","startsAt","endsAt","close","identifier","content","htmlSafe","initialize","window","addEventListener","passive","withPluginApi","teardown","removeEventListener","bind","DateWithZoneHelper","fromDatetime","datetime","localTimezone","year","month","day","hour","minute","second","constructor","params","getProperties","isDST","unitRepetitionsBetweenDates","count","unit","Math","abs","fractional","trunc","parseInt","_fromDatetime","clone","subtract","datetimeWithZone","setup","allowList","registerOptions","datesEmailFormat","discourse_local_dates_email_format","features","registerPlugin","md","core","textPostProcess","ruler","matcher","onMatch","link","timezoneNames","addLocalDate","state","buffer","applyDataAttributes","join","_default","emailFormat","discourse","defaultFormat","emailPreview","utc","token","Token","attrs","matches","_ref","parseBBCodeTag","parsed","tag","_ref2","_dateWithZoneHelper","TIME_FORMAT","Set","x","localDate","isAfter","type","repetitionsForType","_generatePreviews","hasTime","_applyFormatting","_generateTextPreviews","_zoneWithoutPrefix","previewedTimezones","_isEqualZones","_createDateTimeRange","any","unshift","uniqBy","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"],"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"],"sourcesContent":["define(\"discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create\", [\"exports\", \"@ember/component\", \"@ember/object\", \"@ember/object/computed\", \"@ember/runloop\", \"discourse/lib/computed\", \"discourse/lib/local-dates\", \"discourse/lib/text\", \"discourse-common/config/environment\", \"discourse-common/utils/decorators\", \"discourse-i18n\", \"discourse/plugins/discourse-local-dates/lib/local-date-markup-generator\", \"@ember/template-factory\"], function (_exports, _component, _object, _computed, _runloop, _computed2, _localDates, _text, _environment, _decorators, _discourseI18n, _localDateMarkupGenerator, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\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>{{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              {{d-icon \"calendar-alt\"}}\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              {{d-icon \"calendar-alt\"}}\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=\"times\"\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>{{html-safe\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 \"discourse_local_dates.create.form.format_description\"}}\n                <a\n                  target=\"_blank\"\n                  href=\"https://momentjs.com/docs/#/parsing/string-format/\"\n                  rel=\"noopener noreferrer\"\n                >\n                  {{d-icon \"question-circle\"}}\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 \"click\" (fn this.updateFormat previewedFormat.format)}}\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=\"cog\"\n        @label={{this.toggleModeBtnLabel}}\n        class=\"btn-default advanced-mode-btn\"\n      />\n    </:footer>\n  </DModal>\n  */\n  {\n    \"id\": \"BjnsQKXJ\",\n    \"block\": \"[[[8,[39,0],[[24,0,\\\"discourse-local-dates-create-modal -large\\\"]],[[\\\"@title\\\",\\\"@closeModal\\\"],[[28,[37,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,[35,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,[35,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,[35,3],[\\\"calendar-alt\\\"],null]],[1,\\\"\\\\n            \\\"],[8,[39,4],[[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,[35,3],[\\\"calendar-alt\\\"],null]],[1,\\\"\\\\n            \\\"],[8,[39,4],[[24,0,\\\"date-time\\\"]],[[\\\"@action\\\",\\\"@translatedLabel\\\"],[[30,0,[\\\"focusTo\\\"]],[30,0,[\\\"formattedTo\\\"]]]],null],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"toFilled\\\"]],[[[1,\\\"              \\\"],[8,[39,4],[[24,0,\\\"delete-to-date\\\"]],[[\\\"@action\\\",\\\"@icon\\\"],[[30,0,[\\\"eraseToDateTime\\\"]],\\\"times\\\"]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"          \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"site\\\",\\\"desktopView\\\"]],[[[1,\\\"            \\\"],[8,[39,5],null,[[\\\"@options\\\",\\\"@value\\\",\\\"@onChange\\\"],[[28,[37,6],null,[[\\\"icon\\\"],[\\\"globe\\\"]]],[30,0,[\\\"timezone\\\"]],[28,[37,7],[[28,[37,8],[[30,0,[\\\"timezone\\\"]]],null]],null]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"        \\\"],[13],[1,\\\"\\\\n\\\\n        \\\"],[10,0],[14,0,\\\"picker-panel\\\"],[12],[1,\\\"\\\\n          \\\"],[8,[39,9],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,[39,5],null,[[\\\"@value\\\",\\\"@options\\\",\\\"@onChange\\\"],[[30,0,[\\\"timezone\\\"]],[28,[37,6],null,[[\\\"icon\\\"],[\\\"globe\\\"]]],[28,[37,7],[[28,[37,8],[[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,[35,1],[\\\"discourse_local_dates.create.form.recurring_title\\\"],null]],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n              \\\"],[10,2],[12],[1,[28,[35,11],[[28,[37,1],[\\\"discourse_local_dates.create.form.recurring_description\\\"],null]],null]],[13],[1,\\\"\\\\n              \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n                \\\"],[8,[39,12],[[24,0,\\\"recurrence-input\\\"]],[[\\\"@content\\\",\\\"@value\\\",\\\"@onChange\\\",\\\"@options\\\"],[[30,0,[\\\"recurringOptions\\\"]],[30,0,[\\\"recurring\\\"]],[28,[37,7],[[28,[37,8],[[30,0,[\\\"recurring\\\"]]],null]],null],[28,[37,6],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,[35,1],[\\\"discourse_local_dates.create.form.timezones_title\\\"],null]],[13],[1,\\\"\\\\n            \\\"],[10,2],[12],[1,[28,[35,1],[\\\"discourse_local_dates.create.form.timezones_description\\\"],null]],[13],[1,\\\"\\\\n            \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n              \\\"],[8,[39,13],[[24,0,\\\"timezones-input\\\"]],[[\\\"@valueProperty\\\",\\\"@nameProperty\\\",\\\"@content\\\",\\\"@value\\\",\\\"@options\\\"],[null,null,[30,0,[\\\"allTimezones\\\"]],[30,0,[\\\"timezones\\\"]],[28,[37,6],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,[35,1],[\\\"discourse_local_dates.create.form.format_title\\\"],null]],[13],[1,\\\"\\\\n            \\\"],[10,2],[12],[1,\\\"\\\\n              \\\"],[1,[28,[35,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,[35,3],[\\\"question-circle\\\"],null]],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n            \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n              \\\"],[8,[39,14],[[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,[37,16],[[28,[37,16],[[30,0,[\\\"previewedFormats\\\"]]],null]],null],null,[[[1,\\\"                \\\"],[10,\\\"li\\\"],[14,0,\\\"format\\\"],[12],[1,\\\"\\\\n                  \\\"],[11,3],[24,0,\\\"moment-format\\\"],[24,6,\\\"\\\"],[4,[38,17],[\\\"click\\\",[28,[37,7],[[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,[39,4],[[24,0,\\\"btn-primary\\\"]],[[\\\"@action\\\",\\\"@label\\\"],[[30,0,[\\\"save\\\"]],\\\"discourse_local_dates.create.form.insert\\\"]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"\\\\n    \\\"],[8,[39,4],[[24,0,\\\"btn-flat\\\"]],[[\\\"@action\\\",\\\"@translatedLabel\\\"],[[30,0,[\\\"cancel\\\"]],[28,[37,1],[\\\"cancel\\\"],null]]],null],[1,\\\"\\\\n\\\\n    \\\"],[8,[39,4],[[24,0,\\\"btn-default advanced-mode-btn\\\"]],[[\\\"@action\\\",\\\"@icon\\\",\\\"@label\\\"],[[30,0,[\\\"toggleAdvancedMode\\\"]],\\\"cog\\\",[30,0,[\\\"toggleModeBtnLabel\\\"]]]],null],[1,\\\"\\\\n  \\\"]],[]]]]]],[\\\"@closeModal\\\",\\\"previewedFormat\\\"],false,[\\\"d-modal\\\",\\\"i18n\\\",\\\"if\\\",\\\"d-icon\\\",\\\"d-button\\\",\\\"timezone-input\\\",\\\"hash\\\",\\\"fn\\\",\\\"mut\\\",\\\"calendar-date-time-input\\\",\\\"unless\\\",\\\"html-safe\\\",\\\"combo-box\\\",\\\"multi-select\\\",\\\"text-field\\\",\\\"each\\\",\\\"-track-array\\\",\\\"on\\\"]]\",\n    \"moduleName\": \"discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create.hbs\",\n    \"isStrictMode\": false\n  });\n  var _default = _exports.default = (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, _component.default.extend(dt7948.p({\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    fromFilled: (0, _computed.notEmpty)(\"date\"),\n    toSelected: null,\n    toFilled: (0, _computed.notEmpty)(\"toDate\"),\n    init() {\n      this._super(...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      this._super(...arguments);\n      this.send(\"focusFrom\");\n    },\n    configChanged() {\n      this._renderPreview();\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    isRange(date, toDate, toTime) {\n      return 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    fromConfig(date, time, isRange) {\n      let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\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    toConfig(date, time, isRange) {\n      let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\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    options(recurring, timezones, timezone, format) {\n      return _object.default.create({\n        recurring,\n        timezones,\n        timezone,\n        format\n      });\n    },\n    computedConfig(fromConfig, toConfig, options) {\n      return _object.default.create({\n        from: fromConfig,\n        to: toConfig,\n        options\n      });\n    },\n    currentUserTimezone() {\n      return this.currentUser.user_option.timezone || moment.tz.guess();\n    },\n    allTimezones() {\n      return moment.tz.names();\n    },\n    timezoneIsDifferentFromUserTimezone: (0, _computed2.propertyNotEqual)(\"currentUserTimezone\", \"options.timezone\"),\n    formattedCurrentUserTimezone(timezone) {\n      return timezone.replace(\"_\", \" \").replace(\"Etc/\", \"\").replace(\"/\", \", \");\n    },\n    previewedFormats(formats) {\n      return formats.map(format => {\n        return {\n          format,\n          preview: moment().format(format)\n        };\n      });\n    },\n    recurringOptions() {\n      const key = \"discourse_local_dates.create.form.recurring\";\n      return [{\n        name: _discourseI18n.default.t(`${key}.every_day`),\n        id: \"1.days\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_week`),\n        id: \"1.weeks\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_two_weeks`),\n        id: \"2.weeks\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_month`),\n        id: \"1.months\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_two_months`),\n        id: \"2.months\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_three_months`),\n        id: \"3.months\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_six_months`),\n        id: \"6.months\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_year`),\n        id: \"1.years\"\n      }];\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    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    formattedFrom(dateTime) {\n      return dateTime.format(\"LLLL\");\n    },\n    formattedTo(dateTime, toSelected) {\n      const emptyText = toSelected ? \"&nbsp;\" : _discourseI18n.default.t(\"discourse_local_dates.create.form.until\");\n      return dateTime.isValid() ? dateTime.format(\"LLLL\") : emptyText;\n    },\n    updateFormat(format, event) {\n      event?.preventDefault();\n      this.set(\"format\", format);\n    },\n    selectedDate(fromSelected) {\n      return fromSelected ? this.date : this.toDate;\n    },\n    selectedTime(fromSelected) {\n      return fromSelected ? this.time : this.toTime;\n    },\n    changeSelectedDate(date) {\n      if (this.fromSelected) {\n        this.set(\"date\", date);\n      } else {\n        this.set(\"toDate\", date);\n      }\n    },\n    changeSelectedTime(time) {\n      if (this.fromSelected) {\n        this.set(\"time\", time);\n      } else {\n        this.set(\"toTime\", time);\n      }\n    },\n    eraseToDateTime() {\n      this.setProperties({\n        toDate: null,\n        toTime: null\n      });\n      this.focusFrom();\n    },\n    focusFrom() {\n      this.setProperties({\n        fromSelected: true,\n        toSelected: false,\n        minDate: null\n      });\n    },\n    focusTo() {\n      this.setProperties({\n        toSelected: true,\n        fromSelected: false,\n        minDate: this.get(\"fromConfig.date\")\n      });\n    },\n    toggleAdvancedMode() {\n      this.toggleProperty(\"advancedMode\");\n    },\n    save() {\n      const markup = this.markup;\n      if (markup) {\n        this.closeModal();\n        this.model.insertDate(markup);\n      }\n    },\n    cancel() {\n      this.closeModal();\n    }\n  }, [[\"method\", \"configChanged\", [(0, _decorators.observes)(\"computedConfig.{from,to,options}\", \"options\", \"isValid\", \"isRange\")]], [\"method\", \"_renderPreview\", [(0, _decorators.debounce)(_environment.INPUT_DELAY)]], [\"method\", \"isRange\", [(0, _decorators.default)(\"date\", \"toDate\", \"toTime\")]], [\"method\", \"isValid\", [(0, _decorators.default)(\"computedConfig\", \"isRange\")]], [\"method\", \"fromConfig\", [(0, _decorators.default)(\"date\", \"time\", \"isRange\", \"options.{format,timezone}\")]], [\"method\", \"toConfig\", [(0, _decorators.default)(\"toDate\", \"toTime\", \"isRange\", \"options.{timezone,format}\")]], [\"method\", \"options\", [(0, _decorators.default)(\"recurring\", \"timezones\", \"timezone\", \"format\")]], [\"method\", \"computedConfig\", [(0, _decorators.default)(\"fromConfig.{date}\", \"toConfig.{date}\", \"options.{recurring,timezones,timezone,format}\")]], [\"method\", \"currentUserTimezone\", [_decorators.default]], [\"method\", \"allTimezones\", [_decorators.default]], [\"method\", \"formattedCurrentUserTimezone\", [(0, _decorators.default)(\"currentUserTimezone\")]], [\"method\", \"previewedFormats\", [(0, _decorators.default)(\"formats\")]], [\"method\", \"recurringOptions\", [_decorators.default]], [\"method\", \"toggleModeBtnLabel\", [(0, _decorators.default)(\"advancedMode\")]], [\"method\", \"markup\", [(0, _decorators.default)(\"computedConfig.{from,to,options}\", \"options\", \"isValid\", \"isRange\")]], [\"method\", \"formattedFrom\", [(0, _decorators.default)(\"fromConfig.dateTime\")]], [\"method\", \"formattedTo\", [(0, _decorators.default)(\"toConfig.dateTime\", \"toSelected\")]], [\"method\", \"updateFormat\", [_object.action]], [\"method\", \"selectedDate\", [(0, _decorators.default)(\"fromSelected\", \"toSelected\")]], [\"method\", \"selectedTime\", [(0, _decorators.default)(\"fromSelected\", \"toSelected\")]], [\"method\", \"changeSelectedDate\", [_object.action]], [\"method\", \"changeSelectedTime\", [_object.action]], [\"method\", \"eraseToDateTime\", [_object.action]], [\"method\", \"focusFrom\", [_object.action]], [\"method\", \"focusTo\", [_object.action]], [\"method\", \"toggleAdvancedMode\", [_object.action]], [\"method\", \"save\", [_object.action]], [\"method\", \"cancel\", [_object.action]]])));\n});","define(\"discourse/plugins/discourse-local-dates/initializers/discourse-local-dates\", [\"exports\", \"@ember/service\", \"@ember/template\", \"discourse/lib/download-calendar\", \"discourse/lib/plugin-api\", \"discourse/lib/to-markdown\", \"discourse-common/lib/icon-library\", \"discourse-common/utils/decorators\", \"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\"], function (_exports, _service, _template, _downloadCalendar, _pluginApi, _toMarkdown, _iconLibrary, _decorators, _discourseI18n, _localDateMarkupGenerator, _localDatesCreate, _localDateBuilder) {\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) {\n    if (!siteSettings.discourse_local_dates_enabled) {\n      return;\n    }\n    const currentUserTZ = 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\", `<svg class=\"fa d-icon d-icon-globe-americas svg-icon\" xmlns=\"http://www.w3.org/2000/svg\">\n          <use href=\"#globe-americas\"></use>\n        </svg>\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    const siteSettings = api.container.lookup(\"service:site-settings\");\n    const defaultTitle = _discourseI18n.default.t(\"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.onToolbarCreate(toolbar => {\n      toolbar.addButton({\n        title: \"discourse_local_dates.title\",\n        id: \"local-dates\",\n        group: \"extras\",\n        icon: \"calendar-alt\",\n        sendAction: event => toolbar.context.send(\"insertDiscourseLocalDate\", event)\n      });\n    });\n    api.modifyClass(\"component:d-editor\", {\n      modal: (0, _service.service)(),\n      pluginId: \"discourse-local-dates\",\n      actions: {\n        insertDiscourseLocalDate(toolbarEvent) {\n          this.modal.show(_localDatesCreate.default, {\n            model: {\n              insertDate: markup => {\n                toolbarEvent.addText(markup);\n              }\n            }\n          });\n        }\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\")} ${_discourseI18n.default.t(\"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    node.setAttribute(\"data-title\", startDataset.title);\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  var _default = _exports.default = dt7948.p({\n    name: \"discourse-local-dates\",\n    showDatePopover(event) {\n      const tooltip = this.container.lookup(\"service:tooltip\");\n      if (event?.target?.classList?.contains(\"download-calendar\")) {\n        const dataset = event.target.dataset;\n        (0, _downloadCalendar.downloadCalendar)(dataset.title, [{\n          startsAt: dataset.startsAt,\n          endsAt: dataset.endsAt\n        }]);\n        return tooltip.close(\"local-date\");\n      }\n      if (!event?.target?.classList?.contains(\"discourse-local-date\")) {\n        return;\n      }\n      const siteSettings = this.container.lookup(\"service:site-settings\");\n      return tooltip.show(event.target, {\n        identifier: \"local-date\",\n        content: (0, _template.htmlSafe)(buildHtmlPreview(event.target, siteSettings))\n      });\n    },\n    initialize(container) {\n      this.container = container;\n      window.addEventListener(\"click\", this.showDatePopover, {\n        passive: true\n      });\n      const siteSettings = container.lookup(\"service:site-settings\");\n      if (siteSettings.discourse_local_dates_enabled) {\n        (0, _pluginApi.withPluginApi)(\"0.8.8\", initializeDiscourseLocalDates);\n      }\n    },\n    teardown() {\n      window.removeEventListener(\"click\", this.showDatePopover);\n    }\n  }, [[\"method\", \"showDatePopover\", [_decorators.bind]]]);\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() {\n      let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\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    attributes.emailPreview = `${dateTime.utc().format(emailFormat)} UTC`;\n    let token = new state.Token(\"span_open\", \"span\", 1);\n    token.attrs = [[\"class\", \"discourse-local-date\"]];\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, _ref) {\n    let {\n      parseBBCodeTag,\n      applyDataAttributes\n    } = _ref;\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, _ref2) {\n    let {\n      parseBBCodeTag,\n      applyDataAttributes\n    } = _ref2;\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-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.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-common/lib/icon-library\", \"discourse-i18n\", \"discourse/plugins/discourse-local-dates/lib/date-with-zone-helper\"], function (_exports, _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() {\n      let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      let localTimezone = arguments.length > 1 ? arguments[1] : undefined;\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.any(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 previewedTimezones.uniqBy(\"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 _discourseI18n.default.t(\"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 = _discourseI18n.default.t(`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});"],"mappings":"AAAAA,OAAA,ocAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA;AAEAC,OAAAC,eAAAd,EAAA,cACAe,OAAA,IAEAf,EAAAgB,aAAA;AACA,MAAAC,GAAA,EAAAL,EAAAM,uBA2MA,CACAC,GAAA,WACAC,MAAA,23NACAC,WAAA,4FACAC,cAAA;AAEAtB,EAAAgB,SAAA,EAAAf,EAAAsB,sBAAAN,EAAAhB,EAAAe,QAAAQ,OAAAC,OAAAC,EAAA,CACAC,WAAA,WACAC,WAAA,aACAC,eAAA,sBACAC,KAAA,KACAC,OAAA,KACAC,KAAA,KACAC,OAAA,KACAC,OAAA,KACAC,QAAA,KACAC,UAAA,KACAC,cAAA,EACAC,SAAA,KACAC,aAAA,KACAC,YAAA,EAAArC,EAAAsC,UAAA,QACAC,WAAA,KACAC,UAAA,EAAAxC,EAAAsC,UAAA,UACA,IAAAG,GACAC,KAAAC,UAAAC,WACAF,KAAAG,QAAA,KACAH,KAAAI,cAAA,CACAC,UAAA,GACAf,SAAAU,KAAAM,aAAAC,uCAAA,IAAAC,MAAA,KAAAC,QAAAC,OACAjB,SAAAO,KAAAW,oBACA1B,KAAA2B,SAAAvB,OAAAW,KAAAjB,aAEA,EACA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