@citolab/qti-components 7.0.1 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +8297 -0
- package/dist/custom-elements.json +27271 -0
- package/dist/{qti-test/index.d.ts → index.d.ts} +170 -4
- package/dist/index.js +17164 -0
- package/dist/index.js.map +1 -0
- package/dist/item.css +257 -46
- package/dist/{qti-loader → loader}/index.d.ts +1 -1
- package/dist/qti-components-jsx.d.ts +33 -61
- package/dist/{qti-simple-choice-CynLWb8d.d.cts → qti-simple-choice-UTrFa_RQ.d.ts} +11 -19
- package/dist/vscode.html-custom-data.json +15 -11
- package/package.json +41 -58
- package/readme.md +55 -0
- package/README.md +0 -85
- package/cdn/index.min.cjs +0 -4489
- package/cdn/index.min.js +0 -4489
- package/dist/qti-components/index.cjs +0 -6704
- package/dist/qti-components/index.cjs.map +0 -1
- package/dist/qti-components/index.d.cts +0 -150
- package/dist/qti-components/index.d.ts +0 -150
- package/dist/qti-components/index.js +0 -6593
- package/dist/qti-components/index.js.map +0 -1
- package/dist/qti-item/index.cjs +0 -89
- package/dist/qti-item/index.cjs.map +0 -1
- package/dist/qti-item/index.d.cts +0 -24
- package/dist/qti-item/index.d.ts +0 -24
- package/dist/qti-item/index.js +0 -65
- package/dist/qti-item/index.js.map +0 -1
- package/dist/qti-loader/index.cjs +0 -332
- package/dist/qti-loader/index.cjs.map +0 -1
- package/dist/qti-loader/index.d.cts +0 -20
- package/dist/qti-simple-choice-CynLWb8d.d.ts +0 -1185
- package/dist/qti-test/index.cjs +0 -4632
- package/dist/qti-test/index.cjs.map +0 -1
- package/dist/qti-test/index.d.cts +0 -304
- package/dist/qti-test/index.js +0 -4599
- package/dist/qti-test/index.js.map +0 -1
- package/dist/qti-transformers/index.cjs +0 -316
- package/dist/qti-transformers/index.cjs.map +0 -1
- package/dist/qti-transformers/index.d.cts +0 -75
- /package/dist/{qti-loader → loader}/index.js +0 -0
- /package/dist/{qti-loader → loader}/index.js.map +0 -0
- /package/dist/{qti-transformers → transformers}/index.d.ts +0 -0
- /package/dist/{qti-transformers → transformers}/index.js +0 -0
- /package/dist/{qti-transformers → transformers}/index.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/@lit/context/src/lib/context-request-event.ts","../node_modules/@lit/context/src/lib/create-context.ts","../node_modules/@lit/context/src/lib/controllers/context-consumer.ts","../node_modules/@lit/context/src/lib/value-notifier.ts","../node_modules/@lit/context/src/lib/controllers/context-provider.ts","../node_modules/@lit/context/src/lib/decorators/provide.ts","../node_modules/@lit/context/src/lib/decorators/consume.ts","../node_modules/@lit-labs/ssr-dom-shim/src/lib/element-internals.ts","../node_modules/@lit-labs/ssr-dom-shim/src/index.ts","../node_modules/@lit/reactive-element/src/css-tag.ts","../node_modules/@lit/reactive-element/src/reactive-element.ts","../node_modules/lit-html/src/lit-html.ts","../node_modules/lit-element/src/lit-element.ts","../node_modules/@lit/reactive-element/src/decorators/custom-element.ts","../node_modules/@lit/reactive-element/src/decorators/property.ts","../node_modules/@lit/reactive-element/src/decorators/state.ts","../node_modules/@lit/reactive-element/src/decorators/base.ts","../node_modules/@lit/reactive-element/src/decorators/query.ts","../node_modules/@lit/reactive-element/src/decorators/query-assigned-elements.ts","../src/lib/qti-test/context/test.context.ts","../src/lib/qti-test/qti-assessment-test/qti-assessment-item-ref.ts","../src/lib/qti-test/qti-assessment-test/qti-assessment-section.ts","../src/lib/qti-test/qti-assessment-test/qti-assessment-test.ts","../src/lib/qti-test/qti-assessment-test/qti-test-part.ts","../src/lib/qti-transformers/qti-transformers.ts","../src/lib/qti-transformers/qti-transform-item.ts","../src/lib/qti-transformers/qti-transform-test.ts","../src/lib/qti-test/mixins/test-loader.mixin.ts","../src/lib/qti-test/mixins/test-navigation.mixin.ts","../src/lib/qti-test/mixins/test-view.mixin.ts","../src/lib/qti-test/test-base.ts","../src/lib/qti-test/qti-test.ts","../src/lib/qti-test/components/styles.ts","../src/lib/decorators/live-query.ts","../src/lib/decorators/watch.ts","../src/lib/decorators/prop-internal-state.ts","../src/lib/qti-test/components/test-component.abstract.ts","../src/lib/qti-test/components/test-next.ts","../src/lib/qti-test/components/test-prev.ts","../src/lib/qti-test/components/test-view.ts","../src/lib/qti-test/components/test-item-link.ts","../node_modules/lit-html/src/directive-helpers.ts","../node_modules/lit-html/src/directive.ts","../node_modules/lit-html/src/async-directive.ts","../node_modules/lit-html/src/directives/private-async-helpers.ts","../node_modules/lit-html/src/directives/until.ts","inline:../../../item.css?inline","../src/lib/qti-test/components/test-container.ts","../node_modules/jexpr/src/lib/constants.ts","../node_modules/jexpr/src/lib/tokenizer.ts","../node_modules/jexpr/src/lib/parser.ts","../node_modules/jexpr/src/lib/eval.ts","../node_modules/lit-html/src/private-ssr-support.ts","../node_modules/stampino/src/stampino.ts","../src/lib/qti-test/components/test-paging-buttons-stamp.ts","../src/lib/qti-item/qti-item.mixin.ts","inline:../../item.css?inline","../src/lib/qti-item/qti-item.ts","../src/lib/qti-components/qti-assessment-item/qti-assessment-item.context.ts","../src/lib/qti-components/qti-assessment-item/qti-assessment-item.ts","../src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts","../src/lib/qti-components/qti-interaction/internal/active-element/active-element.mixin.ts","../src/lib/qti-components/qti-item-body/qti-item-body.styles.ts","../src/lib/qti-components/qti-item-body/qti-item-body.ts","../src/lib/qti-components/qti-prompt/qti-prompt.ts","../src/lib/qti-components/qti-stylesheet/qti-stylesheet.ts","../src/lib/qti-components/qti-variable-declaration/qti-variable-declaration.ts","../src/lib/qti-components/qti-variable-declaration/qti-outcome-declaration/qti-outcome-declaration.ts","../src/lib/qti-components/qti-variable-declaration/qti-response-declaration/qti-response-declaration.ts","../src/lib/qti-components/qti-companion-materials-info/qti-companion-materials-info.ts","../src/lib/qti-components/qti-rubric-block/qti-content-body.ts","../src/lib/qti-components/qti-rubric-block/qti-rubric-block.ts","../src/lib/qti-components/internal/utils.ts","../src/lib/qti-components/qti-feedback/qti-feedback.ts","../src/lib/qti-components/qti-feedback/qti-feedback-block/qti-feedback-block.ts","../src/lib/qti-components/qti-feedback/qti-feedback-inline/qti-feedback-inline.ts","../src/lib/qti-components/qti-feedback/qti-modal-feedback/qti-modal-feedback.ts","../node_modules/lit-html/src/directives/if-defined.ts","../src/lib/qti-components/qti-interaction/internal/interaction/interaction.ts","../src/lib/qti-components/qti-interaction/qti-extended-text-interaction/qti-extended-text-interaction.ts","../node_modules/lit-html/src/directives/ref.ts","../src/lib/qti-components/qti-interaction/qti-text-entry-interaction/qti-text-entry-interaction.styles.ts","../src/lib/qti-components/qti-interaction/qti-text-entry-interaction/qti-text-entry-interaction.ts","../src/lib/qti-components/qti-interaction/internal/choices/choices.mixin.ts","../src/lib/qti-components/qti-interaction/qti-hottext-interaction/qti-hottext-interaction.ts","../node_modules/lit-html/src/directives/unsafe-html.ts","../src/lib/qti-components/qti-interaction/qti-inline-choice-interaction/qti-inline-choice-interaction.ts","../src/lib/qti-components/qti-interaction/internal/shuffle/shuffle-mixin.ts","../src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts","../src/lib/qti-components/qti-interaction/qti-choice-interaction/qti-choice-interaction.styles.ts","../src/lib/qti-components/qti-interaction/qti-choice-interaction/qti-choice-interaction.ts","../src/lib/qti-components/qti-outcome-processing/qti-outcome-processing.ts","../src/lib/qti-components/internal/template-strings.ts","../src/lib/qti-components/qti-response-processing/qti-response-processing/qti-response-processing.ts","../src/lib/qti-components/qti-response-processing/qti-rule/qti-rule.ts","../src/lib/qti-components/qti-response-processing/qti-rule/qti-lookup-outcome-value/qti-lookup-outcome-value.ts","../src/lib/qti-components/qti-response-processing/qti-rule/qti-response-condition/qti-response-condition.ts","../src/lib/qti-components/qti-response-processing/qti-rule/qti-set-outcome-value/qti-set-outcome-value.ts","../src/lib/qti-components/qti-response-processing/qti-response-else/qti-response-else.ts","../src/lib/qti-components/qti-response-processing/qti-response-else/qti-response-if/qti-response-if.ts","../src/lib/qti-components/qti-response-processing/qti-response-else/qti-response-if/qti-response-else-if/qti-response-else-if.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-expression.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-condition-expression.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-and/qti-and.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-and/index.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-basevalue/qti-basevalue.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-contains/qti-contains.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-correct/qti-correct.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-equal-rounded/qti-equal-rounded.ts","../src/lib/qti-components/qti-response-processing/utilities/scoring-helper.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-equal/qti-equal.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-gt/qti-gt.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-gte/qti-gte.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-is-null/qti-is-null.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-lt/qti-lt.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-lte/qti-lte.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-map-response/qti-map-response.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-mapping/qti-mapping.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-match/qti-match.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-member/qti-member.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-multiple/qti-multiple.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-not/qti-not.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-or/qti-or.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-ordered/qti-ordered.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-printed-variable/qti-printed-variable.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-product/qti-product.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-subtract/qti-subtract.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-subtract/index.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-string-match/qti-string-match.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-sum/qti-sum.ts","../src/lib/qti-components/qti-response-processing/qti-expression/qti-variable/qti-variable.ts","../src/lib/qti-components/qti-interaction/qti-portable-custom-interaction/qti-portable-custom-interaction.ts","../src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-api.ts","../src/lib/qti-components/qti-interaction/internal/drag-drop/droppables-mixin.ts","../src/lib/qti-components/qti-interaction/internal/drag-drop/flippables-mixin.ts","../src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts","../src/lib/qti-components/qti-interaction/qti-associate-interaction/qti-associate-interaction.styles.ts","../src/lib/qti-components/qti-interaction/qti-associate-interaction/qti-associate-interaction.ts","../src/lib/qti-components/qti-interaction/qti-custom-interaction/qti-custom-interaction.ts","../src/lib/qti-components/qti-interaction/qti-end-attempt-interaction/qti-end-attempt-interaction.ts","../src/lib/qti-components/qti-interaction/qti-gap-match-interaction/qti-gap-match-interaction.styles.ts","../src/lib/qti-components/qti-interaction/qti-gap-match-interaction/qti-gap-match-interaction.ts","../node_modules/lit-html/src/directives/repeat.ts","../src/lib/qti-components/qti-interaction/internal/hotspots/hotspot.ts","../src/lib/qti-components/qti-interaction/qti-graphic-associate-interaction/qti-graphic-associate-interaction.ts","../src/lib/qti-components/qti-interaction/qti-graphic-gap-match-interaction/qti-graphic-gap-match-interaction.styles.ts","../src/lib/qti-components/qti-interaction/qti-graphic-gap-match-interaction/qti-graphic-gap-match-interaction.ts","../src/lib/qti-components/qti-interaction/qti-graphic-order-interaction/qti-graphic-order-interaction.ts","../src/lib/qti-components/qti-interaction/qti-hotspot-interaction/qti-hotspot-interaction.ts","../src/lib/qti-components/qti-interaction/qti-simple-associable-choice.ts","../src/lib/qti-components/qti-interaction/qti-match-interaction/qti-match-interaction.styles.ts","../src/lib/qti-components/qti-interaction/qti-match-interaction/qti-match-interaction.ts","../src/lib/qti-components/qti-interaction/qti-media-interaction/qti-media-interaction.ts","../src/lib/qti-components/qti-interaction/qti-order-interaction/qti-order-interaction.styles.ts","../src/lib/qti-components/qti-interaction/qti-order-interaction/qti-order-interaction.ts","../src/lib/qti-components/qti-interaction/qti-position-object-interaction/qti-position-object-interaction.ts","../src/lib/qti-components/qti-interaction/qti-position-object-interaction/qti-position-object-stage.ts","../node_modules/lit-html/src/directives/style-map.ts","../src/lib/qti-components/qti-interaction/qti-select-point-interaction/qti-select-point-interaction.ts","../src/lib/qti-components/qti-interaction/qti-slider-interaction/qti-slider-interaction.ts","../src/lib/qti-components/qti-custom-operator/qti-custom-operator.ts","../src/lib/qti-components/qti-interaction/qti-associable-hotspot.ts","../src/lib/qti-components/qti-interaction/qti-gap.ts","../src/lib/qti-components/qti-interaction/qti-gap-img.ts","../src/lib/qti-components/qti-interaction/qti-gap-text.ts","../src/lib/qti-components/qti-interaction/qti-hotspot-choice.ts","../src/lib/qti-components/qti-interaction/qti-hottext.ts","../src/lib/qti-components/qti-interaction/qti-inline-choice.ts","../src/lib/qti-components/qti-interaction/qti-simple-choice.ts","../src/lib/qti-components/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ContextType, Context} from './create-context.js';\n\ndeclare global {\n interface HTMLElementEventMap {\n /**\n * A 'context-request' event can be emitted by any element which desires\n * a context value to be injected by an external provider.\n */\n 'context-request': ContextRequestEvent<Context<unknown, unknown>>;\n }\n}\n\n/**\n * A callback which is provided by a context requester and is called with the value satisfying the request.\n * This callback can be called multiple times by context providers as the requested value is changed.\n */\nexport type ContextCallback<ValueType> = (\n value: ValueType,\n unsubscribe?: () => void\n) => void;\n\n/**\n * Interface definition for a ContextRequest\n */\nexport interface ContextRequest<C extends Context<unknown, unknown>> {\n readonly context: C;\n readonly callback: ContextCallback<ContextType<C>>;\n readonly subscribe?: boolean;\n}\n\n/**\n * An event fired by a context requester to signal it desires a specified context with the given key.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * method to the callback which consumers can invoke to indicate they no longer wish to receive these updates.\n *\n * If no `subscribe` value is present in the event, then the provider can assume that this is a 'one time'\n * request for the context and can therefore not track the consumer.\n */\nexport class ContextRequestEvent<C extends Context<unknown, unknown>>\n extends Event\n implements ContextRequest<C>\n{\n readonly context: C;\n readonly callback: ContextCallback<ContextType<C>>;\n readonly subscribe?: boolean;\n\n /**\n *\n * @param context the context key to request\n * @param callback the callback that should be invoked when the context with the specified key is available\n * @param subscribe when, true indicates we want to subscribe to future updates\n */\n constructor(\n context: C,\n callback: ContextCallback<ContextType<C>>,\n subscribe?: boolean\n ) {\n super('context-request', {bubbles: true, composed: true});\n this.context = context;\n this.callback = callback;\n this.subscribe = subscribe ?? false;\n }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The Context type defines a type brand to associate a key value with the context value type\n */\nexport type Context<KeyType, ValueType> = KeyType & {__context__: ValueType};\n\n/**\n * @deprecated use Context instead\n */\nexport type ContextKey<KeyType, ValueType> = Context<KeyType, ValueType>;\n\n/**\n * A helper type which can extract a Context value type from a Context type\n */\nexport type ContextType<Key extends Context<unknown, unknown>> =\n Key extends Context<unknown, infer ValueType> ? ValueType : never;\n\n/**\n * Creates a typed Context.\n *\n * Contexts are compared with strict equality.\n *\n * If you want two separate `createContext()` calls to referer to the same\n * context, then use a key that will by equal under strict equality like a\n * string for `Symbol.for()`:\n *\n * ```ts\n * // true\n * createContext('my-context') === createContext('my-context')\n * // true\n * createContext(Symbol.for('my-context')) === createContext(Symbol.for('my-context'))\n * ```\n *\n * If you want a context to be unique so that it's guaranteed to not collide\n * with other contexts, use a key that's unique under strict equality, like\n * a `Symbol()` or object.:\n *\n * ```\n * // false\n * createContext({}) === createContext({})\n * // false\n * createContext(Symbol('my-context')) === createContext(Symbol('my-context'))\n * ```\n *\n * @param key a context key value\n * @template ValueType the type of value that can be provided by this context.\n * @returns the context key value cast to `Context<K, ValueType>`\n */\nexport function createContext<ValueType, K = unknown>(key: K) {\n return key as Context<K, ValueType>;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n ContextCallback,\n ContextRequestEvent,\n} from '../context-request-event.js';\nimport type {Context, ContextType} from '../create-context.js';\nimport type {\n ReactiveController,\n ReactiveControllerHost,\n} from '@lit/reactive-element';\n\nexport interface Options<C extends Context<unknown, unknown>> {\n context: C;\n callback?: (value: ContextType<C>, dispose?: () => void) => void;\n subscribe?: boolean;\n}\n\n/**\n * A ReactiveController which adds context consuming behavior to a custom\n * element by dispatching `context-request` events.\n *\n * When the host element is connected to the document it will emit a\n * `context-request` event with its context key. When the context request\n * is satisfied the controller will invoke the callback, if present, and\n * trigger a host update so it can respond to the new value.\n *\n * It will also call the dispose method given by the provider when the\n * host element is disconnected.\n */\nexport class ContextConsumer<\n C extends Context<unknown, unknown>,\n HostElement extends ReactiveControllerHost & HTMLElement,\n> implements ReactiveController\n{\n protected host: HostElement;\n private context: C;\n private callback?: (value: ContextType<C>, dispose?: () => void) => void;\n private subscribe = false;\n\n private provided = false;\n\n value?: ContextType<C> = undefined;\n\n constructor(host: HostElement, options: Options<C>);\n /** @deprecated Use new ContextConsumer(host, options) */\n constructor(\n host: HostElement,\n context: C,\n callback?: (value: ContextType<C>, dispose?: () => void) => void,\n subscribe?: boolean\n );\n constructor(\n host: HostElement,\n contextOrOptions: C | Options<C>,\n callback?: (value: ContextType<C>, dispose?: () => void) => void,\n subscribe?: boolean\n ) {\n this.host = host;\n // This is a potentially fragile duck-type. It means a context object can't\n // have a property name context and be used in positional argument form.\n if ((contextOrOptions as Options<C>).context !== undefined) {\n const options = contextOrOptions as Options<C>;\n this.context = options.context;\n this.callback = options.callback;\n this.subscribe = options.subscribe ?? false;\n } else {\n this.context = contextOrOptions as C;\n this.callback = callback;\n this.subscribe = subscribe ?? false;\n }\n this.host.addController(this);\n }\n\n private unsubscribe?: () => void;\n\n hostConnected(): void {\n this.dispatchRequest();\n }\n\n hostDisconnected(): void {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = undefined;\n }\n }\n\n private dispatchRequest() {\n this.host.dispatchEvent(\n new ContextRequestEvent(this.context, this._callback, this.subscribe)\n );\n }\n\n // This function must have stable identity to properly dedupe in ContextRoot\n // if this element connects multiple times.\n private _callback: ContextCallback<ContextType<C>> = (value, unsubscribe) => {\n // some providers will pass an unsubscribe function indicating they may provide future values\n if (this.unsubscribe) {\n // if the unsubscribe function changes this implies we have changed provider\n if (this.unsubscribe !== unsubscribe) {\n // cleanup the old provider\n this.provided = false;\n this.unsubscribe();\n }\n // if we don't support subscription, immediately unsubscribe\n if (!this.subscribe) {\n this.unsubscribe();\n }\n }\n\n // store the value so that it can be retrieved from the controller\n this.value = value;\n // schedule an update in case this value is used in a template\n this.host.requestUpdate();\n\n // only invoke callback if we are either expecting updates or have not yet\n // been provided a value\n if (!this.provided || this.subscribe) {\n this.provided = true;\n if (this.callback) {\n this.callback(value, unsubscribe);\n }\n }\n\n this.unsubscribe = unsubscribe;\n };\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ContextCallback} from './context-request-event.js';\n\n/**\n * A disposer function\n */\ntype Disposer = () => void;\n\ninterface CallbackInfo {\n disposer: Disposer;\n consumerHost: Element;\n}\n\n/**\n * A simple class which stores a value, and triggers registered callbacks when\n * the value is changed via its setter.\n *\n * An implementor might use other observable patterns such as MobX or Redux to\n * get behavior like this. But this is a pretty minimal approach that will\n * likely work for a number of use cases.\n */\nexport class ValueNotifier<T> {\n protected readonly subscriptions = new Map<\n ContextCallback<T>,\n CallbackInfo\n >();\n private _value!: T;\n get value(): T {\n return this._value;\n }\n set value(v: T) {\n this.setValue(v);\n }\n\n setValue(v: T, force = false) {\n const update = force || !Object.is(v, this._value);\n this._value = v;\n if (update) {\n this.updateObservers();\n }\n }\n\n constructor(defaultValue?: T) {\n if (defaultValue !== undefined) {\n this.value = defaultValue;\n }\n }\n\n updateObservers = (): void => {\n for (const [callback, {disposer}] of this.subscriptions) {\n callback(this._value, disposer);\n }\n };\n\n addCallback(\n callback: ContextCallback<T>,\n consumerHost: Element,\n subscribe?: boolean\n ): void {\n if (!subscribe) {\n // just call the callback once and we're done\n callback(this.value);\n return;\n }\n if (!this.subscriptions.has(callback)) {\n this.subscriptions.set(callback, {\n disposer: () => {\n this.subscriptions.delete(callback);\n },\n consumerHost,\n });\n }\n const {disposer} = this.subscriptions.get(callback)!;\n callback(this.value, disposer);\n }\n\n clearCallbacks(): void {\n this.subscriptions.clear();\n }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ContextRequestEvent} from '../context-request-event.js';\nimport {ValueNotifier} from '../value-notifier.js';\nimport type {Context, ContextType} from '../create-context.js';\nimport type {\n ReactiveController,\n ReactiveControllerHost,\n} from '@lit/reactive-element';\n\ndeclare global {\n interface HTMLElementEventMap {\n /**\n * A 'context-provider' event can be emitted by any element which hosts\n * a context provider to indicate it is available for use.\n */\n 'context-provider': ContextProviderEvent<Context<unknown, unknown>>;\n }\n}\n\nexport class ContextProviderEvent<\n C extends Context<unknown, unknown>,\n> extends Event {\n readonly context: C;\n\n /**\n *\n * @param context the context which this provider can provide\n */\n constructor(context: C) {\n super('context-provider', {bubbles: true, composed: true});\n this.context = context;\n }\n}\n\nexport interface Options<C extends Context<unknown, unknown>> {\n context: C;\n initialValue?: ContextType<C>;\n}\n\ntype ReactiveElementHost = Partial<ReactiveControllerHost> & HTMLElement;\n\n/**\n * A ReactiveController which adds context provider behavior to a\n * custom element.\n *\n * This controller simply listens to the `context-request` event when\n * the host is connected to the DOM and registers the received callbacks\n * against its observable Context implementation.\n *\n * The controller may also be attached to any HTML element in which case it's\n * up to the user to call hostConnected() when attached to the DOM. This is\n * done automatically for any custom elements implementing\n * ReactiveControllerHost.\n */\nexport class ContextProvider<\n T extends Context<unknown, unknown>,\n HostElement extends ReactiveElementHost = ReactiveElementHost,\n >\n extends ValueNotifier<ContextType<T>>\n implements ReactiveController\n{\n protected readonly host: HostElement;\n private readonly context: T;\n\n constructor(host: HostElement, options: Options<T>);\n /** @deprecated Use new ContextProvider(host, options) */\n constructor(host: HostElement, context: T, initialValue?: ContextType<T>);\n constructor(\n host: HostElement,\n contextOrOptions: T | Options<T>,\n initialValue?: ContextType<T>\n ) {\n super(\n (contextOrOptions as Options<T>).context !== undefined\n ? (contextOrOptions as Options<T>).initialValue\n : initialValue\n );\n this.host = host;\n if ((contextOrOptions as Options<T>).context !== undefined) {\n this.context = (contextOrOptions as Options<T>).context;\n } else {\n this.context = contextOrOptions as T;\n }\n this.attachListeners();\n this.host.addController?.(this);\n }\n\n onContextRequest = (\n ev: ContextRequestEvent<Context<unknown, unknown>>\n ): void => {\n // Only call the callback if the context matches.\n // Also, in case an element is a consumer AND a provider\n // of the same context, we want to avoid the element to self-register.\n // The check on composedPath (as opposed to ev.target) is to cover cases\n // where the consumer is in the shadowDom of the provider (in which case,\n // event.target === this.host because of event retargeting).\n const consumerHost = ev.composedPath()[0] as Element;\n if (ev.context !== this.context || consumerHost === this.host) {\n return;\n }\n ev.stopPropagation();\n this.addCallback(ev.callback, consumerHost, ev.subscribe);\n };\n\n /**\n * When we get a provider request event, that means a child of this element\n * has just woken up. If it's a provider of our context, then we may need to\n * re-parent our subscriptions, because is a more specific provider than us\n * for its subtree.\n */\n onProviderRequest = (\n ev: ContextProviderEvent<Context<unknown, unknown>>\n ): void => {\n // Ignore events when the context doesn't match.\n // Also, in case an element is a consumer AND a provider\n // of the same context it shouldn't provide to itself.\n // We use composedPath (as opposed to ev.target) to cover cases\n // where the consumer is in the shadowDom of the provider (in which case,\n // event.target === this.host because of event retargeting).\n const childProviderHost = ev.composedPath()[0] as Element;\n if (ev.context !== this.context || childProviderHost === this.host) {\n return;\n }\n // Re-parent all of our subscriptions in case this new child provider\n // should take them over.\n const seen = new Set<unknown>();\n for (const [callback, {consumerHost}] of this.subscriptions) {\n // Prevent infinite loops in the case where a one host element\n // is providing the same context multiple times.\n //\n // While normally it's a no-op to attempt to re-parent a subscription\n // that already has its proper parent, in the case where there's more\n // than one ValueProvider for the same context on the same hostElement,\n // they will each call the consumer, and since they will each have their\n // own dispose function, a well behaved consumer will notice the change\n // in dispose function and call their old one.\n //\n // This will cause the subscriptions to thrash, but worse, without this\n // set check here, we can end up in an infinite loop, as we add and remove\n // the same subscriptions onto the end of the map over and over.\n if (seen.has(callback)) {\n continue;\n }\n seen.add(callback);\n consumerHost.dispatchEvent(\n new ContextRequestEvent(this.context, callback, true)\n );\n }\n ev.stopPropagation();\n };\n\n private attachListeners() {\n this.host.addEventListener('context-request', this.onContextRequest);\n this.host.addEventListener('context-provider', this.onProviderRequest);\n }\n\n hostConnected(): void {\n // emit an event to signal a provider is available for this context\n this.host.dispatchEvent(new ContextProviderEvent(this.context));\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ReactiveElement} from '@lit/reactive-element';\nimport {Context} from '../create-context.js';\nimport {ContextProvider} from '../controllers/context-provider.js';\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\n/**\n * A property decorator that adds a ContextProvider controller to the component\n * making it respond to any `context-request` events from its children consumer.\n *\n * @param context A Context identifier value created via `createContext`\n *\n * @example\n *\n * ```ts\n * import {provide} from '@lit/context';\n * import {Logger} from 'my-logging-library';\n * import {loggerContext} from './logger-context.js';\n *\n * class MyElement {\n * @provide({context: loggerContext})\n * logger = new Logger();\n * }\n * ```\n * @category Decorator\n */\nexport function provide<ValueType>({\n context: context,\n}: {\n context: Context<unknown, ValueType>;\n}): ProvideDecorator<ValueType> {\n return ((\n protoOrTarget: ClassAccessorDecoratorTarget<ReactiveElement, ValueType>,\n nameOrContext:\n | PropertyKey\n | ClassAccessorDecoratorContext<ReactiveElement, ValueType>\n ) => {\n // Map of instances to controllers\n const controllerMap = new WeakMap<\n ReactiveElement,\n ContextProvider<Context<unknown, ValueType>>\n >();\n if (typeof nameOrContext === 'object') {\n // Standard decorators branch\n nameOrContext.addInitializer(function () {\n controllerMap.set(this, new ContextProvider(this, {context}));\n });\n return {\n get(this: ReactiveElement) {\n return protoOrTarget.get.call(this);\n },\n set(this: ReactiveElement, value: ValueType) {\n controllerMap.get(this)?.setValue(value);\n return protoOrTarget.set.call(this, value);\n },\n init(this: ReactiveElement, value: ValueType) {\n controllerMap.get(this)?.setValue(value);\n return value;\n },\n };\n } else {\n // Experimental decorators branch\n (protoOrTarget.constructor as typeof ReactiveElement).addInitializer(\n (element: ReactiveElement): void => {\n controllerMap.set(element, new ContextProvider(element, {context}));\n }\n );\n // proxy any existing setter for this property and use it to\n // notify the controller of an updated value\n const descriptor = Object.getOwnPropertyDescriptor(\n protoOrTarget,\n nameOrContext\n );\n let newDescriptor: PropertyDescriptor;\n if (descriptor === undefined) {\n const valueMap = new WeakMap<ReactiveElement, ValueType>();\n newDescriptor = {\n get(this: ReactiveElement) {\n return valueMap.get(this);\n },\n set(this: ReactiveElement, value: ValueType) {\n controllerMap.get(this)!.setValue(value);\n valueMap.set(this, value);\n },\n configurable: true,\n enumerable: true,\n };\n } else {\n const oldSetter = descriptor.set;\n newDescriptor = {\n ...descriptor,\n set(this: ReactiveElement, value: ValueType) {\n controllerMap.get(this)!.setValue(value);\n oldSetter?.call(this, value);\n },\n };\n }\n Object.defineProperty(protoOrTarget, nameOrContext, newDescriptor);\n return;\n }\n }) as ProvideDecorator<ValueType>;\n}\n\n/**\n * Generates a public interface type that removes private and protected fields.\n * This allows accepting otherwise compatible versions of the type (e.g. from\n * multiple copies of the same package in `node_modules`).\n */\ntype Interface<T> = {\n [K in keyof T]: T[K];\n};\n\ntype ProvideDecorator<ContextType> = {\n // legacy\n <\n K extends PropertyKey,\n Proto extends Interface<Omit<ReactiveElement, 'renderRoot'>>,\n >(\n protoOrDescriptor: Proto,\n name?: K\n ): FieldMustMatchContextType<Proto, K, ContextType>;\n\n // standard\n <\n C extends Interface<Omit<ReactiveElement, 'renderRoot'>>,\n V extends ContextType,\n >(\n value: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): void;\n};\n\n// Note TypeScript requires the return type of a decorator to be `void | any`\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype DecoratorReturn = void | any;\n\ntype FieldMustMatchContextType<Obj, Key extends PropertyKey, ContextType> =\n // First we check whether the object has the property as a required field\n Obj extends Record<Key, infer ProvidingType>\n ? // Ok, it does, just check whether it's ok to assign the\n // provided type to the consuming field\n [ProvidingType] extends [ContextType]\n ? DecoratorReturn\n : {\n message: 'providing field not assignable to context';\n context: ContextType;\n provided: ProvidingType;\n }\n : // Next we check whether the object has the property as an optional field\n Obj extends Partial<Record<Key, infer Providing>>\n ? // Check assignability again. Note that we have to include undefined\n // here on the providing type because it's optional.\n [Providing | undefined] extends [ContextType]\n ? DecoratorReturn\n : {\n message: 'providing field not assignable to context';\n context: ContextType;\n consuming: Providing | undefined;\n }\n : // Ok, the field isn't present, so either someone's using provide\n // manually, i.e. not as a decorator (maybe don't do that! but if you do,\n // you're on your own for your type checking, sorry), or the field is\n // private, in which case we can't check it.\n DecoratorReturn;\n","/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ReactiveElement} from '@lit/reactive-element';\nimport {ContextConsumer} from '../controllers/context-consumer.js';\nimport {Context} from '../create-context.js';\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\n/**\n * A property decorator that adds a ContextConsumer controller to the component\n * which will try and retrieve a value for the property via the Context API.\n *\n * @param context A Context identifier value created via `createContext`\n * @param subscribe An optional boolean which when true allows the value to be updated\n * multiple times.\n *\n * @example\n *\n * ```ts\n * import {consume} from '@lit/context';\n * import {loggerContext, Logger} from 'community-protocols/logger';\n *\n * class MyElement {\n * @consume({context: loggerContext})\n * logger?: Logger;\n *\n * doThing() {\n * this.logger!.log('thing was done');\n * }\n * }\n * ```\n * @category Decorator\n */\nexport function consume<ValueType>({\n context,\n subscribe,\n}: {\n context: Context<unknown, ValueType>;\n subscribe?: boolean;\n}): ConsumeDecorator<ValueType> {\n return ((\n protoOrTarget: ClassAccessorDecoratorTarget<ReactiveElement, ValueType>,\n nameOrContext:\n | PropertyKey\n | ClassAccessorDecoratorContext<ReactiveElement, ValueType>\n ) => {\n if (typeof nameOrContext === 'object') {\n // Standard decorators branch\n nameOrContext.addInitializer(function () {\n new ContextConsumer(this, {\n context,\n callback: (value) => {\n protoOrTarget.set.call(this, value);\n },\n subscribe,\n });\n });\n } else {\n // Experimental decorators branch\n (protoOrTarget.constructor as typeof ReactiveElement).addInitializer(\n (element: ReactiveElement): void => {\n new ContextConsumer(element, {\n context,\n callback: (value) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (element as any)[nameOrContext] = value;\n },\n subscribe,\n });\n }\n );\n }\n }) as ConsumeDecorator<ValueType>;\n}\n\n/**\n * Generates a public interface type that removes private and protected fields.\n * This allows accepting otherwise incompatible versions of the type (e.g. from\n * multiple copies of the same package in `node_modules`).\n */\ntype Interface<T> = {\n [K in keyof T]: T[K];\n};\n\ntype ConsumeDecorator<ValueType> = {\n // legacy\n <\n K extends PropertyKey,\n Proto extends Interface<Omit<ReactiveElement, 'renderRoot'>>,\n >(\n protoOrDescriptor: Proto,\n name?: K\n ): FieldMustMatchProvidedType<Proto, K, ValueType>;\n\n // standard\n <\n C extends Interface<Omit<ReactiveElement, 'renderRoot'>>,\n V extends ValueType,\n >(\n value: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): void;\n};\n\n// Note TypeScript requires the return type of a decorator to be `void | any`\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype DecoratorReturn = void | any;\n\ntype FieldMustMatchProvidedType<Obj, Key extends PropertyKey, ProvidedType> =\n // First we check whether the object has the property as a required field\n Obj extends Record<Key, infer ConsumingType>\n ? // Ok, it does, just check whether it's ok to assign the\n // provided type to the consuming field\n [ProvidedType] extends [ConsumingType]\n ? DecoratorReturn\n : {\n message: 'provided type not assignable to consuming field';\n provided: ProvidedType;\n consuming: ConsumingType;\n }\n : // Next we check whether the object has the property as an optional field\n Obj extends Partial<Record<Key, infer ConsumingType>>\n ? // Check assignability again. Note that we have to include undefined\n // here on the consuming type because it's optional.\n [ProvidedType] extends [ConsumingType | undefined]\n ? DecoratorReturn\n : {\n message: 'provided type not assignable to consuming field';\n provided: ProvidedType;\n consuming: ConsumingType | undefined;\n }\n : // Ok, the field isn't present, so either someone's using consume\n // manually, i.e. not as a decorator (maybe don't do that! but if you do,\n // you're on your own for your type checking, sorry), or the field is\n // private, in which case we can't check it.\n DecoratorReturn;\n","/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\ntype ARIAAttributeMap = {\n [K in keyof ARIAMixin]: string;\n};\n\n/**\n * Map of ARIAMixin properties to attributes\n */\nexport const ariaMixinAttributes: ARIAAttributeMap = {\n ariaAtomic: 'aria-atomic',\n ariaAutoComplete: 'aria-autocomplete',\n ariaBrailleLabel: 'aria-braillelabel',\n ariaBrailleRoleDescription: 'aria-brailleroledescription',\n ariaBusy: 'aria-busy',\n ariaChecked: 'aria-checked',\n ariaColCount: 'aria-colcount',\n ariaColIndex: 'aria-colindex',\n ariaColSpan: 'aria-colspan',\n ariaCurrent: 'aria-current',\n ariaDescription: 'aria-description',\n ariaDisabled: 'aria-disabled',\n ariaExpanded: 'aria-expanded',\n ariaHasPopup: 'aria-haspopup',\n ariaHidden: 'aria-hidden',\n ariaInvalid: 'aria-invalid',\n ariaKeyShortcuts: 'aria-keyshortcuts',\n ariaLabel: 'aria-label',\n ariaLevel: 'aria-level',\n ariaLive: 'aria-live',\n ariaModal: 'aria-modal',\n ariaMultiLine: 'aria-multiline',\n ariaMultiSelectable: 'aria-multiselectable',\n ariaOrientation: 'aria-orientation',\n ariaPlaceholder: 'aria-placeholder',\n ariaPosInSet: 'aria-posinset',\n ariaPressed: 'aria-pressed',\n ariaReadOnly: 'aria-readonly',\n ariaRequired: 'aria-required',\n ariaRoleDescription: 'aria-roledescription',\n ariaRowCount: 'aria-rowcount',\n ariaRowIndex: 'aria-rowindex',\n ariaRowSpan: 'aria-rowspan',\n ariaSelected: 'aria-selected',\n ariaSetSize: 'aria-setsize',\n ariaSort: 'aria-sort',\n ariaValueMax: 'aria-valuemax',\n ariaValueMin: 'aria-valuemin',\n ariaValueNow: 'aria-valuenow',\n ariaValueText: 'aria-valuetext',\n role: 'role',\n};\n\ntype ElementInternalsInterface = ElementInternals;\n\n// Shim the global element internals object\n// Methods should be fine as noops and properties can generally\n// be while on the server.\nexport const ElementInternalsShim = class ElementInternals\n implements ElementInternalsInterface\n{\n ariaAtomic = '';\n ariaAutoComplete = '';\n ariaBrailleLabel = '';\n ariaBrailleRoleDescription = '';\n ariaBusy = '';\n ariaChecked = '';\n ariaColCount = '';\n ariaColIndex = '';\n ariaColSpan = '';\n ariaCurrent = '';\n ariaDescription = '';\n ariaDisabled = '';\n ariaExpanded = '';\n ariaHasPopup = '';\n ariaHidden = '';\n ariaInvalid = '';\n ariaKeyShortcuts = '';\n ariaLabel = '';\n ariaLevel = '';\n ariaLive = '';\n ariaModal = '';\n ariaMultiLine = '';\n ariaMultiSelectable = '';\n ariaOrientation = '';\n ariaPlaceholder = '';\n ariaPosInSet = '';\n ariaPressed = '';\n ariaReadOnly = '';\n ariaRequired = '';\n ariaRoleDescription = '';\n ariaRowCount = '';\n ariaRowIndex = '';\n ariaRowSpan = '';\n ariaSelected = '';\n ariaSetSize = '';\n ariaSort = '';\n ariaValueMax = '';\n ariaValueMin = '';\n ariaValueNow = '';\n ariaValueText = '';\n role = '';\n __host: HTMLElement;\n get shadowRoot() {\n // Grab the shadow root instance from the Element shim\n // to ensure that the shadow root is always available\n // to the internals instance even if the mode is 'closed'\n return (this.__host as HTMLElement & {__shadowRoot: ShadowRoot})\n .__shadowRoot;\n }\n constructor(_host: HTMLElement) {\n this.__host = _host;\n }\n checkValidity() {\n // TODO(augustjk) Consider actually implementing logic.\n // See https://github.com/lit/lit/issues/3740\n console.warn(\n '`ElementInternals.checkValidity()` was called on the server.' +\n 'This method always returns true.'\n );\n return true;\n }\n form = null;\n labels = [] as unknown as NodeListOf<HTMLLabelElement>;\n reportValidity() {\n return true;\n }\n setFormValue(): void {}\n setValidity(): void {}\n states = new Set<string>();\n validationMessage = '';\n validity = {} as ValidityState;\n willValidate = true;\n};\n\nconst ElementInternalsShimWithRealType =\n ElementInternalsShim as object as typeof ElementInternals;\nexport {ElementInternalsShimWithRealType as ElementInternals};\n\nexport const HYDRATE_INTERNALS_ATTR_PREFIX = 'hydrate-internals-';\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport {ElementInternalsShim} from './lib/element-internals.js';\n\nexport {\n ariaMixinAttributes,\n ElementInternals,\n HYDRATE_INTERNALS_ATTR_PREFIX,\n} from './lib/element-internals.js';\n\nconst attributes = new WeakMap<\n InstanceType<typeof HTMLElementShim>,\n Map<string, string>\n>();\nconst attributesForElement = (\n element: InstanceType<typeof HTMLElementShim>\n) => {\n let attrs = attributes.get(element);\n if (attrs === undefined) {\n attributes.set(element, (attrs = new Map()));\n }\n return attrs;\n};\n\n// The typings around the exports below are a little funky:\n//\n// 1. We want the `name` of the shim classes to match the real ones at runtime,\n// hence e.g. `class Element`.\n// 2. We can't shadow the global types with a simple class declaration, because\n// then we can't reference the global types for casting, hence e.g.\n// `const ElementShim = class Element`.\n// 3. We want to export the classes typed as the real ones, hence e.g.\n// `const ElementShimWithRealType = ElementShim as object as typeof Element;`.\n// 4. We want the exported names to match the real ones, hence e.g.\n// `export {ElementShimWithRealType as Element}`.\nconst ElementShim = class Element {\n get attributes() {\n return Array.from(attributesForElement(this)).map(([name, value]) => ({\n name,\n value,\n }));\n }\n private __shadowRootMode: null | ShadowRootMode = null;\n protected __shadowRoot: null | ShadowRoot = null;\n protected __internals: null | ElementInternals = null;\n\n get shadowRoot() {\n if (this.__shadowRootMode === 'closed') {\n return null;\n }\n return this.__shadowRoot;\n }\n get localName() {\n return (this.constructor as NamedCustomHTMLElementConstructor).__localName;\n }\n get tagName() {\n return this.localName?.toUpperCase();\n }\n setAttribute(name: string, value: unknown): void {\n // Emulate browser behavior that silently casts all values to string. E.g.\n // `42` becomes `\"42\"` and `{}` becomes `\"[object Object]\"\"`.\n attributesForElement(this).set(name, String(value));\n }\n removeAttribute(name: string) {\n attributesForElement(this).delete(name);\n }\n toggleAttribute(name: string, force?: boolean): boolean {\n // Steps reference https://dom.spec.whatwg.org/#dom-element-toggleattribute\n if (this.hasAttribute(name)) {\n // Step 5\n if (force === undefined || !force) {\n this.removeAttribute(name);\n return false;\n }\n } else {\n // Step 4\n if (force === undefined || force) {\n // Step 4.1\n this.setAttribute(name, '');\n return true;\n } else {\n // Step 4.2\n return false;\n }\n }\n // Step 6\n return true;\n }\n hasAttribute(name: string) {\n return attributesForElement(this).has(name);\n }\n attachShadow(init: ShadowRootInit): ShadowRoot {\n const shadowRoot = {host: this} as object as ShadowRoot;\n this.__shadowRootMode = init.mode;\n if (init && init.mode === 'open') {\n this.__shadowRoot = shadowRoot;\n }\n return shadowRoot;\n }\n attachInternals(): ElementInternals {\n if (this.__internals !== null) {\n throw new Error(\n `Failed to execute 'attachInternals' on 'HTMLElement': ` +\n `ElementInternals for the specified element was already attached.`\n );\n }\n const internals = new ElementInternalsShim(this as unknown as HTMLElement);\n this.__internals = internals;\n return internals as ElementInternals;\n }\n getAttribute(name: string) {\n const value = attributesForElement(this).get(name);\n return value ?? null;\n }\n};\nconst ElementShimWithRealType = ElementShim as object as typeof Element;\nexport {ElementShimWithRealType as Element};\n\nconst HTMLElementShim = class HTMLElement extends ElementShim {};\nconst HTMLElementShimWithRealType =\n HTMLElementShim as object as typeof HTMLElement;\nexport {HTMLElementShimWithRealType as HTMLElement};\n\ninterface CustomHTMLElementConstructor {\n new (): HTMLElement;\n observedAttributes?: string[];\n}\n\ninterface NamedCustomHTMLElementConstructor\n extends CustomHTMLElementConstructor {\n __localName: string;\n}\n\ntype CustomElementRegistration = {\n ctor: {new (): HTMLElement};\n observedAttributes: string[];\n};\n\nconst CustomElementRegistryShim = class CustomElementRegistry {\n private __definitions = new Map<string, CustomElementRegistration>();\n\n define(name: string, ctor: CustomHTMLElementConstructor) {\n if (this.__definitions.has(name)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n `'CustomElementRegistry' already has \"${name}\" defined. ` +\n `This may have been caused by live reload or hot module ` +\n `replacement in which case it can be safely ignored.\\n` +\n `Make sure to test your application with a production build as ` +\n `repeat registrations will throw in production.`\n );\n } else {\n throw new Error(\n `Failed to execute 'define' on 'CustomElementRegistry': ` +\n `the name \"${name}\" has already been used with this registry`\n );\n }\n }\n // Provide tagName and localName for the component.\n (ctor as NamedCustomHTMLElementConstructor).__localName = name;\n this.__definitions.set(name, {\n ctor,\n // Note it's important we read `observedAttributes` in case it is a getter\n // with side-effects, as is the case in Lit, where it triggers class\n // finalization.\n //\n // TODO(aomarks) To be spec compliant, we should also capture the\n // registration-time lifecycle methods like `connectedCallback`. For them\n // to be actually accessible to e.g. the Lit SSR element renderer, though,\n // we'd need to introduce a new API for accessing them (since `get` only\n // returns the constructor).\n observedAttributes: ctor.observedAttributes ?? [],\n });\n }\n\n get(name: string) {\n const definition = this.__definitions.get(name);\n return definition?.ctor;\n }\n};\nconst CustomElementRegistryShimWithRealType =\n CustomElementRegistryShim as object as typeof CustomElementRegistry;\nexport {CustomElementRegistryShimWithRealType as CustomElementRegistry};\n\nexport const customElements = new CustomElementRegistryShimWithRealType();\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n global.ShadowRoot &&\n (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n 'adoptedStyleSheets' in Document.prototype &&\n 'replace' in CSSStyleSheet.prototype;\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n // This property needs to remain unminified.\n ['_$cssResult$'] = true;\n readonly cssText: string;\n private _styleSheet?: CSSStyleSheet;\n private _strings: TemplateStringsArray | undefined;\n\n private constructor(\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ) {\n if (safeToken !== constructionToken) {\n throw new Error(\n 'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n );\n }\n this.cssText = cssText;\n this._strings = strings;\n }\n\n // This is a getter so that it's lazy. In practice, this means stylesheets\n // are not created until the first element instance is made.\n get styleSheet(): CSSStyleSheet | undefined {\n // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n // constructable.\n let styleSheet = this._styleSheet;\n const strings = this._strings;\n if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n const cacheable = strings !== undefined && strings.length === 1;\n if (cacheable) {\n styleSheet = cssTagCache.get(strings);\n }\n if (styleSheet === undefined) {\n (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n this.cssText\n );\n if (cacheable) {\n cssTagCache.set(strings, styleSheet);\n }\n }\n }\n return styleSheet;\n }\n\n toString(): string {\n return this.cssText;\n }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n new (\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n // This property needs to remain unminified.\n if ((value as CSSResult)['_$cssResult$'] === true) {\n return (value as CSSResult).cssText;\n } else if (typeof value === 'number') {\n return value;\n } else {\n throw new Error(\n `Value passed to 'css' function must be a 'css' function result: ` +\n `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n `to ensure page security.`\n );\n }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nexport const unsafeCSS = (value: unknown) =>\n new (CSSResult as ConstructableCSSResult)(\n typeof value === 'string' ? value : String(value),\n undefined,\n constructionToken\n );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n strings: TemplateStringsArray,\n ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n const cssText =\n strings.length === 1\n ? strings[0]\n : values.reduce(\n (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n strings[0]\n );\n return new (CSSResult as ConstructableCSSResult)(\n cssText,\n strings,\n constructionToken\n );\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic spec behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n renderRoot: ShadowRoot,\n styles: Array<CSSResultOrNative>\n) => {\n if (supportsAdoptingStyleSheets) {\n (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n s instanceof CSSStyleSheet ? s : s.styleSheet!\n );\n } else {\n for (const s of styles) {\n const style = document.createElement('style');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nonce = (global as any)['litNonce'];\n if (nonce !== undefined) {\n style.setAttribute('nonce', nonce);\n }\n style.textContent = (s as CSSResult).cssText;\n renderRoot.appendChild(style);\n }\n }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n let cssText = '';\n for (const rule of sheet.cssRules) {\n cssText += rule.cssText;\n }\n return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n supportsAdoptingStyleSheets ||\n (NODE_MODE && global.CSSStyleSheet === undefined)\n ? (s: CSSResultOrNative) => s\n : (s: CSSResultOrNative) =>\n s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * @packageDocumentation\n */\n\nimport {\n getCompatibleStyle,\n adoptStyles,\n CSSResultGroup,\n CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n is,\n defineProperty,\n getOwnPropertyDescriptor,\n getOwnPropertyNames,\n getOwnPropertySymbols,\n getPrototypeOf,\n} = Object;\n\nconst NODE_MODE = false;\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = globalThis;\n\nif (NODE_MODE) {\n global.customElements ??= customElements;\n}\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n\nconst polyfillSupport = DEV_MODE\n ? global.reactiveElementPolyfillSupportDevMode\n : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n const issuedWarnings: Set<string | undefined> = (global.litIssuedWarnings ??=\n new Set());\n\n // Issue a warning, if we haven't already.\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (!issuedWarnings.has(warning)) {\n console.warn(warning);\n issuedWarnings.add(warning);\n }\n };\n\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n\n // Issue polyfill support warning.\n if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n issueWarning(\n 'polyfill-support-missing',\n `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n `the \\`polyfill-support\\` module has not been loaded.`\n );\n }\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry = Update;\n export interface Update {\n kind: 'update';\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: ReactiveUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n /**\n * Called to convert an attribute value to a property\n * value.\n */\n fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n /**\n * Called to convert a property value to an attribute\n * value.\n *\n * It returns unknown instead of string, to be compatible with\n * https://github.com/WICG/trusted-types (and similar efforts).\n */\n toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n | ComplexAttributeConverter<Type>\n | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n /**\n * When set to `true`, indicates the property is internal private state. The\n * property should not be set by users. When using TypeScript, this property\n * should be marked as `private` or `protected`, and it is also a common\n * practice to use a leading `_` in the name. The property is not added to\n * `observedAttributes`.\n */\n readonly state?: boolean;\n\n /**\n * Indicates how and whether the property becomes an observed attribute.\n * If the value is `false`, the property is not added to `observedAttributes`.\n * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n * becomes `foobar`). If a string, the string value is observed (e.g\n * `attribute: 'foo-bar'`).\n */\n readonly attribute?: boolean | string;\n\n /**\n * Indicates the type of the property. This is used only as a hint for the\n * `converter` to determine how to convert the attribute\n * to/from a property.\n */\n readonly type?: TypeHint;\n\n /**\n * Indicates how to convert the attribute to/from a property. If this value\n * is a function, it is used to convert the attribute value a the property\n * value. If it's an object, it can have keys for `fromAttribute` and\n * `toAttribute`. If no `toAttribute` function is provided and\n * `reflect` is set to `true`, the property value is set directly to the\n * attribute. A default `converter` is used if none is provided; it supports\n * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n * when a property changes and the converter is used to update the attribute,\n * the property is never updated again as a result of the attribute changing,\n * and vice versa.\n */\n readonly converter?: AttributeConverter<Type, TypeHint>;\n\n /**\n * Indicates if the property should reflect to an attribute.\n * If `true`, when the property is set, the attribute is set using the\n * attribute name determined according to the rules for the `attribute`\n * property option and the value of the property converted using the rules\n * from the `converter` property option.\n */\n readonly reflect?: boolean;\n\n /**\n * A function that indicates if a property should be considered changed when\n * it is set. The function should take the `newValue` and `oldValue` and\n * return `true` if an update should be requested.\n */\n hasChanged?(value: Type, oldValue: Type): boolean;\n\n /**\n * Indicates whether an accessor will be created for this property. By\n * default, an accessor will be generated for this property that requests an\n * update when set. If this flag is `true`, no accessor will be created, and\n * it will be the user's responsibility to call\n * `this.requestUpdate(propertyName, oldValue)` to request an update when\n * the property changes.\n */\n readonly noAccessor?: boolean;\n\n /**\n * Whether this property is wrapping accessors. This is set by `@property`\n * to control the initial value change and reflection logic.\n *\n * @internal\n */\n wrapped?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n ? PropertyValueMap<T>\n : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n get<K extends keyof T>(k: K): T[K] | undefined;\n set<K extends keyof T>(key: K, value: T[K]): this;\n has<K extends keyof T>(k: K): boolean;\n delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n toAttribute(value: unknown, type?: unknown): unknown {\n switch (type) {\n case Boolean:\n value = value ? emptyStringForBooleanAttribute : null;\n break;\n case Object:\n case Array:\n // if the value is `null` or `undefined` pass this through\n // to allow removing/no change behavior.\n value = value == null ? value : JSON.stringify(value);\n break;\n }\n return value;\n },\n\n fromAttribute(value: string | null, type?: unknown) {\n let fromValue: unknown = value;\n switch (type) {\n case Boolean:\n fromValue = value !== null;\n break;\n case Number:\n fromValue = value === null ? null : Number(value);\n break;\n case Object:\n case Array:\n // Do *not* generate exception when invalid JSON is set as elements\n // don't normally complain on being mis-configured.\n // TODO(sorvell): Do generate exception in *dev mode*.\n try {\n // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n fromValue = JSON.parse(value!) as unknown;\n } catch (e) {\n fromValue = null;\n }\n break;\n }\n return fromValue;\n },\n};\n\nexport interface HasChanged {\n (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n | 'change-in-update'\n | 'migration'\n | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n interface SymbolConstructor {\n readonly metadata: unique symbol;\n }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// Symbol.metadata, so we must ensure that it exists.\n(Symbol as {metadata: symbol}).metadata ??= Symbol('metadata');\n\ndeclare global {\n // This is public global API, do not change!\n // eslint-disable-next-line no-var\n var litPropertyMetadata: WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n >;\n}\n\n// Map from a class's metadata object to property options\n// Note that we must use nullish-coalescing assignment so that we only use one\n// map even if we load multiple version of this module.\nglobal.litPropertyMetadata ??= new WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n // In the Node build, this `extends` clause will be substituted with\n // `(globalThis.HTMLElement ?? HTMLElement)`.\n //\n // This way, we will first prefer any global `HTMLElement` polyfill that the\n // user has assigned, and then fall back to the `HTMLElement` shim which has\n // been imported (see note at the top of this file about how this import is\n // generated by Rollup). Note that the `HTMLElement` variable has been\n // shadowed by this import, so it no longer refers to the global.\n extends HTMLElement\n implements ReactiveControllerHost\n{\n // Note: these are patched in only in DEV_MODE.\n /**\n * Read or set all the enabled warning categories for this class.\n *\n * This property is only used in development builds.\n *\n * @nocollapse\n * @category dev-mode\n */\n static enabledWarnings?: WarningKind[];\n\n /**\n * Enable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Enable for all ReactiveElement subclasses\n * ReactiveElement.enableWarning?.('migration');\n *\n * // Enable for only MyElement and subclasses\n * MyElement.enableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static enableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Disable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Disable for all ReactiveElement subclasses\n * ReactiveElement.disableWarning?.('migration');\n *\n * // Disable for only MyElement and subclasses\n * MyElement.disableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static disableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Adds an initializer function to the class that is called during instance\n * construction.\n *\n * This is useful for code that runs against a `ReactiveElement`\n * subclass, such as a decorator, that needs to do work for each\n * instance, such as setting up a `ReactiveController`.\n *\n * ```ts\n * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n * target.addInitializer((instance: ReactiveElement) => {\n * // This is run during construction of the element\n * new MyController(instance);\n * });\n * }\n * ```\n *\n * Decorating a field will then cause each instance to run an initializer\n * that adds a controller:\n *\n * ```ts\n * class MyElement extends LitElement {\n * @myDecorator foo;\n * }\n * ```\n *\n * Initializers are stored per-constructor. Adding an initializer to a\n * subclass does not add it to a superclass. Since initializers are run in\n * constructors, initializers will run in order of the class hierarchy,\n * starting with superclasses and progressing to the instance's class.\n *\n * @nocollapse\n */\n static addInitializer(initializer: Initializer) {\n this.__prepare();\n (this._initializers ??= []).push(initializer);\n }\n\n static _initializers?: Initializer[];\n\n /*\n * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n * all static methods and properties with initializers. Reference:\n * - https://github.com/google/closure-compiler/issues/1776\n */\n\n /**\n * Maps attribute names to properties; for example `foobar` attribute to\n * `fooBar` property. Created lazily on user subclasses when finalizing the\n * class.\n * @nocollapse\n */\n private static __attributeToPropertyMap: AttributeMap;\n\n /**\n * Marks class as having been finalized, which includes creating properties\n * from `static properties`, but does *not* include all properties created\n * from decorators.\n * @nocollapse\n */\n protected static finalized: true | undefined;\n\n /**\n * Memoized list of all element properties, including any superclass\n * properties. Created lazily on user subclasses when finalizing the class.\n *\n * @nocollapse\n * @category properties\n */\n static elementProperties: PropertyDeclarationMap;\n\n /**\n * User-supplied object that maps property names to `PropertyDeclaration`\n * objects containing options for configuring reactive properties. When\n * a reactive property is set the element will update and render.\n *\n * By default properties are public fields, and as such, they should be\n * considered as primarily settable by element users, either via attribute or\n * the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the `state: true` option. Properties\n * marked as `state` do not reflect from the corresponding attribute\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating\n * public properties should typically not be done for non-primitive (object or\n * array) properties. In other cases when an element needs to manage state, a\n * private property set with the `state: true` option should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n * @nocollapse\n * @category properties\n */\n static properties: PropertyDeclarations;\n\n /**\n * Memoized list of all element styles.\n * Created lazily on user subclasses when finalizing the class.\n * @nocollapse\n * @category styles\n */\n static elementStyles: Array<CSSResultOrNative> = [];\n\n /**\n * Array of styles to apply to the element. The styles should be defined\n * using the {@linkcode css} tag function, via constructible stylesheets, or\n * imported from native CSS module scripts.\n *\n * Note on Content Security Policy:\n *\n * Element styles are implemented with `<style>` tags when the browser doesn't\n * support adopted StyleSheets. To use such `<style>` tags with the style-src\n * CSP directive, the style-src value must either include 'unsafe-inline' or\n * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n * nonce.\n *\n * To provide a nonce to use on generated `<style>` elements, set\n * `window.litNonce` to a server-generated nonce in your page's HTML, before\n * loading application code:\n *\n * ```html\n * <script>\n * // Generated and unique per request:\n * window.litNonce = 'a1b2c3d4';\n * </script>\n * ```\n * @nocollapse\n * @category styles\n */\n static styles?: CSSResultGroup;\n\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n * @category attributes\n */\n static get observedAttributes() {\n // Ensure we've created all properties\n this.finalize();\n // this.__attributeToPropertyMap is only undefined after finalize() in\n // ReactiveElement itself. ReactiveElement.observedAttributes is only\n // accessed with ReactiveElement as the receiver when a subclass or mixin\n // calls super.observedAttributes\n return (\n this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n );\n }\n\n private __instanceProperties?: PropertyValues = undefined;\n\n /**\n * Creates a property accessor on the element prototype if one does not exist\n * and stores a {@linkcode PropertyDeclaration} for the property with the\n * given options. The property setter calls the property's `hasChanged`\n * property option or uses a strict identity check to determine whether or not\n * to request an update.\n *\n * This method may be overridden to customize properties; however,\n * when doing so, it's important to call `super.createProperty` to ensure\n * the property is setup correctly. This method calls\n * `getPropertyDescriptor` internally to get a descriptor to install.\n * To customize what properties do when they are get or set, override\n * `getPropertyDescriptor`. To customize the options for a property,\n * implement `createProperty` like this:\n *\n * ```ts\n * static createProperty(name, options) {\n * options = Object.assign(options, {myOption: true});\n * super.createProperty(name, options);\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n static createProperty(\n name: PropertyKey,\n options: PropertyDeclaration = defaultPropertyDeclaration\n ) {\n // If this is a state property, force the attribute to false.\n if (options.state) {\n (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n }\n this.__prepare();\n this.elementProperties.set(name, options);\n if (!options.noAccessor) {\n const key = DEV_MODE\n ? // Use Symbol.for in dev mode to make it easier to maintain state\n // when doing HMR.\n Symbol.for(`${String(name)} (@property() cache)`)\n : Symbol();\n const descriptor = this.getPropertyDescriptor(name, key, options);\n if (descriptor !== undefined) {\n defineProperty(this.prototype, name, descriptor);\n }\n }\n }\n\n /**\n * Returns a property descriptor to be defined on the given named property.\n * If no descriptor is returned, the property will not become an accessor.\n * For example,\n *\n * ```ts\n * class MyElement extends LitElement {\n * static getPropertyDescriptor(name, key, options) {\n * const defaultDescriptor =\n * super.getPropertyDescriptor(name, key, options);\n * const setter = defaultDescriptor.set;\n * return {\n * get: defaultDescriptor.get,\n * set(value) {\n * setter.call(this, value);\n * // custom action.\n * },\n * configurable: true,\n * enumerable: true\n * }\n * }\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n protected static getPropertyDescriptor(\n name: PropertyKey,\n key: string | symbol,\n options: PropertyDeclaration\n ): PropertyDescriptor | undefined {\n const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n get(this: ReactiveElement) {\n return this[key as keyof typeof this];\n },\n set(this: ReactiveElement, v: unknown) {\n (this as unknown as Record<string | symbol, unknown>)[key] = v;\n },\n };\n if (DEV_MODE && get == null) {\n if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n throw new Error(\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it's actually declared as a value on the prototype. ` +\n `Usually this is due to using @property or @state on a method.`\n );\n }\n issueWarning(\n 'reactive-property-without-getter',\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it does not have a getter. This will be an error in a ` +\n `future version of Lit.`\n );\n }\n return {\n get(this: ReactiveElement) {\n return get?.call(this);\n },\n set(this: ReactiveElement, value: unknown) {\n const oldValue = get?.call(this);\n set!.call(this, value);\n this.requestUpdate(name, oldValue, options);\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n /**\n * Returns the property options associated with the given property.\n * These options are defined with a `PropertyDeclaration` via the `properties`\n * object or the `@property` decorator and are registered in\n * `createProperty(...)`.\n *\n * Note, this method should be considered \"final\" and not overridden. To\n * customize the options for a given property, override\n * {@linkcode createProperty}.\n *\n * @nocollapse\n * @final\n * @category properties\n */\n static getPropertyOptions(name: PropertyKey) {\n return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n }\n\n // Temporary, until google3 is on TypeScript 5.2\n declare static [Symbol.metadata]: object & Record<PropertyKey, unknown>;\n\n /**\n * Initializes static own properties of the class used in bookkeeping\n * for element properties, initializers, etc.\n *\n * Can be called multiple times by code that needs to ensure these\n * properties exist before using them.\n *\n * This method ensures the superclass is finalized so that inherited\n * property metadata can be copied down.\n * @nocollapse\n */\n private static __prepare() {\n if (\n this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))\n ) {\n // Already prepared\n return;\n }\n // Finalize any superclasses\n const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n superCtor.finalize();\n\n // Create own set of initializers for this class if any exist on the\n // superclass and copy them down. Note, for a small perf boost, avoid\n // creating initializers unless needed.\n if (superCtor._initializers !== undefined) {\n this._initializers = [...superCtor._initializers];\n }\n // Initialize elementProperties from the superclass\n this.elementProperties = new Map(superCtor.elementProperties);\n }\n\n /**\n * Finishes setting up the class so that it's ready to be registered\n * as a custom element and instantiated.\n *\n * This method is called by the ReactiveElement.observedAttributes getter.\n * If you override the observedAttributes getter, you must either call\n * super.observedAttributes to trigger finalization, or call finalize()\n * yourself.\n *\n * @nocollapse\n */\n protected static finalize() {\n if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {\n return;\n }\n this.finalized = true;\n this.__prepare();\n\n // Create properties from the static properties block:\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n const propKeys = [\n ...getOwnPropertyNames(props),\n ...getOwnPropertySymbols(props),\n ] as Array<keyof typeof props>;\n for (const p of propKeys) {\n this.createProperty(p, props[p]);\n }\n }\n\n // Create properties from standard decorator metadata:\n const metadata = this[Symbol.metadata];\n if (metadata !== null) {\n const properties = litPropertyMetadata.get(metadata);\n if (properties !== undefined) {\n for (const [p, options] of properties) {\n this.elementProperties.set(p, options);\n }\n }\n }\n\n // Create the attribute-to-property map\n this.__attributeToPropertyMap = new Map();\n for (const [p, options] of this.elementProperties) {\n const attr = this.__attributeNameForProperty(p, options);\n if (attr !== undefined) {\n this.__attributeToPropertyMap.set(attr, p);\n }\n }\n\n this.elementStyles = this.finalizeStyles(this.styles);\n\n if (DEV_MODE) {\n if (this.hasOwnProperty('createProperty')) {\n issueWarning(\n 'no-override-create-property',\n 'Overriding ReactiveElement.createProperty() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n if (this.hasOwnProperty('getPropertyDescriptor')) {\n issueWarning(\n 'no-override-get-property-descriptor',\n 'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n }\n }\n\n /**\n * Options used when calling `attachShadow`. Set this property to customize\n * the options for the shadowRoot; for example, to create a closed\n * shadowRoot: `{mode: 'closed'}`.\n *\n * Note, these options are used in `createRenderRoot`. If this method\n * is customized, options should be respected if possible.\n * @nocollapse\n * @category rendering\n */\n static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n /**\n * Takes the styles the user supplied via the `static styles` property and\n * returns the array of styles to apply to the element.\n * Override this method to integrate into a style management system.\n *\n * Styles are deduplicated preserving the _last_ instance in the list. This\n * is a performance optimization to avoid duplicated styles that can occur\n * especially when composing via subclassing. The last item is kept to try\n * to preserve the cascade order with the assumption that it's most important\n * that last added styles override previous styles.\n *\n * @nocollapse\n * @category styles\n */\n protected static finalizeStyles(\n styles?: CSSResultGroup\n ): Array<CSSResultOrNative> {\n const elementStyles = [];\n if (Array.isArray(styles)) {\n // Dedupe the flattened array in reverse order to preserve the last items.\n // Casting to Array<unknown> works around TS error that\n // appears to come from trying to flatten a type CSSResultArray.\n const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n // Then preserve original order by adding the set items in reverse order.\n for (const s of set) {\n elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n }\n } else if (styles !== undefined) {\n elementStyles.push(getCompatibleStyle(styles));\n }\n return elementStyles;\n }\n\n /**\n * Node or ShadowRoot into which element DOM should be rendered. Defaults\n * to an open shadowRoot.\n * @category rendering\n */\n readonly renderRoot!: HTMLElement | DocumentFragment;\n\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n private static __attributeNameForProperty(\n name: PropertyKey,\n options: PropertyDeclaration\n ) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : typeof attribute === 'string'\n ? attribute\n : typeof name === 'string'\n ? name.toLowerCase()\n : undefined;\n }\n\n // Initialize to an unresolved Promise so we can make sure the element has\n // connected before first update.\n private __updatePromise!: Promise<boolean>;\n\n /**\n * True if there is a pending update as a result of calling `requestUpdate()`.\n * Should only be read.\n * @category updates\n */\n isUpdatePending = false;\n\n /**\n * Is set to `true` after the first update. The element code cannot assume\n * that `renderRoot` exists before the element `hasUpdated`.\n * @category updates\n */\n hasUpdated = false;\n\n /**\n * Map with keys for any properties that have changed since the last\n * update cycle with previous values.\n *\n * @internal\n */\n _$changedProperties!: PropertyValues;\n\n /**\n * Properties that should be reflected when updated.\n */\n private __reflectingProperties?: Set<PropertyKey>;\n\n /**\n * Name of currently reflecting property\n */\n private __reflectingProperty: PropertyKey | null = null;\n\n /**\n * Set of controllers.\n */\n private __controllers?: Set<ReactiveController>;\n\n constructor() {\n super();\n this.__initialize();\n }\n\n /**\n * Internal only override point for customizing work done when elements\n * are constructed.\n */\n private __initialize() {\n this.__updatePromise = new Promise<boolean>(\n (res) => (this.enableUpdating = res)\n );\n this._$changedProperties = new Map();\n // This enqueues a microtask that ust run before the first update, so it\n // must be called before requestUpdate()\n this.__saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdate();\n (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n i(this)\n );\n }\n\n /**\n * Registers a `ReactiveController` to participate in the element's reactive\n * update cycle. The element automatically calls into any registered\n * controllers during its lifecycle callbacks.\n *\n * If the element is connected when `addController()` is called, the\n * controller's `hostConnected()` callback will be immediately called.\n * @category controllers\n */\n addController(controller: ReactiveController) {\n (this.__controllers ??= new Set()).add(controller);\n // If a controller is added after the element has been connected,\n // call hostConnected. Note, re-using existence of `renderRoot` here\n // (which is set in connectedCallback) to avoid the need to track a\n // first connected state.\n if (this.renderRoot !== undefined && this.isConnected) {\n controller.hostConnected?.();\n }\n }\n\n /**\n * Removes a `ReactiveController` from the element.\n * @category controllers\n */\n removeController(controller: ReactiveController) {\n this.__controllers?.delete(controller);\n }\n\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs. Note, on very old versions of Safari (<=9) or Chrome\n * (<=41), properties created for native platform properties like (`id` or\n * `name`) may not have default values set in the element constructor. On\n * these browsers native properties appear on instances and therefore their\n * default value will overwrite any element default (e.g. if the element sets\n * this.id = 'id' in the constructor, the 'id' will become '' since this is\n * the native platform default).\n */\n private __saveInstanceProperties() {\n const instanceProperties = new Map<PropertyKey, unknown>();\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n if (this.hasOwnProperty(p)) {\n instanceProperties.set(p, this[p]);\n delete this[p];\n }\n }\n if (instanceProperties.size > 0) {\n this.__instanceProperties = instanceProperties;\n }\n }\n\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n *\n * @return Returns a node into which to render.\n * @category rendering\n */\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n const renderRoot =\n this.shadowRoot ??\n this.attachShadow(\n (this.constructor as typeof ReactiveElement).shadowRootOptions\n );\n adoptStyles(\n renderRoot,\n (this.constructor as typeof ReactiveElement).elementStyles\n );\n return renderRoot;\n }\n\n /**\n * On first connection, creates the element's renderRoot, sets up\n * element styling, and enables updating.\n * @category lifecycle\n */\n connectedCallback() {\n // Create renderRoot before controllers `hostConnected`\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n this.enableUpdating(true);\n this.__controllers?.forEach((c) => c.hostConnected?.());\n }\n\n /**\n * Note, this method should be considered final and not overridden. It is\n * overridden on the element instance with a function that triggers the first\n * update.\n * @category updates\n */\n protected enableUpdating(_requestedUpdate: boolean) {}\n\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n * @category lifecycle\n */\n disconnectedCallback() {\n this.__controllers?.forEach((c) => c.hostDisconnected?.());\n }\n\n /**\n * Synchronizes property values when attributes change.\n *\n * Specifically, when an attribute is set, the corresponding property is set.\n * You should rarely need to implement this callback. If this method is\n * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n * called.\n *\n * See [using the lifecycle callbacks](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks)\n * on MDN for more information about the `attributeChangedCallback`.\n * @category attributes\n */\n attributeChangedCallback(\n name: string,\n _old: string | null,\n value: string | null\n ) {\n this._$attributeToProperty(name, value);\n }\n\n private __propertyToAttribute(name: PropertyKey, value: unknown) {\n const elemProperties: PropertyDeclarationMap = (\n this.constructor as typeof ReactiveElement\n ).elementProperties;\n const options = elemProperties.get(name)!;\n const attr = (\n this.constructor as typeof ReactiveElement\n ).__attributeNameForProperty(name, options);\n if (attr !== undefined && options.reflect === true) {\n const converter =\n (options.converter as ComplexAttributeConverter)?.toAttribute !==\n undefined\n ? (options.converter as ComplexAttributeConverter)\n : defaultConverter;\n const attrValue = converter.toAttribute!(value, options.type);\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'migration'\n ) &&\n attrValue === undefined\n ) {\n issueWarning(\n 'undefined-attribute-value',\n `The attribute value for the ${name as string} property is ` +\n `undefined on element ${this.localName}. The attribute will be ` +\n `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n `the attribute would not have changed.`\n );\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this.__reflectingProperty = name;\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue as string);\n }\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /** @internal */\n _$attributeToProperty(name: string, value: string | null) {\n const ctor = this.constructor as typeof ReactiveElement;\n // Note, hint this as an `AttributeMap` so closure clearly understands\n // the type; it has issues with tracking types through statics\n const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n // Use tracking info to avoid reflecting a property value to an attribute\n // if it was just set because the attribute changed.\n if (propName !== undefined && this.__reflectingProperty !== propName) {\n const options = ctor.getPropertyOptions(propName);\n const converter =\n typeof options.converter === 'function'\n ? {fromAttribute: options.converter}\n : options.converter?.fromAttribute !== undefined\n ? options.converter\n : defaultConverter;\n // mark state reflecting\n this.__reflectingProperty = propName;\n this[propName as keyof this] = converter.fromAttribute!(\n value,\n options.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) as any;\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /**\n * Requests an update which is processed asynchronously. This should be called\n * when an element should update based on some state not triggered by setting\n * a reactive property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored.\n *\n * @param name name of requesting property\n * @param oldValue old value of requesting property\n * @param options property options to use instead of the previously\n * configured options\n * @category updates\n */\n requestUpdate(\n name?: PropertyKey,\n oldValue?: unknown,\n options?: PropertyDeclaration\n ): void {\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n if (DEV_MODE && (name as unknown) instanceof Event) {\n issueWarning(\n ``,\n `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n );\n }\n options ??= (\n this.constructor as typeof ReactiveElement\n ).getPropertyOptions(name);\n const hasChanged = options.hasChanged ?? notEqual;\n const newValue = this[name as keyof this];\n if (hasChanged(newValue, oldValue)) {\n this._$changeProperty(name, oldValue, options);\n } else {\n // Abort the request if the property should not be considered changed.\n return;\n }\n }\n if (this.isUpdatePending === false) {\n this.__updatePromise = this.__enqueueUpdate();\n }\n }\n\n /**\n * @internal\n */\n _$changeProperty(\n name: PropertyKey,\n oldValue: unknown,\n options: PropertyDeclaration\n ) {\n // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n // vs just Map.set()\n if (!this._$changedProperties.has(name)) {\n this._$changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `__reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (options.reflect === true && this.__reflectingProperty !== name) {\n (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n }\n }\n\n /**\n * Sets up the element to asynchronously update.\n */\n private async __enqueueUpdate() {\n this.isUpdatePending = true;\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await this.__updatePromise;\n } catch (e) {\n // Refire any previous errors async so they do not disrupt the update\n // cycle. Errors are refired so developers have a chance to observe\n // them, and this can be done by implementing\n // `window.onunhandledrejection`.\n Promise.reject(e);\n }\n const result = this.scheduleUpdate();\n // If `scheduleUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n return !this.isUpdatePending;\n }\n\n /**\n * Schedules an element update. You can override this method to change the\n * timing of updates by returning a Promise. The update will await the\n * returned Promise, and you should resolve the Promise to allow the update\n * to proceed. If this method is overridden, `super.scheduleUpdate()`\n * must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```ts\n * override protected async scheduleUpdate(): Promise<unknown> {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.scheduleUpdate();\n * }\n * ```\n * @category updates\n */\n protected scheduleUpdate(): void | Promise<unknown> {\n const result = this.performUpdate();\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'async-perform-update'\n ) &&\n typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n 'function'\n ) {\n issueWarning(\n 'async-perform-update',\n `Element ${this.localName} returned a Promise from performUpdate(). ` +\n `This behavior is deprecated and will be removed in a future ` +\n `version of ReactiveElement.`\n );\n }\n return result;\n }\n\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * Call `performUpdate()` to immediately process a pending update. This should\n * generally not be needed, but it can be done in rare cases when you need to\n * update synchronously.\n *\n * @category updates\n */\n protected performUpdate(): void {\n // Abort any update if one is not pending when this is called.\n // This can happen if `performUpdate` is called early to \"flush\"\n // the update.\n if (!this.isUpdatePending) {\n return;\n }\n debugLogEvent?.({kind: 'update'});\n if (!this.hasUpdated) {\n // Create renderRoot before first update. This occurs in `connectedCallback`\n // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n if (DEV_MODE) {\n // Produce warning if any reactive properties on the prototype are\n // shadowed by class fields. Instance fields set before upgrade are\n // deleted by this point, so any own property is caused by class field\n // initialization in the constructor.\n const ctor = this.constructor as typeof ReactiveElement;\n const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n );\n if (shadowedProperties.length) {\n throw new Error(\n `The following properties on element ${this.localName} will not ` +\n `trigger updates as expected because they are set using class ` +\n `fields: ${shadowedProperties.join(', ')}. ` +\n `Native class fields and some compiled output will overwrite ` +\n `accessors used for detecting changes. See ` +\n `https://lit.dev/msg/class-field-shadowing ` +\n `for more information.`\n );\n }\n }\n // Mixin instance properties once, if they exist.\n if (this.__instanceProperties) {\n // TODO (justinfagnani): should we use the stored value? Could a new value\n // have been set since we stored the own property value?\n for (const [p, value] of this.__instanceProperties) {\n this[p as keyof this] = value as this[keyof this];\n }\n this.__instanceProperties = undefined;\n }\n // Trigger initial value reflection and populate the initial\n // changedProperties map, but only for the case of experimental\n // decorators on accessors, which will not have already populated the\n // changedProperties map. We can't know if these accessors had\n // initializers, so we just set them anyway - a difference from\n // experimental decorators on fields and standard decorators on\n // auto-accessors.\n // For context why experimentalDecorators with auto accessors are handled\n // specifically also see:\n // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n if (elementProperties.size > 0) {\n for (const [p, options] of elementProperties) {\n if (\n options.wrapped === true &&\n !this._$changedProperties.has(p) &&\n this[p as keyof this] !== undefined\n ) {\n this._$changeProperty(p, this[p as keyof this], options);\n }\n }\n }\n }\n let shouldUpdate = false;\n const changedProperties = this._$changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.willUpdate(changedProperties);\n this.__controllers?.forEach((c) => c.hostUpdate?.());\n this.update(changedProperties);\n } else {\n this.__markUpdated();\n }\n } catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n // Ensure element can accept additional updates after an exception.\n this.__markUpdated();\n throw e;\n }\n // The update is no longer considered pending and further updates are now allowed.\n if (shouldUpdate) {\n this._$didUpdate(changedProperties);\n }\n }\n\n /**\n * Invoked before `update()` to compute values needed during the update.\n *\n * Implement `willUpdate` to compute property values that depend on other\n * properties and are used in the rest of the update process.\n *\n * ```ts\n * willUpdate(changedProperties) {\n * // only need to check changed properties for an expensive computation.\n * if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n * this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n * }\n * }\n *\n * render() {\n * return html`SHA: ${this.sha}`;\n * }\n * ```\n *\n * @category updates\n */\n protected willUpdate(_changedProperties: PropertyValues): void {}\n\n // Note, this is an override point for polyfill-support.\n // @internal\n _$didUpdate(changedProperties: PropertyValues) {\n this.__controllers?.forEach((c) => c.hostUpdated?.());\n if (!this.hasUpdated) {\n this.hasUpdated = true;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n if (\n DEV_MODE &&\n this.isUpdatePending &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'change-in-update'\n )\n ) {\n issueWarning(\n 'change-in-update',\n `Element ${this.localName} scheduled an update ` +\n `(generally because a property was set) ` +\n `after an update completed, causing a new update to be scheduled. ` +\n `This is inefficient and should be avoided unless the next update ` +\n `can only be scheduled as a side effect of the previous update.`\n );\n }\n }\n\n private __markUpdated() {\n this._$changedProperties = new Map();\n this.isUpdatePending = false;\n }\n\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update.\n *\n * To await additional asynchronous work, override the `getUpdateComplete`\n * method. For example, it is sometimes useful to await a rendered element\n * before fulfilling this Promise. To do this, first await\n * `super.getUpdateComplete()`, then any subsequent state.\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n get updateComplete(): Promise<boolean> {\n return this.getUpdateComplete();\n }\n\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * ```ts\n * class MyElement extends LitElement {\n * override async getUpdateComplete() {\n * const result = await super.getUpdateComplete();\n * await this._myChild.updateComplete;\n * return result;\n * }\n * }\n * ```\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n protected getUpdateComplete(): Promise<boolean> {\n return this.__updatePromise;\n }\n\n /**\n * Controls whether or not `update()` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n return true;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected update(_changedProperties: PropertyValues) {\n // The forEach() expression will only run when when __reflectingProperties is\n // defined, and it returns undefined, setting __reflectingProperties to\n // undefined\n this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n this.__propertyToAttribute(p, this[p as keyof this])\n ) as undefined;\n this.__markUpdated();\n }\n\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected updated(_changedProperties: PropertyValues) {}\n\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * ```ts\n * firstUpdated() {\n * this.renderRoot.getElementById('my-text-area').focus();\n * }\n * ```\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\npolyfillSupport?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n // Default warning set.\n ReactiveElement.enabledWarnings = [\n 'change-in-update',\n 'async-perform-update',\n ];\n const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n if (\n !ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))\n ) {\n ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n }\n };\n ReactiveElement.enableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n if (!this.enabledWarnings!.includes(warning)) {\n this.enabledWarnings!.push(warning);\n }\n };\n ReactiveElement.disableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n const i = this.enabledWarnings!.indexOf(warning);\n if (i >= 0) {\n this.enabledWarnings!.splice(i, 1);\n }\n };\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.0.4');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\nimport type {TrustedHTML, TrustedTypesWindow} from 'trusted-types/lib';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | TemplatePrep\n | TemplateInstantiated\n | TemplateInstantiatedAndUpdated\n | TemplateUpdating\n | BeginRender\n | EndRender\n | CommitPartEntry\n | SetPartValue;\n export interface TemplatePrep {\n kind: 'template prep';\n template: Template;\n strings: TemplateStringsArray;\n clonableTemplate: HTMLTemplateElement;\n parts: TemplatePart[];\n }\n export interface BeginRender {\n kind: 'begin render';\n id: number;\n value: unknown;\n container: HTMLElement | DocumentFragment;\n options: RenderOptions | undefined;\n part: ChildPart | undefined;\n }\n export interface EndRender {\n kind: 'end render';\n id: number;\n value: unknown;\n container: HTMLElement | DocumentFragment;\n options: RenderOptions | undefined;\n part: ChildPart;\n }\n export interface TemplateInstantiated {\n kind: 'template instantiated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateInstantiatedAndUpdated {\n kind: 'template instantiated and updated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateUpdating {\n kind: 'template updating';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface SetPartValue {\n kind: 'set part';\n part: Part;\n value: unknown;\n valueIndex: number;\n values: unknown[];\n templateInstance: TemplateInstance;\n }\n\n export type CommitPartEntry =\n | CommitNothingToChildEntry\n | CommitText\n | CommitNode\n | CommitAttribute\n | CommitProperty\n | CommitBooleanAttribute\n | CommitEventListener\n | CommitToElementBinding;\n\n export interface CommitNothingToChildEntry {\n kind: 'commit nothing to child';\n start: ChildNode;\n end: ChildNode | null;\n parent: Disconnectable | undefined;\n options: RenderOptions | undefined;\n }\n\n export interface CommitText {\n kind: 'commit text';\n node: Text;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitNode {\n kind: 'commit node';\n start: Node;\n parent: Disconnectable | undefined;\n value: Node;\n options: RenderOptions | undefined;\n }\n\n export interface CommitAttribute {\n kind: 'commit attribute';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitProperty {\n kind: 'commit property';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitBooleanAttribute {\n kind: 'commit boolean attribute';\n element: Element;\n name: string;\n value: boolean;\n options: RenderOptions | undefined;\n }\n\n export interface CommitEventListener {\n kind: 'commit event listener';\n element: Element;\n name: string;\n value: unknown;\n oldListener: unknown;\n options: RenderOptions | undefined;\n // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n removeListener: boolean;\n // True if we're adding a new event listener (e.g. because first render, or settings changed)\n addListener: boolean;\n }\n\n export interface CommitToElementBinding {\n kind: 'commit to element binding';\n element: Element;\n value: unknown;\n options: RenderOptions | undefined;\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: LitUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n global.litIssuedWarnings ??= new Set();\n\n // Issue a warning, if we haven't already.\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (!global.litIssuedWarnings!.has(warning)) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n}\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n global.ShadyDOM?.inUse &&\n global.ShadyDOM?.noPatch === true\n ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = trustedTypes\n ? trustedTypes.createPolicy('lit-html', {\n createHTML: (s) => s,\n })\n : undefined;\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n * is being written to. Note that this is just an exemplar node, the write\n * may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n * be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n node: Node,\n name: string,\n type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n * the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n * unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n _node: Node,\n _name: string,\n _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n return;\n }\n if (sanitizerFactoryInternal !== noopSanitizer) {\n throw new Error(\n `Attempted to overwrite existing lit-html security policy.` +\n ` setSanitizeDOMValueFactory should be called at most once.`\n );\n }\n sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n NODE_MODE && global.document === undefined\n ? ({\n createTreeWalker() {\n return {};\n },\n } as unknown as Document)\n : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n isArray(value) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n * (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /-->/g;\n/**\n * Comments not started with <!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n * * The name: any character except a whitespace character, (\"), ('), \">\",\n * \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n 'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n // This property needs to remain unminified.\n ['_$litType$']: T;\n strings: TemplateStringsArray;\n values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n | UncompiledTemplateResult<T>\n | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n UncompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n // This is a factory in order to make template initialization lazy\n // and allow ShadyRenderOptions scope to be passed in.\n // This property needs to remain unminified.\n ['_$litType$']: CompiledTemplate;\n values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n // el is overridden to be optional. We initialize it on first render\n el?: HTMLTemplateElement;\n\n // The prepared HTML string to create a template element from.\n // The type is a TemplateStringsArray to guarantee that the value came from\n // source code, preventing a JSON injection attack.\n h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n <T extends ResultType>(type: T) =>\n (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n // Warn against templates octal escape sequences\n // We do this here rather than in render so that the warning is closer to the\n // template definition.\n if (DEV_MODE && strings.some((s) => s === undefined)) {\n console.warn(\n 'Some template strings are undefined.\\n' +\n 'This is probably caused by illegal octal escape sequences.'\n );\n }\n if (DEV_MODE) {\n // Import static-html.js results in a circular dependency which g3 doesn't\n // handle. Instead we know that static values must have the field\n // `_$litStatic$`.\n if (\n values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n ) {\n issueWarning(\n '',\n `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n );\n }\n }\n return {\n // This property needs to remain unminified.\n ['_$litType$']: type,\n strings,\n values,\n };\n };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = tag(HTML_RESULT);\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n * <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n * ${rect}\n * </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = tag(SVG_RESULT);\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n * <math>\n * ${num}\n * </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = Symbol.for('lit-noChange');\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n * user.isAdmin\n * ? html`<button>DELETE</button>`\n * : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing = Symbol.for('lit-nothing');\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n /**\n * An object to use as the `this` value for event listeners. It's often\n * useful to set this to the host component rendering a template.\n */\n host?: object;\n /**\n * A DOM node before which to render content in the container.\n */\n renderBefore?: ChildNode | null;\n /**\n * Node used for cloning the template (`importNode` will be called on this\n * node). This controls the `ownerDocument` of the rendered DOM, along with\n * any inherited context. Defaults to the global `document`.\n */\n creationScope?: {importNode(node: Node, deep?: boolean): Node};\n /**\n * The initial connected state for the top-level part being rendered. If no\n * `isConnected` option is set, `AsyncDirective`s will be connected by\n * default. Set to `false` if the initial render occurs in a disconnected tree\n * and `AsyncDirective`s should see `isConnected === false` for their initial\n * render. The `part.setConnected()` method must be used subsequent to initial\n * render to change the connected state of the part.\n */\n isConnected?: boolean;\n}\n\nconst walker = d.createTreeWalker(\n d,\n 129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n);\n\nlet sanitizerFactoryInternal: SanitizerFactory = noopSanitizer;\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n _$parent?: DirectiveParent;\n _$isConnected: boolean;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n tsa: TemplateStringsArray,\n stringFromTSA: string\n): TrustedHTML {\n // A security check to prevent spoofing of Lit template results.\n // In the future, we may be able to replace this with Array.isTemplateObject,\n // though we might need to make that check inside of the html and svg\n // functions, because precompiled templates don't come in as\n // TemplateStringArray objects.\n if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n let message = 'invalid template strings array';\n if (DEV_MODE) {\n message = `\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n `\n .trim()\n .replace(/\\n */g, '\\n');\n }\n throw new Error(message);\n }\n return policy !== undefined\n ? policy.createHTML(stringFromTSA)\n : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n * to avoid object fields since this code is shared with non-minified SSR\n * code)\n */\nconst getTemplateHtml = (\n strings: TemplateStringsArray,\n type: ResultType\n): [TrustedHTML, Array<string>] => {\n // Insert makers into the template HTML to represent the position of\n // bindings. The following code scans the template strings to determine the\n // syntactic position of the bindings. They can be in text position, where\n // we insert an HTML comment, attribute value position, where we insert a\n // sentinel string and re-write the attribute name, or inside a tag where\n // we insert the sentinel string.\n const l = strings.length - 1;\n // Stores the case-sensitive bound attribute names in the order of their\n // parts. ElementParts are also reflected in this array as undefined\n // rather than a string, to disambiguate from attribute bindings.\n const attrNames: Array<string> = [];\n let html =\n type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n // When we're inside a raw text tag (not it's text content), the regex\n // will still be tagRegex so we can find attributes, but will switch to\n // this regex when the tag ends.\n let rawTextEndRegex: RegExp | undefined;\n\n // The current parsing state, represented as a reference to one of the\n // regexes\n let regex = textEndRegex;\n\n for (let i = 0; i < l; i++) {\n const s = strings[i];\n // The index of the end of the last attribute name. When this is\n // positive at end of a string, it means we're in an attribute value\n // position and need to rewrite the attribute name.\n // We also use a special value of -2 to indicate that we encountered\n // the end of a string in attribute name position.\n let attrNameEndIndex = -1;\n let attrName: string | undefined;\n let lastIndex = 0;\n let match!: RegExpExecArray | null;\n\n // The conditions in this loop handle the current parse state, and the\n // assignments to the `regex` variable are the state transitions.\n while (lastIndex < s.length) {\n // Make sure we start searching from where we previously left off\n regex.lastIndex = lastIndex;\n match = regex.exec(s);\n if (match === null) {\n break;\n }\n lastIndex = regex.lastIndex;\n if (regex === textEndRegex) {\n if (match[COMMENT_START] === '!--') {\n regex = commentEndRegex;\n } else if (match[COMMENT_START] !== undefined) {\n // We started a weird comment, like </{\n regex = comment2EndRegex;\n } else if (match[TAG_NAME] !== undefined) {\n if (rawTextElement.test(match[TAG_NAME])) {\n // Record if we encounter a raw-text element. We'll switch to\n // this regex at the end of the tag.\n rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n }\n regex = tagEndRegex;\n } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n if (DEV_MODE) {\n throw new Error(\n 'Bindings in tag names are not supported. Please use static templates instead. ' +\n 'See https://lit.dev/docs/templates/expressions/#static-expressions'\n );\n }\n regex = tagEndRegex;\n }\n } else if (regex === tagEndRegex) {\n if (match[ENTIRE_MATCH] === '>') {\n // End of a tag. If we had started a raw-text element, use that\n // regex\n regex = rawTextEndRegex ?? textEndRegex;\n // We may be ending an unquoted attribute value, so make sure we\n // clear any pending attrNameEndIndex\n attrNameEndIndex = -1;\n } else if (match[ATTRIBUTE_NAME] === undefined) {\n // Attribute name position\n attrNameEndIndex = -2;\n } else {\n attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n attrName = match[ATTRIBUTE_NAME];\n regex =\n match[QUOTE_CHAR] === undefined\n ? tagEndRegex\n : match[QUOTE_CHAR] === '\"'\n ? doubleQuoteAttrEndRegex\n : singleQuoteAttrEndRegex;\n }\n } else if (\n regex === doubleQuoteAttrEndRegex ||\n regex === singleQuoteAttrEndRegex\n ) {\n regex = tagEndRegex;\n } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n regex = textEndRegex;\n } else {\n // Not one of the five state regexes, so it must be the dynamically\n // created raw text regex and we're at the close of that element.\n regex = tagEndRegex;\n rawTextEndRegex = undefined;\n }\n }\n\n if (DEV_MODE) {\n // If we have a attrNameEndIndex, which indicates that we should\n // rewrite the attribute name, assert that we're in a valid attribute\n // position - either in a tag, or a quoted attribute value.\n console.assert(\n attrNameEndIndex === -1 ||\n regex === tagEndRegex ||\n regex === singleQuoteAttrEndRegex ||\n regex === doubleQuoteAttrEndRegex,\n 'unexpected parse state B'\n );\n }\n\n // We have four cases:\n // 1. We're in text position, and not in a raw text element\n // (regex === textEndRegex): insert a comment marker.\n // 2. We have a non-negative attrNameEndIndex which means we need to\n // rewrite the attribute name to add a bound attribute suffix.\n // 3. We're at the non-first binding in a multi-binding attribute, use a\n // plain marker.\n // 4. We're somewhere else inside the tag. If we're in attribute name\n // position (attrNameEndIndex === -2), add a sequential suffix to\n // generate a unique attribute name.\n\n // Detect a binding next to self-closing tag end and insert a space to\n // separate the marker from the tag end:\n const end =\n regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n html +=\n regex === textEndRegex\n ? s + nodeMarker\n : attrNameEndIndex >= 0\n ? (attrNames.push(attrName!),\n s.slice(0, attrNameEndIndex) +\n boundAttributeSuffix +\n s.slice(attrNameEndIndex)) +\n marker +\n end\n : s + marker + (attrNameEndIndex === -2 ? i : end);\n }\n\n const htmlResult: string | TrustedHTML =\n html +\n (strings[l] || '<?>') +\n (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n // Returned as an array for terseness\n return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport type {Template};\nclass Template {\n /** @internal */\n el!: HTMLTemplateElement;\n\n parts: Array<TemplatePart> = [];\n\n constructor(\n // This property needs to remain unminified.\n {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n options?: RenderOptions\n ) {\n let node: Node | null;\n let nodeIndex = 0;\n let attrNameIndex = 0;\n const partCount = strings.length - 1;\n const parts = this.parts;\n\n // Create template element\n const [html, attrNames] = getTemplateHtml(strings, type);\n this.el = Template.createElement(html, options);\n walker.currentNode = this.el.content;\n\n // Re-parent SVG or MathML nodes into template root\n if (type === SVG_RESULT || type === MATHML_RESULT) {\n const wrapper = this.el.content.firstChild!;\n wrapper.replaceWith(...wrapper.childNodes);\n }\n\n // Walk the template to find binding markers and create TemplateParts\n while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n if (node.nodeType === 1) {\n if (DEV_MODE) {\n const tag = (node as Element).localName;\n // Warn if `textarea` includes an expression and throw if `template`\n // does since these are not supported. We do this by checking\n // innerHTML for anything that looks like a marker. This catches\n // cases like bindings in textarea there markers turn into text nodes.\n if (\n /^(?:textarea|template)$/i!.test(tag) &&\n (node as Element).innerHTML.includes(marker)\n ) {\n const m =\n `Expressions are not supported inside \\`${tag}\\` ` +\n `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n `information.`;\n if (tag === 'template') {\n throw new Error(m);\n } else issueWarning('', m);\n }\n }\n // TODO (justinfagnani): for attempted dynamic tag names, we don't\n // increment the bindingIndex, and it'll be off by 1 in the element\n // and off by two after it.\n if ((node as Element).hasAttributes()) {\n for (const name of (node as Element).getAttributeNames()) {\n if (name.endsWith(boundAttributeSuffix)) {\n const realName = attrNames[attrNameIndex++];\n const value = (node as Element).getAttribute(name)!;\n const statics = value.split(marker);\n const m = /([.?@])?(.*)/.exec(realName)!;\n parts.push({\n type: ATTRIBUTE_PART,\n index: nodeIndex,\n name: m[2],\n strings: statics,\n ctor:\n m[1] === '.'\n ? PropertyPart\n : m[1] === '?'\n ? BooleanAttributePart\n : m[1] === '@'\n ? EventPart\n : AttributePart,\n });\n (node as Element).removeAttribute(name);\n } else if (name.startsWith(marker)) {\n parts.push({\n type: ELEMENT_PART,\n index: nodeIndex,\n });\n (node as Element).removeAttribute(name);\n }\n }\n }\n // TODO (justinfagnani): benchmark the regex against testing for each\n // of the 3 raw text element names.\n if (rawTextElement.test((node as Element).tagName)) {\n // For raw text elements we need to split the text content on\n // markers, create a Text node for each segment, and create\n // a TemplatePart for each marker.\n const strings = (node as Element).textContent!.split(marker);\n const lastIndex = strings.length - 1;\n if (lastIndex > 0) {\n (node as Element).textContent = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for node parts\n // We can't use empty text nodes as markers because they're\n // normalized when cloning in IE (could simplify when\n // IE is no longer supported)\n for (let i = 0; i < lastIndex; i++) {\n (node as Element).append(strings[i], createMarker());\n // Walk past the marker node we just added\n walker.nextNode();\n parts.push({type: CHILD_PART, index: ++nodeIndex});\n }\n // Note because this marker is added after the walker's current\n // node, it will be walked to in the outer loop (and ignored), so\n // we don't need to adjust nodeIndex here\n (node as Element).append(strings[lastIndex], createMarker());\n }\n }\n } else if (node.nodeType === 8) {\n const data = (node as Comment).data;\n if (data === markerMatch) {\n parts.push({type: CHILD_PART, index: nodeIndex});\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n parts.push({type: COMMENT_PART, index: nodeIndex});\n // Move to the end of the match\n i += marker.length - 1;\n }\n }\n }\n nodeIndex++;\n }\n\n if (DEV_MODE) {\n // If there was a duplicate attribute on a tag, then when the tag is\n // parsed into an element the attribute gets de-duplicated. We can detect\n // this mismatch if we haven't precisely consumed every attribute name\n // when preparing the template. This works because `attrNames` is built\n // from the template string and `attrNameIndex` comes from processing the\n // resulting DOM.\n if (attrNames.length !== attrNameIndex) {\n throw new Error(\n `Detected duplicate attribute bindings. This occurs if your template ` +\n `has duplicate attributes on an element tag. For example ` +\n `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n `duplicate \"disabled\" attribute. The error was detected in ` +\n `the following template: \\n` +\n '`' +\n strings.join('${...}') +\n '`'\n );\n }\n }\n\n // We could set walker.currentNode to another node here to prevent a memory\n // leak, but every time we prepare a template, we immediately render it\n // and re-use the walker in new TemplateInstance._clone().\n debugLogEvent &&\n debugLogEvent({\n kind: 'template prep',\n template: this,\n clonableTemplate: this.el,\n parts: this.parts,\n strings,\n });\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @nocollapse */\n static createElement(html: TrustedHTML, _options?: RenderOptions) {\n const el = d.createElement('template');\n el.innerHTML = html as unknown as string;\n return el;\n }\n}\n\nexport interface Disconnectable {\n _$parent?: Disconnectable;\n _$disconnectableChildren?: Set<Disconnectable>;\n // Rather than hold connection state on instances, Disconnectables recursively\n // fetch the connection state from the RootPart they are connected in via\n // getters up the Disconnectable tree via _$parent references. This pushes the\n // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n // needing to pass all Disconnectables (parts, template instances, and\n // directives) their connection state each time it changes, which would be\n // costly for trees that have no AsyncDirectives.\n _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n part: ChildPart | AttributePart | ElementPart,\n value: unknown,\n parent: DirectiveParent = part,\n attributeIndex?: number\n): unknown {\n // Bail early if the value is explicitly noChange. Note, this means any\n // nested directive is still attached and is not run.\n if (value === noChange) {\n return value;\n }\n let currentDirective =\n attributeIndex !== undefined\n ? (parent as AttributePart).__directives?.[attributeIndex]\n : (parent as ChildPart | ElementPart | Directive).__directive;\n const nextDirectiveConstructor = isPrimitive(value)\n ? undefined\n : // This property needs to remain unminified.\n (value as DirectiveResult)['_$litDirective$'];\n if (currentDirective?.constructor !== nextDirectiveConstructor) {\n // This property needs to remain unminified.\n currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n if (nextDirectiveConstructor === undefined) {\n currentDirective = undefined;\n } else {\n currentDirective = new nextDirectiveConstructor(part as PartInfo);\n currentDirective._$initialize(part, parent, attributeIndex);\n }\n if (attributeIndex !== undefined) {\n ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n currentDirective;\n } else {\n (parent as ChildPart | Directive).__directive = currentDirective;\n }\n }\n if (currentDirective !== undefined) {\n value = resolveDirective(\n part,\n currentDirective._$resolve(part, (value as DirectiveResult).values),\n currentDirective,\n attributeIndex\n );\n }\n return value;\n}\n\nexport type {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n _$template: Template;\n _$parts: Array<Part | undefined> = [];\n\n /** @internal */\n _$parent: ChildPart;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n constructor(template: Template, parent: ChildPart) {\n this._$template = template;\n this._$parent = parent;\n }\n\n // Called by ChildPart parentNode getter\n get parentNode() {\n return this._$parent.parentNode;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n // This method is separate from the constructor because we need to return a\n // DocumentFragment and we don't want to hold onto it with an instance field.\n _clone(options: RenderOptions | undefined) {\n const {\n el: {content},\n parts: parts,\n } = this._$template;\n const fragment = (options?.creationScope ?? d).importNode(content, true);\n walker.currentNode = fragment;\n\n let node = walker.nextNode()!;\n let nodeIndex = 0;\n let partIndex = 0;\n let templatePart = parts[0];\n\n while (templatePart !== undefined) {\n if (nodeIndex === templatePart.index) {\n let part: Part | undefined;\n if (templatePart.type === CHILD_PART) {\n part = new ChildPart(\n node as HTMLElement,\n node.nextSibling,\n this,\n options\n );\n } else if (templatePart.type === ATTRIBUTE_PART) {\n part = new templatePart.ctor(\n node as HTMLElement,\n templatePart.name,\n templatePart.strings,\n this,\n options\n );\n } else if (templatePart.type === ELEMENT_PART) {\n part = new ElementPart(node as HTMLElement, this, options);\n }\n this._$parts.push(part);\n templatePart = parts[++partIndex];\n }\n if (nodeIndex !== templatePart?.index) {\n node = walker.nextNode()!;\n nodeIndex++;\n }\n }\n // We need to set the currentNode away from the cloned tree so that we\n // don't hold onto the tree even if the tree is detached and should be\n // freed.\n walker.currentNode = d;\n return fragment;\n }\n\n _update(values: Array<unknown>) {\n let i = 0;\n for (const part of this._$parts) {\n if (part !== undefined) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'set part',\n part,\n value: values[i],\n valueIndex: i,\n values,\n templateInstance: this,\n });\n if ((part as AttributePart).strings !== undefined) {\n (part as AttributePart)._$setValue(values, part as AttributePart, i);\n // The number of values the part consumes is part.strings.length - 1\n // since values are in between template spans. We increment i by 1\n // later in the loop, so increment it by part.strings.length - 2 here\n i += (part as AttributePart).strings!.length - 2;\n } else {\n part._$setValue(values[i]);\n }\n }\n i++;\n }\n }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n readonly type: typeof ATTRIBUTE_PART;\n readonly index: number;\n readonly name: string;\n readonly ctor: typeof AttributePart;\n readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n readonly type: typeof CHILD_PART;\n readonly index: number;\n};\ntype ElementTemplatePart = {\n readonly type: typeof ELEMENT_PART;\n readonly index: number;\n};\ntype CommentTemplatePart = {\n readonly type: typeof COMMENT_PART;\n readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n | ChildTemplatePart\n | AttributeTemplatePart\n | ElementTemplatePart\n | CommentTemplatePart;\n\nexport type Part =\n | ChildPart\n | AttributePart\n | PropertyPart\n | BooleanAttributePart\n | ElementPart\n | EventPart;\n\nexport type {ChildPart};\nclass ChildPart implements Disconnectable {\n readonly type = CHILD_PART;\n readonly options: RenderOptions | undefined;\n _$committedValue: unknown = nothing;\n /** @internal */\n __directive?: Directive;\n /** @internal */\n _$startNode: ChildNode;\n /** @internal */\n _$endNode: ChildNode | null;\n private _textSanitizer: ValueSanitizer | undefined;\n /** @internal */\n _$parent: Disconnectable | undefined;\n /**\n * Connection state for RootParts only (i.e. ChildPart without _$parent\n * returned from top-level `render`). This field is unused otherwise. The\n * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n * with this field (and a different _$isConnected getter), but the subclass\n * caused a perf regression, possibly due to making call sites polymorphic.\n * @internal\n */\n __isConnected: boolean;\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n // ChildParts that are not at the root should always be created with a\n // parent; only RootChildNode's won't, so they return the local isConnected\n // state\n return this._$parent?._$isConnected ?? this.__isConnected;\n }\n\n // The following fields will be patched onto ChildParts when required by\n // AsyncDirective\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /** @internal */\n _$notifyConnectionChanged?(\n isConnected: boolean,\n removeFromParent?: boolean,\n from?: number\n ): void;\n /** @internal */\n _$reparentDisconnectables?(parent: Disconnectable): void;\n\n constructor(\n startNode: ChildNode,\n endNode: ChildNode | null,\n parent: TemplateInstance | ChildPart | undefined,\n options: RenderOptions | undefined\n ) {\n this._$startNode = startNode;\n this._$endNode = endNode;\n this._$parent = parent;\n this.options = options;\n // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n // no _$parent); the value on a non-root-part is \"don't care\", but checking\n // for parent would be more code\n this.__isConnected = options?.isConnected ?? true;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n // Explicitly initialize for consistent class shape.\n this._textSanitizer = undefined;\n }\n }\n\n /**\n * The parent node into which the part renders its content.\n *\n * A ChildPart's content consists of a range of adjacent child nodes of\n * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n * `.endNode`).\n *\n * - If both `.startNode` and `.endNode` are non-null, then the part's content\n * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n *\n * - If `.startNode` is non-null but `.endNode` is null, then the part's\n * content consists of all siblings following `.startNode`, up to and\n * including the last child of `.parentNode`. If `.endNode` is non-null, then\n * `.startNode` will always be non-null.\n *\n * - If both `.endNode` and `.startNode` are null, then the part's content\n * consists of all child nodes of `.parentNode`.\n */\n get parentNode(): Node {\n let parentNode: Node = wrap(this._$startNode).parentNode!;\n const parent = this._$parent;\n if (\n parent !== undefined &&\n parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n ) {\n // If the parentNode is a DocumentFragment, it may be because the DOM is\n // still in the cloned fragment during initial render; if so, get the real\n // parentNode the part will be committed into by asking the parent.\n parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n }\n return parentNode;\n }\n\n /**\n * The part's leading marker node, if any. See `.parentNode` for more\n * information.\n */\n get startNode(): Node | null {\n return this._$startNode;\n }\n\n /**\n * The part's trailing marker node, if any. See `.parentNode` for more\n * information.\n */\n get endNode(): Node | null {\n return this._$endNode;\n }\n\n _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n if (DEV_MODE && this.parentNode === null) {\n throw new Error(\n `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n );\n }\n value = resolveDirective(this, value, directiveParent);\n if (isPrimitive(value)) {\n // Non-rendering child values. It's important that these do not render\n // empty text nodes to avoid issues with preventing default <slot>\n // fallback content.\n if (value === nothing || value == null || value === '') {\n if (this._$committedValue !== nothing) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit nothing to child',\n start: this._$startNode,\n end: this._$endNode,\n parent: this._$parent,\n options: this.options,\n });\n this._$clear();\n }\n this._$committedValue = nothing;\n } else if (value !== this._$committedValue && value !== noChange) {\n this._commitText(value);\n }\n // This property needs to remain unminified.\n } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n this._commitTemplateResult(value as TemplateResult);\n } else if ((value as Node).nodeType !== undefined) {\n if (DEV_MODE && this.options?.host === value) {\n this._commitText(\n `[probable mistake: rendered a template's host in itself ` +\n `(commonly caused by writing \\${this} in a template]`\n );\n console.warn(\n `Attempted to render the template host`,\n value,\n `inside itself. This is almost always a mistake, and in dev mode `,\n `we render some warning text. In production however, we'll `,\n `render it, which will usually result in an error, and sometimes `,\n `in the element disappearing from the DOM.`\n );\n return;\n }\n this._commitNode(value as Node);\n } else if (isIterable(value)) {\n this._commitIterable(value);\n } else {\n // Fallback, will render the string representation\n this._commitText(value);\n }\n }\n\n private _insert<T extends Node>(node: T) {\n return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n node,\n this._$endNode\n );\n }\n\n private _commitNode(value: Node): void {\n if (this._$committedValue !== value) {\n this._$clear();\n if (\n ENABLE_EXTRA_SECURITY_HOOKS &&\n sanitizerFactoryInternal !== noopSanitizer\n ) {\n const parentNodeName = this._$startNode.parentNode?.nodeName;\n if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n let message = 'Forbidden';\n if (DEV_MODE) {\n if (parentNodeName === 'STYLE') {\n message =\n `Lit does not support binding inside style nodes. ` +\n `This is a security risk, as style injection attacks can ` +\n `exfiltrate data and spoof UIs. ` +\n `Consider instead using css\\`...\\` literals ` +\n `to compose styles, and do dynamic styling with ` +\n `css custom properties, ::parts, <slot>s, ` +\n `and by mutating the DOM rather than stylesheets.`;\n } else {\n message =\n `Lit does not support binding inside script nodes. ` +\n `This is a security risk, as it could allow arbitrary ` +\n `code execution.`;\n }\n }\n throw new Error(message);\n }\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit node',\n start: this._$startNode,\n parent: this._$parent,\n value: value,\n options: this.options,\n });\n this._$committedValue = this._insert(value);\n }\n }\n\n private _commitText(value: unknown): void {\n // If the committed value is a primitive it means we called _commitText on\n // the previous render, and we know that this._$startNode.nextSibling is a\n // Text node. We can now just replace the text content (.data) of the node.\n if (\n this._$committedValue !== nothing &&\n isPrimitive(this._$committedValue)\n ) {\n const node = wrap(this._$startNode).nextSibling as Text;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(node, 'data', 'property');\n }\n value = this._textSanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node,\n value,\n options: this.options,\n });\n (node as Text).data = value as string;\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n const textNode = d.createTextNode('');\n this._commitNode(textNode);\n // When setting text content, for security purposes it matters a lot\n // what the parent is. For example, <style> and <script> need to be\n // handled with care, while <span> does not. So first we need to put a\n // text node into the document, then we can sanitize its content.\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n }\n value = this._textSanitizer(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: textNode,\n value,\n options: this.options,\n });\n textNode.data = value as string;\n } else {\n this._commitNode(d.createTextNode(value as string));\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: wrap(this._$startNode).nextSibling as Text,\n value,\n options: this.options,\n });\n }\n }\n this._$committedValue = value;\n }\n\n private _commitTemplateResult(\n result: TemplateResult | CompiledTemplateResult\n ): void {\n // This property needs to remain unminified.\n const {values, ['_$litType$']: type} = result;\n // If $litType$ is a number, result is a plain TemplateResult and we get\n // the template from the template cache. If not, result is a\n // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n // to create the <template> element the first time we see it.\n const template: Template | CompiledTemplate =\n typeof type === 'number'\n ? this._$getTemplate(result as UncompiledTemplateResult)\n : (type.el === undefined &&\n (type.el = Template.createElement(\n trustFromTemplateString(type.h, type.h[0]),\n this.options\n )),\n type);\n\n if ((this._$committedValue as TemplateInstance)?._$template === template) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'template updating',\n template,\n instance: this._$committedValue as TemplateInstance,\n parts: (this._$committedValue as TemplateInstance)._$parts,\n options: this.options,\n values,\n });\n (this._$committedValue as TemplateInstance)._update(values);\n } else {\n const instance = new TemplateInstance(template as Template, this);\n const fragment = instance._clone(this.options);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n instance._update(values);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated and updated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n this._commitNode(fragment);\n this._$committedValue = instance;\n }\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @internal */\n _$getTemplate(result: UncompiledTemplateResult) {\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(result.strings, (template = new Template(result)));\n }\n return template;\n }\n\n private _commitIterable(value: Iterable<unknown>): void {\n // For an Iterable, we create a new InstancePart per item, then set its\n // value to the item. This is a little bit of overhead for every item in\n // an Iterable, but it lets us recurse easily and efficiently update Arrays\n // of TemplateResults that will be commonly returned from expressions like:\n // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n // If value is an array, then the previous render was of an\n // iterable and value will contain the ChildParts from the previous\n // render. If value is not an array, clear this part and make a new\n // array for ChildParts.\n if (!isArray(this._$committedValue)) {\n this._$committedValue = [];\n this._$clear();\n }\n\n // Lets us keep track of how many items we stamped so we can clear leftover\n // items from a previous render\n const itemParts = this._$committedValue as ChildPart[];\n let partIndex = 0;\n let itemPart: ChildPart | undefined;\n\n for (const item of value) {\n if (partIndex === itemParts.length) {\n // If no existing part, create a new one\n // TODO (justinfagnani): test perf impact of always creating two parts\n // instead of sharing parts between nodes\n // https://github.com/lit/lit/issues/1266\n itemParts.push(\n (itemPart = new ChildPart(\n this._insert(createMarker()),\n this._insert(createMarker()),\n this,\n this.options\n ))\n );\n } else {\n // Reuse an existing part\n itemPart = itemParts[partIndex];\n }\n itemPart._$setValue(item);\n partIndex++;\n }\n\n if (partIndex < itemParts.length) {\n // itemParts always have end nodes\n this._$clear(\n itemPart && wrap(itemPart._$endNode!).nextSibling,\n partIndex\n );\n // Truncate the parts array so _value reflects the current state\n itemParts.length = partIndex;\n }\n }\n\n /**\n * Removes the nodes contained within this Part from the DOM.\n *\n * @param start Start node to clear from, for clearing a subset of the part's\n * DOM (used when truncating iterables)\n * @param from When `start` is specified, the index within the iterable from\n * which ChildParts are being removed, used for disconnecting directives in\n * those Parts.\n *\n * @internal\n */\n _$clear(\n start: ChildNode | null = wrap(this._$startNode).nextSibling,\n from?: number\n ) {\n this._$notifyConnectionChanged?.(false, true, from);\n while (start && start !== this._$endNode) {\n const n = wrap(start!).nextSibling;\n (wrap(start!) as Element).remove();\n start = n;\n }\n }\n /**\n * Implementation of RootPart's `isConnected`. Note that this method\n * should only be called on `RootPart`s (the `ChildPart` returned from a\n * top-level `render()` call). It has no effect on non-root ChildParts.\n * @param isConnected Whether to set\n * @internal\n */\n setConnected(isConnected: boolean) {\n if (this._$parent === undefined) {\n this.__isConnected = isConnected;\n this._$notifyConnectionChanged?.(isConnected);\n } else if (DEV_MODE) {\n throw new Error(\n 'part.setConnected() may only be called on a ' +\n 'RootPart returned from render().'\n );\n }\n }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n /**\n * Sets the connection state for `AsyncDirective`s contained within this root\n * ChildPart.\n *\n * lit-html does not automatically monitor the connectedness of DOM rendered;\n * as such, it is the responsibility of the caller to `render` to ensure that\n * `part.setConnected(false)` is called before the part object is potentially\n * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n * any resources being held. If a `RootPart` that was previously\n * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n * re-connect), `setConnected(true)` should be called.\n *\n * @param isConnected Whether directives within this tree should be connected\n * or not\n */\n setConnected(isConnected: boolean): void;\n}\n\nexport type {AttributePart};\nclass AttributePart implements Disconnectable {\n readonly type:\n | typeof ATTRIBUTE_PART\n | typeof PROPERTY_PART\n | typeof BOOLEAN_ATTRIBUTE_PART\n | typeof EVENT_PART = ATTRIBUTE_PART;\n readonly element: HTMLElement;\n readonly name: string;\n readonly options: RenderOptions | undefined;\n\n /**\n * If this attribute part represents an interpolation, this contains the\n * static strings of the interpolation. For single-value, complete bindings,\n * this is undefined.\n */\n readonly strings?: ReadonlyArray<string>;\n /** @internal */\n _$committedValue: unknown | Array<unknown> = nothing;\n /** @internal */\n __directives?: Array<Directive | undefined>;\n /** @internal */\n _$parent: Disconnectable;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n protected _sanitizer: ValueSanitizer | undefined;\n\n get tagName() {\n return this.element.tagName;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this.element = element;\n this.name = name;\n this._$parent = parent;\n this.options = options;\n if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n this._$committedValue = new Array(strings.length - 1).fill(new String());\n this.strings = strings;\n } else {\n this._$committedValue = nothing;\n }\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n this._sanitizer = undefined;\n }\n }\n\n /**\n * Sets the value of this part by resolving the value from possibly multiple\n * values and static strings and committing it to the DOM.\n * If this part is single-valued, `this._strings` will be undefined, and the\n * method will be called with a single value argument. If this part is\n * multi-value, `this._strings` will be defined, and the method is called\n * with the value array of the part's owning TemplateInstance, and an offset\n * into the value array from which the values should be read.\n * This method is overloaded this way to eliminate short-lived array slices\n * of the template instance values, and allow a fast-path for single-valued\n * parts.\n *\n * @param value The part value, or an array of values for multi-valued parts\n * @param valueIndex the index to start reading values from. `undefined` for\n * single-valued parts\n * @param noCommit causes the part to not commit its value to the DOM. Used\n * in hydration to prime attribute parts with their first-rendered value,\n * but not set the attribute, and in SSR to no-op the DOM operation and\n * capture the value for serialization.\n *\n * @internal\n */\n _$setValue(\n value: unknown | Array<unknown>,\n directiveParent: DirectiveParent = this,\n valueIndex?: number,\n noCommit?: boolean\n ) {\n const strings = this.strings;\n\n // Whether any of the values has changed, for dirty-checking\n let change = false;\n\n if (strings === undefined) {\n // Single-value binding case\n value = resolveDirective(this, value, directiveParent, 0);\n change =\n !isPrimitive(value) ||\n (value !== this._$committedValue && value !== noChange);\n if (change) {\n this._$committedValue = value;\n }\n } else {\n // Interpolation case\n const values = value as Array<unknown>;\n value = strings[0];\n\n let i, v;\n for (i = 0; i < strings.length - 1; i++) {\n v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n if (v === noChange) {\n // If the user-provided value is `noChange`, use the previous value\n v = (this._$committedValue as Array<unknown>)[i];\n }\n change ||=\n !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n if (v === nothing) {\n value = nothing;\n } else if (value !== nothing) {\n value += (v ?? '') + strings[i + 1];\n }\n // We always record each value, even if one is `nothing`, for future\n // change detection.\n (this._$committedValue as Array<unknown>)[i] = v;\n }\n }\n if (change && !noCommit) {\n this._commitValue(value);\n }\n }\n\n /** @internal */\n _commitValue(value: unknown) {\n if (value === nothing) {\n (wrap(this.element) as Element).removeAttribute(this.name);\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'attribute'\n );\n }\n value = this._sanitizer(value ?? '');\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit attribute',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n (wrap(this.element) as Element).setAttribute(\n this.name,\n (value ?? '') as string\n );\n }\n }\n}\n\nexport type {PropertyPart};\nclass PropertyPart extends AttributePart {\n override readonly type = PROPERTY_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'property'\n );\n }\n value = this._sanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit property',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.element as any)[this.name] = value === nothing ? undefined : value;\n }\n}\n\nexport type {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit boolean attribute',\n element: this.element,\n name: this.name,\n value: !!(value && value !== nothing),\n options: this.options,\n });\n (wrap(this.element) as Element).toggleAttribute(\n this.name,\n !!value && value !== nothing\n );\n }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport type {EventPart};\nclass EventPart extends AttributePart {\n override readonly type = EVENT_PART;\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n super(element, name, strings, parent, options);\n\n if (DEV_MODE && this.strings !== undefined) {\n throw new Error(\n `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n 'invalid content. Event listeners in templates must have exactly ' +\n 'one expression and no surrounding text.'\n );\n }\n }\n\n // EventPart does not use the base _$setValue/_resolveValue implementation\n // since the dirty checking is more complex\n /** @internal */\n override _$setValue(\n newListener: unknown,\n directiveParent: DirectiveParent = this\n ) {\n newListener =\n resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n if (newListener === noChange) {\n return;\n }\n const oldListener = this._$committedValue;\n\n // If the new value is nothing or any options change we have to remove the\n // part as a listener.\n const shouldRemoveListener =\n (newListener === nothing && oldListener !== nothing) ||\n (newListener as EventListenerWithOptions).capture !==\n (oldListener as EventListenerWithOptions).capture ||\n (newListener as EventListenerWithOptions).once !==\n (oldListener as EventListenerWithOptions).once ||\n (newListener as EventListenerWithOptions).passive !==\n (oldListener as EventListenerWithOptions).passive;\n\n // If the new value is not nothing and we removed the listener, we have\n // to add the part as a listener.\n const shouldAddListener =\n newListener !== nothing &&\n (oldListener === nothing || shouldRemoveListener);\n\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit event listener',\n element: this.element,\n name: this.name,\n value: newListener,\n options: this.options,\n removeListener: shouldRemoveListener,\n addListener: shouldAddListener,\n oldListener,\n });\n if (shouldRemoveListener) {\n this.element.removeEventListener(\n this.name,\n this,\n oldListener as EventListenerWithOptions\n );\n }\n if (shouldAddListener) {\n // Beware: IE11 and Chrome 41 don't like using the listener as the\n // options object. Figure out how to deal w/ this in IE11 - maybe\n // patch addEventListener?\n this.element.addEventListener(\n this.name,\n this,\n newListener as EventListenerWithOptions\n );\n }\n this._$committedValue = newListener;\n }\n\n handleEvent(event: Event) {\n if (typeof this._$committedValue === 'function') {\n this._$committedValue.call(this.options?.host ?? this.element, event);\n } else {\n (this._$committedValue as EventListenerObject).handleEvent(event);\n }\n }\n}\n\nexport type {ElementPart};\nclass ElementPart implements Disconnectable {\n readonly type = ELEMENT_PART;\n\n /** @internal */\n __directive?: Directive;\n\n // This is to ensure that every Part has a _$committedValue\n _$committedValue: undefined;\n\n /** @internal */\n _$parent!: Disconnectable;\n\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n options: RenderOptions | undefined;\n\n constructor(\n public element: Element,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this._$parent = parent;\n this.options = options;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n _$setValue(value: unknown): void {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit to element binding',\n element: this.element,\n value,\n options: this.options,\n });\n resolveDirective(this, value);\n }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n // Used in lit-ssr\n _boundAttributeSuffix: boundAttributeSuffix,\n _marker: marker,\n _markerMatch: markerMatch,\n _HTML_RESULT: HTML_RESULT,\n _getTemplateHtml: getTemplateHtml,\n // Used in tests and private-ssr-support\n _TemplateInstance: TemplateInstance,\n _isIterable: isIterable,\n _resolveDirective: resolveDirective,\n _ChildPart: ChildPart,\n _AttributePart: AttributePart,\n _BooleanAttributePart: BooleanAttributePart,\n _EventPart: EventPart,\n _PropertyPart: PropertyPart,\n _ElementPart: ElementPart,\n};\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litHtmlPolyfillSupportDevMode\n : global.litHtmlPolyfillSupport;\npolyfillSupport?.(Template, ChildPart);\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.2.1');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. ` +\n `Loading multiple versions is not recommended.`\n );\n}\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n * value](https://lit.dev/docs/templates/expressions/#child-expressions),\n * typically a {@linkcode TemplateResult} created by evaluating a template tag\n * like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n * the rendered value to the container, and subsequent renders will\n * efficiently update the rendered value if the same result type was\n * previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = (\n value: unknown,\n container: HTMLElement | DocumentFragment,\n options?: RenderOptions\n): RootPart => {\n if (DEV_MODE && container == null) {\n // Give a clearer error message than\n // Uncaught TypeError: Cannot read properties of null (reading\n // '_$litPart$')\n // which reads like an internal Lit error.\n throw new TypeError(`The container to render into may not be ${container}`);\n }\n const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n const partOwnerNode = options?.renderBefore ?? container;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n debugLogEvent &&\n debugLogEvent({\n kind: 'begin render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n if (part === undefined) {\n const endNode = options?.renderBefore ?? null;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n container.insertBefore(createMarker(), endNode),\n endNode,\n undefined,\n options ?? {}\n );\n }\n part._$setValue(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'end render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n render.setSanitizer = setSanitizer;\n render.createSanitizer = createSanitizer;\n if (DEV_MODE) {\n render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n * ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n * // Declare observed properties\n * static get properties() {\n * return {\n * adjective: {}\n * }\n * }\n *\n * constructor() {\n * this.adjective = 'awesome';\n * }\n *\n * // Define the element's template\n * render() {\n * return html`<p>your ${adjective} template here</p>`;\n * }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | LitUnstable.DebugLog.Entry\n | ReactiveUnstable.DebugLog.Entry;\n }\n}\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n const issuedWarnings: Set<string | undefined> =\n (globalThis.litIssuedWarnings ??= new Set());\n\n // Issue a warning, if we haven't already.\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (!issuedWarnings.has(warning)) {\n console.warn(warning);\n issuedWarnings.add(warning);\n }\n };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n // This property needs to remain unminified.\n static ['_$litElement$'] = true;\n\n /**\n * @category rendering\n */\n readonly renderOptions: RenderOptions = {host: this};\n\n private __childPart: RootPart | undefined = undefined;\n\n /**\n * @category rendering\n */\n protected override createRenderRoot() {\n const renderRoot = super.createRenderRoot();\n // When adoptedStyleSheets are shimmed, they are inserted into the\n // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n // any styles in Lit content render before adoptedStyleSheets. This is\n // important so that adoptedStyleSheets have precedence over styles in\n // the shadowRoot.\n this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n return renderRoot;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes\n * and calls `render` to render DOM via lit-html. Setting properties inside\n * this method will *not* trigger another update.\n * @param changedProperties Map of changed properties with old values\n * @category updates\n */\n protected override update(changedProperties: PropertyValues) {\n // Setting properties in `render` should not trigger an update. Since\n // updates are allowed after super.update, it's important to call `render`\n // before that.\n const value = this.render();\n if (!this.hasUpdated) {\n this.renderOptions.isConnected = this.isConnected;\n }\n super.update(changedProperties);\n this.__childPart = render(value, this.renderRoot, this.renderOptions);\n }\n\n /**\n * Invoked when the component is added to the document's DOM.\n *\n * In `connectedCallback()` you should setup tasks that should only occur when\n * the element is connected to the document. The most common of these is\n * adding event listeners to nodes external to the element, like a keydown\n * event handler added to the window.\n *\n * ```ts\n * connectedCallback() {\n * super.connectedCallback();\n * addEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * Typically, anything done in `connectedCallback()` should be undone when the\n * element is disconnected, in `disconnectedCallback()`.\n *\n * @category lifecycle\n */\n override connectedCallback() {\n super.connectedCallback();\n this.__childPart?.setConnected(true);\n }\n\n /**\n * Invoked when the component is removed from the document's DOM.\n *\n * This callback is the main signal to the element that it may no longer be\n * used. `disconnectedCallback()` should ensure that nothing is holding a\n * reference to the element (such as event listeners added to nodes external\n * to the element), so that it is free to be garbage collected.\n *\n * ```ts\n * disconnectedCallback() {\n * super.disconnectedCallback();\n * window.removeEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * An element may be re-connected after being disconnected.\n *\n * @category lifecycle\n */\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.__childPart?.setConnected(false);\n }\n\n /**\n * Invoked on each update to perform rendering tasks. This method may return\n * any value renderable by lit-html's `ChildPart` - typically a\n * `TemplateResult`. Setting properties inside this method will *not* trigger\n * the element to update.\n * @category rendering\n */\n protected render(): unknown {\n return noChange;\n }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\nglobalThis.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? globalThis.litElementPolyfillSupportDevMode\n : globalThis.litElementPolyfillSupport;\npolyfillSupport?.({LitElement});\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n _$attributeToProperty: (\n el: LitElement,\n name: string,\n value: string | null\n ) => {\n // eslint-disable-next-line\n (el as any)._$attributeToProperty(name, value);\n },\n // eslint-disable-next-line\n _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(globalThis.litElementVersions ??= []).push('4.1.1');\nif (DEV_MODE && globalThis.litElementVersions.length > 1) {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport type {Constructor} from './base.js';\n\n/**\n * Allow for custom element classes with private constructors\n */\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nexport type CustomElementDecorator = {\n // legacy\n (cls: CustomElementClass): void;\n\n // standard\n (\n target: CustomElementClass,\n context: ClassDecoratorContext<Constructor<HTMLElement>>\n ): void;\n};\n\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * ```js\n * @customElement('my-element')\n * class MyElement extends LitElement {\n * render() {\n * return html``;\n * }\n * }\n * ```\n * @category Decorator\n * @param tagName The tag name of the custom element to define.\n */\nexport const customElement =\n (tagName: string): CustomElementDecorator =>\n (\n classOrTarget: CustomElementClass | Constructor<HTMLElement>,\n context?: ClassDecoratorContext<Constructor<HTMLElement>>\n ) => {\n if (context !== undefined) {\n context.addInitializer(() => {\n customElements.define(\n tagName,\n classOrTarget as CustomElementConstructor\n );\n });\n } else {\n customElements.define(tagName, classOrTarget as CustomElementConstructor);\n }\n };\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport {\n type PropertyDeclaration,\n type ReactiveElement,\n defaultConverter,\n notEqual,\n} from '../reactive-element.js';\nimport type {Interface} from './base.js';\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n const issuedWarnings: Set<string | undefined> =\n (globalThis.litIssuedWarnings ??= new Set());\n\n // Issue a warning, if we haven't already.\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (!issuedWarnings.has(warning)) {\n console.warn(warning);\n issuedWarnings.add(warning);\n }\n };\n}\n\n// Overloads for property decorator so that TypeScript can infer the correct\n// return type when a decorator is used as an accessor decorator or a setter\n// decorator.\nexport type PropertyDecorator = {\n // accessor decorator signature\n <C extends Interface<ReactiveElement>, V>(\n target: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): ClassAccessorDecoratorResult<C, V>;\n\n // setter decorator signature\n <C extends Interface<ReactiveElement>, V>(\n target: (value: V) => void,\n context: ClassSetterDecoratorContext<C, V>\n ): (this: C, value: V) => void;\n\n // legacy decorator signature\n (\n protoOrDescriptor: Object,\n name: PropertyKey,\n descriptor?: PropertyDescriptor\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): any;\n};\n\nconst legacyProperty = (\n options: PropertyDeclaration | undefined,\n proto: Object,\n name: PropertyKey\n) => {\n const hasOwnProperty = proto.hasOwnProperty(name);\n (proto.constructor as typeof ReactiveElement).createProperty(\n name,\n hasOwnProperty ? {...options, wrapped: true} : options\n );\n // For accessors (which have a descriptor on the prototype) we need to\n // return a descriptor, otherwise TypeScript overwrites the descriptor we\n // define in createProperty() with the original descriptor. We don't do this\n // for fields, which don't have a descriptor, because this could overwrite\n // descriptor defined by other decorators.\n return hasOwnProperty\n ? Object.getOwnPropertyDescriptor(proto, name)\n : undefined;\n};\n\n// This is duplicated from a similar variable in reactive-element.ts, but\n// actually makes sense to have this default defined with the decorator, so\n// that different decorators could have different defaults.\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n hasChanged: notEqual,\n};\n\n// Temporary type, until google3 is on TypeScript 5.2\ntype StandardPropertyContext<C, V> = (\n | ClassAccessorDecoratorContext<C, V>\n | ClassSetterDecoratorContext<C, V>\n) & {metadata: object};\n\n/**\n * Wraps a class accessor or setter so that `requestUpdate()` is called with the\n * property name and old value when the accessor is set.\n */\nexport const standardProperty = <C extends Interface<ReactiveElement>, V>(\n options: PropertyDeclaration = defaultPropertyDeclaration,\n target: ClassAccessorDecoratorTarget<C, V> | ((value: V) => void),\n context: StandardPropertyContext<C, V>\n): ClassAccessorDecoratorResult<C, V> | ((this: C, value: V) => void) => {\n const {kind, metadata} = context;\n\n if (DEV_MODE && metadata == null) {\n issueWarning(\n 'missing-class-metadata',\n `The class ${target} is missing decorator metadata. This ` +\n `could mean that you're using a compiler that supports decorators ` +\n `but doesn't support decorator metadata, such as TypeScript 5.1. ` +\n `Please update your compiler.`\n );\n }\n\n // Store the property options\n let properties = globalThis.litPropertyMetadata.get(metadata);\n if (properties === undefined) {\n globalThis.litPropertyMetadata.set(metadata, (properties = new Map()));\n }\n properties.set(context.name, options);\n\n if (kind === 'accessor') {\n // Standard decorators cannot dynamically modify the class, so we can't\n // replace a field with accessors. The user must use the new `accessor`\n // keyword instead.\n const {name} = context;\n return {\n set(this: ReactiveElement, v: V) {\n const oldValue = (\n target as ClassAccessorDecoratorTarget<C, V>\n ).get.call(this as unknown as C);\n (target as ClassAccessorDecoratorTarget<C, V>).set.call(\n this as unknown as C,\n v\n );\n this.requestUpdate(name, oldValue, options);\n },\n init(this: ReactiveElement, v: V): V {\n if (v !== undefined) {\n this._$changeProperty(name, undefined, options);\n }\n return v;\n },\n } as unknown as ClassAccessorDecoratorResult<C, V>;\n } else if (kind === 'setter') {\n const {name} = context;\n return function (this: ReactiveElement, value: V) {\n const oldValue = this[name as keyof ReactiveElement];\n (target as (value: V) => void).call(this, value);\n this.requestUpdate(name, oldValue, options);\n } as unknown as (this: C, value: V) => void;\n }\n throw new Error(`Unsupported decorator location: ${kind}`);\n};\n\n/**\n * A class field or accessor decorator which creates a reactive property that\n * reflects a corresponding attribute value. When a decorated property is set\n * the element will update and render. A {@linkcode PropertyDeclaration} may\n * optionally be supplied to configure property features.\n *\n * This decorator should only be used for public fields. As public fields,\n * properties should be considered as primarily settable by element users,\n * either via attribute or the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the {@linkcode state} decorator.\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating public\n * properties should typically not be done for non-primitive (object or array)\n * properties. In other cases when an element needs to manage state, a private\n * property decorated via the {@linkcode state} decorator should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n *\n * ```ts\n * class MyElement {\n * @property({ type: Boolean })\n * clicked = false;\n * }\n * ```\n * @category Decorator\n * @ExportDecoratedItems\n */\nexport function property(options?: PropertyDeclaration): PropertyDecorator {\n return <C extends Interface<ReactiveElement>, V>(\n protoOrTarget:\n | object\n | ClassAccessorDecoratorTarget<C, V>\n | ((value: V) => void),\n nameOrContext:\n | PropertyKey\n | ClassAccessorDecoratorContext<C, V>\n | ClassSetterDecoratorContext<C, V>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): any => {\n return (\n typeof nameOrContext === 'object'\n ? standardProperty<C, V>(\n options,\n protoOrTarget as\n | ClassAccessorDecoratorTarget<C, V>\n | ((value: V) => void),\n nameOrContext as StandardPropertyContext<C, V>\n )\n : legacyProperty(\n options,\n protoOrTarget as Object,\n nameOrContext as PropertyKey\n )\n ) as PropertyDecorator;\n };\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport {property} from './property.js';\n\nexport interface StateDeclaration<Type = unknown> {\n /**\n * A function that indicates if a property should be considered changed when\n * it is set. The function should take the `newValue` and `oldValue` and\n * return `true` if an update should be requested.\n */\n hasChanged?(value: Type, oldValue: Type): boolean;\n}\n\n/**\n * @deprecated use StateDeclaration\n */\nexport type InternalPropertyDeclaration<Type = unknown> =\n StateDeclaration<Type>;\n\n/**\n * Declares a private or protected reactive property that still triggers\n * updates to the element when it changes. It does not reflect from the\n * corresponding attribute.\n *\n * Properties declared this way must not be used from HTML or HTML templating\n * systems, they're solely for properties internal to the element. These\n * properties may be renamed by optimization tools like closure compiler.\n * @category Decorator\n */\nexport function state(options?: StateDeclaration) {\n return property({\n ...options,\n // Add both `state` and `attribute` because we found a third party\n // controller that is keying off of PropertyOptions.state to determine\n // whether a field is a private internal property or not.\n state: true,\n attribute: false,\n });\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Generates a public interface type that removes private and protected fields.\n * This allows accepting otherwise incompatible versions of the type (e.g. from\n * multiple copies of the same package in `node_modules`).\n */\nexport type Interface<T> = {\n [K in keyof T]: T[K];\n};\n\nexport type Constructor<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n};\n\n/**\n * Wraps up a few best practices when returning a property descriptor from a\n * decorator.\n *\n * Marks the defined property as configurable, and enumerable, and handles\n * the case where we have a busted Reflect.decorate zombiefill (e.g. in Angular\n * apps).\n *\n * @internal\n */\nexport const desc = (\n obj: object,\n name: PropertyKey | ClassAccessorDecoratorContext<unknown, unknown>,\n descriptor: PropertyDescriptor\n) => {\n // For backwards compatibility, we keep them configurable and enumerable.\n descriptor.configurable = true;\n descriptor.enumerable = true;\n if (\n // We check for Reflect.decorate each time, in case the zombiefill\n // is applied via lazy loading some Angular code.\n (Reflect as typeof Reflect & {decorate?: unknown}).decorate &&\n typeof name !== 'object'\n ) {\n // If we're called as a legacy decorator, and Reflect.decorate is present\n // then we have no guarantees that the returned descriptor will be\n // defined on the class, so we must apply it directly ourselves.\n\n Object.defineProperty(obj, name, descriptor);\n }\n return descriptor;\n};\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\nimport type {ReactiveElement} from '../reactive-element.js';\nimport {desc, type Interface} from './base.js';\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n const issuedWarnings: Set<string | undefined> =\n (globalThis.litIssuedWarnings ??= new Set());\n\n // Issue a warning, if we haven't already.\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (!issuedWarnings.has(warning)) {\n console.warn(warning);\n issuedWarnings.add(warning);\n }\n };\n}\n\nexport type QueryDecorator = {\n // legacy\n (\n proto: Interface<ReactiveElement>,\n name: PropertyKey,\n descriptor?: PropertyDescriptor\n // Note TypeScript requires the return type to be `void|any`\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): void | any;\n\n // standard\n <C extends Interface<ReactiveElement>, V extends Element | null>(\n value: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): ClassAccessorDecoratorResult<C, V>;\n};\n\n/**\n * A property decorator that converts a class property into a getter that\n * executes a querySelector on the element's renderRoot.\n *\n * @param selector A DOMString containing one or more selectors to match.\n * @param cache An optional boolean which when true performs the DOM query only\n * once and caches the result.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector\n *\n * ```ts\n * class MyElement {\n * @query('#first')\n * first: HTMLDivElement;\n *\n * render() {\n * return html`\n * <div id=\"first\"></div>\n * <div id=\"second\"></div>\n * `;\n * }\n * }\n * ```\n * @category Decorator\n */\nexport function query(selector: string, cache?: boolean): QueryDecorator {\n return (<C extends Interface<ReactiveElement>, V extends Element | null>(\n protoOrTarget: ClassAccessorDecoratorTarget<C, V>,\n nameOrContext: PropertyKey | ClassAccessorDecoratorContext<C, V>,\n descriptor?: PropertyDescriptor\n ) => {\n const doQuery = (el: Interface<ReactiveElement>): V => {\n const result = (el.renderRoot?.querySelector(selector) ?? null) as V;\n if (DEV_MODE && result === null && cache && !el.hasUpdated) {\n const name =\n typeof nameOrContext === 'object'\n ? nameOrContext.name\n : nameOrContext;\n issueWarning(\n '',\n `@query'd field ${JSON.stringify(String(name))} with the 'cache' ` +\n `flag set for selector '${selector}' has been accessed before ` +\n `the first update and returned null. This is expected if the ` +\n `renderRoot tree has not been provided beforehand (e.g. via ` +\n `Declarative Shadow DOM). Therefore the value hasn't been cached.`\n );\n }\n // TODO: if we want to allow users to assert that the query will never\n // return null, we need a new option and to throw here if the result\n // is null.\n return result;\n };\n if (cache) {\n // Accessors to wrap from either:\n // 1. The decorator target, in the case of standard decorators\n // 2. The property descriptor, in the case of experimental decorators\n // on auto-accessors.\n // 3. Functions that access our own cache-key property on the instance,\n // in the case of experimental decorators on fields.\n const {get, set} =\n typeof nameOrContext === 'object'\n ? protoOrTarget\n : descriptor ??\n (() => {\n const key = DEV_MODE\n ? Symbol(`${String(nameOrContext)} (@query() cache)`)\n : Symbol();\n type WithCache = ReactiveElement & {\n [key: symbol]: Element | null;\n };\n return {\n get() {\n return (this as WithCache)[key];\n },\n set(v) {\n (this as WithCache)[key] = v;\n },\n };\n })();\n return desc(protoOrTarget, nameOrContext, {\n get(this: ReactiveElement): V {\n let result: V = get!.call(this);\n if (result === undefined) {\n result = doQuery(this);\n if (result !== null || this.hasUpdated) {\n set!.call(this, result);\n }\n }\n return result;\n },\n });\n } else {\n // This object works as the return type for both standard and\n // experimental decorators.\n return desc(protoOrTarget, nameOrContext, {\n get(this: ReactiveElement) {\n return doQuery(this);\n },\n });\n }\n }) as QueryDecorator;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport type {ReactiveElement} from '../reactive-element.js';\nimport type {QueryAssignedNodesOptions} from './query-assigned-nodes.js';\nimport {desc, type Interface} from './base.js';\n\nexport type QueryAssignedElementsDecorator = {\n // legacy\n (\n proto: Interface<ReactiveElement>,\n name: PropertyKey,\n descriptor?: PropertyDescriptor\n // Note TypeScript requires the return type to be `void|any`\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): void | any;\n\n // standard\n <C extends Interface<ReactiveElement>, V extends Array<Element>>(\n value: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): ClassAccessorDecoratorResult<C, V>;\n};\n\n/**\n * Options for the {@linkcode queryAssignedElements} decorator. Extends the\n * options that can be passed into\n * [HTMLSlotElement.assignedElements](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement/assignedElements).\n */\nexport interface QueryAssignedElementsOptions\n extends QueryAssignedNodesOptions {\n /**\n * CSS selector used to filter the elements returned. For example, a selector\n * of `\".item\"` will only include elements with the `item` class.\n */\n selector?: string;\n}\n\n/**\n * A property decorator that converts a class property into a getter that\n * returns the `assignedElements` of the given `slot`. Provides a declarative\n * way to use\n * [`HTMLSlotElement.assignedElements`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement/assignedElements).\n *\n * Can be passed an optional {@linkcode QueryAssignedElementsOptions} object.\n *\n * Example usage:\n * ```ts\n * class MyElement {\n * @queryAssignedElements({ slot: 'list' })\n * listItems!: Array<HTMLElement>;\n * @queryAssignedElements()\n * unnamedSlotEls!: Array<HTMLElement>;\n *\n * render() {\n * return html`\n * <slot name=\"list\"></slot>\n * <slot></slot>\n * `;\n * }\n * }\n * ```\n *\n * Note, the type of this property should be annotated as `Array<HTMLElement>`.\n *\n * @category Decorator\n */\nexport function queryAssignedElements(\n options?: QueryAssignedElementsOptions\n): QueryAssignedElementsDecorator {\n return (<V extends Array<Element>>(\n obj: object,\n name: PropertyKey | ClassAccessorDecoratorContext<unknown, unknown>\n ) => {\n const {slot, selector} = options ?? {};\n const slotSelector = `slot${slot ? `[name=${slot}]` : ':not([name])'}`;\n return desc(obj, name, {\n get(this: ReactiveElement): V {\n const slotEl =\n this.renderRoot?.querySelector<HTMLSlotElement>(slotSelector);\n const elements = slotEl?.assignedElements(options) ?? [];\n return (\n selector === undefined\n ? elements\n : elements.filter((node) => node.matches(selector))\n ) as V;\n },\n });\n }) as QueryAssignedElementsDecorator;\n}\n","import { createContext } from '@lit/context';\nimport { QtiAssessmentTest } from '../qti-assessment-test';\nimport { ItemContext, VariableDeclaration } from '../../qti-components';\n\nexport interface TestContext {\n items: (ItemContext & { category?: string })[];\n testOutcomeVariables: VariableDeclaration<string | string[]>[];\n}\n\nexport const testContext = createContext<Readonly<TestContext>>(Symbol('test'));\n\nexport type TestElement = {\n el: QtiAssessmentTest;\n};\n\nexport const testElement = createContext<Readonly<TestElement>>(Symbol('testElement'));\n","import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { testContext, TestContext } from '../context';\nimport { QtiAssessmentItem } from '../../qti-components';\n\n// Converter function to interpret \"true\" and \"false\" as booleans\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\n// @customElement('qti-assessment-item-ref')\nexport class QtiAssessmentItemRef extends LitElement {\n @property({ type: String }) category?: string;\n @property({ type: String }) identifier?: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) required?: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed?: boolean;\n @property({ type: String }) href?: string;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n weigths: Map<string, number> = new Map();\n\n @property({ type: Object, attribute: false })\n xmlDoc!: DocumentFragment; // the XMLDocument\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n get assessmentItem(): QtiAssessmentItem | null {\n return this.renderRoot?.querySelector('qti-assessment-item');\n }\n\n async connectedCallback(): Promise<void> {\n // debugger;\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-assessment-item-ref-connected', {\n bubbles: true,\n composed: true,\n detail: { identifier: this.identifier, href: this.href, category: this.category }\n })\n );\n }\n\n render() {\n return html`${this.xmlDoc}`;\n }\n}\n\nif (!customElements.get('qti-assessment-item-ref')) {\n customElements.define('qti-assessment-item-ref', QtiAssessmentItemRef);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item-ref': QtiAssessmentItemRef;\n }\n}\n","import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { testContext, TestContext } from '../context';\n\n// https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#Root_AssessmentSection\n\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\nexport class QtiAssessmentSection extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) required: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed: boolean;\n @property({ type: String }) title: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) visible: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter, attribute: 'keep-together' }) keepTogether: boolean;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-assessment-section-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html`<slot name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-assessment-section')) {\n customElements.define('qti-assessment-section', QtiAssessmentSection);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-section': QtiAssessmentSection;\n }\n}\n","import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { testContext, TestContext } from '../context';\n\n@customElement('qti-assessment-test')\nexport class QtiAssessmentTest extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) title: string;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-assessment-test-connected', {\n detail: this,\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-test': QtiAssessmentTest;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n@customElement('qti-test-part')\nexport class QtiTestPart extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) title: string = '';\n @property({ type: String }) class: string = '';\n\n @property({ type: String, attribute: 'navigation-mode' })\n NavigationMode: 'linear' | 'nonlinear' = 'nonlinear';\n\n @property({ type: String, attribute: 'submission-mode' })\n submissionMode: 'individual' | 'simultaneous' = 'individual';\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-test-part-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-test-part')) {\n customElements.define('qti-test-part', QtiTestPart);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test-part': QtiTestPart;\n }\n}\n","const xml = String.raw;\n\n/* <!-- convert CDATA to comments -->\n <xsl:template match=\"text()[contains(., 'CDATA')]\">\n <xsl:comment>\n <xsl:value-of select=\".\"/>\n </xsl:comment>\n</xsl:template>\n*/\n\n/*\n <!-- remove xml comments -->\n <xsl:template match=\"comment()\" />\n */\n\nconst xmlToHTML = xml`<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n<xsl:output method=\"html\" version=\"5.0\" encoding=\"UTF-8\" indent=\"yes\" />\n <xsl:template match=\"@*|node()\">\n <xsl:copy>\n <xsl:apply-templates select=\"@*|node()\"/>\n </xsl:copy>\n </xsl:template>\n\n <!-- remove existing namespaces -->\n <xsl:template match=\"*\">\n <!-- remove element prefix -->\n <xsl:element name=\"{local-name()}\">\n <!-- process attributes -->\n <xsl:for-each select=\"@*\">\n <!-- remove attribute prefix -->\n <xsl:attribute name=\"{local-name()}\">\n <xsl:value-of select=\".\"/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>`;\n\n// Function to extend elements with a specific tag name by adding an extension suffix\nexport function extendElementName(xmlFragment: XMLDocument, tagName: string, extension: string) {\n xmlFragment.querySelectorAll(tagName).forEach(element => {\n const newTagName = `${tagName}-${extension}`;\n const newElement = createElementWithNewTagName(element, newTagName);\n element.replaceWith(newElement);\n });\n}\n\n// Function to extend any element with a specific class pattern (e.g., \"extend:suffix\")\nexport function extendElementsWithClass(xmlFragment: XMLDocument, classNamePattern: string) {\n xmlFragment.querySelectorAll('*').forEach(element => {\n const classList = element.classList;\n if (classList) {\n classList.forEach(className => {\n if (className.startsWith(`${classNamePattern}:`)) {\n const suffix = className.slice(`${classNamePattern}:`.length);\n const newTagName = `${element.nodeName}-${suffix}`;\n const newElement = createElementWithNewTagName(element, newTagName);\n element.replaceWith(newElement);\n }\n });\n }\n });\n}\n\n// Helper function to create a new element with a new tag name and copy attributes and children\nfunction createElementWithNewTagName(element, newTagName) {\n const newElement = document.createElement(newTagName);\n // Copy attributes\n for (const attr of element.attributes) {\n newElement.setAttribute(attr.name, attr.value);\n }\n // Copy child nodes\n while (element.firstChild) {\n newElement.appendChild(element.firstChild);\n }\n return newElement;\n}\n\nexport function itemsFromTest(xmlFragment: DocumentFragment) {\n const items: { identifier: string; href: string; category: string }[] = [];\n xmlFragment.querySelectorAll('qti-assessment-item-ref').forEach(el => {\n const identifier = el.getAttribute('identifier');\n const href = el.getAttribute('href');\n const category = el.getAttribute('category');\n items.push({ identifier, href, category });\n });\n return items;\n}\n\nlet currentRequest: XMLHttpRequest | null = null;\n\nexport function loadXML(url, cancelPreviousRequest = false) {\n if (cancelPreviousRequest && currentRequest !== null) {\n currentRequest.abort(); // Abort the ongoing request if there is one\n }\n\n return new Promise<XMLDocument | null>((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n currentRequest = xhr; // Store the current request\n\n xhr.open('GET', url, true);\n xhr.responseType = 'document';\n\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.responseXML);\n } else {\n reject(xhr.statusText);\n }\n };\n\n xhr.onerror = () => {\n reject(xhr.statusText);\n };\n\n xhr.send();\n });\n}\n\nexport function parseXML(xmlDocument: string) {\n const parser = new DOMParser();\n const xmlFragment = parser.parseFromString(xmlDocument, 'text/xml');\n return xmlFragment;\n}\n\nexport function toHTML(xmlFragment: Document): DocumentFragment {\n const processor = new XSLTProcessor();\n const xsltDocument = new DOMParser().parseFromString(xmlToHTML, 'text/xml');\n processor.importStylesheet(xsltDocument);\n const itemHTMLFragment = processor.transformToFragment(xmlFragment, document);\n return itemHTMLFragment;\n}\n\nexport function setLocation(xmlFragment: DocumentFragment, location: string) {\n if (!location.endsWith('/')) {\n location += '/';\n }\n\n xmlFragment.querySelectorAll('[src],[href],[primary-path]').forEach(elWithSrc => {\n let attr: 'src' | 'href' | 'primary-path' | '' = '';\n\n if (elWithSrc.getAttribute('src')) {\n attr = 'src';\n }\n if (elWithSrc.getAttribute('href')) {\n attr = 'href';\n }\n if (elWithSrc.getAttribute('primary-path')) {\n attr = 'primary-path';\n }\n const attrValue = elWithSrc.getAttribute(attr)?.trim();\n\n if (!attrValue.startsWith('data:') && !attrValue.startsWith('http')) {\n const newSrcValue = location + encodeURI(attrValue);\n elWithSrc.setAttribute(attr, newSrcValue);\n }\n });\n}\n\nexport function convertCDATAtoComment(xmlFragment: DocumentFragment) {\n const cdataElements = xmlFragment.querySelectorAll('qti-custom-operator[class=\"js.org\"] > qti-base-value');\n cdataElements.forEach(element => {\n const commentText = document.createComment(element.textContent);\n element.replaceChild(commentText, element.firstChild);\n });\n}\n\nexport function stripStyleSheets(xmlFragment: DocumentFragment) {\n // remove qti-stylesheet tag\n xmlFragment.querySelectorAll('qti-stylesheet').forEach(stylesheet => stylesheet.remove());\n}\n","/**\n * Browser based QTI-XML to HTML transformer.\n * Returns an object with methods to load, parse, transform and serialize QTI XML items.\n * @returns An object with methods to load, parse, transform and serialize QTI XML items.\n * @example\n * const qtiTransformer = qtiTransformItem();\n * await qtiTransformer.load('path/to/xml/file.xml');\n * qtiTransformer.path('/assessmentItem/itemBody');\n * const html = qtiTransformer.html();\n * const xml = qtiTransformer.xml();\n * const htmldoc = qtiTransformer.htmldoc();\n * const xmldoc = qtiTransformer.xmldoc();\n *\n * qtiTransformItem().parse(storyXML).html()\n */\n\nimport {\n convertCDATAtoComment,\n extendElementName,\n extendElementsWithClass,\n loadXML,\n parseXML,\n setLocation,\n stripStyleSheets,\n toHTML\n} from './qti-transformers';\n\nexport type transformItemApi = {\n load: (uri: string, cancelPreviousRequest?: boolean) => Promise<transformItemApi>;\n parse: (xmlString: string) => transformItemApi;\n path: (location: string) => transformItemApi;\n fn: (fn: (xmlFragment: XMLDocument) => void) => transformItemApi;\n pciHooks: (uri: string) => transformItemApi;\n extendElementName: (elementName: string, extend: string) => transformItemApi;\n extendElementsWithClass: (param?: string) => transformItemApi;\n customInteraction: (baseRef: string, baseItem: string) => transformItemApi;\n convertCDATAtoComment: () => transformItemApi;\n stripStyleSheets: () => transformItemApi;\n html: () => string;\n xml: () => string;\n htmlDoc: () => DocumentFragment;\n xmlDoc: () => XMLDocument;\n};\n\nexport const qtiTransformItem = () => {\n let xmlFragment: XMLDocument;\n\n const api: transformItemApi = {\n async load(uri: string, cancelPreviousRequest = false): Promise<typeof api> {\n return new Promise<typeof api>(resolve => {\n loadXML(uri, cancelPreviousRequest).then(xml => {\n xmlFragment = xml;\n // set the base path for images and other resources,\n // you probably want to set the base path to the document root else you can use the path method to set it\n api.path(uri.substring(0, uri.lastIndexOf('/')));\n return resolve(api);\n });\n });\n },\n parse(xmlString: string): typeof api {\n xmlFragment = parseXML(xmlString);\n return api;\n },\n path: (location: string): typeof api => {\n setLocation(xmlFragment, location);\n return api;\n },\n fn(fn: (xmlFragment: XMLDocument) => void): typeof api {\n fn(xmlFragment);\n return api;\n },\n pciHooks(uri: string): typeof api {\n const attributes = ['hook', 'module'];\n const documentPath = uri.substring(0, uri.lastIndexOf('/'));\n for (const attribute of attributes) {\n const srcAttributes = xmlFragment.querySelectorAll('[' + attribute + ']');\n srcAttributes.forEach(node => {\n const srcValue = node.getAttribute(attribute)!;\n if (!srcValue.startsWith('data:') && !srcValue.startsWith('http')) {\n // Just paste the relative path of the src location after the documentrootPath\n // old pcis can have a .js, new pci's don't\n node.setAttribute('base-url', uri);\n node.setAttribute(\n 'module',\n documentPath + '/' + encodeURI(srcValue + (srcValue.endsWith('.js') ? '' : '.js'))\n );\n }\n });\n }\n return api;\n },\n extendElementName: (tagName: string, extension: string): typeof api => {\n extendElementName(xmlFragment, tagName, extension);\n return api;\n },\n extendElementsWithClass: (param: string = 'extend'): typeof api => {\n extendElementsWithClass(xmlFragment, param);\n return api;\n },\n customInteraction(baseRef: string, baseItem: string): typeof api {\n const qtiCustomInteraction = xmlFragment.querySelector('qti-custom-interaction');\n const qtiCustomInteractionObject = qtiCustomInteraction.querySelector('object');\n\n qtiCustomInteraction.setAttribute('data-base-ref', baseRef);\n qtiCustomInteraction.setAttribute('data-base-item', baseRef + baseItem);\n qtiCustomInteraction.setAttribute('data', qtiCustomInteractionObject.getAttribute('data'));\n qtiCustomInteraction.setAttribute('width', qtiCustomInteractionObject.getAttribute('width'));\n qtiCustomInteraction.setAttribute('height', qtiCustomInteractionObject.getAttribute('height'));\n\n qtiCustomInteraction.removeChild(qtiCustomInteractionObject);\n return api;\n },\n convertCDATAtoComment(): typeof api {\n convertCDATAtoComment(xmlFragment);\n return api;\n },\n stripStyleSheets(): typeof api {\n stripStyleSheets(xmlFragment);\n return api;\n },\n html() {\n return new XMLSerializer().serializeToString(toHTML(xmlFragment));\n },\n xml(): string {\n return new XMLSerializer().serializeToString(xmlFragment);\n },\n htmlDoc() {\n return toHTML(xmlFragment);\n },\n xmlDoc(): XMLDocument {\n return xmlFragment; // new XMLSerializer().serializeToString(xmlFragment);\n }\n };\n return api;\n};\n","/**\n * Returns an object with methods to load, parse and transform QTI tests.\n * @returns An object with methods to load, parse and transform QTI tests.\n * @example\n * const qtiTransformer = qtiTransformTest();\n * await qtiTransformer.load('https://example.com/test.xml');\n * const items = qtiTransformer.items();\n * const html = qtiTransformer.html();\n * const xml = qtiTransformer.xml();\n */\n\nimport { itemsFromTest, loadXML, parseXML, toHTML } from './qti-transformers';\n\nexport type transformTestApi = {\n load: (uri: string) => Promise<transformTestApi>;\n parse: (xmlString: string) => transformTestApi;\n fn: (fn: (xmlFragment: XMLDocument) => void) => transformTestApi;\n items: () => { identifier: string; href: string; category: string }[];\n html: () => string;\n xml: () => string;\n htmlDoc: () => DocumentFragment;\n xmlDoc: () => XMLDocument;\n};\n\nexport const qtiTransformTest = (): transformTestApi => {\n let xmlFragment: XMLDocument;\n\n const api: transformTestApi = {\n async load(uri) {\n return new Promise<transformTestApi>((resolve, _) => {\n loadXML(uri).then(xml => {\n xmlFragment = xml;\n return resolve(api);\n });\n });\n },\n parse(xmlString: string) {\n xmlFragment = parseXML(xmlString);\n return api;\n },\n fn(fn: (xmlFragment: XMLDocument) => void) {\n fn(xmlFragment);\n return api;\n },\n items() {\n return itemsFromTest(xmlFragment);\n },\n html() {\n return new XMLSerializer().serializeToString(toHTML(xmlFragment));\n },\n xml(): string {\n return new XMLSerializer().serializeToString(xmlFragment);\n },\n htmlDoc() {\n return toHTML(xmlFragment);\n },\n xmlDoc(): XMLDocument {\n return xmlFragment;\n }\n };\n return api;\n};\n","import { LitElement } from 'lit';\nimport { qtiTransformItem, qtiTransformTest } from '../../qti-transformers';\n\n// const setSessionData = <T>(key: string, value?: T): void => sessionStorage.setItem(key, JSON.stringify(value));\n// const getSessionData = <T>(key: string): T | null => (sessionStorage.getItem(key) ? JSON.parse(sessionStorage.getItem(key)!) : null);\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestLoaderInterface {}\nexport const TestLoaderMixin = <T extends Constructor<LitElement>>(superClass: T) => {\n abstract class TestLoaderClass extends superClass {\n private testURL = '';\n\n constructor(...args: any[]) {\n super(...args);\n\n this.addEventListener('qti-load-test-request', (e: CustomEvent /* 1. Request the test */) => {\n const { testURL } = e.detail;\n if (!testURL) {\n console.warn(\n 'No test found, there should be an attribute test-url with the path to the test on the test-container'\n );\n } else {\n this.testURL = testURL;\n }\n\n e.detail.promise = (async () => {\n e.preventDefault(); /* indicates that the event was catched and handled */\n const api = await qtiTransformTest().load(`${this.testURL}`); /* 6. load the item */\n return api.htmlDoc(); /* 3. Return html version of the assessment.xml */\n })();\n });\n\n this.addEventListener('qti-assessment-test-connected', () => {\n // this.context = getSessionData(`testcontext-${this.testURL}`); /* 4. Set the context */\n });\n\n this.addEventListener('qti-load-item-request' /* 5. Request the item */, ({ detail }: CustomEvent) => {\n if (!this.testURL) return;\n detail.promise = (async () => {\n const api = await qtiTransformItem().load(\n `${this.testURL.slice(0, this.testURL.lastIndexOf('/'))}/${detail.href}`,\n detail.cancelPreviousRequest\n ); /* 6. load the item */\n return api.htmlDoc(); /* 7. Return HTML version of the item.xml */\n })();\n });\n\n this.addEventListener('qti-interaction-changed', _e => {\n /* 8. Interaction changed */\n // const scoreOutcomeIdentifier = qtiAssessmentItem.variables.find(v => v.identifier === 'SCORE') as OutcomeVariable;\n // if (scoreOutcomeIdentifier.externalScored === null && qtiAssessmentItem.adaptive === 'false') {\n // qtiAssessmentItem.processResponse(); /* 9. Process the response */\n // }\n // setSessionData(`testcontext-${this.testURL}`, this.context); /* 10. Update the context */\n });\n\n this.addEventListener('qti-outcome-changed', () => {\n // setSessionData(`testcontext-${this.testURL}`, this.context); /* 10. Update the context */\n });\n }\n }\n\n return TestLoaderClass as Constructor<TestLoaderInterface> & T;\n};\n","import { QtiAssessmentItemRef } from '../qti-assessment-test';\nimport { TestBase } from '../test-base';\n\ndeclare module '../context/test.context' {\n interface TestContext {\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n }\n}\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestNavigationInterface {}\nexport const TestNavigationMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestNavigationClass extends superClass {\n constructor(...args: any[]) {\n super(...args);\n\n // this.addEventListener('qti-request-test-part', (e: CustomEvent) => {\n // this._clearLoadedItems();\n // });\n\n // Load all items of a section\n // this.addEventListener('qti-request-test-section', ({ detail: navSectionId }: CustomEvent<string>) => {\n // this._clearLoadedItems();\n\n // const sectionRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>(\n // `qti-assessment-section[identifier=\"${navSectionId}\"]`\n // );\n\n // const itemRefEls = this.testElement.el.querySelectorAll(\n // `qti-assessment-section[identifier=\"${navSectionId}\"] > qti-assessment-item-ref`\n // );\n\n // const navPartId = sectionRefEl.closest('qti-test-part').identifier;\n\n // this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId: null };\n\n // const items = Array.from(itemRefEls).map((itemRef: QtiAssessmentItemRef) => {\n // return { identifier: itemRef.identifier, href: itemRef.href, element: itemRef };\n // });\n\n // const promises = items.map((item, index) => {\n // return new Promise((resolve, reject) => {\n // return this._loadItemRequest(item.href, false)\n // .then(doc => (item.element.xmlDoc = doc))\n // .then(() => resolve(item))\n // .catch(error => console.error('Failed to load item:', error));\n // });\n // });\n\n // Promise.all(promises)\n // .then(results => {\n // requestAnimationFrame(() =>\n // this.dispatchEvent(new CustomEvent('qti-test-connected', { detail: results, bubbles: true, composed: true }))\n // );\n // })\n // .catch(error => console.error('One or more promises failed:', error));\n // });\n\n // load an item\n this.addEventListener('qti-request-test-item', ({ detail: navItemId }: CustomEvent<string>) => {\n if (!navItemId) return;\n this._clearLoadedItems();\n\n const itemRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${navItemId}\"]`\n );\n\n const promise = this._loadItemRequest(itemRefEl.href, false);\n\n const navPartId = itemRefEl.closest('qti-test-part').identifier;\n const navSectionId = itemRefEl.closest('qti-assessment-section').identifier;\n this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId, navItemLoading: true };\n\n if (promise) {\n promise\n .then(doc => {\n itemRefEl.xmlDoc = doc;\n requestAnimationFrame(() =>\n this.dispatchEvent(new CustomEvent('qti-item-connected', { bubbles: true, composed: true }))\n );\n this._testContext = { ...this._testContext, navItemLoading: false };\n })\n .catch(error => console.error('Failed to load item:', error));\n } else {\n console.info('Load item request was not handled:', itemRefEl.href);\n }\n });\n\n this.addEventListener('qti-assessment-test-connected', () => {\n let navItemId = this._testContext.navItemId;\n if (!navItemId) {\n const itemRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>('qti-assessment-item-ref');\n navItemId = itemRefEl.identifier;\n }\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', { detail: navItemId, bubbles: true, composed: true })\n );\n });\n }\n\n private _clearLoadedItems(): void {\n const itemRefEls = this.testElement.el.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);\n Array.from(itemRefEls).forEach((itemElement: QtiAssessmentItemRef) => {\n itemElement.xmlDoc = null;\n });\n }\n\n private _loadItemRequest(href: string, cancelPreviousRequest: boolean = true): Promise<DocumentFragment> {\n const event = new CustomEvent('qti-load-item-request', {\n bubbles: true,\n composed: true,\n detail: {\n href: href,\n promise: null,\n cancelPreviousRequest\n }\n });\n this.dispatchEvent(event);\n\n return event.detail.promise;\n }\n }\n\n return TestNavigationClass as Constructor<TestNavigationInterface> & T;\n};\n","import { QtiAssessmentItem } from '../../qti-components';\nimport { TestBase } from '../test-base';\n\nexport type View = 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor' | '';\n\ndeclare module '../context' {\n interface TestContext {\n view?: View;\n }\n}\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestViewInterface {}\n\nexport const TestViewMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestViewClass extends superClass {\n constructor(...args: any[]) {\n super(...args);\n this._testContext = { ...this._testContext, view: 'candidate' };\n\n this.addEventListener('on-test-switch-view', (e: CustomEvent<View>) => {\n this._testContext = { ...this._testContext, view: e.detail };\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-test-connected', () => {\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent) => {\n this._updateElementView();\n this._setCorrectResponseVisibility(e.detail);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n // if (previousContext && previousContext.view !== this._testContext.view) {\n this._updateElementView();\n // }\n }\n }\n\n // Method to handle view updates for elements based on the current context view\n private _updateElementView() {\n if (this.testElement && this.testElement.el) {\n const viewElements = Array.from(this.testElement.el.querySelectorAll('[view]'));\n\n viewElements.forEach((element: HTMLElement) => {\n element.classList.toggle('show', element.getAttribute('view') === this._testContext.view);\n });\n\n const assessmentItem = this.testElement.el.querySelector<QtiAssessmentItem>(\n `qti-assessment-item[identifier=\"${this._testContext.navItemId}\"]`\n );\n if (assessmentItem) {\n assessmentItem.showCorrectResponse(this._testContext.view === 'scorer');\n }\n }\n }\n\n // Event handler for connected QTI assessment items\n private _setCorrectResponseVisibility(assessmentItem: QtiAssessmentItem): void {\n assessmentItem.showCorrectResponse(this._testContext.view === 'scorer');\n }\n }\n\n return TestViewClass as Constructor<TestViewInterface> & T;\n};\n","import { provide } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { TestContext, testContext, TestElement, testElement } from './context';\nimport { QtiAssessmentTest } from './qti-assessment-test';\nimport { ItemContext, QtiAssessmentItem, VariableValue } from '../qti-components';\n\nexport abstract class TestBase extends LitElement {\n @state()\n @provide({ context: testContext })\n protected _testContext: Readonly<TestContext> = { items: [], testOutcomeVariables: [] };\n\n @state()\n @provide({ context: testElement })\n protected testElement: TestElement = { el: null };\n\n constructor() {\n super();\n\n this.addEventListener('qti-assessment-test-connected', (e: CustomEvent<QtiAssessmentTest>) => {\n const qtiAssessmentTest = e.detail;\n\n const items = Array.from(qtiAssessmentTest.querySelectorAll('qti-assessment-item-ref')).map(\n (itemRef): ItemContext & { category: string } => ({\n href: itemRef.href,\n identifier: itemRef.identifier,\n category: itemRef.category,\n variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]\n })\n );\n this.testElement = { el: qtiAssessmentTest };\n this._testContext = { ...this._testContext, items };\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent<QtiAssessmentItem>) => {\n this._updateItemInTestContext(e.detail);\n });\n this.addEventListener('qti-outcome-changed', e => {\n const assessmentitem = e.composedPath()[0] as QtiAssessmentItem;\n this._updateItemVariablesInTestContext(assessmentitem.identifier, assessmentitem.variables);\n });\n\n // this.addEventListener(\n // 'qti-assessment-item-ref-connected',\n // (e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }) => {\n // this._addItemToTestContext(e);\n // }\n // );\n }\n\n get context(): TestContext {\n return this._testContext;\n }\n\n // /* restores the context by updating existing items and adding new items from the \"contextToRestore\" parameter into the \"this._context.items\" array. */\n set context(testContext: TestContext) {\n if (testContext === null || testContext === undefined) return;\n this._testContext = { ...testContext }; // Clone the context to avoid modifying the original object\n // // append the items that are not yet in the context and replace the ones that are\n testContext.items?.forEach(itemContext => {\n const existingItemContext = this._testContext.items.find(i => i.identifier === itemContext.identifier);\n if (existingItemContext) {\n existingItemContext.variables = itemContext.variables;\n } else {\n this._testContext.items.push(itemContext);\n }\n });\n }\n\n private _updateItemVariablesInTestContext(\n identifier: string,\n variables: VariableValue<string | string[] | null>[]\n ): void {\n // Update the test context with modified variables for the specified item\n this._testContext = {\n ...this._testContext, // Spread existing test context properties\n items: this._testContext.items.map(itemContext => {\n // If the item identifier doesn't match, keep it unchanged\n if (itemContext.identifier !== identifier) {\n return itemContext;\n }\n\n // Update the matching item with new variables\n return {\n ...itemContext, // Keep other properties of the item context\n variables: variables.map(variable => {\n // Find a matching variable in the current item context\n const matchingVariable = itemContext.variables.find(v => v.identifier === variable.identifier);\n\n // Merge matching variable with the new one, or use the new variable if no match\n return matchingVariable ? { ...matchingVariable, ...variable } : variable;\n })\n };\n })\n };\n }\n\n /**\n * Updates the variables of an assessment item in the test context.\n * - Matches the assessment item with the corresponding test context item.\n * - If the item is not found, logs a warning.\n * - Updates variables in the test context if exactly one variable exists.\n * - Otherwise, syncs the assessment item's variables with the test context.\n *\n * @param assessmentItem - The assessment item to update.\n */\n private _updateItemInTestContext = (assessmentItem: QtiAssessmentItem): void => {\n const { identifier, variables } = assessmentItem;\n\n // console.log(this._testContext);\n\n // Find the corresponding item in the test context by identifier\n const itemContext = this._testContext.items.find(i => i?.identifier === identifier);\n\n if (!itemContext) {\n console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);\n return;\n }\n\n // Update variables in the test context or sync them to the assessment item\n if (itemContext.variables?.length === 1) {\n // The loaded qti-assessment-item itself has variables which are not in test context yet.\n this._updateItemVariablesInTestContext(identifier, variables);\n } else {\n // Sync the assessment item's variables with the test context\n assessmentItem.variables = [...(itemContext.variables || [])];\n }\n };\n\n // private _addItemToTestContext(\n // e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }\n // ): void {\n // const { href, identifier, category } = e.detail;\n\n // // Update test context items, adding a new item if the identifier is not already in the list\n // if (!this._testContext.items.some(item => item.identifier === identifier)) {\n // this._testContext.items.push({\n // href,\n // identifier,\n // category,\n // variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]\n // // category: e.target.category\n // });\n // }\n // }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('qti-test', '');\n }\n}\n","import { html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestLoaderMixin, TestNavigationMixin, TestViewMixin } from './mixins';\nimport { TestBase } from './test-base';\n\n/**\n * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n *\n * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n *\n * ### Example Usage\n *\n * Minimal markup:\n * ```html\n * <qti-test test=\"./path/to/assessment.xml\">\n * <test-container></test-container>\n * </qti-test>\n * ```\n *\n * With navigation buttons:\n * ```html\n * <qti-test >\n * <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n * <div class=\"flex\">\n * <test-prev></test-prev>\n * <test-next></test-next>\n * </div>\n * </qti-test>\n * ```\n *\n * You can use normal class names to style the elements.\n * And you can use the `test-prev` and `test-next` elements to navigate through the test.\n *\n * @attr {string} testURL - the relative location to the QTI assessment.xml file\n *\n * ### Features\n *\n * - **Dynamic Template Loading**:\n * If a `<template>` element is included as a child of `<qti-test>`, its content is dynamically appended to the shadow DOM.\n */\n@customElement('qti-test')\nexport class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {\n /**\n * Lifecycle callback invoked when the element is added to the DOM.\n * Automatically appends the content of a `<template>` element (if present)\n * to the shadow DOM.\n */\n override connectedCallback() {\n super.connectedCallback();\n const template = this.querySelector(':scope > template') as HTMLTemplateElement;\n if (template) {\n this.shadowRoot?.appendChild(template.content);\n }\n }\n\n /**\n * Renders the component's template.\n * Provides a default `<slot>` for content projection.\n */\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test': QtiTest;\n }\n}\n","// /* eslint-disable lit-plugin(no-invalid-css) */\nimport { css } from 'lit';\n\nexport const form = css`\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n`;\n\nexport const btn = css`\n background-color: lightgray;\n ${form};\n`;\n\nexport const dis = css`\n cursor: not-allowed;\n opacity: 0.5;\n`;\n\nexport const ind = css`\n ${form};\n border: 1px solid gray;\n`;\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n\nimport type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\ntype UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface LiveQueryOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n}\n\nexport function liveQuery(querySelector: string, _options?: LiveQueryOptions) {\n let observer: MutationObserver;\n // const resolvedOptions: Required<LiveQueryOptions> = {\n // ...options\n // };\n return <ElemClass extends LitElement>(\n proto: ElemClass,\n decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>\n ): void => {\n const { connectedCallback, disconnectedCallback } = proto;\n\n proto.connectedCallback = function (this: ElemClass) {\n connectedCallback.call(this);\n const callback = (mutationList: MutationRecord[]) => {\n const elementsToWatch = Array.from(this.querySelectorAll(querySelector)).concat(\n Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])\n );\n for (const mutation of mutationList) {\n const addedNodes = Array.from(mutation.addedNodes).map(e => e as Element);\n const removedNodes = Array.from(mutation.addedNodes).map(e => e as Element);\n if (mutation.type === 'childList' && addedNodes.find(n => elementsToWatch.includes(n))) {\n (this[decoratedFnName] as unknown as UpdateHandler)(addedNodes, removedNodes);\n }\n }\n };\n observer = new MutationObserver(callback);\n observer.observe(this, { childList: true, subtree: true });\n\n const elementsAdded = Array.from(this.querySelectorAll(querySelector)).concat(\n Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])\n );\n (this[decoratedFnName] as unknown as UpdateHandler)(Array.from(elementsAdded), []);\n };\n\n proto.disconnectedCallback = function (this: ElemClass) {\n disconnectedCallback.call(this);\n observer.disconnect();\n };\n };\n}\n","import type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\nexport type UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface WatchOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n waitUntilFirstUpdate?: boolean;\n}\n\n/**\n * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an\n * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the\n * initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n *\n * Usage:\n *\n * @watch('propName')\n * handlePropChange(oldValue, newValue) {\n * ...\n * }\n */\nexport function watch(propertyName: string | string[], options?: WatchOptions) {\n const resolvedOptions: Required<WatchOptions> = {\n waitUntilFirstUpdate: false,\n ...options\n };\n return <ElemClass extends LitElement>(\n proto: ElemClass,\n decoratedFnName: UpdateHandlerFunctionKeys<ElemClass> | any\n ) => {\n // @ts-expect-error - update is a protected property\n const { update } = proto;\n const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];\n\n // @ts-expect-error - update is a protected property\n proto.update = function (this: ElemClass, changedProps: Map<keyof ElemClass, ElemClass[keyof ElemClass]>) {\n watchedProperties.forEach(property => {\n const key = property as keyof ElemClass;\n if (changedProps.has(key)) {\n const oldValue = changedProps.get(key);\n const newValue = this[key];\n\n if (oldValue !== newValue) {\n if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {\n (this[decoratedFnName] as unknown as UpdateHandler)(oldValue, newValue);\n }\n }\n }\n });\n\n update.call(this, changedProps);\n };\n };\n}\n","import { ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { PropertyDeclaration } from 'lit';\n\n// Extended decorator options\ninterface InternalStateOptions extends PropertyDeclaration {\n aria?: string; // Corresponding ARIA attribute, e.g., 'aria-disabled'\n}\n\nexport function propInternalState(options: InternalStateOptions) {\n return (protoOrDescriptor: any, name: string) => {\n // Apply the default Lit `@property` decorator\n property(options)(protoOrDescriptor, name);\n\n // Intercept the property descriptor to enhance functionality\n const key = `__${name}`; // Internal backing field\n\n Object.defineProperty(protoOrDescriptor, name, {\n get() {\n return this[key];\n },\n set(value: any) {\n const oldValue = this[key];\n this[key] = value;\n\n // Trigger updates if value changes\n if (oldValue !== value) {\n // Update internals state\n if (this._internals?.states) {\n const stateName = name.toLowerCase();\n if (value) {\n this._internals.states.add(`--${stateName}`);\n } else {\n this._internals.states.delete(`--${stateName}`);\n }\n }\n\n // Update ARIA attributes if specified\n if (options.aria && this._internals) {\n const ariaAttribute = options.aria;\n if (value) {\n this._internals[ariaAttribute] = 'true';\n } else {\n this._internals[ariaAttribute] = null;\n }\n }\n\n // Request an update\n (this as ReactiveElement).requestUpdate(name, oldValue);\n }\n },\n configurable: true,\n enumerable: true\n });\n };\n}\n","import { consume } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { propInternalState } from '../../decorators';\nimport { testContext, testElement, TestElement, TestContext } from '../context';\nimport { watch } from '../../decorators/watch';\n\nexport abstract class TestComponent extends LitElement {\n @propInternalState({\n type: Boolean,\n reflect: true,\n aria: 'ariaDisabled' // Maps to `aria-disabled` attribute\n })\n public disabled = true;\n\n @state()\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n @state()\n @consume({ context: testElement, subscribe: true })\n public _testElement?: TestElement;\n @watch('_testElement')\n _handleTestElementChange(_oldValue: TestElement, newValue: TestElement) {\n if (newValue.el) {\n this.disabled = false;\n }\n }\n\n protected _internals: ElementInternals;\n\n protected items;\n protected itemIndex;\n protected view;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n if (changedProperties.has('_testContext')) {\n const { items = [], navItemId } = this._testContext ?? {};\n this.itemIndex = items.findIndex(item => item.identifier === navItemId);\n this.items = items;\n this.view = this._testContext?.view;\n }\n }\n\n protected _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\n );\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement?.el || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport * as styles from './styles';\n\n/**\n * Represents a custom element for navigating to the previous test item.\n *\n * @remarks\n * This element provides functionality for navigating to the previous test item.\n *\n * @example\n * ```html\n * <test-prev></test-prev>\n * ```\n */\n@customElement('test-prev')\nexport class TestPrev extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex - 1].identifier);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement?.el || this.itemIndex === 0 || this.itemIndex === -1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-previous': TestPrev;\n }\n}\n","import { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport { watch } from '../../decorators/watch';\n\n@customElement('test-view')\nexport class TestView extends TestComponent {\n static DEFAULT_VIEW_OPTIONS = ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'];\n\n @property({ type: String })\n label = 'view';\n\n @property({ type: String, attribute: 'view-options' }) viewOptions = '';\n @watch('viewOptions')\n _handleViewOptionsChange = (_: string, viewOptions: string) => {\n console.log(viewOptions);\n };\n\n private _viewOptions: string[] = TestView.DEFAULT_VIEW_OPTIONS;\n\n // updated(changedProperties: PropertyValues) {\n // super.updated(changedProperties);\n // if (changedProperties.has('viewOptionsString')) {\n // this._updateViewOptions();\n // }\n // }\n\n // private _updateViewOptions() {\n // if (this.viewOptionsString) {\n // const options = this.viewOptionsString.split(',').map(opt => opt.trim());\n // this.viewOptions = options.filter(opt => TestView.DEFAULT_VIEW_OPTIONS.includes(opt));\n // } else {\n // this.viewOptions = TestView.DEFAULT_VIEW_OPTIONS;\n // }\n // }\n\n render() {\n return html`\n <label part=\"label\" for=\"viewSelect\">${this.label}</label>\n <select\n part=\"select\"\n id=\"viewSelect\"\n .disabled=${this.disabled}\n @change=${(e: Event) => {\n const el = e.target as HTMLSelectElement;\n this._switchView(el.value);\n }}\n >\n ${this._viewOptions.map(v => html`<option value=\"${v}\" ?selected=${v === this.view}>${v}</option>`)}\n </select>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-view': TestView;\n }\n}\n","import { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\n\n@customElement('test-item-link')\nexport class TestItemLink extends TestComponent {\n @property({ type: String, attribute: 'item-id' })\n private itemId: string = null;\n\n constructor() {\n super();\n this.addEventListener('click', () => this._requestItem(this.itemId));\n }\n\n render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-item-link': TestItemLink;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n _$LH,\n Part,\n DirectiveParent,\n CompiledTemplateResult,\n MaybeCompiledTemplateResult,\n UncompiledTemplateResult,\n} from './lit-html.js';\nimport {\n DirectiveResult,\n DirectiveClass,\n PartInfo,\n AttributePartInfo,\n} from './directive.js';\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\n\nconst {_ChildPart: ChildPart} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\n\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n MATHML: 3,\n} as const;\n\nexport type TemplateResultType =\n (typeof TemplateResultType)[keyof typeof TemplateResultType];\n\ntype IsTemplateResult = {\n (val: unknown): val is MaybeCompiledTemplateResult;\n <T extends TemplateResultType>(\n val: unknown,\n type: T\n ): val is UncompiledTemplateResult<T>;\n};\n\n/**\n * Tests if a value is a TemplateResult or a CompiledTemplateResult.\n */\nexport const isTemplateResult: IsTemplateResult = (\n value: unknown,\n type?: TemplateResultType\n): value is UncompiledTemplateResult =>\n type === undefined\n ? // This property needs to remain unminified.\n (value as UncompiledTemplateResult)?.['_$litType$'] !== undefined\n : (value as UncompiledTemplateResult)?.['_$litType$'] === type;\n\n/**\n * Tests if a value is a CompiledTemplateResult.\n */\nexport const isCompiledTemplateResult = (\n value: unknown\n): value is CompiledTemplateResult => {\n return (value as CompiledTemplateResult)?.['_$litType$']?.h != null;\n};\n\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value: unknown): value is DirectiveResult =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'] !== undefined;\n\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value: unknown): DirectiveClass | undefined =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'];\n\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part: PartInfo) =>\n (part as AttributePartInfo).strings === undefined;\n\nconst createMarker = () => document.createComment('');\n\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (\n containerPart: ChildPart,\n refPart?: ChildPart,\n part?: ChildPart\n): ChildPart => {\n const container = wrap(containerPart._$startNode).parentNode!;\n\n const refNode =\n refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(\n startNode,\n endNode,\n containerPart,\n containerPart.options\n );\n } else {\n const endNode = wrap(part._$endNode!).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (\n part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent!._$isConnected\n ) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start: Node | null = part._$startNode;\n while (start !== endNode) {\n const n: Node | null = wrap(start!).nextSibling;\n wrap(container).insertBefore(start!, refNode);\n start = n;\n }\n }\n }\n\n return part;\n};\n\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = <T extends ChildPart>(\n part: T,\n value: unknown,\n directiveParent: DirectiveParent = part\n): T => {\n part._$setValue(value, directiveParent);\n return part;\n};\n\n// A sentinel value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part: Part, value: unknown = RESET_VALUE) =>\n (part._$committedValue = value);\n\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being committed.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part: ChildPart) => part._$committedValue;\n\n/**\n * Removes a ChildPart from the DOM, including any of its content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part: ChildPart) => {\n part._$notifyConnectionChanged?.(false, true);\n let start: ChildNode | null = part._$startNode;\n const end: ChildNode | null = wrap(part._$endNode!).nextSibling;\n while (start !== end) {\n const n: ChildNode | null = wrap(start!).nextSibling;\n (wrap(start!) as ChildNode).remove();\n start = n;\n }\n};\n\nexport const clearPart = (part: ChildPart) => {\n part._$clear();\n};\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal\n */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Overview:\n *\n * This module is designed to add support for an async `setValue` API and\n * `disconnected` callback to directives with the least impact on the core\n * runtime or payload when that feature is not used.\n *\n * The strategy is to introduce a `AsyncDirective` subclass of\n * `Directive` that climbs the \"parent\" tree in its constructor to note which\n * branches of lit-html's \"logical tree\" of data structures contain such\n * directives and thus need to be crawled when a subtree is being cleared (or\n * manually disconnected) in order to run the `disconnected` callback.\n *\n * The \"nodes\" of the logical tree include Parts, TemplateInstances (for when a\n * TemplateResult is committed to a value of a ChildPart), and Directives; these\n * all implement a common interface called `DisconnectableChild`. Each has a\n * `_$parent` reference which is set during construction in the core code, and a\n * `_$disconnectableChildren` field which is initially undefined.\n *\n * The sparse tree created by means of the `AsyncDirective` constructor\n * crawling up the `_$parent` tree and placing a `_$disconnectableChildren` Set\n * on each parent that includes each child that contains a\n * `AsyncDirective` directly or transitively via its children. In order to\n * notify connection state changes and disconnect (or reconnect) a tree, the\n * `_$notifyConnectionChanged` API is patched onto ChildParts as a directive\n * climbs the parent tree, which is called by the core when clearing a part if\n * it exists. When called, that method iterates over the sparse tree of\n * Set<DisconnectableChildren> built up by AsyncDirectives, and calls\n * `_$notifyDirectiveConnectionChanged` on any directives that are encountered\n * in that tree, running the required callbacks.\n *\n * A given \"logical tree\" of lit-html data-structures might look like this:\n *\n * ChildPart(N1) _$dC=[D2,T3]\n * ._directive\n * AsyncDirective(D2)\n * ._value // user value was TemplateResult\n * TemplateInstance(T3) _$dC=[A4,A6,N10,N12]\n * ._$parts[]\n * AttributePart(A4) _$dC=[D5]\n * ._directives[]\n * AsyncDirective(D5)\n * AttributePart(A6) _$dC=[D7,D8]\n * ._directives[]\n * AsyncDirective(D7)\n * Directive(D8) _$dC=[D9]\n * ._directive\n * AsyncDirective(D9)\n * ChildPart(N10) _$dC=[D11]\n * ._directive\n * AsyncDirective(D11)\n * ._value\n * string\n * ChildPart(N12) _$dC=[D13,N14,N16]\n * ._directive\n * AsyncDirective(D13)\n * ._value // user value was iterable\n * Array<ChildPart>\n * ChildPart(N14) _$dC=[D15]\n * ._value\n * string\n * ChildPart(N16) _$dC=[D17,T18]\n * ._directive\n * AsyncDirective(D17)\n * ._value // user value was TemplateResult\n * TemplateInstance(T18) _$dC=[A19,A21,N25]\n * ._$parts[]\n * AttributePart(A19) _$dC=[D20]\n * ._directives[]\n * AsyncDirective(D20)\n * AttributePart(A21) _$dC=[22,23]\n * ._directives[]\n * AsyncDirective(D22)\n * Directive(D23) _$dC=[D24]\n * ._directive\n * AsyncDirective(D24)\n * ChildPart(N25) _$dC=[D26]\n * ._directive\n * AsyncDirective(D26)\n * ._value\n * string\n *\n * Example 1: The directive in ChildPart(N12) updates and returns `nothing`. The\n * ChildPart will _clear() itself, and so we need to disconnect the \"value\" of\n * the ChildPart (but not its directive). In this case, when `_clear()` calls\n * `_$notifyConnectionChanged()`, we don't iterate all of the\n * _$disconnectableChildren, rather we do a value-specific disconnection: i.e.\n * since the _value was an Array<ChildPart> (because an iterable had been\n * committed), we iterate the array of ChildParts (N14, N16) and run\n * `setConnected` on them (which does recurse down the full tree of\n * `_$disconnectableChildren` below it, and also removes N14 and N16 from N12's\n * `_$disconnectableChildren`). Once the values have been disconnected, we then\n * check whether the ChildPart(N12)'s list of `_$disconnectableChildren` is empty\n * (and would remove it from its parent TemplateInstance(T3) if so), but since\n * it would still contain its directive D13, it stays in the disconnectable\n * tree.\n *\n * Example 2: In the course of Example 1, `setConnected` will reach\n * ChildPart(N16); in this case the entire part is being disconnected, so we\n * simply iterate all of N16's `_$disconnectableChildren` (D17,T18) and\n * recursively run `setConnected` on them. Note that we only remove children\n * from `_$disconnectableChildren` for the top-level values being disconnected\n * on a clear; doing this bookkeeping lower in the tree is wasteful since it's\n * all being thrown away.\n *\n * Example 3: If the LitElement containing the entire tree above becomes\n * disconnected, it will run `childPart.setConnected()` (which calls\n * `childPart._$notifyConnectionChanged()` if it exists); in this case, we\n * recursively run `setConnected()` over the entire tree, without removing any\n * children from `_$disconnectableChildren`, since this tree is required to\n * re-connect the tree, which does the same operation, simply passing\n * `isConnected: true` down the tree, signaling which callback to run.\n */\n\nimport {AttributePart, ChildPart, Disconnectable, Part} from './lit-html.js';\nimport {isSingleExpression} from './directive-helpers.js';\nimport {Directive, PartInfo, PartType} from './directive.js';\nexport * from './directive.js';\n\nconst DEV_MODE = true;\n\n/**\n * Recursively walks down the tree of Parts/TemplateInstances/Directives to set\n * the connected state of directives and run `disconnected`/ `reconnected`\n * callbacks.\n *\n * @return True if there were children to disconnect; false otherwise\n */\nconst notifyChildrenConnectedChanged = (\n parent: Disconnectable,\n isConnected: boolean\n): boolean => {\n const children = parent._$disconnectableChildren;\n if (children === undefined) {\n return false;\n }\n for (const obj of children) {\n // The existence of `_$notifyDirectiveConnectionChanged` is used as a \"brand\" to\n // disambiguate AsyncDirectives from other DisconnectableChildren\n // (as opposed to using an instanceof check to know when to call it); the\n // redundancy of \"Directive\" in the API name is to avoid conflicting with\n // `_$notifyConnectionChanged`, which exists `ChildParts` which are also in\n // this list\n // Disconnect Directive (and any nested directives contained within)\n // This property needs to remain unminified.\n (obj as AsyncDirective)['_$notifyDirectiveConnectionChanged']?.(\n isConnected,\n false\n );\n // Disconnect Part/TemplateInstance\n notifyChildrenConnectedChanged(obj, isConnected);\n }\n return true;\n};\n\n/**\n * Removes the given child from its parent list of disconnectable children, and\n * if the parent list becomes empty as a result, removes the parent from its\n * parent, and so forth up the tree when that causes subsequent parent lists to\n * become empty.\n */\nconst removeDisconnectableFromParent = (obj: Disconnectable) => {\n let parent, children;\n do {\n if ((parent = obj._$parent) === undefined) {\n break;\n }\n children = parent._$disconnectableChildren!;\n children.delete(obj);\n obj = parent;\n } while (children?.size === 0);\n};\n\nconst addDisconnectableToParent = (obj: Disconnectable) => {\n // Climb the parent tree, creating a sparse tree of children needing\n // disconnection\n for (let parent; (parent = obj._$parent); obj = parent) {\n let children = parent._$disconnectableChildren;\n if (children === undefined) {\n parent._$disconnectableChildren = children = new Set();\n } else if (children.has(obj)) {\n // Once we've reached a parent that already contains this child, we\n // can short-circuit\n break;\n }\n children.add(obj);\n installDisconnectAPI(parent);\n }\n};\n\n/**\n * Changes the parent reference of the ChildPart, and updates the sparse tree of\n * Disconnectable children accordingly.\n *\n * Note, this method will be patched onto ChildPart instances and called from\n * the core code when parts are moved between different parents.\n */\nfunction reparentDisconnectables(this: ChildPart, newParent: Disconnectable) {\n if (this._$disconnectableChildren !== undefined) {\n removeDisconnectableFromParent(this);\n this._$parent = newParent;\n addDisconnectableToParent(this);\n } else {\n this._$parent = newParent;\n }\n}\n\n/**\n * Sets the connected state on any directives contained within the committed\n * value of this part (i.e. within a TemplateInstance or iterable of\n * ChildParts) and runs their `disconnected`/`reconnected`s, as well as within\n * any directives stored on the ChildPart (when `valueOnly` is false).\n *\n * `isClearingValue` should be passed as `true` on a top-level part that is\n * clearing itself, and not as a result of recursively disconnecting directives\n * as part of a `clear` operation higher up the tree. This both ensures that any\n * directive on this ChildPart that produced a value that caused the clear\n * operation is not disconnected, and also serves as a performance optimization\n * to avoid needless bookkeeping when a subtree is going away; when clearing a\n * subtree, only the top-most part need to remove itself from the parent.\n *\n * `fromPartIndex` is passed only in the case of a partial `_clear` running as a\n * result of truncating an iterable.\n *\n * Note, this method will be patched onto ChildPart instances and called from the\n * core code when parts are cleared or the connection state is changed by the\n * user.\n */\nfunction notifyChildPartConnectedChanged(\n this: ChildPart,\n isConnected: boolean,\n isClearingValue = false,\n fromPartIndex = 0\n) {\n const value = this._$committedValue;\n const children = this._$disconnectableChildren;\n if (children === undefined || children.size === 0) {\n return;\n }\n if (isClearingValue) {\n if (Array.isArray(value)) {\n // Iterable case: Any ChildParts created by the iterable should be\n // disconnected and removed from this ChildPart's disconnectable\n // children (starting at `fromPartIndex` in the case of truncation)\n for (let i = fromPartIndex; i < value.length; i++) {\n notifyChildrenConnectedChanged(value[i], false);\n removeDisconnectableFromParent(value[i]);\n }\n } else if (value != null) {\n // TemplateInstance case: If the value has disconnectable children (will\n // only be in the case that it is a TemplateInstance), we disconnect it\n // and remove it from this ChildPart's disconnectable children\n notifyChildrenConnectedChanged(value as Disconnectable, false);\n removeDisconnectableFromParent(value as Disconnectable);\n }\n } else {\n notifyChildrenConnectedChanged(this, isConnected);\n }\n}\n\n/**\n * Patches disconnection API onto ChildParts.\n */\nconst installDisconnectAPI = (obj: Disconnectable) => {\n if ((obj as ChildPart).type == PartType.CHILD) {\n (obj as ChildPart)._$notifyConnectionChanged ??=\n notifyChildPartConnectedChanged;\n (obj as ChildPart)._$reparentDisconnectables ??= reparentDisconnectables;\n }\n};\n\n/**\n * An abstract `Directive` base class whose `disconnected` method will be\n * called when the part containing the directive is cleared as a result of\n * re-rendering, or when the user calls `part.setConnected(false)` on\n * a part that was previously rendered containing the directive (as happens\n * when e.g. a LitElement disconnects from the DOM).\n *\n * If `part.setConnected(true)` is subsequently called on a\n * containing part, the directive's `reconnected` method will be called prior\n * to its next `update`/`render` callbacks. When implementing `disconnected`,\n * `reconnected` should also be implemented to be compatible with reconnection.\n *\n * Note that updates may occur while the directive is disconnected. As such,\n * directives should generally check the `this.isConnected` flag during\n * render/update to determine whether it is safe to subscribe to resources\n * that may prevent garbage collection.\n */\nexport abstract class AsyncDirective extends Directive {\n // As opposed to other Disconnectables, AsyncDirectives always get notified\n // when the RootPart connection changes, so the public `isConnected`\n // is a locally stored variable initialized via its part's getter and synced\n // via `_$notifyDirectiveConnectionChanged`. This is cheaper than using\n // the _$isConnected getter, which has to look back up the tree each time.\n /**\n * The connection state for this Directive.\n */\n isConnected!: boolean;\n\n // @internal\n override _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /**\n * Initialize the part with internal fields\n * @param part\n * @param parent\n * @param attributeIndex\n */\n override _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n super._$initialize(part, parent, attributeIndex);\n addDisconnectableToParent(this);\n this.isConnected = part._$isConnected;\n }\n // This property needs to remain unminified.\n /**\n * Called from the core code when a directive is going away from a part (in\n * which case `shouldRemoveFromParent` should be true), and from the\n * `setChildrenConnected` helper function when recursively changing the\n * connection state of a tree (in which case `shouldRemoveFromParent` should\n * be false).\n *\n * @param isConnected\n * @param isClearingDirective - True when the directive itself is being\n * removed; false when the tree is being disconnected\n * @internal\n */\n override ['_$notifyDirectiveConnectionChanged'](\n isConnected: boolean,\n isClearingDirective = true\n ) {\n if (isConnected !== this.isConnected) {\n this.isConnected = isConnected;\n if (isConnected) {\n this.reconnected?.();\n } else {\n this.disconnected?.();\n }\n }\n if (isClearingDirective) {\n notifyChildrenConnectedChanged(this, isConnected);\n removeDisconnectableFromParent(this);\n }\n }\n\n /**\n * Sets the value of the directive's Part outside the normal `update`/`render`\n * lifecycle of a directive.\n *\n * This method should not be called synchronously from a directive's `update`\n * or `render`.\n *\n * @param directive The directive to update\n * @param value The value to set\n */\n setValue(value: unknown) {\n if (isSingleExpression(this.__part as unknown as PartInfo)) {\n this.__part._$setValue(value, this);\n } else {\n // this.__attributeIndex will be defined in this case, but\n // assert it in dev mode\n if (DEV_MODE && this.__attributeIndex === undefined) {\n throw new Error(`Expected this.__attributeIndex to be a number`);\n }\n const newValues = [...(this.__part._$committedValue as Array<unknown>)];\n newValues[this.__attributeIndex!] = value;\n (this.__part as AttributePart)._$setValue(newValues, this, 0);\n }\n }\n\n /**\n * User callbacks for implementing logic to release any resources/subscriptions\n * that may have been retained by this directive. Since directives may also be\n * re-connected, `reconnected` should also be implemented to restore the\n * working state of the directive prior to the next render.\n */\n protected disconnected() {}\n protected reconnected() {}\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Note, this module is not included in package exports so that it's private to\n// our first-party directives. If it ends up being useful, we can open it up and\n// export it.\n\n/**\n * Helper to iterate an AsyncIterable in its own closure.\n * @param iterable The iterable to iterate\n * @param callback The callback to call for each value. If the callback returns\n * `false`, the loop will be broken.\n */\nexport const forAwaitOf = async <T>(\n iterable: AsyncIterable<T>,\n callback: (value: T) => Promise<boolean>\n) => {\n for await (const v of iterable) {\n if ((await callback(v)) === false) {\n return;\n }\n }\n};\n\n/**\n * Holds a reference to an instance that can be disconnected and reconnected,\n * so that a closure over the ref (e.g. in a then function to a promise) does\n * not strongly hold a ref to the instance. Approximates a WeakRef but must\n * be manually connected & disconnected to the backing instance.\n */\nexport class PseudoWeakRef<T> {\n private _ref?: T;\n constructor(ref: T) {\n this._ref = ref;\n }\n /**\n * Disassociates the ref with the backing instance.\n */\n disconnect() {\n this._ref = undefined;\n }\n /**\n * Reassociates the ref with the backing instance.\n */\n reconnect(ref: T) {\n this._ref = ref;\n }\n /**\n * Retrieves the backing instance (will be undefined when disconnected)\n */\n deref() {\n return this._ref;\n }\n}\n\n/**\n * A helper to pause and resume waiting on a condition in an async function\n */\nexport class Pauser {\n private _promise?: Promise<void> = undefined;\n private _resolve?: () => void = undefined;\n /**\n * When paused, returns a promise to be awaited; when unpaused, returns\n * undefined. Note that in the microtask between the pauser being resumed\n * an await of this promise resolving, the pauser could be paused again,\n * hence callers should check the promise in a loop when awaiting.\n * @returns A promise to be awaited when paused or undefined\n */\n get() {\n return this._promise;\n }\n /**\n * Creates a promise to be awaited\n */\n pause() {\n this._promise ??= new Promise((resolve) => (this._resolve = resolve));\n }\n /**\n * Resolves the promise which may be awaited\n */\n resume() {\n this._resolve?.();\n this._promise = this._resolve = undefined;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Part, noChange} from '../lit-html.js';\nimport {isPrimitive} from '../directive-helpers.js';\nimport {directive, AsyncDirective} from '../async-directive.js';\nimport {Pauser, PseudoWeakRef} from './private-async-helpers.js';\n\nconst isPromise = (x: unknown) => {\n return !isPrimitive(x) && typeof (x as {then?: unknown}).then === 'function';\n};\n// Effectively infinity, but a SMI.\nconst _infinity = 0x3fffffff;\n\nexport class UntilDirective extends AsyncDirective {\n private __lastRenderedIndex: number = _infinity;\n private __values: unknown[] = [];\n private __weakThis = new PseudoWeakRef(this);\n private __pauser = new Pauser();\n\n render(...args: Array<unknown>): unknown {\n return args.find((x) => !isPromise(x)) ?? noChange;\n }\n\n override update(_part: Part, args: Array<unknown>) {\n const previousValues = this.__values;\n let previousLength = previousValues.length;\n this.__values = args;\n\n const weakThis = this.__weakThis;\n const pauser = this.__pauser;\n\n // If our initial render occurs while disconnected, ensure that the pauser\n // and weakThis are in the disconnected state\n if (!this.isConnected) {\n this.disconnected();\n }\n\n for (let i = 0; i < args.length; i++) {\n // If we've rendered a higher-priority value already, stop.\n if (i > this.__lastRenderedIndex) {\n break;\n }\n\n const value = args[i];\n\n // Render non-Promise values immediately\n if (!isPromise(value)) {\n this.__lastRenderedIndex = i;\n // Since a lower-priority value will never overwrite a higher-priority\n // synchronous value, we can stop processing now.\n return value;\n }\n\n // If this is a Promise we've already handled, skip it.\n if (i < previousLength && value === previousValues[i]) {\n continue;\n }\n\n // We have a Promise that we haven't seen before, so priorities may have\n // changed. Forget what we rendered before.\n this.__lastRenderedIndex = _infinity;\n previousLength = 0;\n\n // Note, the callback avoids closing over `this` so that the directive\n // can be gc'ed before the promise resolves; instead `this` is retrieved\n // from `weakThis`, which can break the hard reference in the closure when\n // the directive disconnects\n Promise.resolve(value).then(async (result: unknown) => {\n // If we're disconnected, wait until we're (maybe) reconnected\n // The while loop here handles the case that the connection state\n // thrashes, causing the pauser to resume and then get re-paused\n while (pauser.get()) {\n await pauser.get();\n }\n // If the callback gets here and there is no `this`, it means that the\n // directive has been disconnected and garbage collected and we don't\n // need to do anything else\n const _this = weakThis.deref();\n if (_this !== undefined) {\n const index = _this.__values.indexOf(value);\n // If state.values doesn't contain the value, we've re-rendered without\n // the value, so don't render it. Then, only render if the value is\n // higher-priority than what's already been rendered.\n if (index > -1 && index < _this.__lastRenderedIndex) {\n _this.__lastRenderedIndex = index;\n _this.setValue(result);\n }\n }\n });\n }\n\n return noChange;\n }\n\n override disconnected() {\n this.__weakThis.disconnect();\n this.__pauser.pause();\n }\n\n override reconnected() {\n this.__weakThis.reconnect(this);\n this.__pauser.resume();\n }\n}\n\n/**\n * Renders one of a series of values, including Promises, to a Part.\n *\n * Values are rendered in priority order, with the first argument having the\n * highest priority and the last argument having the lowest priority. If a\n * value is a Promise, low-priority values will be rendered until it resolves.\n *\n * The priority of values can be used to create placeholder content for async\n * data. For example, a Promise with pending content can be the first,\n * highest-priority, argument, and a non_promise loading indicator template can\n * be used as the second, lower-priority, argument. The loading indicator will\n * render immediately, and the primary content will render when the Promise\n * resolves.\n *\n * Example:\n *\n * ```js\n * const content = fetch('./content.txt').then(r => r.text());\n * html`${until(content, html`<span>Loading...</span>`)}`\n * ```\n */\nexport const until = directive(UntilDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\n// export type {UntilDirective};\n","@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;\n\n:root,\n:host {\n /* Active colors */\n --qti-bg-active: #ffecec;\n --qti-border-active: #f86d70;\n\n /* Gap size */\n --qti-gap-size: 1rem;\n\n /* Background colors */\n --qti-bg: white;\n --qti-hover-bg: #f9fafb;\n\n /* Light theme colors */\n --qti-light-bg-active: #f0f0f0; /* Light gray */\n --qti-light-border-active: #d0d0d0; /* Medium gray */\n\n /* Dark theme colors */\n --qti-dark-bg-active: #1f2937; /* Dark gray */\n --qti-dark-border-active: #64748b; /* Medium gray */\n\n /* Disabled colors */\n --qti-disabled-bg: #f3f4f6;\n --qti-disabled-color: #45484f;\n\n /* Border properties */\n --qti-border-thickness: 2px;\n --qti-border-style: solid;\n --qti-border-color: #c6cad0;\n --qti-border-radius: 0.3rem;\n --qti-drop-border-radius: calc(var(--qti-border-radius) + var(--qti-border-thickness));\n\n /* Focus & active states */\n --qti-focus-border-width: 5px;\n --qti-focus-color: #bddcff7e;\n\n /* Class-specific variables */\n\n /* Form elements */\n --qti-form-size: 1rem;\n\n /* Point elements */\n --qti-point-size: 2rem;\n\n /* Order buttons */\n --qti-order-size: 2rem;\n\n /* Generic padding for all elements */\n --qti-padding-vertical: 0.5rem; /* py-2 */\n --qti-padding-horizontal: 0.5rem; /* px-2 */\n}\n\n/* SVG masks and backgrounds */\n\n.chevron {\n background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n.handle {\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n background-repeat: repeat-y;\n background-position: left center;\n background-size: 14px 8px;\n}\n\n.check-mask {\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/* \n Following are classes that can be applied to elements and element states, so they are not used directly \n The @apply directive is used to apply these classes to elements\n*/\n\n/* Apply .bordered to an element */\n\n.bordered {\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .form rules for checkbox and radiobutton */\n\n.form {\n\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .button rules for button-like elements, such as drags and buttons */\n\n.button {\n\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .select for the select dropdown element */\n\n.select {\n\n border-radius: var(--qti-border-radius);\n position: relative;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n padding-right: calc(var(--qti-padding-horizontal) + 1.5rem); /* 1.5rem for the chevron */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n/* Apply .text for the input text and textarea */\n\n.text {\n\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: unset;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .spot for hotspot shapes */\n\n.spot {\n\n width: 100%;\n height: 100%;\n background-color: transparent;\n padding: 0;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .point for circular small hotspots */\n\n.point {\n\n border-radius: 100%;\n width: var(--qti-point-size);\n height: var(--qti-point-size);\n background-color: transparent;\n padding: 0;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .drag for draggable elements */\n\n.drag {\n\n transition:\n transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem) !important; /* 1.5rem for the drag */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n ); background-repeat: repeat-y; background-position: left center; background-size: 14px 8px;\n}\n\n/* Apply .dragging for the dragging state of a draggable element */\n\n.dragging {\n pointer-events: none;\n rotate: -2deg;\n box-shadow:\n 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n}\n\n/* Apply .drop for an element where you can drop the draggable */\n\n.drop {\n\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .dropping for an indicator where you can drop the draggable */\n\n.dropping {\n background-color: var(--qti-bg-active);\n}\n\n/* Apply .order for a small circular button */\n\n.order {\n\n display: grid;\n place-content: center;\n\n /* background-color: var(--qti-bg-active); */\n border-radius: 100%;\n width: var(--qti-order-size);\n height: var(--qti-order-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-size for radio and checkbox size */\n\n.check-size {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n}\n\n/* Apply .check for checkbox */\n\n.check {\n gap: 0.5rem;\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n outline: none;\n cursor: pointer;\n}\n\n/* Apply .check-radio for outer circle of the radio buttons */\n\n.check-radio {\n\n border-radius: 100%;\n\n display: grid;\n\n place-content: center;\n\n width: var(--qti-form-size);\n\n height: var(--qti-form-size);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n}\n\n/* Apply .check-radio-checked for the inner checked radio */\n\n.check-radio-checked {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n}\n\n/* Apply .check-checkbox for outer square of the checkbox */\n\n.check-checkbox {\n\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-checkbox-checked for the inner checkmark */\n\n.check-checkbox-checked {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/* Apply .hov for hover state */\n\n.hov {\n background-color: var(--qti-hover-bg);\n}\n\n/* Apply .foc for focus state */\n\n.foc {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n}\n\n/* Apply .act for active state */\n\n.act {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n}\n\n.act-bg {\n background-color: var(--qti-bg-active);\n}\n\n.act-bor {\n border-color: var(--qti-border-active);\n}\n\n/* Apply .rdo for readonly state */\n\n.rdo {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n}\n\n/* Apply .dis for disabled state */\n\n.dis {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n}\n\n/* base */\n\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flexbox;\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n\n/* stylelint-disable number-max-precision */\n\n@layer qti-base {\n .qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n }\n\n .qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n }\n\n .qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there’s padding or borders */\n }\n\n .qti-layout-col1 {\n width: 6.3829787234%;\n }\n\n .qti-layout-col2 {\n width: 14.8936170213%;\n }\n\n .qti-layout-col3 {\n width: 23.4042553191%;\n }\n\n .qti-layout-col4 {\n width: 31.914893617%;\n }\n\n .qti-layout-col5 {\n width: 40.4255319149%;\n }\n\n .qti-layout-col6 {\n width: 48.9361702128%;\n }\n\n .qti-layout-col7 {\n width: 57.4468085106%;\n }\n\n .qti-layout-col8 {\n width: 65.9574468085%;\n }\n\n .qti-layout-col9 {\n width: 74.4680851064%;\n }\n\n .qti-layout-col10 {\n width: 82.9787234043%;\n }\n\n .qti-layout-col11 {\n width: 91.4893617021%;\n }\n\n .qti-layout-col12 {\n width: 100%;\n }\n\n .qti-layout-offset1 {\n margin-left: 8.5106382979%;\n }\n\n .qti-layout-offset2 {\n margin-left: 17.0212765957%;\n }\n\n .qti-layout-offset3 {\n margin-left: 25.5319148936%;\n }\n\n .qti-layout-offset4 {\n margin-left: 34.0425531915%;\n }\n\n .qti-layout-offset5 {\n margin-left: 42.5531914894%;\n }\n\n .qti-layout-offset6 {\n margin-left: 51.0638297872%;\n }\n\n .qti-layout-offset7 {\n margin-left: 59.5744680851%;\n }\n\n .qti-layout-offset8 {\n margin-left: 68.085106383%;\n }\n\n .qti-layout-offset9 {\n margin-left: 76.5957446809%;\n }\n\n .qti-layout-offset10 {\n margin-left: 85.1063829787%;\n }\n\n .qti-layout-offset11 {\n margin-left: 93.6170212766%;\n }\n\n .qti-layout-offset12 {\n margin-left: 102.1276595745%;\n }\n\n @media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n }\n}\n\n[view],\nqti-outcome-declaration,\nqti-response-declaration {\n display: none;\n}\n\n[view].show {\n display: block;\n}\n\n:host {\n box-sizing: border-box;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n/* components */\n\n@layer qti-components {\n qti-choice-interaction {\n &.qti-input-control-hidden {\n & qti-simple-choice {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n &:not(.qti-input-control-hidden) {\n & qti-simple-choice {\n\n &:not([aria-disabled='true'], [aria-readonly='true'], :state(--checked)):hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n\n gap: 0.5rem;\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n outline: none;\n\n cursor: pointer\n }\n }\n\n & qti-simple-choice {\n width: -moz-fit-content;\n width: fit-content;\n cursor: pointer;\n\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: #16a34a; /* text-green-600 */\n }\n }\n }\n\n & qti-simple-choice > p {\n margin: 0 !important;\n padding: 0 !important;\n }\n }\n\n .hover-border {\n border: 2px solid #000; /* Adjust the border style and color as needed */\n }\n\n qti-graphic-gap-match-interaction {\n position: relative;\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-gap-img,\n qti-gap-text {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: grab;\n }\n\n & qti-associable-hotspot {\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid transparent;\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light & {\n background-color: var(--qti-light-bg-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n background-color: var(--qti-dark-bg-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &[active] {\n\n /* Light theme override */\n .qti-selections-light & {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n\n &[disabled] {\n\n &:not(:empty) {\n cursor: default !important;\n }\n\n cursor: not-allowed;\n\n background-color: var(--qti-disabled-bg);\n\n color: var(--qti-disabled-color);\n\n border-color: var(--qti-border-color);\n\n outline: 4px solid var(--qti-disabled-bg)\n }\n\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */\n content: '\\0000a0'; /* when empty, put a space in it */\n }\n\n &:not(:empty) {\n padding: 0;\n width: auto;\n }\n\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0); /* rotate-0 */\n box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */\n }\n }\n\n & img {\n margin: 0;\n padding: 0;\n }\n }\n\n qti-text-entry-interaction {\n &::part(input) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: unset;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus-within {\n &::part(input) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n\n qti-extended-text-interaction {\n &::part(textarea) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: unset;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus-within {\n &::part(textarea) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n\n qti-gap-match-interaction {\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-gap-text {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px\n }\n\n & qti-gap {\n\n &[disabled] {\n\n &:not(:empty) {\n cursor: default !important;\n }\n\n cursor: not-allowed;\n\n background-color: var(--qti-disabled-bg);\n\n color: var(--qti-disabled-color);\n\n border-color: var(--qti-border-color);\n\n outline: 4px solid var(--qti-disabled-bg)\n }\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light & {\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &[active] {\n\n /* Light theme override */\n .qti-selections-light & {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n\n display: inline-flex;\n align-items: center;\n\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */\n content: '\\0000a0'; /* when empty, put a space in it */\n }\n\n &:not(:empty) {\n display: inline-flex;\n padding: 0;\n width: auto;\n }\n\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0); /* rotate-0 */\n box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */\n }\n\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n\n border-radius: var(--qti-border-radius);\n\n position: relative;\n\n background-color: var(--qti-bg);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n qti-hotspot-interaction {\n & qti-hotspot-choice {\n &[shape='circle'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n\n &:state(--readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(--disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='rect'] {\n\n /* &:hover {\n @apply hov;\n } */\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='poly'] {\n &:hover::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n var(--qti-border-active),\n var(--qti-border-active) 5px,\n transparent 5px,\n transparent 10px\n );\n display: block;\n }\n\n &:state(--checked)::after,\n &[aria-checked='true']::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 5px,\n var(--qti-border-active) 5px,\n var(--qti-border-active) 10px\n );\n display: block;\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n\n qti-hottext-interaction {\n /* &:not(.qti-input-control-hidden),\n &:not(.qti-unselected-hidden) { */\n qti-hottext {\n display: inline-flex;\n align-items: center;\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n\n gap: 0.5rem;\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n outline: none;\n\n cursor: pointer\n }\n\n /* } */\n\n &.qti-input-control-hidden {\n qti-hottext {\n /* --qti-padding-md: 0.1rem;\n --qti-padding-lg: 0.2rem;\n --qti-border-radius-md: 0.3rem;\n --qti-border-thickness: 1px;\n --qti-font-weight-semibold: 400; */\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n /* @layer qti-variants { */\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n /* } */\n }\n\n &.qti-unselected-hidden {\n qti-hottext {\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n cursor: pointer;\n\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked) {\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n\n qti-inline-choice-interaction {\n &::part(select) {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n border-radius: var(--qti-border-radius);\n\n position: relative;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n padding-right: calc(var(--qti-padding-horizontal) + 1.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px\n }\n }\n\n qti-match-interaction:not(.qti-match-tabular) {\n &:state(--dragzone-enabled) qti-simple-match-set:first-of-type {\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-active) qti-simple-match-set:first-of-type {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n /* The draggables */\n & qti-simple-match-set:first-of-type {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start; /* Prevents children from stretching */\n gap: var(--qti-gap-size);\n border: 2px solid transparent;\n\n & qti-simple-associable-choice {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px\n }\n }\n\n /* The droppables */\n & qti-simple-match-set:last-of-type {\n display: grid;\n grid-auto-columns: 1fr; /* auto-cols-fr */\n grid-auto-flow: column; /* grid-flow-col */\n gap: var(--qti-gap-size); /* gap-2 */\n width: 100%; /* w-full */\n\n & qti-simple-associable-choice {\n display: flex;\n flex-direction: column;\n }\n\n & > qti-simple-associable-choice {\n /* a droppable qti-simple-associable-choice */\n box-sizing: border-box;\n display: grid;\n grid-row: 2 / 4;\n grid-template-rows: subgrid;\n\n & img {\n max-width: 100%;\n height: auto;\n }\n\n &[enabled] {\n &::part(dropslot) {\n background-color: var(--qti-bg-active);\n }\n }\n\n &[disabled] {\n &::part(dropslot) {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n\n &[active] {\n &::part(dropslot) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n }\n\n &::part(dropslot) {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n min-height: 6rem;\n gap: var(--qti-gap-size);\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n & > *:not(qti-simple-associable-choice) {\n pointer-events: none;\n }\n\n & > qti-simple-associable-choice {\n\n &::part(dropslot) {\n display: none;\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n flex-basis: fit-content;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px;\n }\n }\n }\n }\n\n qti-order-interaction:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n qti-order-interaction:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n qti-order-interaction {\n &::part(qti-simple-choice),\n & qti-simple-choice {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px\n }\n\n &::part(qti-simple-choice) {\n display: flex;\n overflow: hidden;\n align-items: center;\n width: 100%;\n text-overflow: ellipsis;\n }\n\n &::part(drops) {\n gap: 0.5rem; /* gap-2 */\n }\n\n &::part(drags) {\n gap: 0.5rem; /* gap-2 */\n }\n\n &::part(drop-list) {\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light & {\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n display: flex;\n min-height: 4rem;\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &::part(active) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n & drop-list {\n &[shape='circle'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='square'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n }\n\n qti-associate-interaction {\n /* General styles for active and enabled states */\n &:state(--dragzone-active) slot[name='qti-simple-associable-choice'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled) slot[name='qti-simple-associable-choice'] {\n background-color: var(--qti-bg-active);\n }\n\n & qti-simple-associable-choice, /* drags when in lightdom */\n &::part(qti-simple-associable-choice) /* drags when in shadowdom */ {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px\n }\n\n /* display: flex;\n overflow: hidden;\n align-items: center; */\n\n /* &::part(drop-container) {\n display: flex;\n flex-direction: column;\n gap: var(--qti-gap-size);\n } */\n\n &::part(drop-list) {\n\n display: grid;\n height: 3rem;\n min-width: 10rem;\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &::part(drop-list):focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(drop-list)[dragging] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n /* &::part(drop-list) {\n @apply act;\n } */\n }\n\n qti-graphic-order-interaction {\n & qti-hotspot-choice {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &[aria-ordervalue] {\n display: grid;\n place-content: center;\n }\n\n &[aria-ordervalue]::after {\n content: attr(aria-ordervalue) !important;\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-graphic-associate-interaction {\n position: relative;\n display: block;\n\n & qti-associable-hotspot {\n &[shape='circle'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='square'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-slider-interaction {\n display: block;\n\n --qti-tick-color: rgb(229 231 235 / 100%);\n --qti-tick-width: 1px;\n\n &::part(slider) {\n margin-left: 2rem; /* mx-8 */\n margin-right: 2rem;\n padding-bottom: 1rem; /* pb-4 */\n padding-top: 1.25rem; /* pt-5 */\n }\n\n --show-bounds: true;\n\n &::part(bounds) {\n display: flex;\n width: 100%;\n justify-content: space-between;\n margin-bottom: 0.5rem; /* mb-2 */\n }\n\n --show-ticks: true;\n\n &::part(ticks) {\n margin-left: 0.125rem; /* mx-0.5 */\n margin-right: 0.125rem;\n margin-bottom: 0.25rem; /* mb-1 */\n height: 0.5rem; /* h-2 */\n background: linear-gradient(to right, var(--qti-tick-color) var(--qti-tick-width), transparent 1px) repeat-x 0\n center / calc(calc(100% - var(--qti-tick-width)) / ((var(--max) - var(--min)) / var(--step))) 100%;\n }\n\n &::part(rail) {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 0.375rem; /* h-1.5 */\n width: 100%;\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n border: 1px solid #d1d5db; /* border-gray-300 */\n background-color: #e5e7eb; /* bg-gray-200 */\n }\n\n &::part(knob) {\n background-color: var(--qti-primary);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage);\n }\n\n --show-value: true;\n\n &::part(value) {\n position: absolute;\n bottom: 2rem; /* bottom-8 */\n left: 0.5rem; /* left-2 */\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 0.25rem; /* rounded */\n background-color: #f3f4f6; /* bg-gray-100 */\n padding: 0.25rem 0.5rem; /* px-2 py-1 */\n text-align: center;\n color: #6b7280; /* text-gray-500 */\n }\n }\n\n qti-select-point-interaction {\n &::part(point) {\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n border-radius: 100%;\n\n width: var(--qti-point-size);\n\n height: var(--qti-point-size);\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n }\n }\n\n qti-position-object-stage {\n & qti-position-object-interaction {\n /* no styles necessary, only layout styles, defined in the component */\n }\n }\n\n qti-prompt {\n margin: 0.5rem 0; /* my-2 */\n display: block;\n width: 100%;\n }\n}\n","import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\n\nimport itemCss from '../../../item.css?inline';\n\n/**\n * `<test-container>` is a custom element designed for hosting the qti-assessment-test.\n * The `qti-assessment-test` will be placed inside the shadow DOM of this element.\n *\n * ### Example Usage\n * The `test-container` element to hosts the visual representation of the items.\n * You can style the container by adding a class to the element.\n *\n * ```html\n * <qti-test testurl=\"./path/to/assessment.xml\">\n * <test-container class=\"container bg-white m-2\"></test-container>\n * </qti-test>\n * ```\n *\n * @tag test-container\n */\n@customElement('test-container')\nexport class TestContainer extends LitElement {\n /**\n * Internal state for the dynamically loaded content.\n * This is a Promise resolving to the content that will be rendered.\n */\n @state()\n private content: Promise<DocumentFragment>;\n\n @property({ type: String, attribute: 'test-url' })\n testURL = '';\n\n /**\n * Preloaded content from a `<template>` child, if present.\n */\n private preContent: any;\n\n /**\n * Lifecycle callback invoked when the element is added to the DOM.\n * Handles template preloading and dispatches a `qti-load-test-request` event\n * if no template is found.\n */\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n\n const template = this.querySelector('template') as HTMLTemplateElement;\n if (template) {\n this.preContent = template.content;\n } else {\n this.preContent = html``;\n\n // Dynamically create and apply styles\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n\n await this.updateComplete;\n\n // Dispatch a custom event to request test content\n const event = new CustomEvent<{ promise: Promise<DocumentFragment>; testURL: string }>('qti-load-test-request', {\n bubbles: true,\n composed: true,\n detail: {\n promise: null,\n testURL: this.testURL\n }\n });\n\n const preventDefault = this.dispatchEvent(event);\n if (!preventDefault) {\n console.warn('No qti-load-test-request listener found');\n this.preContent = html`<span>qti-load-test-request was not catched</span>`;\n } else {\n this.content = (async () => {\n return await event.detail.promise;\n })();\n }\n }\n }\n\n /**\n * Renders the component content.\n * Preloaded template content is rendered first, followed by the default slot\n * and dynamically loaded content.\n */\n render() {\n return html`\n ${this.preContent}\n <slot></slot>\n ${until(this.content, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-container': TestContainer;\n }\n}\n","/*\n * @license\n * Portions Copyright (c) 2013, the Dart project authors.\n */\n\nexport const KEYWORDS = ['this'];\nexport const UNARY_OPERATORS = ['+', '-', '!'];\nexport const BINARY_OPERATORS = [\n '=',\n '+',\n '-',\n '*',\n '/',\n '%',\n '^',\n '==',\n '!=',\n '>',\n '<',\n '>=',\n '<=',\n '||',\n '&&',\n '??',\n '&',\n '===',\n '!==',\n '|',\n '|>',\n];\n\nexport const PRECEDENCE: Record<string, number> = {\n '!': 0,\n ':': 0,\n ',': 0,\n ')': 0,\n ']': 0,\n '}': 0,\n\n '|>': 1,\n '?': 2,\n '??': 3,\n '||': 4,\n '&&': 5,\n '|': 6,\n '^': 7,\n '&': 8,\n\n // equality\n '!=': 9,\n '==': 9,\n '!==': 9,\n '===': 9,\n\n // relational\n '>=': 10,\n '>': 10,\n '<=': 10,\n '<': 10,\n\n // additive\n '+': 11,\n '-': 11,\n\n // multiplicative\n '%': 12,\n '/': 12,\n '*': 12,\n\n // postfix\n '(': 13,\n '[': 13,\n '.': 13,\n '{': 13, // not sure this is correct\n};\n\nexport const POSTFIX_PRECEDENCE = 13;\n","/*\n * @license\n * Portions Copyright (c) 2013, the Dart project authors.\n */\n\nimport {KEYWORDS, POSTFIX_PRECEDENCE, PRECEDENCE} from './constants.js';\n\nconst _TWO_CHAR_OPS = ['==', '!=', '<=', '>=', '||', '&&', '??', '|>'];\nconst _THREE_CHAR_OPS = ['===', '!=='];\n\nexport interface Token {\n kind: Kind;\n value: string;\n precedence: number;\n}\n\nexport enum Kind {\n STRING = 1,\n IDENTIFIER = 2,\n DOT = 3,\n COMMA = 4,\n COLON = 5,\n INTEGER = 6,\n DECIMAL = 7,\n OPERATOR = 8,\n GROUPER = 9,\n KEYWORD = 10,\n ARROW = 11,\n}\n\nexport const token = (kind: Kind, value: string, precedence: number = 0) => ({\n kind,\n value,\n precedence,\n});\n\nconst _isWhitespace = (ch: number) =>\n ch === 9 /* \\t */ ||\n ch === 10 /* \\n */ ||\n ch === 13 /* \\r */ ||\n ch === 32; /* space */\n\n// TODO(justinfagnani): allow code points > 127\nconst _isIdentOrKeywordStart = (ch: number) =>\n ch === 95 /* _ */ ||\n ch === 36 /* $ */ ||\n // ch &= ~32 puts ch into the range [65,90] [A-Z] only if ch was already in\n // the that range or in the range [97,122] [a-z]. We must mutate ch only after\n // checking other characters, thus the comma operator.\n ((ch &= ~32), 65 /* A */ <= ch && ch <= 90); /* Z */\n\n// TODO(justinfagnani): allow code points > 127\nconst _isIdentifier = (ch: number) =>\n _isIdentOrKeywordStart(ch) || _isNumber(ch);\n\nconst _isKeyword = (str: string) => KEYWORDS.indexOf(str) !== -1;\n\nconst _isQuote = (ch: number) => ch === 34 /* \" */ || ch === 39; /* ' */\n\nconst _isNumber = (ch: number) => 48 /* 0 */ <= ch && ch <= 57; /* 9 */\n\nconst _isOperator = (ch: number) =>\n ch === 43 /* + */ ||\n ch === 45 /* - */ ||\n ch === 42 /* * */ ||\n ch === 47 /* / */ ||\n ch === 33 /* ! */ ||\n ch === 38 /* & */ ||\n ch === 37 /* % */ ||\n ch === 60 /* < */ ||\n ch === 61 /* = */ ||\n ch === 62 /* > */ ||\n ch === 63 /* ? */ ||\n ch === 94 /* ^ */ ||\n ch === 124; /* | */\n\nconst _isGrouper = (ch: number) =>\n ch === 40 /* ( */ ||\n ch === 41 /* ) */ ||\n ch === 91 /* [ */ ||\n ch === 93 /* ] */ ||\n ch === 123 /* { */ ||\n ch === 125; /* } */\n\nconst _escapeString = (str: string) =>\n str.replace(/\\\\(.)/g, (_match, group) => {\n switch (group) {\n case 'n':\n return '\\n';\n case 'r':\n return '\\r';\n case 't':\n return '\\t';\n case 'b':\n return '\\b';\n case 'f':\n return '\\f';\n default:\n return group;\n }\n });\n\nexport class Tokenizer {\n private _input: string;\n private _index = -1;\n private _tokenStart = 0;\n private _next?: number;\n\n constructor(input: string) {\n this._input = input;\n this._advance();\n }\n\n nextToken() {\n while (_isWhitespace(this._next!)) {\n this._advance(true);\n }\n if (_isQuote(this._next!)) return this._tokenizeString();\n if (_isIdentOrKeywordStart(this._next!)) {\n return this._tokenizeIdentOrKeyword();\n }\n if (_isNumber(this._next!)) return this._tokenizeNumber();\n if (this._next === 46 /* . */) return this._tokenizeDot();\n if (this._next === 44 /* , */) return this._tokenizeComma();\n if (this._next === 58 /* : */) return this._tokenizeColon();\n if (_isOperator(this._next!)) return this._tokenizeOperator();\n if (_isGrouper(this._next!)) return this._tokenizeGrouper();\n // no match, should be end of input\n this._advance();\n if (this._next !== undefined) {\n throw new Error(`Expected end of input, got ${this._next}`);\n }\n return undefined;\n }\n\n private _advance(resetTokenStart?: boolean) {\n this._index++;\n if (this._index < this._input.length) {\n this._next = this._input.charCodeAt(this._index);\n if (resetTokenStart === true) {\n this._tokenStart = this._index;\n }\n } else {\n this._next = undefined;\n }\n }\n\n private _getValue(lookahead: number = 0) {\n const v = this._input.substring(this._tokenStart, this._index + lookahead);\n if (lookahead === 0) {\n this._clearValue();\n }\n return v;\n }\n\n private _clearValue() {\n this._tokenStart = this._index;\n }\n\n private _tokenizeString() {\n const _us = 'unterminated string';\n const quoteChar = this._next;\n this._advance(true);\n while (this._next !== quoteChar) {\n if (this._next === undefined) throw new Error(_us);\n if (this._next === 92 /* \\ */) {\n this._advance();\n if (this._next === undefined) throw new Error(_us);\n }\n this._advance();\n }\n const t = token(Kind.STRING, _escapeString(this._getValue()));\n this._advance();\n return t;\n }\n\n private _tokenizeIdentOrKeyword() {\n // This do/while loops assumes _isIdentifier(this._next!), so it must only\n // be called if _isIdentOrKeywordStart(this._next!) has returned true.\n do {\n this._advance();\n } while (_isIdentifier(this._next!));\n const value = this._getValue();\n const kind = _isKeyword(value) ? Kind.KEYWORD : Kind.IDENTIFIER;\n return token(kind, value);\n }\n\n private _tokenizeNumber() {\n // This do/while loops assumes _isNumber(this._next!), so it must only\n // be called if _isNumber(this._next!) has returned true.\n do {\n this._advance();\n } while (_isNumber(this._next!));\n if (this._next === 46 /* . */) return this._tokenizeDot();\n return token(Kind.INTEGER, this._getValue());\n }\n\n private _tokenizeDot() {\n this._advance();\n if (_isNumber(this._next!)) return this._tokenizeFraction();\n this._clearValue();\n return token(Kind.DOT, '.', POSTFIX_PRECEDENCE);\n }\n\n private _tokenizeComma() {\n this._advance(true);\n return token(Kind.COMMA, ',');\n }\n\n private _tokenizeColon() {\n this._advance(true);\n return token(Kind.COLON, ':');\n }\n\n private _tokenizeFraction() {\n // This do/while loops assumes _isNumber(this._next!), so it must only\n // be called if _isNumber(this._next!) has returned true.\n do {\n this._advance();\n } while (_isNumber(this._next!));\n return token(Kind.DECIMAL, this._getValue());\n }\n\n private _tokenizeOperator() {\n this._advance();\n let op = this._getValue(2);\n\n if (_THREE_CHAR_OPS.indexOf(op) !== -1) {\n this._advance();\n this._advance();\n } else {\n op = this._getValue(1);\n if (op === '=>') {\n this._advance();\n return token(Kind.ARROW, op);\n }\n if (_TWO_CHAR_OPS.indexOf(op) !== -1) {\n this._advance();\n }\n }\n op = this._getValue();\n return token(Kind.OPERATOR, op, PRECEDENCE[op]);\n }\n\n private _tokenizeGrouper() {\n const value = String.fromCharCode(this._next!);\n const t = token(Kind.GROUPER, value, PRECEDENCE[value]);\n this._advance(true);\n return t;\n }\n}\n","/*\n * @license\n * Portions Copyright (c) 2013, the Dart project authors.\n */\n\nimport {ID, Invoke, Expression} from './ast.js';\nimport {AstFactory} from './ast_factory.js';\nimport {\n BINARY_OPERATORS,\n KEYWORDS,\n POSTFIX_PRECEDENCE,\n UNARY_OPERATORS,\n} from './constants.js';\nimport {Kind, Token, Tokenizer} from './tokenizer.js';\n\nexport const parse = <E extends Expression>(\n expr: string,\n astFactory: AstFactory<E>,\n): E | undefined => new Parser<E>(expr, astFactory).parse();\n\nexport class Parser<N extends Expression> {\n private _kind?: Kind;\n private _tokenizer: Tokenizer;\n private _ast: AstFactory<N>;\n private _token?: Token;\n private _value?: string;\n\n constructor(input: string, astFactory: AstFactory<N>) {\n this._tokenizer = new Tokenizer(input);\n this._ast = astFactory;\n }\n\n parse(): N | undefined {\n this._advance();\n return this._parseExpression();\n }\n\n private _advance(kind?: Kind, value?: string) {\n if (!this._matches(kind, value)) {\n throw new Error(\n `Expected kind ${kind} (${value}), was ${this._token?.kind} (${this._token?.value})`,\n );\n }\n const t = this._tokenizer.nextToken();\n this._token = t;\n this._kind = t?.kind;\n this._value = t?.value;\n }\n\n _matches(kind?: Kind, value?: string) {\n return !((kind && this._kind !== kind) || (value && this._value !== value));\n }\n\n private _parseExpression(): N | undefined {\n if (!this._token) return this._ast.empty();\n const expr = this._parseUnary();\n return expr === undefined ? undefined : this._parsePrecedence(expr, 0);\n }\n\n // _parsePrecedence and _parseBinary implement the precedence climbing\n // algorithm as described in:\n // http://en.wikipedia.org/wiki/Operator-precedence_parser#Precedence_climbing_method\n private _parsePrecedence(left: N | undefined, precedence: number) {\n if (left === undefined) {\n throw new Error('Expected left to be defined.');\n }\n while (this._token) {\n if (this._matches(Kind.GROUPER, '(')) {\n const args = this._parseArguments();\n left = this._ast.invoke(left, undefined, args);\n } else if (this._matches(Kind.GROUPER, '[')) {\n const indexExpr = this._parseIndex();\n left = this._ast.index(left, indexExpr);\n } else if (this._matches(Kind.DOT)) {\n this._advance();\n const right = this._parseUnary();\n left = this._makeInvokeOrGetter(left, right);\n } else if (this._matches(Kind.KEYWORD)) {\n break;\n } else if (\n this._matches(Kind.OPERATOR) &&\n this._token.precedence >= precedence\n ) {\n left =\n this._value === '?'\n ? this._parseTernary(left)\n : this._parseBinary(left, this._token);\n } else {\n break;\n }\n }\n return left;\n }\n\n private _makeInvokeOrGetter(left: N, right: N | undefined) {\n if (right === undefined) {\n throw new Error('expected identifier');\n }\n if (right.type === 'ID') {\n return this._ast.getter(left, (right as ID).value);\n } else if (\n right.type === 'Invoke' &&\n (right as Invoke).receiver.type === 'ID'\n ) {\n const method = (right as Invoke).receiver as ID;\n return this._ast.invoke(\n left,\n method.value,\n (right as Invoke).arguments as any,\n );\n } else {\n throw new Error(`expected identifier: ${right}`);\n }\n }\n\n private _parseBinary(left: N, op: Token) {\n if (BINARY_OPERATORS.indexOf(op.value) === -1) {\n throw new Error(`unknown operator: ${op.value}`);\n }\n this._advance();\n let right = this._parseUnary();\n while (\n (this._kind === Kind.OPERATOR ||\n this._kind === Kind.DOT ||\n this._kind === Kind.GROUPER) &&\n this._token!.precedence > op.precedence\n ) {\n right = this._parsePrecedence(right, this._token!.precedence);\n }\n return this._ast.binary(left, op.value, right);\n }\n\n private _parseUnary(): N | undefined {\n if (this._matches(Kind.OPERATOR)) {\n const value = this._value;\n this._advance();\n // handle unary + and - on numbers as part of the literal, not as a\n // unary operator\n if (value === '+' || value === '-') {\n if (this._matches(Kind.INTEGER)) {\n return this._parseInteger(value);\n } else if (this._matches(Kind.DECIMAL)) {\n return this._parseDecimal(value);\n }\n }\n if (UNARY_OPERATORS.indexOf(value!) === -1)\n throw new Error(`unexpected token: ${value}`);\n const expr = this._parsePrecedence(\n this._parsePrimary(),\n POSTFIX_PRECEDENCE,\n );\n return this._ast.unary(value!, expr);\n }\n return this._parsePrimary();\n }\n\n private _parseTernary(condition: N) {\n this._advance(Kind.OPERATOR, '?');\n const trueExpr = this._parseExpression();\n this._advance(Kind.COLON);\n const falseExpr = this._parseExpression();\n return this._ast.ternary(condition, trueExpr, falseExpr);\n }\n\n private _parsePrimary() {\n switch (this._kind) {\n case Kind.KEYWORD:\n const keyword = this._value!;\n if (keyword === 'this') {\n this._advance();\n // TODO(justin): return keyword node\n return this._ast.id(keyword);\n } else if (KEYWORDS.indexOf(keyword) !== -1) {\n throw new Error(`unexpected keyword: ${keyword}`);\n }\n throw new Error(`unrecognized keyword: ${keyword}`);\n case Kind.IDENTIFIER:\n return this._parseInvokeOrIdentifier();\n case Kind.STRING:\n return this._parseString();\n case Kind.INTEGER:\n return this._parseInteger();\n case Kind.DECIMAL:\n return this._parseDecimal();\n case Kind.GROUPER:\n if (this._value === '(') {\n return this._parseParenOrFunction();\n } else if (this._value === '{') {\n return this._parseMap();\n } else if (this._value === '[') {\n return this._parseList();\n }\n return undefined;\n case Kind.COLON:\n throw new Error('unexpected token \":\"');\n default:\n return undefined;\n }\n }\n\n private _parseList() {\n const items: (N | undefined)[] = [];\n do {\n this._advance();\n if (this._matches(Kind.GROUPER, ']')) break;\n items.push(this._parseExpression());\n } while (this._matches(Kind.COMMA));\n this._advance(Kind.GROUPER, ']');\n return this._ast.list(items);\n }\n\n private _parseMap() {\n const entries: {[key: string]: N | undefined} = {};\n do {\n this._advance();\n if (this._matches(Kind.GROUPER, '}')) break;\n const key = this._value!;\n if (this._matches(Kind.STRING) || this._matches(Kind.IDENTIFIER)) {\n this._advance();\n }\n this._advance(Kind.COLON);\n entries[key] = this._parseExpression();\n } while (this._matches(Kind.COMMA));\n this._advance(Kind.GROUPER, '}');\n return this._ast.map(entries);\n }\n\n private _parseInvokeOrIdentifier() {\n const value = this._value;\n if (value === 'true') {\n this._advance();\n return this._ast.literal(true);\n }\n if (value === 'false') {\n this._advance();\n return this._ast.literal(false);\n }\n if (value === 'null') {\n this._advance();\n return this._ast.literal(null);\n }\n if (value === 'undefined') {\n this._advance();\n return this._ast.literal(undefined);\n }\n const identifier = this._parseIdentifier();\n const args = this._parseArguments();\n return !args ? identifier : this._ast.invoke(identifier, undefined, args);\n }\n\n private _parseIdentifier() {\n if (!this._matches(Kind.IDENTIFIER)) {\n throw new Error(`expected identifier: ${this._value}`);\n }\n const value = this._value;\n this._advance();\n return this._ast.id(value!);\n }\n\n private _parseArguments() {\n if (!this._matches(Kind.GROUPER, '(')) {\n return undefined;\n }\n const args: Array<N | undefined> = [];\n do {\n this._advance();\n if (this._matches(Kind.GROUPER, ')')) {\n break;\n }\n const expr = this._parseExpression();\n args.push(expr);\n } while (this._matches(Kind.COMMA));\n this._advance(Kind.GROUPER, ')');\n return args;\n }\n\n private _parseIndex() {\n // console.assert(this._matches(Kind.GROUPER, '['));\n this._advance();\n const expr = this._parseExpression();\n this._advance(Kind.GROUPER, ']');\n return expr;\n }\n\n private _parseParenOrFunction() {\n const expressions = this._parseArguments();\n if (this._matches(Kind.ARROW)) {\n this._advance();\n const body = this._parseExpression();\n const params = expressions?.map((e) => (e as ID).value) ?? [];\n return this._ast.arrowFunction(params, body);\n } else {\n return this._ast.paren(expressions![0]);\n }\n }\n\n private _parseString() {\n const value = this._ast.literal(this._value!);\n this._advance();\n return value;\n }\n\n private _parseInteger(prefix: string = '') {\n const value = this._ast.literal(parseInt(`${prefix}${this._value}`, 10));\n this._advance();\n return value;\n }\n\n private _parseDecimal(prefix: string = '') {\n const value = this._ast.literal(parseFloat(`${prefix}${this._value}`));\n this._advance();\n return value;\n }\n}\n","/*\n * @license\n * Portions Copyright (c) 2013, the Dart project authors.\n */\n\nimport * as ast from './ast.js';\nimport {AstFactory} from './ast_factory.js';\n\nconst _BINARY_OPERATORS: Record<string, (a: any, b: any) => any> = {\n '+': (a: any, b: any) => a + b,\n '-': (a: any, b: any) => a - b,\n '*': (a: any, b: any) => a * b,\n '/': (a: any, b: any) => a / b,\n '%': (a: any, b: any) => a % b,\n '==': (a: any, b: any) => a == b,\n '!=': (a: any, b: any) => a != b,\n '===': (a: any, b: any) => a === b,\n '!==': (a: any, b: any) => a !== b,\n '>': (a: any, b: any) => a > b,\n '>=': (a: any, b: any) => a >= b,\n '<': (a: any, b: any) => a < b,\n '<=': (a: any, b: any) => a <= b,\n '||': (a: any, b: any) => a || b,\n '&&': (a: any, b: any) => a && b,\n '??': (a: any, b: any) => a ?? b,\n '|': (a: any, f: (a: any) => any) => f(a),\n '|>': (a: any, f: (a: any) => any) => f(a),\n};\n\nconst _UNARY_OPERATORS: Record<string, (a: any) => any> = {\n '+': (a: any) => a,\n '-': (a: any) => -a,\n '!': (a: any) => !a,\n};\n\nexport interface Scope {\n [key: string]: any;\n}\n\nexport interface Evaluatable {\n evaluate(scope: Scope): any;\n getIds(idents: string[]): string[];\n}\n\nexport type Expression =\n | Literal\n | Empty\n | ID\n | Unary\n | Binary\n | Getter\n | Invoke\n | Index\n | Ternary\n | Map\n | List\n | ArrowFunction;\n\nexport interface Literal extends Evaluatable {\n type: 'Literal';\n value: ast.LiteralValue;\n}\nexport interface Empty extends Evaluatable {\n type: 'Empty';\n}\nexport interface ID extends Evaluatable {\n type: 'ID';\n value: string;\n}\nexport interface Unary extends Evaluatable {\n type: 'Unary';\n operator: string;\n child: Expression;\n}\nexport interface Binary extends Evaluatable {\n type: 'Binary';\n operator: string;\n left: Expression;\n right: Expression;\n}\nexport interface Getter extends Evaluatable {\n type: 'Getter';\n receiver: Expression;\n name: string;\n}\nexport interface Invoke extends Evaluatable {\n type: 'Invoke';\n receiver: Expression;\n method: string | undefined;\n arguments: Array<Expression> | undefined;\n}\nexport interface Index extends Evaluatable {\n type: 'Index';\n receiver: Expression;\n argument: Expression;\n}\nexport interface Ternary extends Evaluatable {\n type: 'Ternary';\n condition: Expression;\n trueExpr: Expression;\n falseExpr: Expression;\n}\nexport interface Map extends Evaluatable {\n type: 'Map';\n entries: {[key: string]: Expression | undefined} | undefined;\n}\nexport interface List extends Evaluatable {\n type: 'List';\n items: Array<Expression> | undefined;\n}\nexport interface ArrowFunction extends Evaluatable {\n type: 'ArrowFunction';\n params: Array<string>;\n body: Expression;\n}\n\nexport class EvalAstFactory implements AstFactory<Expression> {\n empty(): Empty {\n // TODO(justinfagnani): return null instead?\n return {\n type: 'Empty',\n evaluate(scope) {\n return scope;\n },\n getIds(idents) {\n return idents;\n },\n };\n }\n\n // TODO(justinfagnani): just use a JS literal?\n literal(v: string): Literal {\n return {\n type: 'Literal',\n value: v,\n evaluate(_scope) {\n return this.value;\n },\n getIds(idents) {\n return idents;\n },\n };\n }\n\n id(v: string): ID {\n return {\n type: 'ID',\n value: v,\n evaluate(scope) {\n // TODO(justinfagnani): this prevents access to properties named 'this'\n if (this.value === 'this') return scope;\n return scope?.[this.value];\n },\n getIds(idents) {\n idents.push(this.value);\n return idents;\n },\n };\n }\n\n unary(op: string, expr: Expression): Unary {\n const f = _UNARY_OPERATORS[op];\n return {\n type: 'Unary',\n operator: op,\n child: expr,\n evaluate(scope) {\n return f(this.child.evaluate(scope));\n },\n getIds(idents) {\n return this.child.getIds(idents);\n },\n };\n }\n\n binary(l: Expression, op: string, r: Expression): Binary {\n const f = _BINARY_OPERATORS[op];\n return {\n type: 'Binary',\n operator: op,\n left: l,\n right: r,\n evaluate(scope) {\n if (this.operator === '=') {\n if (\n this.left.type !== 'ID' &&\n this.left.type !== 'Getter' &&\n this.left.type !== 'Index'\n ) {\n throw new Error(`Invalid assignment target: ${this.left}`);\n }\n const value = this.right.evaluate(scope);\n let receiver: object | undefined = undefined;\n let property!: string;\n if (this.left.type === 'Getter') {\n receiver = this.left.receiver.evaluate(scope);\n property = this.left.name;\n } else if (this.left.type === 'Index') {\n receiver = this.left.receiver.evaluate(scope);\n property = this.left.argument.evaluate(scope);\n } else if (this.left.type === 'ID') {\n // TODO: the id could be a parameter\n receiver = scope;\n property = this.left.value;\n }\n return receiver === undefined\n ? undefined\n : ((receiver as any)[property] = value);\n }\n return f(this.left.evaluate(scope), this.right.evaluate(scope));\n },\n getIds(idents) {\n this.left.getIds(idents);\n this.right.getIds(idents);\n return idents;\n },\n };\n }\n\n getter(g: Expression, n: string): Getter {\n return {\n type: 'Getter',\n receiver: g,\n name: n,\n evaluate(scope) {\n return this.receiver.evaluate(scope)?.[this.name];\n },\n getIds(idents) {\n this.receiver.getIds(idents);\n return idents;\n },\n };\n }\n\n invoke(receiver: Expression, method: string, args: Expression[]): Invoke {\n if (method != null && typeof method !== 'string') {\n throw new Error('method not a string');\n }\n return {\n type: 'Invoke',\n receiver: receiver,\n method: method,\n arguments: args,\n evaluate(scope) {\n const receiver = this.receiver.evaluate(scope);\n // TODO(justinfagnani): this might be wrong in cases where we're\n // invoking a top-level function rather than a method. If method is\n // defined on a nested scope, then we should probably set _this to null.\n const _this = this.method ? receiver : scope?.['this'] ?? scope;\n const f = this.method ? receiver?.[method] : receiver;\n const args = this.arguments ?? [];\n const argValues = args.map((a) => a?.evaluate(scope));\n return f?.apply?.(_this, argValues);\n },\n getIds(idents) {\n this.receiver.getIds(idents);\n this.arguments?.forEach((a) => a?.getIds(idents));\n return idents;\n },\n };\n }\n\n paren(e: Expression): Expression {\n return e;\n }\n\n index(e: Expression, a: Expression): Index {\n return {\n type: 'Index',\n receiver: e,\n argument: a,\n evaluate(scope) {\n return this.receiver.evaluate(scope)?.[this.argument.evaluate(scope)];\n },\n getIds(idents) {\n this.receiver.getIds(idents);\n return idents;\n },\n };\n }\n\n ternary(c: Expression, t: Expression, f: Expression): Ternary {\n return {\n type: 'Ternary',\n condition: c,\n trueExpr: t,\n falseExpr: f,\n evaluate(scope) {\n const c = this.condition.evaluate(scope);\n if (c) {\n return this.trueExpr.evaluate(scope);\n } else {\n return this.falseExpr.evaluate(scope);\n }\n },\n getIds(idents) {\n this.condition.getIds(idents);\n this.trueExpr.getIds(idents);\n this.falseExpr.getIds(idents);\n return idents;\n },\n };\n }\n\n map(entries: {[key: string]: Expression} | undefined): Map {\n return {\n type: 'Map',\n entries: entries,\n evaluate(scope) {\n const map = {};\n if (entries && this.entries) {\n for (const key in entries) {\n const val = this.entries[key];\n if (val) {\n (map as any)[key] = val.evaluate(scope);\n }\n }\n }\n return map;\n },\n getIds(idents) {\n if (entries && this.entries) {\n for (const key in entries) {\n const val = this.entries[key];\n if (val) {\n val.getIds(idents);\n }\n }\n }\n return idents;\n },\n };\n }\n\n // TODO(justinfagnani): if the list is deeply literal\n list(l: Array<Expression> | undefined): List {\n return {\n type: 'List',\n items: l,\n evaluate(scope) {\n return this.items?.map((a) => a?.evaluate(scope));\n },\n getIds(idents) {\n this.items?.forEach((i) => i?.getIds(idents));\n return idents;\n },\n };\n }\n\n arrowFunction(params: string[], body: Expression): Expression {\n return {\n type: 'ArrowFunction',\n params,\n body,\n evaluate(scope) {\n const params = this.params;\n const body = this.body;\n return function (...args: any[]) {\n // TODO: this isn't correct for assignments to variables in outer\n // scopes\n // const newScope = Object.create(scope ?? null);\n const paramsObj = Object.fromEntries(\n params.map((p, i) => [p, args[i]]),\n );\n const newScope = new Proxy(scope ?? {}, {\n set(target, prop, value) {\n if (paramsObj.hasOwnProperty(prop)) {\n paramsObj[prop as string] = value;\n }\n return (target[prop as string] = value);\n },\n get(target, prop) {\n if (paramsObj.hasOwnProperty(prop)) {\n return paramsObj[prop as string];\n }\n return target[prop as string];\n },\n });\n return body.evaluate(newScope);\n };\n },\n getIds(idents) {\n // Only return the _free_ variables in the body. Since arrow function\n // parameters are the only way to introduce new variable names, we can\n // assume that any variable in the body that isn't a parameter is free.\n return this.body\n .getIds(idents)\n .filter((id) => !this.params.includes(id));\n },\n };\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n Directive,\n PartInfo,\n DirectiveClass,\n DirectiveResult,\n} from './directive.js';\nimport {\n _$LH as p,\n AttributePart,\n noChange,\n Part,\n Disconnectable,\n} from './lit-html.js';\n\nimport type {\n PropertyPart,\n ChildPart,\n BooleanAttributePart,\n EventPart,\n ElementPart,\n TemplateInstance,\n} from './lit-html.js';\n\n// Contains either the minified or unminified `_$resolve` Directive method name.\nlet resolveMethodName: Extract<keyof Directive, '_$resolve'> | null = null;\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n * @private\n */\nexport const _$LH = {\n boundAttributeSuffix: p._boundAttributeSuffix,\n marker: p._marker,\n markerMatch: p._markerMatch,\n HTML_RESULT: p._HTML_RESULT,\n getTemplateHtml: p._getTemplateHtml,\n overrideDirectiveResolve: (\n directiveClass: new (part: PartInfo) => Directive & {render(): unknown},\n resolveOverrideFn: (directive: Directive, values: unknown[]) => unknown\n ) =>\n class extends directiveClass {\n override _$resolve(\n this: Directive,\n _part: Part,\n values: unknown[]\n ): unknown {\n return resolveOverrideFn(this, values);\n }\n },\n patchDirectiveResolve: (\n directiveClass: typeof Directive,\n resolveOverrideFn: (\n this: Directive,\n _part: Part,\n values: unknown[]\n ) => unknown\n ) => {\n if (directiveClass.prototype._$resolve !== resolveOverrideFn) {\n resolveMethodName ??= directiveClass.prototype._$resolve\n .name as NonNullable<typeof resolveMethodName>;\n for (\n let proto = directiveClass.prototype;\n proto !== Object.prototype;\n proto = Object.getPrototypeOf(proto)\n ) {\n if (proto.hasOwnProperty(resolveMethodName)) {\n proto[resolveMethodName] = resolveOverrideFn;\n return;\n }\n }\n // Nothing was patched which indicates an error. The most likely error is\n // that somehow both minified and unminified lit code passed through this\n // codepath. This is possible as lit-labs/ssr contains its own lit-html\n // module as a dependency for server rendering client Lit code. If a\n // client contains multiple duplicate Lit modules with minified and\n // unminified exports, we currently cannot handle both.\n throw new Error(\n `Internal error: It is possible that both dev mode and production mode` +\n ` Lit was mixed together during SSR. Please comment on the issue: ` +\n `https://github.com/lit/lit/issues/4527`\n );\n }\n },\n setDirectiveClass(value: DirectiveResult, directiveClass: DirectiveClass) {\n // This property needs to remain unminified.\n value['_$litDirective$'] = directiveClass;\n },\n getAttributePartCommittedValue: (\n part: AttributePart,\n value: unknown,\n index: number | undefined\n ) => {\n // Use the part setter to resolve directives/concatenate multiple parts\n // into a final value (captured by passing in a commitValue override)\n let committedValue: unknown = noChange;\n // Note that _commitValue need not be in `stableProperties` because this\n // method is only run on `AttributePart`s created by lit-ssr using the same\n // version of the library as this file\n part._commitValue = (value: unknown) => (committedValue = value);\n part._$setValue(value, part, index);\n return committedValue;\n },\n connectedDisconnectable: (props?: object): Disconnectable => ({\n ...props,\n _$isConnected: true,\n }),\n resolveDirective: p._resolveDirective,\n AttributePart: p._AttributePart,\n PropertyPart: p._PropertyPart as typeof PropertyPart,\n BooleanAttributePart: p._BooleanAttributePart as typeof BooleanAttributePart,\n EventPart: p._EventPart as typeof EventPart,\n ElementPart: p._ElementPart as typeof ElementPart,\n TemplateInstance: p._TemplateInstance as typeof TemplateInstance,\n isIterable: p._isIterable,\n ChildPart: p._ChildPart as typeof ChildPart,\n};\n","import {render as renderLit, TemplateInstance, nothing} from 'lit-html';\nimport {CompiledTemplate, CompiledTemplateResult} from 'lit-html';\n\nimport {parse, Parser, EvalAstFactory} from 'jexpr';\nimport type {Expression, Scope} from 'jexpr/lib/eval';\n\nimport {_$LH} from 'lit-html/private-ssr-support.js';\nconst {AttributePart, PropertyPart, BooleanAttributePart, EventPart} = _$LH;\n\nconst astFactory = new EvalAstFactory();\nconst expressionCache = new Map<string, Expression | undefined>();\n\nconst toCamelCase = (s: string) =>\n s.replace(/-(-|\\w)/g, (_, p1: string) => p1.toUpperCase());\n\n/**\n * Gets the value from a string that contains a delimted expression: {{ ... }}\n */\nconst getSingleValue = (s: string, model: any) => {\n let ast = expressionCache.get(s);\n if (ast === undefined) {\n if (expressionCache.has(s)) {\n return undefined;\n }\n s = s.trim();\n if (s.startsWith('{{') && s.endsWith('}}')) {\n const expression = s.substring(2, s.length - 2).trim();\n ast = new Parser(expression, astFactory).parse();\n expressionCache.set(s, ast);\n }\n }\n return ast?.evaluate(model);\n};\n\nexport interface TemplateFunction {\n (model: object): unknown;\n}\n\n/**\n * A Renderer is responsible for rendering a block call, like\n * <template name=\"foo\">\n */\n// TODO: rename to BlockRenderer?\nexport interface Renderer {\n (model: any, handlers: TemplateHandlers, renderers: Renderers): unknown;\n}\n\nexport interface Renderers {\n [name: string]: Renderer;\n}\n\n/**\n * A TemplateHandlers is responsible for rendering control flow like\n * <template type=\"if\" if=\"{{x}}\">\n */\nexport type TemplateHandler = (\n template: HTMLTemplateElement,\n model: object,\n handlers: TemplateHandlers,\n renderers: Renderers,\n) => unknown;\n\nexport interface TemplateHandlers {\n [name: string]: TemplateHandler;\n}\n\nexport const ifHandler: TemplateHandler = (\n template: HTMLTemplateElement,\n model: object,\n handlers: TemplateHandlers,\n renderers: Renderers,\n) => {\n const ifAttribute = template.getAttribute('if');\n if (ifAttribute !== null && getSingleValue(ifAttribute, model)) {\n return evaluateTemplate(template, model, handlers, renderers);\n }\n return undefined;\n};\n\nconst bindingRegex = /(?<!\\\\){{(.*?)(?:(?<!\\\\)}})/g;\n\nconst hasEscapedBindingMarkers = (s: string) => /(?:\\\\{{)|(?:\\\\}})/g.test(s);\n\nconst unescapeBindingMarkers = (s: string) =>\n s.replaceAll(/\\\\{{/g, '{{').replace(/\\\\}}/g, '}}');\n\nexport const repeatHandler: TemplateHandler = (\n template: HTMLTemplateElement,\n model: object & {this?: unknown},\n handlers: TemplateHandlers,\n renderers: Renderers,\n) => {\n const repeatAttribute = template.getAttribute('repeat');\n if (repeatAttribute !== null) {\n const items = getSingleValue(repeatAttribute, model);\n if (!items[Symbol.iterator]) {\n return nothing;\n }\n const litTemplate = getLitTemplate(template);\n\n let index = -1;\n const result = [];\n for (const item of items) {\n index++;\n const itemModel = Object.create(model);\n itemModel.item = item;\n itemModel.index = index;\n itemModel['this'] = model['this'] ?? model;\n\n const values = [];\n for (const part of litTemplate.parts) {\n const value = part.update(itemModel, handlers, renderers);\n if (part.type === 1) {\n values.push(...(value as Iterable<unknown>));\n } else {\n values.push(value);\n }\n }\n const templateResult: CompiledTemplateResult = {\n _$litType$: litTemplate,\n values,\n };\n result.push(templateResult);\n }\n return result;\n }\n return undefined;\n};\n\nexport const defaultHandlers = <TemplateHandlers>{\n if: ifHandler,\n repeat: repeatHandler,\n};\n\n/**\n * @returns {Function} a template function of the form (model) => TemplateResult\n */\nexport const prepareTemplate = (\n template: HTMLTemplateElement,\n handlers: TemplateHandlers = defaultHandlers,\n renderers: Renderers = {},\n superTemplate?: HTMLTemplateElement,\n): TemplateFunction => {\n const litTemplate = getLitTemplate(template);\n const templateRenderers = litTemplate.renderers;\n if (superTemplate) {\n const superLitTemplate = getLitTemplate(superTemplate);\n const superRenderers = superLitTemplate.renderers;\n const superCallRenderer = templateRenderers['super'];\n\n if (superCallRenderer !== undefined) {\n // Explicit super call\n\n // render the sub template with:\n renderers = {\n // sub template's own renderes\n ...templateRenderers,\n // passed-in renderers\n ...renderers,\n // a super call renderer\n super: (model, handlers, renderers) => {\n // This renderer delegates to the super block in the sub template,\n // which in turn delegates back to the super renderer below, but with\n // the inner blocks of the super call.\n // when the super call goes, render with:\n renderers = {\n // super template's own blocks\n ...superRenderers,\n // passed-in renderers\n ...renderers,\n // sub template's overrides will be added by the inner super call\n super: (model, handlers, renderers) => {\n return evaluateTemplate(\n superTemplate,\n model,\n handlers,\n renderers,\n );\n },\n };\n return superCallRenderer(model, handlers, renderers);\n },\n };\n } else {\n // Implicit super call\n\n // Wrap the whole template in an implicit super call by rendering the\n // super template first, but using the block renderers from this template.\n // Render the super template with:\n renderers = {\n // super template's own blocks\n ...superRenderers,\n // sub template's overrides\n ...templateRenderers,\n // passed-in renderers\n ...renderers,\n };\n template = superTemplate;\n }\n } else {\n // No super call\n renderers = {\n // template's named blocks\n ...templateRenderers,\n // passed-in renderers\n ...renderers,\n };\n }\n return (model) => evaluateTemplate(template, model, handlers, renderers);\n};\n\nexport interface RenderOptions {\n renderers?: Renderers;\n extends?: HTMLTemplateElement;\n}\n\n/**\n * Renders a template element containing a Stampino template.\n *\n * This is a convenience function wrapper around:\n *\n * ```\n * import {render} from 'lit';\n * const templateFn = prepareTemplate(templateEl);\n * render(templateFn(model), container);\n * ```\n */\nexport const render = (\n template: HTMLTemplateElement,\n container: HTMLElement,\n model: any,\n handlers: TemplateHandlers = defaultHandlers,\n) => {\n const litTemplate = prepareTemplate(template, handlers);\n renderLit(litTemplate(model), container);\n};\n\n/**\n * Evaluates the given template and returns its result\n *\n * @param template\n * @param model\n * @param handlers\n * @param renderers\n * @returns\n */\nexport const evaluateTemplate = (\n template: HTMLTemplateElement,\n model: any,\n handlers: TemplateHandlers = defaultHandlers,\n renderers: Renderers = {},\n) => {\n const litTemplate = getLitTemplate(template);\n const values: Array<unknown> = [];\n for (const part of litTemplate.parts) {\n const value = part.update(model, handlers, renderers);\n if (part.type === 1) {\n values.push(...(value as Iterable<unknown>));\n } else {\n values.push(value);\n }\n }\n const templateResult: CompiledTemplateResult = {\n _$litType$: litTemplate,\n values,\n };\n return templateResult;\n};\n\ntype TemplatePart = TemplateInstance['_$template']['parts'][0];\n\ntype StampinoTemplatePart = TemplatePart & {\n update: PartUpdater;\n};\n\ntype PartUpdater = (\n model: object,\n handlers: TemplateHandlers,\n blocks: Renderers,\n) => unknown;\n\ninterface StampinoTemplate extends CompiledTemplate {\n parts: Array<StampinoTemplatePart>;\n renderers: Renderers;\n}\n\nconst litTemplateCache = new Map<HTMLTemplateElement, StampinoTemplate>();\n\nexport const getLitTemplate = (\n template: HTMLTemplateElement,\n): StampinoTemplate => {\n let litTemplate = litTemplateCache.get(template);\n if (litTemplate === undefined) {\n litTemplateCache.set(template, (litTemplate = makeLitTemplate(template)));\n }\n return litTemplate;\n};\n\nconst makeLitTemplate = (template: HTMLTemplateElement): StampinoTemplate => {\n const litTemplate: StampinoTemplate = {\n h: undefined as unknown as TemplateStringsArray,\n el: template.cloneNode(true) as HTMLTemplateElement,\n parts: [],\n renderers: {},\n };\n const walker = document.createTreeWalker(\n litTemplate.el!.content,\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT,\n );\n let node: Node | null = walker.currentNode;\n let nodeIndex = -1;\n const elementsToRemove = [];\n\n while ((node = walker.nextNode()) !== null) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n nodeIndex++;\n const element = node as Element;\n if (element.tagName === 'TEMPLATE') {\n const type = element.getAttribute('type');\n const name = element.getAttribute('name');\n const call = element.getAttribute('call');\n\n if (call !== null || type !== null || name !== null) {\n element.parentNode!.insertBefore(document.createComment(''), element);\n elementsToRemove.push(element);\n let update: PartUpdater;\n\n if (call !== null) {\n // This is a sub-template call, like <template call=\"foo\">\n const templateName = call.trim();\n const templateNameIsExpression =\n templateName.startsWith('{{') && templateName.endsWith('}}');\n\n update = (\n model: object,\n handlers: TemplateHandlers,\n renderers: Renderers,\n ) => {\n const dataAttr = element.getAttribute('data');\n const data =\n dataAttr === null ? undefined : getSingleValue(dataAttr, model);\n\n const renderer = templateNameIsExpression\n ? getSingleValue(templateName, model)\n : renderers[call];\n return renderer?.(data, handlers, renderers);\n };\n } else if (type !== null) {\n // This is a control-flow call, like if/repeat\n update = (\n model: object,\n handlers: TemplateHandlers,\n renderers: Renderers,\n ) => {\n const handler = handlers[type];\n return handler?.(\n element as HTMLTemplateElement,\n model,\n handlers,\n renderers,\n );\n };\n } else {\n // This is a named block\n if (name === 'super') {\n litTemplate.renderers['super'] = (\n model: any,\n handlers: TemplateHandlers,\n renderers: Renderers,\n ) => {\n // Instead of rendering this block, delegate to a passed in\n // 'super' renderer which will actually render the late-bound\n // super template. We pass that renderer the child blocks from\n // this block for block overrides.\n const superRenderer = renderers['super'];\n const superCallTemplate = getLitTemplate(\n element as HTMLTemplateElement,\n );\n renderers = {\n ...renderers,\n ...superCallTemplate.renderers,\n };\n return superRenderer(model, handlers, renderers);\n };\n } else {\n // The renderer renders the contents of the named block\n litTemplate.renderers[name!] = (\n model: any,\n handlers: TemplateHandlers,\n renderers: Renderers,\n ) => {\n return evaluateTemplate(\n element as HTMLTemplateElement,\n model,\n handlers,\n renderers,\n );\n };\n }\n // The updater runs when the template is evaluated and functions as\n // a template _call_. It looks for a named renderer, which might be\n // the renderer function above if the block is not overridden.\n update = (\n model: object,\n handlers: TemplateHandlers,\n renderers: Renderers,\n ) => {\n const renderer = renderers[name!];\n return renderer?.(model, handlers, renderers);\n };\n }\n litTemplate.parts.push({\n type: 2, // text binding\n index: nodeIndex,\n update,\n });\n // Template with call, type, or name attributes are removed from the\n // DOM, so they can't have attribute bindings.\n continue;\n }\n }\n const attributeNames = element.getAttributeNames();\n for (const attributeName of attributeNames) {\n const attributeValue = element.getAttribute(attributeName)!;\n // TODO: use alternative to negative lookbehind\n // (but it's so convenient!)\n const splitValue = attributeValue.split(bindingRegex);\n if (splitValue.length === 1) {\n if (hasEscapedBindingMarkers(attributeValue)) {\n element.setAttribute(\n attributeName,\n unescapeBindingMarkers(attributeValue),\n );\n }\n continue;\n }\n element.removeAttribute(attributeName);\n let name = attributeName;\n let ctor = AttributePart;\n const prefix = attributeName[0];\n if (prefix === '.') {\n name = toCamelCase(attributeName.substring(1));\n ctor = PropertyPart;\n } else if (prefix === '?') {\n name = attributeName.substring(1);\n ctor = BooleanAttributePart;\n } else if (prefix === '@') {\n name = toCamelCase(attributeName.substring(1));\n ctor = EventPart;\n }\n\n const strings = [unescapeBindingMarkers(splitValue[0])];\n const exprs: Array<Expression> = [];\n for (let i = 1; i < splitValue.length; i += 2) {\n const exprText = splitValue[i];\n exprs.push(parse(exprText, astFactory) as Expression);\n strings.push(unescapeBindingMarkers(splitValue[i + 1]));\n }\n\n litTemplate.parts.push({\n type: 1, // attribute binding\n index: nodeIndex,\n name,\n strings,\n ctor,\n update: (\n model: object,\n _handlers: TemplateHandlers,\n _renderers: Renderers,\n ) => {\n return exprs.map((expr) => expr.evaluate(model));\n },\n });\n }\n } else if (node.nodeType === Node.TEXT_NODE) {\n let textNode = node as Text;\n const text = textNode.textContent!;\n const strings = text.split(bindingRegex);\n if (strings.length > 1) {\n textNode.textContent = unescapeBindingMarkers(strings[0]);\n } else if (hasEscapedBindingMarkers(text)) {\n textNode.textContent = unescapeBindingMarkers(text);\n }\n for (let i = 1; i < strings.length; i += 2) {\n const exprText = strings[i];\n const expr = parse(exprText, astFactory) as Expression;\n litTemplate.parts.push({\n type: 2,\n index: ++nodeIndex,\n update: (model: unknown, _handlers: TemplateHandlers) =>\n expr.evaluate(model as Scope),\n });\n const newTextNode = new Text(strings[i + 1].replace('\\\\{{', '{{'));\n textNode.parentNode!.insertBefore(newTextNode, textNode.nextSibling);\n textNode.parentNode!.insertBefore(\n document.createComment(''),\n textNode.nextSibling,\n );\n textNode = newTextNode;\n // This TreeWalker isn't configured to walk comment nodes, but this\n // node will be returned next time through the loop. This is the easiest\n // way to get the walker to proceed to the next successor after the\n // marker, even when the marker doesn't have a nextSibling\n walker.currentNode = newTextNode;\n }\n }\n }\n for (const e of elementsToRemove) {\n e.remove();\n }\n return litTemplate;\n};\n","import { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { TestComponent } from './test-component.abstract';\nimport { prepareTemplate } from 'stampino';\n\n@customElement('test-paging-buttons-stamp')\nexport class TestPagingButtonsStamp extends TestComponent {\n @property({ type: Number, attribute: 'max-displayed-items' })\n private maxDisplayedItems = 2;\n\n @property({ type: String, attribute: 'skip-on-category' })\n private skipOnCategory = 'dep-informational';\n\n protected createRenderRoot() {\n return this;\n }\n\n constructor() {\n super();\n this._internals.ariaLabel = 'pagination';\n }\n\n render() {\n const items = this._testContext.items.reduce(\n (acc, item) => {\n const isDepInfoItem = item.category?.split(' ').includes(this.skipOnCategory);\n const newIndex = isDepInfoItem ? 'i' : acc.counter++;\n acc.result.push({\n ...item,\n newIndex // Assign the new index, which only increments for non-info items\n });\n return acc;\n },\n { counter: 0, result: [] }\n ).result;\n\n // Get the index of the current item\n const itemIndex = items.findIndex(item => item.identifier === this._testContext.navItemId);\n\n // Calculate the start and end range based on maxDisplayedItems\n const start = Math.max(0, itemIndex - this.maxDisplayedItems);\n const end = Math.min(items.length, itemIndex + this.maxDisplayedItems + 1);\n\n // console.log('start', start, 'end', end);\n // Adjust the items array to only include the clamped range\n const clampedItems = items.slice(start, end);\n\n return html`\n ${clampedItems.map(item => {\n const rawscore = item.variables.find(vr => vr.identifier == 'SCORE');\n const score = parseInt(rawscore?.value?.toString());\n const completionStatus = item.variables.find(v => v.identifier === 'completionStatus')?.value;\n const type = item.category !== this.skipOnCategory ? 'regular' : 'info'; // rounded-full\n const active = this._testContext.navItemId === item.identifier; // !border-sky-600\n const correct =\n this._testContext.view === 'scorer' && type == 'regular' && score !== undefined && !isNaN(score) && score > 0; // bg-green-100 border-green-400\n const incorrect =\n this._testContext.view === 'scorer' &&\n type == 'regular' &&\n score !== undefined &&\n !isNaN(score) &&\n score <= 0; // bg-red-100 border-red-400\n const answered =\n this._testContext.view === 'candidate' &&\n completionStatus === 'completed' &&\n item.category !== this.skipOnCategory; // bg-slate-300 shadow-sm\n\n const computedItem = {\n ...item,\n type,\n active,\n correct,\n incorrect,\n answered\n };\n\n const templateElement = this.firstElementChild as HTMLTemplateElement;\n const myTemplate = prepareTemplate(templateElement);\n return myTemplate({ item: computedItem });\n })}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-paging-buttons-stamp': TestPagingButtonsStamp;\n }\n}\n","import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { QtiAssessmentItem } from '../qti-components';\n\ntype Constructor<T = {}> = new (...args: any[]) => T;\n\nexport interface QtiItemInterface {\n identifier?: string;\n href?: string;\n xmlDoc: DocumentFragment;\n assessmentItem: QtiAssessmentItem | null;\n}\n\nexport function QtiItemMixin<T extends Constructor<LitElement>>(Base: T) {\n class QtiItemClass extends Base {\n @property({ type: String, reflect: true }) identifier?: string;\n @property({ type: String }) href?: string;\n\n @property({ type: Object, attribute: false })\n xmlDoc!: DocumentFragment; // the XMLDocument\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n get assessmentItem(): QtiAssessmentItem | null {\n return this.renderRoot?.querySelector('qti-assessment-item');\n }\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-item-connected', {\n bubbles: true,\n composed: true,\n detail: { identifier: this.identifier, href: this.href }\n })\n );\n }\n\n render() {\n return html`${this.xmlDoc}`;\n }\n }\n return QtiItemClass as Constructor<QtiItemInterface> & T;\n}\n","@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;\n\n:root,\n:host {\n /* Active colors */\n --qti-bg-active: #ffecec;\n --qti-border-active: #f86d70;\n\n /* Gap size */\n --qti-gap-size: 1rem;\n\n /* Background colors */\n --qti-bg: white;\n --qti-hover-bg: #f9fafb;\n\n /* Light theme colors */\n --qti-light-bg-active: #f0f0f0; /* Light gray */\n --qti-light-border-active: #d0d0d0; /* Medium gray */\n\n /* Dark theme colors */\n --qti-dark-bg-active: #1f2937; /* Dark gray */\n --qti-dark-border-active: #64748b; /* Medium gray */\n\n /* Disabled colors */\n --qti-disabled-bg: #f3f4f6;\n --qti-disabled-color: #45484f;\n\n /* Border properties */\n --qti-border-thickness: 2px;\n --qti-border-style: solid;\n --qti-border-color: #c6cad0;\n --qti-border-radius: 0.3rem;\n --qti-drop-border-radius: calc(var(--qti-border-radius) + var(--qti-border-thickness));\n\n /* Focus & active states */\n --qti-focus-border-width: 5px;\n --qti-focus-color: #bddcff7e;\n\n /* Class-specific variables */\n\n /* Form elements */\n --qti-form-size: 1rem;\n\n /* Point elements */\n --qti-point-size: 2rem;\n\n /* Order buttons */\n --qti-order-size: 2rem;\n\n /* Generic padding for all elements */\n --qti-padding-vertical: 0.5rem; /* py-2 */\n --qti-padding-horizontal: 0.5rem; /* px-2 */\n}\n\n/* SVG masks and backgrounds */\n\n.chevron {\n background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n.handle {\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n background-repeat: repeat-y;\n background-position: left center;\n background-size: 14px 8px;\n}\n\n.check-mask {\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/* \n Following are classes that can be applied to elements and element states, so they are not used directly \n The @apply directive is used to apply these classes to elements\n*/\n\n/* Apply .bordered to an element */\n\n.bordered {\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .form rules for checkbox and radiobutton */\n\n.form {\n\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .button rules for button-like elements, such as drags and buttons */\n\n.button {\n\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .select for the select dropdown element */\n\n.select {\n\n border-radius: var(--qti-border-radius);\n position: relative;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n padding-right: calc(var(--qti-padding-horizontal) + 1.5rem); /* 1.5rem for the chevron */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n/* Apply .text for the input text and textarea */\n\n.text {\n\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: unset;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .spot for hotspot shapes */\n\n.spot {\n\n width: 100%;\n height: 100%;\n background-color: transparent;\n padding: 0;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .point for circular small hotspots */\n\n.point {\n\n border-radius: 100%;\n width: var(--qti-point-size);\n height: var(--qti-point-size);\n background-color: transparent;\n padding: 0;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .drag for draggable elements */\n\n.drag {\n\n transition:\n transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem) !important; /* 1.5rem for the drag */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n ); background-repeat: repeat-y; background-position: left center; background-size: 14px 8px;\n}\n\n/* Apply .dragging for the dragging state of a draggable element */\n\n.dragging {\n pointer-events: none;\n rotate: -2deg;\n box-shadow:\n 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n}\n\n/* Apply .drop for an element where you can drop the draggable */\n\n.drop {\n\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .dropping for an indicator where you can drop the draggable */\n\n.dropping {\n background-color: var(--qti-bg-active);\n}\n\n/* Apply .order for a small circular button */\n\n.order {\n\n display: grid;\n place-content: center;\n\n /* background-color: var(--qti-bg-active); */\n border-radius: 100%;\n width: var(--qti-order-size);\n height: var(--qti-order-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-size for radio and checkbox size */\n\n.check-size {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n}\n\n/* Apply .check for checkbox */\n\n.check {\n gap: 0.5rem;\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n outline: none;\n cursor: pointer;\n}\n\n/* Apply .check-radio for outer circle of the radio buttons */\n\n.check-radio {\n\n border-radius: 100%;\n\n display: grid;\n\n place-content: center;\n\n width: var(--qti-form-size);\n\n height: var(--qti-form-size);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n}\n\n/* Apply .check-radio-checked for the inner checked radio */\n\n.check-radio-checked {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n}\n\n/* Apply .check-checkbox for outer square of the checkbox */\n\n.check-checkbox {\n\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-checkbox-checked for the inner checkmark */\n\n.check-checkbox-checked {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/* Apply .hov for hover state */\n\n.hov {\n background-color: var(--qti-hover-bg);\n}\n\n/* Apply .foc for focus state */\n\n.foc {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n}\n\n/* Apply .act for active state */\n\n.act {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n}\n\n.act-bg {\n background-color: var(--qti-bg-active);\n}\n\n.act-bor {\n border-color: var(--qti-border-active);\n}\n\n/* Apply .rdo for readonly state */\n\n.rdo {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n}\n\n/* Apply .dis for disabled state */\n\n.dis {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n}\n\n/* base */\n\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flexbox;\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n\n/* stylelint-disable number-max-precision */\n\n@layer qti-base {\n .qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n }\n\n .qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n }\n\n .qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there’s padding or borders */\n }\n\n .qti-layout-col1 {\n width: 6.3829787234%;\n }\n\n .qti-layout-col2 {\n width: 14.8936170213%;\n }\n\n .qti-layout-col3 {\n width: 23.4042553191%;\n }\n\n .qti-layout-col4 {\n width: 31.914893617%;\n }\n\n .qti-layout-col5 {\n width: 40.4255319149%;\n }\n\n .qti-layout-col6 {\n width: 48.9361702128%;\n }\n\n .qti-layout-col7 {\n width: 57.4468085106%;\n }\n\n .qti-layout-col8 {\n width: 65.9574468085%;\n }\n\n .qti-layout-col9 {\n width: 74.4680851064%;\n }\n\n .qti-layout-col10 {\n width: 82.9787234043%;\n }\n\n .qti-layout-col11 {\n width: 91.4893617021%;\n }\n\n .qti-layout-col12 {\n width: 100%;\n }\n\n .qti-layout-offset1 {\n margin-left: 8.5106382979%;\n }\n\n .qti-layout-offset2 {\n margin-left: 17.0212765957%;\n }\n\n .qti-layout-offset3 {\n margin-left: 25.5319148936%;\n }\n\n .qti-layout-offset4 {\n margin-left: 34.0425531915%;\n }\n\n .qti-layout-offset5 {\n margin-left: 42.5531914894%;\n }\n\n .qti-layout-offset6 {\n margin-left: 51.0638297872%;\n }\n\n .qti-layout-offset7 {\n margin-left: 59.5744680851%;\n }\n\n .qti-layout-offset8 {\n margin-left: 68.085106383%;\n }\n\n .qti-layout-offset9 {\n margin-left: 76.5957446809%;\n }\n\n .qti-layout-offset10 {\n margin-left: 85.1063829787%;\n }\n\n .qti-layout-offset11 {\n margin-left: 93.6170212766%;\n }\n\n .qti-layout-offset12 {\n margin-left: 102.1276595745%;\n }\n\n @media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n }\n}\n\n[view],\nqti-outcome-declaration,\nqti-response-declaration {\n display: none;\n}\n\n[view].show {\n display: block;\n}\n\n:host {\n box-sizing: border-box;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n/* components */\n\n@layer qti-components {\n qti-choice-interaction {\n &.qti-input-control-hidden {\n & qti-simple-choice {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n &:not(.qti-input-control-hidden) {\n & qti-simple-choice {\n\n &:not([aria-disabled='true'], [aria-readonly='true'], :state(--checked)):hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n\n gap: 0.5rem;\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n outline: none;\n\n cursor: pointer\n }\n }\n\n & qti-simple-choice {\n width: -moz-fit-content;\n width: fit-content;\n cursor: pointer;\n\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: #16a34a; /* text-green-600 */\n }\n }\n }\n\n & qti-simple-choice > p {\n margin: 0 !important;\n padding: 0 !important;\n }\n }\n\n .hover-border {\n border: 2px solid #000; /* Adjust the border style and color as needed */\n }\n\n qti-graphic-gap-match-interaction {\n position: relative;\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-gap-img,\n qti-gap-text {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: grab;\n }\n\n & qti-associable-hotspot {\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid transparent;\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light & {\n background-color: var(--qti-light-bg-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n background-color: var(--qti-dark-bg-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &[active] {\n\n /* Light theme override */\n .qti-selections-light & {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n\n &[disabled] {\n\n &:not(:empty) {\n cursor: default !important;\n }\n\n cursor: not-allowed;\n\n background-color: var(--qti-disabled-bg);\n\n color: var(--qti-disabled-color);\n\n border-color: var(--qti-border-color);\n\n outline: 4px solid var(--qti-disabled-bg)\n }\n\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */\n content: '\\0000a0'; /* when empty, put a space in it */\n }\n\n &:not(:empty) {\n padding: 0;\n width: auto;\n }\n\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0); /* rotate-0 */\n box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */\n }\n }\n\n & img {\n margin: 0;\n padding: 0;\n }\n }\n\n qti-text-entry-interaction {\n &::part(input) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: unset;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus-within {\n &::part(input) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n\n qti-extended-text-interaction {\n &::part(textarea) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: unset;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus-within {\n &::part(textarea) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n\n qti-gap-match-interaction {\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-gap-text {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px\n }\n\n & qti-gap {\n\n &[disabled] {\n\n &:not(:empty) {\n cursor: default !important;\n }\n\n cursor: not-allowed;\n\n background-color: var(--qti-disabled-bg);\n\n color: var(--qti-disabled-color);\n\n border-color: var(--qti-border-color);\n\n outline: 4px solid var(--qti-disabled-bg)\n }\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light & {\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &[active] {\n\n /* Light theme override */\n .qti-selections-light & {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n\n display: inline-flex;\n align-items: center;\n\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */\n content: '\\0000a0'; /* when empty, put a space in it */\n }\n\n &:not(:empty) {\n display: inline-flex;\n padding: 0;\n width: auto;\n }\n\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0); /* rotate-0 */\n box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */\n }\n\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n\n border-radius: var(--qti-border-radius);\n\n position: relative;\n\n background-color: var(--qti-bg);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n qti-hotspot-interaction {\n & qti-hotspot-choice {\n &[shape='circle'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n\n &:state(--readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(--disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='rect'] {\n\n /* &:hover {\n @apply hov;\n } */\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='poly'] {\n &:hover::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n var(--qti-border-active),\n var(--qti-border-active) 5px,\n transparent 5px,\n transparent 10px\n );\n display: block;\n }\n\n &:state(--checked)::after,\n &[aria-checked='true']::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 5px,\n var(--qti-border-active) 5px,\n var(--qti-border-active) 10px\n );\n display: block;\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n\n qti-hottext-interaction {\n /* &:not(.qti-input-control-hidden),\n &:not(.qti-unselected-hidden) { */\n qti-hottext {\n display: inline-flex;\n align-items: center;\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n\n gap: 0.5rem;\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n outline: none;\n\n cursor: pointer\n }\n\n /* } */\n\n &.qti-input-control-hidden {\n qti-hottext {\n /* --qti-padding-md: 0.1rem;\n --qti-padding-lg: 0.2rem;\n --qti-border-radius-md: 0.3rem;\n --qti-border-thickness: 1px;\n --qti-font-weight-semibold: 400; */\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n /* @layer qti-variants { */\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n /* } */\n }\n\n &.qti-unselected-hidden {\n qti-hottext {\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n cursor: pointer;\n\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked) {\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n\n qti-inline-choice-interaction {\n &::part(select) {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n border-radius: var(--qti-border-radius);\n\n position: relative;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n padding-right: calc(var(--qti-padding-horizontal) + 1.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px\n }\n }\n\n qti-match-interaction:not(.qti-match-tabular) {\n &:state(--dragzone-enabled) qti-simple-match-set:first-of-type {\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-active) qti-simple-match-set:first-of-type {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n /* The draggables */\n & qti-simple-match-set:first-of-type {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start; /* Prevents children from stretching */\n gap: var(--qti-gap-size);\n border: 2px solid transparent;\n\n & qti-simple-associable-choice {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px\n }\n }\n\n /* The droppables */\n & qti-simple-match-set:last-of-type {\n display: grid;\n grid-auto-columns: 1fr; /* auto-cols-fr */\n grid-auto-flow: column; /* grid-flow-col */\n gap: var(--qti-gap-size); /* gap-2 */\n width: 100%; /* w-full */\n\n & qti-simple-associable-choice {\n display: flex;\n flex-direction: column;\n }\n\n & > qti-simple-associable-choice {\n /* a droppable qti-simple-associable-choice */\n box-sizing: border-box;\n display: grid;\n grid-row: 2 / 4;\n grid-template-rows: subgrid;\n\n & img {\n max-width: 100%;\n height: auto;\n }\n\n &[enabled] {\n &::part(dropslot) {\n background-color: var(--qti-bg-active);\n }\n }\n\n &[disabled] {\n &::part(dropslot) {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n\n &[active] {\n &::part(dropslot) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n }\n\n &::part(dropslot) {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n min-height: 6rem;\n gap: var(--qti-gap-size);\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n & > *:not(qti-simple-associable-choice) {\n pointer-events: none;\n }\n\n & > qti-simple-associable-choice {\n\n &::part(dropslot) {\n display: none;\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n flex-basis: fit-content;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px;\n }\n }\n }\n }\n\n qti-order-interaction:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n qti-order-interaction:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n qti-order-interaction {\n &::part(qti-simple-choice),\n & qti-simple-choice {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px\n }\n\n &::part(qti-simple-choice) {\n display: flex;\n overflow: hidden;\n align-items: center;\n width: 100%;\n text-overflow: ellipsis;\n }\n\n &::part(drops) {\n gap: 0.5rem; /* gap-2 */\n }\n\n &::part(drags) {\n gap: 0.5rem; /* gap-2 */\n }\n\n &::part(drop-list) {\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light & {\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark & {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n display: flex;\n min-height: 4rem;\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &::part(active) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n & drop-list {\n &[shape='circle'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='square'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n }\n\n qti-associate-interaction {\n /* General styles for active and enabled states */\n &:state(--dragzone-active) slot[name='qti-simple-associable-choice'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled) slot[name='qti-simple-associable-choice'] {\n background-color: var(--qti-bg-active);\n }\n\n & qti-simple-associable-choice, /* drags when in lightdom */\n &::part(qti-simple-associable-choice) /* drags when in shadowdom */ {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n\n background-repeat: repeat-y;\n\n background-position: left center;\n\n background-size: 14px 8px\n }\n\n /* display: flex;\n overflow: hidden;\n align-items: center; */\n\n /* &::part(drop-container) {\n display: flex;\n flex-direction: column;\n gap: var(--qti-gap-size);\n } */\n\n &::part(drop-list) {\n\n display: grid;\n height: 3rem;\n min-width: 10rem;\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &::part(drop-list):focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(drop-list)[dragging] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n /* &::part(drop-list) {\n @apply act;\n } */\n }\n\n qti-graphic-order-interaction {\n & qti-hotspot-choice {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &[aria-ordervalue] {\n display: grid;\n place-content: center;\n }\n\n &[aria-ordervalue]::after {\n content: attr(aria-ordervalue) !important;\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-graphic-associate-interaction {\n position: relative;\n display: block;\n\n & qti-associable-hotspot {\n &[shape='circle'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='square'] {\n\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-slider-interaction {\n display: block;\n\n --qti-tick-color: rgb(229 231 235 / 100%);\n --qti-tick-width: 1px;\n\n &::part(slider) {\n margin-left: 2rem; /* mx-8 */\n margin-right: 2rem;\n padding-bottom: 1rem; /* pb-4 */\n padding-top: 1.25rem; /* pt-5 */\n }\n\n --show-bounds: true;\n\n &::part(bounds) {\n display: flex;\n width: 100%;\n justify-content: space-between;\n margin-bottom: 0.5rem; /* mb-2 */\n }\n\n --show-ticks: true;\n\n &::part(ticks) {\n margin-left: 0.125rem; /* mx-0.5 */\n margin-right: 0.125rem;\n margin-bottom: 0.25rem; /* mb-1 */\n height: 0.5rem; /* h-2 */\n background: linear-gradient(to right, var(--qti-tick-color) var(--qti-tick-width), transparent 1px) repeat-x 0\n center / calc(calc(100% - var(--qti-tick-width)) / ((var(--max) - var(--min)) / var(--step))) 100%;\n }\n\n &::part(rail) {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 0.375rem; /* h-1.5 */\n width: 100%;\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n border: 1px solid #d1d5db; /* border-gray-300 */\n background-color: #e5e7eb; /* bg-gray-200 */\n }\n\n &::part(knob) {\n background-color: var(--qti-primary);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage);\n }\n\n --show-value: true;\n\n &::part(value) {\n position: absolute;\n bottom: 2rem; /* bottom-8 */\n left: 0.5rem; /* left-2 */\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 0.25rem; /* rounded */\n background-color: #f3f4f6; /* bg-gray-100 */\n padding: 0.25rem 0.5rem; /* px-2 py-1 */\n text-align: center;\n color: #6b7280; /* text-gray-500 */\n }\n }\n\n qti-select-point-interaction {\n &::part(point) {\n &:hover {\n background-color: var(--qti-hover-bg);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n border-radius: 100%;\n\n width: var(--qti-point-size);\n\n height: var(--qti-point-size);\n\n background-color: transparent;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n }\n }\n\n qti-position-object-stage {\n & qti-position-object-interaction {\n /* no styles necessary, only layout styles, defined in the component */\n }\n }\n\n qti-prompt {\n margin: 0.5rem 0; /* my-2 */\n display: block;\n width: 100%;\n }\n}\n","import { LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { QtiItemMixin } from './qti-item.mixin';\nimport itemCss from '../../item.css?inline';\n\n@customElement('qti-item')\nexport class QtiItem extends QtiItemMixin(LitElement) {\n connectedCallback() {\n super.connectedCallback();\n // Dynamically create and apply styles\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}\n","import { createContext } from '@lit/context';\nimport { VariableDeclaration } from '../internal/variables';\n\nexport interface ItemContext {\n href?: string;\n identifier: string;\n variables: ReadonlyArray<VariableDeclaration<string | string[]>>;\n}\n\nexport const itemContextVariables = [\n {\n identifier: 'completionStatus',\n cardinality: 'single',\n baseType: 'string',\n value: 'unknown',\n type: 'outcome'\n },\n {\n identifier: 'numAttempts',\n cardinality: 'single',\n baseType: 'integer',\n value: '0',\n type: 'response'\n }\n] as VariableDeclaration<string | string[]>[];\n\nexport const itemContext = createContext<ItemContext>(Symbol('item'));\n","import { provide } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { watch } from '../../decorators/watch';\nimport type { InteractionChangedDetails, OutcomeChangedDetails } from '../internal/event-types';\nimport type { ResponseInteraction } from '../internal/expression-result';\nimport type { VariableDeclaration, VariableValue } from '../internal/variables';\nimport { OutcomeVariable, ResponseVariable } from '../internal/variables';\nimport type { QtiFeedback } from '../qti-feedback/qti-feedback';\nimport type { Interaction } from '../qti-interaction/internal/interaction/interaction';\nimport type { QtiResponseProcessing } from '../qti-response-processing';\nimport { ItemContext, itemContext, itemContextVariables } from './qti-assessment-item.context';\nimport QtiRegisterVariable from '../internal/events/qti-register-variable';\n\n/**\n * @summary The qti-assessment-item element contains all the other QTI 3 item structures.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj\n * @status stable\n * @since 4.0\n *\n * @dependency qti-feedback\n * @dependency qti-responseprocessing\n *\n * @slot - The default slot where all the other QTI 3 item structures go.\n *\n * @event qti-interaction-changed - Emitted when an interaction is changed.\n * @event qti-outcome-changed - Emitted when an outcome has changed.\n * @event qti-response-processing - Emitted when response-processing is called.\n *\n */\n@customElement('qti-assessment-item')\nexport class QtiAssessmentItem extends LitElement {\n @property({ type: String }) title: string;\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) adaptive: 'true' | 'false' = 'false';\n @property({ type: String }) timeDependent: 'true' | 'false' | null = null;\n\n @property({ type: Boolean }) disabled: boolean;\n @watch('disabled', { waitUntilFirstUpdate: true })\n _handleDisabledChange = (_: boolean, disabled: boolean) => {\n this._interactionElements.forEach(ch => (ch.disabled = disabled));\n };\n\n @property({ type: Boolean }) readonly: boolean;\n @watch('readonly', { waitUntilFirstUpdate: true })\n _handleReadonlyChange = (_: boolean, readonly: boolean) =>\n this._interactionElements.forEach(ch => (ch.readonly = readonly));\n\n @provide({ context: itemContext })\n private _context: ItemContext = {\n identifier: this.getAttribute('identifier'),\n variables: itemContextVariables\n };\n\n public get variables(): VariableValue<string | string[] | null>[] {\n return this._context.variables.map(v => ({\n identifier: v.identifier,\n value: v.value,\n type: v.type,\n // add externalscored, a fixed prop to the test, so the testcontext can read and decide how to score this item\n ...(v.type === 'outcome' && v.identifier === 'SCORE'\n ? { externalScored: (v as OutcomeVariable).externalScored }\n : {})\n }));\n }\n\n public set variables(value: VariableValue<string | string[] | null>[]) {\n if (!Array.isArray(value) || value.some(v => !('identifier' in v))) {\n console.warn('variables property should be an array of VariableDeclaration');\n return;\n }\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n const matchingValue = value.find(v => v.identifier === variable.identifier);\n if (matchingValue) {\n return { ...variable, ...matchingValue };\n }\n return variable;\n })\n };\n\n this._context.variables.forEach(variable => {\n if (variable.type === 'response') {\n const interactionElement = this._interactionElements.find(\n (el: Interaction) => el.responseIdentifier === variable.identifier\n );\n if (interactionElement) {\n interactionElement.value = variable.value as string | string[];\n }\n }\n\n if (variable.type === 'outcome') {\n this._feedbackElements.forEach(fe => fe.checkShowFeedback(variable.identifier));\n }\n });\n }\n\n private _initialContext: Readonly<ItemContext> = { ...this._context, variables: this._context.variables };\n private _feedbackElements: QtiFeedback[] = [];\n private _interactionElements: Interaction[] = [];\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this._emit<{ detail: QtiAssessmentItem }>('qti-assessment-item-connected', this);\n }\n\n /** @deprecated use variables property instead */\n set responses(myResponses: ResponseInteraction[]) {\n if (myResponses) {\n for (const response of myResponses) {\n const responseVariable = this.getResponse(response.responseIdentifier);\n if (responseVariable) {\n this.updateResponseVariable(response.responseIdentifier, response.response);\n }\n\n const interaction: Interaction | undefined = this._interactionElements.find(\n i => i.getAttribute('response-identifier') === response.responseIdentifier\n );\n if (interaction) {\n interaction.value = response.response;\n }\n }\n }\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n\n constructor() {\n super();\n this.addEventListener('qti-register-variable', (e: QtiRegisterVariable) => {\n this._context = { ...this._context, variables: [...this._context.variables, e.detail.variable] };\n this._initialContext = this._context;\n e.stopPropagation();\n });\n this.addEventListener('qti-register-feedback', (e: CustomEvent<QtiFeedback>) => {\n e.stopPropagation();\n const feedbackElement = e.detail;\n this._feedbackElements.push(feedbackElement);\n feedbackElement.checkShowFeedback(feedbackElement.outcomeIdentifier);\n });\n this.addEventListener('qti-register-interaction', (e: CustomEvent<null>) => {\n e.stopPropagation();\n this._interactionElements.push(e.target as Interaction);\n });\n this.addEventListener('end-attempt', (e: CustomEvent<{ responseIdentifier: string; countAttempt: boolean }>) => {\n const { responseIdentifier, countAttempt } = e.detail;\n this.validate();\n this.updateResponseVariable(responseIdentifier, 'true');\n this.processResponse(countAttempt);\n });\n\n this.addEventListener(\n // wordt aangeroepen vanuit de processingtemplate\n 'qti-set-outcome-value',\n (e: CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>) => {\n const { outcomeIdentifier, value } = e.detail;\n this.updateOutcomeVariable(outcomeIdentifier, value);\n e.stopPropagation();\n }\n );\n\n this.addEventListener('qti-interaction-response', this.handleUpdateResponseVariable);\n }\n\n public showCorrectResponse(show: boolean) {\n const responseVariables = this._context.variables.filter(\n (vari: ResponseVariable | OutcomeVariable) => 'correctResponse' in vari && vari.correctResponse\n ) as ResponseVariable[];\n const responses = responseVariables.map(cr => {\n return {\n responseIdentifier: cr.identifier,\n response: cr.correctResponse\n };\n });\n for (const response of responses) {\n const interaction: Interaction | undefined = this._interactionElements.find(\n i => i.getAttribute('response-identifier') === response.responseIdentifier\n );\n if (interaction) {\n interaction.correctResponse = show ? response.response : '';\n }\n }\n }\n\n public processResponse(countNumAttempts: boolean = true): boolean {\n this.validate();\n const responseProcessor = this.querySelector<QtiResponseProcessing>('qti-response-processing');\n if (!responseProcessor) {\n // console.info('Client side response processing template not available');\n return false;\n }\n\n if (!responseProcessor.process) {\n // console.info('Client side response webcomponents not available');\n return false;\n }\n\n responseProcessor.process();\n\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this._getCompletionStatus());\n }\n\n if (countNumAttempts) {\n this.updateOutcomeVariable(\n 'numAttempts',\n (+this._context.variables.find(v => v.identifier === 'numAttempts')?.value + 1).toString()\n );\n }\n\n this._emit('qti-response-processed');\n return true;\n }\n\n public resetResponses() {\n this._context = this._initialContext;\n }\n\n public getResponse(identifier: string): Readonly<ResponseVariable> {\n return this.getVariable(identifier) as ResponseVariable;\n }\n\n public getOutcome(identifier: string): Readonly<OutcomeVariable> {\n return this.getVariable(identifier) as OutcomeVariable;\n }\n\n public getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>> {\n return this._context.variables.find(v => v.identifier === identifier) || null;\n }\n\n // saving privates here: ------------------------------------------------------------------------------\n\n private handleUpdateResponseVariable(event: CustomEvent<ResponseInteraction>) {\n const { responseIdentifier, response } = event.detail;\n this.updateResponseVariable(responseIdentifier, response);\n }\n\n public updateResponseVariable(identifier: string, value: string | string[] | undefined) {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => (v.identifier !== identifier ? v : { ...v, value: value }))\n };\n\n this._emit<InteractionChangedDetails>('qti-interaction-changed', {\n item: this.identifier,\n responseIdentifier: identifier,\n response: Array.isArray(value) ? [...value] : value\n });\n\n if (this.adaptive === 'false') {\n // if adapative, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this._getCompletionStatus());\n }\n }\n\n public updateOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n const outcomeVariable = this.getOutcome(identifier);\n\n if (!outcomeVariable) {\n console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);\n return;\n }\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => {\n if (v.identifier !== identifier) {\n return v;\n }\n return {\n ...v,\n value: outcomeVariable.cardinality === 'single' ? value : [...v.value, value as string]\n };\n })\n };\n this._feedbackElements.forEach(fe => fe.checkShowFeedback(identifier));\n\n this._emit<OutcomeChangedDetails>('qti-outcome-changed', {\n item: this.identifier,\n outcomeIdentifier: identifier,\n value: this._context.variables.find(v => v.identifier === identifier)?.value\n });\n }\n\n public validate(): boolean | null {\n if (this._interactionElements.every(interactionElement => interactionElement.validate())) return true;\n if (this._interactionElements.some(interactionElement => interactionElement.validate())) return false;\n return null;\n }\n\n private _getCompletionStatus(): 'completed' | 'incomplete' | 'not_attempted' | 'unknown' {\n const valid = this.validate();\n if (valid === true) return 'completed';\n if (valid === false) return 'incomplete';\n return 'not_attempted';\n }\n\n private _emit<T>(name, detail = null) {\n this.dispatchEvent(\n new CustomEvent<T>(name, {\n bubbles: true,\n composed: true,\n detail\n })\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item': QtiAssessmentItem;\n }\n}\n","import { LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { qtiTransformItem } from '../../qti-transformers';\n\n/**\n * Represents a custom element for referencing an assessment stimulus.\n */\n@customElement('qti-assessment-stimulus-ref')\nexport class QtiAssessmentStimulusRef extends LitElement {\n /**\n * The identifier of the stimulus.\n */\n @property({ type: String }) identifier = '';\n\n /**\n * The href of the stimulus.\n */\n @property({ type: String }) href = '';\n\n /**\n * Lifecycle method called when the element is connected to the DOM.\n * Loads and appends the stimulus if the 'qti-assessment-stimulus-ref-connected' event is not prevented.\n */\n public async connectedCallback(): Promise<void> {\n super.connectedCallback();\n\n const event = new Event('qti-assessment-stimulus-ref-connected', { cancelable: true, bubbles: true });\n const isPrevented = this.dispatchEvent(event);\n\n if (isPrevented) {\n const item = this.closest('qti-assessment-item');\n\n const stimulusRef = item.querySelector(`[data-stimulus-idref=${this.identifier}]`);\n if (stimulusRef) {\n await this.updateStimulusRef(stimulusRef);\n } else {\n console.warn(`Stimulus with data-stimulus-idref ${this.identifier} not found`);\n }\n }\n }\n\n /**\n * Loads and appends the stimulus to the specified element.\n * @param stimulusRef - The element to which the stimulus will be appended.\n */\n public async updateStimulusRef(stimulusRef: Element) {\n const stimulus = await qtiTransformItem()\n .load(this.href)\n .then(api => api.htmlDoc());\n if (stimulus) {\n const elements = stimulus.querySelectorAll('qti-stimulus-body, qti-stylesheet');\n stimulusRef.innerHTML = '';\n stimulusRef.append(...elements);\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-stimulus-ref': QtiAssessmentStimulusRef;\n }\n}\n","import { ComplexAttributeConverter, LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { watch } from '../../../../decorators/watch';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\nexport interface ChoiceInterface {\n identifier: string;\n disabled: boolean;\n readonly: boolean;\n}\n\n/**\n * Converter to handle boolean attributes for ARIA properties,\n * ensuring they are set as 'true' or 'false' strings.\n */\nconst ariaBooleanConverter: ComplexAttributeConverter<boolean, boolean> = {\n toAttribute: (value: boolean) => (value ? 'true' : 'false'),\n fromAttribute: (value: string | null) => value === 'true'\n};\n\n/**\n * A mixin that adds choice functionality to a LitElement-based class.\n * It dispatches events with a custom `type` and handles selection logic.\n *\n * @param Base - The base class to extend.\n * @param type - The type of the choice, used in event names.\n * @returns A new class extending the base class with choice functionality.\n */\nexport interface ActiveElementMixinInterface {\n identifier: string;\n tabIndex: number;\n disabled: boolean;\n readonly: boolean;\n internals: ElementInternals;\n}\n\n\nexport function ActiveElementMixin<T extends Constructor<LitElement>>(Base: T, type: string) {\n abstract class QtiChoice extends Base {\n @property({ type: String })\n public identifier = '';\n\n @property({ type: Number, reflect: true, attribute: 'tabindex' })\n public tabIndex = 0;\n\n @property({\n type: Boolean,\n reflect: true,\n attribute: 'aria-disabled',\n converter: ariaBooleanConverter\n })\n public disabled = false;\n\n @property({\n type: Boolean,\n reflect: true,\n attribute: 'aria-readonly',\n converter: ariaBooleanConverter\n })\n public readonly = false;\n\n public internals: ElementInternals;\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange(_oldValue: boolean, disabled: boolean) {\n this.tabIndex = disabled ? -1 : 0;\n if (disabled) {\n this.blur();\n }\n }\n\n constructor(...args: any[]) {\n super(...args);\n this.internals = this.attachInternals();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('keyup', this._onKeyUp);\n this.addEventListener('click', this._onClick);\n\n this.dispatchEvent(\n new CustomEvent(`register-${type}`, {\n bubbles: true,\n composed: true\n })\n );\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('keyup', this._onKeyUp);\n this.removeEventListener('click', this._onClick);\n this.dispatchEvent(\n new CustomEvent(`unregister-${type}`, {\n bubbles: true,\n composed: true\n })\n );\n }\n\n private _onKeyUp(event: KeyboardEvent) {\n if (event.altKey) return;\n\n if (event.code === 'Space') {\n event.preventDefault();\n this._activate();\n }\n }\n\n private _onClick() {\n if (this.disabled || this.readonly) return;\n this.focus();\n this._activate();\n }\n\n private _activate() {\n if (this.disabled || this.readonly) return;\n\n this.dispatchEvent(\n new CustomEvent<{ identifier: string }>(`activate-${type}`, {\n bubbles: true,\n composed: true,\n detail: { identifier: this.identifier }\n })\n );\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n }\n return QtiChoice as Constructor<ActiveElementMixinInterface> & T;\n}\n","import { css } from 'lit';\n\nexport default css`\n :host {\n display: block;\n }\n`;\n","import { customElement } from 'lit/decorators.js';\nimport { html, LitElement } from 'lit';\nimport styles from './qti-item-body.styles';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary The qti-item-body node contains the text, graphics, media objects and interactions that describe the item's content and information about how it is structured.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi\n * @status stable\n * @since 4.0\n *\n * @slot - item body content.\n * @slot qti-rubric-block - the qti rubric block is placed above the item\n *\n */\n@customElement('qti-item-body')\nexport class QtiItemBody extends LitElement {\n static styles: CSSResultGroup = styles;\n\n override render() {\n return html`<slot name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item-body': QtiItemBody;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n@customElement('qti-prompt')\nexport class QtiPrompt extends LitElement {\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n // if prompts are in interactions they should have a slot, so the prompt has to go there\n // if prompt is in the body, then just display the prompt there.\n // A better check would be the latter, but not can't get through the shadowroot to find the slot\n const inInteraction = this.parentElement.tagName.endsWith('INTERACTION');\n if (inInteraction) {\n this.setAttribute('slot', 'prompt');\n }\n // const promptSlot = this.parentElement.shadowRoot.querySelector(\"[name='prompt']\");\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-prompt': QtiPrompt;\n }\n}\n","import { LitElement, PropertyValueMap } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('qti-stylesheet')\nexport class QtiStylesheet extends LitElement {\n private styleElement: HTMLStyleElement | null = null;\n\n protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n super.firstUpdated(_changedProperties);\n\n const link = this.getAttribute('href');\n\n if (link !== null) {\n // Fetch the stylesheet content\n fetch(link)\n .then(response => response.text())\n .then(cssContent => {\n // Minify the CSS content by removing whitespace and comments\n const minifiedCss = this.minifyCss(cssContent);\n\n // Create a <style> element with @scope surrounding the minified CSS\n this.styleElement = document.createElement('style');\n this.styleElement.media = 'screen';\n this.styleElement.textContent = `@scope {${minifiedCss}}`;\n\n // Append the style element to the parent element of this component\n if (this.parentElement) {\n this.parentElement.appendChild(this.styleElement);\n } else {\n console.warn('No parent element to append the scoped stylesheet to.');\n }\n })\n .catch(error => {\n console.error('Failed to load stylesheet:', error);\n });\n }\n\n if (this.textContent !== null && this.textContent.trim() !== '') {\n // Minify the inline CSS content\n const minifiedCss = this.minifyCss(this.textContent);\n\n // Directly create a <style> element with the @scope surrounding the minified inline styles\n this.styleElement = document.createElement('style');\n this.styleElement.media = 'screen';\n this.styleElement.textContent = `@scope {${minifiedCss}}`;\n\n // Append the style element to the parent element of this component\n if (this.parentElement) {\n this.parentElement.appendChild(this.styleElement);\n } else {\n console.warn('No parent element to append the scoped stylesheet to.');\n }\n }\n }\n\n private minifyCss(cssContent: string): string {\n // Remove comments, whitespace, and newline characters\n return cssContent\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '') // Remove comments\n .replace(/\\s+/g, ' ') // Collapse whitespace\n .replace(/\\s*([{}:;])\\s*/g, '$1') // Remove spaces around {}, :, ;\n .trim(); // Trim leading/trailing whitespace\n }\n\n override disconnectedCallback() {\n if (this.styleElement) {\n try {\n this.styleElement.remove();\n } catch (error) {\n console.error('Could not remove stylesheet:', error);\n }\n }\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-stylesheet': QtiStylesheet;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { VariableDeclaration } from '../internal/variables';\n\n@customElement('qti-variabledeclaration')\nexport class QtiVariableDeclaration extends LitElement {\n override render() {\n return html`<slot></slot>`;\n }\n\n protected defaultValues(variable: VariableDeclaration<string | string[] | null>) {\n const htmlValues = Array.from(this.querySelectorAll('qti-default-value > qti-value'));\n\n if (htmlValues.length === 0) {\n return null;\n }\n\n const defaultValues = htmlValues.map(n => n.innerHTML.trim());\n if (defaultValues.length > 1 || variable.cardinality === 'multiple' || variable.cardinality === 'ordered') {\n return defaultValues;\n }\n return defaultValues[0];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-variabledeclaration': QtiVariableDeclaration;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { BaseType, Cardinality } from '../../internal/expression-result';\nimport { OutcomeVariable } from '../../internal/variables';\nimport { ItemContext, itemContext } from '../../qti-assessment-item/qti-assessment-item.context';\nimport { QtiVariableDeclaration } from '../qti-variable-declaration';\n\n@customElement('qti-outcome-declaration')\nexport class QtiOutcomeDeclaration extends QtiVariableDeclaration {\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType;\n @property({ type: String, attribute: 'external-scored' }) externalScored: 'human' | 'externalMachine' | null = null;\n @property({ type: String }) identifier: string;\n @property({ type: String }) cardinality: Cardinality;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n public itemContext?: ItemContext;\n\n static styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n const value = this.itemContext?.variables.find(v => v.identifier === this.identifier)?.value;\n return html`${JSON.stringify(value, null, 2)}`;\n }\n\n get interpolationTable(): Map<number, number> | null {\n const table = this.querySelector('qti-interpolation-table');\n if (table) {\n const entries = new Map<number, number>();\n for (const entry of table.querySelectorAll('qti-interpolation-table-entry')) {\n if (!entry.getAttribute('source-value') && entry.getAttribute('target-value')) {\n console.error('source-value or target-value is missing in qti-interpolation-table-entry');\n }\n const sourceValue = parseInt(entry.getAttribute('source-value'));\n const targetValue = parseInt(entry.getAttribute('target-value'));\n if (isNaN(sourceValue) || isNaN(targetValue)) {\n console.error('source-value or target-value is not a number in qti-interpolation-table-entry');\n }\n entries.set(sourceValue, targetValue);\n }\n return entries;\n }\n return null;\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n const outcomeVariable: OutcomeVariable = {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n type: 'outcome',\n value: null,\n interpolationTable: this.interpolationTable,\n externalScored: this.externalScored\n };\n outcomeVariable.value = this.defaultValues(outcomeVariable);\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable: outcomeVariable }\n })\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-outcome-declaration': QtiOutcomeDeclaration;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { BaseType, Cardinality } from '../../internal/expression-result';\nimport { ResponseVariable } from '../../internal/variables';\nimport { ItemContext, itemContext } from '../../qti-assessment-item/qti-assessment-item.context';\nimport { QtiMapping } from '../../qti-response-processing/qti-expression/qti-mapping/qti-mapping';\nimport { QtiVariableDeclaration } from '../qti-variable-declaration';\n\n@customElement('qti-response-declaration')\nexport class QtiResponseDeclaration extends QtiVariableDeclaration {\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType;\n\n @property({ type: String }) identifier: string;\n\n @property({ type: String }) cardinality: Cardinality;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n public itemContext?: ItemContext;\n\n static styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n const value = this.itemContext?.variables.find(v => v.identifier === this.identifier)?.value;\n return html`${JSON.stringify(value, null, 2)}`;\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n\n const responseVariable: ResponseVariable = {\n baseType: this.baseType,\n identifier: this.identifier,\n correctResponse: this.correctResponse,\n cardinality: this.cardinality || 'single',\n mapping: this.mapping,\n value: null,\n type: 'response',\n candidateResponse: null\n };\n responseVariable.value = this.defaultValues(responseVariable);\n\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable: responseVariable }\n })\n );\n }\n\n private get correctResponse(): string | string[] {\n let result: string | string[];\n const correctResponse = this.querySelector('qti-correct-response');\n if (correctResponse) {\n const values = correctResponse.querySelectorAll('qti-value');\n if (this.cardinality === 'single' && values.length > 0) {\n result = values[0].textContent;\n values[0].remove();\n } else if (this.cardinality !== 'single') {\n result = [];\n for (let i = 0; i < values.length; i++) {\n result.push(values[i].textContent);\n values[i].remove();\n }\n }\n }\n return result;\n }\n\n private get mapping() {\n return this.querySelector('qti-mapping') as QtiMapping;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-response-declaration': QtiResponseDeclaration;\n }\n}\n","import { LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('qti-companion-materials-info')\nexport class QtiCompanionMaterialsInfo extends LitElement {\n // static override styles = css`\n // slot {\n // display: hidden;\n // }\n // `;\n // override render() {\n // return html` <slot></slot> `;\n // }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-companion-materials-info': QtiCompanionMaterialsInfo;\n }\n}\n","import { LitElement, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('qti-content-body')\nexport class QtiContentBody extends LitElement {\n override render() {\n return html`<slot></slot>`;\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-content-body': QtiContentBody;\n }\n}\n","import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { watch } from '../../decorators/watch';\n\n@customElement('qti-rubric-block')\nexport class QtiRubricBlock extends LitElement {\n @property({ type: String }) override id; // =\"qtiAspectInhoudRubricBlock\"\n\n @property({ type: String }) use: 'instructions' | 'scoring' | 'navigation'; // = \"scoring\"\n\n @property({ type: String }) view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';\n\n @property({ type: String, attribute: 'class' }) classNames;\n @watch('classNames', { waitUntilFirstUpdate: true })\n handleclassNamesChange() {\n const classNames = this.classNames.split(' ');\n classNames.forEach((className: string) => {\n switch (className) {\n case 'qti-rubric-discretionary-placement':\n this.setAttribute('slot', 'qti-rubric-block');\n break;\n case 'qti-rubric-inline':\n this.setAttribute('slot', '');\n break;\n default:\n break;\n }\n });\n }\n\n static override styles = css`\n :host {\n display: block;\n }\n `;\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // by default put this in a slot in the item-body\n this.setAttribute('slot', 'qti-rubric-block');\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-rubric-block': QtiRubricBlock;\n }\n}\n","export const decimalSeparator = () => {\n return new Intl.NumberFormat().format(0.1).replace(/\\d/g, '');\n};\n\nexport const convertNumberToUniveralFormat = (number: number | string) => {\n // check if type is string\n if (typeof number === 'string') {\n return number;\n }\n const dSep = decimalSeparator();\n if (dSep === '.') {\n return number.toLocaleString();\n } else {\n return number.toString().replace('.', '').replace(dSep, '.');\n }\n};\n\nexport function IsNullOrUndefined(value: unknown) {\n return value === null || value === undefined;\n}\n\nexport function removeDoubleSlashes(str: string) {\n const singleForwardSlashes = str\n .replace(/([^:]\\/)\\/+/g, '$1')\n .replace(/\\/\\//g, '/')\n .replace('http:/', 'http://')\n .replace('https:/', 'https://');\n return singleForwardSlashes;\n}\n","import { consume } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { IsNullOrUndefined } from '../internal/utils';\nimport { itemContext, ItemContext } from '../qti-assessment-item/qti-assessment-item.context';\n\nexport abstract class QtiFeedback extends LitElement {\n @property({ type: String, attribute: 'show-hide' })\n protected showHide: string;\n\n @property({ type: String, attribute: 'outcome-identifier' })\n public outcomeIdentifier: string;\n\n @property({ type: String })\n protected identifier: string;\n\n @property({ type: String, attribute: false })\n public showStatus: string;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n private _context?: ItemContext;\n\n public override connectedCallback() {\n super.connectedCallback();\n this.dispatchEvent(\n new CustomEvent<QtiFeedback>('qti-register-feedback', {\n bubbles: true,\n composed: true,\n detail: this\n })\n );\n }\n\n public checkShowFeedback(outcomeIdentifier: string) { \n const outcomeVariable = this._context.variables.find(v => v.identifier === outcomeIdentifier) || null;;\n\n if (this.outcomeIdentifier !== outcomeIdentifier || !outcomeVariable) return;\n let isFound = false;\n if (Array.isArray(outcomeVariable.value)) {\n isFound = outcomeVariable.value.includes(this.identifier);\n } else {\n isFound =\n (!IsNullOrUndefined(this.identifier) &&\n !IsNullOrUndefined(outcomeVariable?.value) &&\n this.identifier === outcomeVariable.value) ||\n false;\n }\n\n this.showFeedback(isFound);\n }\n\n private showFeedback(value: boolean) { \n this.showStatus = (value && this.showHide === 'show') || (!value && this.showHide === 'hide') ? 'on' : 'off'; \n }\n}\n","import { PropertyValueMap, css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { QtiFeedback } from '../qti-feedback';\n\n@customElement('qti-feedback-block')\nexport class QtiFeedbackBlock extends QtiFeedback {\n static override styles = css`\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n `;\n\n override render() {\n return html` <slot part=\"feedback\" class=\"feedback ${this.showStatus}\"></slot> `;\n }\n\n protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n this.checkShowFeedback(this.outcomeIdentifier);\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-feedback-block': QtiFeedbackBlock;\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { QtiFeedback } from '../qti-feedback';\n\n@customElement('qti-feedback-inline')\nexport class QtiFeedbackInline extends QtiFeedback {\n static override styles = css`\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n `;\n\n override render = () => html` <slot part=\"feedback\" class=\"${this.showStatus}\"></slot> `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-feedback-inline': QtiFeedbackInline;\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { QtiFeedback } from '../qti-feedback';\n\n@customElement('qti-modal-feedback')\nexport class QtiModalFeedback extends QtiFeedback {\n static override styles = css`\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n `;\n\n override render = () => html` <slot part=\"feedback\" class=\"${this.showStatus}\"></slot> `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-modal-feedback': QtiModalFeedback;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing} from '../lit-html.js';\n\n/**\n * For AttributeParts, sets the attribute if the value is defined and removes\n * the attribute if the value is undefined.\n *\n * For other part types, this directive is a no-op.\n */\nexport const ifDefined = <T>(value: T) => value ?? nothing;\n","import { property, state } from 'lit/decorators.js';\nimport { LitElement } from 'lit';\nimport { IInteraction } from './interaction.interface';\n\nexport abstract class Interaction extends LitElement implements IInteraction {\n static formAssociated = true;\n\n @property({ type: String, attribute: 'response-identifier' }) responseIdentifier;\n\n @property({ reflect: true, type: Boolean }) disabled = false;\n\n @property({ reflect: true, type: Boolean }) readonly = false;\n\n @state()\n protected _correctResponse: string | string[];\n protected _internals: ElementInternals;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n abstract validate(): boolean;\n\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n\n public reset(): void {\n this.value = '';\n }\n\n abstract get value(): string | string[];\n abstract set value(val: string | string[]);\n\n public get correctResponse(): string | string[] {\n return this._correctResponse;\n }\n set correctResponse(value: string | string[]) {\n this._correctResponse = value;\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n\n this.dispatchEvent(\n new CustomEvent('qti-register-interaction', {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n responseIdentifier: this.responseIdentifier\n }\n })\n );\n }\n\n public saveResponse(value: string | string[]) {\n this.dispatchEvent(\n new CustomEvent('qti-interaction-response', {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n responseIdentifier: this.responseIdentifier,\n response: Array.isArray(value) ? [...value] : value\n }\n })\n );\n }\n}\n","import { css, html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { Interaction } from '../internal/interaction/interaction';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { watch } from '../../../decorators/watch';\n\n@customElement('qti-extended-text-interaction')\nexport class QtiExtendedTextInteraction extends Interaction {\n @state()\n private _rows = 5;\n\n /** expected length is mapped to the property maxlength on the textarea */\n @property({ type: Number, attribute: 'expected-length' }) expectedLength: number;\n\n @property({ type: String, attribute: 'pattern-mask' }) patternMask: string;\n\n /** text appearing in the extended-text-nteraction if it is empty */\n @property({ type: String, attribute: 'placeholder-text' }) placeholderText: string;\n\n @property({ type: String, attribute: 'data-patternmask-message' }) dataPatternmaskMessage: string;\n\n @state()\n private _value = '';\n\n @property({ type: String, attribute: 'class' }) classNames;\n @watch('classNames')\n handleclassNamesChange(_: any, classes: string) {\n const classNames = classes.split(' ');\n let rowsSet = false;\n classNames.forEach((className: string) => {\n if (className.startsWith('qti-height-lines-')) {\n const nrRows = className.replace('qti-height-lines-', '');\n this._rows = parseInt(nrRows);\n rowsSet = true;\n }\n });\n // If no qti-height-lines class is set, calculate rows based on expectedLength\n if (!rowsSet && this.expectedLength) {\n const estimatedRows = Math.ceil(this.expectedLength / 50); // '50' based on an estimate for characters per row\n this._rows = estimatedRows;\n }\n }\n\n get value(): string | string[] {\n return this._value;\n }\n set value(val: string | string[]) {\n if (typeof val === 'string') {\n this._value = val;\n const formData = new FormData();\n formData.append(this.responseIdentifier, val);\n this._internals.setFormValue(formData);\n this.validate();\n } else {\n throw new Error('Value must be a string');\n }\n }\n\n public override validate() {\n const textarea = this.shadowRoot.querySelector('textarea');\n if (!textarea) return false;\n\n if (this.patternMask && this.dataPatternmaskMessage) {\n // Clear any custom error initially\n this._internals.setValidity({});\n textarea.setCustomValidity('');\n const patternSource =\n this.patternMask.startsWith('^') && this.patternMask.endsWith('$') ? this.patternMask : `^${this.patternMask}$`;\n\n const pattern = new RegExp(patternSource);\n const isValid = textarea.checkValidity() && pattern.test(textarea.value);\n\n if (!isValid) {\n // Set custom error if invalid\n this._internals.setValidity({ customError: true }, this.dataPatternmaskMessage);\n textarea.setCustomValidity(this.dataPatternmaskMessage);\n }\n } else {\n const isValid = textarea.checkValidity();\n this._internals.setValidity(isValid ? {} : { customError: false });\n }\n\n return this._value !== '' && textarea.checkValidity();\n }\n\n override reportValidity() {\n const textarea = this.shadowRoot.querySelector('textarea');\n if (!textarea) return false;\n\n // Run the validate function to ensure the custom validity state is up to date\n const isValid = this.validate();\n if (!isValid) {\n textarea.reportValidity();\n }\n return isValid;\n }\n\n static override get styles() {\n return [\n css`\n /* PK: display host as block, else design will be collapsed */\n :host {\n display: block;\n }\n textarea {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 0;\n }\n `\n ];\n }\n\n override render() {\n return html`<slot name=\"prompt\"></slot\n ><textarea\n part=\"textarea\"\n name=\"${this.responseIdentifier}\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n maxlength=\"${5000}\"\n @keydown=\"${event => event.stopImmediatePropagation()}\"\n @keyup=\"${this.textChanged}\"\n @change=\"${this.textChanged}\"\n @blur=\"${(_: FocusEvent) => {\n this.reportValidity();\n }}\"\n placeholder=\"${ifDefined(this.placeholderText ? this.placeholderText : undefined)}\"\n rows=\"${this._rows}\"\n ?disabled=\"${this.disabled}\"\n ?readonly=\"${this.readonly}\"\n .value=${this._value}\n ></textarea>`;\n }\n\n protected textChanged(event: Event) {\n if (this.disabled || this.readonly) return;\n const input = event.target as HTMLInputElement;\n this.setEmptyAttribute(input.value);\n if (this._value !== input.value) {\n this.value = input.value;\n this.saveResponse(input.value);\n }\n }\n\n private setEmptyAttribute(text: string) {\n this.setAttribute('empty', text === '' ? 'true' : 'false');\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-extended-text-interaction': QtiExtendedTextInteraction;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport {nothing, ElementPart} from '../lit-html.js';\nimport {directive, AsyncDirective} from '../async-directive.js';\n\n/**\n * Creates a new Ref object, which is container for a reference to an element.\n */\nexport const createRef = <T = Element>() => new Ref<T>();\n\n/**\n * An object that holds a ref value.\n */\nclass Ref<T = Element> {\n /**\n * The current Element value of the ref, or else `undefined` if the ref is no\n * longer rendered.\n */\n readonly value?: T;\n}\n\nexport type {Ref};\n\ninterface RefInternal {\n value: Element | undefined;\n}\n\n// When callbacks are used for refs, this map tracks the last value the callback\n// was called with, for ensuring a directive doesn't clear the ref if the ref\n// has already been rendered to a new spot. It is double-keyed on both the\n// context (`options.host`) and the callback, since we auto-bind class methods\n// to `options.host`.\nconst lastElementForContextAndCallback = new WeakMap<\n object,\n WeakMap<Function, Element | undefined>\n>();\n\nexport type RefOrCallback<T = Element> = Ref<T> | ((el: T | undefined) => void);\n\nclass RefDirective extends AsyncDirective {\n private _element?: Element;\n private _ref?: RefOrCallback;\n private _context?: object;\n\n render(_ref?: RefOrCallback) {\n return nothing;\n }\n\n override update(part: ElementPart, [ref]: Parameters<this['render']>) {\n const refChanged = ref !== this._ref;\n if (refChanged && this._ref !== undefined) {\n // The ref passed to the directive has changed;\n // unset the previous ref's value\n this._updateRefValue(undefined);\n }\n if (refChanged || this._lastElementForRef !== this._element) {\n // We either got a new ref or this is the first render;\n // store the ref/element & update the ref value\n this._ref = ref;\n this._context = part.options?.host;\n this._updateRefValue((this._element = part.element));\n }\n return nothing;\n }\n\n private _updateRefValue(element: Element | undefined) {\n if (!this.isConnected) {\n element = undefined;\n }\n if (typeof this._ref === 'function') {\n // If the current ref was called with a previous value, call with\n // `undefined`; We do this to ensure callbacks are called in a consistent\n // way regardless of whether a ref might be moving up in the tree (in\n // which case it would otherwise be called with the new value before the\n // previous one unsets it) and down in the tree (where it would be unset\n // before being set). Note that element lookup is keyed by\n // both the context and the callback, since we allow passing unbound\n // functions that are called on options.host, and we want to treat\n // these as unique \"instances\" of a function.\n const context = this._context ?? globalThis;\n let lastElementForCallback =\n lastElementForContextAndCallback.get(context);\n if (lastElementForCallback === undefined) {\n lastElementForCallback = new WeakMap();\n lastElementForContextAndCallback.set(context, lastElementForCallback);\n }\n if (lastElementForCallback.get(this._ref) !== undefined) {\n this._ref.call(this._context, undefined);\n }\n lastElementForCallback.set(this._ref, element);\n // Call the ref with the new element value\n if (element !== undefined) {\n this._ref.call(this._context, element);\n }\n } else {\n (this._ref as RefInternal)!.value = element;\n }\n }\n\n private get _lastElementForRef() {\n return typeof this._ref === 'function'\n ? lastElementForContextAndCallback\n .get(this._context ?? globalThis)\n ?.get(this._ref)\n : this._ref?.value;\n }\n\n override disconnected() {\n // Only clear the box if our element is still the one in it (i.e. another\n // directive instance hasn't rendered its element to it before us); that\n // only happens in the event of the directive being cleared (not via manual\n // disconnection)\n if (this._lastElementForRef === this._element) {\n this._updateRefValue(undefined);\n }\n }\n\n override reconnected() {\n // If we were manually disconnected, we can safely put our element back in\n // the box, since no rendering could have occurred to change its state\n this._updateRefValue(this._element);\n }\n}\n\n/**\n * Sets the value of a Ref object or calls a ref callback with the element it's\n * bound to.\n *\n * A Ref object acts as a container for a reference to an element. A ref\n * callback is a function that takes an element as its only argument.\n *\n * The ref directive sets the value of the Ref object or calls the ref callback\n * during rendering, if the referenced element changed.\n *\n * Note: If a ref callback is rendered to a different element position or is\n * removed in a subsequent render, it will first be called with `undefined`,\n * followed by another call with the new element it was rendered to (if any).\n *\n * ```js\n * // Using Ref object\n * const inputRef = createRef();\n * render(html`<input ${ref(inputRef)}>`, container);\n * inputRef.value.focus();\n *\n * // Using callback\n * const callback = (inputElement) => inputElement.focus();\n * render(html`<input ${ref(callback)}>`, container);\n * ```\n */\nexport const ref = directive(RefDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {RefDirective};\n","import { css } from 'lit';\n\nexport default css`\n :host {\n display: inline-block;\n }\n [part='correct'] {\n position: absolute;\n width: 100%;\n }\n :host(.qti-input-width-1) [part='input'] {\n width: 1.1rem;\n min-width: 1.1rem;\n }\n\n :host(.qti-input-width-2) [part='input'] {\n width: 2.3rem;\n min-width: 2.3rem;\n }\n\n :host(.qti-input-width-3) [part='input'] {\n width: 3.3rem;\n min-width: 3.3rem;\n }\n\n :host(.qti-input-width-4) [part='input'] {\n width: 4.2rem;\n min-width: 4.2rem;\n }\n\n :host(.qti-input-width-6) [part='input'] {\n width: 6.6rem;\n min-width: 6.6rem;\n }\n\n :host(.qti-input-width-10) [part='input'] {\n width: 8rem;\n min-width: 8rem;\n }\n\n :host(.qti-input-width-15) [part='input'] {\n width: 12rem;\n min-width: 12rem;\n }\n\n :host(.qti-input-width-20) [part='input'] {\n width: 17rem;\n min-width: 17rem;\n }\n\n :host(.qti-input-width-25) [part='input'] {\n width: 20rem;\n min-width: 20rem;\n }\n\n :host(.qti-input-width-30) [part='input'] {\n width: 24rem;\n min-width: 24rem;\n }\n\n :host(.qti-input-width-35) [part='input'] {\n width: 28rem;\n min-width: 28rem;\n }\n\n :host(.qti-input-width-40) [part='input'] {\n width: 32rem;\n min-width: 32rem;\n }\n\n :host(.qti-input-width-45) [part='input'] {\n width: 36rem;\n min-width: 36rem;\n }\n\n :host(.qti-input-width-50) [part='input'] {\n width: 40rem;\n min-width: 40rem;\n }\n\n :host(.qti-input-width-72) [part='input'] {\n width: 57rem;\n min-width: 57rem;\n }\n`;\n","import { CSSResultGroup, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createRef } from 'lit/directives/ref.js';\nimport { Interaction } from '../internal/interaction/interaction';\nimport styles from './qti-text-entry-interaction.styles';\n@customElement('qti-text-entry-interaction')\nexport class QtiTextEntryInteraction extends Interaction {\n static styles: CSSResultGroup = styles;\n\n @property({ type: Number, attribute: 'expected-length' }) expectedLength: number;\n\n @property({ type: String, attribute: 'pattern-mask' }) patternMask: string;\n\n @property({ type: String, attribute: 'placeholder-text' }) placeholderText: string;\n\n @property({ type: String, attribute: 'data-patternmask-message' }) dataPatternmaskMessage: string;\n\n @state()\n private _value = '';\n\n inputRef = createRef<HTMLInputElement>();\n\n get value(): string | string[] {\n return this._value;\n }\n set value(val: string | string[]) {\n if (typeof val === 'string') {\n this._value = val;\n const formData = new FormData();\n formData.append(this.responseIdentifier, val);\n this._internals.setFormValue(formData);\n this.validate();\n } else {\n throw new Error('Value must be a string');\n }\n }\n\n public override validate() {\n const input = this.shadowRoot.querySelector('input');\n if (!input) return false;\n if (this.patternMask && this.dataPatternmaskMessage) {\n // Clear any custom error if the input is valid\n this._internals.setValidity({});\n input.setCustomValidity(''); // Clear the custom message\n const isValid = input.checkValidity();\n if (!isValid) {\n // Set custom error if invalid\n this._internals.setValidity({ customError: true }, this.dataPatternmaskMessage);\n input.setCustomValidity(this.dataPatternmaskMessage); // Set custom message only if invalid\n }\n } else {\n const isValid = input.checkValidity();\n this._internals.setValidity(isValid ? {} : { customError: false });\n }\n return this._value !== '' && input.checkValidity();\n }\n\n override render() {\n return html`\n <input\n part=\"input\"\n name=\"${this.responseIdentifier}\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @blur=\"${(_: FocusEvent) => {\n this.reportValidity();\n }}\"\n @keydown=\"${event => event.stopImmediatePropagation()}\"\n @keyup=\"${this.textChanged}\"\n @change=\"${this.textChanged}\"\n type=\"${this.patternMask == '[0-9]*' ? 'number' : 'text'}\"\n placeholder=\"${ifDefined(this.placeholderText ? this.placeholderText : undefined)}\"\n .value=\"${this._value}\"\n pattern=\"${ifDefined(this.patternMask ? this.patternMask : undefined)}\"\n maxlength=${1000}\n ?disabled=\"${this.disabled}\"\n ?readonly=\"${this.readonly}\"\n />\n <div part=\"correct\">${this._correctResponse}</div>\n `;\n }\n protected textChanged(event: Event) {\n if (this.disabled || this.readonly) return;\n const input = event.target as HTMLInputElement;\n this.setEmptyAttribute(input.value);\n if (this._value !== input.value) {\n this.value = input.value;\n this.saveResponse(input.value);\n }\n }\n\n override reportValidity() {\n const input = this.shadowRoot.querySelector('input');\n if (!input) return false;\n\n // Run the validate function to ensure the custom validity state is up to date\n const isValid = this.validate();\n if (!isValid) {\n input.reportValidity();\n }\n return isValid;\n }\n\n reset(): void {\n this._value = '';\n }\n\n private setEmptyAttribute(text: string) {\n this.setAttribute('empty', text === '' ? 'true' : 'false');\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-text-entry-interaction': QtiTextEntryInteraction;\n }\n}\n","import { property, query } from 'lit/decorators.js';\nimport { watch } from '../../../../decorators/watch';\n\nimport { ChoiceInterface } from '../active-element/active-element.mixin';\nimport { Interaction } from '../interaction/interaction';\nimport { IInteraction } from '../interaction/interaction.interface';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\nexport type Choice = HTMLElement & ChoiceInterface & { internals: ElementInternals };\n\nexport interface ChoicesInterface extends IInteraction {\n correctResponse: string | string[];\n}\n\nexport const ChoicesMixin = <T extends Constructor<Interaction>>(superClass: T, selector: string) => {\n abstract class ChoicesMixinElement extends superClass implements ChoicesInterface {\n protected _choiceElements: Choice[] = [];\n\n @query('#validationMessage')\n private _validationMessageElement!: HTMLElement;\n\n @property({ type: Number, attribute: 'min-choices' })\n public minChoices = 0;\n\n @property({ type: Number, attribute: 'max-choices' })\n public maxChoices = 1;\n\n @watch('maxChoices', { waitUntilFirstUpdate: true })\n protected _handleMaxChoicesChange(_oldValue: number, _newValue: number) {\n this._determineInputType();\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n protected _handleDisabledChange = (_: boolean, disabled: boolean) => {\n this._choiceElements.forEach(ch => (ch.disabled = disabled));\n };\n\n @watch('readonly', { waitUntilFirstUpdate: true })\n protected _handleReadonlyChange = (_: boolean, readonly: boolean) => {\n this._choiceElements.forEach(choice => (choice.readonly = readonly));\n };\n\n private _value: string | string[] = '';\n\n get value(): string | string[] {\n return Array.isArray(this._value) ? this._value.join(',') : this._value;\n }\n\n set value(val: string | string[]) {\n if (this.maxChoices > 1 && typeof val === 'string') {\n this._value = val.split(',');\n } else {\n this._value = val;\n }\n // Assuming this.value is an array of strings\n if (Array.isArray(this._value)) {\n const formData = new FormData();\n this._value.forEach(response => {\n formData.append(this.responseIdentifier, response);\n });\n this._internals.setFormValue(formData);\n } else {\n // Handle the case where this.value is not an array\n this._internals.setFormValue(this._value);\n }\n this._updateChoiceSelection();\n }\n\n public get correctResponse(): string | string[] {\n return this._correctResponse;\n }\n\n public set correctResponse(value: string | string[]) {\n this._correctResponse = value;\n const responseArray = Array.isArray(value) ? value : [value];\n this._choiceElements.forEach(choice => {\n choice.internals.states.delete('correct-response');\n choice.internals.states.delete('incorrect-response');\n if (responseArray.length > 0) {\n if (responseArray.includes(choice.identifier)) {\n choice.internals.states.add('correct-response');\n } else {\n choice.internals.states.add('incorrect-response');\n }\n }\n });\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.addEventListener(`register-${selector}`, this._registerChoiceElement);\n this.addEventListener(`unregister-${selector}`, this._unregisterChoiceElement);\n this.addEventListener(`activate-${selector}`, this._choiceElementSelectedHandler);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(`register-${selector}`, this._registerChoiceElement);\n this.removeEventListener(`unregister-${selector}`, this._unregisterChoiceElement);\n this.removeEventListener(`activate-${selector}`, this._choiceElementSelectedHandler);\n }\n\n public validate(): boolean {\n const selectedChoices = this._choiceElements.filter(choice => this._getChoiceChecked(choice));\n const selectedCount = selectedChoices.length;\n let isValid = true;\n let validityMessage = '';\n if (this.maxChoices !== 0 && selectedCount > this.maxChoices) {\n isValid = false;\n validityMessage = this.dataset.maxSelectionsMessage || `You can select at most ${this.maxChoices} choices.`;\n } else if (selectedCount < this.minChoices) {\n isValid = false;\n validityMessage = this.dataset.minSelectionsMessage || `You must select at least ${this.minChoices} choices.`;\n }\n\n if (selectedChoices.length > 0) {\n this._internals.setValidity(\n isValid ? {} : { customError: true },\n validityMessage,\n selectedChoices[selectedCount - 1] || this._choiceElements[0] || this\n );\n }\n this.reportValidity();\n return isValid;\n }\n\n override reportValidity() {\n if (this._validationMessageElement) {\n if (!this._internals.validity.valid) {\n this._validationMessageElement.textContent = this._internals.validationMessage;\n this._validationMessageElement.style.display = 'block';\n } else {\n this._validationMessageElement.textContent = '';\n this._validationMessageElement.style.display = 'none';\n }\n }\n return this._internals.validity.valid;\n }\n\n private _registerChoiceElement(event: CustomEvent) {\n event.stopPropagation();\n const choiceElement = event.target as Choice;\n choiceElement.disabled = this.disabled;\n\n this._choiceElements.push(choiceElement);\n this._setInputType(choiceElement);\n }\n\n private _unregisterChoiceElement(event: CustomEvent) {\n event.stopPropagation();\n const choiceElement = event.target as Choice;\n this._choiceElements = this._choiceElements.filter(choice => choice !== choiceElement);\n }\n\n private _determineInputType() {\n this._choiceElements.forEach(choice => {\n this._setInputType(choice);\n });\n }\n\n private _setInputType(choiceElement: Choice) {\n this._internals.ariaLabel = this.maxChoices === 1 ? 'radio-group' : 'checkbox-group';\n\n const role = this.maxChoices === 1 ? 'radio' : 'checkbox';\n choiceElement.internals.role = role;\n choiceElement.internals.states.delete(role === 'radio' ? 'checkbox' : 'radio');\n choiceElement.internals.states.add(role);\n }\n\n protected _choiceElementSelectedHandler(event: CustomEvent<{ identifier: string }>) {\n this._toggleChoiceChecked(event.target as Choice);\n if (this.maxChoices === 1) {\n this._choiceElements.forEach(choice => {\n if (choice.identifier !== event.detail.identifier) {\n this._setChoiceChecked(choice, false);\n }\n });\n }\n this._handleChoiceSelection();\n }\n\n private _setChoiceChecked(choice: Choice, checked: boolean) {\n if (choice.internals?.states) {\n if (checked) {\n choice.internals.states.add('--checked');\n choice.internals.ariaChecked = 'true';\n } else {\n choice.internals.states.delete('--checked');\n choice.internals.ariaChecked = 'false';\n }\n }\n }\n\n private _getChoiceChecked(choice: Choice): boolean {\n return choice.internals.states.has('--checked');\n }\n\n private _toggleChoiceChecked(choice: Choice) {\n const checked = this._getChoiceChecked(choice);\n this._setChoiceChecked(choice, !checked);\n }\n\n private _handleChoiceSelection() {\n const selectedChoices = this._choiceElements.filter(choice => this._getChoiceChecked(choice));\n const selectedIdentifiers = selectedChoices.map(choice => choice.identifier);\n\n this.value = this.maxChoices === 1 ? selectedIdentifiers[0] || '' : selectedIdentifiers;\n this.validate();\n this.saveResponse(this._value);\n }\n\n /**\n * Updates the selection state of each choice element based on the current response.\n */\n private _updateChoiceSelection() {\n const responseArray = Array.isArray(this._value) ? this._value : [this._value];\n this._choiceElements.forEach(choice => {\n const isSelected = responseArray.includes(choice.identifier);\n this._setChoiceChecked(choice, isSelected);\n });\n }\n }\n return ChoicesMixinElement as Constructor<ChoicesInterface> & T;\n};\n","import { html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { ChoicesMixin } from '../internal/choices/choices.mixin';\nimport { Interaction } from '../internal/interaction/interaction';\n\n@customElement('qti-hottext-interaction')\nexport class QtiHottextInteraction extends ChoicesMixin(Interaction, 'qti-hottext') {\n override connectedCallback() {\n super.connectedCallback();\n this.setAttribute('qti-hottext-interaction', '');\n }\n\n override render = () => html`<slot></slot>`;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-hottext-interaction': QtiHottextInteraction;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing, TemplateResult, noChange} from '../lit-html.js';\nimport {directive, Directive, PartInfo, PartType} from '../directive.js';\n\nconst HTML_RESULT = 1;\n\nexport class UnsafeHTMLDirective extends Directive {\n static directiveName = 'unsafeHTML';\n static resultType = HTML_RESULT;\n\n private _value: unknown = nothing;\n private _templateResult?: TemplateResult;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error(\n `${\n (this.constructor as typeof UnsafeHTMLDirective).directiveName\n }() can only be used in child bindings`\n );\n }\n }\n\n render(value: string | typeof nothing | typeof noChange | undefined | null) {\n if (value === nothing || value == null) {\n this._templateResult = undefined;\n return (this._value = value);\n }\n if (value === noChange) {\n return value;\n }\n if (typeof value != 'string') {\n throw new Error(\n `${\n (this.constructor as typeof UnsafeHTMLDirective).directiveName\n }() called with a non-string value`\n );\n }\n if (value === this._value) {\n return this._templateResult;\n }\n this._value = value;\n const strings = [value] as unknown as TemplateStringsArray;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (strings as any).raw = strings;\n // WARNING: impersonating a TemplateResult like this is extremely\n // dangerous. Third-party directives should not do this.\n return (this._templateResult = {\n // Cast to a known set of integers that satisfy ResultType so that we\n // don't have to export ResultType and possibly encourage this pattern.\n // This property needs to remain unminified.\n ['_$litType$']: (this.constructor as typeof UnsafeHTMLDirective)\n .resultType as 1 | 2,\n strings,\n values: [],\n });\n }\n}\n\n/**\n * Renders the result as HTML, rather than text.\n *\n * The values `undefined`, `null`, and `nothing`, will all result in no content\n * (empty string) being rendered.\n *\n * Note, this is unsafe to use with any user-provided input that hasn't been\n * sanitized or escaped, as it may lead to cross-site-scripting\n * vulnerabilities.\n */\nexport const unsafeHTML = directive(UnsafeHTMLDirective);\n","import { css, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { Interaction } from '../internal/interaction/interaction';\n\ninterface OptionType {\n textContent: string;\n value: string;\n selected: boolean;\n}\n\n@customElement('qti-inline-choice-interaction')\nexport class QtiInlineChoiceInteraction extends Interaction {\n static override get styles() {\n return [\n css`\n :host {\n display: inline-block;\n }\n slot {\n display: flex;\n flex-direction: column;\n }\n [role='menu'] {\n position: absolute;\n z-index: 1000;\n }\n .anchor {\n /* anchor-name: --infobox; */\n width: fit-content;\n }\n\n .positionedElement {\n position: absolute;\n /* position-anchor: --infobox; */\n /* top: anchor(bottom); */\n }\n `\n ];\n }\n\n public static inputWidthClass = [\n '',\n 'qti-input-width-2',\n 'qti-input-width-1',\n 'qti-input-width-3',\n 'qti-input-width-4',\n 'qti-input-width-6',\n 'qti-input-width-10',\n 'qti-input-width-15',\n 'qti-input-width-20',\n 'qti-input-width-72'\n ];\n\n @state() options: OptionType[] = [];\n\n @state() correctOption: string = '';\n\n @property({ attribute: 'data-prompt', type: String })\n dataPrompt: string = 'select';\n\n override render() {\n return html`\n <select part=\"select\" @change=\"${this.choiceSelected}\" ?disabled=\"${this.disabled}\" ?readonly=\"${this.readonly}\">\n ${this.options.map(\n option => html`\n <option value=\"${option.value}\" ?selected=\"${option.selected}\">${unsafeHTML(option.textContent)}</option>\n `\n )}\n </select>\n\n ${unsafeHTML(this.correctOption)}\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('on-dropdown-selected', this.choiceSelected);\n const choices = Array.from(this.querySelectorAll('qti-inline-choice'));\n this.options = [\n {\n textContent: this.dataPrompt,\n value: '',\n selected: false\n },\n ...choices.map(choice => ({\n textContent: choice.innerHTML,\n value: choice.getAttribute('identifier'),\n selected: false\n }))\n ];\n }\n\n disconnectedCallback() {\n this.removeEventListener('on-dropdown-selected', this.choiceSelected);\n }\n\n public validate(): boolean {\n const selectedOption = this.options.find(option => option.selected);\n return selectedOption ? selectedOption.value !== '' : false;\n }\n\n public reset() {\n this.options = this.options.map((option, i) => ({ ...option, selected: i === 0 }));\n }\n\n public set value(value: string) {\n this.options = this.options.map(option => {\n if (value === option.value) {\n option.selected = true;\n }\n return option;\n });\n }\n get value(): string {\n return this.options.find(option => option.selected).value;\n }\n\n set correctResponse(value: string | string[]) {\n if (value === '') {\n this.correctOption = '';\n return;\n }\n this.correctOption = `<span part=\"correct-option\">${\n this.options.find(option => value === option.value).textContent\n }</span>`;\n }\n\n public choiceSelected(event: Event) {\n const selectedOptionValue = (event.target as HTMLSelectElement).value;\n this.options = this.options.map(option => ({ ...option, selected: option.value === selectedOptionValue }));\n this.saveResponse(selectedOptionValue);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-inline-choice-interaction': QtiInlineChoiceInteraction;\n }\n}\n","/**\n * Mixin that provides shuffling functionality for a LitElement.\n * @template T - The type of the LitElement subclass.\n * @param {T} superClass - The superclass to extend.\n * @param {string} selector - The CSS selector for the elements to shuffle.\n * @returns {Constructor<ShuffleInterface> & T} - The extended class with shuffling functionality.\n *\n * adds a shuffle property to the class with an attribute converter\n *\n * qti-inline-choice-interaction\n * qti-choice-interaction\n * qti-match-interaction\n */\nimport { property } from 'lit/decorators.js';\nimport { Interaction } from '../interaction/interaction';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class ShuffleInterface {}\nexport const ShuffleMixin = <T extends Constructor<Interaction>>(superClass: T, selector: string) => {\n abstract class ShuffleElement extends superClass {\n /** <span style=\"color:blue\">some *blue* text</span>. Does not work in storybook */\n @property({ type: String, reflect: true })\n shuffle: 'true' | 'false' = 'false'; // Defaults to 'false'\n\n connectedCallback() {\n super.connectedCallback();\n this._applyShuffle();\n }\n\n updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('shuffle')) {\n this._applyShuffle();\n }\n }\n\n private _applyShuffle() {\n if (this.shuffle === 'true') {\n this._shuffleChoices();\n } else {\n this._resetShuffleChoices();\n }\n }\n\n private _shuffleChoices() {\n const choices = Array.from(this.querySelectorAll<HTMLElement>(selector));\n const fixedChoices = choices.filter(choice => choice.hasAttribute('fixed'));\n const nonFixedChoices = choices.filter(choice => !choice.hasAttribute('fixed'));\n\n if (nonFixedChoices.length <= 1) {\n console.warn('Shuffling is not possible with fewer than 2 non-fixed elements.');\n return;\n }\n\n const originalOrder = [...nonFixedChoices];\n let shuffled = false;\n let attempts = 0;\n\n // Shuffle until the result is different or attempts are exceeded\n while (!shuffled && attempts < 10) {\n attempts++;\n for (let i = nonFixedChoices.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [nonFixedChoices[i], nonFixedChoices[j]] = [nonFixedChoices[j], nonFixedChoices[i]];\n }\n shuffled = !nonFixedChoices.every((choice, index) => choice === originalOrder[index]);\n }\n\n if (!shuffled) {\n console.warn('Failed to shuffle the choices after multiple attempts.');\n }\n\n // Apply order styles\n let order = 1;\n [...fixedChoices, ...nonFixedChoices].forEach(choice => {\n choice.style.setProperty('order', String(order++));\n });\n }\n\n private _resetShuffleChoices() {\n this.querySelectorAll<HTMLElement>(selector).forEach(choice => {\n choice.style.setProperty('order', 'initial');\n });\n }\n }\n\n return ShuffleElement as Constructor<ShuffleInterface> & T;\n};\n","/**\n * Mixin that provides shuffling functionality for a LitElement.\n * @template T - The type of the LitElement subclass.\n * @param {T} superClass - The superclass to extend.\n * @param {string} selector - The CSS selector for the elements to shuffle.\n * @returns {Constructor<ShuffleInterface> & T} - The extended class with shuffling functionality.\n *\n * adds a shuffle property to the class with an attribute converter\n *\n * qti-inline-choice-interaction\n * qti-choice-interaction\n * qti-match-interaction\n */\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { QtiSimpleChoice } from '../../qti-simple-choice';\nimport { Interaction } from '../interaction/interaction';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ntype LabelType = 'qti-labels-decimal' | 'qti-labels-lower-alpha' | 'qti-labels-upper-alpha';\ntype LabelSuffixType = 'qti-labels-suffix-period' | 'qti-labels-suffix-parenthesis';\n\ndeclare class VocabularyInterface {}\n\nexport const VocabularyMixin = <T extends Constructor<Interaction>>(superClass: T, _selector: string) => {\n abstract class VocabularyElement extends superClass {\n private _classes: string[] = [];\n private _allLabels = ['qti-labels-decimal', 'qti-labels-lower-alpha', 'qti-labels-upper-alpha'];\n private _allLabelSuffixes = ['qti-labels-suffix-period', 'qti-labels-suffix-parenthesis'] as LabelSuffixType[];\n // Define the property with the custom converter\n @property({\n type: String,\n reflect: true\n })\n set class(value: string) {\n if (!value) {\n return;\n }\n // const oldValue = this._classes.join(' ');\n this._classes = value.split(' ');\n\n this._addLabels();\n // this.requestUpdate('class', oldValue);\n }\n get class(): string {\n return this._classes?.join(' ') || '';\n }\n\n protected override updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties);\n if (_changedProperties.has('shuffle')) {\n this._addLabels();\n }\n }\n\n private _addLabels() {\n const classContainsLabel = this._classes.some(\n cls => this._allLabels.includes(cls) || this._allLabelSuffixes.includes(cls as LabelSuffixType)\n );\n const isNumber = value => {\n return !isNaN(+value);\n };\n if (classContainsLabel) {\n const choiceElements = Array.from(this.querySelectorAll('qti-simple-choice')).map(c => c as QtiSimpleChoice);\n const choices = choiceElements\n .map((choice: HTMLElement, index) => {\n return { el: choice, order: isNumber(choice.style.order) ? +choice.style.order : index + 1 };\n })\n .sort((a, b) => a.order - b.order)\n .map(choice => choice.el);\n for (let i = 0; i < choices.length; i++) {\n (choices[i] as QtiSimpleChoice).marker = this._getLabel(i + 1);\n }\n }\n }\n private _getLabel(index: number) {\n let lastLabel = this._classes.filter(c => this._allLabels.includes(c)).pop() as LabelType;\n const lastLabelSuffix = this._classes.filter(c => this._allLabelSuffixes.includes(c as LabelSuffixType)).pop();\n\n if (!lastLabel && lastLabelSuffix) {\n // a suffix without a label is strange so add qti-labels-upper-alpha\n lastLabel = 'qti-labels-upper-alpha';\n }\n let label = '';\n switch (lastLabel) {\n case 'qti-labels-decimal':\n label = `${index}`;\n break;\n case 'qti-labels-lower-alpha':\n label = `${String.fromCharCode(97 + index - 1)}`;\n break;\n case 'qti-labels-upper-alpha':\n label = `${String.fromCharCode(65 + index - 1)}`;\n break;\n }\n if (lastLabelSuffix === 'qti-labels-suffix-period') {\n label += '.';\n } else if (lastLabelSuffix === 'qti-labels-suffix-parenthesis') {\n label += `)`;\n }\n return label;\n }\n }\n return VocabularyElement as Constructor<VocabularyInterface> & T;\n};\n","import { css } from 'lit';\n\nexport default css`\n [part='slot'] {\n display: flex;\n flex-direction: column;\n gap: var(--qti-gap-size);\n flex-wrap: wrap;\n }\n\n ::slotted(qti-simple-choice) {\n flex: 0 0\n calc((100% - (var(--qti-gap-size) * var(--choice-interactions-stacking))) / var(--choice-interactions-stacking)) !important;\n box-sizing: border-box !important;\n }\n\n :host(.qti-choices-stacking-1) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 1;\n }\n\n :host(.qti-choices-stacking-2) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 2;\n }\n :host(.qti-choices-stacking-3) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 3;\n }\n :host(.qti-choices-stacking-4) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 4;\n }\n :host(.qti-choices-stacking-5) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 5;\n }\n :host([orientation='horizontal']) [part='slot'] {\n flex-direction: row;\n }\n`;\n","import type { CSSResultGroup } from 'lit';\nimport { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ChoicesInterface, ChoicesMixin } from '../internal/choices/choices.mixin';\nimport { ShuffleMixin } from '../internal/shuffle/shuffle-mixin';\nimport { VocabularyMixin } from '../internal/vocabulary/vocabulary-mixin';\nimport styles from './qti-choice-interaction.styles';\nimport { Interaction } from '../internal/interaction/interaction';\n\nexport type Orientation = 'horizontal' | 'vertical' | undefined;\n\n/**\n * An sample element.\n *\n * @slot - default slot of the choices\n * @slot prompt - slot of the prompt\n *\n * @csspart slot - The choice elements\n * @csspart prompt - The prompt\n * @csspart message - The validation message\n *\n * @cssprop [--qti-bg-active=#ffecec] - The active background color\n * @cssprop [--qti-border-active=#f86d70] - The active border color\n * @cssprop [--qti-padding-horizontal=1px] - The option horizontal padding\n * @cssprop [--qti-padding-vertical=solid] - The option vertical padding\n * @cssprop [--qti-border-radius=8px] - The option border radius\n */\n@customElement('qti-choice-interaction')\nexport class QtiChoiceInteraction\n extends VocabularyMixin(\n ShuffleMixin(ChoicesMixin(Interaction, 'qti-simple-choice'), 'qti-simple-choice'),\n 'qti-simple-choice'\n )\n implements ChoicesInterface\n{\n static styles: CSSResultGroup = styles;\n\n constructor() {\n super();\n this._internals.role = 'group';\n }\n\n /** @deprecated, use 'qti-orientation-horizontal' or 'qti-orientation-vertical' instead */\n @property({ type: String })\n public orientation: Orientation;\n\n render() {\n return html`\n <slot part=\"prompt\" name=\"prompt\"></slot><slot part=\"slot\"></slot>\n <div part=\"message\" role=\"alert\" id=\"validationMessage\"></div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-choice-interaction': QtiChoiceInteraction;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { QtiRule, QtiRuleBase } from '..';\n\n@customElement('qti-outcome-processing')\nexport class QtiOutcomeProcessing extends LitElement {\n static styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n public process() {\n const logic = new QtiOutcomeProcessingProcessor();\n const rules = [...this.children] as QtiRule[];\n logic.process(rules);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-outcome-processing': QtiOutcomeProcessing;\n }\n}\n\nexport class QtiOutcomeProcessingProcessor {\n public process(rules: QtiRuleBase[]) {\n for (const rule of rules) {\n rule.process();\n }\n }\n}\n","export const matchCorrect = `<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n <qti-correct identifier=\"RESPONSE\"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>`;\n\nexport const mapResponse = `<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response identifier=\"RESPONSE\"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>`;\n\nexport const mapResponsePoint = `<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response-point identifier=\"RESPONSE\"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>`;\n","import { css, html, LitElement, PropertyValueMap } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { mapResponse, mapResponsePoint, matchCorrect } from '../../internal/template-strings';\nimport { type QtiRule } from '../qti-rule/qti-rule';\n\n@customElement('qti-response-processing')\nexport default class QtiResponseProcessing extends LitElement {\n static styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n public process() {\n const assessmentItem = this.closest('qti-assessment-item');\n if (!assessmentItem) return;\n const rules = [...this.children] as QtiRule[];\n for (const rule of rules) {\n rule.process();\n }\n }\n\n public firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n if (this.getAttribute('template')) {\n const splittedTemplateName = this.getAttribute('template')!.split('/');\n const templateName = splittedTemplateName[splittedTemplateName.length - 1].replace('.xml', '');\n this.innerHTML = '';\n switch (templateName) {\n case 'map_response': {\n this.appendChild(this.fragmentFromString(mapResponse).firstElementChild.firstElementChild);\n break;\n }\n case 'map_response_point': {\n this.appendChild(this.fragmentFromString(mapResponsePoint).firstElementChild.firstElementChild);\n break;\n }\n case 'match_correct':\n this.appendChild(this.fragmentFromString(matchCorrect).firstElementChild.firstElementChild);\n break;\n }\n }\n }\n\n private fragmentFromString(strHTML: string) {\n return document.createRange().createContextualFragment(strHTML);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-response-processing': QtiResponseProcessing;\n }\n}\n","import { customElement } from 'lit/decorators.js';\nimport { html, LitElement } from 'lit';\n\n@customElement('qti-rule')\nexport class QtiRule extends LitElement implements QtiRuleBase {\n override render() {\n return html`<slot></slot>`;\n }\n\n public process() {\n throw new Error('Not implemented');\n }\n}\n\nexport interface QtiRuleBase {\n process(): any;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-rule': QtiRule;\n }\n}\n","import { property } from 'lit/decorators.js';\nimport { convertNumberToUniveralFormat } from '../../../internal/utils';\nimport { QtiExpression } from '../../qti-expression/qti-expression';\nimport { QtiRule } from '../qti-rule';\nimport { OutcomeVariable } from '../../../internal/variables';\n\n/**\n * The lookupOutcomeValue rule sets the value of an outcome variable to the value obtained\n * by looking up the value of the associated expression in the lookupTable associated\n * with the outcome's declaration.\n */\nexport class QtiLookupOutcomeValue extends QtiRule {\n @property({ type: String }) identifier: string;\n\n get childExpression(): QtiExpression<string> {\n return this.firstElementChild as QtiExpression<string>;\n }\n\n public override process(): number {\n const identifier = this.getAttribute('identifier');\n const outcomeVariable = this.closest('qti-assessment-item').getVariable(identifier) as OutcomeVariable;\n let value;\n if (outcomeVariable.interpolationTable) {\n value = outcomeVariable.interpolationTable.get(parseInt(this.childExpression.calculate()));\n }\n if (value === null || value === undefined) {\n console.warn('lookupOutcomeValue: value is null or undefined');\n return 0;\n }\n this.dispatchEvent(\n new CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>('qti-set-outcome-value', {\n bubbles: true,\n composed: true,\n detail: {\n outcomeIdentifier: this.identifier,\n value: convertNumberToUniveralFormat(value)\n }\n })\n );\n return value;\n }\n}\ncustomElements.define('qti-lookup-outcome-value', QtiLookupOutcomeValue);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-lookup-outcome-value': QtiLookupOutcomeValue;\n }\n}\n","import { html } from 'lit';\nimport { QtiExpression } from '../../qti-expression/qti-expression';\nimport { QtiRule } from '../qti-rule';\n\nexport class QtiResponseCondition extends QtiRule {\n override render() {\n return html`<slot></slot>`;\n }\n\n public override process() {\n const branches = [...this.children] as QtiExpression<any>[];\n\n for (let i = 0; i < branches.length; i++) {\n const branch = branches[i];\n\n if (branch.calculate()) {\n (branch as unknown as QtiRule).process();\n\n return;\n }\n }\n }\n}\n\ncustomElements.define('qti-response-condition', QtiResponseCondition);\n","import { convertNumberToUniveralFormat } from '../../../internal/utils';\nimport { QtiExpression, QtiExpressionBase } from '../../qti-expression/qti-expression';\nimport { QtiRule, QtiRuleBase } from '../qti-rule';\n\nexport class QtiSetOutcomeValue extends QtiRule {\n public override process() {\n const outcomeIdentifier = this.getAttribute('identifier');\n\n const expression = this.firstElementChild as QtiExpression<string>;\n\n const rule = new QtiSetOutcomeValueRule(expression);\n const value = rule.process();\n this.dispatchEvent(\n new CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>('qti-set-outcome-value', {\n bubbles: true,\n composed: true,\n detail: {\n outcomeIdentifier,\n value: Array.isArray(value)\n ? value.map((v: string) => convertNumberToUniveralFormat(v))\n : convertNumberToUniveralFormat(value)\n }\n })\n );\n }\n}\n\nexport class QtiSetOutcomeValueRule<T> implements QtiRuleBase {\n constructor(private expression: QtiExpressionBase<T>) {}\n\n process(): any {\n const value = this.expression ? this.expression.calculate() : null;\n\n if (value === null || value === undefined) {\n console.warn('setOutcomeValue: value is null or undefined');\n return;\n }\n return value;\n }\n}\n\ncustomElements.define('qti-set-outcome-value', QtiSetOutcomeValue);\n","import { LitElement, html } from 'lit';\nimport { QtiRule } from '../qti-rule/qti-rule';\n\nexport class QtiResponseElse extends LitElement {\n override render() {\n return html`<slot></slot>`;\n }\n\n public calculate() {\n return true;\n }\n\n public getSubRules(): QtiRule[] {\n return [...this.children] as QtiRule[];\n }\n\n public process() {\n const subRules = this.getSubRules();\n for (let i = 0; i < subRules.length; i++) {\n const subRule = subRules[i];\n subRule.process();\n }\n }\n}\n\ncustomElements.define('qti-response-else', QtiResponseElse);\n","import { QtiExpression } from '../../qti-expression/qti-expression';\nimport { QtiRule } from '../../qti-rule/qti-rule';\nimport { QtiResponseElse } from '../qti-response-else';\n\nexport class QtiResponseIf extends QtiResponseElse {\n public override calculate() {\n const expression = this.firstElementChild as QtiExpression<boolean>;\n const result = expression.calculate() as boolean;\n return result;\n }\n\n public override getSubRules(): QtiRule[] {\n const result = [];\n for (let i = 1; i < this.children.length; i++) {\n result.push(this.children[i]);\n }\n return result;\n }\n}\n\ncustomElements.define('qti-response-if', QtiResponseIf);\n","import { html } from 'lit';\nimport { QtiResponseIf } from '../qti-response-if';\n\nexport class QtiResponseElseIf extends QtiResponseIf {\n override render() {\n return html`${super.render()}`;\n }\n}\n\ncustomElements.define('qti-response-else-if', QtiResponseElseIf);\n","import { consume } from '@lit/context';\nimport { css, html, LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { ResponseVariable, VariableDeclaration } from '../../internal/variables';\nimport { itemContext, ItemContext } from '../../qti-assessment-item/qti-assessment-item.context';\nimport { QtiMultiple } from './qti-multiple/qti-multiple';\n\nexport interface QtiExpressionBase<T> {\n // get assessmentItem(): QtiAssessmentItem;\n\n // getVariables(): VariableDeclaration<number | string | (number | string)[] | null>[];\n calculate(): Readonly<T>;\n}\n\nexport abstract class QtiExpression<T> extends LitElement implements QtiExpressionBase<T> {\n @state()\n protected result: any;\n\n // hide the slot with css\n static styles = css`\n slot {\n display: none;\n }\n `;\n\n override render() {\n return html`<pre>${JSON.stringify(this.result, null, 2)}</pre>\n <slot></slot>`;\n }\n\n public calculate(): Readonly<T> {\n this.result = this.getResult();\n return this.result;\n }\n\n protected getResult(): Readonly<T> {\n throw new Error('Not implemented');\n }\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n protected context?: ItemContext;\n\n getVariables = (): VariableDeclaration<number | string | (number | string)[] | null>[] =>\n // FIXME: if this itself is multiple, this will never enter the qti-multiple switch\n // See this example here: https://github.com/1EdTech/qti-examples/blob/master/qtiv3-examples/packaging/items/Example05-feedbackBlock-adaptive.xml\n\n Array.from(this.children)\n .map((e: Element) => {\n switch (e.tagName.toLowerCase()) {\n case 'qti-base-value': {\n return {\n baseType: e.getAttribute('base-type'),\n value: e.textContent.trim(),\n cardinality: 'single'\n } as ResponseVariable;\n }\n case 'qti-variable': {\n const identifier = e.getAttribute('identifier') || '';\n const variable = this.context.variables.find(v => v.identifier === identifier) || null;\n return variable;\n }\n case 'qti-multiple': {\n const multiple = e as QtiMultiple;\n const values = multiple.getResult();\n if (values.length > 0) {\n return {\n identifier: '',\n baseType: values[0].baseType,\n value: values.map(v => v.value),\n cardinality: 'multiple',\n type: 'response'\n } as ResponseVariable;\n }\n return null;\n }\n case 'qti-correct': {\n const identifier = e.getAttribute('identifier') || '';\n const responseVariable: ResponseVariable = this.context.variables.find(v => v.identifier === identifier) || null;\n return {\n baseType: responseVariable.baseType,\n value: responseVariable.correctResponse,\n cardinality: responseVariable.cardinality\n } as ResponseVariable;\n }\n default: {\n // added for use of qti-equal-rounded\n try {\n const expression = e as QtiExpression<number>;\n const value = expression.getResult();\n return {\n baseType: 'integer',\n value: value.toString(),\n cardinality: 'single'\n } as ResponseVariable;\n } catch (error) {\n console.warn('default not sufficient');\n }\n return null;\n }\n }\n })\n .filter(v => v !== null);\n}\n","import { QtiExpression } from './qti-expression';\n\nexport abstract class QtiConditionExpression extends QtiExpression<boolean> {\n public calculate(): Readonly<boolean> {\n this.result = this.getResult();\n return this.result;\n }\n\n public getResult(): Readonly<boolean> {\n throw new Error('Not implemented');\n }\n}\n","import { QtiConditionExpression } from '../qti-condition-expression';\nimport { QtiExpression } from '../qti-expression';\n\ntype Constructor<T> = new (...args: any[]) => T;\nexport class QtiAnd extends qtiAndMixin(QtiConditionExpression as unknown as Constructor<QtiConditionExpression>) {\n public calculate() {\n return this.calculateChildren(Array.from(this.children as unknown as QtiExpression<any>[]));\n }\n}\n\ntype MockQtiExpression<T> = { calculate: () => T };\ntype MockConstructor = new (...args: any[]) => {};\nexport function qtiAndMixin<TBase extends MockConstructor>(Base: TBase) {\n return class MockQtiAnd extends Base {\n public calculateChildren(children: Array<MockQtiExpression<any>>) {\n // children can be a mix of qti-expression and qti-condition-expression\n const values = children.map(c => {\n const condition = c as MockQtiExpression<any>;\n if (!condition.calculate) {\n console.error(\"Element doesn't implement QtiConditionExpression\");\n return null;\n }\n const value = condition.calculate();\n let val = false;\n // convert string value to boolean and return null if not possible\n if (typeof value === 'string') {\n if (value === 'true') {\n val = true;\n } else if (value === 'false') {\n val = false;\n } else {\n console.error('unexpected val in qti-or, expected boolean');\n return null;\n }\n } else {\n if (typeof value === 'boolean') {\n val = value;\n }\n }\n return val;\n });\n return values.every(e => {\n return typeof e === 'boolean' && e;\n });\n }\n };\n}\n","import { QtiAnd } from './qti-and';\ncustomElements.define('qti-and', QtiAnd);\n\nexport * from './qti-and';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-and': QtiAnd;\n }\n}\n","import { property } from 'lit/decorators.js';\nimport { BaseType } from '../../../internal/expression-result';\nimport { QtiExpression } from '../qti-expression';\nexport class QtiBaseValue extends QtiExpression<string> {\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType = 'string';\n\n public override getResult(): string {\n const value = this.textContent.trim();\n return value;\n }\n}\n\ncustomElements.define('qti-base-value', QtiBaseValue);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiConditionExpression } from '../qti-condition-expression';\n\n// PK: For the contains we assume the expressions to calculate are all directedPairs\n// I don't know it this in QTI is always the case however?\nexport class QtiContains extends QtiConditionExpression {\n public override getResult() {\n // TODO: implement this for other types than directedPair\n const values = this.getVariables() as ResponseVariable[];\n if (this.children.length === 2) {\n const value1 = values[0];\n const value2 = values[1];\n if (\n value1.baseType === 'directedPair' &&\n value2.baseType === 'directedPair' &&\n value1.cardinality === 'multiple'\n ) {\n const projection1 = value1.value as string[];\n const projection2 = value2.value as string[];\n const enumerable = projection1.filter(x => projection2.includes(x));\n\n const result = enumerable.length > 0;\n return result;\n } else if (\n value1.baseType === 'directedPair' &&\n value2.baseType === 'directedPair' &&\n value1.cardinality === 'single'\n ) {\n const projection1 = value1.value as string;\n const projection2 = value2.value as string[];\n return projection2.includes(projection1);\n } else {\n console.error(\n 'unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported'\n );\n }\n } else {\n console.error('unexpected number of children in qti contains');\n }\n return false;\n }\n}\n\ncustomElements.define('qti-contains', QtiContains);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiCorrect extends QtiExpression<string | string[]> {\n get interpretation() {\n return this.getAttribute('interpretation') || '';\n }\n\n override getResult() {\n const identifier = this.getAttribute('identifier') || '';\n const responseVariable: ResponseVariable = this.context.variables.find(v => v.identifier === identifier) || null;\n if (responseVariable.cardinality !== 'single') {\n return responseVariable.correctResponse.length > 0 ? responseVariable.correctResponse[0] : '';\n } else {\n return responseVariable.correctResponse;\n }\n }\n}\n\ncustomElements.define('qti-correct', QtiCorrect);\n","import { property } from 'lit/decorators.js';\nimport { ResponseVariable } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiEqualRounded extends QtiExpression<boolean> {\n @property({ type: String }) roundingMode: 'decimalPlaces' | 'significantFigures' = 'significantFigures';\n\n get figures() {\n const attr = this.getAttribute('figures');\n if (!attr) {\n console.error('figures attribute is missing');\n return null;\n }\n const figures = parseInt(this.getAttribute('figures') || '0');\n if (isNaN(figures)) {\n console.error('figures attribute is not a number');\n return null;\n }\n if (figures < 0) {\n console.error('figures attribute is negative');\n return null;\n }\n if (figures < 1 && this.roundingMode === 'significantFigures') {\n console.error('figures cannot be smaller than 1 for RoundingMode significantFigures');\n return null;\n }\n return figures;\n }\n\n public override getResult() {\n if (this.children.length === 2) {\n const values = this.getVariables() as ResponseVariable[];\n const value1 = values[0];\n const value2 = values[1];\n if (this.roundingMode === null) {\n return null;\n }\n if (\n value1.cardinality !== 'single' ||\n value2.cardinality !== 'single' ||\n Array.isArray(value1.value) ||\n Array.isArray(value2.value)\n ) {\n console.error('unexpected cardinality in qti equal');\n return false;\n }\n switch (values[0].baseType) {\n case 'integer':\n case 'float': {\n const float1 = parseFloat(value1.value as string);\n const float2 = parseFloat(value2.value as string);\n\n if (!isNaN(float1) && !isNaN(float2)) {\n if (this.roundingMode === 'significantFigures') {\n return float1.toPrecision(this.figures) === float2.toPrecision(this.figures);\n } else {\n return (\n Math.round(float1 * Math.pow(10, this.figures)) / Math.pow(10, this.figures) ===\n Math.round(float2 * Math.pow(10, this.figures)) / Math.pow(10, this.figures)\n );\n }\n } else {\n console.error(`value cannot be casted to numeric value in equalRounded operator: ${float1}, ${float2}`);\n }\n break;\n }\n default: {\n console.error(`values other than float and int cannot be used in equalRounded operator.`);\n break;\n }\n }\n return false;\n }\n console.error('unexpected number of children in qti-equal-rounded');\n return null;\n }\n}\n\ncustomElements.define('qti-equal-rounded', QtiEqualRounded);\n","import { BaseType } from '../..';\n\nexport class ScoringHelper {\n public static compareSingleValues(value1: Readonly<string>, value2: Readonly<string>, baseType: BaseType): boolean {\n switch (baseType) {\n case 'identifier':\n case 'string':\n return value1 === value2;\n case 'integer': {\n const int1 = parseInt(value1, 10);\n const int2 = parseInt(value2, 10);\n if (!isNaN(int1) && !isNaN(int2)) {\n return int1 === int2;\n } else {\n console.error(`Cannot convert ${value1} and/or ${value2} to int.`);\n }\n break;\n }\n case 'float': {\n const float1 = parseFloat(value1);\n const float2 = parseFloat(value2);\n if (!isNaN(float1) && !isNaN(float2)) {\n return float1 === float2;\n } else {\n console.error(`couldn't convert ${value1} and/or ${value2} to float.`);\n }\n break;\n }\n case 'pair':\n case 'directedPair': {\n const pair1 = value1.split(' ').sort();\n const pair2 = value2.split(' ').sort();\n if (pair1.length === 2 && pair2.length === 2) {\n if (baseType === 'pair') {\n pair1.sort();\n pair2.sort();\n }\n return pair1.join(' ') === pair2.join(' ');\n } else {\n console.error(`compared two pair but one of the values does not have 2 values: 1: ${value1} 2: ${value2}`);\n }\n break;\n }\n }\n\n return false;\n }\n}\n","import { property } from 'lit/decorators.js';\nimport { ResponseVariable } from '../../../internal/variables';\nimport { ScoringHelper } from '../../utilities/scoring-helper';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiEqual extends QtiExpression<boolean> {\n @property({ type: String }) toleranceMode: 'exact' | 'relative' | 'absolute' = 'exact';\n\n public override getResult() {\n if (this.children.length === 2) {\n const values = this.getVariables() as ResponseVariable[];\n const value1 = values[0];\n const value2 = values[1];\n if (this.toleranceMode !== 'exact') {\n console.error('toleranceMode is not supported yet');\n return false;\n }\n if (\n value1.cardinality !== 'single' ||\n value2.cardinality !== 'single' ||\n Array.isArray(value1.value) ||\n Array.isArray(value2.value)\n ) {\n console.error('unexpected cardinality in qti equal');\n return false;\n }\n return ScoringHelper.compareSingleValues(value1.value as string, value2.value as string, value1.baseType);\n }\n console.error('unexpected number of children in qti-equal');\n return null;\n }\n}\n\ncustomElements.define('qti-equal', QtiEqual);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiGt extends QtiExpression<boolean> {\n public override getResult(): boolean {\n if (this.children.length === 2) {\n const values = this.getVariables() as ResponseVariable[];\n const value1 = values[0];\n const value2 = values[1];\n if (\n (value1.baseType === 'integer' || value1.baseType === 'float') &&\n (value2.baseType === 'integer' || value2.baseType === 'float')\n ) {\n return +value1.value > +value2.value;\n } else {\n console.error('unexpected baseType or cardinality in qti gt');\n }\n }\n console.error('unexpected number of children in qt');\n return null;\n }\n}\n\ncustomElements.define('qti-gt', QtiGt);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiConditionExpression } from '../qti-condition-expression';\n\n// PK: For the contains we assume the expressions to calculate are all directedPairs\n// I don't know it this in QTI is always the case however?\nexport class QtiGte extends QtiConditionExpression {\n public override getResult(): boolean {\n if (this.children.length === 2) {\n const values = this.getVariables() as ResponseVariable[];\n const value1 = values[0];\n const value2 = values[1];\n if (\n (value1.baseType === 'integer' || value1.baseType === 'float') &&\n (value2.baseType === 'integer' || value2.baseType === 'float')\n ) {\n return +value1.value >= +value2.value;\n } else {\n console.error('unexpected baseType or cardinality in qti gte');\n return null;\n }\n }\n console.log('unexpected number of children in qte');\n return null;\n }\n}\n\ncustomElements.define('qti-gte', QtiGte);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\n\n// PK: For the contains we assume the expressions to calculate are all directedPairs\n// I don't know it this in QTI is always the case however?\nexport class QtiIsNull extends QtiExpression<boolean> {\n public override getResult(): boolean {\n if (this.children.length === 1) {\n const variables = this.getVariables() as ResponseVariable[];\n if (!variables) {\n return true;\n }\n const value = variables[0].value;\n return value == null || value == undefined || value === '';\n }\n console.error('unexpected number of children in qti Null');\n return null;\n }\n}\n\ncustomElements.define('qti-is-null', QtiIsNull);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiLt extends QtiExpression<boolean> {\n public override getResult(): boolean {\n if (this.children.length === 2) {\n const values = this.getVariables() as ResponseVariable[];\n const value1 = values[0];\n const value2 = values[1];\n if (\n (value1.baseType === 'integer' || value1.baseType === 'float') &&\n (value2.baseType === 'integer' || value2.baseType === 'float')\n ) {\n return +value1.value < +value2.value;\n } else {\n console.error('unexpected baseType or cardinality in qti lt');\n }\n }\n console.error('unexpected number of children in lt');\n return null;\n }\n}\n\ncustomElements.define('qti-lt', QtiLt);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiConditionExpression } from '../qti-condition-expression';\n\n// PK: For the contains we assume the expressions to calculate are all directedPairs\n// I don't know it this in QTI is always the case however?\nexport class QtiLte extends QtiConditionExpression {\n public override getResult(): boolean {\n if (this.children.length === 2) {\n const values = this.getVariables() as ResponseVariable[];\n const value1 = values[0];\n const value2 = values[1];\n if (\n (value1.baseType === 'integer' || value1.baseType === 'float') &&\n (value2.baseType === 'integer' || value2.baseType === 'float')\n ) {\n return +value1.value <= +value2.value;\n } else {\n console.error('unexpected baseType or cardinality in qti lte');\n return null;\n }\n }\n console.log('unexpected number of children in lte');\n return null;\n }\n}\n\ncustomElements.define('qti-lte', QtiLte);\n","import { property } from 'lit/decorators.js';\nimport { ScoringHelper } from '../../utilities/scoring-helper';\nimport { QtiExpression } from '../qti-expression';\nimport { ResponseVariable } from '../../../internal/variables';\n\nexport class QtiMapResponse extends QtiExpression<number> {\n @property({ type: String }) identifier: string;\n\n public override getResult(): number {\n const response: ResponseVariable = this.context.variables.find(r => r.identifier === this.identifier);\n if (!response) {\n console.warn(`Response ${this.identifier} can not be found`);\n return null;\n }\n const mapping = response.mapping;\n const candidateResponses = !Array.isArray(response.value) ? [response.value] : response.value;\n let result = 0;\n for (const candidateResponse of candidateResponses) {\n const mappedValue = mapping.mapEntries.find(entry => {\n return ScoringHelper.compareSingleValues(entry.mapKey, candidateResponse, response.baseType);\n });\n if (!(mappedValue == null || mappedValue.mappedValue == undefined)) {\n result += mappedValue.mappedValue;\n } else {\n result += mapping.defaultValue;\n }\n }\n if (mapping.lowerBound != null) {\n result = Math.max(mapping.lowerBound, result);\n }\n if (mapping.upperBound != null) {\n result = Math.min(mapping.upperBound, result);\n }\n return result;\n }\n}\n\ncustomElements.define('qti-map-response', QtiMapResponse);\n","import { property } from 'lit/decorators.js';\nimport { LitElement } from 'lit';\n\nexport class QtiMapping extends LitElement {\n @property({ attribute: 'default-value', type: Number }) defaultValue: number = 0;\n @property({ attribute: 'lower-bound', type: Number }) lowerBound: number;\n @property({ attribute: 'upper-bound', type: Number }) upperBound: number;\n\n public get mapEntries() {\n return Array.from(this.querySelectorAll('qti-map-entry')).map(el => {\n return {\n mapKey: el.getAttribute('map-key'),\n mappedValue: +el.getAttribute('mapped-value')\n };\n });\n }\n}\n\ncustomElements.define('qti-mapping', QtiMapping);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { ScoringHelper } from '../../utilities/scoring-helper';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiMatch extends QtiExpression<boolean> {\n //PK : FIXME.\n // This was a little experiment if we could call the match function as a static function,\n // This can be used for all kind of things, but now especially for use in\n // qti-response-condition-script\n // in which we pass the expressions as pure functions, and hope for the best.\n // SADLY, the getVariables throws roet in de eten.. weet nog niet precies hoe deze werkt.\n // Maar ik ga erin duiken.\n public override getResult() {\n if (this.children.length === 2) {\n const values = this.getVariables() as ResponseVariable[];\n const valueToMap = values[0];\n const correctValueInfo = values[1];\n return QtiMatch.match(valueToMap, correctValueInfo);\n }\n\n console.error('unexpected number of children in match');\n return null;\n }\n\n public static match(valueToMap: ResponseVariable, correctValueInfo: ResponseVariable) {\n switch (correctValueInfo.cardinality) {\n case 'single': {\n if (valueToMap.value === null) return false;\n if (Array.isArray(valueToMap.value) || Array.isArray(correctValueInfo.value)) {\n console.error('unexpected cardinality in qti match');\n return false;\n }\n return ScoringHelper.compareSingleValues(\n valueToMap.value?.toString(),\n correctValueInfo.value.toString(),\n correctValueInfo.baseType\n );\n }\n\n case 'ordered': {\n if (!Array.isArray(valueToMap.value) || !Array.isArray(correctValueInfo.value)) {\n console.error('unexpected cardinality in qti match');\n return false;\n }\n if (valueToMap.value.length !== correctValueInfo.value.length) {\n return false;\n }\n for (let i = 0; i < valueToMap.value.length; i++) {\n const result = ScoringHelper.compareSingleValues(\n correctValueInfo.value[i],\n valueToMap.value[i],\n correctValueInfo.baseType\n );\n if (!result) {\n return false;\n }\n }\n return true;\n }\n\n case 'multiple': {\n if (!Array.isArray(valueToMap.value) || !Array.isArray(correctValueInfo.value)) {\n console.error('unexpected cardinality in qti match');\n return false;\n }\n if (valueToMap.value.length !== correctValueInfo.value.length) {\n return false;\n }\n let answerIndex = 0;\n for (const correctAnswer of correctValueInfo.value) {\n let matchingValue: string | null = null;\n const arr = [...valueToMap.value];\n for (const mv of arr) {\n const result = ScoringHelper.compareSingleValues(correctAnswer, mv, correctValueInfo.baseType);\n if (result) {\n matchingValue = mv;\n break;\n }\n }\n if (matchingValue !== null) {\n (arr as string[]).splice(arr.indexOf(matchingValue), 1);\n } else {\n return false;\n }\n answerIndex++;\n }\n return true;\n }\n\n default:\n console.error('unexpected cardinality in qti match');\n return false;\n }\n }\n}\n\ncustomElements.define('qti-match', QtiMatch);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiMember extends QtiExpression<boolean | null> {\n public override getResult() {\n const values = this.getVariables() as ResponseVariable[];\n\n if (!(this.children.length === 2)) {\n console.warn('The member operator takes two sub-expressions');\n }\n\n const [value1, value2] = values;\n\n if (\n !(\n value1.baseType === value2.baseType ||\n (value1.baseType === 'integer' && value2.baseType === 'float') ||\n (value1.baseType === 'float' && value2.baseType === 'integer')\n )\n ) {\n console.warn('Which must both have the same base-type');\n }\n if (!(value2.cardinality === 'multiple' || value2.cardinality === 'ordered')) {\n console.warn('and the second must be a multiple or ordered container');\n }\n if (value1.baseType === 'float' || value2.baseType === 'float') {\n console.warn('The member operator should not be used on sub-expressions with a base-type of float');\n }\n if (value1.baseType === 'duration' || value2.baseType === 'duration') {\n console.warn('It must not be used on sub-expressions with a base-type of duration');\n }\n\n // If either sub-expression is NULL then the result of the operator is NULL\n if (value1.value === null || value2.value === null) {\n return null;\n }\n\n // The result is a single boolean with a value of 'true' if the value given by the first sub-expression is in the container defined by the second sub-expression.\n const projection1 = value1.value as string;\n const projection2 = value2.value as string[];\n return projection2.includes(projection1);\n }\n}\n\ncustomElements.define('qti-member', QtiMember);\n","import { ResponseVariable, VariableDeclaration } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\nexport class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {\n public override getResult(): ResponseVariable[] {\n const variables = this.getVariables() as ResponseVariable[];\n if (variables.length === 0) {\n console.error('unexpected number of children in qti multiple');\n return null;\n }\n for (const variable of variables) {\n if (variable.cardinality !== 'multiple' && variable.cardinality !== 'single') {\n console.error('unexpected cardinality in qti multiple');\n return [];\n }\n }\n\n // const values = variables.map(v => v.value);\n // console.log(variables);\n // const flattenedArray = values.reduce((acc: string[], value: string | string[]) => {\n // return acc.concat(Array.isArray(value) ? [...value] : value);\n // }, []);\n // return flattenedArray;\n\n return variables;\n }\n}\n\ncustomElements.define('qti-multiple', QtiMultiple);\n","import { html } from 'lit';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiNot extends QtiExpression<boolean> {\n override render() {\n return html`${super.render()}`;\n }\n\n public override getResult() {\n const expression = this.firstElementChild as QtiExpression<boolean>;\n const result = expression.calculate() as boolean;\n return !result;\n }\n}\n\ncustomElements.define('qti-not', QtiNot);\n","import { QtiConditionExpression } from '../qti-condition-expression';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiOr extends QtiConditionExpression {\n public override getResult() {\n // children can be a mix of qti-expression and qti-condition-expression\n const values = Array.from(this.children).map(c => {\n const condition = c as QtiExpression<any>;\n if (!condition.calculate) {\n console.error(\"Element doesn't implement QtiConditionExpression\");\n return null;\n }\n const value = condition.calculate();\n let val = false;\n // convert string value to boolean and return null if not possible\n if (typeof value === 'string') {\n if (value === 'true') {\n val = true;\n } else if (value === 'false') {\n val = false;\n } else {\n console.error('unexpected val in qti-or, expected boolean');\n return null;\n }\n } else {\n if (typeof value === 'boolean') {\n val = value;\n }\n }\n return val;\n });\n return values.some(e => {\n return typeof e === 'boolean' && e;\n });\n }\n}\n\ncustomElements.define('qti-or', QtiOr);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\nexport class QtiOrdered extends QtiExpression<ResponseVariable[]> {\n public override getResult(): ResponseVariable[] {\n const variables = this.getVariables() as ResponseVariable[];\n if (variables.length === 0) {\n console.error('unexpected number of children in qti multiple');\n return null;\n }\n for (const variable of variables) {\n if (variable.cardinality !== 'ordered' && variable.cardinality !== 'single') {\n console.error('unexpected cardinality in qti ordered');\n return [];\n }\n }\n return variables;\n }\n}\n\ncustomElements.define('qti-ordered', QtiOrdered);\n","import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport { ItemContext, itemContext } from '../../../qti-assessment-item/qti-assessment-item.context';\nimport { VariableDeclaration } from '../../../internal/variables';\n\nexport class QtiPrintedVariable extends LitElement {\n @property({ type: String })\n identifier: string;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n protected context?: ItemContext;\n\n override render() {\n const value = this.context?.variables.find(v => v.identifier === this.identifier)?.value;\n return html`${JSON.stringify(value, null, 2)}`;\n }\n\n public calculate(): VariableDeclaration<string | string[]> {\n const result = this.context.variables.find(v => v.identifier === this.identifier) || null;\n return result;\n }\n}\n\ncustomElements.define('qti-printed-variable', QtiPrintedVariable);\n","import { ResponseVariable } from '../../../internal/variables';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiProduct extends QtiExpression<number> {\n public override getResult() {\n const values = this.getVariables() as ResponseVariable[];\n const product = values.reduce((accumulator, currentValue) => {\n if (currentValue.baseType == 'float' || currentValue.baseType == 'integer') {\n try {\n return accumulator * parseInt(currentValue.value.toString());\n } catch (error) {\n console.warn(`can not convert to number`);\n }\n } else {\n console.warn(`has another baseType ${currentValue.baseType}`);\n }\n return accumulator;\n }, 1);\n return product;\n }\n}\n\ncustomElements.define('qti-product', QtiProduct);\n","import { QtiExpression } from '../qti-expression';\n\ntype Constructor<T> = new (...args: any[]) => T;\nexport class QtiSubtract extends qtiSubtractMixin(QtiExpression<any> as unknown as Constructor<QtiExpression<number>>) {\n public override getResult() {\n // children can be a mix of qti-expression and qti-condition-expression\n const value = this.calculateChildren(Array.from(this.children as unknown as QtiExpression<any>[]));\n return value;\n }\n}\n\ntype MockQtiExpression<T> = { calculate: () => T };\ntype MockConstructor = new (...args: any[]) => {};\n\nexport function qtiSubtractMixin<TBase extends MockConstructor>(Base: TBase) {\n return class MockQtiSubtract extends Base {\n public calculateChildren(children: Array<MockQtiExpression<any>>) {\n // children can be a mix of qti-expression and qti-condition-expression\n const values = children.map(expression => {\n if (!expression.calculate) {\n console.error(\"Element doesn't implement QtiConditionExpression\");\n return null;\n }\n const value = expression.calculate();\n if (Number.isNaN(value)) {\n console.error('Unexpected value in qti-subtract, expected number');\n return null;\n }\n return Number(value);\n });\n if (values.some(value => value === null)) {\n console.error('One or more child expressions returned invalid values');\n return 0;\n }\n // Subtract the two values\n return values[0] - values[1];\n }\n };\n}\n","import { QtiSubtract } from './qti-subtract';\ncustomElements.define('qti-subtract', QtiSubtract);\n\nexport * from './qti-subtract';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-subtract': QtiSubtract;\n }\n}\n","import { property } from 'lit/decorators.js';\nimport { ResponseVariable } from '../../../internal/variables';\nimport { ScoringHelper } from '../../utilities/scoring-helper';\nimport { QtiExpression } from '../qti-expression';\n\nexport class QtiStringMatch extends QtiExpression<boolean> {\n @property({ type: String, attribute: 'case-sensitive' }) caseSensitive = 'true';\n\n public override getResult() {\n if (this.children.length === 2) {\n const values = this.getVariables() as ResponseVariable[];\n const value1 = values[0];\n const value2 = values[1];\n if (\n value1.cardinality !== 'single' ||\n value2.cardinality !== 'single' ||\n Array.isArray(value1.value) ||\n Array.isArray(value2.value)\n ) {\n console.error('unexpected cardinality in qti string-match');\n return false;\n }\n const v1 = this.caseSensitive === 'true' ? value1.value : (value1.value as string).toLowerCase();\n const v2 = this.caseSensitive === 'true' ? value2.value : (value2.value as string).toLowerCase();\n return ScoringHelper.compareSingleValues(v1 as string, v2 as string, value1.baseType);\n }\n console.error('unexpected number of children in qti-string-match');\n return null;\n }\n}\n\ncustomElements.define('qti-string-match', QtiStringMatch);\n","import { QtiExpression, QtiExpressionBase } from '../qti-expression';\n\nexport class QtiSum extends QtiExpression<number> {\n private _expression: QtiSumExpression;\n constructor() {\n super();\n this._expression = new QtiSumExpression(Array.from(this.children as unknown as QtiExpressionBase<number>[]));\n }\n\n public override getResult() {\n // children can be a mix of qti-expression and qti-condition-expression\n const value = this._expression.calculate();\n return value;\n }\n}\n\nexport class QtiSumExpression implements QtiExpressionBase<number> {\n constructor(private expressions: QtiExpressionBase<number>[]) {}\n\n public calculate() {\n const values = this.expressions.map(c => {\n if (!c.calculate) {\n console.error(\"Element doesn't implement QtiConditionExpression\");\n return null;\n }\n const value = c.calculate();\n if (Number.isNaN(value)) {\n console.error('unexpected value in qti-sum, expected number');\n return null;\n }\n\n return Number(value);\n });\n return values.reduce((a, b) => a + b, 0);\n }\n}\n\ncustomElements.define('qti-sum', QtiSum);\n","import { QtiExpression } from '../qti-expression';\n\nexport class QtiVariable extends QtiExpression<string | string[]> {\n public override getResult() {\n const identifier = this.getAttribute('identifier');\n const result = this.context.variables.find(v => v.identifier === identifier).value\n return result;\n }\n}\n\ncustomElements.define('qti-variable', QtiVariable);\n","import { html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { Interaction } from '../internal/interaction/interaction';\nimport { IMSpci, ModuleResolutionConfig, QtiVariableJSON } from './interface';\n\ndeclare const requirejs: any;\ndeclare const define: any;\n\n@customElement('qti-portable-custom-interaction')\nexport class QtiPortableCustomInteraction extends Interaction {\n private intervalId: any;\n private rawResponse: string;\n\n private pci: IMSpci<unknown>;\n\n @property({ type: String, attribute: 'module' })\n module: string;\n\n @property({ type: String, attribute: 'custom-interaction-type-identifier' })\n customInteractionTypeIdentifier: string;\n\n @state()\n private _errorMessage: string = null;\n\n private convertQtiVariableJSON(input: QtiVariableJSON): string | string[] {\n for (const topLevelKey in input) {\n // eslint-disable-next-line no-prototype-builtins\n if (input.hasOwnProperty(topLevelKey)) {\n const nestedObject = input[topLevelKey as 'list' | 'base'];\n if (nestedObject) {\n for (const nestedKey in nestedObject) {\n // eslint-disable-next-line no-prototype-builtins\n if (nestedObject.hasOwnProperty(nestedKey)) {\n const value = nestedObject[nestedKey as keyof typeof nestedObject];\n if (Array.isArray(value)) {\n return value.map(String); // Convert each element in the array to string\n } else if (value !== undefined && value !== null) {\n return String(value); // Convert the single value to string\n }\n }\n }\n }\n }\n }\n return null;\n }\n\n private startChecking(): void {\n // because the pci doesn't have a method to check for changes we'll use an interval\n // to check if the response has changed. If changed we'll save the response\n this.intervalId = setInterval(() => {\n const response = this.pci.getResponse();\n const newResponse = this.pci.getResponse();\n const stringified = JSON.stringify(response);\n if (stringified !== this.rawResponse) {\n this.rawResponse = stringified;\n const value = this.convertQtiVariableJSON(newResponse);\n this.value = value;\n this.saveResponse(value);\n }\n }, 200);\n }\n\n private stopChecking(): void {\n if (this.intervalId !== undefined) {\n clearInterval(this.intervalId);\n }\n }\n\n validate(): boolean {\n return true; // FOR NOW\n }\n set value(_: string | string[]) {\n // Only set state is supported in a PCI\n }\n get value(): string | string[] {\n return this.rawResponse;\n }\n\n getTAOConfig(node) {\n const a = node.querySelectorAll('properties');\n let config = {};\n\n const getPropertyValue = el => {\n const property = {};\n const key = el.getAttribute('key');\n if (key) {\n const children = Array.from(el.children);\n const allKey = children.map((c: HTMLElement) => c.getAttribute('key'));\n const isArray = allKey.length > 0 && !allKey.find(k => !Number.isInteger(+k));\n if (isArray) {\n property[key] = children.map(c => getChildProperties(c));\n } else {\n property[key] = el.textContent;\n }\n }\n return property;\n };\n\n const getChildProperties = (el): {} | void => {\n if (el) {\n let properties = {};\n for (const child of el.children) {\n properties = { ...properties, ...getPropertyValue(child) };\n }\n return properties;\n }\n };\n\n for (const properties of a) {\n const key = properties.getAttribute('key');\n if (!key) {\n config = { ...config, ...getChildProperties(properties) };\n }\n return config;\n }\n console.log('Can not find qti-custom-interaction config');\n return null;\n }\n\n register(pci: IMSpci<unknown>) {\n this.pci = pci;\n\n const type = this.parentElement.tagName === 'QTI-CUSTOM-INTERACTION' ? 'TAO' : 'IMS';\n const dom: HTMLElement =\n type == 'IMS' ? this.querySelector('qti-interaction-markup') : this.querySelector('markup');\n dom.classList.add('qti-customInteraction');\n\n if (type == 'TAO' && this.querySelector('properties')) {\n (this.querySelector('properties') as HTMLElement).style.display = 'none';\n }\n\n const config: any =\n type == 'IMS'\n ? {\n properties: this.dataset,\n onready: () => {\n console.log('onready');\n }\n }\n : this.getTAOConfig(this);\n if (type == 'IMS') {\n pci.getInstance(dom, config, undefined);\n } else {\n (pci as any).initialize(this.customInteractionTypeIdentifier, dom.firstElementChild, config);\n }\n if (type == 'TAO') {\n const links = Array.from(this.querySelectorAll('link')).map(acc => acc.getAttribute('href'));\n links.forEach(link => {\n const styles = document.createElement('link');\n styles.rel = 'stylesheet';\n styles.type = 'text/css';\n styles.media = 'screen';\n styles.href = link;\n dom.appendChild(styles);\n });\n }\n this.startChecking();\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n define('qtiCustomInteractionContext', () => {\n return {\n register: ctxA => {\n this.register(ctxA);\n },\n notifyReady: () => {\n /* only used in the TAO version */\n }\n };\n });\n\n const config = this.buildRequireConfig();\n const requirePCI = requirejs.config(config);\n requirePCI(['require'], require => {\n // eslint-disable-next-line import/no-dynamic-require\n require([this.module]);\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n requirejs.undef(this.customInteractionTypeIdentifier);\n // Clear the modules in the context\n const context = requirejs.s.contexts;\n delete context[this.customInteractionTypeIdentifier];\n this.stopChecking();\n }\n\n buildRequireConfig() {\n // Set RequireJS paths and shim configuration if available\n const config: ModuleResolutionConfig = {\n context: this.customInteractionTypeIdentifier,\n catchError: true,\n paths: window['requirePaths'] || {},\n shim: window['requireShim'] || {}\n };\n // Check if RequireJS is available, if not, set an error message\n if (!globalThis.require) {\n this._errorMessage = `RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js`;\n return null;\n }\n const baseUrl = this.getAttribute('data-base-url');\n const interactionModules = this.querySelector('qti-interaction-modules');\n\n if (interactionModules) {\n const modules = interactionModules.querySelectorAll('qti-interaction-module');\n for (const module of modules) {\n const moduleId = module.getAttribute('id');\n const primaryPath = module.getAttribute('primary-path');\n const fallbackPath = module.getAttribute('fallback-path');\n\n if (moduleId && primaryPath) {\n // Set the paths using RequireJS's fallback array\n const paths = fallbackPath\n ? this.combineRequireResolvePaths(\n this.getResolvablePath(primaryPath, baseUrl),\n this.getResolvablePath(fallbackPath, baseUrl)\n )\n : this.getResolvablePath(primaryPath, baseUrl);\n const existingPath = config.paths[moduleId] || [];\n config.paths[moduleId] = this.combineRequireResolvePaths(existingPath, paths);\n }\n }\n }\n return config;\n }\n\n private combineRequireResolvePaths(path1: string | string[], path2: string | string[]) {\n const path1Array = Array.isArray(path1) ? path1 : [path1];\n const path2Array = Array.isArray(path2) ? path2 : [path2];\n return path1Array.concat(path2Array);\n }\n\n private removeDoubleSlashes(str: string) {\n const singleForwardSlashes = str\n .replace(/([^:]\\/)\\/+/g, '$1')\n .replace(/\\/\\//g, '/')\n .replace('http:/', 'http://')\n .replace('https:/', 'https://');\n return singleForwardSlashes;\n }\n\n loadConfig = async (url: string, baseUrl?: string): Promise<ModuleResolutionConfig> => {\n url = this.removeDoubleSlashes(url);\n try {\n const requireConfig = await fetch(url);\n if (requireConfig.ok) {\n const config = await requireConfig.json();\n const moduleCong = config as ModuleResolutionConfig;\n for (const moduleId in moduleCong.paths) {\n if (baseUrl) {\n moduleCong.paths[moduleId] = this.getResolvablePath(moduleCong.paths[moduleId], baseUrl);\n }\n }\n return moduleCong;\n }\n } catch (e) {\n // do nothing\n }\n return null;\n };\n\n getResolvablePathString = (path: string, basePath?: string) => {\n path = path.replace(/\\.js$/, '');\n return path?.toLocaleLowerCase().startsWith('http') || !basePath\n ? path\n : this.removeDoubleSlashes(`${basePath}/${path}`);\n };\n\n getResolvablePath = (path: string | string[], basePath?: string) => {\n return Array.isArray(path)\n ? path.map(p => this.getResolvablePathString(p, basePath))\n : this.getResolvablePathString(path, basePath);\n };\n\n override render() {\n return html`<slot></slot>${this._errorMessage &&\n html`<div style=\"color:red\">\n <h1>Error</h1>\n ${this._errorMessage}\n </div>`}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-portable-custom-interaction': QtiPortableCustomInteraction;\n }\n}\n","type Point = { x: number; y: number };\n\nexport class TouchDragAndDrop {\n public draggables: HTMLElement[] = [];\n public droppables: HTMLElement[] = [];\n public dragContainers: HTMLElement[] = [];\n\n private touchStartPoint = null; // Point of the first touch\n private isDraggable = false; // Whether a draggable element is active\n private dragSource: HTMLElement = null; // The source element being dragged\n private dragClone: HTMLElement = null; // Clone of drag source for visual feedback\n private touchEndTriggered = false; // Flag for touchEnd event\n private isDragging = false; // Whether a drag operation is ongoing\n private initialTransform = ''; // Original transform style\n private hasDispatchedDragStart = false; // Flag to ensure dragstart event is dispatched once\n private rootNode: Node = null; // Root node for boundary calculations\n private allDropzones: HTMLElement[] = []; // All dropzones for keyboard navigation\n\n private dataTransfer = {\n data: {},\n setData(type, val) {\n this.data[type] = val;\n },\n getData(type) {\n return this.data[type];\n },\n effectAllowed: 'move'\n };\n private cloneOffset = { x: 0, y: 0 }; // Offset for positioning the drag clone\n\n private lastTarget = null; // Last touch target\n private currentDropTarget = null; // Current droppable element\n private static instance: TouchDragAndDrop;\n\n copyStylesForDragClone = true;\n dragOnClickEnabled = false;\n useDragClone = false; // Set to true to drag with a clone; set to false to drag the original element\n\n private readonly MIN_DRAG_DISTANCE = 5; // Minimum pixel movement to start dragging\n private readonly DRAG_CLONE_OPACITY = 1; // Opacity of the drag clone element\n initialTransition: string;\n // droppables: Element[];\n\n constructor() {\n if (TouchDragAndDrop.instance) {\n return TouchDragAndDrop.instance;\n }\n TouchDragAndDrop.instance = this;\n\n // Add event listeners for touch and mouse interactions\n document.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: false });\n document.addEventListener('mousemove', this.handleTouchMove.bind(this), { passive: false });\n document.addEventListener('touchend', this.handleTouchEnd.bind(this), { passive: false });\n document.addEventListener('mouseup', this.handleTouchEnd.bind(this), { passive: false });\n document.addEventListener('touchcancel', this.handleTouchCancel.bind(this), { passive: false });\n }\n\n dragContainersModified(addedDragContainers: HTMLElement[], removedDragContainers: HTMLElement[]) {\n for (const removedContainer of removedDragContainers) {\n if (this.dragContainers.includes(removedContainer)) {\n this.dragContainers = this.dragContainers.filter(container => container !== removedContainer);\n this.allDropzones = this.allDropzones.filter(dropzone => dropzone !== removedContainer);\n }\n }\n for (const dragContainer of addedDragContainers) {\n if (!this.dragContainers.includes(dragContainer)) {\n this.dragContainers.push(dragContainer);\n this.allDropzones.push(dragContainer);\n }\n }\n }\n\n draggablesModified(addedDraggables: HTMLElement[], removedDraggables: HTMLElement[]) {\n for (const removedDraggable of removedDraggables) {\n if (this.draggables.includes(removedDraggable)) {\n this.draggables = this.draggables.filter(draggable => draggable !== removedDraggable);\n removedDraggable.removeAttribute('tabindex');\n removedDraggable.removeEventListener('touchstart', this.handleTouchStart.bind(this));\n removedDraggable.removeEventListener('mousedown', this.handleTouchStart.bind(this));\n }\n }\n for (const draggable of addedDraggables) {\n if (!this.draggables.includes(draggable)) {\n this.draggables.push(draggable);\n // draggables.forEach(el => {\n draggable.setAttribute('tabindex', '0'); // Make draggable elements focusable\n // el.addEventListener('focus', () => (this.focusedElement = el as HTMLElement));\n // el.addEventListener('blur', () => (this.focusedElement = null));\n\n draggable.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: false });\n draggable.addEventListener('mousedown', this.handleTouchStart.bind(this), { passive: false });\n // });\n }\n }\n }\n\n droppablesModified(addedDroppables: HTMLElement[], removedDroppables: HTMLElement[]) {\n for (const removedDroppable of removedDroppables) {\n if (this.droppables.includes(removedDroppable)) {\n this.droppables = this.droppables.filter(droppable => droppable !== removedDroppable);\n this.allDropzones = this.allDropzones.filter(dropzone => dropzone !== removedDroppable);\n }\n }\n for (const droppable of addedDroppables) {\n if (!this.droppables.includes(droppable)) {\n this.droppables.push(droppable);\n this.allDropzones.push(droppable);\n }\n }\n }\n\n private handleTouchStart(e) {\n const { x, y } = this.getEventCoordinates(e);\n this.touchStartPoint = { x, y };\n this.dragSource = e.currentTarget;\n this.isDraggable = true;\n\n // Get the root node\n this.rootNode = this.dragSource.getRootNode();\n\n if (this.dragOnClickEnabled) {\n this.isDragging = true;\n this.createDragClone(e, { clientX: x, clientY: y });\n }\n\n if (!this.useDragClone) {\n // Save initial transform\n const computedStyle = window.getComputedStyle(this.dragSource);\n this.initialTransform = computedStyle.transform === 'none' ? '' : computedStyle.transform;\n\n // Save the original transition style\n this.initialTransition = computedStyle.transition || '';\n\n // Disable transitions\n this.dragSource.style.transition = 'none';\n\n // Calculate clone offset\n const rect = this.dragSource.getBoundingClientRect();\n this.cloneOffset.x = x - rect.left;\n this.cloneOffset.y = y - rect.top;\n\n // Set higher z-index to bring it on top\n this.dragSource.style.zIndex = '9999';\n // this.dragSource.style.pointerEvents = 'none'; // So it doesn't block events\n this.dragSource.focus();\n }\n\n e.preventDefault();\n }\n\n private handleTouchMove(e) {\n if (this.isDraggable && this.dragSource) {\n const { x, y } = this.getEventCoordinates(e);\n const currentTouch = { clientX: x, clientY: y };\n\n if (this.calculateDragDistance(currentTouch) >= this.MIN_DRAG_DISTANCE) {\n this.dragSource.style.pointerEvents = 'none'; // So it doesn't block events\n this.isDragging = true;\n }\n\n this.createDragClone(e, currentTouch);\n e.preventDefault();\n\n // Determine the closest dropzone using the closest corners algorithm\n const closestDropzone = this.findClosestDropzone();\n this.currentDropTarget = closestDropzone;\n if (closestDropzone !== this.lastTarget) {\n if (this.lastTarget) {\n this.dispatchCustomEvent(this.lastTarget, 'dragleave');\n }\n if (closestDropzone) {\n this.dispatchCustomEvent(closestDropzone, 'dragenter');\n }\n this.lastTarget = closestDropzone;\n }\n\n if (this.lastTarget) {\n this.dispatchCustomEvent(this.lastTarget, 'dragover');\n }\n }\n }\n\n private createDragClone(_e, currentTouch: { clientX: number; clientY: number }) {\n if (!this.isDragging) return;\n\n if (this.useDragClone) {\n // Existing code for creating and handling the drag clone\n if (!this.dragClone) {\n this.dragSource.style.opacity = this.DRAG_CLONE_OPACITY.toString();\n this.dragClone = this.dragSource.cloneNode(true) as HTMLElement;\n\n if (this.copyStylesForDragClone) {\n const computedStyles = window.getComputedStyle(this.dragSource);\n for (const style of computedStyles) {\n this.dragClone.style[style] = computedStyles.getPropertyValue(style);\n }\n }\n\n // Move the drag clone to the root node\n if (this.rootNode instanceof ShadowRoot) {\n // Append to the host of the shadow root\n this.rootNode.host.appendChild(this.dragClone);\n } else if (this.rootNode instanceof Document) {\n document.body.appendChild(this.dragClone);\n }\n\n this.calculateClonePosition(currentTouch);\n this.setDragCloneStyles(currentTouch);\n this.dispatchCustomEvent(this.dragSource, 'dragstart');\n }\n\n this.updateDragClonePosition(currentTouch);\n } else {\n // Handle dragging the original element using CSS transforms\n if (this.touchStartPoint) {\n const deltaX = currentTouch.clientX - this.touchStartPoint.x;\n const deltaY = currentTouch.clientY - this.touchStartPoint.y;\n\n // Apply boundaries\n // const { boundedDeltaX, boundedDeltaY } = this.applyTransformBoundaries(deltaX, deltaY);\n // this.dragSource.style.transform = `${this.initialTransform} translate(${boundedDeltaX}px, ${boundedDeltaY}px)`;\n\n this.dragSource.style.transform = `${this.initialTransform} translate(${deltaX}px, ${deltaY}px)`;\n\n if (!this.hasDispatchedDragStart) {\n this.dispatchCustomEvent(this.dragSource, 'dragstart');\n this.hasDispatchedDragStart = true;\n }\n }\n }\n\n const dropTarget = this.currentDropTarget;\n\n if (dropTarget !== this.lastTarget) {\n this.dispatchCustomEvent(dropTarget, 'dragenter');\n this.dispatchCustomEvent(this.lastTarget, 'dragleave');\n this.lastTarget = dropTarget;\n }\n\n this.currentDropTarget = dropTarget;\n if (this.currentDropTarget) this.dispatchCustomEvent(dropTarget, 'dragover');\n }\n\n private handleTouchEnd(_e) {\n // this.allDropzones = [];\n this.touchEndTriggered = true;\n this.isDraggable = false;\n let dropFound = false;\n\n // console.log('dropFound', dropFound);\n if (this.currentDropTarget) {\n this.dispatchCustomEvent(this.currentDropTarget, 'drop');\n this.dispatchCustomEvent(this.dragSource, 'dragend');\n dropFound = true;\n } else if (this.isDragging) {\n const dragEndEvent = new CustomEvent('dragend', { bubbles: true, cancelable: true });\n dragEndEvent['dataTransfer'] = { dropEffect: 'none' };\n this.dragSource?.dispatchEvent(dragEndEvent);\n }\n\n this.resetDragState(dropFound);\n }\n\n private handleTouchCancel(_e) {\n this.resetDragState();\n }\n\n private findClosestDropzone(): HTMLElement | null {\n if (!this.dragSource || this.allDropzones.length === 0) return null;\n\n const dragCenter = this.getCenter(this.dragSource.getBoundingClientRect());\n\n let closestDropzone: HTMLElement | null = null;\n let minDistance = Infinity;\n\n for (const dropzone of this.allDropzones) {\n const dropCenter = this.getCenter(dropzone.getBoundingClientRect());\n const distance = this.calculateDistance(dragCenter, dropCenter);\n\n if (distance < minDistance) {\n minDistance = distance;\n closestDropzone = dropzone;\n }\n }\n return closestDropzone;\n }\n\n private getCenter(rect: DOMRect): Point {\n return {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2\n };\n }\n\n private calculateDistance(pointA: Point, pointB: Point): number {\n const dx = pointA.x - pointB.x;\n const dy = pointA.y - pointB.y;\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n private getEventCoordinates(event, page = false) {\n const touch = event.touches ? event.touches[0] : event;\n return {\n x: page ? touch.pageX : touch.clientX,\n y: page ? touch.pageY : touch.clientY\n };\n }\n\n private calculateClonePosition(touch) {\n const rect = this.dragSource.getBoundingClientRect();\n this.cloneOffset.x = touch.clientX - rect.left;\n this.cloneOffset.y = touch.clientY - rect.top;\n }\n\n private setDragCloneStyles(touch) {\n this.dragClone.style.position = 'fixed';\n this.dragClone.style.top = `${touch.clientY - this.cloneOffset.y}px`;\n this.dragClone.style.left = `${touch.clientX - this.cloneOffset.x}px`;\n this.dragClone.style.pointerEvents = 'none';\n this.dragClone.style.zIndex = '999999';\n }\n\n private updateDragClonePosition(touch) {\n requestAnimationFrame(() => {\n if (this.touchEndTriggered || !this.dragClone) return;\n\n const newLeft = touch.clientX - this.cloneOffset.x;\n const newTop = touch.clientY - this.cloneOffset.y;\n\n // Apply boundaries\n const { newLeft: boundedLeft, newTop: boundedTop } = this.applyBoundaries(newLeft, newTop, this.dragClone);\n\n this.dragClone.style.left = `${boundedLeft}px`;\n this.dragClone.style.top = `${boundedTop}px`;\n });\n }\n\n private applyBoundaries(newLeft: number, newTop: number, element: HTMLElement) {\n // Get the boundaries of the root node\n let boundaryRect: DOMRect;\n if (this.rootNode instanceof ShadowRoot) {\n boundaryRect = this.rootNode.host.getBoundingClientRect();\n } else if (this.rootNode instanceof Document) {\n boundaryRect = document.documentElement.getBoundingClientRect();\n } else {\n // Default to viewport\n boundaryRect = new DOMRect(0, 0, window.innerWidth, window.innerHeight);\n }\n\n // Get the dimensions of the element\n const elementRect = element.getBoundingClientRect();\n const elementWidth = elementRect.width;\n const elementHeight = elementRect.height;\n\n // Limit the newLeft and newTop within the boundaries\n const boundedLeft = Math.max(boundaryRect.left, Math.min(newLeft, boundaryRect.right - elementWidth));\n const boundedTop = Math.max(boundaryRect.top, Math.min(newTop, boundaryRect.bottom - elementHeight));\n\n return { newLeft: boundedLeft, newTop: boundedTop };\n }\n\n private calculateDragDistance(touch): number {\n const xDist = Math.abs(touch.clientX - this.touchStartPoint.x);\n const yDist = Math.abs(touch.clientY - this.touchStartPoint.y);\n return xDist + yDist;\n }\n\n private dispatchCustomEvent(element, eventType, bubble = true) {\n if (!element) return;\n const event = new CustomEvent(eventType, { bubbles: bubble, cancelable: true });\n event['dataTransfer'] = this.dataTransfer;\n element.dispatchEvent(event);\n }\n\n private resetDragState(dropFound: boolean = false) {\n if (this.isDragging) {\n if (this.useDragClone) {\n this.dragSource.style.opacity = '1.0';\n this.dragClone?.parentElement.removeChild(this.dragClone);\n } else {\n // Restore original styles\n if (!dropFound) this.dragSource.style.transform = 'translate(0, 0)';\n this.dragSource.style.zIndex = '';\n this.dragSource.style.pointerEvents = '';\n // Restore the original transition style\n this.dragSource.style.transition = this.initialTransition;\n\n // Reset the original transition property\n this.initialTransition = '';\n }\n }\n\n this.isDragging = false;\n this.dragSource = null;\n this.dragClone = null;\n this.isDraggable = false;\n this.touchStartPoint = null;\n this.touchEndTriggered = false;\n this.dataTransfer = {\n data: {},\n setData(type, val) {\n this.data[type] = val;\n },\n getData(type) {\n return this.data[type];\n },\n effectAllowed: 'move'\n };\n this.cloneOffset = { x: 0, y: 0 };\n this.lastTarget = null;\n this.currentDropTarget = null;\n this.initialTransform = '';\n this.hasDispatchedDragStart = false;\n\n this.rootNode = null;\n }\n}\n","import { property } from 'lit/decorators.js';\nimport { Interaction } from '../interaction/interaction';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class DroppablesInterface {}\n\nexport const DroppablesMixin = <T extends Constructor<Interaction>>(superClass: T, droppablesSelector: string) => {\n abstract class DroppablesElement extends superClass {\n private observer: MutationObserver;\n\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n override firstUpdated(changedProps): void {\n if (this.isMatchTabular()) return;\n super.firstUpdated(changedProps);\n\n const droppables = this.getDroppableElements();\n this.initializeEventHandlers();\n droppables.forEach(droppable => {\n this.prepareDroppable(droppable);\n this.observeDroppableAttributes(droppable);\n });\n }\n\n private isMatchTabular(): boolean {\n return this.classList.contains('qti-match-tabular');\n }\n\n private getDroppableElements(): Element[] {\n return Array.from(this.shadowRoot?.querySelectorAll(droppablesSelector) || []).concat(\n Array.from(this.querySelectorAll(droppablesSelector) || [])\n );\n }\n\n private initializeEventHandlers(): void {\n this.dragoverHandler = this.dragoverHandler.bind(this);\n this.dragleaveHandler = this.dragleaveHandler.bind(this);\n this.dragenterHandler = this.dragenterHandler.bind(this);\n this.dropHandler = this.dropHandler.bind(this);\n }\n\n private prepareDroppable(droppable: Element): void {\n droppable.addEventListener('dragleave', this.dragleaveHandler);\n this.attachEventListeners(droppable);\n }\n\n private observeDroppableAttributes(droppable: Element): void {\n this.observer = new MutationObserver(mutations => {\n mutations.forEach(({ attributeName }) => {\n if (attributeName === 'disabled') {\n this.toggleDroppableHandlers(droppable);\n }\n });\n });\n this.observer.observe(droppable, { attributes: true });\n }\n\n private toggleDroppableHandlers(droppable: Element): void {\n const disabled = droppable.hasAttribute('disabled');\n if (disabled) {\n this.removeEventListeners(droppable);\n } else {\n this.attachEventListeners(droppable);\n }\n }\n\n private attachEventListeners(droppable: Element): void {\n droppable.addEventListener('dragover', this.dragoverHandler);\n droppable.addEventListener('dragenter', this.dragenterHandler);\n droppable.addEventListener('drop', this.dropHandler);\n }\n\n private removeEventListeners(droppable: Element): void {\n droppable.removeEventListener('dragover', this.dragoverHandler);\n droppable.removeEventListener('dragenter', this.dragenterHandler);\n droppable.removeEventListener('drop', this.dropHandler);\n }\n\n override disconnectedCallback(): void {\n if (this.isMatchTabular()) return;\n super.disconnectedCallback();\n this.observer?.disconnect();\n }\n\n private dragenterHandler(ev: DragEvent): void {\n ev.preventDefault();\n }\n\n private dragoverHandler(ev: DragEvent): boolean {\n // const responseIdentifierDraggable = ev.dataTransfer.getData('responseIdentifier');\n ev.preventDefault();\n // if (responseIdentifierDraggable === this.responseIdentifier) {\n this.activateDroppable(ev.currentTarget as HTMLElement);\n ev.dataTransfer.dropEffect = 'move';\n // }\n return false;\n }\n\n private activateDroppable(droppable: HTMLElement): void {\n this._internals.states.delete('--dragzone-active');\n droppable.setAttribute('active', '');\n }\n\n private async dropHandler(ev: DragEvent): Promise<boolean> {\n ev.preventDefault();\n const droppable = ev.currentTarget as HTMLElement;\n const identifier = ev.dataTransfer.getData('text');\n const responseIdentifierDraggable = ev.dataTransfer.getData('responseIdentifier');\n const draggable = this.findDraggable(responseIdentifierDraggable, identifier);\n\n if (!draggable) return false;\n if (draggable && !this.isValidDrop(droppable, draggable, responseIdentifierDraggable)) {\n draggable.style.transform = 'translate(0, 0)';\n return false;\n }\n await this.moveDraggableToDroppable(draggable, droppable);\n this.deactivateDroppable(droppable, false);\n return false;\n }\n\n private findDraggable(responseIdentifier: string, identifier: string): HTMLElement | null {\n if (!identifier) return null;\n // if (responseIdentifier === this.responseIdentifier) {\n return (\n this.querySelector(`[identifier=${identifier}]`) || this.shadowRoot.querySelector(`[identifier=${identifier}]`)\n );\n // }\n }\n\n private isValidDrop(\n _droppable: HTMLElement,\n _draggable: HTMLElement,\n responseIdentifierDraggable: string\n ): boolean {\n // debugger;\n return true;\n // this.responseIdentifier === responseIdentifierDraggable\n // && draggable.parentElement.getAttribute('identifier') !== droppable.getAttribute('identifier')\n }\n\n private async moveDraggableToDroppable(draggable: HTMLElement, droppable: HTMLElement): Promise<void> {\n console.log(`moveDraggableToDroppable, draggable: ${draggable.tagName}, droppable: ${droppable.tagName}`);\n const moveElement = (): void => {\n draggable.style.transform = 'translate(0, 0)';\n if (droppable.tagName === 'SLOT') {\n draggable.setAttribute('slot', droppable.getAttribute('name'));\n } else {\n droppable.appendChild(draggable);\n }\n\n // checkMaxAssociations and saveResponse are defined/overridden in a mixin\n this['checkMaxAssociations']();\n this['saveResponse'](null); //\n };\n\n if (!document.startViewTransition) {\n moveElement();\n return;\n }\n\n const transition = document.startViewTransition(moveElement);\n await transition.finished;\n\n // this['checkMaxAssociations']();\n }\n\n private deactivateDroppable(droppable: HTMLElement, makeDragzoneActive = true): void {\n if (makeDragzoneActive) {\n this._internals.states.add('--dragzone-active');\n }\n droppable.removeAttribute('active');\n }\n\n private dragleaveHandler(ev: DragEvent): boolean {\n ev.preventDefault();\n this.deactivateDroppable(ev.currentTarget as HTMLElement);\n ev.dataTransfer.dropEffect = 'none';\n return false;\n }\n }\n return DroppablesElement as Constructor<DroppablesInterface> & T;\n};\n","// THIS IS A MIXIN, THIS IS A MIXIN\n// USE LIKE THIS\n// ```class DropList extends Flippables(LitElement) {```\n// mixin which animates children with FLIP\n// a combination between this directive:\n// https://ng-run.com/edit/9MGr5dYWA20AiJtpy5az?open=app%2Fapp.component.html\n// and a tutorial how to make a mixin\n// https://lit.dev/docs/composition/mixins/\n\nimport { Interaction } from '../interaction/interaction';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\nexport declare class FlippablesInterface {\n connectedCallback(): void;\n disconnectedCallback(): void;\n}\n\n// just a conversion of a angular FLIP directive, made as a Mixin\n// https://ng-run.com/edit/9MGr5dYWA20AiJtpy5az?open=app%2Fapp.component.html\nexport const FlippablesMixin = <T extends Constructor<Interaction>>(\n superClass: T,\n _droppablesSel: string,\n _draggablesSel: string\n) => {\n abstract class FlippablesElement extends superClass {\n // private state = new Map<Element, any>();\n // private observer: MutationObserver;\n // flippablesSelector: string;\n // override async firstUpdated(changedProps) {\n // await this.updateComplete; // pk: this is the key to calculate correct proportions\n // const draggables = Array.from(this.querySelectorAll(draggablesSel));\n // draggables.forEach((elem) => {\n // const { left, top, width, height } = elem.getBoundingClientRect();\n // this.state.set(elem, { left, top, width, height });\n // });\n // this.observer = new MutationObserver(this.animateMe);\n // const droppables = Array.from(this.querySelectorAll(droppablesSel));\n // droppables.forEach((draggable) => {\n // this.observer.observe(draggable, { childList: true });\n // });\n // this.observer.observe(this, { childList: true });\n // super.firstUpdated(changedProps);\n // }\n // private animateMe = () => {\n // this.state.forEach((value, elem) => {\n // const { left, top, width, height } = elem.getBoundingClientRect();\n // if (this.state.get(elem) == null) {\n // this.state.set(elem, { left, top, width, height });\n // }\n // const cache = this.state.get(elem);\n // const deltaX = cache.left - left;\n // const deltaY = cache.top - top;\n // const deltaW = cache.width / width;\n // const deltaH = cache.height / height;\n // this.state.set(elem, { left, top, width, height });\n // const { duration, easing } = { duration: 350, easing: 'cubic-bezier(0.26, 0.86, 0.44, 0.985)' };\n // elem.animate(\n // [\n // {\n // transformOrigin: 'top left',\n // transform: `\n // translate(${deltaX}px, ${deltaY}px)\n // scale(${deltaW}, ${deltaH})\n // `,\n // // width: cache.width,\n // // height: cache.height+ 'px',\n // // opacity: cache.opacity,\n // },\n // {\n // transformOrigin: 'top left',\n // transform: 'none',\n // },\n // ],\n // {\n // duration,\n // easing,\n // }\n // );\n // });\n // };\n // override disconnectedCallback(): void {\n // super.disconnectedCallback();\n // this.observer.disconnect();\n // }\n }\n return FlippablesElement as Constructor<FlippablesInterface> & T;\n};\n","import { IInteraction } from '../interaction/interaction.interface';\nimport { DroppablesMixin } from './droppables-mixin';\nimport { FlippablesMixin } from './flippables-mixin';\n\nimport { property } from 'lit/decorators.js';\nimport { liveQuery } from '../../../../decorators/live-query';\nimport { TouchDragAndDrop } from './drag-drop-api';\nimport { Interaction } from '../interaction/interaction';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ninterface InteractionConfiguration {\n copyStylesDragClone: boolean;\n dragCanBePlacedBack: boolean;\n dragOnClick: boolean;\n}\n\nexport const DragDropInteractionMixin = <T extends Constructor<Interaction>>(\n superClass: T,\n draggablesSelector: string,\n droppablesSelector: string,\n dragContainersSelector: string\n) => {\n abstract class DragDropInteractionElement extends FlippablesMixin(\n DroppablesMixin(superClass, droppablesSelector),\n droppablesSelector,\n draggablesSelector\n ) {\n protected draggables = new Map<HTMLElement, { parent: HTMLElement; index: number }>();\n private observer: MutationObserver | null = null;\n private resizeObserver: ResizeObserver | null = null;\n private dragDropApi: TouchDragAndDrop;\n\n @property({ attribute: false, type: Object }) protected configuration: InteractionConfiguration = {\n copyStylesDragClone: true,\n dragCanBePlacedBack: true,\n dragOnClick: false\n };\n @property({ type: Number, reflect: true, attribute: 'min-associations' }) minAssociations = 1;\n @property({ type: Number, reflect: true, attribute: 'max-associations' }) maxAssociations = 1;\n\n @liveQuery(dragContainersSelector)\n handleDraggableContainerChange(dragContainersAdded: HTMLElement[], dragContainersRemoved: HTMLElement[]) {\n if (this.isMatchTabular()) return;\n if (dragContainersAdded.length > 0 || dragContainersRemoved.length > 0) {\n this.dragContainersModified(dragContainersAdded || [], dragContainersRemoved || []);\n }\n }\n\n @liveQuery(draggablesSelector)\n handleDraggablesChange(dragsAdded: HTMLElement[], dragsRemoved: HTMLElement[]) {\n if (this.isMatchTabular()) return;\n if (dragsAdded.length > 0 || dragsRemoved.length > 0) {\n this.draggablesModified(dragsAdded || [], dragsRemoved || []);\n }\n }\n\n @liveQuery(droppablesSelector)\n handleDroppablesChange(dropsAdded: HTMLElement[], dropsRemoved: HTMLElement[]) {\n if (this.isMatchTabular()) return;\n if (dropsAdded.length > 0 || dropsRemoved.length > 0) {\n this.droppablesModified(dropsAdded || [], dropsRemoved || []);\n }\n }\n\n override firstUpdated(changedProps): void {\n super.firstUpdated(changedProps);\n const draggables = Array.from(this.querySelectorAll(draggablesSelector) || []).concat(\n Array.from(this.shadowRoot?.querySelectorAll(draggablesSelector) || [])\n ) as HTMLElement[];\n const droppables = Array.from(this.querySelectorAll(droppablesSelector) || []).concat(\n Array.from(this.shadowRoot?.querySelectorAll(droppablesSelector) || [])\n ) as HTMLElement[];\n const dragContainers = Array.from(this.querySelectorAll(dragContainersSelector) || []).concat(\n Array.from(this.shadowRoot?.querySelectorAll(dragContainersSelector) || [])\n ) as HTMLElement[];\n this.dragContainersModified(dragContainers, []);\n this.droppablesModified(droppables, []);\n this.draggablesModified(draggables, []);\n\n this.updateMinDimensionsForDropZones();\n\n // MutationObserver to observe changes in child elements\n this.observer = new MutationObserver(() => this.updateMinDimensionsForDropZones());\n this.observer.observe(this, { childList: true, subtree: true });\n\n // ResizeObserver to monitor size changes of `gapTexts`\n this.resizeObserver = new ResizeObserver(() => this.updateMinDimensionsForDropZones());\n const gapTexts = this.querySelectorAll('qti-gap-text');\n gapTexts.forEach(gapText => this.resizeObserver?.observe(gapText));\n }\n\n private dragContainersModified = (dragContainersAdded: HTMLElement[], dragContainersRemoved: HTMLElement[]) => {\n this.dragDropApi.dragContainersModified(dragContainersAdded, dragContainersRemoved);\n };\n\n private draggablesModified = (dragsAdded: HTMLElement[], dragsRemoved: HTMLElement[]) => {\n this.dragDropApi.draggablesModified(dragsAdded, dragsRemoved);\n this.dragDropApi.draggables.forEach(draggable => {\n this.storeDraggable(draggable);\n });\n };\n\n private droppablesModified = (dropsAdded: HTMLElement[], dropsRemoved: HTMLElement[]) => {\n this.dragDropApi.droppablesModified(dropsAdded, dropsRemoved);\n for (const droppable of this.dragDropApi.droppables) {\n if (this.dataset.choicesContainerWidth) {\n droppable.style.width = `${this.dataset.choicesContainerWidth}px`;\n droppable.style.boxSizing = `border-box`;\n }\n }\n };\n\n override connectedCallback() {\n super.connectedCallback();\n this.initializeDragDropApi();\n }\n\n private initializeDragDropApi() {\n this.dragDropApi = new TouchDragAndDrop();\n this.dispatchEvent(\n new CustomEvent<DragDropInteractionElement>('qti-register-interaction', {\n bubbles: true,\n composed: true,\n detail: this\n })\n );\n }\n\n private isMatchTabular(): boolean {\n return this.classList.contains('qti-match-tabular');\n }\n\n private storeDraggable(draggable: HTMLElement): void {\n const index = Array.from(draggable.parentNode.children).indexOf(draggable);\n if (!this.draggables.has(draggable)) {\n this.draggables.set(draggable, {\n parent: draggable.parentElement,\n index\n });\n }\n draggable.style.viewTransitionName = `drag-${index}-${this.getAttribute('identifier') || crypto.randomUUID()}`;\n draggable.setAttribute('qti-draggable', 'true');\n draggable.addEventListener('dragstart', this.handleDragStart);\n draggable.addEventListener('dragend', this.handleDragEnd);\n }\n\n private handleDragStart = (ev: DragEvent) => {\n const target = ev.currentTarget as HTMLElement;\n ev.dataTransfer.setData('text', target.getAttribute('identifier'));\n if (this.responseIdentifier) {\n ev.dataTransfer.setData('responseIdentifier', this.responseIdentifier);\n }\n this._internals.states.add('--dragzone-enabled');\n this._internals.states.add('--dragzone-active');\n target.setAttribute('dragging', '');\n this.activateDragLocation();\n this.activateDroppables(target);\n };\n\n private handleDragEnd = async (ev: DragEvent) => {\n ev.preventDefault();\n const draggable = ev.currentTarget as HTMLElement;\n this._internals.states.delete('--dragzone-enabled');\n this._internals.states.delete('--dragzone-active');\n this.deactivateDragLocation();\n this.deactivateDroppables();\n\n draggable.removeAttribute('dragging');\n const wasDropped = await this.wasDropped(ev);\n if (!wasDropped) {\n if (this.configuration.dragCanBePlacedBack) {\n this.restoreInitialDraggablePosition(draggable);\n }\n }\n };\n\n private updateMinDimensionsForDropZones() {\n const gapTexts = this.querySelectorAll(draggablesSelector);\n const gaps = Array.from(this.querySelectorAll(droppablesSelector)).map(d => d as HTMLElement);\n let maxHeight = 0;\n let maxWidth = 0;\n gapTexts.forEach(gapText => {\n const rect = gapText.getBoundingClientRect();\n maxHeight = Math.max(maxHeight, rect.height);\n maxWidth = Math.max(maxWidth, rect.width);\n });\n\n const dragContainer =\n (this.querySelector(dragContainersSelector) as HTMLElement) ||\n (this.shadowRoot?.querySelector(dragContainersSelector) as HTMLElement);\n\n if (dragContainer) {\n dragContainer.style.minHeight = `${maxHeight}px`;\n dragContainer.style.minWidth = `${maxWidth}px`;\n }\n for (const gap of gaps) {\n gap.style.minHeight = `${maxHeight}px`;\n gap.style.minWidth = `${maxWidth}px`;\n }\n }\n\n private activateDroppables(target: HTMLElement): void {\n const dragContainers = this.dragDropApi.dragContainers;\n dragContainers.forEach(d => {\n d.setAttribute('enabled', '');\n if (d.hasAttribute('disabled')) {\n if (d.contains(target) || (d.shadowRoot && d.shadowRoot.contains(target))) {\n d.removeAttribute('disabled');\n }\n }\n });\n this.dragDropApi.droppables.forEach(d => {\n d.setAttribute('enabled', '');\n if (d.hasAttribute('disabled')) {\n if (d.contains(target) || (d.shadowRoot && d.shadowRoot.contains(target))) {\n d.removeAttribute('disabled');\n }\n }\n });\n }\n\n private activateDragLocation(): void {\n this._internals.states.add('--dragzone-enabled');\n }\n\n private deactivateDragLocation(): void {\n this._internals.states.delete('--dragzone-enabled');\n }\n\n private deactivateDroppables(): void {\n const dragContainers = this.dragDropApi.dragContainers;\n dragContainers.forEach(d => {\n d.removeAttribute('enabled');\n });\n this.dragDropApi.droppables.forEach(d => d.removeAttribute('enabled'));\n }\n\n private wasDropped(ev: DragEvent) {\n return ev.dataTransfer.dropEffect && ev.dataTransfer.dropEffect !== 'none';\n }\n\n private async restoreInitialDraggablePosition(draggable: HTMLElement): Promise<void> {\n const { parent, index } = this.draggables.get(draggable);\n\n const moveDraggable = (draggable: HTMLElement, parent: HTMLElement, index: number) => {\n const targetIndex = Math.min(index, parent.children.length);\n parent.insertBefore(draggable, parent.children[targetIndex]);\n draggable.style.transform = 'translate(0, 0)';\n this.checkMaxAssociations();\n };\n\n // Fallback if view transitions are not supported\n if (!document.startViewTransition) {\n moveDraggable(draggable, parent, index);\n return;\n }\n\n // Use view transitions if supported\n const transition = document.startViewTransition(() => {\n draggable.style.transform = '';\n moveDraggable(draggable, parent, index);\n });\n // transition.finished.then(() => {\n // draggable.style.transition = '';\n // });\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n\n // Cleanup MutationObserver\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n\n // Cleanup ResizeObserver\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n validate(): boolean {\n if (!this.shadowRoot) return false;\n\n const validAssociations = this.getValidAssociations();\n let isValid = true;\n let validityMessage = '';\n\n if (this.maxAssociations > 0 && validAssociations > this.maxAssociations) {\n isValid = false;\n validityMessage =\n this.dataset.maxSelectionsMessage ||\n `You've selected too many associations. Maximum allowed is ${this.maxAssociations}.`;\n } else if (this.minAssociations > 0 && validAssociations < this.minAssociations) {\n isValid = false;\n validityMessage =\n this.dataset.minSelectionsMessage ||\n `You haven't selected enough associations. Minimum required is ${this.minAssociations}.`;\n }\n const lastElementChild = this.lastElementChild as HTMLElement;\n // Use null for the third argument if no specific anchor is needed\n this._internals.setValidity(isValid ? {} : { customError: true }, validityMessage, lastElementChild);\n\n this.reportValidity();\n return isValid;\n }\n\n override reportValidity(): boolean {\n const validationMessageElement = this.shadowRoot.querySelector('#validationMessage') as HTMLElement;\n if (validationMessageElement) {\n if (!this._internals.validity.valid) {\n validationMessageElement.textContent = this._internals.validationMessage;\n validationMessageElement.style.display = 'block';\n } else {\n validationMessageElement.textContent = '';\n validationMessageElement.style.display = 'none';\n }\n }\n return this._internals.validity.valid;\n }\n\n protected checkMaxAssociations(): void {\n this.dragDropApi.droppables.forEach(d => {\n const maxMatch = +(d.getAttribute('match-max') || 1);\n const currentAssociations = d.querySelectorAll('[qti-draggable=\"true\"]').length;\n const disableDroppable = currentAssociations >= maxMatch;\n if (disableDroppable) {\n this.disableDroppable(d);\n } else {\n this.enableDroppable(d);\n }\n });\n }\n\n private disableDroppable(droppable: Element): void {\n droppable.setAttribute('disabled', '');\n }\n\n private enableDroppable(droppable: Element): void {\n droppable.removeAttribute('disabled');\n }\n\n get value(): string[] {\n return this.collectResponseData();\n }\n\n set value(value: string[]) {\n if (this.isMatchTabular()) return;\n this.resetDroppables();\n // Assuming this.value is an array of strings\n if (Array.isArray(value)) {\n value?.forEach(entry => this.placeResponse(entry));\n const formData = new FormData();\n value.forEach(response => {\n formData.append(this.responseIdentifier, response);\n });\n this._internals.setFormValue(formData);\n } else {\n // Handle the case where this.value is not an array\n this._internals.setFormValue(value);\n }\n }\n\n private placeResponse(response: string): void {\n const [dropId, ...dragIds] = response.split(' ').reverse();\n const droppable = this.findDroppableById(dropId);\n dragIds.forEach(dragId => this.placeDraggableInDroppable(dragId, droppable));\n }\n\n private findDroppableById(identifier: string): Element | undefined {\n return this.dragDropApi.droppables.find(drop => drop.getAttribute('identifier') === identifier);\n }\n\n private async placeDraggableInDroppable(dragId: string, droppable: Element): Promise<void> {\n const draggable = this.querySelector<HTMLElement>(`[identifier=${dragId}]`);\n if (!droppable || !draggable) {\n console.error(`Cannot find draggable or droppable with the given identifier: ${dragId}`);\n return;\n }\n const moveElement = (): void => {\n draggable.style.transform = 'translate(0, 0)';\n droppable.appendChild(draggable);\n this.checkMaxAssociations();\n };\n\n if (!document.startViewTransition) {\n moveElement();\n } else {\n const transition = document.startViewTransition(moveElement);\n await transition.finished;\n }\n }\n\n private getValidAssociations(): number {\n return this.dragDropApi.droppables.filter(d => d.childElementCount > 0).length;\n }\n\n public saveResponse(): void {\n this.validate();\n const response = this.collectResponseData();\n this.dispatchEvent(\n new CustomEvent('qti-interaction-response', {\n bubbles: true,\n composed: true,\n detail: {\n responseIdentifier: this.responseIdentifier,\n response\n }\n })\n );\n }\n\n private collectResponseData(): string[] {\n const response = this.dragDropApi.droppables\n .map(droppable => {\n const draggablesInDroppable = droppable.querySelectorAll('[qti-draggable=\"true\"]');\n const identifiers = Array.from(draggablesInDroppable).map(d => d.getAttribute('identifier'));\n const droppableIdentifier = droppable.getAttribute('identifier');\n return identifiers.map(id => `${id} ${droppableIdentifier}`);\n })\n .flat();\n return response;\n }\n\n reset(save = true): void {\n this.resetDroppables();\n if (save) this.saveResponse();\n }\n\n private async resetDroppables(): Promise<void> {\n const moveDraggable = (draggable: HTMLElement, parent: HTMLElement, index: number) => {\n draggable.style.transform = 'translate(0, 0)';\n const targetIndex = Math.min(index, parent.children.length);\n parent.insertBefore(draggable, parent.children[targetIndex]);\n };\n\n if (!document.startViewTransition) {\n // Fallback if view transitions are not supported\n this.draggables.forEach(({ parent, index }, draggable) => {\n moveDraggable(draggable, parent, index);\n });\n return;\n }\n\n // Use view transitions if supported\n const transition = document.startViewTransition(() => {\n this.draggables.forEach(({ parent, index }, draggable) => {\n moveDraggable(draggable, parent, index);\n });\n });\n\n await transition.finished;\n }\n }\n\n return DragDropInteractionElement as Constructor<IInteraction> & T;\n};\n","import { css } from 'lit';\n\nexport default css`\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n slot[name='qti-simple-associable-choice'] {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n border: 2px solid transparent;\n }\n\n :host::part(associables-container) {\n display: flex;\n justify-content: space-between;\n background: linear-gradient(\n 180deg,\n rgb(0 0 0 / 0%) calc(50% - 1px),\n var(--qti-border-color-gray) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n`;\n","import { CSSResultGroup, html } from 'lit';\n\nimport { customElement, state } from 'lit/decorators.js';\nimport { DragDropInteractionMixin } from '../internal/drag-drop';\nimport { QtiSimpleAssociableChoice } from '../qti-simple-associable-choice';\nimport styles from './qti-associate-interaction.styles';\nimport { Interaction } from '../internal/interaction/interaction';\n@customElement('qti-associate-interaction')\nexport class QtiAssociateInteraction extends DragDropInteractionMixin(\n Interaction,\n 'qti-simple-associable-choice',\n '.dl',\n `slot[name='qti-simple-associable-choice']`\n) {\n @state() private _childrenMap: Element[] = [];\n\n static styles: CSSResultGroup = styles;\n\n private _registerChoiceHandler: (event: CustomEvent) => void;\n\n constructor() {\n super();\n this._registerChoiceHandler = this._registerChoice.bind(this);\n this.addEventListener('register-qti-simple-associable-choice', this._registerChoiceHandler);\n }\n\n private _registerChoice(event: CustomEvent) {\n const choice = event.target as QtiSimpleAssociableChoice;\n this._childrenMap.push(choice);\n }\n\n override render() {\n return html` <slot name=\"prompt\"></slot>\n <slot name=\"qti-simple-associable-choice\"></slot>\n <div part=\"drop-container\">\n ${this._childrenMap.length > 0 &&\n Array.from(Array(Math.ceil(this._childrenMap.length / 2)).keys()).map(\n (_, index) =>\n html`<div part=\"associables-container\">\n <div name=\"left${index}\" part=\"drop-list\" class=\"dl\" identifier=\"droplist${index}_left\"></div>\n <div name=\"right${index}\" part=\"drop-list\" class=\"dl\" identifier=\"droplist${index}_right\"></div>\n </div>\n <div role=\"alert\" id=\"validationMessage\"></div>`\n )}\n </div>`;\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('register-qti-simple-associable-choice', this._registerChoiceHandler);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-associate-interaction': QtiAssociateInteraction;\n }\n}\n","import { html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { Interaction } from '../internal/interaction/interaction';\nimport { removeDoubleSlashes } from '../../internal/utils';\n\n@customElement('qti-custom-interaction')\nexport class QtiCustomInteraction extends Interaction {\n // This custom-interaction support the CES API which is use in FACET\n //\n // It works like this:\n // 1. The CI manifest is fetched\n // 2. An iframe is created and the first style and first script from the manifest are loaded\n // 3. The first script is bootstrap.js which also creates an iframe and loads the first media from the manifest\n // 4. Communication is done via the CES API but because the iframe is not allowed to access the global CES object we need to use window.postMessage\n\n // To achieve this we change the package by replacing the bootstrap.js with our own and inject a proxy CES API that communicates via postMessage\n // Because we also want to run this in storybook, we cannot use window.top because to send messages there, because in case of storybook that is not the top window.\n // So we send messages to all parent windows\n private rawResponse: string;\n\n constructor() {\n super();\n this.handlePostMessage = this.handlePostMessage.bind(this);\n }\n\n @property({ type: String, attribute: 'data' })\n data: string;\n\n @property({ type: String, attribute: 'data-base-item' })\n baseItemUrl: string;\n\n @property({ type: String, attribute: 'data-base-ref' })\n baseRefUrl: string;\n\n @property({ type: String, attribute: 'id' })\n id: string;\n\n @state()\n private _errorMessage: string = null;\n manifest: {\n script: string[];\n style: string[];\n media: string[];\n };\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n const uriToManifest = this.data.startsWith('http')\n ? this.data\n : removeDoubleSlashes(this.baseItemUrl + '/' + this.data);\n // fetch the json file located at the data attribute\n fetch(uriToManifest)\n .then(response => response.json())\n .then(data => {\n this.manifest = data;\n this.setupCES();\n })\n .catch(err => {\n this._errorMessage = err;\n });\n }\n\n // MH: Changed the default bootstrap.js to use the new CES API\n // Because the old one uses the global CES object that is not allowed to be accessed when the CI\n // is embedded in an iframe and coming from another domain\n // Therefor we need to use the new CES API to communicates via the broadcast API\n setupCES() {\n const iframe = this.shadowRoot.querySelector('#pciContainer') as HTMLIFrameElement,\n iframeDoc = iframe.contentDocument;\n\n // const channel = new BroadcastChannel('ces_channel');\n window.addEventListener('message', this.handlePostMessage);\n iframeDoc.open();\n iframeDoc.write(`\n <html>\n <head>\n <link href='${removeDoubleSlashes(`${this.baseRefUrl}/${this.manifest.style[0]}`)}' rel=\"stylesheet\" />\n <script src='${removeDoubleSlashes(`${this.baseRefUrl}/${this.manifest.script[0]}`)}'></script>\n </head>\n <body></body>\n </html>\n `);\n\n iframeDoc.close();\n }\n\n private getIFrames() {\n const iframesInShadowRoot = this.shadowRoot.querySelectorAll('iframe');\n const iframe = this.querySelectorAll('iframe');\n\n const outerIFrames = [...iframesInShadowRoot, ...iframe];\n for (const iframe of outerIFrames) {\n const iframeSrc = iframe.src;\n const isSameOrigin = new URL(iframeSrc, window.location.href).origin === window.location.origin;\n if (isSameOrigin) {\n try {\n const outerDoc = iframe.contentDocument || iframe.contentWindow.document;\n if (outerDoc) {\n this.getInnerIFrames(outerDoc, outerIFrames);\n }\n } catch (e) {\n console.error('Error accessing nested iframe:', e);\n }\n }\n }\n // get only unique iframes\n outerIFrames.forEach((iframe, index) => {\n if (outerIFrames.indexOf(iframe) !== index) {\n outerIFrames.splice(index, 1);\n }\n });\n return outerIFrames;\n }\n\n private getInnerIFrames(iframeDocument: Document, iframes = []) {\n // Get all iframes in the current document\n const currentIframes = iframeDocument.querySelectorAll('iframe');\n\n currentIframes.forEach(iframe => {\n // Add the current iframe to the list\n iframes.push(iframe);\n\n // Recursively get iframes within the current iframe\n // Check if the iframe src is from the same origin\n const iframeSrc = iframe.src;\n const isSameOrigin = new URL(iframeSrc, window.location.href).origin === window.location.origin;\n\n if (isSameOrigin) {\n try {\n const nestedDoc = iframe.contentDocument || iframe.contentWindow.document;\n this.getInnerIFrames(nestedDoc, iframes);\n } catch (e) {\n console.error('Error accessing nested iframe:', e);\n }\n } else {\n console.warn('Skipped cross-origin iframe:', iframeSrc);\n }\n });\n\n return iframes;\n }\n\n private postToWindowAndIframes(type: string, data: any) {\n window.postMessage({ type, data }, '*');\n const iframes = this.getIFrames();\n for (const iframe of iframes) {\n if (iframe.contentWindow) {\n iframe.contentWindow.postMessage({ type, data }, '*');\n }\n }\n }\n\n handlePostMessage(event: MessageEvent) {\n const { type, data } = event.data;\n switch (type) {\n case 'setResponse':\n this.rawResponse = data;\n this.saveResponse(data);\n break;\n case 'getResponse': {\n this.postToWindowAndIframes('responseData', this.rawResponse);\n break;\n }\n case 'getMedia': {\n const mediaData = this.manifest.media.map(media => {\n const url = media.startsWith('http') ? media : removeDoubleSlashes(this.baseRefUrl + '/' + media);\n return url;\n });\n this.postToWindowAndIframes('mediaData', mediaData);\n break;\n }\n case 'setStageHeight':\n console.log('setStageHeight not implemented');\n break;\n }\n }\n\n validate(): boolean {\n return this.rawResponse !== '';\n }\n\n get value(): string | string[] {\n return this.rawResponse;\n }\n\n set value(val: string | string[]) {\n if (typeof val === 'string') {\n this.rawResponse = val;\n this.saveResponse(val);\n } else {\n throw new Error('Value must be a string');\n }\n }\n\n override disconnectedCallback(): void {\n window.removeEventListener('message', this.handlePostMessage);\n super.disconnectedCallback();\n }\n\n override render() {\n return html`<iframe\n width=${this.getAttribute('width')}\n height=${this.getAttribute('height')}\n frameborder=\"0\"\n title=\"pciContainer\"\n id=\"pciContainer\"\n >\n </iframe>\n ${this._errorMessage &&\n html`<div style=\"color:red\">\n <h1>Error</h1>\n ${this._errorMessage}\n </div>`}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-custom-interaction': QtiCustomInteraction;\n }\n}\n","import { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { Interaction } from '../internal/interaction/interaction';\n@customElement('qti-end-attempt-interaction')\nexport class QtiEndAttemptInteraction extends Interaction {\n @property({ type: String, attribute: 'count-attempt' })\n public countAttempt: string = 'true';\n\n @property({ type: String })\n public title: 'end attempt';\n\n validate(): boolean {\n // not implemented by design\n return true;\n }\n\n get value(): string | string[] {\n // throw new Error('Method not implemented.');\n return '';\n }\n\n set value(_: string | string[]) {\n // not implemented by design\n }\n\n override render() {\n return html`<button ?disabled=${this.disabled} part=\"button\" @click=${this.endAttempt}>${this.title}</button>`;\n }\n public endAttempt(_: Event) {\n this.dispatchEvent(\n new CustomEvent('end-attempt', {\n bubbles: true,\n composed: true,\n detail: { responseIdentifier: this.responseIdentifier, countAttempt: this.countAttempt === 'true' }\n })\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-end-attempt-interaction': QtiEndAttemptInteraction;\n }\n}\n","import { css } from 'lit';\n// import componentStyles from '../../utilities/styles/component.styles';\n// :host {\n// display: inline-block;\n// position: relative;\n// }\n/* ${componentStyles} */\nexport default css`\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) {\n flex-direction: row;\n }\n :host(.qti-choices-right) {\n flex-direction: row-reverse;\n }\n /* [part='drops'] , */\n [name='prompt'] {\n width: 100%;\n }\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n`;\n","import { CSSResultGroup, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { DragDropInteractionMixin } from '../internal/drag-drop/drag-drop-interaction-mixin';\nimport { Interaction } from '../internal/interaction/interaction';\nimport styles from './qti-gap-match-interaction.styles';\n@customElement('qti-gap-match-interaction')\nexport class QtiGapMatchInteraction extends DragDropInteractionMixin(\n Interaction,\n 'qti-gap-text',\n 'qti-gap',\n `slot[part='drags']`\n) {\n static styles: CSSResultGroup = styles;\n\n override render() {\n return html`<slot name=\"prompt\"> </slot>\n <slot part=\"drags\" name=\"drags\"></slot>\n <slot part=\"drops\"></slot>\n <div role=\"alert\" id=\"validationMessage\"></div>`;\n }\n\n set correctResponse(value: string | string[]) {\n let matches: { text: string; gap: string }[] = [];\n const response = Array.isArray(value) ? value : [value];\n\n if (response) {\n matches = response.map(x => {\n const split = x.split(' ');\n return { text: split[0], gap: split[1] };\n });\n }\n\n const gaps = this.querySelectorAll('qti-gap');\n gaps.forEach(gap => {\n const identifier = gap.getAttribute('identifier');\n const textIdentifier = matches.find(x => x.gap === identifier)?.text;\n const text = this.querySelector(`qti-gap-text[identifier=\"${textIdentifier}\"]`)?.textContent.trim();\n if (textIdentifier && text) {\n if (!gap.nextElementSibling?.classList.contains('correct-option')) {\n const textSpan = document.createElement('span');\n textSpan.classList.add('correct-option');\n textSpan.textContent = text;\n gap.insertAdjacentElement('afterend', textSpan);\n }\n } else if (gap.nextElementSibling?.classList.contains('correct-option')) {\n gap.nextElementSibling.remove();\n }\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-gap-match-interaction': QtiGapMatchInteraction;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ChildPart, noChange} from '../lit-html.js';\nimport {directive, Directive, PartInfo, PartType} from '../directive.js';\nimport {\n insertPart,\n getCommittedValue,\n removePart,\n setCommittedValue,\n setChildPartValue,\n} from '../directive-helpers.js';\n\nexport type KeyFn<T> = (item: T, index: number) => unknown;\nexport type ItemTemplate<T> = (item: T, index: number) => unknown;\n\n// Helper for generating a map of array item to its index over a subset\n// of an array (used to lazily generate `newKeyToIndexMap` and\n// `oldKeyToIndexMap`)\nconst generateMap = (list: unknown[], start: number, end: number) => {\n const map = new Map<unknown, number>();\n for (let i = start; i <= end; i++) {\n map.set(list[i], i);\n }\n return map;\n};\n\nclass RepeatDirective extends Directive {\n private _itemKeys?: unknown[];\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error('repeat() can only be used in text expressions');\n }\n }\n\n private _getValuesAndKeys<T>(\n items: Iterable<T>,\n keyFnOrTemplate: KeyFn<T> | ItemTemplate<T>,\n template?: ItemTemplate<T>\n ) {\n let keyFn: KeyFn<T> | undefined;\n if (template === undefined) {\n template = keyFnOrTemplate;\n } else if (keyFnOrTemplate !== undefined) {\n keyFn = keyFnOrTemplate as KeyFn<T>;\n }\n const keys = [];\n const values = [];\n let index = 0;\n for (const item of items) {\n keys[index] = keyFn ? keyFn(item, index) : index;\n values[index] = template!(item, index);\n index++;\n }\n return {\n values,\n keys,\n };\n }\n\n render<T>(items: Iterable<T>, template: ItemTemplate<T>): Array<unknown>;\n render<T>(\n items: Iterable<T>,\n keyFn: KeyFn<T> | ItemTemplate<T>,\n template: ItemTemplate<T>\n ): Array<unknown>;\n render<T>(\n items: Iterable<T>,\n keyFnOrTemplate: KeyFn<T> | ItemTemplate<T>,\n template?: ItemTemplate<T>\n ) {\n return this._getValuesAndKeys(items, keyFnOrTemplate, template).values;\n }\n\n override update<T>(\n containerPart: ChildPart,\n [items, keyFnOrTemplate, template]: [\n Iterable<T>,\n KeyFn<T> | ItemTemplate<T>,\n ItemTemplate<T>,\n ]\n ) {\n // Old part & key lists are retrieved from the last update (which may\n // be primed by hydration)\n const oldParts = getCommittedValue(\n containerPart\n ) as Array<ChildPart | null>;\n const {values: newValues, keys: newKeys} = this._getValuesAndKeys(\n items,\n keyFnOrTemplate,\n template\n );\n\n // We check that oldParts, the committed value, is an Array as an\n // indicator that the previous value came from a repeat() call. If\n // oldParts is not an Array then this is the first render and we return\n // an array for lit-html's array handling to render, and remember the\n // keys.\n if (!Array.isArray(oldParts)) {\n this._itemKeys = newKeys;\n return newValues;\n }\n\n // In SSR hydration it's possible for oldParts to be an array but for us\n // to not have item keys because the update() hasn't run yet. We set the\n // keys to an empty array. This will cause all oldKey/newKey comparisons\n // to fail and execution to fall to the last nested brach below which\n // reuses the oldPart.\n const oldKeys = (this._itemKeys ??= []);\n\n // New part list will be built up as we go (either reused from\n // old parts or created for new keys in this update). This is\n // saved in the above cache at the end of the update.\n const newParts: ChildPart[] = [];\n\n // Maps from key to index for current and previous update; these\n // are generated lazily only when needed as a performance\n // optimization, since they are only required for multiple\n // non-contiguous changes in the list, which are less common.\n let newKeyToIndexMap!: Map<unknown, number>;\n let oldKeyToIndexMap!: Map<unknown, number>;\n\n // Head and tail pointers to old parts and new values\n let oldHead = 0;\n let oldTail = oldParts.length - 1;\n let newHead = 0;\n let newTail = newValues.length - 1;\n\n // Overview of O(n) reconciliation algorithm (general approach\n // based on ideas found in ivi, vue, snabbdom, etc.):\n //\n // * We start with the list of old parts and new values (and\n // arrays of their respective keys), head/tail pointers into\n // each, and we build up the new list of parts by updating\n // (and when needed, moving) old parts or creating new ones.\n // The initial scenario might look like this (for brevity of\n // the diagrams, the numbers in the array reflect keys\n // associated with the old parts or new values, although keys\n // and parts/values are actually stored in parallel arrays\n // indexed using the same head/tail pointers):\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [ , , , , , , ]\n // newKeys: [0, 2, 1, 4, 3, 7, 6] <- reflects the user's new\n // item order\n // newHead ^ ^ newTail\n //\n // * Iterate old & new lists from both sides, updating,\n // swapping, or removing parts at the head/tail locations\n // until neither head nor tail can move.\n //\n // * Example below: keys at head pointers match, so update old\n // part 0 in-place (no need to move it) and record part 0 in\n // the `newParts` list. The last thing we do is advance the\n // `oldHead` and `newHead` pointers (will be reflected in the\n // next diagram).\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , ] <- heads matched: update 0\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: head pointers don't match, but tail\n // pointers do, so update part 6 in place (no need to move\n // it), and record part 6 in the `newParts` list. Last,\n // advance the `oldTail` and `oldHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- tails matched: update 6\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldTail\n // & newTail\n // newHead ^ ^ newTail\n //\n // * If neither head nor tail match; next check if one of the\n // old head/tail items was removed. We first need to generate\n // the reverse map of new keys to index (`newKeyToIndexMap`),\n // which is done once lazily as a performance optimization,\n // since we only hit this case if multiple non-contiguous\n // changes were made. Note that for contiguous removal\n // anywhere in the list, the head and tails would advance\n // from either end and pass each other before we get to this\n // case and removals would be handled in the final while loop\n // without needing to generate the map.\n //\n // * Example below: The key at `oldTail` was removed (no longer\n // in the `newKeyToIndexMap`), so remove that part from the\n // DOM and advance just the `oldTail` pointer.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- 5 not in new map: remove\n // newKeys: [0, 2, 1, 4, 3, 7, 6] 5 and advance oldTail\n // newHead ^ ^ newTail\n //\n // * Once head and tail cannot move, any mismatches are due to\n // either new or moved items; if a new key is in the previous\n // \"old key to old index\" map, move the old part to the new\n // location, otherwise create and insert a new part. Note\n // that when moving an old part we null its position in the\n // oldParts array if it lies between the head and tail so we\n // know to skip it when the pointers get there.\n //\n // * Example below: neither head nor tail match, and neither\n // were removed; so find the `newHead` key in the\n // `oldKeyToIndexMap`, and move that old part's DOM into the\n // next head position (before `oldParts[oldHead]`). Last,\n // null the part in the `oldPart` array since it was\n // somewhere in the remaining oldParts still to be scanned\n // (between the head and tail pointers) so that we know to\n // skip that old part on future iterations.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, , , , , 6] <- stuck: update & move 2\n // newKeys: [0, 2, 1, 4, 3, 7, 6] into place and advance\n // newHead\n // newHead ^ ^ newTail\n //\n // * Note that for moves/insertions like the one above, a part\n // inserted at the head pointer is inserted before the\n // current `oldParts[oldHead]`, and a part inserted at the\n // tail pointer is inserted before `newParts[newTail+1]`. The\n // seeming asymmetry lies in the fact that new parts are\n // moved into place outside in, so to the right of the head\n // pointer are old parts, and to the right of the tail\n // pointer are new parts.\n //\n // * We always restart back from the top of the algorithm,\n // allowing matching and simple updates in place to\n // continue...\n //\n // * Example below: the head pointers once again match, so\n // simply update part 1 and record it in the `newParts`\n // array. Last, advance both head pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, , , , 6] <- heads matched: update 1\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * As mentioned above, items that were moved as a result of\n // being stuck (the final else clause in the code below) are\n // marked with null, so we always advance old pointers over\n // these so we're comparing the next actual old value on\n // either end.\n //\n // * Example below: `oldHead` is null (already placed in\n // newParts), so advance `oldHead`.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6] <- old head already used:\n // newParts: [0, 2, 1, , , , 6] advance oldHead\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ ^ newTail\n //\n // * Note it's not critical to mark old parts as null when they\n // are moved from head to tail or tail to head, since they\n // will be outside the pointer range and never visited again.\n //\n // * Example below: Here the old tail key matches the new head\n // key, so the part at the `oldTail` position and move its\n // DOM to the new head position (before `oldParts[oldHead]`).\n // Last, advance `oldTail` and `newHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, , , 6] <- old tail matches new\n // newKeys: [0, 2, 1, 4, 3, 7, 6] head: update & move 4,\n // advance oldTail & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: Old and new head keys match, so update the\n // old head part in place, and advance the `oldHead` and\n // `newHead` pointers.\n //\n // oldHead v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, ,6] <- heads match: update 3\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance oldHead &\n // newHead\n // newHead ^ ^ newTail\n //\n // * Once the new or old pointers move past each other then all\n // we have left is additions (if old list exhausted) or\n // removals (if new list exhausted). Those are handled in the\n // final while loops at the end.\n //\n // * Example below: `oldHead` exceeded `oldTail`, so we're done\n // with the main loop. Create the remaining part and insert\n // it at the new head position, and the update is complete.\n //\n // (oldHead > oldTail)\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, 7 ,6] <- create and insert 7\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ newTail\n //\n // * Note that the order of the if/else clauses is not\n // important to the algorithm, as long as the null checks\n // come first (to ensure we're always working on valid old\n // parts) and that the final else clause comes last (since\n // that's where the expensive moves occur). The order of\n // remaining clauses is just a simple guess at which cases\n // will be most common.\n //\n // * Note, we could calculate the longest\n // increasing subsequence (LIS) of old items in new position,\n // and only move those not in the LIS set. However that costs\n // O(nlogn) time and adds a bit more code, and only helps\n // make rare types of mutations require fewer moves. The\n // above handles removes, adds, reversal, swaps, and single\n // moves of contiguous items in linear time, in the minimum\n // number of moves. As the number of multiple moves where LIS\n // might help approaches a random shuffle, the LIS\n // optimization becomes less helpful, so it seems not worth\n // the code at this point. Could reconsider if a compelling\n // case arises.\n\n while (oldHead <= oldTail && newHead <= newTail) {\n if (oldParts[oldHead] === null) {\n // `null` means old part at head has already been used\n // below; skip\n oldHead++;\n } else if (oldParts[oldTail] === null) {\n // `null` means old part at tail has already been used\n // below; skip\n oldTail--;\n } else if (oldKeys[oldHead] === newKeys[newHead]) {\n // Old head matches new head; update in place\n newParts[newHead] = setChildPartValue(\n oldParts[oldHead]!,\n newValues[newHead]\n );\n oldHead++;\n newHead++;\n } else if (oldKeys[oldTail] === newKeys[newTail]) {\n // Old tail matches new tail; update in place\n newParts[newTail] = setChildPartValue(\n oldParts[oldTail]!,\n newValues[newTail]\n );\n oldTail--;\n newTail--;\n } else if (oldKeys[oldHead] === newKeys[newTail]) {\n // Old head matches new tail; update and move to new tail\n newParts[newTail] = setChildPartValue(\n oldParts[oldHead]!,\n newValues[newTail]\n );\n insertPart(containerPart, newParts[newTail + 1], oldParts[oldHead]!);\n oldHead++;\n newTail--;\n } else if (oldKeys[oldTail] === newKeys[newHead]) {\n // Old tail matches new head; update and move to new head\n newParts[newHead] = setChildPartValue(\n oldParts[oldTail]!,\n newValues[newHead]\n );\n insertPart(containerPart, oldParts[oldHead]!, oldParts[oldTail]!);\n oldTail--;\n newHead++;\n } else {\n if (newKeyToIndexMap === undefined) {\n // Lazily generate key-to-index maps, used for removals &\n // moves below\n newKeyToIndexMap = generateMap(newKeys, newHead, newTail);\n oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);\n }\n if (!newKeyToIndexMap.has(oldKeys[oldHead])) {\n // Old head is no longer in new list; remove\n removePart(oldParts[oldHead]!);\n oldHead++;\n } else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {\n // Old tail is no longer in new list; remove\n removePart(oldParts[oldTail]!);\n oldTail--;\n } else {\n // Any mismatches at this point are due to additions or\n // moves; see if we have an old part we can reuse and move\n // into place\n const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);\n const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;\n if (oldPart === null) {\n // No old part for this value; create a new one and\n // insert it\n const newPart = insertPart(containerPart, oldParts[oldHead]!);\n setChildPartValue(newPart, newValues[newHead]);\n newParts[newHead] = newPart;\n } else {\n // Reuse old part\n newParts[newHead] = setChildPartValue(oldPart, newValues[newHead]);\n insertPart(containerPart, oldParts[oldHead]!, oldPart);\n // This marks the old part as having been used, so that\n // it will be skipped in the first two checks above\n oldParts[oldIndex as number] = null;\n }\n newHead++;\n }\n }\n }\n // Add parts for any remaining new values\n while (newHead <= newTail) {\n // For all remaining additions, we insert before last new\n // tail, since old pointers are no longer valid\n const newPart = insertPart(containerPart, newParts[newTail + 1]);\n setChildPartValue(newPart, newValues[newHead]);\n newParts[newHead++] = newPart;\n }\n // Remove any remaining unused old parts\n while (oldHead <= oldTail) {\n const oldPart = oldParts[oldHead++];\n if (oldPart !== null) {\n removePart(oldPart);\n }\n }\n\n // Save order of new parts for next round\n this._itemKeys = newKeys;\n // Directly set part value, bypassing it's dirty-checking\n setCommittedValue(containerPart, newParts);\n return noChange;\n }\n}\n\nexport interface RepeatDirectiveFn {\n <T>(\n items: Iterable<T>,\n keyFnOrTemplate: KeyFn<T> | ItemTemplate<T>,\n template?: ItemTemplate<T>\n ): unknown;\n <T>(items: Iterable<T>, template: ItemTemplate<T>): unknown;\n <T>(\n items: Iterable<T>,\n keyFn: KeyFn<T> | ItemTemplate<T>,\n template: ItemTemplate<T>\n ): unknown;\n}\n\n/**\n * A directive that repeats a series of values (usually `TemplateResults`)\n * generated from an iterable, and updates those items efficiently when the\n * iterable changes based on user-provided `keys` associated with each item.\n *\n * Note that if a `keyFn` is provided, strict key-to-DOM mapping is maintained,\n * meaning previous DOM for a given key is moved into the new position if\n * needed, and DOM will never be reused with values for different keys (new DOM\n * will always be created for new keys). This is generally the most efficient\n * way to use `repeat` since it performs minimum unnecessary work for insertions\n * and removals.\n *\n * The `keyFn` takes two parameters, the item and its index, and returns a unique key value.\n *\n * ```js\n * html`\n * <ol>\n * ${repeat(this.items, (item) => item.id, (item, index) => {\n * return html`<li>${index}: ${item.name}</li>`;\n * })}\n * </ol>\n * `\n * ```\n *\n * **Important**: If providing a `keyFn`, keys *must* be unique for all items in a\n * given call to `repeat`. The behavior when two or more items have the same key\n * is undefined.\n *\n * If no `keyFn` is provided, this directive will perform similar to mapping\n * items to values, and DOM will be reused against potentially different items.\n */\nexport const repeat = directive(RepeatDirective) as RepeatDirectiveFn;\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {RepeatDirective};\n","import { QtiHotspotChoice } from '../../qti-hotspot-choice';\n\nexport function positionHotspots(\n shape: string,\n coordsNumber: number[],\n img: HTMLImageElement,\n hotspot: QtiHotspotChoice\n) {\n switch (shape) {\n case 'circle':\n {\n const [centerX, centerY, radius] = coordsNumber;\n const centerXPer = (centerX / img.width) * 100;\n const centerYPer = (centerY / img.height) * 100;\n const radiusPer = (radius / img.width) * 100;\n hotspot.style.left = centerXPer - radiusPer + '%';\n hotspot.style.top = centerYPer - radiusPer + '%';\n hotspot.style.width = hotspot.style.height = 4 * radiusPer + 'px';\n hotspot.style.borderRadius = `9999px`;\n }\n break;\n\n case 'rect':\n {\n const [leftX, topY, rightX, bottomY] = coordsNumber;\n const leftXPer = (leftX / img.width) * 100;\n const topYPer = (topY / img.height) * 100;\n const rightXPer = (rightX / img.width) * 100;\n const bottomYPer = (bottomY / img.height) * 100;\n hotspot.style.left = leftXPer + '%';\n hotspot.style.top = topYPer + '%';\n hotspot.style.width = rightXPer - leftXPer + '%';\n hotspot.style.height = bottomYPer - topYPer + '%';\n }\n break;\n\n case 'poly':\n {\n // from a,b,c,d,e,f => [{x:a, y:b},{x:c, y:d},{x:e, y:f}]\n const polycoords = coordsNumber.reduce((acc, currentValue, currentIndex, polyC) => {\n if (currentIndex % 2 === 1) {\n const lastVal = acc.pop();\n acc[acc.length] = { x: lastVal, y: polyC[currentIndex] };\n } else {\n acc.push(currentValue);\n }\n return acc;\n }, []);\n\n // calculate bounding box by finding the max ax min coordinates of x and y\n const leftX = Math.min(...polycoords.map(point => point.x));\n const rightX = Math.max(...polycoords.map(point => point.x));\n const topY = Math.min(...polycoords.map(point => point.y));\n const bottomY = Math.max(...polycoords.map(point => point.y));\n\n // calculate the relative distance cause we want to use percentages\n const leftXPer = (leftX / img.width) * 100;\n const topYPer = (topY / img.height) * 100;\n const rightXPer = (rightX / img.width) * 100;\n const bottomYPer = (bottomY / img.height) * 100;\n\n // set the hotspot on x,y and set the width and height in percentages\n hotspot.style.left = (leftX / img.width) * 100 + '%';\n hotspot.style.top = (topY / img.height) * 100 + '%';\n hotspot.style.width = rightXPer - leftXPer + '%';\n hotspot.style.height = bottomYPer - topYPer + '%';\n\n // all the polygon points should be corrected caused they are from\n // image 0,0 point, and should be from the hotspot point which already\n // has been offsetted from the image in the previous few lines of code\n // also the points have a relative distance to the image, but now have\n // to have a relative distance from the width of the hotspot\n const polygonData = polycoords.map(point => ({\n x: ((point.x - leftX) / (rightX - leftX)) * 100,\n y: ((point.y - topY) / (bottomY - topY)) * 100\n }));\n\n // create clip path coordinate style in percentages\n const polyD = polygonData.map(p => Math.round(p.x) + '% ' + Math.round(p.y) + '%').join(',');\n\n // 50% 0%, 100% 50%, 50% 100%, 0% 50%\n hotspot.style.clipPath = `polygon(${polyD})`;\n }\n break;\n\n default:\n break;\n }\n}\n","import { css, html, svg } from 'lit';\nimport { customElement, query, queryAssignedElements, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { positionHotspots } from '../internal/hotspots/hotspot';\nimport { Interaction } from '../internal/interaction/interaction';\nimport { QtiHotspotChoice } from '../qti-hotspot-choice';\n\n@customElement('qti-graphic-associate-interaction')\nexport class QtiGraphicAssociateInteraction extends Interaction {\n choiceOrdering: boolean;\n hotspots;\n startPoint = null;\n endPoint = null;\n @state() _lines = [];\n @state() startCoord: { x: any; y: any };\n @state() mouseCoord: { x: number; y: number };\n @query('svg') svgContainer;\n @queryAssignedElements({ selector: 'img' }) grImage;\n\n // target the main slot make it relative and fit with the conten\n static override styles = [\n css`\n slot:not([name='prompt']) {\n // position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n ::slotted(qti-associable-hotspot) {\n transform: translate(-50%, -50%);\n }\n line-container {\n display: block;\n position: relative;\n }\n svg {\n position: absolute;\n top: 0px;\n left: 0px;\n }\n `\n ];\n svg: SVGSVGElement;\n\n constructor() {\n super();\n this.addEventListener('qti-register-hotspot', this.positionHotspotOnRegister);\n }\n\n reset(): void {\n this._lines = [];\n }\n validate(): boolean {\n return this._lines.length > 0;\n }\n set value(val: string | string[]) {\n if (Array.isArray(val)) {\n this._lines = val;\n }\n }\n get value(): string | string[] {\n return this._lines;\n }\n\n override render() {\n return html`<slot name=\"prompt\"></slot>\n <line-container>\n <svg\n width=${ifDefined(this.grImage[0]?.width)}\n height=${ifDefined(this.grImage[0]?.height)}\n viewbox=\"0 0 ${this.grImage[0]?.width} ${this.grImage[0]?.height}\"\n >\n ${repeat(\n this._lines,\n line => line,\n (line, index) => svg`\n <line\n part=\"line\"\n x1=${parseInt(this.querySelector<SVGLineElement>('[identifier=' + line.split(' ')[0] + ']').style.left)}\n y1=${parseInt(this.querySelector<SVGLineElement>('[identifier=' + line.split(' ')[0] + ']').style.top)}\n x2=${parseInt(this.querySelector<SVGLineElement>('[identifier=' + line.split(' ')[1] + ']').style.left)}\n y2=${parseInt(this.querySelector<SVGLineElement>('[identifier=' + line.split(' ')[1] + ']').style.top)}\n stroke=\"red\"\n stroke-width=\"3\"\n @click=${(e: Event) => {\n e.stopPropagation();\n this._lines = this._lines.filter((_, i) => i !== index);\n this.saveResponse(this._lines);\n }}\n />\n `\n )}\n ${this.startPoint &&\n svg`<line\n part=\"point\"\n x1=${this.startCoord.x}\n y1=${this.startCoord.y}\n x2=${this.mouseCoord.x}\n y2=${this.mouseCoord.y}\n stroke=\"red\"\n stroke-width=\"3\"\n />`}\n </svg>\n <slot></slot>\n </line-container>\n <div role=\"alert\" id=\"validationMessage\"></div>`;\n }\n\n private positionHotspotOnRegister(e: CustomEvent<QtiHotspotChoice>): void {\n const img = this.querySelector('img') as HTMLImageElement;\n const hotspot = e.target as QtiHotspotChoice;\n const coords = hotspot.getAttribute('coords');\n const shape = hotspot.getAttribute('shape');\n const coordsNumber = coords.split(',').map(s => parseInt(s));\n positionHotspots(shape, coordsNumber, img, hotspot);\n }\n\n override firstUpdated(e): void {\n super.firstUpdated(e);\n\n this.hotspots = this.querySelectorAll('qti-associable-hotspot');\n\n document.addEventListener('mousemove', event => {\n this.mouseCoord = {\n x: event.clientX - this.grImage[0].getBoundingClientRect().left,\n y: event.clientY - this.grImage[0].getBoundingClientRect().top\n };\n });\n\n this.hotspots.forEach(hotspot => {\n hotspot.style.left = hotspot.getAttribute('coords').split(',')[0] + 'px';\n hotspot.style.top = hotspot.getAttribute('coords').split(',')[1] + 'px';\n\n hotspot.addEventListener('click', event => {\n if (!this.startPoint) {\n this.startPoint = event.target;\n\n this.startCoord = {\n x: this.startPoint.getAttribute('coords').split(',')[0],\n y: this.startPoint.getAttribute('coords').split(',')[1]\n };\n } else if (!this.endPoint) {\n this.endPoint = event.target;\n\n this._lines = [\n ...this._lines,\n this.startPoint.getAttribute('identifier') + ' ' + this.endPoint.getAttribute('identifier')\n ];\n this.saveResponse(this._lines);\n this.startPoint = null;\n this.endPoint = null;\n }\n });\n });\n }\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('qti-register-hotspot', this.positionHotspotOnRegister);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-graphic-associate-interaction': QtiGraphicAssociateInteraction;\n }\n}\n","import { css } from 'lit';\n// import componentStyles from '../../utilities/styles/component.styles';\n// :host {\n// display: inline-block;\n// position: relative;\n// }\n/* ${componentStyles} */\nexport default css`\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column;\n }\n :host(.qti-choices-left) {\n flex-direction: row-reverse;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n :host(.qti-choices-right) {\n flex-direction: row;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n [part='image'] {\n display: block;\n position: relative;\n }\n /* [part='drops'] , */\n\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n ::slotted(img) {\n display: inline-block;\n user-select: none;\n pointer-events: none;\n }\n`;\n","import { CSSResultGroup, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { DragDropInteractionMixin } from '../internal/drag-drop/drag-drop-interaction-mixin';\nimport { QtiHotspotChoice } from '../qti-hotspot-choice';\nimport { Interaction } from '../internal/interaction/interaction';\nimport styles from './qti-graphic-gap-match-interaction.styles';\n@customElement('qti-graphic-gap-match-interaction')\nexport class QtiGraphicGapMatchInteraction extends DragDropInteractionMixin(\n Interaction,\n 'qti-gap-img, qti-gap-text',\n 'qti-associable-hotspot',\n `slot[part='drags']`\n) {\n static styles: CSSResultGroup = styles;\n\n override render() {\n return html` <slot name=\"prompt\"></slot>\n <slot part=\"image\"></slot>\n <slot part=\"drags\" name=\"drags\" class=\"hover-border\"></slot>\n <div role=\"alert\" id=\"validationMessage\"></div>`;\n }\n\n private positionHotspotOnRegister(e: CustomEvent<null>): void {\n const hotspot = e.target as QtiHotspotChoice;\n const coords = hotspot.getAttribute('coords');\n const shape = hotspot.getAttribute('shape');\n const coordsNumber = coords.split(',').map(s => parseInt(s));\n\n // positionHotspots(shape, coordsNumber, img, hotspot);\n switch (shape) {\n case 'circle':\n {\n const [centerX, centerY, radius] = coordsNumber;\n hotspot.style.left = centerX - radius + 'px';\n hotspot.style.top = centerY - radius + 'px';\n hotspot.style.width = hotspot.style.height = 2 * radius + 'px';\n }\n break;\n\n case 'rect':\n {\n const [leftX, topY, rightX, bottomY] = coordsNumber;\n hotspot.style.left = leftX + 'px';\n hotspot.style.top = topY + 'px';\n hotspot.style.width = rightX - leftX + 'px';\n hotspot.style.height = bottomY - topY + 'px';\n }\n break;\n\n default:\n break;\n }\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('qti-register-hotspot', this.positionHotspotOnRegister);\n }\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('qti-register-hotspot', this.positionHotspotOnRegister);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-graphic-gap-match-interaction': QtiGraphicGapMatchInteraction;\n }\n}\n","import { css, html } from 'lit';\nimport { Choice, ChoicesMixin } from '../internal/choices/choices.mixin';\nimport { QtiHotspotChoice } from '../qti-hotspot-choice';\n\nimport { customElement } from 'lit/decorators.js';\nimport { positionHotspots } from '../internal/hotspots/hotspot';\nimport { Interaction } from '../internal/interaction/interaction';\n\ntype HotspotChoice = Choice & { order: number };\n\n@customElement('qti-graphic-order-interaction')\nexport class QtiGraphicOrderInteraction extends ChoicesMixin(Interaction, 'qti-hotspot-choice') {\n choiceOrdering: boolean;\n\n protected _choiceElements: Choice[] = [];\n\n // do not select ( highlight blue, the image)\n // target the main slot make it relative and fit with the conten\n static override styles = [\n css`\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n `\n ];\n\n override render() {\n return html`\n <slot name=\"prompt\"></slot>\n <!-- slot for the prompt -->\n <slot></slot>\n <!-- slot for the image and hotspots -->\n <div role=\"alert\" id=\"validationMessage\"></div>\n `;\n }\n\n private setHotspotOrder(e: CustomEvent<{ identifier: string; checked: boolean }>): void {\n const { identifier } = e.detail;\n\n const hotspot = this._choiceElements.find(el => el.getAttribute('identifier') === identifier) as HotspotChoice;\n\n const maxSelection = this._choiceElements.length;\n if (!this.choiceOrdering) {\n this.choiceOrdering = true;\n if (hotspot.order == null) {\n if ((this._choiceElements as HotspotChoice[]).filter(i => i.order > 0).length >= maxSelection) {\n this.choiceOrdering = false;\n return; // don't do anything if user already selected 5 images.\n }\n hotspot.order = (this._choiceElements as HotspotChoice[]).filter(i => !!i.order).length + 1;\n this.choiceOrdering = false;\n return;\n } else {\n (this._choiceElements as HotspotChoice[]).forEach(hotspot => {\n if (hotspot.order > hotspot.order) {\n hotspot.order--;\n }\n return hotspot;\n });\n hotspot.order = null;\n }\n this.choiceOrdering = false;\n }\n }\n\n private positionHotspotOnRegister(e: CustomEvent<QtiHotspotChoice>): void {\n const img = this.querySelector('img') as HTMLImageElement;\n const hotspot = e.target as QtiHotspotChoice;\n const coords = hotspot.getAttribute('coords');\n const shape = hotspot.getAttribute('shape');\n const coordsNumber = coords.split(',').map(s => parseInt(s));\n\n positionHotspots(shape, coordsNumber, img, hotspot);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('activate-qti-hotspot-choice', this.setHotspotOrder);\n this.addEventListener('register-qti-hotspot-choice', this.positionHotspotOnRegister);\n }\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('activate-qti-hotspot-choice', this.setHotspotOrder);\n this.removeEventListener('register-qti-hotspot-choice', this.positionHotspotOnRegister);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-graphic-order-interaction': QtiGraphicOrderInteraction;\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { ChoicesMixin } from '../internal/choices/choices.mixin';\nimport { positionHotspots } from '../internal/hotspots/hotspot';\nimport { QtiHotspotChoice } from '../qti-hotspot-choice';\nimport { Interaction } from '../internal/interaction/interaction';\n\n@customElement('qti-hotspot-interaction')\nexport class QtiHotspotInteraction extends ChoicesMixin(Interaction, 'qti-hotspot-choice') {\n // do not select ( highlight blue, the image)\n // target the main slot make it relative and fit with the conten\n static override styles = [\n css`\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n `\n ];\n override render() {\n return html`\n <slot name=\"prompt\"></slot>\n <!-- slot for the prompt -->\n <slot></slot>\n <!-- slot for the image and hotspots -->\n `;\n }\n\n private positionHotspotOnRegister(e: CustomEvent<QtiHotspotChoice>): void {\n const img = this.querySelector('img') as HTMLImageElement;\n const hotspot = e.target as QtiHotspotChoice;\n const coords = hotspot.getAttribute('coords');\n const shape = hotspot.getAttribute('shape');\n const coordsNumber = coords.split(',').map(s => parseInt(s));\n\n positionHotspots(shape, coordsNumber, img, hotspot);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('register-qti-hotspot-choice', this.positionHotspotOnRegister);\n }\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('unregister-qti-hotspot-choice', this.positionHotspotOnRegister);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-hotspot-interaction': QtiHotspotInteraction;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ActiveElementMixin } from './internal/active-element/active-element.mixin';\n\n/* \nqti-match-interaction\nqti-associate-interaction\n*/\n@customElement('qti-simple-associable-choice')\n// tslint:disable: indent\nexport class QtiSimpleAssociableChoice extends ActiveElementMixin(LitElement, 'qti-simple-associable-choice') {\n static styles = css`\n :host {\n display: flex;\n user-select: none;\n }\n slot {\n width: 100%;\n display: block;\n }\n slot[name='qti-simple-associable-choice'] {\n width: 100%;\n }\n `;\n\n /** the minimal number of selections a candidate must make */\n @property({\n type: Number,\n attribute: 'match-min'\n })\n public matchMin: number = 0;\n\n /** the maximum number of selections a candidate must make, the other options will be disabled when max options is checked */\n @property({\n type: Number,\n attribute: 'match-max'\n })\n public matchMax: number = 1;\n\n @property({\n type: Boolean,\n attribute: 'fixed'\n })\n public fixed = false;\n\n // pk: This needs some explanation\n // in the associate interaction there is a special slot for these qti-simple-associable-choices\n override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('slot', 'qti-simple-associable-choice');\n this.setAttribute('part', 'qti-simple-associable-choice');\n }\n\n // pk: This needs some explanation\n // in qti-match-interaction, qti-simple-associable-choice is used to denote the\n // draggable, but also the droppable. WEIRD.. but lets deal with it.\n // So we have a slot for whenever another qti-simple-associable-choice is dropped in here.\n // And we have slot for content like in this associate interaction\n override render() {\n return html`\n <slot part=\"slot\"></slot>\n <slot part=\"dropslot\" name=\"qti-simple-associable-choice\"></slot>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-simple-associable-choice': QtiSimpleAssociableChoice;\n }\n}\n","import { css } from 'lit';\n// import componentStyles from '../../utilities/styles/component.styles';\n\n/* ${componentStyles} */\nexport default css`\n slot:not([hidden]) {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n align-items: flex-start; /* prevents the drag and drop container slots having the same height */\n }\n :host(.qti-choices-top) slot {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) slot {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) slot {\n flex-direction: row;\n }\n :host(.qti-choices-right) slot {\n flex-direction: row-reverse;\n }\n slot[name='prompt'] {\n display: block;\n }\n ::slotted(qti-simple-match-set) {\n /* Make sure the drag and drop container slots have the same width */\n flex: 1;\n }\n`;\n","import { CSSResultGroup, html, nothing } from 'lit';\nimport { DragDropInteractionMixin } from '../internal/drag-drop/drag-drop-interaction-mixin';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { ResponseInteraction } from '../../internal/expression-result';\nimport '../qti-simple-associable-choice';\nimport { QtiSimpleAssociableChoice } from '../qti-simple-associable-choice';\nimport styles from './qti-match-interaction.styles';\nimport { Interaction } from '../internal/interaction/interaction';\n\n@customElement('qti-match-interaction')\nexport class QtiMatchInteraction extends DragDropInteractionMixin(\n Interaction,\n 'qti-simple-match-set:first-of-type qti-simple-associable-choice, qti-simple-match-set:last-of-type > qti-simple-associable-choice > qti-simple-associable-choice',\n 'qti-simple-match-set:last-of-type > qti-simple-associable-choice',\n 'qti-simple-match-set:first-of-type'\n) {\n static styles: CSSResultGroup = styles;\n\n protected rows: QtiSimpleAssociableChoice[];\n protected cols: QtiSimpleAssociableChoice[];\n protected lastCheckedRadio: HTMLInputElement | null = null;\n\n @property({ type: String }) class: string = '';\n @state() protected _response: string | string[] = [];\n // dragDropApi: TouchDragAndDrop;\n get value(): string[] {\n if (!this.classList.contains('qti-match-tabular')) return super.value as string[];\n else return this._response as string[];\n }\n set value(val: string[]) {\n if (!this.classList.contains('qti-match-tabular')) super.value = val;\n else this._response = val;\n }\n @property({ type: String, attribute: 'response-identifier' }) responseIdentifier: string = '';\n @state() protected correctOptions: string[] = [];\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.rows = Array.from<QtiSimpleAssociableChoice>(\n this.querySelectorAll('qti-simple-match-set:first-of-type qti-simple-associable-choice')\n );\n this.cols = Array.from<QtiSimpleAssociableChoice>(\n this.querySelectorAll('qti-simple-match-set:last-of-type qti-simple-associable-choice')\n );\n\n this.value = [];\n }\n\n protected handleRadioClick = e => {\n const radio = e.target as HTMLInputElement;\n if (this.lastCheckedRadio === radio) {\n radio.checked = false;\n this.lastCheckedRadio = null;\n this.handleRadioChange(e);\n } else {\n this.lastCheckedRadio = radio;\n }\n };\n\n protected handleRadioChange = e => {\n const checkbox = e.target as HTMLInputElement;\n const value = checkbox.value;\n const name = checkbox.name;\n const type = checkbox.type;\n\n if (checkbox.checked) {\n if (!this.value) {\n this.value = [value];\n } else if (this.value.indexOf(value) === -1) {\n if (type === 'radio') {\n this.value = this.value.filter(v => v.indexOf(name) === -1);\n }\n this.value = [...this.value, value];\n }\n this.lastCheckedRadio = checkbox;\n } else {\n this.value = this.value.filter(v => v !== value);\n this.lastCheckedRadio = null;\n }\n\n this.requestUpdate();\n this.dispatchEvent(\n new CustomEvent<ResponseInteraction>('qti-interaction-response', {\n bubbles: true,\n composed: true,\n detail: {\n responseIdentifier: this.responseIdentifier,\n response: Array.isArray(this.value) ? [...this.value] : this.value\n }\n })\n );\n };\n\n set correctResponse(responseValue: string | string[]) {\n if (responseValue === '') {\n this.correctOptions = [];\n return;\n } else if (Array.isArray(responseValue)) {\n this.correctOptions = responseValue;\n }\n }\n\n override render() {\n const isTabular = this.class.split(' ').includes('qti-match-tabular');\n return html`\n <slot name=\"prompt\"></slot>\n <slot ?hidden=${isTabular}></slot>\n\n ${isTabular\n ? html`\n <table>\n <tr>\n <td></td>\n ${this.cols.map(col => html`<th part=\"r-header\">${unsafeHTML(col.innerHTML)}</th>`)}\n </tr>\n\n ${this.rows.map(\n row =>\n html`<tr>\n <td part=\"c-header\">${unsafeHTML(row.innerHTML)}</td>\n ${this.cols.map(col => {\n const rowId = row.getAttribute('identifier');\n const colId = col.getAttribute('identifier');\n const value = `${rowId} ${colId}`;\n const selectedInRowCount = this.value.filter(v => v.split(' ')[0] === rowId).length || 0;\n const checked = this.value.includes(value);\n const part = `rb ${checked ? 'rb-checked' : ''} ${this.correctOptions.includes(value) ? 'rb-correct' : ''}`;\n // disable if match max is greater than 1 and max is reached\n const disable =\n this.correctOptions.length > 0\n ? true\n : row.matchMax === 1\n ? false\n : selectedInRowCount >= row.matchMax && !checked;\n return html`<td>\n <input\n type=${row.matchMax === 1 ? 'radio' : `checkbox`}\n part=${part}\n name=${rowId}\n value=${value}\n .disabled=${disable}\n @change=${e => this.handleRadioChange(e)}\n @click=${e => (row.matchMax === 1 ? this.handleRadioClick(e) : null)}\n />\n </td>`;\n })}\n </tr>`\n )}\n </table>\n `\n : nothing}\n\n <div role=\"alert\" id=\"validationMessage\"></div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-match-interaction': QtiMatchInteraction;\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { Interaction } from '../internal/interaction/interaction';\n\n@customElement('qti-media-interaction')\nexport class QtiMediaInteraction extends Interaction {\n private _value = 0;\n reset() {\n // throw new Error('Method not implemented.');\n }\n validate(): boolean {\n return true;\n // maybe check if the media has been played?\n }\n\n get value(): string | string[] {\n return this._value.toString();\n }\n\n set value(val: string | string[]) {\n const isNumber = !isNaN(parseInt(val.toString()));\n if (isNumber) {\n this._value = parseInt(val.toString());\n } else {\n throw new Error('Value must be a number');\n }\n }\n\n static override get properties() {\n return {\n ...Interaction.properties,\n ...{\n step: {\n type: Number,\n attribute: 'step',\n default: 10\n }\n }\n };\n }\n\n static override styles = [css``];\n\n override render() {\n return html` <slot name=\"prompt\"></slot>\n <slot></slot>`;\n }\n\n constructor() {\n super();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n // get audio, video of object tag.\n const mediaObject = this.querySelector('audio') || this.querySelector('video') || this.querySelector('object');\n if (mediaObject) {\n // listen to ended event\n mediaObject.addEventListener('ended', () => {\n // set value to 0\n // check if this.value is a number\n this._value++;\n this.saveResponse(this.value);\n });\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-media-interaction': QtiMediaInteraction;\n }\n}\n","import { css } from 'lit';\n// import componentStyles from '../../utilities/styles/component.styles';\n// :host {\n// display: inline-block;\n// position: relative;\n// }\n/* ${componentStyles} */\nexport default css`\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n }\n\n [part='drops'] {\n flex: 1;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n }\n\n :host([orientation='horizontal']) [part='drags'] {\n flex-direction: row;\n }\n :host([orientation='horizontal']) [part='drops'] {\n grid-auto-flow: column;\n }\n :host([orientation='vertical']) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'] {\n grid-auto-flow: row;\n }\n\n [part='drop-list'] {\n display: block;\n flex: 1;\n }\n\n [part='container'] {\n display: flex;\n gap: 0.5rem;\n }\n :host(.qti-choices-top) [part='container'] {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) [part='container'] {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) [part='container'] {\n flex-direction: row;\n }\n :host(.qti-choices-right) [part='container'] {\n flex-direction: row-reverse;\n }\n`;\n","import { html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { DragDropInteractionMixin } from '../internal/drag-drop/drag-drop-interaction-mixin';\nimport { ShuffleMixin } from '../internal/shuffle/shuffle-mixin'; // Import the mixin\nimport { QtiSimpleChoice } from '../qti-simple-choice';\nimport { Interaction } from '../internal/interaction/interaction';\nimport styles from './qti-order-interaction.styles';\n@customElement('qti-order-interaction')\nexport class QtiOrderInteraction extends ShuffleMixin(\n DragDropInteractionMixin(Interaction, `qti-simple-choice`, 'drop-list', `slot[part='drags']`),\n 'qti-simple-choice'\n) {\n static styles = styles;\n childrenMap: Element[];\n\n @state() nrChoices: number = 0;\n @state() correctResponses: string[] = [];\n @state() showCorrectResponses: boolean = false;\n\n /** orientation of choices */\n @property({ type: String })\n public orientation: 'horizontal' | 'vertical';\n\n override render() {\n const choices = Array.from(this.querySelectorAll('qti-simple-choice'));\n if (this.nrChoices < choices.length) {\n this.nrChoices = choices.length;\n }\n\n return html` <slot name=\"prompt\"> </slot>\n <div part=\"container\">\n <slot part=\"drags\"> </slot>\n <div part=\"drops\">\n ${Array.from(Array(this.nrChoices)).map(\n (_, i) =>\n html`<drop-list part=\"drop-list\" identifier=\"droplist${i}\"></drop-list>${this.showCorrectResponses &&\n this.correctResponses.length > i\n ? unsafeHTML(`<span part='correct-response'>${this.correctResponses[i]}</span>`)\n : ''}`\n )}\n </div>\n </div>`;\n }\n\n set correctResponse(value: string | string[]) {\n if (value === '') {\n this.showCorrectResponses = false;\n return;\n }\n\n if (this.correctResponses.length === 0) {\n const responses = Array.isArray(value) ? value : [value];\n\n responses.forEach(response => {\n let simpleChoice = this.querySelector(`qti-simple-choice[identifier=\"${response}\"]`);\n if (!simpleChoice) {\n simpleChoice = this.shadowRoot.querySelector(`qti-simple-choice[identifier=\"${response}\"]`);\n }\n\n const text = simpleChoice?.textContent.trim();\n this.correctResponses = [...this.correctResponses, text];\n });\n }\n\n this.showCorrectResponses = true;\n }\n\n // some interactions have a different way of getting the response\n // this is called from the drag and drop mixin class\n // you have to implement your own getResponse method in the superclass\n // cause they are different for some interactions.\n // MH: is this function called? Shouldn't we use getValue?\n protected getResponse(): string[] {\n const droppables = Array.from<QtiSimpleChoice>(this.shadowRoot.querySelectorAll('drop-list'));\n\n const response = droppables.map(droppable => {\n const dragsInDroppable = droppable.querySelectorAll('[qti-draggable=\"true\"]');\n const identifiers = Array.from(dragsInDroppable).map(d => d.getAttribute('identifier'));\n return [...identifiers].join(' ');\n });\n return response;\n }\n\n override async firstUpdated(changedProps) {\n super.firstUpdated(changedProps);\n this.childrenMap = Array.from(this.querySelectorAll('qti-simple-choice'));\n this.childrenMap.forEach(el => el.setAttribute('part', 'qti-simple-choice'));\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-order-interaction': QtiOrderInteraction;\n }\n}\n","import { LitElement, css, html } from 'lit';\n\nexport class QtiPositionObjectInteraction extends LitElement {\n override render() {\n return html`<slot></slot>`;\n }\n\n static override styles = [\n css`\n :host {\n display: block;\n }\n ::slotted(img) {\n position: absolute;\n cursor: move;\n user-select: none;\n left: 50%;\n transform: translateX(-50%);\n }\n `\n ];\n}\n\ncustomElements.define('qti-position-object-interaction', QtiPositionObjectInteraction);\n","import { LitElement, css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('qti-position-object-stage')\nexport class QtiPositionObjectStage extends LitElement {\n choiceOrdering: boolean;\n startX: any;\n startY: any;\n dragElement: any;\n\n override render() {\n return html`<slot></slot>`;\n }\n\n static override styles = [\n css`\n :host {\n display: inline-block;\n position: relative;\n }\n `\n ];\n\n constructor() {\n super();\n this.removeMoveListener = this.removeMoveListener.bind(this);\n this.dragElementHandler = this.dragElementHandler.bind(this);\n }\n\n // Define a function to handle the mousemove event on the draggable element\n dragElementHandler(event) {\n event.preventDefault();\n\n // Calculate the distance the mouse has moved since the last event\n const deltaX = event.clientX - this.startX;\n const deltaY = event.clientY - this.startY;\n\n // Update the position of the draggable element\n this.dragElement.style.left = this.dragElement.offsetLeft + deltaX + 'px';\n this.dragElement.style.top = this.dragElement.offsetTop + deltaY + 'px';\n\n // Update the starting position of the mouse\n this.startX = event.clientX;\n this.startY = event.clientY;\n }\n\n override firstUpdated(a): void {\n super.firstUpdated(a);\n\n // Get the draggable and drop zone elements\n this.dragElement = this.querySelector('qti-position-object-interaction>img');\n // const canvasElement = document.getElementById('canvas');\n\n // Initialize variables for the starting position of the draggable element\n this.startX = 0;\n this.startY = 0;\n\n // Add a mousedown event listener to the draggable element\n this.dragElement.addEventListener('mousedown', (event: MouseEvent) => {\n // Save the starting position of the mouse\n this.startX = event.clientX;\n this.startY = event.clientY;\n\n // Add a mousemove event listener to the document\n document.addEventListener('mousemove', this.dragElementHandler, true);\n });\n document.addEventListener('mouseup', this.removeMoveListener);\n }\n\n removeMoveListener() {\n document.removeEventListener('mousemove', this.dragElementHandler, true);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener('mousemove', this.dragElementHandler);\n document.removeEventListener('mouseup', this.removeMoveListener);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-position-object-stage': QtiPositionObjectStage;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange} from '../lit-html.js';\nimport {\n directive,\n Directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\n\n/**\n * A key-value set of CSS properties and values.\n *\n * The key should be either a valid CSS property name string, like\n * `'background-color'`, or a valid JavaScript camel case property name\n * for CSSStyleDeclaration like `backgroundColor`.\n */\nexport interface StyleInfo {\n [name: string]: string | number | undefined | null;\n}\n\nconst important = 'important';\n// The leading space is important\nconst importantFlag = ' !' + important;\n// How many characters to remove from a value, as a negative number\nconst flagTrim = 0 - importantFlag.length;\n\nclass StyleMapDirective extends Directive {\n private _previousStyleProperties?: Set<string>;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (\n partInfo.type !== PartType.ATTRIBUTE ||\n partInfo.name !== 'style' ||\n (partInfo.strings?.length as number) > 2\n ) {\n throw new Error(\n 'The `styleMap` directive must be used in the `style` attribute ' +\n 'and must be the only part in the attribute.'\n );\n }\n }\n\n render(styleInfo: Readonly<StyleInfo>) {\n return Object.keys(styleInfo).reduce((style, prop) => {\n const value = styleInfo[prop];\n if (value == null) {\n return style;\n }\n // Convert property names from camel-case to dash-case, i.e.:\n // `backgroundColor` -> `background-color`\n // Vendor-prefixed names need an extra `-` appended to front:\n // `webkitAppearance` -> `-webkit-appearance`\n // Exception is any property name containing a dash, including\n // custom properties; we assume these are already dash-cased i.e.:\n // `--my-button-color` --> `--my-button-color`\n prop = prop.includes('-')\n ? prop\n : prop\n .replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&')\n .toLowerCase();\n return style + `${prop}:${value};`;\n }, '');\n }\n\n override update(part: AttributePart, [styleInfo]: DirectiveParameters<this>) {\n const {style} = part.element as HTMLElement;\n\n if (this._previousStyleProperties === undefined) {\n this._previousStyleProperties = new Set(Object.keys(styleInfo));\n return this.render(styleInfo);\n }\n\n // Remove old properties that no longer exist in styleInfo\n for (const name of this._previousStyleProperties) {\n // If the name isn't in styleInfo or it's null/undefined\n if (styleInfo[name] == null) {\n this._previousStyleProperties!.delete(name);\n if (name.includes('-')) {\n style.removeProperty(name);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (style as any)[name] = null;\n }\n }\n }\n\n // Add or update properties\n for (const name in styleInfo) {\n const value = styleInfo[name];\n if (value != null) {\n this._previousStyleProperties.add(name);\n const isImportant =\n typeof value === 'string' && value.endsWith(importantFlag);\n if (name.includes('-') || isImportant) {\n style.setProperty(\n name,\n isImportant\n ? (value as string).slice(0, flagTrim)\n : (value as string),\n isImportant ? important : ''\n );\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (style as any)[name] = value;\n }\n }\n }\n return noChange;\n }\n}\n\n/**\n * A directive that applies CSS properties to an element.\n *\n * `styleMap` can only be used in the `style` attribute and must be the only\n * expression in the attribute. It takes the property names in the\n * {@link StyleInfo styleInfo} object and adds the properties to the inline\n * style of the element.\n *\n * Property names with dashes (`-`) are assumed to be valid CSS\n * property names and set on the element's style object using `setProperty()`.\n * Names without dashes are assumed to be camelCased JavaScript property names\n * and set on the element's style object using property assignment, allowing the\n * style object to translate JavaScript-style names to CSS property names.\n *\n * For example `styleMap({backgroundColor: 'red', 'border-top': '5px', '--size':\n * '0'})` sets the `background-color`, `border-top` and `--size` properties.\n *\n * @param styleInfo\n * @see {@link https://lit.dev/docs/templates/directives/#stylemap styleMap code samples on Lit.dev}\n */\nexport const styleMap = directive(StyleMapDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {StyleMapDirective};\n","import { css, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { Interaction } from '../internal/interaction/interaction';\n\n@customElement('qti-select-point-interaction')\nexport class QtiSelectPointInteraction extends Interaction {\n static override styles = [\n css`\n :host {\n display: block;\n }\n point-container {\n display: block;\n position: relative;\n }\n `\n ];\n\n @property({\n type: Number,\n attribute: 'max-choices'\n })\n public maxChoices: number = Infinity;\n\n @property({\n type: Number,\n attribute: 'min-choices'\n })\n public minChoices: number = 0;\n\n @state()\n private _points: string[] = [];\n\n // Reference to the image element\n private _imgElement: HTMLImageElement | null = null;\n\n // Extracted click handler method\n private _onImageClick = (event: MouseEvent) => {\n if (this._points.length < this.maxChoices) {\n const x = event.offsetX;\n const y = event.offsetY;\n\n this._points = [...this._points, `${x} ${y}`];\n this.saveResponse(this._points);\n }\n };\n\n override render() {\n return html` <slot name=\"prompt\"></slot>\n <point-container>\n ${repeat(\n this._points,\n point => point,\n (point, index) => html`\n <button\n part=\"point\"\n style=${styleMap({\n position: 'absolute',\n transform: 'translate(-50%, -50%)',\n left: `${point.split(' ')[0]}px`,\n top: `${point.split(' ')[1]}px`\n })}\n aria-label=\"Remove point at ${point}\"\n @click=${(e: Event) => {\n e.stopPropagation();\n this._points = this._points.filter((_, i) => i !== index);\n this.saveResponse(this._points);\n }}\n ></button>\n `\n )}\n <slot></slot>\n </point-container>`;\n }\n\n reset(): void {\n this._points = [];\n }\n\n validate(): boolean {\n return this._points.length >= this.minChoices && this._points.length <= this.maxChoices;\n }\n\n set value(val: string | string[]) {\n this._points = Array.isArray(val) ? val : [val];\n }\n get value(): string | string[] {\n return this._points;\n }\n\n override firstUpdated(): void {\n this._imgElement = this.querySelector('img');\n\n if (this._imgElement) {\n // Attach the click event listener to the image element\n this._imgElement.addEventListener('click', this._onImageClick);\n } else {\n console.warn('No <img> element found in <qti-select-point-interaction>');\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n\n if (this._imgElement) {\n // Remove the click event listener from the image element\n this._imgElement.removeEventListener('click', this._onImageClick);\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-select-point-interaction': QtiSelectPointInteraction;\n }\n}\n","import { css, html, nothing } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\n\nimport { watch } from '../../../decorators/watch';\nimport { Interaction } from '../internal/interaction/interaction';\n\n/**\n * @summary The SliderInteraction.Type (qti-slider-interaction) presents the candidate with a control for selecting a numerical value between a lower and upper bound.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.s61xcrj4qcyj\n * @status stable\n * @since 6.0\n *\n * @event qti-register-interaction - emitted when the interaction wants to register itself\n * @event qti-interaction-response - emitted when the interaction changes\n *\n * @cssprop --show-value - shows the current value while sliding\n * @cssprop --show-ticks - shows the ticks according to steps\n * @cssprop --show-bounds - shows value for lower and upper boundary\n *\n * @csspart slider -- slider inluding, bounds and ticks and value, use it for paddings and margins\n * @csspart bounds -- div for bounds, containing two divs for with min, and max bounds value\n * @csspart ticks -- div for ticks, use lineair gradient and exposed css variables for styling\n * @csspart rail -- div for rail, style according to needs\n * @csspart knob -- div, should be relative or absolute\n * @csspart value -- div, containing value\n *\n * @slot - The default slot where <qti-simple-choice> must be placed.\n * @slot prompt - slot where the prompt is placed.\n */\n\n@customElement('qti-slider-interaction')\nexport class QtiSliderInteraction extends Interaction {\n private _value = 0;\n csLive: CSSStyleDeclaration;\n\n // @query('#knob')\n // private _knob: HTMLElement;\n\n @query('#rail')\n private _rail: HTMLElement;\n\n @property({ type: Boolean, attribute: 'step-label' }) stepLabel = false;\n\n @property({ type: Boolean }) reverse = false;\n\n private _min: number;\n @property({ type: Number, attribute: 'lower-bound' }) set min(value: number) {\n this._min = value;\n this._value = value;\n this.style.setProperty('--min', `${this._min}`);\n }\n get min(): number {\n return this._min;\n }\n\n private _max: number;\n @property({ type: Number, attribute: 'upper-bound' }) set max(value: number) {\n this._max = value;\n this.style.setProperty('--max', `${this._max}`);\n }\n get max(): number {\n return this._max;\n }\n\n private _step: number;\n @property({ type: Number, attribute: 'step' }) set step(value: number) {\n this._step = value;\n this.style.setProperty('--step', `${this._step}`);\n }\n get step(): number {\n return this._step;\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n _handleDisabledChange = () => {};\n\n @watch('readonly', { waitUntilFirstUpdate: true })\n _handleReadonlyChange = () => {};\n\n reset() {\n // throw new Error('Method not implemented.');\n }\n validate(): boolean {\n return true;\n }\n\n get value(): string | string[] {\n return this._value.toString();\n }\n\n set value(val: string | string[]) {\n const isNumber = !isNaN(parseInt(val.toString()));\n if (isNumber) {\n this._value = parseInt(val.toString());\n } else {\n throw new Error('Value must be a number');\n }\n }\n\n // static shadowRootOptions: ShadowRootInit = { ...LitElement.shadowRootOptions, delegatesFocus: true, mode: 'open' };\n\n constructor() {\n super();\n /* the computed style is a live property, we use this to get css variables\n see render template */\n this.csLive = getComputedStyle(this);\n }\n\n set response(myResponse: string | string[]) {\n if (Array.isArray(myResponse)) {\n console.error('QtiSliderInteraction: response is an array, but should be a single value');\n return;\n }\n const value = parseInt(myResponse);\n if (Number.isNaN(value)) {\n console.error('QtiSliderInteraction: response is not a number');\n return;\n }\n this._value = value;\n }\n\n static override styles = [css``];\n\n override render() {\n // convert the value, which is the real slider value to a percentage for the dom.\n if (this._value < this.min) {\n this._value = this.min;\n }\n if (this._value > this.max) {\n this._value = this.max;\n }\n const valuePercentage = ((this._value - this.min) / (this.max - this.min)) * 100;\n this.style.setProperty('--value-percentage', `${valuePercentage}%`);\n this.setAttribute('aria-valuenow', this.value.toString());\n\n return html`<slot name=\"prompt\"></slot>\n <div id=\"slider\" part=\"slider\">\n ${this.csLive.getPropertyValue('--show-bounds') == 'true'\n ? html`<div id=\"bounds\" part=\"bounds\">\n <div>${this._min}</div>\n <div>${this._max}</div>\n </div>`\n : nothing}\n ${this.csLive.getPropertyValue('--show-ticks') == 'true' ? html`<div id=\"ticks\" part=\"ticks\"></div>` : nothing}\n <div id=\"rail\" part=\"rail\" @mousedown=${this._onMouseDown} @touchstart=${this._onTouchMove}>\n <div id=\"knob\" part=\"knob\">\n ${this.csLive.getPropertyValue('--show-value') == 'true'\n ? html`<div id=\"value\" part=\"value\">${this.value}</div>`\n : nothing}\n </div>\n </div>\n </div>`;\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.step = 1;\n this.setAttribute('tabindex', '0');\n this.setAttribute('role', 'slider');\n }\n\n private _onTouchMove(event) {\n const handleTouchMove = event => {\n const { x } = this.getPositionFromEvent(event);\n const diffX = x - this._rail.getBoundingClientRect().left - document.documentElement.scrollLeft;\n this.calculateValue(diffX);\n event.stopPropagation();\n };\n\n const handleTouchEnd = () => {\n document.removeEventListener('touchmove', handleTouchMove);\n document.removeEventListener('touchend', handleTouchEnd);\n\n this.saveResponse(this.value.toString());\n };\n\n document.addEventListener('touchmove', handleTouchMove);\n document.addEventListener('touchend', handleTouchEnd);\n\n const { x } = this.getPositionFromEvent(event);\n const diffX = x - this._rail.getBoundingClientRect().left - document.documentElement.scrollLeft;\n this.calculateValue(diffX);\n event.stopPropagation();\n }\n\n private _onMouseDown(event) {\n const handleMouseMove = (event: MouseEvent) => {\n // if the qti-slider-interaction has an absolute left position and body is scrolled a bit, take account for that\n const diffX = event.pageX - this._rail.getBoundingClientRect().left - document.documentElement.scrollLeft;\n\n this.calculateValue(diffX);\n event.preventDefault();\n event.stopPropagation();\n };\n\n const handleMouseUp = () => {\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n\n this.saveResponse(this.value.toString());\n };\n\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n\n // if the qti-slider-interaction has an absolute left position and body is scrolled a bit, take account for that\n const diffX = event.pageX - this._rail.getBoundingClientRect().left - document.documentElement.scrollLeft;\n\n this.calculateValue(diffX);\n event.preventDefault();\n event.stopPropagation();\n }\n\n /** calculateValue gets x position and compares this with the total width in pixels */\n private calculateValue(diffX: number) {\n const valueNow = this.min + ((this.max - this.min) * diffX) / this._rail.getBoundingClientRect().width;\n const roundedStepValue = this.min + Math.round((valueNow - this.min) / this._step) * this._step;\n this._value = roundedStepValue;\n }\n\n private getPositionFromEvent(e: any): {\n x: number;\n y: number;\n } {\n let _touchMove;\n if (e.type == 'touchstart' || e.type == 'touchmove' || e.type == 'touchend' || e.type == 'touchcancel') {\n const evt = typeof e.originalEvent === 'undefined' ? e : e.originalEvent;\n const touch = evt.touches[0] || evt.changedTouches[0];\n _touchMove = {\n x: touch.pageX,\n y: touch.pageY\n };\n } else if (\n e.type == 'mousedown' ||\n e.type == 'mouseup' ||\n e.type == 'mousemove' ||\n e.type == 'mouseover' ||\n e.type == 'mouseout' ||\n e.type == 'mouseenter' ||\n e.type == 'mouseleave'\n ) {\n _touchMove = {\n x: e.clientX,\n y: e.clientY\n };\n }\n return _touchMove;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-slider-interaction': QtiSliderInteraction;\n }\n}\n","import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\nimport { Calculate } from '../internal/expression-result';\nimport { ResponseVariable } from '../internal/variables';\nimport { ItemContext, itemContext } from '../qti-assessment-item/qti-assessment-item.context';\n\n/**\n * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw\n * <qti-custom-operator class=\"js.org\">\n <qti-base-value base-type=\"string\"><![CDATA[\n console.log(context.variables);\n return 'B'\n document.querySelector('qti-end-attempt-interaction').disabled = true;\n ]]></qti-base-value>\n </qti-custom-operator>\n </qti-set-outcome-value>\n */\n@customElement('qti-custom-operator')\nexport class QtiCustomOperator extends LitElement implements Calculate {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n private operatorFunction: Function;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n private _context?: ItemContext;\n\n render() {\n return html`<slot @slotchange=${this.handleSlotChange}></slot>`;\n }\n\n handleSlotChange() {\n // expecting <[!CDATA[ ... ]]> is converted into <!-- ... --> with qti-transform: cDataToComment\n const commentNode = Array.from(this.firstElementChild?.childNodes ?? []).find(\n node => node.nodeType === Node.COMMENT_NODE\n );\n try {\n this.operatorFunction = new Function('context', 'fn', 'item', commentNode.textContent ?? '');\n } catch (e) {\n console.error('custom-operator contains invalid javascript code', e);\n }\n }\n\n public calculate() {\n const fn = {\n variable: (responseIdentifier: string) =>\n this._context?.variables.find(v => v.identifier === responseIdentifier)?.value ?? '',\n correct: (responseIdentifier: string) =>\n (this._context?.variables.find(v => v.identifier === responseIdentifier) as ResponseVariable)\n ?.correctResponse ?? ''\n };\n const item = {\n getVariable: (variableIdentifier: string) =>\n this._context?.variables.find(v => v.identifier === variableIdentifier),\n updateOutcomeVariable: (outcomeIdentifier: string, value: string | string[]) => {\n this.dispatchEvent(\n new CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>('qti-set-outcome-value', {\n bubbles: true,\n composed: true,\n detail: {\n outcomeIdentifier,\n value\n }\n })\n );\n },\n updateResponseVariable: (responseIdentifier: string, response: string | string[]) => {\n this.dispatchEvent(\n new CustomEvent<{ responseIdentifier: string; response: string | string[] }>('qti-interaction-response', {\n bubbles: true,\n composed: true,\n detail: {\n responseIdentifier,\n response\n }\n })\n );\n }\n };\n\n return this.operatorFunction(this._context, fn, item);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-custom-operator': QtiCustomOperator;\n }\n}\n","import { LitElement, css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('qti-associable-hotspot')\nexport class QtiAssociableHotspot extends LitElement {\n static styles = css`\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n `;\n\n override connectedCallback() {\n super.connectedCallback();\n this.dispatchEvent(\n new CustomEvent('qti-register-hotspot', {\n bubbles: true,\n composed: true,\n cancelable: false\n })\n );\n }\n\n override render() {\n return html` <slot name=\"drags\"></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-associable-hotspot': QtiAssociableHotspot;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n@customElement('qti-gap')\nexport class QtiGap extends LitElement {\n static styles = css`\n :host {\n display: flex;\n user-select: none;\n }\n `;\n\n @property({ type: Number, reflect: true }) tabindex: number | undefined = 0;\n\n override render() {\n return html` <slot name=\"drags\"></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-gap': QtiGap;\n }\n}\n","import { css, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n@customElement('qti-gap-img')\nexport class QtiGapImg extends LitElement {\n static styles = css`\n :host {\n display: flex;\n user-select: none;\n }\n `;\n\n @property({ type: Number, reflect: true }) tabindex: number | undefined = 0;\n\n connectedCallback() {\n this.setAttribute('slot', 'drags');\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-gap-img': QtiGapImg;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ActiveElementMixin } from './internal/active-element/active-element.mixin';\n\n@customElement('qti-gap-text')\nexport class QtiGapText extends ActiveElementMixin(LitElement, 'qti-gap-text') {\n static styles = css`\n :host {\n display: inline-flex;\n user-select: none;\n }\n `;\n\n @property({ type: Number, reflect: true }) tabindex: number | undefined = 0;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('slot', 'drags');\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-gap-text': QtiGapText;\n }\n}\n","import { css, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ActiveElementMixin } from './internal/active-element/active-element.mixin';\n\n// type shape = { shape: 'rect' | 'circle' | 'poly'; coords: number[] };\n\n@customElement('qti-hotspot-choice')\nexport class QtiHotspotChoice extends ActiveElementMixin(LitElement, 'qti-hotspot-choice') {\n static styles = css`\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n `;\n @property({ attribute: 'aria-ordervalue', type: Number, reflect: true }) order: number;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-hotspot-choice': QtiHotspotChoice;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { ActiveElementMixin } from './internal/active-element/active-element.mixin';\n\n@customElement('qti-hottext')\nexport class QtiHottext extends ActiveElementMixin(LitElement, 'qti-hottext') {\n static styles = css`\n :host {\n display: flex;\n user-select: none;\n }\n `;\n\n override render() {\n return html`<div part=\"ch\"><div part=\"cha\"></div></div>\n <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-hottext': QtiHottext;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n@customElement('qti-inline-choice')\nexport class QtiInlineChoice extends LitElement {\n static override get styles() {\n return [\n css`\n :host {\n display: block;\n cursor: pointer;\n }\n `\n ];\n }\n\n @property({ type: String })\n identifier: string;\n\n override connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('click', this._onSelectInlineChoice);\n\n this.dispatchEvent(\n new CustomEvent('qti-inline-choice-register', {\n bubbles: true,\n composed: true,\n cancelable: false\n })\n );\n }\n\n override disconnectedCallback() {\n this.removeEventListener('click', this._onSelectInlineChoice);\n }\n\n override render() {\n return html` <slot></slot> `;\n }\n\n private _onSelectInlineChoice() {\n // if (this.disabled || this.readonly) return;\n\n this.dispatchEvent(\n new CustomEvent('qti-inline-choice-select', {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail: { identifier: this.identifier }\n })\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-inline-choice': QtiInlineChoice;\n }\n}\n","import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ActiveElementMixin } from './internal/active-element/active-element.mixin';\n\n/**\n * qti-order-interaction\n * qti-choice-interaction\n */\n@customElement('qti-simple-choice')\nexport class QtiSimpleChoice extends ActiveElementMixin(LitElement, 'qti-simple-choice') {\n static styles = css`\n :host {\n display: flex;\n align-items: center;\n user-select: none;\n }\n slot {\n width: 100%;\n display: flex;\n align-items: center;\n }\n [part='ch'] {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n `;\n\n // property label\n @property({ type: String, attribute: false })\n public marker: string;\n\n\n get checked() {\n return this['internals'].states.has('--checked');\n }\n\n override render() {\n return html`<div part=\"ch\">\n <div part=\"cha\"></div>\n </div>\n ${this.marker ? html`<div id=\"label\">${this.marker}</div>` : nothing}\n <slot part=\"slot\"></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-simple-choice': QtiSimpleChoice;\n }\n}\n","/* only exported to override or extend for specific purposes */\nexport * from './internal/event-types';\nexport * from './internal/events';\nexport * from './internal/expression-result';\nexport * from './internal/variables';\n/* only exported to override or extend for specific purposes */\nexport * from './qti-assessment-item/qti-assessment-item';\nexport * from './qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nexport * from './qti-interaction/internal/active-element/active-element.mixin';\nexport * from './qti-item-body/qti-item-body';\nexport * from './qti-prompt/qti-prompt';\nexport * from './qti-stylesheet/qti-stylesheet';\n/* start response and outcome */\nexport * from './qti-variable-declaration/qti-outcome-declaration/qti-outcome-declaration';\nexport * from './qti-variable-declaration/qti-response-declaration/qti-response-declaration';\n/* end response and outcome */\nexport * from './qti-companion-materials-info/qti-companion-materials-info';\nexport * from './qti-rubric-block/qti-content-body';\nexport * from './qti-rubric-block/qti-rubric-block';\n/* start feedback */\nexport * from './qti-feedback/qti-feedback-block/qti-feedback-block';\nexport * from './qti-feedback/qti-feedback-inline/qti-feedback-inline';\nexport * from './qti-feedback/qti-modal-feedback/qti-modal-feedback';\n/* end feedback */\n/* start textentryinteraction */\nexport * from './qti-interaction/qti-extended-text-interaction/qti-extended-text-interaction';\nexport * from './qti-interaction/qti-text-entry-interaction/qti-text-entry-interaction';\n/* end textentryinteraction */\n/* start hottext */\nexport * from './qti-interaction/qti-hottext-interaction/qti-hottext-interaction';\n/* end hottext */\n/* start inlinechoice */\nexport * from './qti-interaction/qti-inline-choice-interaction/qti-inline-choice-interaction';\n/* end inlinechoice */\n/* start choiceinteraction */\nexport * from './qti-interaction/qti-choice-interaction/qti-choice-interaction';\n/* end choiceinteraction */\nexport * from './qti-outcome-processing/qti-outcome-processing';\nexport * from './qti-response-processing';\n/* start custom interactions */\nexport * from './qti-interaction/qti-portable-custom-interaction/qti-portable-custom-interaction';\n/* end custom interactions */\n/* start only preview items */\nexport * from './qti-interaction/qti-associate-interaction/qti-associate-interaction';\nexport * from './qti-interaction/qti-custom-interaction/qti-custom-interaction';\nexport * from './qti-interaction/qti-end-attempt-interaction/qti-end-attempt-interaction';\nexport * from './qti-interaction/qti-gap-match-interaction/qti-gap-match-interaction';\nexport * from './qti-interaction/qti-graphic-associate-interaction/qti-graphic-associate-interaction';\nexport * from './qti-interaction/qti-graphic-gap-match-interaction/qti-graphic-gap-match-interaction';\nexport * from './qti-interaction/qti-graphic-order-interaction/qti-graphic-order-interaction';\nexport * from './qti-interaction/qti-hotspot-interaction/qti-hotspot-interaction';\nexport * from './qti-interaction/qti-match-interaction/qti-match-interaction';\nexport * from './qti-interaction/qti-media-interaction/qti-media-interaction';\nexport * from './qti-interaction/qti-order-interaction/qti-order-interaction';\nexport * from './qti-interaction/qti-position-object-interaction/qti-position-object-interaction';\nexport * from './qti-interaction/qti-position-object-interaction/qti-position-object-stage';\nexport * from './qti-interaction/qti-select-point-interaction/qti-select-point-interaction';\nexport * from './qti-interaction/qti-slider-interaction/qti-slider-interaction';\n/* end only preview items */\nexport * from './qti-assessment-item/qti-assessment-item.context';\nexport * from './qti-custom-operator/qti-custom-operator';\nexport * from './qti-interaction/internal/interaction/interaction';\nexport * from './qti-interaction/qti-associable-hotspot';\nexport * from './qti-interaction/qti-gap';\nexport * from './qti-interaction/qti-gap-img';\nexport * from './qti-interaction/qti-gap-text';\nexport * from './qti-interaction/qti-hotspot-choice';\nexport * from './qti-interaction/qti-hottext';\nexport * from './qti-interaction/qti-inline-choice';\nexport * from './qti-interaction/qti-simple-associable-choice';\nexport * from './qti-interaction/qti-simple-choice';\n\nconsole.log(\n '%cC¿TO%cLab%c: qti-components loaded',\n 'font-weight:bold; color:green',\n 'font-family: \"PT Sans\", font-weight:bold; color:green; font-size: smaller;vertical-align: sub',\n 'font-weight:unset'\n);\n\n// css for font pt-sans and subscript and green\n"],"mappings":";;;;;;;;;;;;;;AAiDM,IAAOA,IAAP,cACIC,MAAAA;EAaR,YACEC,IACAC,IACAC,KAAAA;AAEAC,UAAM,mBAAmB,EAACC,SAAAA,MAAeC,UAAAA,KAAU,CAAA,GACnDC,KAAKN,UAAUA,IACfM,KAAKL,WAAWA,IAChBK,KAAKJ,YAAYA,OAAAA;EAClB;AAAA;;;ACnBG,SAAUK,EAAsCC,KAAAA;AACpD,SAAOA;AACT;;;ICrBaC,WAAAA;EAsBX,YACEC,IACAC,IACAC,KACAC,IAAAA;AAKA,QAvBMC,KAASD,YAAAA,OAETC,KAAQC,WAAAA,OAEhBD,KAAKE,QAAAA,QAqDGF,KAAAG,IAA6C,CAACD,IAAOE,QAAAA;AAEvDJ,WAAKI,gBAEHJ,KAAKI,gBAAgBA,QAEvBJ,KAAKC,WAAAA,OACLD,KAAKI,YAAAA,IAGFJ,KAAKD,aACRC,KAAKI,YAA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H;AAAA,EACF;AAAA,EAES,uBAAuB;AAC9B,SAAK,oBAAoB,SAAS,KAAK,qBAAqB;AAAA,EAC9D;AAAA,EAES,SAAS;AAChB,WAAO;AAAA,EACT;AAAA,EAEQ,wBAAwB;AAG9B,SAAK;AAAA,MACH,IAAI,YAAY,4BAA4B;AAAA,QAC1C,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,QAAQ,EAAE,YAAY,KAAK,WAAW;AAAA,MACxC,CAAC;AAAA,IACH;AAAA,EACF;AACF;AApCE;AAAA,EADCC,GAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAZf,gBAaX;AAbW,kBAAN;AAAA,EADNC,GAAc,mBAAmB;AAAA,GACrB;;;ACKN,IAAM,kBAAN,cAA8B,mBAAmBC,IAAY,mBAAmB,EAAE;AAAA,EAyBvF,IAAI,UAAU;AACZ,WAAO,KAAK,WAAW,EAAE,OAAO,IAAI,WAAW;AAAA,EACjD;AAAA,EAES,SAAS;AAChB,WAAO;AAAA;AAAA;AAAA,QAGH,KAAK,SAAS,oBAAuB,KAAK,MAAM,WAAW,CAAO;AAAA;AAAA,EAExE;AACF;AApCa,gBACJ,SAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBT;AAAA,EADNC,GAAS,EAAE,MAAM,QAAQ,WAAW,MAAM,CAAC;AAAA,GArBjC,gBAsBJ;AAtBI,kBAAN;AAAA,EADNC,GAAc,mBAAmB;AAAA,GACrB;;;AC+Db,QAAQ;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["ContextRequestEvent","Event","context","callback","subscribe","super","bubbles","composed","this","createContext","key","ContextConsumer","host","contextOrOptions","callback","subscribe","this","provided","value","_callback","unsubscribe","requestUpdate","context","options","addController","hostConnected","dispatchRequest","hostDisconnected","dispatchEvent","ContextRequestEvent","ValueNotifier","value","this","_value","v","setValue","force","update","Object","is","updateObservers","defaultValue","subscriptions","Map","callback","disposer","consumerHost","subscribe","has","set","delete","get","clearCallbacks","clear","ContextProviderEvent","Event","context","super","bubbles","composed","this","ContextProvider","ValueNotifier","host","contextOrOptions","initialValue","onContextRequest","ev","consumerHost","composedPath","stopPropagation","addCallback","callback","subscribe","onProviderRequest","childProviderHost","seen","Set","subscriptions","has","add","dispatchEvent","ContextRequestEvent","attachListeners","addController","addEventListener","hostConnected","provide","context","protoOrTarget","nameOrContext","controllerMap","WeakMap","addInitializer","set","this","ContextProvider","get","call","value","setValue","constructor","element","descriptor","Object","getOwnPropertyDescriptor","newDescriptor","valueMap","configurable","enumerable","oldSetter","defineProperty","consume","context","subscribe","protoOrTarget","nameOrContext","addInitializer","ContextConsumer","this","callback","value","set","call","constructor","element","customElements","global","globalThis","supportsAdoptingStyleSheets","ShadowRoot","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet","constructionToken","Symbol","cssTagCache","WeakMap","CSSResult","cssText","strings","safeToken","this","Error","_strings","styleSheet","_styleSheet","cacheable","length","get","replaceSync","set","toString","unsafeCSS","value","String","css","values","reduce","acc","v","idx","adoptStyles","renderRoot","styles","adoptedStyleSheets","map","s","style","document","createElement","nonce","setAttribute","textContent","appendChild","getCompatibleStyle","sheet","rule","cssRules","is","defineProperty","getOwnPropertyDescriptor","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","Object","global","globalThis","customElements","trustedTypes","emptyStringForBooleanAttribute","emptyScript","polyfillSupport","reactiveElementPolyfillSupport","JSCompiler_renameProperty","prop","_obj","defaultConverter","value","type","Boolean","Array","JSON","stringify","fromValue","Number","parse","e","notEqual","old","defaultPropertyDeclaration","attribute","String","converter","reflect","hasChanged","Symbol","metadata","litPropertyMetadata","WeakMap","ReactiveElement","HTMLElement","initializer","this","__prepare","_initializers","push","observedAttributes","finalize","__attributeToPropertyMap","keys","name","options","state","elementProperties","set","noAccessor","key","descriptor","getPropertyDescriptor","prototype","get","v","call","oldValue","requestUpdate","configurable","enumerable","hasOwnProperty","superCtor","Map","finalized","props","properties","propKeys","p","createProperty","attr","__attributeNameForProperty","elementStyles","finalizeStyles","styles","isArray","Set","flat","Infinity","reverse","s","unshift","getCompatibleStyle","toLowerCase","constructor","super","__instanceProperties","isUpdatePending","hasUpdated","__reflectingProperty","__initialize","__updatePromise","Promise","res","enableUpdating","_$changedProperties","__saveInstanceProperties","forEach","i","controller","__controllers","add","renderRoot","isConnected","hostConnected","delete","instanceProperties","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","adoptStyles","connectedCallback","c","_requestedUpdate","disconnectedCallback","hostDisconnected","_old","_$attributeToProperty","attrValue","toAttribute","removeAttribute","setAttribute","ctor","propName","getPropertyOptions","fromAttribute","_$changeProperty","__enqueueUpdate","has","__reflectingProperties","reject","result","scheduleUpdate","performUpdate","wrapped","shouldUpdate","changedProperties","willUpdate","hostUpdate","update","__markUpdated","_$didUpdate","_changedProperties","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","__propertyToAttribute","mode","reactiveElementVersions","global","globalThis","trustedTypes","policy","createPolicy","createHTML","s","boundAttributeSuffix","marker","Math","random","toFixed","slice","markerMatch","nodeMarker","d","document","createTreeWalker","createMarker","createComment","isPrimitive","value","isArray","Array","isIterable","Symbol","iterator","SPACE_CHAR","textEndRegex","commentEndRegex","comment2EndRegex","tagEndRegex","RegExp","singleQuoteAttrEndRegex","doubleQuoteAttrEndRegex","rawTextElement","tag","type","strings","values","_$litType$","html","svg","mathml","noChange","for","nothing","templateCache","WeakMap","walker","trustFromTemplateString","tsa","stringFromTSA","hasOwnProperty","Error","getTemplateHtml","l","length","attrNames","rawTextEndRegex","regex","i","attrName","match","attrNameEndIndex","lastIndex","exec","test","end","startsWith","push","Template","constructor","options","node","this","parts","nodeIndex","attrNameIndex","partCount","el","createElement","currentNode","content","wrapper","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","name","getAttributeNames","endsWith","realName","statics","getAttribute","split","m","index","ctor","PropertyPart","BooleanAttributePart","EventPart","AttributePart","removeAttribute","tagName","textContent","emptyScript","append","data","indexOf","_options","innerHTML","resolveDirective","part","parent","attributeIndex","currentDirective","__directives","__directive","nextDirectiveConstructor","_$initialize","_$resolve","TemplateInstance","template","_$parts","_$disconnectableChildren","_$template","_$parent","parentNode","_$isConnected","fragment","creationScope","importNode","partIndex","templatePart","ChildPart","nextSibling","ElementPart","_$setValue","__isConnected","startNode","endNode","_$committedValue","_$startNode","_$endNode","isConnected","directiveParent","_$clear","_commitText","_commitTemplateResult","_commitNode","_commitIterable","insertBefore","_insert","createTextNode","result","_$getTemplate","h","_update","instance","_clone","get","set","itemParts","itemPart","item","start","from","_$notifyConnectionChanged","n","remove","element","fill","String","valueIndex","noCommit","change","v","_commitValue","setAttribute","toggleAttribute","super","newListener","oldListener","shouldRemoveListener","capture","once","passive","shouldAddListener","removeEventListener","addEventListener","event","call","host","handleEvent","_$LH","_boundAttributeSuffix","_marker","_markerMatch","_HTML_RESULT","_getTemplateHtml","_TemplateInstance","_isIterable","_resolveDirective","_ChildPart","_AttributePart","_BooleanAttributePart","_EventPart","_PropertyPart","_ElementPart","polyfillSupport","litHtmlPolyfillSupport","litHtmlVersions","render","container","partOwnerNode","renderBefore","LitElement","ReactiveElement","constructor","this","renderOptions","host","__childPart","createRenderRoot","renderRoot","super","renderBefore","firstChild","changedProperties","value","render","hasUpdated","isConnected","update","connectedCallback","setConnected","disconnectedCallback","noChange","globalThis","litElementHydrateSupport","polyfillSupport","litElementPolyfillSupport","globalThis","litElementVersions","push","customElement","tagName","classOrTarget","context","addInitializer","customElements","define","defaultPropertyDeclaration","attribute","type","String","converter","defaultConverter","reflect","hasChanged","notEqual","standardProperty","options","target","context","kind","metadata","properties","globalThis","litPropertyMetadata","get","set","Map","name","v","oldValue","call","this","requestUpdate","_$changeProperty","value","Error","property","protoOrTarget","nameOrContext","proto","hasOwnProperty","constructor","createProperty","wrapped","Object","getOwnPropertyDescriptor","state","options","property","attribute","desc","obj","name","descriptor","configurable","enumerable","Reflect","decorate","Object","defineProperty","query","selector","cache","protoOrTarget","nameOrContext","descriptor","doQuery","el","renderRoot","querySelector","get","set","key","Symbol","this","v","desc","result","call","hasUpdated","queryAssignedElements","options","obj","name","slot","selector","slotSelector","desc","get","slotEl","this","renderRoot","querySelector","elements","assignedElements","filter","node","matches","r","n","stringToBooleanConverter","r","n","r","n","t","r","n","t","xml","attributes","_","xml","e","e","r","itemContext","i","e","testContext","v","t","i","e","n","n","r","e","i","t","e","i","t","_","e","v","n","t","n","t","_ChildPart","ChildPart","_$LH","isPrimitive","value","isSingleExpression","part","strings","createMarker","document","createComment","insertPart","containerPart","refPart","container","_$startNode","parentNode","refNode","_$endNode","startNode","insertBefore","endNode","ChildPart","options","nextSibling","oldParent","_$parent","parentChanged","newConnectionState","_$reparentDisconnectables","_$notifyConnectionChanged","_$isConnected","start","n","setChildPartValue","value","directiveParent","_$setValue","RESET_VALUE","setCommittedValue","_$committedValue","getCommittedValue","removePart","end","remove","PartType","ATTRIBUTE","CHILD","PROPERTY","BOOLEAN_ATTRIBUTE","EVENT","ELEMENT","directive","c","values","_$litDirective$","Directive","_partInfo","_$isConnected","this","_$parent","part","parent","attributeIndex","__part","__attributeIndex","props","update","_part","render","notifyChildrenConnectedChanged","parent","isConnected","children","_$disconnectableChildren","obj","removeDisconnectableFromParent","_$parent","delete","size","addDisconnectableToParent","Set","has","add","installDisconnectAPI","reparentDisconnectables","newParent","this","notifyChildPartConnectedChanged","isClearingValue","fromPartIndex","value","_$committedValue","Array","isArray","i","length","type","PartType","CHILD","_$notifyConnectionChanged","_$reparentDisconnectables","AsyncDirective","Directive","constructor","part","attributeIndex","super","_$initialize","_$isConnected","isClearingDirective","reconnected","disconnected","isSingleExpression","__part","_$setValue","newValues","__attributeIndex","PseudoWeakRef","ref","this","_ref","disconnect","deref","Pauser","constructor","_promise","_resolve","get","pause","Promise","resolve","resume","isPromise","x","isPrimitive","then","_infinity","UntilDirective","AsyncDirective","constructor","this","__lastRenderedIndex","__values","__weakThis","PseudoWeakRef","__pauser","Pauser","args","find","noChange","_part","previousValues","previousLength","length","weakThis","pauser","isConnected","disconnected","i","value","Promise","resolve","async","result","get","_this","deref","index","indexOf","setValue","disconnect","pause","reconnected","reconnect","resume","until","directive","r","m","n","t","Kind","v","t","astFactory","t","e","a","b","f","v","l","r","g","n","receiver","args","e","c","t","i","params","body","p","resolveMethodName","_$LH","boundAttributeSuffix","p","_boundAttributeSuffix","marker","_marker","markerMatch","_markerMatch","HTML_RESULT","_HTML_RESULT","getTemplateHtml","_getTemplateHtml","overrideDirectiveResolve","directiveClass","resolveOverrideFn","_part","values","this","patchDirectiveResolve","prototype","_$resolve","name","proto","Object","getPrototypeOf","hasOwnProperty","Error","value","getAttributePartCommittedValue","part","index","committedValue","noChange","_commitValue","_$setValue","connectedDisconnectable","props","_$isConnected","resolveDirective","_resolveDirective","AttributePart","_AttributePart","PropertyPart","_PropertyPart","BooleanAttributePart","_BooleanAttributePart","EventPart","_EventPart","ElementPart","_ElementPart","TemplateInstance","_TemplateInstance","isIterable","_isIterable","ChildPart","_ChildPart","i","s","_","handlers","renderers","model","i","e","v","n","t","n","item_default","r","item_default","t","r","_","e","v","i","n","t","r","n","t","n","i","r","t","r","t","r","t","r","n","t","v","i","n","r","t","v","i","n","r","t","r","t","r","t","r","i","n","t","r","v","n","i","t","i","t","i","t","ifDefined","value","nothing","r","n","_","i","o","r","n","t","createRef","Ref","lastElementForContextAndCallback","WeakMap","ref","directive","AsyncDirective","_ref","nothing","part","refChanged","this","_updateRefValue","undefined","_lastElementForRef","_element","_context","options","host","element","isConnected","context","globalThis","lastElementForCallback","get","set","call","value","disconnected","reconnected","i","e","_","o","n","r","t","_","e","n","t","UnsafeHTMLDirective","Directive","partInfo","super","this","_value","nothing","type","PartType","CHILD","Error","constructor","directiveName","value","_templateResult","noChange","strings","raw","_$litType$","resultType","values","unsafeHTML","directive","i","o","r","n","t","i","j","n","c","a","b","i","n","i","n","t","r","i","t","r","i","t","r","t","n","i","v","r","i","i","r","e","v","i","c","e","n","x","v","n","n","r","n","r","n","i","c","e","r","v","n","v2","n","c","a","b","v","e","p","_","a","c","k","require","n","r","t","e","x","y","n","d","draggable","parent","index","n","i","_","r","t","iframe","e","n","r","t","_","n","t","i","x","t","generateMap","list","start","end","map","Map","i","set","repeat","directive","Directive","partInfo","super","type","PartType","CHILD","Error","items","keyFnOrTemplate","template","keyFn","keys","values","index","item","this","_getValuesAndKeys","containerPart","oldParts","getCommittedValue","newValues","newKeys","Array","isArray","_itemKeys","oldKeys","newParts","newKeyToIndexMap","oldKeyToIndexMap","oldHead","oldTail","length","newHead","newTail","setChildPartValue","insertPart","has","oldIndex","get","oldPart","newPart","removePart","setCommittedValue","noChange","p","o","c","e","_","i","s","r","t","i","e","s","t","e","i","hotspot","s","t","e","s","i","t","r","i","n","t","i","e","v","o","n","r","t","i","t","i","_","i","o","d","r","n","t","r","i","r","a","i","t","important","importantFlag","styleMap","directive","Directive","partInfo","super","type","PartType","ATTRIBUTE","name","strings","length","Error","styleInfo","Object","keys","reduce","style","prop","value","includes","replace","toLowerCase","part","element","this","_previousStyleProperties","Set","render","delete","removeProperty","add","isImportant","endsWith","setProperty","slice","noChange","x","y","c","o","e","_","i","n","r","t","event","x","diffX","e","i","n","t","r","e","v","t","r","i","t","r","i","n","t","r","i","n","t","r","i","n","t","r","i","n","t","r","i","t","r","i","n","t","r","i","n","t"]}
|