\\n \");\n if (isRequired) {\n template.querySelector(\".required-symbol\").style.display = null;\n }\n if (radiosOptionsJSON !== undefined && radiosOptionsJSON.Value.length > 0) {\n var radioOptions = JSON.parse(radiosOptionsJSON.Value);\n var radioNameAttributeValue = \"radio-\".concat(thisFieldAccumulatorId);\n var _iterator3 = _createForOfIteratorHelper(radioOptions),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var radioOption = _step3.value;\n var thisRadioAccumulatorId = FieldBuilder.InternalAccumulator++;\n var thisRadioId = \"radio-\".concat(thisRadioAccumulatorId, \"-input\");\n var radioInputContainer = document.createElement(\"div\");\n var radio = document.createElement(\"input\");\n var radioLabel = document.createElement(\"label\");\n radioInputContainer.classList.add(\"radio-input-container\");\n radio.setAttribute(\"type\", \"radio\");\n radio.setAttribute(\"name\", radioNameAttributeValue);\n radio.id = thisRadioId;\n radioLabel.textContent = radioOption.Text;\n radioLabel.setAttribute(\"for\", thisRadioId);\n if (radioOption.IsSelected) {\n radio.checked = true;\n }\n radioInputContainer.append(radio);\n radioInputContainer.append(radioLabel);\n template.querySelector(\".radios-container\").append(radioInputContainer);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n return template;\n }\n }]);\n return FieldBuilder;\n}();\n/**\n * An accumulator to give all fields unique Ids to use with labels or other id-reference-needing elements.\n */\n_defineProperty(FieldBuilder, \"InternalAccumulator\", 1);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nexport var RenderedFormComponent = /*#__PURE__*/function () {\n function RenderedFormComponent() {\n _classCallCheck(this, RenderedFormComponent);\n _defineProperty(this, \"DOM\", void 0);\n }\n _createClass(RenderedFormComponent, [{\n key: \"Build\",\n value: function Build() {\n throw \"Not implemented.\";\n }\n }, {\n key: \"Render\",\n value: function Render() {\n throw \"Not implemented.\";\n }\n }, {\n key: \"GetFormComponentDto\",\n value: function GetFormComponentDto() {\n throw \"Not implemented.\";\n }\n }, {\n key: \"GetDOM\",\n value: function GetDOM() {\n return this.DOM;\n }\n /**\n * Gets the component and its fields as an object payload\n */\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n throw \"Not implemented.\";\n }\n }]);\n return RenderedFormComponent;\n}();", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FormFieldInternalId } from \"../../../../../Enums/Client/Dashboard/Form/FormFieldInternald.js\";\nimport { FormFieldOptionType } from \"../../../../../Enums/Client/Dashboard/Form/FormFieldOptionType.js\";\nimport { CountriesUtility } from \"../../../../Resources/Address/CountriesUtility.js\";\nimport { UnitedStatesUtility } from \"../../../../Resources/Address/UnitedStatesUtility.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var AddressComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(AddressComponent, _RenderedFormComponen);\n var _super = _createSuper(AddressComponent);\n function AddressComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, AddressComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Street1Field\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Street2Field\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"CityField\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"USStateField\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"ProvinceField\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"PostalField\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"CountryField\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(AddressComponent, [{\n key: \"Build\",\n value: function Build() {\n var _this2 = this;\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \\n \\n \\n \";\n var street1Row = template.querySelector(\".street-1-row\");\n var street2Row = template.querySelector(\".street-2-row\");\n var localityRow = template.querySelector(\".locality-row\");\n var countryRow = template.querySelector(\".country-row\");\n var street1FieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerStreet1Field;\n });\n var street2FieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerStreet2Field;\n });\n var cityFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerCityField;\n });\n var regionFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerRegionField;\n });\n var postalFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerPostalCodeField;\n });\n var countryFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerCountryField;\n });\n this.Street1Field = FieldBuilder.BuildTextualInputField(street1FieldDto, \"text\");\n this.Street2Field = FieldBuilder.BuildTextualInputField(street2FieldDto, \"text\");\n this.CityField = FieldBuilder.BuildTextualInputField(cityFieldDto, \"text\");\n street1Row.append(this.Street1Field);\n street2Row.append(this.Street2Field);\n localityRow.append(this.CityField);\n // The region (state/province) field is special. It doesn't automatically build the selectable US states when the country === \"US\"\n // We build them here in the component because they're not actually saved in the database (the states)\n // like custom dropdowns have their fields saved.\n // Build a text input and a dropdown for the state/province (region)\n var provinceTextInput = FieldBuilder.BuildTextualInputField(regionFieldDto, \"text\");\n this.ProvinceField = provinceTextInput;\n provinceTextInput.classList.add(\"province-input-container\");\n var usStateDropdown = FieldBuilder.BuildDropdownField(regionFieldDto);\n this.USStateField = usStateDropdown;\n usStateDropdown.classList.add(\"us-state-input-container\");\n var selectedRegionOption = regionFieldDto.Options.find(function (option) {\n return option.Option === FormFieldOptionType.DefaultValue;\n });\n var selectedRegion;\n if (selectedRegionOption !== undefined) {\n selectedRegion = selectedRegionOption.Value;\n }\n // Similarly, we must populate the available countries here in this section as well\n var countryDropdown = FieldBuilder.BuildDropdownField(countryFieldDto);\n this.CountryField = countryDropdown;\n var countrySelectMenu = countryDropdown.querySelector(\"select\");\n var selectedCountryOption = countryFieldDto.Options.find(function (option) {\n return option.Option === FormFieldOptionType.DefaultValue;\n });\n var selectedCountry;\n if (selectedCountryOption !== undefined) {\n selectedCountry = selectedCountryOption.Value;\n }\n // Render countries into the country dropdown\n var _iterator = _createForOfIteratorHelper(CountriesUtility.ListOfSupportedCountries),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var countryData = _step.value;\n var optionElement = document.createElement(\"option\");\n optionElement.value = countryData.TwoLetterCode;\n optionElement.textContent = countryData.TwoLetterCode;\n if (selectedCountry !== undefined && countryData.TwoLetterCode === selectedCountry) {\n optionElement.selected = true;\n }\n countrySelectMenu.append(optionElement);\n }\n // Render all US states into the US state dropdown\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n var _iterator2 = _createForOfIteratorHelper(UnitedStatesUtility.ListOfStates),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var usStateData = _step2.value;\n var _optionElement = document.createElement(\"option\");\n _optionElement.value = usStateData.Abbreviation;\n _optionElement.textContent = usStateData.FullName;\n if (selectedRegion !== undefined && usStateData.FullName === selectedRegion) {\n _optionElement.selected = true;\n }\n usStateDropdown.querySelector(\"select\").append(_optionElement);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n localityRow.append(provinceTextInput);\n localityRow.append(usStateDropdown);\n // Add the postal code input\n this.PostalField = FieldBuilder.BuildTextualInputField(postalFieldDto, \"text\");\n localityRow.append(this.PostalField);\n // Add the country dropdown\n countryRow.append(countryDropdown);\n // Connect event for when the country select is changed\n countrySelectMenu.addEventListener(\"change\", function () {\n _this2.OnCountryChange();\n });\n this.DOM = template;\n // Run the country change event to begin the hiding/showing of the correct region input\n this.OnCountryChange();\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var street1FieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerStreet1Field;\n });\n var street2FieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerStreet2Field;\n });\n var cityFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerCityField;\n });\n var regionFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerRegionField;\n });\n var postalFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerPostalCodeField;\n });\n var countryFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerCountryField;\n });\n fields.push({\n FieldId: street1FieldDto.FieldId,\n Value: this.Street1Field.querySelector(\"input\").value\n });\n fields.push({\n FieldId: street2FieldDto.FieldId,\n Value: this.Street2Field.querySelector(\"input\").value\n });\n fields.push({\n FieldId: cityFieldDto.FieldId,\n Value: this.CityField.querySelector(\"input\").value\n });\n // Determine if the region field will be the US state or the province text input\n var countrySelectMenu = this.CountryField.querySelector(\"select\");\n if (countrySelectMenu.value === \"US\") {\n fields.push({\n FieldId: regionFieldDto.FieldId,\n Value: this.USStateField.querySelector(\"select\").value\n });\n } else {\n fields.push({\n FieldId: regionFieldDto.FieldId,\n Value: this.ProvinceField.querySelector(\"input\").value\n });\n }\n fields.push({\n FieldId: postalFieldDto.FieldId,\n Value: this.PostalField.querySelector(\"input\").value\n });\n fields.push({\n FieldId: countryFieldDto.FieldId,\n Value: this.CountryField.querySelector(\"select\").value\n });\n return {\n ComponentType: FormComponentType.Address,\n Fields: fields\n };\n }\n /**\n * When the country dropdown is changed. Show/hides the correct region or US-state dropdown\n * input. Additionally, changes which one is required if that field has been defined as required.\n */\n }, {\n key: \"OnCountryChange\",\n value: function OnCountryChange() {\n var countryDropdown = this.CountryField.querySelector(\"select\");\n var selectedCountry = countryDropdown.value;\n var regionFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerRegionField;\n });\n var isRequiredOption = regionFieldDto.Options.find(function (option) {\n return option.Option === FormFieldOptionType.Required;\n });\n var isRequired = isRequiredOption !== undefined ? FieldBuilder.ParseBooleanString(isRequiredOption.Value) : false;\n if (selectedCountry !== undefined) {\n if (selectedCountry === \"US\") {\n // Hide province input and show the state input\n this.ProvinceField.style.display = \"none\";\n this.USStateField.style.display = null;\n } else {\n this.ProvinceField.style.display = null;\n this.USStateField.style.display = \"none\";\n }\n }\n this.UpdateRegionInputRequiredAttribute();\n }\n /**\n * If the region field is set to be required, then this method will update which HTML input (or select, for US states)\n * actually has the required attribute on it. This is needed because when the US country is selected, the region/province\n * textual input is hidden but should not be required. And vice-versa for any country other than the US being selected.\n * @returns\n */\n }, {\n key: \"UpdateRegionInputRequiredAttribute\",\n value: function UpdateRegionInputRequiredAttribute() {\n var countryDropdown = this.CountryField.querySelector(\"select\");\n var selectedCountry = countryDropdown.value;\n var regionFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerRegionField;\n });\n var isRequiredOption = regionFieldDto.Options.find(function (option) {\n return option.Option === FormFieldOptionType.Required;\n });\n var isRequired = isRequiredOption !== undefined ? FieldBuilder.ParseBooleanString(isRequiredOption.Value) : false;\n if (selectedCountry !== undefined) {\n if (selectedCountry === \"US\") {\n if (isRequired) {\n this.USStateField.querySelector(\"select\").setAttribute(\"required\", \"\");\n this.ProvinceField.querySelector(\"input\").removeAttribute(\"required\");\n }\n } else {\n if (isRequired) {\n this.USStateField.querySelector(\"select\").removeAttribute(\"required\");\n this.ProvinceField.querySelector(\"input\").setAttribute(\"required\", \"\");\n }\n }\n }\n return this;\n }\n }]);\n return AddressComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var CheckboxesComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(CheckboxesComponent, _RenderedFormComponen);\n var _super = _createSuper(CheckboxesComponent);\n function CheckboxesComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, CheckboxesComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"CheckboxFieldContainer\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(CheckboxesComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var formRow = template.querySelector(\".form-row\");\n var fieldDto = this.ComponentDto.Fields[0];\n this.CheckboxFieldContainer = FieldBuilder.BuildCheckboxesField(fieldDto);\n formRow.append(this.CheckboxFieldContainer);\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetFormComponentDto\",\n value: function GetFormComponentDto() {\n return this.ComponentDto;\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var selectedValues = [];\n // Add the checked checkbox values to the selectedValues array\n for (var _i = 0, _Array$from = Array.from(this.CheckboxFieldContainer.querySelectorAll(\".checkbox-input-container\")); _i < _Array$from.length; _i++) {\n var checkboxInputContainer = _Array$from[_i];\n var input = checkboxInputContainer.querySelector(\"input\");\n if (input.checked) {\n selectedValues.push(checkboxInputContainer.querySelector(\"label\").textContent);\n }\n }\n fields.push({\n FieldId: this.ComponentDto.Fields[0].FieldId,\n Value: JSON.stringify(selectedValues)\n });\n return {\n ComponentType: FormComponentType.CustomCheckbox,\n Fields: fields\n };\n }\n }]);\n return CheckboxesComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var DropdownComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(DropdownComponent, _RenderedFormComponen);\n var _super = _createSuper(DropdownComponent);\n function DropdownComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, DropdownComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"DropdownField\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(DropdownComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var formRow = template.querySelector(\".form-row\");\n var fieldDto = this.ComponentDto.Fields[0];\n this.DropdownField = FieldBuilder.BuildDropdownField(fieldDto);\n formRow.append(this.DropdownField);\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var fieldDto = this.ComponentDto.Fields[0];\n fields.push({\n FieldId: fieldDto.FieldId,\n Value: this.DropdownField.querySelector(\"select\").value\n });\n return {\n ComponentType: FormComponentType.CustomDropdown,\n Fields: fields\n };\n }\n }]);\n return DropdownComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FormFieldInternalId } from \"../../../../../Enums/Client/Dashboard/Form/FormFieldInternald.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var EmailComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(EmailComponent, _RenderedFormComponen);\n var _super = _createSuper(EmailComponent);\n function EmailComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, EmailComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"EmailField\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(EmailComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var formRow = template.querySelector(\".form-row\");\n var emailFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerEmailField;\n });\n this.EmailField = FieldBuilder.BuildTextualInputField(emailFieldDto, \"email\");\n formRow.append(this.EmailField);\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var emailFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerEmailField;\n });\n fields.push({\n FieldId: emailFieldDto.FieldId,\n Value: this.EmailField.querySelector(\"input\").value\n });\n return {\n ComponentType: FormComponentType.Email,\n Fields: fields\n };\n }\n }]);\n return EmailComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var InputComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(InputComponent, _RenderedFormComponen);\n var _super = _createSuper(InputComponent);\n function InputComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, InputComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"InputField\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(InputComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var formRow = template.querySelector(\".form-row\");\n var textFieldDto = this.ComponentDto.Fields[0];\n this.InputField = FieldBuilder.BuildTextualInputField(textFieldDto, \"text\");\n formRow.append(this.InputField);\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var fieldDto = this.ComponentDto.Fields[0];\n fields.push({\n FieldId: fieldDto.FieldId,\n Value: this.InputField.querySelector(\"input\").value\n });\n return {\n ComponentType: FormComponentType.CustomText,\n Fields: fields\n };\n }\n }]);\n return InputComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FormFieldInternalId } from \"../../../../../Enums/Client/Dashboard/Form/FormFieldInternald.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var NameComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(NameComponent, _RenderedFormComponen);\n var _super = _createSuper(NameComponent);\n function NameComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, NameComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"FirstNameField\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"LastNameField\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(NameComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var formRow = template.querySelector(\".form-row\");\n var firstNameFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerFirstNameField;\n });\n var lastNameFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerLastNameField;\n });\n var firstNameField = FieldBuilder.BuildTextualInputField(firstNameFieldDto, \"text\");\n var lastNameField = FieldBuilder.BuildTextualInputField(lastNameFieldDto, \"text\");\n this.FirstNameField = firstNameField;\n this.LastNameField = lastNameField;\n formRow.append(firstNameField);\n formRow.append(lastNameField);\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var firstNameFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerFirstNameField;\n });\n var lastNameFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerLastNameField;\n });\n fields.push({\n FieldId: firstNameFieldDto.FieldId,\n Value: this.FirstNameField.querySelector(\"input\").value\n });\n fields.push({\n FieldId: lastNameFieldDto.FieldId,\n Value: this.LastNameField.querySelector(\"input\").value\n });\n return {\n ComponentType: FormComponentType.Name,\n Fields: fields\n };\n }\n }]);\n return NameComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FormFieldInternalId } from \"../../../../../Enums/Client/Dashboard/Form/FormFieldInternald.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var PhoneNumberComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(PhoneNumberComponent, _RenderedFormComponen);\n var _super = _createSuper(PhoneNumberComponent);\n function PhoneNumberComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, PhoneNumberComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"PhoneNumberField\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(PhoneNumberComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var formRow = template.querySelector(\".form-row\");\n var phoneNumberFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerPhoneField;\n });\n this.PhoneNumberField = FieldBuilder.BuildTextualInputField(phoneNumberFieldDto, \"tel\");\n formRow.append(this.PhoneNumberField);\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var phoneNumberFieldDto = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.CustomerPhoneField;\n });\n fields.push({\n FieldId: phoneNumberFieldDto.FieldId,\n Value: this.PhoneNumberField.querySelector(\"input\").value\n });\n return {\n ComponentType: FormComponentType.PhoneNumber,\n Fields: fields\n };\n }\n }]);\n return PhoneNumberComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var RadiosComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(RadiosComponent, _RenderedFormComponen);\n var _super = _createSuper(RadiosComponent);\n function RadiosComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, RadiosComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"RadiosFieldContainer\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(RadiosComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var formRow = template.querySelector(\".form-row\");\n var fieldDto = this.ComponentDto.Fields[0];\n this.RadiosFieldContainer = FieldBuilder.BuildRadiosField(fieldDto);\n formRow.append(this.RadiosFieldContainer);\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetFormComponentDto\",\n value: function GetFormComponentDto() {\n return this.ComponentDto;\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var selectedValue = \"\";\n // Get the selected radio's label text content\n for (var _i = 0, _Array$from = Array.from(this.RadiosFieldContainer.querySelectorAll(\".radio-input-container\")); _i < _Array$from.length; _i++) {\n var checkboxInputContainer = _Array$from[_i];\n var input = checkboxInputContainer.querySelector(\"input\");\n if (input.checked) {\n selectedValue = checkboxInputContainer.querySelector(\"label\").textContent;\n // Since it's radios, only one can be selected per field anyway. Break here\n break;\n }\n }\n fields.push({\n FieldId: this.ComponentDto.Fields[0].FieldId,\n Value: selectedValue\n });\n return {\n ComponentType: FormComponentType.CustomRadio,\n Fields: fields\n };\n }\n }]);\n return RadiosComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var SectionBreakComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(SectionBreakComponent, _RenderedFormComponen);\n var _super = _createSuper(SectionBreakComponent);\n function SectionBreakComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, SectionBreakComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(SectionBreakComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }]);\n return SectionBreakComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormFieldOptionType } from \"../../../../../Enums/Client/Dashboard/Form/FormFieldOptionType.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var TextBlockComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(TextBlockComponent, _RenderedFormComponen);\n var _super = _createSuper(TextBlockComponent);\n function TextBlockComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, TextBlockComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(TextBlockComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var textBlockField = this.ComponentDto.Fields[0];\n var defaultValue = textBlockField.Options.find(function (option) {\n return option.Option === FormFieldOptionType.DefaultValue;\n }).Value;\n template.querySelector(\".text-block\").textContent = defaultValue;\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }]);\n return TextBlockComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FieldBuilder } from \"../../FieldBuilder.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nexport var TextareaComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(TextareaComponent, _RenderedFormComponen);\n var _super = _createSuper(TextareaComponent);\n function TextareaComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, TextareaComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"InputField\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(TextareaComponent, [{\n key: \"Build\",\n value: function Build() {\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n \\n \";\n var formRow = template.querySelector(\".form-row\");\n var largeTextFieldDto = this.ComponentDto.Fields[0];\n this.InputField = FieldBuilder.BuildTextareaField(largeTextFieldDto);\n formRow.append(this.InputField);\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var fields = [];\n var fieldDto = this.ComponentDto.Fields[0];\n fields.push({\n FieldId: fieldDto.FieldId,\n Value: this.InputField.querySelector(\"textarea\").value\n });\n return {\n ComponentType: FormComponentType.CustomLargeText,\n Fields: fields\n };\n }\n }]);\n return TextareaComponent;\n}(RenderedFormComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nexport var BaseComponent = /*#__PURE__*/function () {\n function BaseComponent() {\n _classCallCheck(this, BaseComponent);\n _defineProperty(this, \"Dom\", void 0);\n }\n _createClass(BaseComponent, [{\n key: \"Build\",\n value:\n /**\n * Builds the component Dom. Sets the Dom here.\n */\n function Build() {\n throw \"Not implemented\";\n }\n /**\n * Renders the Dom into the provided container\n */\n }, {\n key: \"RenderInto\",\n value: function RenderInto(container) {\n container.append(this.Dom);\n return this;\n }\n /**\n * Removes the Dom from the document. Deletes its HTML element.\n * @returns\n */\n }, {\n key: \"Remove\",\n value: function Remove() {\n this.Dom.remove();\n return this;\n }\n /**\n * Returns the HTML element this component represents.\n * @returns\n */\n }, {\n key: \"GetDom\",\n value: function GetDom() {\n return this.Dom;\n }\n }]);\n return BaseComponent;\n}();", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { BaseComponent } from \"./../BaseComponent.js\";\n/**\n * Represents an individual day on the calendar\n */\nexport var DayButton = /*#__PURE__*/function (_BaseComponent) {\n _inherits(DayButton, _BaseComponent);\n var _super = _createSuper(DayButton);\n function DayButton(dateTime, currentDateTime) {\n var _this;\n _classCallCheck(this, DayButton);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"DateTime\", void 0);\n /**\n * The current DateTime represented by the user selection in the DateTimePicker component.\n */\n _defineProperty(_assertThisInitialized(_this), \"CurrentDateTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"OnClickedCallbacks\", []);\n _defineProperty(_assertThisInitialized(_this), \"IsDisabled\", false);\n _this.DateTime = dateTime;\n _this.CurrentDateTime = currentDateTime;\n return _this;\n }\n /**\n * Gets the luxon.DateTime that this button represents.\n * @returns\n */\n _createClass(DayButton, [{\n key: \"GetDateTime\",\n value: function GetDateTime() {\n return this.DateTime;\n }\n }, {\n key: \"OnClicked\",\n value: function OnClicked(callback) {\n this.OnClickedCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"Build\",\n value: function Build() {\n var _this2 = this;\n var template = document.createElement(\"button\");\n template.setAttribute(\"type\", \"button\");\n template.innerHTML = \"\\n \".concat(this.DateTime.toFormat(\"d\"), \"\\n \");\n if (this.DateTime.month !== this.CurrentDateTime.month) {\n template.classList.add(\"outside-of-month\");\n }\n if (this.DateTime.month === this.CurrentDateTime.month && this.DateTime.day === this.CurrentDateTime.day) {\n template.classList.add(\"selected\");\n }\n if (this.IsDisabled) {\n template.classList.add(\"disabled\");\n } else {\n template.addEventListener(\"click\", function () {\n _this2.FireOnClickedCallbacks();\n });\n }\n this.Dom = template;\n return this;\n }\n }, {\n key: \"FireOnClickedCallbacks\",\n value: function FireOnClickedCallbacks() {\n var _iterator = _createForOfIteratorHelper(this.OnClickedCallbacks),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var callback = _step.value;\n callback();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n /**\n * When called, will disable this button and it will not be clickable by the user.\n * This must be called before Build() to have any real effect.\n */\n }, {\n key: \"AsDisabled\",\n value: function AsDisabled() {\n this.IsDisabled = true;\n return this;\n }\n }]);\n return DayButton;\n}(BaseComponent);", "function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nexport var BeforeConfirmedEvent = /*#__PURE__*/_createClass(function BeforeConfirmedEvent() {\n _classCallCheck(this, BeforeConfirmedEvent);\n _defineProperty(this, \"Canceled\", false);\n _defineProperty(this, \"DateTime\", void 0);\n});", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { BaseComponent } from \"../BaseComponent.js\";\n/**\n * Represents an individual month button on the calendar's month selector.\n */\nexport var MonthButton = /*#__PURE__*/function (_BaseComponent) {\n _inherits(MonthButton, _BaseComponent);\n var _super = _createSuper(MonthButton);\n function MonthButton(dateTime, currentDateTime) {\n var _this;\n _classCallCheck(this, MonthButton);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"DateTime\", void 0);\n /**\n * The current DateTime represented by this month button. We are only concerned with the month itself.\n */\n _defineProperty(_assertThisInitialized(_this), \"CurrentDateTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"OnClickedCallbacks\", []);\n _this.DateTime = dateTime;\n _this.CurrentDateTime = currentDateTime;\n return _this;\n }\n /**\n * Gets the luxon.DateTime that this button represents.\n * @returns\n */\n _createClass(MonthButton, [{\n key: \"GetDateTime\",\n value: function GetDateTime() {\n return this.DateTime;\n }\n }, {\n key: \"OnClicked\",\n value: function OnClicked(callback) {\n this.OnClickedCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"Build\",\n value: function Build() {\n var _this2 = this;\n var template = document.createElement(\"button\");\n template.setAttribute(\"type\", \"button\");\n template.innerHTML = \"\\n \".concat(this.DateTime.toFormat(\"MMMM\"), \"\\n \");\n if (this.DateTime.month === this.CurrentDateTime.month) {\n template.classList.add(\"selected\");\n }\n template.addEventListener(\"click\", function () {\n _this2.FireOnClickedCallbacks();\n });\n this.Dom = template;\n return this;\n }\n }, {\n key: \"FireOnClickedCallbacks\",\n value: function FireOnClickedCallbacks() {\n var _iterator = _createForOfIteratorHelper(this.OnClickedCallbacks),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var callback = _step.value;\n callback();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }]);\n return MonthButton;\n}(BaseComponent);", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { BaseComponent } from \"../BaseComponent.js\";\n/**\n * Represents an individual year button on the calendar's year selector.\n */\nexport var YearButton = /*#__PURE__*/function (_BaseComponent) {\n _inherits(YearButton, _BaseComponent);\n var _super = _createSuper(YearButton);\n function YearButton(dateTime, currentDateTime) {\n var _this;\n _classCallCheck(this, YearButton);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"DateTime\", void 0);\n /**\n * The current DateTime represented by this year button. We are only concerned with the year itself.\n */\n _defineProperty(_assertThisInitialized(_this), \"CurrentDateTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"OnClickedCallbacks\", []);\n _this.DateTime = dateTime;\n _this.CurrentDateTime = currentDateTime;\n return _this;\n }\n /**\n * Gets the luxon.DateTime that this button represents.\n * @returns\n */\n _createClass(YearButton, [{\n key: \"GetDateTime\",\n value: function GetDateTime() {\n return this.DateTime;\n }\n }, {\n key: \"OnClicked\",\n value: function OnClicked(callback) {\n this.OnClickedCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"Build\",\n value: function Build() {\n var _this2 = this;\n var template = document.createElement(\"button\");\n template.setAttribute(\"type\", \"button\");\n template.innerHTML = \"\\n \".concat(this.DateTime.toFormat(\"yyyy\"), \"\\n \");\n if (this.DateTime.year === this.CurrentDateTime.year) {\n template.classList.add(\"selected\");\n }\n template.addEventListener(\"click\", function () {\n _this2.FireOnClickedCallbacks();\n });\n this.Dom = template;\n return this;\n }\n }, {\n key: \"FireOnClickedCallbacks\",\n value: function FireOnClickedCallbacks() {\n var _iterator = _createForOfIteratorHelper(this.OnClickedCallbacks),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var callback = _step.value;\n callback();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }]);\n return YearButton;\n}(BaseComponent);", "export var DateTimePickerWidget;\n(function (DateTimePickerWidget) {\n DateTimePickerWidget[DateTimePickerWidget[\"DATE_PICKER\"] = 0] = \"DATE_PICKER\";\n DateTimePickerWidget[DateTimePickerWidget[\"TIME_PICKER\"] = 1] = \"TIME_PICKER\";\n})(DateTimePickerWidget || (DateTimePickerWidget = {}));", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { BaseComponent } from \"./../BaseComponent.js\";\nimport { DayButton } from \"./DayButton.js\";\nimport { BeforeConfirmedEvent } from \"../../Events/BeforeConfirmedEvent.js\";\nimport { MonthButton } from \"./MonthButton.js\";\nimport { YearButton } from \"./YearButton.js\";\nimport { DateTimePickerWidget } from \"../../DateTimePickerWidget.js\";\nexport var Calendar = /*#__PURE__*/function (_BaseComponent) {\n _inherits(Calendar, _BaseComponent);\n var _super = _createSuper(Calendar);\n function Calendar(dateTimePicker) {\n var _this;\n _classCallCheck(this, Calendar);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"DateTimePicker\", void 0);\n /**\n * This is the current date time this calendar widget is working with and what the user has selected.\n * The DateTimePicker date time is only set when the user confirms the CurrentDateTime from this Calendar\n * component.\n */\n _defineProperty(_assertThisInitialized(_this), \"CurrentDateTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"DayButtonComponents\", []);\n _defineProperty(_assertThisInitialized(_this), \"MonthButtonComponents\", []);\n _defineProperty(_assertThisInitialized(_this), \"YearButtonComponents\", []);\n _defineProperty(_assertThisInitialized(_this), \"CalendarControlsButtons\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"CancelButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"BackButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"ConfirmButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"NextButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"CalendarControlsContainer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"MonthSelectorContainer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"YearSelectorContainer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"CurrentYearSelectionRowShift\", 0);\n _this.DateTimePicker = dateTimePicker;\n return _this;\n }\n _createClass(Calendar, [{\n key: \"Build\",\n value: function Build() {\n var _this2 = this;\n var currentDateTime = this.CurrentDateTime;\n var template = document.createElement(\"div\");\n template.classList.add(\"date-time-picker-modal\");\n template.classList.add(\"date-time-picker-calendar-component\");\n template.innerHTML = \"\\n
\\n
\\n
\\n
\\n \\n \\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n \\n \\n \\n \\n
\\n
\\n
\\n \");\n this.Dom = template;\n this.CalendarControlsButtons = template.querySelector(\".calendar-controls-buttons\");\n this.CancelButton = template.querySelector(\".close-button\");\n this.ConfirmButton = template.querySelector(\".confirm-button\");\n this.BackButton = template.querySelector(\".back-button\");\n this.NextButton = template.querySelector(\".next-button\");\n this.CalendarControlsContainer = template.querySelector(\".calendar-controls-container\");\n this.MonthSelectorContainer = template.querySelector(\".month-selection-container\");\n this.YearSelectorContainer = template.querySelector(\".year-selection-container\");\n template.addEventListener(\"click\", function (e) {\n _this2.OnComponentClicked(e);\n });\n template.querySelector(\".prev-month-button\").addEventListener(\"click\", function (e) {\n _this2.OnMonthChangeButtonClicked(-1);\n });\n template.querySelector(\".next-month-button\").addEventListener(\"click\", function (e) {\n _this2.OnMonthChangeButtonClicked(1);\n });\n template.querySelector(\".select-month-button\").addEventListener(\"click\", function (e) {\n _this2.OnSelectMonthButtonClicked();\n });\n template.querySelector(\".select-year-button\").addEventListener(\"click\", function (e) {\n _this2.OnSelectYearButtonClicked();\n });\n template.querySelector(\".year-selection-container\").addEventListener(\"wheel\", function (e) {\n _this2.OnSelectYearScroll(e.deltaY);\n });\n // Render weekday titles from user-defined weekday indices order\n var weekdayIndices = this.DateTimePicker.GetWeekdayIndices();\n var _iterator = _createForOfIteratorHelper(weekdayIndices),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var weekdayNumber = _step.value;\n var luxonDateWithWeekdaySet = luxon.DateTime.now().set({\n weekday: weekdayNumber\n });\n var element = document.createElement(\"div\");\n element.textContent = luxonDateWithWeekdaySet.toFormat(\"EEE\");\n template.querySelector(\".weekdays-titles\").append(element);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n this.RenderButtonsForCurrentMonth();\n this.CancelButton.addEventListener(\"click\", function () {\n _this2.OnCancelButtonClicked();\n });\n this.ConfirmButton.addEventListener(\"click\", function () {\n _this2.OnConfirmButtonClicked();\n });\n this.NextButton.addEventListener(\"click\", function () {\n _this2.OnNextButtonClicked();\n });\n return this;\n }\n }, {\n key: \"OnSelectMonthButtonClicked\",\n value: function OnSelectMonthButtonClicked() {\n this.RenderMonthSelectionButtons();\n this.ShowMonthPicker();\n }\n }, {\n key: \"OnSelectYearButtonClicked\",\n value: function OnSelectYearButtonClicked() {\n // Reset the shows to shift by\n this.CurrentYearSelectionRowShift = 0;\n this.RenderYearSelectionButtons();\n this.ShowYearPicker();\n }\n /**\n * When the user scrolls/drags while selecting a year\n * @param deltaY\n */\n }, {\n key: \"OnSelectYearScroll\",\n value: function OnSelectYearScroll(deltaY) {\n if (deltaY < 0) {\n --this.CurrentYearSelectionRowShift;\n this.ClearYearSelectionButtons();\n this.RenderYearSelectionButtons();\n } else if (deltaY > 0) {\n ++this.CurrentYearSelectionRowShift;\n this.ClearYearSelectionButtons();\n this.RenderYearSelectionButtons();\n }\n }\n }, {\n key: \"OnCancelButtonClicked\",\n value: function OnCancelButtonClicked() {\n this.DateTimePicker.HideAll();\n this.DateTimePicker.FireCanceled();\n }\n }, {\n key: \"OnConfirmButtonClicked\",\n value: function OnConfirmButtonClicked() {\n var beforeConfirmEvent = new BeforeConfirmedEvent();\n beforeConfirmEvent.DateTime = this.CurrentDateTime;\n this.DateTimePicker.FireBeforeConfirmed(beforeConfirmEvent);\n if (!beforeConfirmEvent.Canceled) {\n this.DateTimePicker.ConfirmSelection();\n }\n }\n }, {\n key: \"OnNextButtonClicked\",\n value: function OnNextButtonClicked() {\n this.Hide();\n this.DateTimePicker.Show(DateTimePickerWidget.TIME_PICKER);\n }\n /**\n * Shows the month picker section of the calendar. Hides other content sections.\n */\n }, {\n key: \"ShowMonthPicker\",\n value: function ShowMonthPicker() {\n this.CalendarControlsButtons.style.display = \"none\";\n this.CalendarControlsContainer.style.display = \"none\";\n this.YearSelectorContainer.style.display = \"none\";\n this.MonthSelectorContainer.style.display = null;\n }\n /**\n * Shows the year picker section of the calendar. Hides other content sections.\n */\n }, {\n key: \"ShowYearPicker\",\n value: function ShowYearPicker() {\n this.CalendarControlsButtons.style.display = \"none\";\n this.CalendarControlsContainer.style.display = \"none\";\n this.YearSelectorContainer.style.display = null;\n this.MonthSelectorContainer.style.display = \"none\";\n }\n /**\n * Shows the normal date picker view of a calendar.\n */\n }, {\n key: \"ShowDatePicker\",\n value: function ShowDatePicker() {\n this.CalendarControlsButtons.style.display = null;\n this.CalendarControlsContainer.style.display = null;\n this.YearSelectorContainer.style.display = \"none\";\n this.MonthSelectorContainer.style.display = \"none\";\n }\n /**\n * Shows the calendar modal component. Also logically shows/hides the correct buttons to either confirm the\n * date or progress the calendar to render the time selector if it has been enabled.\n * @returns\n */\n }, {\n key: \"Show\",\n value: function Show() {\n this.CancelButton.style.display = null;\n this.BackButton.style.display = \"none\";\n if (this.DateTimePicker.GetTimePickerEnabled()) {\n this.NextButton.style.display = null;\n this.ConfirmButton.style.display = \"none\";\n } else {\n this.NextButton.style.display = \"none\";\n this.ConfirmButton.style.display = null;\n }\n this.Dom.classList.add(\"show\");\n return this;\n }\n /**\n * Sets the current luxon.DateTime the calendar is using as a reference. Should not be called\n * by methods inside this component - used for outside callers.\n * @param dateTime\n * @returns\n */\n }, {\n key: \"SetCurrentDateTime\",\n value: function SetCurrentDateTime(dateTime) {\n this.CurrentDateTime = dateTime;\n return this;\n }\n }, {\n key: \"GetCurrentDateTime\",\n value: function GetCurrentDateTime() {\n return this.CurrentDateTime;\n }\n /**\n * Reloads the calendar's day buttons and labels.\n * @returns\n */\n }, {\n key: \"Reload\",\n value: function Reload() {\n this.ClearCurrentDayButtons();\n this.RenderButtonsForCurrentMonth();\n this.UpdateMonthButtonText();\n this.UpdateYearButtonText();\n return this;\n }\n }, {\n key: \"Hide\",\n value: function Hide() {\n this.Dom.classList.remove(\"show\");\n return this;\n }\n /**\n * When any part of the modal is clicked\n * @param e\n */\n }, {\n key: \"OnComponentClicked\",\n value: function OnComponentClicked(e) {\n var elementTarget = e.target;\n if (elementTarget !== null) {\n if (elementTarget.classList.contains(\"date-time-picker-modal\")) {\n this.DateTimePicker.FireCanceled();\n this.DateTimePicker.HideAll();\n }\n }\n }\n /**\n * Removes all the day buttons in the calendar widget, and clears the DayButtonComponents array of this instance.\n */\n }, {\n key: \"ClearCurrentDayButtons\",\n value: function ClearCurrentDayButtons() {\n this.DayButtonComponents.forEach(function (component) {\n return component.Remove();\n });\n this.DayButtonComponents = [];\n }\n /**\n * Removes all the month buttons in the month selection section, and clears the array of this instance.\n */\n }, {\n key: \"ClearMonthSelectionButtons\",\n value: function ClearMonthSelectionButtons() {\n this.MonthButtonComponents.forEach(function (component) {\n return component.Remove();\n });\n this.MonthButtonComponents = [];\n }\n /**\n * Removes all the year buttons in the year selection section, and clears the array of this instance.\n */\n }, {\n key: \"ClearYearSelectionButtons\",\n value: function ClearYearSelectionButtons() {\n this.YearButtonComponents.forEach(function (component) {\n return component.Remove();\n });\n this.YearButtonComponents = [];\n }\n /**\n * Renders the month's date buttons for the current month defined in the\n * DateTimePicker property's current date time.\n */\n }, {\n key: \"RenderButtonsForCurrentMonth\",\n value: function RenderButtonsForCurrentMonth() {\n var _this3 = this;\n var currentDateTime = this.CurrentDateTime;\n this.ClearCurrentDayButtons();\n var dateTimesToRender = this.GetListOfDateTimesToRenderOnCalendar();\n var dayButtonsContainer = this.Dom.querySelector(\".weekday-buttons\");\n var _iterator2 = _createForOfIteratorHelper(dateTimesToRender),\n _step2;\n try {\n var _loop = function _loop() {\n var dateTime = _step2.value;\n var buttonComponent = new DayButton(dateTime, currentDateTime);\n if (_this3.DateTimePicker.IsDateTimeDisabled(dateTime)) {\n buttonComponent.AsDisabled();\n }\n buttonComponent.Build().RenderInto(dayButtonsContainer).OnClicked(function () {\n _this3.OnDayButtonClicked(buttonComponent);\n });\n _this3.DayButtonComponents.push(buttonComponent);\n };\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n _loop();\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n /**\n * Renders the buttons for the month selection section.\n */\n }, {\n key: \"RenderMonthSelectionButtons\",\n value: function RenderMonthSelectionButtons() {\n var _this4 = this;\n var currentDateTime = this.CurrentDateTime;\n this.ClearMonthSelectionButtons();\n var _loop2 = function _loop2() {\n var buttonComponent = new MonthButton(luxon.DateTime.now().set({\n day: 1,\n month: i\n }), currentDateTime).Build().RenderInto(_this4.MonthSelectorContainer.querySelector(\".month-buttons\")).OnClicked(function () {\n _this4.OnMonthButtonClicked(buttonComponent);\n });\n _this4.MonthButtonComponents.push(buttonComponent);\n };\n for (var i = 1; i <= 12; i++) {\n _loop2();\n }\n }\n /**\n * Renders the buttons for the year selection section. Renders years in 12 year intervals where the current year\n * is always rendered as the 5th index (starting the second row out of 3 rows)\n */\n }, {\n key: \"RenderYearSelectionButtons\",\n value: function RenderYearSelectionButtons() {\n var _this$CurrentYearSele,\n _this5 = this;\n var currentDateTime = this.CurrentDateTime;\n var yearsPerRow = 4;\n var rowsToShiftBy = (_this$CurrentYearSele = this.CurrentYearSelectionRowShift) !== null && _this$CurrentYearSele !== void 0 ? _this$CurrentYearSele : 0;\n var firstYearToRender = currentDateTime.year - yearsPerRow;\n var lastYearToRender = currentDateTime.year + (yearsPerRow - 1) + yearsPerRow;\n this.ClearYearSelectionButtons();\n var _loop3 = function _loop3() {\n var buttonComponent = new YearButton(luxon.DateTime.now().set({\n day: 1,\n month: 1,\n year: i\n }), currentDateTime).Build().RenderInto(_this5.YearSelectorContainer.querySelector(\".year-buttons\")).OnClicked(function () {\n _this5.OnYearButtonClicked(buttonComponent);\n });\n _this5.YearButtonComponents.push(buttonComponent);\n };\n for (var i = firstYearToRender + yearsPerRow * rowsToShiftBy; i <= lastYearToRender + yearsPerRow * rowsToShiftBy; i++) {\n _loop3();\n }\n }\n /**\n * Fetches an array of luxon.DateTime objects in chronological order to render for the current month's\n * calendar view.\n *\n * We first begin by determine if we need to gather dates from the previous month. This happens\n * when the 1st of the current month begins on a weekday other than the user-defined start weekday.\n *\n * Then, we fill the array with all dates of the current month.\n *\n * Then, we determine if we need any dates from the next month. This occurs only when the last date\n * of the current month is not the last weekday in the user-defined weekdays.\n */\n }, {\n key: \"GetListOfDateTimesToRenderOnCalendar\",\n value: function GetListOfDateTimesToRenderOnCalendar() {\n var dateTimesToRender = [];\n var currentDateTime = this.CurrentDateTime;\n // What week day does the current month start on?\n var firstDayOfCurrentMonth = currentDateTime.set({\n day: 1\n });\n var lastDayOfCurrentMonth = currentDateTime.set({\n day: currentDateTime.daysInMonth\n });\n var firstWeekdayOfCurrentMonth = firstDayOfCurrentMonth.weekday;\n var lastWeekdayOfCurrentMonth = lastDayOfCurrentMonth.weekday;\n var userDefinedWeekIndices = this.DateTimePicker.GetWeekdayIndices();\n // Check if the weekday that this month starts on is the same as the user-defined start of the week\n // to show in the calendar\n if (userDefinedWeekIndices[0] !== firstWeekdayOfCurrentMonth) {\n // This means that the current month's weekday starts at a point which is not the start of the user-defined's\n // first day of the week. We must gather days from the previous month until we satisfy how many we are missing.\n // Which index, in the user-defined weekdays, does this current month's weekday fall into?\n var indexInUserDefinedWeek = userDefinedWeekIndices.indexOf(firstWeekdayOfCurrentMonth);\n // Iterate until we hit the array-index that the current week day falls on\n for (var i = 0; i < indexInUserDefinedWeek; i++) {\n dateTimesToRender.push(firstDayOfCurrentMonth.minus({\n day: indexInUserDefinedWeek - i\n }));\n }\n }\n // Add all days from the current month\n for (var _i = 1; _i <= firstDayOfCurrentMonth.daysInMonth; _i++) {\n dateTimesToRender.push(firstDayOfCurrentMonth.set({\n day: _i\n }));\n }\n // Check if the last day of the month's weekday is not equal to the last day of the user-defined week\n if (userDefinedWeekIndices[userDefinedWeekIndices.length - 1] !== lastWeekdayOfCurrentMonth) {\n // This means that the current month's weekday end at a point which is not the end of the user-defined's\n // last day of the week. We must gather days from the next month until we satisfy how many we are missing.\n // Which index, in the user-defined weekdays, does this current month's weekday fall into?\n var _indexInUserDefinedWeek = userDefinedWeekIndices.indexOf(lastWeekdayOfCurrentMonth);\n // Iterate until we hit the end of the user define week indices array length\n for (var _i2 = _indexInUserDefinedWeek; _i2 < userDefinedWeekIndices.length - 1; _i2++) {\n dateTimesToRender.push(lastDayOfCurrentMonth.plus({\n day: _i2 - _indexInUserDefinedWeek + 1\n }));\n }\n }\n return dateTimesToRender;\n }\n /**\n * Called when a year selection button is clicked. Sets the current date's year and then re-renders the calendar buttons\n * based on the new date selected.\n * @param component\n */\n }, {\n key: \"OnYearButtonClicked\",\n value: function OnYearButtonClicked(component) {\n var dateTime = component.GetDateTime();\n this.CurrentDateTime = this.CurrentDateTime.set({\n year: dateTime.year\n });\n this.ClearCurrentDayButtons();\n this.RenderButtonsForCurrentMonth();\n this.UpdateMonthButtonText();\n this.UpdateYearButtonText();\n this.ShowDatePicker();\n return this;\n }\n /**\n * Called when a month selection button is clicked. Sets the current date's month and then re-renders the calendar buttons\n * based on the new date selected.\n * @param component\n */\n }, {\n key: \"OnMonthButtonClicked\",\n value: function OnMonthButtonClicked(component) {\n var dateTime = component.GetDateTime();\n this.CurrentDateTime = this.CurrentDateTime.set({\n month: dateTime.month\n });\n this.ClearCurrentDayButtons();\n this.RenderButtonsForCurrentMonth();\n this.UpdateMonthButtonText();\n this.UpdateYearButtonText();\n this.ShowDatePicker();\n return this;\n }\n /**\n * Called when a day button in the calendar is clicked. Sets the current Date (month, day, year)\n * and then re-renders the calendar buttons based on the new date selected.\n * @param component\n * @returns\n */\n }, {\n key: \"OnDayButtonClicked\",\n value: function OnDayButtonClicked(component) {\n var dateTime = component.GetDateTime();\n this.CurrentDateTime = this.CurrentDateTime.set({\n month: dateTime.month,\n day: dateTime.day,\n year: dateTime.year\n });\n this.ClearCurrentDayButtons();\n this.RenderButtonsForCurrentMonth();\n this.UpdateMonthButtonText();\n this.UpdateYearButtonText();\n return this;\n }\n /**\n * Called when one of the month change buttons is clicked. The interval provided is either 1 or -1 and shifts\n * the current month by that interval. The day buttons are then cleared and re-rendered.\n * @param interval\n */\n }, {\n key: \"OnMonthChangeButtonClicked\",\n value: function OnMonthChangeButtonClicked(interval) {\n var newDateTime = this.CurrentDateTime.plus({\n month: interval\n });\n this.CurrentDateTime = this.CurrentDateTime.set({\n month: newDateTime.month,\n day: newDateTime.day,\n year: newDateTime.year\n });\n this.ClearCurrentDayButtons();\n this.RenderButtonsForCurrentMonth();\n this.UpdateMonthButtonText();\n this.UpdateYearButtonText();\n this.ShowDatePicker();\n return this;\n }\n /**\n * Updates the calendar's month button's current month text.\n */\n }, {\n key: \"UpdateMonthButtonText\",\n value: function UpdateMonthButtonText() {\n var monthButton = this.Dom.querySelector(\".select-month-button\");\n monthButton.textContent = this.CurrentDateTime.toFormat(\"MMMM\");\n return this;\n }\n /**\n * Updates the calendar's year button's current year text.\n */\n }, {\n key: \"UpdateYearButtonText\",\n value: function UpdateYearButtonText() {\n var yearButton = this.Dom.querySelector(\".select-year-button\");\n yearButton.textContent = this.CurrentDateTime.toFormat(\"yyyy\");\n return this;\n }\n }]);\n return Calendar;\n}(BaseComponent);", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nexport var ModalBackdrop = /*#__PURE__*/function () {\n function ModalBackdrop() {\n _classCallCheck(this, ModalBackdrop);\n _defineProperty(this, \"Dom\", void 0);\n _defineProperty(this, \"OnClickCallbacks\", []);\n this.Build().RenderInto(document.body);\n }\n /**\n * Runs the callback when the backdrop is clicked\n */\n _createClass(ModalBackdrop, [{\n key: \"OnClicked\",\n value: function OnClicked(callback) {\n this.OnClickCallbacks.push(callback);\n return this;\n }\n /**\n * There can only ever be one #date-picker-component-modal-backdrop, so even if this is called again from another\n * instance it will just use the existing instance in the document.\n * @returns\n */\n }, {\n key: \"Build\",\n value: function Build() {\n var _this = this;\n var existingBackdrop = document.querySelector(\"#date-picker-component-modal-backdrop\");\n if (existingBackdrop !== null) {\n this.Dom = existingBackdrop;\n } else {\n var template = document.createElement(\"div\");\n template.id = \"date-picker-component-modal-backdrop\";\n this.Dom = template;\n }\n this.Dom.addEventListener(\"click\", function (e) {\n _this.FireOnClickCallbacks(e);\n });\n return this;\n }\n }, {\n key: \"GetDom\",\n value: function GetDom() {\n return this.Dom;\n }\n }, {\n key: \"RenderInto\",\n value: function RenderInto(container) {\n container.append(this.Dom);\n return this;\n }\n }, {\n key: \"FireOnClickCallbacks\",\n value: function FireOnClickCallbacks(e) {\n var _iterator = _createForOfIteratorHelper(this.OnClickCallbacks),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var callback = _step.value;\n callback(e);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n /**\n * Shows the modal backdrop\n */\n }, {\n key: \"Show\",\n value: function Show() {\n if (!document.body.classList.contains(\"date-picker-component-backdrop-shown\")) {\n document.body.classList.add(\"date-picker-component-backdrop-shown\");\n this.Dom.classList.add(\"shown\");\n }\n }\n /**\n * Hides the modal backdrop\n */\n }, {\n key: \"Hide\",\n value: function Hide() {\n document.body.classList.remove(\"date-picker-component-backdrop-shown\");\n this.Dom.classList.remove(\"shown\");\n }\n }]);\n return ModalBackdrop;\n}();", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { BaseComponent } from \"./../BaseComponent.js\";\n/**\n * Represents an individual hour on the time picker\n */\nexport var HourButton = /*#__PURE__*/function (_BaseComponent) {\n _inherits(HourButton, _BaseComponent);\n var _super = _createSuper(HourButton);\n function HourButton(dateTime, currentDateTime) {\n var _this;\n _classCallCheck(this, HourButton);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"DateTime\", void 0);\n /**\n * The current DateTime represented by the user selection in the DateTimePicker component.\n */\n _defineProperty(_assertThisInitialized(_this), \"CurrentDateTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"OnClickedCallbacks\", []);\n _this.DateTime = dateTime;\n _this.CurrentDateTime = currentDateTime;\n return _this;\n }\n /**\n * Gets the luxon.DateTime that this button represents.\n * @returns\n */\n _createClass(HourButton, [{\n key: \"GetDateTime\",\n value: function GetDateTime() {\n return this.DateTime;\n }\n }, {\n key: \"OnClicked\",\n value: function OnClicked(callback) {\n this.OnClickedCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"Build\",\n value: function Build() {\n var _this2 = this;\n var template = document.createElement(\"button\");\n template.setAttribute(\"type\", \"button\");\n template.innerHTML = \"\\n \".concat(this.DateTime.toFormat(\"h\"), \"\\n \");\n if (this.DateTime.hour === this.CurrentDateTime.hour) {\n template.classList.add(\"selected\");\n }\n template.addEventListener(\"click\", function () {\n _this2.FireOnClickedCallbacks();\n });\n this.Dom = template;\n return this;\n }\n }, {\n key: \"FireOnClickedCallbacks\",\n value: function FireOnClickedCallbacks() {\n var _iterator = _createForOfIteratorHelper(this.OnClickedCallbacks),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var callback = _step.value;\n callback();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }]);\n return HourButton;\n}(BaseComponent);", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { BaseComponent } from \"../BaseComponent.js\";\n/**\n * Represents an individual hour on the time picker\n */\nexport var MinuteButton = /*#__PURE__*/function (_BaseComponent) {\n _inherits(MinuteButton, _BaseComponent);\n var _super = _createSuper(MinuteButton);\n function MinuteButton(dateTime, currentDateTime) {\n var _this;\n _classCallCheck(this, MinuteButton);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"DateTime\", void 0);\n /**\n * The current DateTime represented by the user selection in the DateTimePicker component.\n */\n _defineProperty(_assertThisInitialized(_this), \"CurrentDateTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"OnClickedCallbacks\", []);\n _this.DateTime = dateTime;\n _this.CurrentDateTime = currentDateTime;\n return _this;\n }\n /**\n * Gets the luxon.DateTime that this button represents.\n * @returns\n */\n _createClass(MinuteButton, [{\n key: \"GetDateTime\",\n value: function GetDateTime() {\n return this.DateTime;\n }\n }, {\n key: \"OnClicked\",\n value: function OnClicked(callback) {\n this.OnClickedCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"Build\",\n value: function Build() {\n var _this2 = this;\n var template = document.createElement(\"button\");\n template.setAttribute(\"type\", \"button\");\n template.innerHTML = \"\\n \".concat(this.DateTime.toFormat(\"mm\"), \"\\n \");\n if (this.DateTime.minute === this.CurrentDateTime.minute) {\n template.classList.add(\"selected\");\n }\n template.addEventListener(\"click\", function () {\n _this2.FireOnClickedCallbacks();\n });\n this.Dom = template;\n return this;\n }\n }, {\n key: \"FireOnClickedCallbacks\",\n value: function FireOnClickedCallbacks() {\n var _iterator = _createForOfIteratorHelper(this.OnClickedCallbacks),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var callback = _step.value;\n callback();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }]);\n return MinuteButton;\n}(BaseComponent);", "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { DateTimePickerWidget } from \"../../DateTimePickerWidget.js\";\nimport { BaseComponent } from \"../BaseComponent.js\";\nimport { HourButton } from \"./HourButton.js\";\nimport { MinuteButton } from \"./MinuteButton.js\";\nimport { BeforeConfirmedEvent } from \"../../Events/BeforeConfirmedEvent.js\";\nexport var TimePicker = /*#__PURE__*/function (_BaseComponent) {\n _inherits(TimePicker, _BaseComponent);\n var _super = _createSuper(TimePicker);\n function TimePicker(dateTimePickerComponent) {\n var _this;\n _classCallCheck(this, TimePicker);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"DateTimePicker\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"HourButtonComponents\", []);\n _defineProperty(_assertThisInitialized(_this), \"MinuteButtonComponents\", []);\n /**\n * The current date time this component references. We are only concerned with the hours and minutes.\n * This component will never change the month, day, or year as it is a time component.\n */\n _defineProperty(_assertThisInitialized(_this), \"CurrentDateTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"TimePickerControlsButtons\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"CancelButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"BackButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"ConfirmButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"NextButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"AMButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"PMButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"LastTouchPageY\", void 0);\n /**\n * Number of pixels a touch must move on an hour listening element before it will fire its internal \"touch move\" function\n */\n _defineProperty(_assertThisInitialized(_this), \"LastTouchMoveThresholdHour\", 20);\n /**\n * Number of pixels a touch must move on a minute listening element before it will fire its internal \"touch move\" function\n */\n _defineProperty(_assertThisInitialized(_this), \"LastTouchMoveThresholdMinute\", 10);\n _this.DateTimePicker = dateTimePickerComponent;\n return _this;\n }\n _createClass(TimePicker, [{\n key: \"SetCurrentDateTime\",\n value: function SetCurrentDateTime(dateTime) {\n // Round the hour and minutes to the nearest intervals\n var roundedMinuteAndHourIntervals = dateTime.set({\n hour: this.RoundHourToInterval(dateTime.hour),\n minute: this.RoundMinuteToInterval(dateTime.minute)\n });\n this.CurrentDateTime = roundedMinuteAndHourIntervals;\n return this;\n }\n }, {\n key: \"GetCurrentDateTime\",\n value: function GetCurrentDateTime(dateTime) {\n return this.CurrentDateTime;\n }\n }, {\n key: \"Build\",\n value: function Build() {\n var _this2 = this;\n var template = document.createElement(\"div\");\n template.classList.add(\"date-time-picker-modal\");\n template.classList.add(\"date-time-picker-time-picker-component\");\n template.innerHTML = \"\\n
\\n
\\n
\\n
\\n \\n
\\n \\n \\n \\n \\n
\\n \\n
\\n
:
\\n
\\n \\n
\\n \\n \\n \\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n
\\n \\n \\n \\n \\n
\\n
\\n
\\n \";\n this.Dom = template;\n this.Dom.addEventListener(\"click\", function (e) {\n _this2.OnComponentClicked(e);\n });\n this.TimePickerControlsButtons = template.querySelector(\".time-picker-controls-buttons\");\n this.CancelButton = template.querySelector(\".close-button\");\n this.ConfirmButton = template.querySelector(\".confirm-button\");\n this.BackButton = template.querySelector(\".back-button\");\n this.NextButton = template.querySelector(\".next-button\");\n this.AMButton = template.querySelector(\".am-button\");\n this.PMButton = template.querySelector(\".pm-button\");\n this.CancelButton.addEventListener(\"click\", function () {\n _this2.OnCancelButtonClicked();\n });\n this.BackButton.addEventListener(\"click\", function () {\n _this2.OnBackButtonClicked();\n });\n this.ConfirmButton.addEventListener(\"click\", function () {\n _this2.OnConfirmButtonClicked();\n });\n this.RenderHourButtons();\n this.RenderMinuteButtons();\n if (this.IsCurrentTimeAM()) {\n this.SelectAMButton();\n } else {\n this.SelectPMButton();\n }\n this.AMButton.addEventListener(\"click\", function () {\n _this2.SelectAMButton();\n });\n this.PMButton.addEventListener(\"click\", function () {\n _this2.SelectPMButton();\n });\n template.querySelector(\".back-hour-button\").addEventListener(\"click\", function () {\n _this2.ShiftHour(-_this2.DateTimePicker.GetHourInterval());\n });\n template.querySelector(\".next-hour-button\").addEventListener(\"click\", function () {\n _this2.ShiftHour(_this2.DateTimePicker.GetHourInterval());\n });\n template.querySelector(\".back-minute-button\").addEventListener(\"click\", function () {\n _this2.ShiftMinute(-_this2.DateTimePicker.GetMinuteInterval());\n });\n template.querySelector(\".next-minute-button\").addEventListener(\"click\", function () {\n _this2.ShiftMinute(_this2.DateTimePicker.GetMinuteInterval());\n });\n template.addEventListener(\"touchstart\", function (e) {\n _this2.LastTouchPageY = e.touches[0].pageY;\n }, {\n passive: false\n });\n template.querySelector(\".minute-section\").addEventListener(\"touchmove\", function (e) {\n e.preventDefault();\n var deltaY = _this2.LastTouchPageY - e.touches[0].pageY;\n if (Math.abs(deltaY) >= _this2.LastTouchMoveThresholdMinute) {\n _this2.ShiftMinute(deltaY > 0 ? _this2.DateTimePicker.GetMinuteInterval() : -_this2.DateTimePicker.GetMinuteInterval());\n _this2.LastTouchPageY = e.touches[0].pageY;\n }\n }, {\n passive: false\n });\n template.querySelector(\".hour-section\").addEventListener(\"touchmove\", function (e) {\n e.preventDefault();\n var deltaY = _this2.LastTouchPageY - e.touches[0].pageY;\n if (Math.abs(deltaY) >= _this2.LastTouchMoveThresholdHour) {\n _this2.ShiftHour(deltaY > 0 ? _this2.DateTimePicker.GetHourInterval() : -_this2.DateTimePicker.GetHourInterval());\n _this2.LastTouchPageY = e.touches[0].pageY;\n }\n }, {\n passive: false\n });\n template.querySelector(\".minute-section\").addEventListener(\"wheel\", function (e) {\n _this2.OnMinuteWheel(e);\n });\n template.querySelector(\".hour-section\").addEventListener(\"wheel\", function (e) {\n _this2.OnHourWheel(e);\n });\n return this;\n }\n }, {\n key: \"OnConfirmButtonClicked\",\n value: function OnConfirmButtonClicked() {\n var beforeConfirmEvent = new BeforeConfirmedEvent();\n beforeConfirmEvent.DateTime = this.CurrentDateTime;\n this.DateTimePicker.FireBeforeConfirmed(beforeConfirmEvent);\n if (!beforeConfirmEvent.Canceled) {\n this.DateTimePicker.ConfirmSelection();\n }\n }\n }, {\n key: \"OnHourWheel\",\n value: function OnHourWheel(e) {\n if (e.deltaY === 0) {\n return;\n }\n this.ShiftHour(e.deltaY > 0 ? this.DateTimePicker.GetHourInterval() : -this.DateTimePicker.GetHourInterval());\n return this;\n }\n }, {\n key: \"OnMinuteWheel\",\n value: function OnMinuteWheel(e) {\n if (e.deltaY === 0) {\n return;\n }\n this.ShiftMinute(e.deltaY > 0 ? this.DateTimePicker.GetMinuteInterval() : -this.DateTimePicker.GetMinuteInterval());\n return this;\n }\n /**\n * Shifts the current minute by the provided interval\n * @param interval\n */\n }, {\n key: \"ShiftMinute\",\n value: function ShiftMinute(interval) {\n var currentMinute = this.GetCurrentMinuteFromUI();\n var newMinute = (currentMinute + interval) % 60;\n if (newMinute < 0) {\n newMinute += 60;\n }\n this.CurrentDateTime = this.CurrentDateTime.set({\n minute: newMinute\n });\n this.Reload();\n return this;\n }\n /**\n * Shifts the current hour by the provided interval\n * @param interval\n */\n }, {\n key: \"ShiftHour\",\n value: function ShiftHour(interval) {\n var currentHour = this.GetCurrentHourAs12HourFromUI();\n var newHour = (currentHour + interval) % 12;\n if (this.IsAMButtonSelected()) {\n this.CurrentDateTime = this.CurrentDateTime.set({\n hour: newHour < 12 ? newHour : 0\n });\n } else {\n var hourOutOf24HoursToSet = newHour < 12 ? newHour + 12 : 12;\n this.CurrentDateTime = this.CurrentDateTime.set({\n hour: hourOutOf24HoursToSet\n });\n }\n this.Reload();\n return this;\n }\n }, {\n key: \"OnCancelButtonClicked\",\n value: function OnCancelButtonClicked() {\n this.DateTimePicker.HideAll();\n this.DateTimePicker.FireCanceled();\n }\n }, {\n key: \"OnBackButtonClicked\",\n value: function OnBackButtonClicked() {\n this.Hide();\n this.DateTimePicker.Show(DateTimePickerWidget.DATE_PICKER);\n return this;\n }\n /**\n * Returns if the AM button is currently selected.\n */\n }, {\n key: \"IsAMButtonSelected\",\n value: function IsAMButtonSelected() {\n return this.Dom.querySelector(\".am-button\").classList.contains(\"selected\");\n }\n /**\n * Determines if the CurrentDateTime represents an anti meridiem time\n */\n }, {\n key: \"IsCurrentTimeAM\",\n value: function IsCurrentTimeAM() {\n return this.CurrentDateTime.hour < 12;\n }\n }, {\n key: \"SelectAMButton\",\n value: function SelectAMButton() {\n if (!this.AMButton.classList.contains(\"selected\")) {\n if (this.PMButton.classList.contains(\"selected\")) {\n this.PMButton.classList.remove(\"selected\");\n }\n this.AMButton.classList.add(\"selected\");\n this.CurrentDateTime = this.GetDateTimeFromControls();\n }\n return this;\n }\n }, {\n key: \"SelectPMButton\",\n value: function SelectPMButton() {\n if (!this.PMButton.classList.contains(\"selected\")) {\n if (this.AMButton.classList.contains(\"selected\")) {\n this.AMButton.classList.remove(\"selected\");\n }\n this.PMButton.classList.add(\"selected\");\n this.CurrentDateTime = this.GetDateTimeFromControls();\n }\n return this;\n }\n /**\n * Shows the time picker modal component. Also logically shows/hides the correct buttons to either confirm the\n * time or regress back to the calendar, if it is enabled.\n * @returns\n */\n }, {\n key: \"Show\",\n value: function Show() {\n this.NextButton.style.display = \"none\";\n if (this.DateTimePicker.GetDatePickerEnabled()) {\n this.CancelButton.style.display = \"none\";\n this.BackButton.style.display = null;\n this.ConfirmButton.style.display = null;\n } else {\n this.CancelButton.style.display = null;\n this.BackButton.style.display = \"none\";\n this.ConfirmButton.style.display = null;\n }\n this.Dom.classList.add(\"show\");\n return this;\n }\n }, {\n key: \"Hide\",\n value: function Hide() {\n this.Dom.classList.remove(\"show\");\n return this;\n }\n /**\n * Reloads the hour, minute, and meridiem controls to reflect the CurrentDateTime\n */\n }, {\n key: \"Reload\",\n value: function Reload() {\n this.RenderHourButtons();\n this.RenderMinuteButtons();\n if (this.IsCurrentTimeAM()) {\n this.SelectAMButton();\n } else {\n this.SelectPMButton();\n }\n return this;\n }\n /**\n * When any part of the modal is clicked\n * @param e\n */\n }, {\n key: \"OnComponentClicked\",\n value: function OnComponentClicked(e) {\n var elementTarget = e.target;\n if (elementTarget !== null) {\n if (elementTarget.classList.contains(\"date-time-picker-modal\")) {\n this.DateTimePicker.HideAll();\n this.DateTimePicker.FireCanceled();\n }\n }\n }\n }, {\n key: \"ClearHourButtons\",\n value: function ClearHourButtons() {\n this.HourButtonComponents.forEach(function (component) {\n return component.Remove();\n });\n this.HourButtonComponents = [];\n return this;\n }\n }, {\n key: \"ClearMinuteButtons\",\n value: function ClearMinuteButtons() {\n this.MinuteButtonComponents.forEach(function (component) {\n return component.Remove();\n });\n this.MinuteButtonComponents = [];\n return this;\n }\n }, {\n key: \"RenderHourButtons\",\n value: function RenderHourButtons() {\n var _this3 = this;\n this.ClearHourButtons();\n // Render previous hours\n // i represents how many to render\n var _loop = function _loop() {\n var component = new HourButton(_this3.CurrentDateTime.minus({\n hour: i * _this3.DateTimePicker.GetHourInterval()\n }), _this3.CurrentDateTime).Build().RenderInto(_this3.Dom.querySelector(\".prev-hour-buttons\")).OnClicked(function () {\n _this3.OnHourButtonClicked(component);\n });\n _this3.HourButtonComponents.push(component);\n };\n for (var i = 1; i <= 2; i++) {\n _loop();\n }\n // Render current hour\n var currentComponent = new HourButton(this.CurrentDateTime, this.CurrentDateTime).Build().RenderInto(this.Dom.querySelector(\".current-hour-button\")).OnClicked(function () {\n _this3.OnHourButtonClicked(currentComponent);\n });\n this.HourButtonComponents.push(currentComponent);\n // Render next hours\n // i represents how many to render\n var _loop2 = function _loop2() {\n var component = new HourButton(_this3.CurrentDateTime.plus({\n hour: _i * _this3.DateTimePicker.GetHourInterval()\n }), _this3.CurrentDateTime).Build().RenderInto(_this3.Dom.querySelector(\".next-hour-buttons\")).OnClicked(function () {\n _this3.OnHourButtonClicked(component);\n });\n _this3.HourButtonComponents.push(component);\n };\n for (var _i = 1; _i <= 2; _i++) {\n _loop2();\n }\n return this;\n }\n }, {\n key: \"RenderMinuteButtons\",\n value: function RenderMinuteButtons() {\n var _this4 = this;\n this.ClearMinuteButtons();\n // Render previous minutes\n // i represents how many to render\n var _loop3 = function _loop3() {\n var component = new MinuteButton(_this4.CurrentDateTime.minus({\n minute: i * _this4.DateTimePicker.GetMinuteInterval()\n }), _this4.CurrentDateTime).Build().RenderInto(_this4.Dom.querySelector(\".prev-minute-buttons\")).OnClicked(function () {\n _this4.OnMinuteButtonClicked(component);\n });\n _this4.MinuteButtonComponents.push(component);\n };\n for (var i = 1; i <= 2; i++) {\n _loop3();\n }\n // Render current minute\n var currentComponent = new MinuteButton(this.CurrentDateTime, this.CurrentDateTime).Build().RenderInto(this.Dom.querySelector(\".current-minute-button\")).OnClicked(function () {\n _this4.OnMinuteButtonClicked(currentComponent);\n });\n this.MinuteButtonComponents.push(currentComponent);\n // Render next minutes\n // i represents how many to render\n var _loop4 = function _loop4() {\n var component = new MinuteButton(_this4.CurrentDateTime.plus({\n minute: _i2 * _this4.DateTimePicker.GetMinuteInterval()\n }), _this4.CurrentDateTime).Build().RenderInto(_this4.Dom.querySelector(\".next-minute-buttons\")).OnClicked(function () {\n _this4.OnMinuteButtonClicked(component);\n });\n _this4.MinuteButtonComponents.push(component);\n };\n for (var _i2 = 1; _i2 <= 2; _i2++) {\n _loop4();\n }\n return this;\n }\n }, {\n key: \"OnHourButtonClicked\",\n value: function OnHourButtonClicked(component) {\n return this;\n }\n }, {\n key: \"OnMinuteButtonClicked\",\n value: function OnMinuteButtonClicked(component) {\n return this;\n }\n /**\n * Gets the current hour from the time picker UI in 12-hour notation.\n */\n }, {\n key: \"GetCurrentHourAs12HourFromUI\",\n value: function GetCurrentHourAs12HourFromUI() {\n var currentHourFromUI = parseInt(this.Dom.querySelector(\".current-hour-button\").textContent);\n return currentHourFromUI;\n }\n /**\n * Gets the current hour from the time picker UI in 24-hour notation.\n */\n }, {\n key: \"GetCurrentHourAs24HourFromUI\",\n value: function GetCurrentHourAs24HourFromUI() {\n var currentHourFromUI = this.GetCurrentHourAs12HourFromUI();\n if (!this.IsAMButtonSelected()) {\n currentHourFromUI += 12;\n } else {\n // Change 12AM to be hour 0\n if (currentHourFromUI === 12) {\n currentHourFromUI = 0;\n }\n }\n return currentHourFromUI;\n }\n }, {\n key: \"GetCurrentMinuteFromUI\",\n value: function GetCurrentMinuteFromUI() {\n return parseInt(this.Dom.querySelector(\".current-minute-button\").textContent);\n }\n /**\n * Retrieves a luxon.DateTime object where the hour and minute are set to match the current\n * controls selection in the UI.\n */\n }, {\n key: \"GetDateTimeFromControls\",\n value: function GetDateTimeFromControls() {\n var now = luxon.DateTime.now();\n var currentHourFromUI = this.GetCurrentHourAs24HourFromUI();\n var currentMinuteFromUI = this.GetCurrentMinuteFromUI();\n return now.set({\n hour: currentHourFromUI,\n minute: currentMinuteFromUI\n });\n }\n /**\n * Returns a rounded minute to the nearest minute interval defined by the user\n */\n }, {\n key: \"RoundMinuteToInterval\",\n value: function RoundMinuteToInterval(minute) {\n var interval = this.DateTimePicker.GetMinuteInterval();\n return Math.ceil(minute / interval) * interval;\n }\n /**\n * Returns a rounded hour to the nearest hour interval defined by the user\n */\n }, {\n key: \"RoundHourToInterval\",\n value: function RoundHourToInterval(hour) {\n var interval = this.DateTimePicker.GetHourInterval();\n return Math.ceil(hour / interval) * interval;\n }\n }]);\n return TimePicker;\n}(BaseComponent);", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { Calendar } from \"./Components/Calendar/Calendar.js\";\nimport { ModalBackdrop } from \"./Components/ModalBackdrop.js\";\nimport { DateTimePickerWidget } from \"./DateTimePickerWidget.js\";\nimport { TimePicker } from \"./Components/TimePicker/TimePicker.js\";\nexport var DateTimePickerComponent = /*#__PURE__*/function () {\n function DateTimePickerComponent() {\n var _this = this;\n _classCallCheck(this, DateTimePickerComponent);\n _defineProperty(this, \"Backdrop\", void 0);\n _defineProperty(this, \"DatePickerEnabled\", false);\n _defineProperty(this, \"TimePickerEnabled\", false);\n _defineProperty(this, \"Calendar\", void 0);\n _defineProperty(this, \"TimePicker\", void 0);\n /**\n * The current DateTime represented by the user's selection in the Calendar and or Time pickers.\n */\n _defineProperty(this, \"CurrentDateTime\", luxon.DateTime.now());\n /**\n * The order of the weekdays to display in the calendar. Can be overriden when using WithDatePicker()\n */\n _defineProperty(this, \"WeekdayIndices\", [1, 2, 3, 4, 5, 6, 7]);\n /**\n * The interval of hours to allow the user to select\n */\n _defineProperty(this, \"HourInterval\", 1);\n /**\n * The interval of minutes to allow the user to select. This will always start from the 0th minute of the hour.\n */\n _defineProperty(this, \"MinuteInterval\", 1);\n _defineProperty(this, \"OnBeforeConfirmedCallbacks\", []);\n _defineProperty(this, \"OnBeforeDateNextCallbacks\", []);\n _defineProperty(this, \"OnDateNextCallbacks\", []);\n _defineProperty(this, \"OnConfirmedCallbacks\", []);\n _defineProperty(this, \"OnCanceledCallbacks\", []);\n /**\n * If defined, this is the minimum date the calendar will allow the user to select\n */\n _defineProperty(this, \"MinimumDate\", void 0);\n /**\n * If defined, this is the maximum date the calendar will allow the user to select\n */\n _defineProperty(this, \"MaximumDate\", void 0);\n /**\n * The weekdays that will always be disabled or unselectable in the date picket widget.\n * These indices used must match the numbers in the this.WeekdayIndices.\n */\n _defineProperty(this, \"DisabledWeekdays\", []);\n this.Backdrop = new ModalBackdrop();\n this.Backdrop.OnClicked(function (e) {\n _this.OnBackdropClicked(e);\n });\n }\n _createClass(DateTimePickerComponent, [{\n key: \"GetMinimumDate\",\n value: function GetMinimumDate() {\n return this.MinimumDate;\n }\n }, {\n key: \"GetMaximumDate\",\n value: function GetMaximumDate() {\n return this.MaximumDate;\n }\n }, {\n key: \"GetDisabledWeekdayIndices\",\n value: function GetDisabledWeekdayIndices() {\n return this.DisabledWeekdays;\n }\n /**\n * Registers an event to be called before the entire component's luxon.DateTime is confirmed and set by\n * interacting with either the Calendar or Time picker components.\n * @param callback\n * @returns\n */\n }, {\n key: \"OnBeforeConfirmed\",\n value: function OnBeforeConfirmed(callback) {\n this.OnBeforeConfirmedCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"FireBeforeConfirmed\",\n value: function FireBeforeConfirmed(e) {\n var _iterator = _createForOfIteratorHelper(this.OnBeforeConfirmedCallbacks),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var callback = _step.value;\n callback(e);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return this;\n }\n /**\n * Registers an event to be called after the entire component's luxon.DateTime is confirmed and set by\n * interacting with either the Calendar or Time picker components.\n * @param callback\n * @returns\n */\n }, {\n key: \"OnConfirmed\",\n value: function OnConfirmed(callback) {\n this.OnConfirmedCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"FireConfirmed\",\n value: function FireConfirmed() {\n var _iterator2 = _createForOfIteratorHelper(this.OnConfirmedCallbacks),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var callback = _step2.value;\n callback();\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n return this;\n }\n /**\n * Registers an event to be called after the modal is canceled by clicking on the backdrop\n * or clicking on the cancel button.\n * @param callback\n * @returns\n */\n }, {\n key: \"OnCanceled\",\n value: function OnCanceled(callback) {\n this.OnCanceledCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"FireCanceled\",\n value: function FireCanceled() {\n var _iterator3 = _createForOfIteratorHelper(this.OnCanceledCallbacks),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var callback = _step3.value;\n callback();\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n return this;\n }\n /**\n * Registers an event to be called before the Date picker's next button is clicked. This event can only be fired\n * if both the Date and the Time pickers are enabled and thus a Next button exists on the calendar instead\n * of a Confirm button.\n * @param callback\n * @returns\n */\n }, {\n key: \"OnBeforeDateNext\",\n value: function OnBeforeDateNext(callback) {\n this.OnBeforeDateNextCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"FireBeforeDateNext\",\n value: function FireBeforeDateNext(e) {\n var _iterator4 = _createForOfIteratorHelper(this.OnBeforeDateNextCallbacks),\n _step4;\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var callback = _step4.value;\n callback(e);\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n return this;\n }\n /**\n * Registers an event to be called after the Date picker's next button is clicked. This event can only be fired\n * if both the Date and the Time pickers are enabled and thus a Next button exists on the calendar instead\n * of a Confirm button.\n * @param callback\n * @returns\n */\n }, {\n key: \"OnDateNext\",\n value: function OnDateNext(callback) {\n this.OnDateNextCallbacks.push(callback);\n return this;\n }\n }, {\n key: \"FireDateNext\",\n value: function FireDateNext() {\n var _iterator5 = _createForOfIteratorHelper(this.OnDateNextCallbacks),\n _step5;\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var callback = _step5.value;\n callback();\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n return this;\n }\n /**\n * Hides all components\n */\n }, {\n key: \"HideAll\",\n value: function HideAll() {\n this.Backdrop.Hide();\n if (this.Calendar !== undefined) {\n this.Calendar.Hide();\n }\n if (this.TimePicker !== undefined) {\n this.TimePicker.Hide();\n }\n }\n /**\n * Gets the instance of the backdrop used for this modal\n * @returns\n */\n }, {\n key: \"GetBackdrop\",\n value: function GetBackdrop() {\n return this.Backdrop;\n }\n /**\n * Gets the current luxon.DateTime that this component is representing. It is modified\n * by the user using this component's controls in either the calendar date picker or the time picker.\n * @returns\n */\n }, {\n key: \"GetCurrentDateTime\",\n value: function GetCurrentDateTime() {\n return this.CurrentDateTime;\n }\n /**\n * Sets the current zone of the current luxon.DateTime\n * @param zone\n */\n }, {\n key: \"SetCurrentTimeZone\",\n value: function SetCurrentTimeZone(zone, keepLocalTime) {\n this.CurrentDateTime = this.CurrentDateTime.setZone(zone, {\n keepLocalTime: keepLocalTime\n });\n return this;\n }\n /**\n * Sets the current month, day, and year of the CurrentDateTime of this component.\n * @returns\n */\n }, {\n key: \"SetCurrentDate\",\n value: function SetCurrentDate(month, day, year) {\n this.CurrentDateTime = this.CurrentDateTime.set({\n month: month,\n day: day,\n year: year\n });\n return this;\n }\n /**\n * Sets the current month, day, and year of the CurrentDateTime of this component.\n * @returns\n */\n }, {\n key: \"SetCurrentTime\",\n value: function SetCurrentTime(hour, minute, second) {\n this.CurrentDateTime = this.CurrentDateTime.set({\n hour: hour,\n minute: minute,\n second: second\n });\n return this;\n }\n /**\n * Returns the indices in the order defined for rendering on the calendar\n */\n }, {\n key: \"GetWeekdayIndices\",\n value: function GetWeekdayIndices() {\n return this.WeekdayIndices;\n }\n /**\n * Returns the interval at which hours can be stepped through on the UI\n * @returns\n */\n }, {\n key: \"GetHourInterval\",\n value: function GetHourInterval() {\n return this.HourInterval;\n }\n /**\n * Returns the interval at which minutes can be stepped through on the UI\n * @returns\n */\n }, {\n key: \"GetMinuteInterval\",\n value: function GetMinuteInterval() {\n return this.MinuteInterval;\n }\n /**\n * Sets the component to build with a date picker. Optionally, you can provide an array of weekday indices to define\n * how the week days will be displayed in the calendar. For example, providing [1,2,3,4,5,6,7] will start the weeks in the\n * calendar from Monday. If they need to start from Sunday, then provide [7,1,2,3,4,5,6]\n * @returns\n */\n }, {\n key: \"WithDatePicker\",\n value: function WithDatePicker() {\n var weekdayIndices = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n if (weekdayIndices !== undefined) {\n if (weekdayIndices.length !== 7) {\n throw \"Cannot provide weekdayIndices that doesn't have an array length of 7\";\n }\n // TODO, check that only numbers 1-7 are provided and are all unique\n this.WeekdayIndices = weekdayIndices;\n }\n this.DatePickerEnabled = true;\n return this;\n }\n /**\n * Sets the component to build with the time picker.\n * @returns\n */\n }, {\n key: \"WithTimePicker\",\n value: function WithTimePicker() {\n var hourInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n var minuteInterval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n this.TimePickerEnabled = true;\n if (hourInterval !== undefined) {\n this.HourInterval = hourInterval;\n }\n if (minuteInterval !== undefined) {\n this.MinuteInterval = minuteInterval;\n }\n return this;\n }\n /**\n * Sets the minimum DateTime a user can select from the calendar. Will automatically\n * set the hour, minute, and second to the maximum values for that day\n * @param dateTime\n * @returns\n */\n }, {\n key: \"WithMinimumDate\",\n value: function WithMinimumDate(dateTime) {\n this.MinimumDate = dateTime.set({\n hour: 0,\n minute: 0,\n second: 0\n });\n return this;\n }\n /**\n * Sets the maximum DateTime a user can select from the calendar. Will automatically\n * set the hour, minute, and second to the maximum values for that day\n * @param dateTime\n * @returns\n */\n }, {\n key: \"WithMaximumDate\",\n value: function WithMaximumDate(dateTime) {\n this.MaximumDate = dateTime.set({\n hour: 23,\n minute: 59,\n second: 59\n });\n return this;\n }\n /**\n * Sets the weekday indices that will always be disabled and unselectable in the date\n * picker widget. This overrides any previous disabled weekdays set by a previous\n * call to this method.\n * @param indices\n * @returns\n */\n }, {\n key: \"WithDisabledWeekdays\",\n value: function WithDisabledWeekdays(indices) {\n this.DisabledWeekdays = indices;\n return this;\n }\n }, {\n key: \"GetDatePickerEnabled\",\n value: function GetDatePickerEnabled() {\n return this.DatePickerEnabled;\n }\n }, {\n key: \"GetTimePickerEnabled\",\n value: function GetTimePickerEnabled() {\n return this.TimePickerEnabled;\n }\n /**\n * Build the component's HTML elements\n * @returns\n */\n }, {\n key: \"Build\",\n value: function Build() {\n if (this.DatePickerEnabled) {\n this.Calendar = new Calendar(this).SetCurrentDateTime(this.CurrentDateTime).Build().RenderInto(document.body);\n }\n if (this.TimePickerEnabled) {\n this.TimePicker = new TimePicker(this).SetCurrentDateTime(this.CurrentDateTime).Build().RenderInto(document.body);\n }\n return this;\n }\n /**\n * When the component's backdrop is clicked on.\n * @param e\n * @returns\n */\n }, {\n key: \"OnBackdropClicked\",\n value: function OnBackdropClicked(e) {\n this.FireCanceled();\n this.HideAll();\n return this;\n }\n /**\n * Called by the internal widgets. This is called when the user confirms their final choice in\n * the widgets. From whichever is enabled (or both) it will fetch the date from the calendar widget\n * and the time from the time picker widget.\n */\n }, {\n key: \"ConfirmSelection\",\n value: function ConfirmSelection() {\n if (this.GetDatePickerEnabled()) {\n var dateTimeFromCalendar = this.Calendar.GetCurrentDateTime();\n this.SetCurrentDate(dateTimeFromCalendar.month, dateTimeFromCalendar.day, dateTimeFromCalendar.year);\n }\n if (this.GetTimePickerEnabled()) {\n var dateTimeFromTimePicker = this.TimePicker.GetCurrentDateTime();\n this.SetCurrentTime(dateTimeFromTimePicker.hour, dateTimeFromTimePicker.minute, dateTimeFromTimePicker.second);\n }\n this.FireConfirmed();\n }\n /**\n * If no argument is provided, shows the logical first picker. If both the date and time pickers are enabled,\n * this will be the date picker. If only the time picker is enabled, it will be the time picker. If only the date picker\n * is enabled, then the date picker.\n *\n * If an argument is provided, then it attempts to show the provided picker widget requested - if it is enabled.\n * @returns\n */\n }, {\n key: \"Show\",\n value: function Show() {\n var widgetEnum = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n if (widgetEnum === DateTimePickerWidget.DATE_PICKER && !this.GetDatePickerEnabled()) {\n throw \"Cannot show the date picker widget - it is not enabled.\";\n }\n if (widgetEnum === DateTimePickerWidget.TIME_PICKER && !this.GetTimePickerEnabled()) {\n throw \"Cannot show the time picker widget - it is not enabled.\";\n }\n // Show the modal backdrop regardless of which widget will be shown\n this.Backdrop.Show();\n if (widgetEnum === undefined) {\n if (this.GetDatePickerEnabled()) {\n this.Calendar.Show();\n } else if (this.GetTimePickerEnabled()) {\n this.TimePicker.Show();\n } else {\n throw \"No widgets are enabled. Cannot show either. You must enable one or both before building this DateTimePickerComponent class.\";\n }\n } else {\n if (widgetEnum === DateTimePickerWidget.DATE_PICKER) {\n this.Calendar.Show();\n } else if (widgetEnum === DateTimePickerWidget.TIME_PICKER) {\n this.TimePicker.Show();\n } else {\n throw \"Unknown widget enum provided.\";\n }\n }\n return this;\n }\n /**\n * Returns an indication if the provided dateTime parameter is out of bounds\n * for a valid selection in the Calendar widget\n * @param dateTime\n */\n }, {\n key: \"IsDateTimeDisabled\",\n value: function IsDateTimeDisabled(dateTime) {\n if (this.GetMinimumDate() !== undefined) {\n if (dateTime < this.GetMinimumDate()) {\n return true;\n }\n }\n if (this.GetMaximumDate() !== undefined) {\n if (dateTime > this.GetMaximumDate()) {\n return true;\n }\n }\n if (this.GetDisabledWeekdayIndices().includes(dateTime.weekday)) {\n return true;\n }\n return false;\n }\n /**\n * Reloads the calendar widget (re-renders it). Useful to update it if you change minimum or maximum\n * dates.\n * @returns\n */\n }, {\n key: \"ReloadCalendar\",\n value: function ReloadCalendar() {\n this.Calendar.SetCurrentDateTime(this.CurrentDateTime);\n this.Calendar.Reload();\n return this;\n }\n /**\n * Destroys all HTML elements for this and its sub components.\n * @returns\n */\n }, {\n key: \"Remove\",\n value: function Remove() {\n var _this$Calendar, _this$Calendar$GetDom, _this$TimePicker, _this$TimePicker$GetD;\n this.Backdrop.GetDom().remove();\n (_this$Calendar = this.Calendar) === null || _this$Calendar === void 0 ? void 0 : (_this$Calendar$GetDom = _this$Calendar.GetDom()) === null || _this$Calendar$GetDom === void 0 ? void 0 : _this$Calendar$GetDom.remove();\n (_this$TimePicker = this.TimePicker) === null || _this$TimePicker === void 0 ? void 0 : (_this$TimePicker$GetD = _this$TimePicker.GetDom()) === null || _this$TimePicker$GetD === void 0 ? void 0 : _this$TimePicker$GetD.remove();\n return this;\n }\n }]);\n return DateTimePickerComponent;\n}();", "function _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == typeof value && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, \"throw\" === methodName && delegate.iterator.return && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method) || \"return\" !== methodName && (context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a '\" + methodName + \"' method\")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { FormFieldInternalId } from \"../../../../../Enums/Client/Dashboard/Form/FormFieldInternald.js\";\nimport { FormFieldOptionType } from \"../../../../../Enums/Client/Dashboard/Form/FormFieldOptionType.js\";\nimport { RenderedFormComponent } from \"./RenderedFormComponent.js\";\nimport { DateTimePickerComponent } from \"../../../../../Components/Shared/LuxonDateTimePicker/DateTimePickerComponent.js\";\nexport var JobBookingWidgetComponent = /*#__PURE__*/function (_RenderedFormComponen) {\n _inherits(JobBookingWidgetComponent, _RenderedFormComponen);\n var _super = _createSuper(JobBookingWidgetComponent);\n function JobBookingWidgetComponent(form, componentDto) {\n var _this;\n _classCallCheck(this, JobBookingWidgetComponent);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"ComponentDto\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"Form\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"ServiceData\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"DateSelector\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"ServiceButtonsContainer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"TimeBlockButtonsContainer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"DateSelectionButton\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"CurrentReferenceDate\", void 0);\n /**\n * This will be the current DateTime of the selected _office_ (from whatever service is selected)\n * and it is undefined if no service is yet selected.\n */\n _defineProperty(_assertThisInitialized(_this), \"TodaysDate\", void 0);\n _this.ComponentDto = componentDto;\n _this.Form = form;\n return _this;\n }\n _createClass(JobBookingWidgetComponent, [{\n key: \"Build\",\n value: function Build() {\n var _widgetTitleField$Opt,\n _widgetTitleField$Opt2,\n _serviceSectionTitleF,\n _serviceSectionTitleF2,\n _dateSectionTitleFiel,\n _dateSectionTitleFiel2,\n _timeSectionTitleFiel,\n _timeSectionTitleFiel2,\n _this2 = this;\n var template = document.createElement(\"div\");\n template.classList.add(\"form-component\");\n template.innerHTML = \"\\n
\\n
\\n
\\n
\\n
Book a Service
\\n
\\n
\\n
\\n
\\n
Select a Service
\\n
\\n \\n
\\n
\\n
\\n
Select a Date
\\n
\\n
\\n Click the button below to change the date selected.\\n
\\n
\\n Choose a service first\\n
\\n
\\n \\n
\\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n
\\n
Choose an Available Time
\\n
\\n \\n
\\n Choose a date first\\n
\\n
\\n No availability for the selected service and date.\\n
\\n
\\n \\n
\\n
\\n \\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n \";\n this.ServiceButtonsContainer = template.querySelector(\".service-button-container\");\n this.TimeBlockButtonsContainer = template.querySelector(\".time-block-selection\");\n this.DateSelectionButton = template.querySelector(\".date-selection .date-selection-button\");\n this.DateSelector = new DateTimePickerComponent().WithDatePicker([1, 2, 3, 4, 5, 6, 7]).Build();\n var widgetTitleField = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.BookingWidgetTitle;\n });\n var serviceSectionTitleField = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.BookingWidgetServiceLabel;\n });\n var dateSectionTitleField = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.BookingWidgetDateLabel;\n });\n var timeSectionTitleField = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.BookingWidgetTimeLabel;\n });\n var serviceDataField = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.BookingWidgetServicesData;\n });\n template.querySelector(\".job-booking-header .title\").textContent = (_widgetTitleField$Opt = (_widgetTitleField$Opt2 = widgetTitleField.Options.find(function (options) {\n return options.Option === FormFieldOptionType.Label;\n })) === null || _widgetTitleField$Opt2 === void 0 ? void 0 : _widgetTitleField$Opt2.Value) !== null && _widgetTitleField$Opt !== void 0 ? _widgetTitleField$Opt : \"\";\n template.querySelector(\".select-a-service-heading\").textContent = (_serviceSectionTitleF = (_serviceSectionTitleF2 = serviceSectionTitleField.Options.find(function (options) {\n return options.Option === FormFieldOptionType.Label;\n })) === null || _serviceSectionTitleF2 === void 0 ? void 0 : _serviceSectionTitleF2.Value) !== null && _serviceSectionTitleF !== void 0 ? _serviceSectionTitleF : \"\";\n template.querySelector(\".select-a-date-heading\").textContent = (_dateSectionTitleFiel = (_dateSectionTitleFiel2 = dateSectionTitleField.Options.find(function (options) {\n return options.Option === FormFieldOptionType.Label;\n })) === null || _dateSectionTitleFiel2 === void 0 ? void 0 : _dateSectionTitleFiel2.Value) !== null && _dateSectionTitleFiel !== void 0 ? _dateSectionTitleFiel : \"\";\n template.querySelector(\".choose-a-time-heading\").textContent = (_timeSectionTitleFiel = (_timeSectionTitleFiel2 = timeSectionTitleField.Options.find(function (options) {\n return options.Option === FormFieldOptionType.Label;\n })) === null || _timeSectionTitleFiel2 === void 0 ? void 0 : _timeSectionTitleFiel2.Value) !== null && _timeSectionTitleFiel !== void 0 ? _timeSectionTitleFiel : \"\";\n this.DateSelectionButton.addEventListener(\"click\", function () {\n _this2.OnMonthYearButtonClicked();\n });\n this.DateSelector.OnConfirmed(function () {\n if (_this2.DateSelector.IsDateTimeDisabled(_this2.DateSelector.GetCurrentDateTime())) {\n alert(\"That date is not available to be chosen.\");\n return;\n }\n _this2.LoadTimeBlocks();\n _this2.DateSelector.HideAll();\n });\n var serviceData = null;\n try {\n var _serviceDataField$Opt;\n serviceData = JSON.parse((_serviceDataField$Opt = serviceDataField.Options.find(function (option) {\n return option.Option === FormFieldOptionType.BookingWidgetServiceDataJSON;\n })) === null || _serviceDataField$Opt === void 0 ? void 0 : _serviceDataField$Opt.Value);\n } catch (jsonError) {}\n if (serviceData !== null) {\n this.ServiceData = serviceData;\n this.LoadServiceData();\n }\n this.DOM = template;\n return template;\n }\n }, {\n key: \"Render\",\n value: function Render() {\n this.Form.GetComponentsContainer().append(this.DOM);\n }\n /**\n * For this particular component - the JobBookingWidget - only one field is passed\n * and that field is the virtual field with the internal type fo the job booking widget.\n *\n * The value of this data will be solely information about the booking.\n * @returns\n */\n }, {\n key: \"GetAsPayload\",\n value: function GetAsPayload() {\n var _selectedService$Serv, _selectedTimeBlockBut, _selectedTimeBlockBut2;\n var fields = [];\n var selectedService = this.GetSelectedService();\n var selectedTimeBlockButton = this.GetSelectedTimeBlockButton();\n var submittedBookingData = {\n ServiceName: (_selectedService$Serv = selectedService === null || selectedService === void 0 ? void 0 : selectedService.ServiceName) !== null && _selectedService$Serv !== void 0 ? _selectedService$Serv : \"\",\n BookingStartDateTimeLocal: (_selectedTimeBlockBut = selectedTimeBlockButton === null || selectedTimeBlockButton === void 0 ? void 0 : selectedTimeBlockButton.getAttribute(\"data-start-datetime\")) !== null && _selectedTimeBlockBut !== void 0 ? _selectedTimeBlockBut : null,\n BookingEndDateTimeLocal: (_selectedTimeBlockBut2 = selectedTimeBlockButton === null || selectedTimeBlockButton === void 0 ? void 0 : selectedTimeBlockButton.getAttribute(\"data-end-datetime\")) !== null && _selectedTimeBlockBut2 !== void 0 ? _selectedTimeBlockBut2 : null\n };\n var serviceDataVirtualField = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.BookingWidgetServicesData;\n });\n fields.push({\n FieldId: serviceDataVirtualField.FieldId,\n Value: JSON.stringify(submittedBookingData)\n });\n return {\n ComponentType: FormComponentType.JobBookingWidget,\n Fields: fields\n };\n }\n /**\n * Loads the data about the services and times into the component.\n * When a service gets selected, information about availability for that office and team will be fetched\n * from the public-facing backend API\n * @returns\n */\n }, {\n key: \"LoadServiceData\",\n value: function LoadServiceData() {\n var _this3 = this;\n if (this.ServiceData === undefined) {\n return this;\n }\n // Load buttons\n var _iterator = _createForOfIteratorHelper(this.ServiceData.Services),\n _step;\n try {\n var _loop = function _loop() {\n var service = _step.value;\n var button = document.createElement(\"button\");\n button.type = \"button\";\n button.textContent = service.ServiceName;\n button.addEventListener(\"click\", function () {\n _this3.OnServiceButtonClicked(button);\n });\n _this3.ServiceButtonsContainer.append(button);\n };\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n _loop();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return this;\n }\n /**\n * Loads date buttons which are available for the parameters of the currently selected service.\n */\n }, {\n key: \"LoadDateSelection\",\n value: function () {\n var _LoadDateSelection = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var service, _yield$this$GetSelect, localReferenceDateTime, localNow, minDaysInAdvance, maxDaysInAdvance, endOfCurrentMonth, startOfCurrentMonth, minimumDate, currentReferenceDate, maxReferenceDate, weekdayIndicesOfficeIsClosed, _iterator2, _step2, dayHours, selectedDate;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n service = this.GetSelectedService();\n this.DOM.querySelector(\".month-year-selection-container\").style.display = \"none\";\n this.DOM.querySelector(\".date-selection-inactive-service\").style.display = \"none\";\n this.DOM.querySelector(\".date-selection-active-service\").style.display = null;\n this.DOM.querySelector(\".date-selection-loading\").style.display = null;\n this.DOM.querySelector(\".date-selection .section-helper-text .inner-text\").style.display = null;\n if (!(service !== null)) {\n _context.next = 47;\n break;\n }\n _context.next = 9;\n return this.GetCurrentDateTimeInSelectedOfficeTimeZone();\n case 9:\n localReferenceDateTime = _context.sent;\n localNow = this.TodaysDate;\n minDaysInAdvance = service.MinimumDaysOut;\n maxDaysInAdvance = service.MaximumDaysOut;\n endOfCurrentMonth = localReferenceDateTime.endOf(\"month\");\n startOfCurrentMonth = localReferenceDateTime.startOf(\"month\");\n minimumDate = localNow.plus({\n days: minDaysInAdvance\n });\n if (startOfCurrentMonth < minimumDate) {\n currentReferenceDate = minimumDate;\n } else {\n currentReferenceDate = startOfCurrentMonth;\n }\n if (maxDaysInAdvance > 0) {\n maxReferenceDate = localNow.plus({\n days: maxDaysInAdvance\n });\n }\n weekdayIndicesOfficeIsClosed = [];\n _context.t0 = _createForOfIteratorHelper;\n _context.next = 22;\n return this.GetSelectedOffice();\n case 22:\n _context.t2 = _yield$this$GetSelect = _context.sent;\n _context.t1 = _context.t2 === null;\n if (_context.t1) {\n _context.next = 26;\n break;\n }\n _context.t1 = _yield$this$GetSelect === void 0;\n case 26:\n if (!_context.t1) {\n _context.next = 30;\n break;\n }\n _context.t3 = void 0;\n _context.next = 31;\n break;\n case 30:\n _context.t3 = _yield$this$GetSelect.DailyHours;\n case 31:\n _context.t4 = _context.t3;\n _iterator2 = (0, _context.t0)(_context.t4);\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n dayHours = _step2.value;\n if (dayHours.IsClosed) {\n weekdayIndicesOfficeIsClosed.push(dayHours.Weekday);\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n this.DateSelector.WithDisabledWeekdays(weekdayIndicesOfficeIsClosed);\n this.DateSelector.WithMaximumDate(maxReferenceDate);\n this.DateSelector.WithMinimumDate(minimumDate);\n this.DateSelector.SetCurrentDate(currentReferenceDate.month, currentReferenceDate.day, currentReferenceDate.year);\n _context.t5 = this.DateSelector;\n _context.next = 41;\n return this.GetSelectedOfficeTimeZone();\n case 41:\n _context.t6 = _context.sent;\n _context.t5.SetCurrentTimeZone.call(_context.t5, _context.t6, true);\n this.DateSelector.ReloadCalendar();\n selectedDate = this.DateSelector.GetCurrentDateTime();\n this.DOM.querySelector(\".date-timezone-notice\").textContent = \"All dates and times are in \".concat(selectedDate.toFormat(\"ZZZZZ (ZZ)\"));\n this.DateSelectionButton.querySelector(\"span\").textContent = selectedDate.toFormat(\"DDDD\");\n case 47:\n this.DOM.querySelector(\".month-year-selection-container\").style.display = null;\n this.DOM.querySelector(\".date-selection-loading\").style.display = \"none\";\n return _context.abrupt(\"return\", this);\n case 50:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function LoadDateSelection() {\n return _LoadDateSelection.apply(this, arguments);\n }\n return LoadDateSelection;\n }()\n /**\n * Clears current time blocks and shows \"select a date first\" verbiage.\n */\n }, {\n key: \"ClearTimeBlocks\",\n value: function ClearTimeBlocks() {\n this.TimeBlockButtonsContainer.innerHTML = \"\";\n this.DOM.querySelector(\".time-selection-inactive-service\").style.display = null;\n this.DOM.querySelector(\".time-timezone-notice\").style.display = \"none\";\n this.DOM.querySelector(\".time-block-selection\").style.display = \"none\";\n this.DOM.querySelector(\".time-selection-no-availability\").style.display = \"none\";\n }\n /**\n * Fetches time block availability for the currently selected date and renders them into\n * the time block selection container.\n */\n }, {\n key: \"LoadTimeBlocks\",\n value: function () {\n var _LoadTimeBlocks = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _this4 = this;\n var availabilityDtos, _iterator3, _step3, _loop2;\n return _regeneratorRuntime().wrap(function _callee2$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n this.ClearTimeBlocks();\n this.DOM.querySelector(\".time-block-loader\").style.display = null;\n this.DOM.querySelector(\".time-selection-inactive-service\").style.display = \"none\";\n this.DateSelectionButton.querySelector(\"span\").textContent = this.DateSelector.GetCurrentDateTime().toFormat(\"DDDD\");\n _context3.next = 6;\n return this.FetchSelectedDateServiceAvailability();\n case 6:\n availabilityDtos = _context3.sent;\n this.DOM.querySelector(\".time-timezone-notice\").style.display = null;\n if (!(availabilityDtos !== undefined)) {\n _context3.next = 29;\n break;\n }\n if (!(availabilityDtos.length > 0)) {\n _context3.next = 28;\n break;\n }\n _iterator3 = _createForOfIteratorHelper(availabilityDtos);\n _context3.prev = 11;\n _loop2 = /*#__PURE__*/_regeneratorRuntime().mark(function _loop2() {\n var availabilityDto, officeTimeZone, startTime, endTime, button;\n return _regeneratorRuntime().wrap(function _loop2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n availabilityDto = _step3.value;\n _context2.next = 3;\n return _this4.GetSelectedOfficeTimeZone();\n case 3:\n officeTimeZone = _context2.sent;\n startTime = luxon.DateTime.fromJSDate(new Date(availabilityDto.TimeBlockStart)).setZone(officeTimeZone, {\n keepLocalTime: true\n });\n endTime = luxon.DateTime.fromJSDate(new Date(availabilityDto.TimeBlockEnd)).setZone(officeTimeZone, {\n keepLocalTime: true\n });\n button = document.createElement(\"button\");\n button.type = \"button\";\n button.textContent = \"\".concat(startTime.toFormat(\"hh:mma\"), \" - \").concat(endTime.toFormat(\"hh:mma\"));\n button.setAttribute(\"data-start-datetime\", startTime.toISO());\n button.setAttribute(\"data-end-datetime\", endTime.toISO());\n button.addEventListener(\"click\", function () {\n _this4.OnTimeBlockClicked(button);\n });\n _this4.TimeBlockButtonsContainer.append(button);\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }, _loop2);\n });\n _iterator3.s();\n case 14:\n if ((_step3 = _iterator3.n()).done) {\n _context3.next = 18;\n break;\n }\n return _context3.delegateYield(_loop2(), \"t0\", 16);\n case 16:\n _context3.next = 14;\n break;\n case 18:\n _context3.next = 23;\n break;\n case 20:\n _context3.prev = 20;\n _context3.t1 = _context3[\"catch\"](11);\n _iterator3.e(_context3.t1);\n case 23:\n _context3.prev = 23;\n _iterator3.f();\n return _context3.finish(23);\n case 26:\n _context3.next = 29;\n break;\n case 28:\n // No availability on this date\n this.DOM.querySelector(\".time-selection-no-availability\").style.display = null;\n case 29:\n this.DOM.querySelector(\".time-block-loader\").style.display = \"none\";\n this.DOM.querySelector(\".time-block-selection\").style.display = null;\n case 31:\n case \"end\":\n return _context3.stop();\n }\n }, _callee2, this, [[11, 20, 23, 26]]);\n }));\n function LoadTimeBlocks() {\n return _LoadTimeBlocks.apply(this, arguments);\n }\n return LoadTimeBlocks;\n }()\n /**\n * Returns the HTML button for a time block that is currently selected.\n * @returns\n */\n }, {\n key: \"GetSelectedTimeBlockButton\",\n value: function GetSelectedTimeBlockButton() {\n return this.TimeBlockButtonsContainer.querySelector(\"button.active\");\n }\n /**\n * Gets the ServiceName of the selected service\n */\n }, {\n key: \"GetSelectedServiceName\",\n value: function GetSelectedServiceName() {\n var selectedButton = this.ServiceButtonsContainer.querySelector(\".active\");\n if (selectedButton !== null) {\n return selectedButton.textContent;\n }\n return null;\n }\n /**\n * Gets the service that is currently selected\n * @returns\n */\n }, {\n key: \"GetSelectedService\",\n value: function GetSelectedService() {\n var selectedServiceName = this.GetSelectedServiceName();\n if (selectedServiceName !== null) {\n if (this.ServiceData !== undefined) {\n var selectedService = this.ServiceData.Services.find(function (service) {\n return service.ServiceName === selectedServiceName;\n });\n return selectedService !== null && selectedService !== void 0 ? selectedService : null;\n }\n }\n }\n /**\n * Gets the luxon.DateTime of the currently selected date for the booking.\n */\n }, {\n key: \"GetSelectedDate\",\n value: function GetSelectedDate() {\n if (this.CurrentReferenceDate === undefined) {\n return null;\n }\n return this.DateSelector.GetCurrentDateTime();\n }\n /**\n * Fetches the offices from the remote API if they're not already locally cached. If cached locally, returns that cache instead.\n * @returns\n */\n }, {\n key: \"GetOffices\",\n value: function () {\n var _GetOffices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var response, apiData;\n return _regeneratorRuntime().wrap(function _callee3$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(JobBookingWidgetComponent.CompanyOfficesCache === undefined)) {\n _context4.next = 12;\n break;\n }\n _context4.next = 3;\n return fetch(\"\".concat(\"https://forms.fbdash.com\", \"/forms/\").concat(this.Form.GetID(), \"/\").concat(this.Form.GetUUID(), \"/booking/offices\"));\n case 3:\n response = _context4.sent;\n if (!(response.status === 200)) {\n _context4.next = 11;\n break;\n }\n _context4.next = 7;\n return response.json();\n case 7:\n apiData = _context4.sent;\n JobBookingWidgetComponent.CompanyOfficesCache = apiData;\n _context4.next = 12;\n break;\n case 11:\n JobBookingWidgetComponent.CompanyOfficesCache = [];\n case 12:\n return _context4.abrupt(\"return\", JobBookingWidgetComponent.CompanyOfficesCache);\n case 13:\n case \"end\":\n return _context4.stop();\n }\n }, _callee3, this);\n }));\n function GetOffices() {\n return _GetOffices.apply(this, arguments);\n }\n return GetOffices;\n }()\n /**\n * Fetches the availability time blocks for the currently-selected service and currently-selected date.\n */\n }, {\n key: \"FetchSelectedDateServiceAvailability\",\n value: function () {\n var _FetchSelectedDateServiceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var selectedService, offices, selectedOffice, currentDateInOfficeTimeZone, serviceDataField, urlSearchParams, response, apiData;\n return _regeneratorRuntime().wrap(function _callee4$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n selectedService = this.GetSelectedService();\n _context5.next = 3;\n return this.GetOffices();\n case 3:\n offices = _context5.sent;\n selectedOffice = offices.find(function (office) {\n return office.Id == selectedService.OfficeId;\n });\n if (!(selectedOffice !== undefined)) {\n _context5.next = 18;\n break;\n }\n currentDateInOfficeTimeZone = this.GetSelectedDate(); // Show the user what timezone the times are in\n this.DOM.querySelector(\".time-timezone-notice\").textContent = \"All dates and times are in \".concat(currentDateInOfficeTimeZone.toFormat(\"ZZZZZ (ZZ)\"));\n serviceDataField = this.ComponentDto.Fields.find(function (fieldDto) {\n return fieldDto.InternalFieldId === FormFieldInternalId.BookingWidgetServicesData;\n });\n urlSearchParams = new URLSearchParams({\n dateInOfficeLocalTimeZone: currentDateInOfficeTimeZone.toFormat(\"yyyy-MM-dd\"),\n formComponentId: this.ComponentDto.Id.toString(),\n formComponentFieldId: serviceDataField.FieldId.toString(),\n bookingWidgetServiceName: selectedService.ServiceName\n });\n _context5.next = 12;\n return fetch(\"\".concat(\"https://forms.fbdash.com\", \"/forms/\").concat(this.Form.GetID(), \"/\").concat(this.Form.GetUUID(), \"/booking/offices/\").concat(selectedOffice.Id, \"/\").concat(selectedService.TeamId, \"/availability?\").concat(urlSearchParams));\n case 12:\n response = _context5.sent;\n if (!(response.status === 200)) {\n _context5.next = 18;\n break;\n }\n _context5.next = 16;\n return response.json();\n case 16:\n apiData = _context5.sent;\n return _context5.abrupt(\"return\", apiData);\n case 18:\n case \"end\":\n return _context5.stop();\n }\n }, _callee4, this);\n }));\n function FetchSelectedDateServiceAvailability() {\n return _FetchSelectedDateServiceAvailability.apply(this, arguments);\n }\n return FetchSelectedDateServiceAvailability;\n }()\n /**\n * Gets the currently selected office (from the currently selected service).\n */\n }, {\n key: \"GetSelectedOffice\",\n value: function () {\n var _GetSelectedOffice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var service, offices, selectedOffice;\n return _regeneratorRuntime().wrap(function _callee5$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n service = this.GetSelectedService();\n _context6.next = 3;\n return this.GetOffices();\n case 3:\n offices = _context6.sent;\n if (!(service === null)) {\n _context6.next = 6;\n break;\n }\n return _context6.abrupt(\"return\", null);\n case 6:\n selectedOffice = offices.find(function (office) {\n return office.Id == service.OfficeId;\n });\n return _context6.abrupt(\"return\", selectedOffice);\n case 8:\n case \"end\":\n return _context6.stop();\n }\n }, _callee5, this);\n }));\n function GetSelectedOffice() {\n return _GetSelectedOffice.apply(this, arguments);\n }\n return GetSelectedOffice;\n }()\n /**\n * Gets the IANA TimeZone name of the currently selected office, or null if there is\n * no service/office selected.\n * @returns\n */\n }, {\n key: \"GetSelectedOfficeTimeZone\",\n value: function () {\n var _GetSelectedOfficeTimeZone = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n var selectedOffice, ianaTimeZone;\n return _regeneratorRuntime().wrap(function _callee6$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return this.GetSelectedOffice();\n case 2:\n selectedOffice = _context7.sent;\n ianaTimeZone = selectedOffice.TimeZone;\n return _context7.abrupt(\"return\", ianaTimeZone);\n case 5:\n case \"end\":\n return _context7.stop();\n }\n }, _callee6, this);\n }));\n function GetSelectedOfficeTimeZone() {\n return _GetSelectedOfficeTimeZone.apply(this, arguments);\n }\n return GetSelectedOfficeTimeZone;\n }()\n /**\n * Fetches the current local DateTime for the timezone of the currently selected service's office - or null.\n * @returns\n */\n }, {\n key: \"GetCurrentDateTimeInSelectedOfficeTimeZone\",\n value: function () {\n var _GetCurrentDateTimeInSelectedOfficeTimeZone = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n var ianaTimeZone;\n return _regeneratorRuntime().wrap(function _callee7$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.next = 2;\n return this.GetSelectedOfficeTimeZone();\n case 2:\n ianaTimeZone = _context8.sent;\n if (!(ianaTimeZone !== null)) {\n _context8.next = 9;\n break;\n }\n if (this.TodaysDate === undefined) {\n this.TodaysDate = luxon.DateTime.fromISO(luxon.DateTime.now().toISO(), {\n zone: ianaTimeZone\n });\n }\n if (this.CurrentReferenceDate === undefined) {\n this.CurrentReferenceDate = luxon.DateTime.fromISO(luxon.DateTime.now().toISO(), {\n zone: ianaTimeZone\n });\n }\n return _context8.abrupt(\"return\", this.CurrentReferenceDate);\n case 9:\n return _context8.abrupt(\"return\", null);\n case 10:\n case \"end\":\n return _context8.stop();\n }\n }, _callee7, this);\n }));\n function GetCurrentDateTimeInSelectedOfficeTimeZone() {\n return _GetCurrentDateTimeInSelectedOfficeTimeZone.apply(this, arguments);\n }\n return GetCurrentDateTimeInSelectedOfficeTimeZone;\n }()\n /**\n * When a service button is clicked. This will load available dates for that service into buttons.\n * @param button\n */\n }, {\n key: \"OnServiceButtonClicked\",\n value: function OnServiceButtonClicked(button) {\n this.DOM.querySelector(\".time-selection-inactive-service\").style.display = null;\n this.DOM.querySelector(\".time-timezone-notice\").style.display = \"none\";\n this.DOM.querySelector(\".date-timezone-notice\").style.display = null;\n this.DOM.querySelector(\".time-block-selection\").style.display = \"none\";\n this.DOM.querySelector(\".time-selection-no-availability\").style.display = \"none\";\n var selectedButton = this.ServiceButtonsContainer.querySelector(\".active\");\n if (selectedButton !== null && selectedButton !== button) {\n selectedButton.classList.remove(\"active\");\n }\n button.classList.add(\"active\");\n this.LoadDateSelection();\n }\n /**\n * Selects a time block button.\n * @param button\n */\n }, {\n key: \"OnTimeBlockClicked\",\n value: function OnTimeBlockClicked(button) {\n var selectedButton = this.TimeBlockButtonsContainer.querySelector(\".active\");\n if (selectedButton !== null && selectedButton !== button) {\n selectedButton.classList.remove(\"active\");\n }\n button.classList.add(\"active\");\n }\n }, {\n key: \"OnIncrementMonthClicked\",\n value: function OnIncrementMonthClicked() {\n // Increment the reference date's month by 1, then reload the day buttons\n // Deselect time blocks\n this.ClearTimeBlocks();\n this.CurrentReferenceDate = this.CurrentReferenceDate.plus({\n month: 1\n });\n this.LoadDateSelection();\n }\n }, {\n key: \"OnDecrementMonthClicked\",\n value: function OnDecrementMonthClicked() {\n this.ClearTimeBlocks();\n this.CurrentReferenceDate = this.CurrentReferenceDate.minus({\n month: 1\n });\n this.LoadDateSelection();\n }\n }, {\n key: \"OnMonthYearButtonClicked\",\n value: function OnMonthYearButtonClicked() {\n this.DateSelector.Show();\n }\n }]);\n return JobBookingWidgetComponent;\n}(RenderedFormComponent);\n_defineProperty(JobBookingWidgetComponent, \"CompanyOfficesCache\", void 0);", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == typeof value && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, \"throw\" === methodName && delegate.iterator.return && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method) || \"return\" !== methodName && (context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a '\" + methodName + \"' method\")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { FormComponentType } from \"../../../../Enums/Client/Dashboard/Form/FormComponentType.js\";\nimport { ThemeMap } from \"../../ThemeMap.js\";\nimport { AddressComponent } from \"./FormComponents/AddressComponent.js\";\nimport { CheckboxesComponent } from \"./FormComponents/CheckboxesComponent.js\";\nimport { DropdownComponent } from \"./FormComponents/DropdownComponent.js\";\nimport { EmailComponent } from \"./FormComponents/EmailComponent.js\";\nimport { InputComponent } from \"./FormComponents/InputComponent.js\";\nimport { NameComponent } from \"./FormComponents/NameComponent.js\";\nimport { PhoneNumberComponent } from \"./FormComponents/PhoneNumberComponent.js\";\nimport { RadiosComponent } from \"./FormComponents/RadiosComponent.js\";\nimport { SectionBreakComponent } from \"./FormComponents/SectionBreakComponent.js\";\nimport { TextBlockComponent } from \"./FormComponents/TextBlockComponent.js\";\nimport { TextareaComponent } from \"./FormComponents/TextareaComponent.js\";\nimport { JobBookingWidgetComponent } from \"./FormComponents/JobBookingWidgetComponent.js\";\nimport { FormFieldOptionType } from \"../../../../Enums/Client/Dashboard/Form/FormFieldOptionType.js\";\nexport var Form = /*#__PURE__*/function () {\n /**\n * Constructs a new Form object within the provided container. Additionally, the form itself is fetched\n * from the Footbridge Media Dashboard based on the form's attributes: data-fbm-crm-form-id and data-fbm-crm-form-uuid\n * @param container\n */\n function Form(container) {\n _classCallCheck(this, Form);\n _defineProperty(this, \"IsFetchingData\", false);\n _defineProperty(this, \"IsSubmitting\", false);\n _defineProperty(this, \"Id\", void 0);\n _defineProperty(this, \"UUID\", void 0);\n _defineProperty(this, \"FormDto\", void 0);\n _defineProperty(this, \"Container\", void 0);\n _defineProperty(this, \"DOM\", void 0);\n _defineProperty(this, \"FormElement\", void 0);\n _defineProperty(this, \"ComponentsContainer\", void 0);\n _defineProperty(this, \"ErrorContainer\", void 0);\n _defineProperty(this, \"ErrorMessageContainer\", void 0);\n _defineProperty(this, \"AfterSubmitContainer\", void 0);\n _defineProperty(this, \"AfterSubmitMessageContainer\", void 0);\n /**\n * The components that have been rendered. Used in iteration that packages them into payloads\n * after submission.\n */\n _defineProperty(this, \"RenderedComponents\", []);\n _defineProperty(this, \"IsStyleSheetEnabled\", true);\n // Fetch required data\n var id = parseInt(container.getAttribute(\"data-fbm-crm-form-id\"));\n var uuid = container.getAttribute(\"data-fbm-crm-form-uuid\");\n if (isNaN(id)) {\n // Console logging is intentional to let a debugging user know which element we're referring to\n console.log(container);\n throw \"Form must have a valid data-fbm-crm-form-id attribute.\";\n }\n if (uuid === null || uuid.trim() === \"\") {\n // Console logging is intentional to let a debugging user know which element we're referring to\n console.log(container);\n throw \"Form must have a valid data-fbm-crm-form-uuid attribute.\";\n }\n this.Id = id;\n this.UUID = uuid;\n this.Container = container;\n }\n _createClass(Form, [{\n key: \"GetID\",\n value: function GetID() {\n return this.Id;\n }\n }, {\n key: \"GetUUID\",\n value: function GetUUID() {\n return this.UUID;\n }\n /**\n * Toggles loading and injecting the form's stylesheet set on the form server.\n */\n }, {\n key: \"SetStylesheetLoading\",\n value: function SetStylesheetLoading(flag) {\n this.IsStyleSheetEnabled = flag;\n return this;\n }\n /**\n * Fetch's the form's Dto object from the FBM dashboard API. Checks the local cache of Dtos first.\n * @returns\n */\n }, {\n key: \"FetchFormFromFootbridgeMediaDashboard\",\n value: function () {\n var _FetchFormFromFootbridgeMediaDashboard = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var cachedDto, response, formDto, apiData;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!this.IsFetchingData) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\");\n case 2:\n cachedDto = Form.GetDtoFromCache(this.Id);\n if (!(cachedDto !== null)) {\n _context.next = 6;\n break;\n }\n this.FormDto = cachedDto;\n return _context.abrupt(\"return\", cachedDto);\n case 6:\n this.IsFetchingData = true;\n _context.next = 9;\n return fetch(\"\".concat(\"https://forms.fbdash.com\", \"/forms/get/\").concat(this.Id, \"/\").concat(this.UUID));\n case 9:\n response = _context.sent;\n if (!(response.status === 200)) {\n _context.next = 19;\n break;\n }\n _context.next = 13;\n return response.json();\n case 13:\n formDto = _context.sent;\n this.FormDto = formDto;\n // Cache it\n Form.CachedFormDtos[this.Id] = formDto;\n return _context.abrupt(\"return\", formDto);\n case 19:\n if (!(response.status === 400)) {\n _context.next = 40;\n break;\n }\n _context.prev = 20;\n _context.next = 23;\n return response.json();\n case 23:\n apiData = _context.sent;\n _context.next = 29;\n break;\n case 26:\n _context.prev = 26;\n _context.t0 = _context[\"catch\"](20);\n throw \"Received an unknown error from the FBM Dashboard API.\";\n case 29:\n if (!(\"detail\" in apiData)) {\n _context.next = 33;\n break;\n }\n throw apiData.detail;\n case 33:\n if (!(\"title\" in apiData)) {\n _context.next = 37;\n break;\n }\n throw apiData.title;\n case 37:\n throw apiData;\n case 38:\n _context.next = 41;\n break;\n case 40:\n throw \"Failed fetching the form from the FBM Dashboard API.\";\n case 41:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[20, 26]]);\n }));\n function FetchFormFromFootbridgeMediaDashboard() {\n return _FetchFormFromFootbridgeMediaDashboard.apply(this, arguments);\n }\n return FetchFormFromFootbridgeMediaDashboard;\n }()\n /**\n * Builds the form and all its components.\n * @returns\n */\n }, {\n key: \"Build\",\n value: function () {\n var _Build = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _this = this;\n var template, classes, _iterator, _step, additionalClass, needsLuxon, _iterator2, _step2, component, renderedComponent, _classes, _iterator4, _step4, _additionalClass, componentDOM, allInputElements, allTextAreaElements, allSelectElements, allFormControls, _iterator3, _step3, formControl;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!(this.DOM !== undefined)) {\n _context2.next = 2;\n break;\n }\n throw \"Cannot call Build() on a form that has already been built.\";\n case 2:\n template = document.createElement(\"div\");\n template.classList.add(\"fbm-rendered-form-container\");\n template.innerHTML = \"\\n \\n