\n
\n
\n \n ${this.numberCheckedText()}\n ${this.choicesText()}\n
\n \n
\n `;\n }\n /* eslint-disable @typescript-eslint/no-explicit-any */\n firstUpdated(_changedProperties) {\n this.countChecked();\n }\n updated() {\n this.toggleEnabled();\n }\n countChecked() {\n this.numberChecked = this.checkedCheckboxes().length;\n }\n toggleEnabled() {\n this.collectTimeRanges();\n if (this.maxChoices !== null && this.numberChecked >= this.maxChoices) {\n this.unCheckedCheckboxes().forEach(c => this.disableCheckbox(c));\n }\n else {\n this.unCheckedCheckboxes().forEach(c => this.overlaps(c) ? this.disableOverlappingCheckbox(c) : this.enableCheckbox(c));\n }\n }\n disableCheckbox(cb) {\n cb.disabled = true;\n }\n enableCheckbox(cb) {\n var _a;\n cb.disabled = false;\n (_a = cb.parentElement) === null || _a === void 0 ? void 0 : _a.removeAttribute(\"title\");\n }\n disableOverlappingCheckbox(cb) {\n cb.disabled = true;\n if (this.overlapTitle && cb.parentElement !== null) {\n cb.parentElement.title = this.overlapTitle;\n }\n }\n checkedCheckboxes() {\n return this.assignedDescendants(\"input[type=checkbox]:checked\");\n }\n unCheckedCheckboxes() {\n return this.assignedDescendants(\"input[type=checkbox]:not(:checked):not([data-disabled])\");\n }\n collectTimeRanges() {\n this._selectedTimeRanges = this.checkedCheckboxes().map(elementTimeRange).filter((c) => c !== undefined);\n }\n overlaps(checkbox) {\n const elementRange = elementTimeRange(checkbox);\n if (elementRange === undefined) {\n return false;\n }\n return this._selectedTimeRanges.some(range => timeRangesOverlap(range, elementRange));\n }\n assignedDescendants(selector) {\n return this._assignedElements.reduce((matches, element) => {\n if (element.matches(selector)) {\n matches.push(element);\n }\n const descendents = element.querySelectorAll(selector);\n if (descendents.length > 0) {\n const descendentElements = Array.from(descendents);\n matches.push(...descendentElements);\n }\n return matches;\n }, []);\n }\n choicesText() {\n return this.maxChoices !== null ? `Max choices ${this.maxChoices}` : null;\n }\n numberCheckedText() {\n switch (this.numberChecked) {\n case 1:\n return \"1 choice selected\";\n case null:\n return \"0 choices selected\";\n default:\n return `${this.numberChecked} choices selected`;\n }\n }\n};\nGrCheckList.styles = css `\n .info {\n color: red;\n }\n `;\n__decorate([\n property({ type: Number, attribute: 'min-choices' })\n], GrCheckList.prototype, \"minChoices\", void 0);\n__decorate([\n property({ type: Number, attribute: 'max-choices' })\n], GrCheckList.prototype, \"maxChoices\", void 0);\n__decorate([\n property({ type: Number, attribute: false })\n], GrCheckList.prototype, \"numberChecked\", void 0);\n__decorate([\n property({ type: String, attribute: \"overlap-title\" })\n], GrCheckList.prototype, \"overlapTitle\", void 0);\n__decorate([\n queryAssignedElements()\n], GrCheckList.prototype, \"_assignedElements\", void 0);\n__decorate([\n queryAssignedNodes()\n], GrCheckList.prototype, \"_assignedNodes\", void 0);\n__decorate([\n queryAssignedNodes()\n], GrCheckList.prototype, \"_flatNodes\", void 0);\nGrCheckList = __decorate([\n customElement(\"gr-check-list\")\n], GrCheckList);\nexport { GrCheckList };\n//# sourceMappingURL=gr-check-list.js.map","/*!\nTurbo 8.0.4\nCopyright © 2024 37signals LLC\n */\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2019 Javan Makhmali\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n(function (prototype) {\n if (typeof prototype.requestSubmit == \"function\") return\n\n prototype.requestSubmit = function (submitter) {\n if (submitter) {\n validateSubmitter(submitter, this);\n submitter.click();\n } else {\n submitter = document.createElement(\"input\");\n submitter.type = \"submit\";\n submitter.hidden = true;\n this.appendChild(submitter);\n submitter.click();\n this.removeChild(submitter);\n }\n };\n\n function validateSubmitter(submitter, form) {\n submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\");\n submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\");\n submitter.form == form ||\n raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\");\n }\n\n function raise(errorConstructor, message, name) {\n throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name)\n }\n})(HTMLFormElement.prototype);\n\nconst submittersByForm = new WeakMap();\n\nfunction findSubmitterFromClickTarget(target) {\n const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n const candidate = element ? element.closest(\"input, button\") : null;\n return candidate?.type == \"submit\" ? candidate : null\n}\n\nfunction clickCaptured(event) {\n const submitter = findSubmitterFromClickTarget(event.target);\n\n if (submitter && submitter.form) {\n submittersByForm.set(submitter.form, submitter);\n }\n}\n\n(function () {\n if (\"submitter\" in Event.prototype) return\n\n let prototype = window.Event.prototype;\n // Certain versions of Safari 15 have a bug where they won't\n // populate the submitter. This hurts TurboDrive's enable/disable detection.\n // See https://bugs.webkit.org/show_bug.cgi?id=229660\n if (\"SubmitEvent\" in window) {\n const prototypeOfSubmitEvent = window.SubmitEvent.prototype;\n\n if (/Apple Computer/.test(navigator.vendor) && !(\"submitter\" in prototypeOfSubmitEvent)) {\n prototype = prototypeOfSubmitEvent;\n } else {\n return // polyfill not needed\n }\n }\n\n addEventListener(\"click\", clickCaptured, true);\n\n Object.defineProperty(prototype, \"submitter\", {\n get() {\n if (this.type == \"submit\" && this.target instanceof HTMLFormElement) {\n return submittersByForm.get(this.target)\n }\n }\n });\n})();\n\nconst FrameLoadingStyle = {\n eager: \"eager\",\n lazy: \"lazy\"\n};\n\n/**\n * Contains a fragment of HTML which is updated based on navigation within\n * it (e.g. via links or form submissions).\n *\n * @customElement turbo-frame\n * @example\n *