Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lit-html

Package Overview
Dependencies
Maintainers
10
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lit-html - npm Package Compare versions

Comparing version 2.0.0-rc.3 to 2.0.0-rc.4

development/directives/private-async-helpers.d.ts

69

async-directive.d.ts

@@ -28,9 +28,10 @@ /**

* on each parent that includes each child that contains a
* `AsyncDirective` directly or transitively via its children. In order
* disconnect (or reconnect) a tree, the `_$setChildPartConnected` API is patched
* onto ChildParts as a directive climbs the parent tree, which is called by the
* core when clearing a part if it exists. When called, that method iterates
* over the sparse tree of Set<DisconnectableChildren> built up by
* AsyncDirectives, and calls `_$setDirectiveConnected` on any
* directives that are encountered in that tree, running the required callbacks.
* `AsyncDirective` directly or transitively via its children. In order to
* notify connection state changes and disconnect (or reconnect) a tree, the
* `_$notifyConnectionChanged` API is patched onto ChildParts as a directive
* climbs the parent tree, which is called by the core when clearing a part if
* it exists. When called, that method iterates over the sparse tree of
* Set<DisconnectableChildren> built up by AsyncDirectives, and calls
* `_$notifyDirectiveConnectionChanged` on any directives that are encountered
* in that tree, running the required callbacks.
*

@@ -91,3 +92,3 @@ * A given "logical tree" of lit-html data-structures might look like this:

* the ChildPart (but not its directive). In this case, when `_clear()` calls
* `_$setChildPartConnected()`, we don't iterate all of the
* `_$notifyConnectionChanged()`, we don't iterate all of the
* _$disconnectableChildren, rather we do a value-specific disconnection: i.e.

@@ -114,3 +115,3 @@ * since the _value was an Array<ChildPart> (because an iterable had been

* disconnected, it will run `childPart.setConnected()` (which calls
* `childPart._$setChildPartConnected()` if it exists); in this case, we
* `childPart._$notifyConnectionChanged()` if it exists); in this case, we
* recursively run `setConnected()` over the entire tree, without removing any

@@ -128,3 +129,4 @@ * children from `_$disconnectableChildren`, since this tree is required to

* re-rendering, or when the user calls `part.setDirectiveConnection(false)` on
* a part that was previously rendered containing the directive.
* a part that was previously rendered containing the directive (as happens
* when e.g. a LitElement disconnects from the DOM).
*

@@ -135,7 +137,13 @@ * If `part.setDirectiveConnection(true)` is subsequently called on a

* `reconnected` should also be implemented to be compatible with reconnection.
*
* Note that updates may occur while the directive is disconnected. As such,
* directives should generally check the `this.isConnected` flag during
* render/update to determine whether it is safe to subscribe to resources
* that may prevent garbage collection.
*/
export declare abstract class AsyncDirective extends Directive {
/**
* The connection state for this Directive.
*/
isConnected: boolean;
private _pendingValue;
_$disconnectableChildren?: Set<Disconnectable>;
/**

@@ -149,36 +157,2 @@ * Initialize the part with internal fields

/**
* Called from the core code when a directive is going away from a part (in
* which case `shouldRemoveFromParent` should be true), and from the
* `setChildrenConnected` helper function when recursively changing the
* connection state of a tree (in which case `shouldRemoveFromParent` should
* be false).
*
* @param isConnected
* @param isClearingDirective - True when the directive itself is being
* removed; false when the tree is being disconnected
* @internal
*/
_$setDirectiveConnected(isConnected: boolean, isClearingDirective?: boolean): void;
/**
* Private method used to set the connection state of the directive and call
* the respective `disconnected` or `reconnected` callback. Note thatsince
* `isConnected` defaults to true, we do not run `reconnected` on first
* render.
*
* If a call to `setValue` was made while disconnected, flush it to the part
* before reconnecting.
*
* @param isConnected
* @internal
*/
private _setConnected;
/**
* Override of the base `_resolve` method to ensure `reconnected` is run
* prior to the next render.
*
* @override
* @internal
*/
_$resolve(part: Part, props: Array<unknown>): unknown;
/**
* Sets the value of the directive's Part outside the normal `update`/`render`

@@ -190,5 +164,2 @@ * lifecycle of a directive.

*
* If the method is called while the part is disconnected, the value will be
* queued until directive is reconnected.
*
* @param directive The directive to update

@@ -195,0 +166,0 @@ * @param value The value to set

@@ -1,2 +0,2 @@

import{noChange as i}from"./lit-html.js";import{Directive as t,PartType as s}from"./directive.js";export{directive}from"./directive.js";import{isSingleExpression as e}from"./directive-helpers.js";
import{isSingleExpression as i}from"./directive-helpers.js";import{Directive as t,PartType as s}from"./directive.js";export{directive}from"./directive.js";
/**

@@ -6,3 +6,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const r=(i,t)=>{var s,e;const o=i.N;if(void 0===o)return!1;for(const i of o)null===(e=(s=i).O)||void 0===e||e.call(s,t,!1),r(i,t);return!0},o=i=>{let t,s;do{if(void 0===(t=i.M))break;s=t.N,s.delete(i),i=t}while(0===(null==s?void 0:s.size))},h=i=>{for(let t;t=i.M;i=t){let s=t.N;if(void 0===s)t.N=s=new Set;else if(s.has(i))break;s.add(i),d(t)}};function n(i){void 0!==this.N?(o(this),this.M=i,h(this)):this.M=i}function l(i,t=!1,s=0){const e=this.H,h=this.N;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(e))for(let i=s;i<e.length;i++)r(e[i],!1),o(e[i]);else null!=e&&(r(e,!1),o(e));else r(this,i)}const d=i=>{var t,e,r,o;i.type==s.CHILD&&(null!==(t=(r=i).P)&&void 0!==t||(r.P=l),null!==(e=(o=i).Q)&&void 0!==e||(o.Q=n))};class c extends t{constructor(){super(...arguments),this.isConnected=!0,this.ut=i,this.N=void 0}T(i,t,s){super.T(i,t,s),h(this)}O(i,t=!0){this.at(i),t&&(r(this,i),o(this))}at(t){var s,e;t!==this.isConnected&&(t?(this.isConnected=!0,this.ut!==i&&(this.setValue(this.ut),this.ut=i),null===(s=this.reconnected)||void 0===s||s.call(this)):(this.isConnected=!1,null===(e=this.disconnected)||void 0===e||e.call(this)))}S(i,t){if(!this.isConnected)throw Error(`AsyncDirective ${this.constructor.name} was rendered while its tree was disconnected.`);return super.S(i,t)}setValue(i){if(this.isConnected)if(e(this.Σdt))this.Σdt.I(i,this);else{const t=[...this.Σdt.H];t[this.Σct]=i,this.Σdt.I(t,this,0)}else this.ut=i}disconnected(){}reconnected(){}}export{c as AsyncDirective};
*/const e=(i,t)=>{var s,o;const n=i._$AN;if(void 0===n)return!1;for(const i of n)null===(o=(s=i)._$AO)||void 0===o||o.call(s,t,!1),e(i,t);return!0},o=i=>{let t,s;do{if(void 0===(t=i._$AM))break;s=t._$AN,s.delete(i),i=t}while(0===(null==s?void 0:s.size))},n=i=>{for(let t;t=i._$AM;i=t){let s=t._$AN;if(void 0===s)t._$AN=s=new Set;else if(s.has(i))break;s.add(i),l(t)}};function r(i){void 0!==this._$AN?(o(this),this._$AM=i,n(this)):this._$AM=i}function h(i,t=!1,s=0){const n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(n))for(let i=s;i<n.length;i++)e(n[i],!1),o(n[i]);else null!=n&&(e(n,!1),o(n));else e(this,i)}const l=i=>{var t,e,o,n;i.type==s.CHILD&&(null!==(t=(o=i)._$AP)&&void 0!==t||(o._$AP=h),null!==(e=(n=i)._$AQ)&&void 0!==e||(n._$AQ=r))};class d extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,s){super._$AT(i,t,s),n(this),this.isConnected=i._$AU}_$AO(i,t=!0){var s,n;i!==this.isConnected&&(this.isConnected=i,i?null===(s=this.reconnected)||void 0===s||s.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),t&&(e(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{d as AsyncDirective};
//# sourceMappingURL=async-directive.js.map

@@ -28,9 +28,10 @@ /**

* on each parent that includes each child that contains a
* `AsyncDirective` directly or transitively via its children. In order
* disconnect (or reconnect) a tree, the `_$setChildPartConnected` API is patched
* onto ChildParts as a directive climbs the parent tree, which is called by the
* core when clearing a part if it exists. When called, that method iterates
* over the sparse tree of Set<DisconnectableChildren> built up by
* AsyncDirectives, and calls `_$setDirectiveConnected` on any
* directives that are encountered in that tree, running the required callbacks.
* `AsyncDirective` directly or transitively via its children. In order to
* notify connection state changes and disconnect (or reconnect) a tree, the
* `_$notifyConnectionChanged` API is patched onto ChildParts as a directive
* climbs the parent tree, which is called by the core when clearing a part if
* it exists. When called, that method iterates over the sparse tree of
* Set<DisconnectableChildren> built up by AsyncDirectives, and calls
* `_$notifyDirectiveConnectionChanged` on any directives that are encountered
* in that tree, running the required callbacks.
*

@@ -91,3 +92,3 @@ * A given "logical tree" of lit-html data-structures might look like this:

* the ChildPart (but not its directive). In this case, when `_clear()` calls
* `_$setChildPartConnected()`, we don't iterate all of the
* `_$notifyConnectionChanged()`, we don't iterate all of the
* _$disconnectableChildren, rather we do a value-specific disconnection: i.e.

@@ -114,3 +115,3 @@ * since the _value was an Array<ChildPart> (because an iterable had been

* disconnected, it will run `childPart.setConnected()` (which calls
* `childPart._$setChildPartConnected()` if it exists); in this case, we
* `childPart._$notifyConnectionChanged()` if it exists); in this case, we
* recursively run `setConnected()` over the entire tree, without removing any

@@ -128,3 +129,4 @@ * children from `_$disconnectableChildren`, since this tree is required to

* re-rendering, or when the user calls `part.setDirectiveConnection(false)` on
* a part that was previously rendered containing the directive.
* a part that was previously rendered containing the directive (as happens
* when e.g. a LitElement disconnects from the DOM).
*

@@ -135,7 +137,13 @@ * If `part.setDirectiveConnection(true)` is subsequently called on a

* `reconnected` should also be implemented to be compatible with reconnection.
*
* Note that updates may occur while the directive is disconnected. As such,
* directives should generally check the `this.isConnected` flag during
* render/update to determine whether it is safe to subscribe to resources
* that may prevent garbage collection.
*/
export declare abstract class AsyncDirective extends Directive {
/**
* The connection state for this Directive.
*/
isConnected: boolean;
private _pendingValue;
_$disconnectableChildren?: Set<Disconnectable>;
/**

@@ -149,36 +157,2 @@ * Initialize the part with internal fields

/**
* Called from the core code when a directive is going away from a part (in
* which case `shouldRemoveFromParent` should be true), and from the
* `setChildrenConnected` helper function when recursively changing the
* connection state of a tree (in which case `shouldRemoveFromParent` should
* be false).
*
* @param isConnected
* @param isClearingDirective - True when the directive itself is being
* removed; false when the tree is being disconnected
* @internal
*/
_$setDirectiveConnected(isConnected: boolean, isClearingDirective?: boolean): void;
/**
* Private method used to set the connection state of the directive and call
* the respective `disconnected` or `reconnected` callback. Note thatsince
* `isConnected` defaults to true, we do not run `reconnected` on first
* render.
*
* If a call to `setValue` was made while disconnected, flush it to the part
* before reconnecting.
*
* @param isConnected
* @internal
*/
private _setConnected;
/**
* Override of the base `_resolve` method to ensure `reconnected` is run
* prior to the next render.
*
* @override
* @internal
*/
_$resolve(part: Part, props: Array<unknown>): unknown;
/**
* Sets the value of the directive's Part outside the normal `update`/`render`

@@ -190,5 +164,2 @@ * lifecycle of a directive.

*
* If the method is called while the part is disconnected, the value will be
* queued until directive is reconnected.
*
* @param directive The directive to update

@@ -195,0 +166,0 @@ * @param value The value to set

@@ -6,115 +6,2 @@ /**

*/
/**
* Overview:
*
* This module is designed to add support for an async `setValue` API and
* `disconnected` callback to directives with the least impact on the core
* runtime or payload when that feature is not used.
*
* The strategy is to introduce a `AsyncDirective` subclass of
* `Directive` that climbs the "parent" tree in its constructor to note which
* branches of lit-html's "logical tree" of data structures contain such
* directives and thus need to be crawled when a subtree is being cleared (or
* manually disconnected) in order to run the `disconnected` callback.
*
* The "nodes" of the logical tree include Parts, TemplateInstances (for when a
* TemplateResult is committed to a value of a ChildPart), and Directives; these
* all implement a common interface called `DisconnectableChild`. Each has a
* `_$parent` reference which is set during construction in the core code, and a
* `_$disconnectableChildren` field which is initially undefined.
*
* The sparse tree created by means of the `AsyncDirective` constructor
* crawling up the `_$parent` tree and placing a `_$disconnectableChildren` Set
* on each parent that includes each child that contains a
* `AsyncDirective` directly or transitively via its children. In order
* disconnect (or reconnect) a tree, the `_$setChildPartConnected` API is patched
* onto ChildParts as a directive climbs the parent tree, which is called by the
* core when clearing a part if it exists. When called, that method iterates
* over the sparse tree of Set<DisconnectableChildren> built up by
* AsyncDirectives, and calls `_$setDirectiveConnected` on any
* directives that are encountered in that tree, running the required callbacks.
*
* A given "logical tree" of lit-html data-structures might look like this:
*
* ChildPart(N1) _$dC=[D2,T3]
* ._directive
* AsyncDirective(D2)
* ._value // user value was TemplateResult
* TemplateInstance(T3) _$dC=[A4,A6,N10,N12]
* ._parts[]
* AttributePart(A4) _$dC=[D5]
* ._directives[]
* AsyncDirective(D5)
* AttributePart(A6) _$dC=[D7,D8]
* ._directives[]
* AsyncDirective(D7)
* Directive(D8) _$dC=[D9]
* ._directive
* AsyncDirective(D9)
* ChildPart(N10) _$dC=[D11]
* ._directive
* AsyncDirective(D11)
* ._value
* string
* ChildPart(N12) _$dC=[D13,N14,N16]
* ._directive
* AsyncDirective(D13)
* ._value // user value was iterable
* Array<ChildPart>
* ChildPart(N14) _$dC=[D15]
* ._value
* string
* ChildPart(N16) _$dC=[D17,T18]
* ._directive
* AsyncDirective(D17)
* ._value // user value was TemplateResult
* TemplateInstance(T18) _$dC=[A19,A21,N25]
* ._parts[]
* AttributePart(A19) _$dC=[D20]
* ._directives[]
* AsyncDirective(D20)
* AttributePart(A21) _$dC=[22,23]
* ._directives[]
* AsyncDirective(D22)
* Directive(D23) _$dC=[D24]
* ._directive
* AsyncDirective(D24)
* ChildPart(N25) _$dC=[D26]
* ._directive
* AsyncDirective(D26)
* ._value
* string
*
* Example 1: The directive in ChildPart(N12) updates and returns `nothing`. The
* ChildPart will _clear() itself, and so we need to disconnect the "value" of
* the ChildPart (but not its directive). In this case, when `_clear()` calls
* `_$setChildPartConnected()`, we don't iterate all of the
* _$disconnectableChildren, rather we do a value-specific disconnection: i.e.
* since the _value was an Array<ChildPart> (because an iterable had been
* committed), we iterate the array of ChildParts (N14, N16) and run
* `setConnected` on them (which does recurse down the full tree of
* `_$disconnectableChildren` below it, and also removes N14 and N16 from N12's
* `_$disconnectableChildren`). Once the values have been disconnected, we then
* check whether the ChildPart(N12)'s list of `_$disconnectableChildren` is empty
* (and would remove it from its parent TemplateInstance(T3) if so), but since
* it would still contain its directive D13, it stays in the disconnectable
* tree.
*
* Example 2: In the course of Example 1, `setConnected` will reach
* ChildPart(N16); in this case the entire part is being disconnected, so we
* simply iterate all of N16's `_$disconnectableChildren` (D17,T18) and
* recursively run `setConnected` on them. Note that we only remove children
* from `_$disconnectableChildren` for the top-level values being disconnected
* on a clear; doing this bookkeeping lower in the tree is wasteful since it's
* all being thrown away.
*
* Example 3: If the LitElement containing the entire tree above becomes
* disconnected, it will run `childPart.setConnected()` (which calls
* `childPart._$setChildPartConnected()` if it exists); in this case, we
* recursively run `setConnected()` over the entire tree, without removing any
* children from `_$disconnectableChildren`, since this tree is required to
* re-connect the tree, which does the same operation, simply passing
* `isConnectd: true` down the tree, signaling which callback to run.
*/
import { noChange, } from './lit-html.js';
import { isSingleExpression } from './directive-helpers.js';

@@ -131,3 +18,3 @@ import { Directive, PartType } from './directive.js';

*/
const setChildrenConnected = (parent, isConnected) => {
const notifyChildrenConnectedChanged = (parent, isConnected) => {
var _a, _b;

@@ -139,12 +26,13 @@ const children = parent._$disconnectableChildren;

for (const obj of children) {
// The existence of `_$setDirectiveConnected` is used as a "brand" to
// The existence of `_$notifyDirectiveConnectionChanged` is used as a "brand" to
// disambiguate AsyncDirectives from other DisconnectableChildren
// (as opposed to using an instanceof check to know when to call it); the
// redundancy of "Directive" in the API name is to avoid conflicting with
// `_$setChildPartConnected`, which exists `ChildParts` which are also in
// `_$notifyConnectionChanged`, which exists `ChildParts` which are also in
// this list
// Disconnect Directive (and any nested directives contained within)
(_b = (_a = obj)._$setDirectiveConnected) === null || _b === void 0 ? void 0 : _b.call(_a, isConnected, false);
// This property needs to remain unminified.
(_b = (_a = obj)['_$notifyDirectiveConnectionChanged']) === null || _b === void 0 ? void 0 : _b.call(_a, isConnected, false);
// Disconnect Part/TemplateInstance
setChildrenConnected(obj, isConnected);
notifyChildrenConnectedChanged(obj, isConnected);
}

@@ -225,3 +113,3 @@ return true;

*/
function setChildPartConnected(isConnected, isClearingValue = false, fromPartIndex = 0) {
function notifyChildPartConnectedChanged(isConnected, isClearingValue = false, fromPartIndex = 0) {
const value = this._$committedValue;

@@ -238,3 +126,3 @@ const children = this._$disconnectableChildren;

for (let i = fromPartIndex; i < value.length; i++) {
setChildrenConnected(value[i], false);
notifyChildrenConnectedChanged(value[i], false);
removeDisconnectableFromParent(value[i]);

@@ -247,3 +135,3 @@ }

// and remove it from this ChildPart's disconnectable children
setChildrenConnected(value, false);
notifyChildrenConnectedChanged(value, false);
removeDisconnectableFromParent(value);

@@ -253,3 +141,3 @@ }

else {
setChildrenConnected(this, isConnected);
notifyChildrenConnectedChanged(this, isConnected);
}

@@ -264,3 +152,3 @@ }

if (obj.type == PartType.CHILD) {
(_a = (_c = obj)._$setChildPartConnected) !== null && _a !== void 0 ? _a : (_c._$setChildPartConnected = setChildPartConnected);
(_a = (_c = obj)._$notifyConnectionChanged) !== null && _a !== void 0 ? _a : (_c._$notifyConnectionChanged = notifyChildPartConnectedChanged);
(_b = (_d = obj)._$reparentDisconnectables) !== null && _b !== void 0 ? _b : (_d._$reparentDisconnectables = reparentDisconnectables);

@@ -273,3 +161,4 @@ }

* re-rendering, or when the user calls `part.setDirectiveConnection(false)` on
* a part that was previously rendered containing the directive.
* a part that was previously rendered containing the directive (as happens
* when e.g. a LitElement disconnects from the DOM).
*

@@ -280,2 +169,7 @@ * If `part.setDirectiveConnection(true)` is subsequently called on a

* `reconnected` should also be implemented to be compatible with reconnection.
*
* Note that updates may occur while the directive is disconnected. As such,
* directives should generally check the `this.isConnected` flag during
* render/update to determine whether it is safe to subscribe to resources
* that may prevent garbage collection.
*/

@@ -285,4 +179,2 @@ export class AsyncDirective extends Directive {

super(...arguments);
this.isConnected = true;
this._pendingValue = noChange;
// @internal

@@ -300,3 +192,5 @@ this._$disconnectableChildren = undefined;

addDisconnectableToParent(this);
this.isConnected = part._$isConnected;
}
// This property needs to remain unminified.
/**

@@ -314,51 +208,17 @@ * Called from the core code when a directive is going away from a part (in

*/
_$setDirectiveConnected(isConnected, isClearingDirective = true) {
this._setConnected(isConnected);
if (isClearingDirective) {
setChildrenConnected(this, isConnected);
removeDisconnectableFromParent(this);
}
}
/**
* Private method used to set the connection state of the directive and call
* the respective `disconnected` or `reconnected` callback. Note thatsince
* `isConnected` defaults to true, we do not run `reconnected` on first
* render.
*
* If a call to `setValue` was made while disconnected, flush it to the part
* before reconnecting.
*
* @param isConnected
* @internal
*/
_setConnected(isConnected) {
['_$notifyDirectiveConnectionChanged'](isConnected, isClearingDirective = true) {
var _a, _b;
if (isConnected !== this.isConnected) {
this.isConnected = isConnected;
if (isConnected) {
this.isConnected = true;
if (this._pendingValue !== noChange) {
this.setValue(this._pendingValue);
this._pendingValue = noChange;
}
(_a = this.reconnected) === null || _a === void 0 ? void 0 : _a.call(this);
}
else {
this.isConnected = false;
(_b = this.disconnected) === null || _b === void 0 ? void 0 : _b.call(this);
}
}
}
/**
* Override of the base `_resolve` method to ensure `reconnected` is run
* prior to the next render.
*
* @override
* @internal
*/
_$resolve(part, props) {
if (!this.isConnected) {
throw new Error(`AsyncDirective ${this.constructor.name} was ` +
`rendered while its tree was disconnected.`);
if (isClearingDirective) {
notifyChildrenConnectedChanged(this, isConnected);
removeDisconnectableFromParent(this);
}
return super._$resolve(part, props);
}

@@ -372,5 +232,2 @@ /**

*
* If the method is called while the part is disconnected, the value will be
* queued until directive is reconnected.
*
* @param directive The directive to update

@@ -380,19 +237,14 @@ * @param value The value to set

setValue(value) {
if (this.isConnected) {
if (isSingleExpression(this.__part)) {
this.__part._$setValue(value, this);
}
else {
// this.__attributeIndex will be defined in this case, but
// assert it in dev mode
if (DEV_MODE && this.__attributeIndex === undefined) {
throw new Error(`Expected this.__attributeIndex to be a number`);
}
const newValues = [...this.__part._$committedValue];
newValues[this.__attributeIndex] = value;
this.__part._$setValue(newValues, this, 0);
}
if (isSingleExpression(this.__part)) {
this.__part._$setValue(value, this);
}
else {
this._pendingValue = value;
// this.__attributeIndex will be defined in this case, but
// assert it in dev mode
if (DEV_MODE && this.__attributeIndex === undefined) {
throw new Error(`Expected this.__attributeIndex to be a number`);
}
const newValues = [...this.__part._$committedValue];
newValues[this.__attributeIndex] = value;
this.__part._$setValue(newValues, this, 0);
}

@@ -399,0 +251,0 @@ }

@@ -8,2 +8,3 @@ /**

import { DirectiveResult, DirectiveClass, PartInfo } from './directive.js';
declare type Primitive = null | undefined | boolean | number | string | symbol | bigint;
/**

@@ -14,3 +15,3 @@ * Tests if a value is a primitive value.

*/
export declare const isPrimitive: (value: unknown) => value is string | number | bigint | boolean | symbol | null | undefined;
export declare const isPrimitive: (value: unknown) => value is Primitive;
export declare const TemplateResultType: {

@@ -24,3 +25,3 @@ readonly HTML: 1;

*/
export declare const isTemplateResult: (value: unknown, type?: 1 | 2 | undefined) => value is TemplateResult<1 | 2>;
export declare const isTemplateResult: (value: unknown, type?: TemplateResultType | undefined) => value is TemplateResult<1 | 2>;
/**

@@ -107,2 +108,3 @@ * Tests if a value is a DirectiveResult.

export declare const clearPart: (part: import("./lit-html.js").ChildPart) => void;
export {};
//# sourceMappingURL=directive-helpers.d.ts.map

@@ -7,6 +7,7 @@ /**

var _a, _b;
import { _Σ } from './lit-html.js';
const { _ChildPart: ChildPart } = _Σ;
import { _$LH } from './lit-html.js';
const { _ChildPart: ChildPart } = _$LH;
const ENABLE_SHADYDOM_NOPATCH = true;
const wrap = ENABLE_SHADYDOM_NOPATCH && ((_a = window.ShadyDOM) === null || _a === void 0 ? void 0 : _a.inUse) &&
const wrap = ENABLE_SHADYDOM_NOPATCH &&
((_a = window.ShadyDOM) === null || _a === void 0 ? void 0 : _a.inUse) &&
((_b = window.ShadyDOM) === null || _b === void 0 ? void 0 : _b.noPatch) === true

@@ -31,4 +32,5 @@ ? window.ShadyDOM.wrap

return type === undefined
? ((_a = value) === null || _a === void 0 ? void 0 : _a._$litType$) !== undefined
: ((_b = value) === null || _b === void 0 ? void 0 : _b._$litType$) === type;
? // This property needs to remain unminified.
((_a = value) === null || _a === void 0 ? void 0 : _a['_$litType$']) !== undefined
: ((_b = value) === null || _b === void 0 ? void 0 : _b['_$litType$']) === type;
};

@@ -38,7 +40,11 @@ /**

*/
export const isDirectiveResult = (value) => { var _a; return ((_a = value) === null || _a === void 0 ? void 0 : _a._$litDirective$) !== undefined; };
export const isDirectiveResult = (value) => { var _a;
// This property needs to remain unminified.
return ((_a = value) === null || _a === void 0 ? void 0 : _a['_$litDirective$']) !== undefined; };
/**
* Retrieves the Directive class for a DirectiveResult
*/
export const getDirectiveClass = (value) => { var _a; return (_a = value) === null || _a === void 0 ? void 0 : _a._$litDirective$; };
export const getDirectiveClass = (value) => { var _a;
// This property needs to remain unminified.
return (_a = value) === null || _a === void 0 ? void 0 : _a['_$litDirective$']; };
/**

@@ -77,3 +83,4 @@ * Tests whether a part has only a single-expression with no strings to

const endNode = wrap(part._$endNode).nextSibling;
const parentChanged = part._$parent !== containerPart;
const oldParent = part._$parent;
const parentChanged = oldParent !== containerPart;
if (parentChanged) {

@@ -86,2 +93,11 @@ (_a = part._$reparentDisconnectables) === null || _a === void 0 ? void 0 : _a.call(part, containerPart);

part._$parent = containerPart;
// Since the _$isConnected getter is somewhat costly, only
// read it once we know the subtree has directives that need
// to be notified
let newConnectionState;
if (part._$notifyConnectionChanged !== undefined &&
(newConnectionState = containerPart._$isConnected) !==
oldParent._$isConnected) {
part._$notifyConnectionChanged(newConnectionState);
}
}

@@ -156,3 +172,3 @@ if (endNode !== refNode || parentChanged) {

var _a;
(_a = part._$setChildPartConnected) === null || _a === void 0 ? void 0 : _a.call(part, false, true);
(_a = part._$notifyConnectionChanged) === null || _a === void 0 ? void 0 : _a.call(part, false, true);
let start = part._$startNode;

@@ -159,0 +175,0 @@ const end = wrap(part._$endNode).nextSibling;

@@ -7,3 +7,3 @@ /**

import { Disconnectable, Part } from './lit-html';
export { AttributePart, BooleanAttributePart, ChildPart, ElementPart, EventPart, Part, } from './lit-html';
export { AttributePart, BooleanAttributePart, ChildPart, ElementPart, EventPart, Part, PropertyPart, } from './lit-html';
export interface DirectiveClass {

@@ -22,6 +22,2 @@ new (part: PartInfo): Directive;

export interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {
/** @internal */
_$litDirective$: C;
/** @internal */
values: DirectiveParameters<InstanceType<C>>;
}

@@ -66,14 +62,5 @@ export declare const PartType: {

*/
export declare abstract class Directive {
__part: Part;
__attributeIndex: number | undefined;
__directive?: Directive;
_$parent: Disconnectable;
_$disconnectableChildren?: Set<Disconnectable>;
_$setDirectiveConnected?(isConnected: boolean): void;
export declare abstract class Directive implements Disconnectable {
constructor(_partInfo: PartInfo);
/** @internal */
_$initialize(part: Part, parent: Disconnectable, attributeIndex: number | undefined): void;
/** @internal */
_$resolve(part: Part, props: Array<unknown>): unknown;
get _$isConnected(): boolean;
abstract render(...props: Array<unknown>): unknown;

@@ -80,0 +67,0 @@ update(_part: Part, props: Array<unknown>): unknown;

@@ -19,3 +19,4 @@ /**

export const directive = (c) => (...values) => ({
_$litDirective$: c,
// This property needs to remain unminified.
['_$litDirective$']: c,
values,

@@ -30,2 +31,6 @@ });

constructor(_partInfo) { }
// See comment in Disconnectable interface for why this is a getter
get _$isConnected() {
return this._$parent._$isConnected;
}
/** @internal */

@@ -32,0 +37,0 @@ _$initialize(part, parent, attributeIndex) {

@@ -6,16 +6,10 @@ /**

*/
import { ChildPart, noChange } from '../lit-html.js';
import { ChildPart } from '../lit-html.js';
import { DirectiveParameters, PartInfo } from '../directive.js';
import { AsyncDirective } from '../async-directive.js';
declare type Mapper<T> = (v: T, index?: number) => unknown;
declare class AsyncAppendDirective extends AsyncDirective {
private _value?;
private _reconnectResolver?;
private _reconnectPromise?;
import { AsyncReplaceDirective } from './async-replace.js';
declare class AsyncAppendDirective extends AsyncReplaceDirective {
private __childPart;
constructor(partInfo: PartInfo);
render<T>(value: AsyncIterable<T>, _mapper?: Mapper<T>): symbol;
update(part: ChildPart, [value, mapper]: DirectiveParameters<this>): typeof noChange | undefined;
private __iterate;
disconnected(): void;
reconnected(): void;
update(part: ChildPart, params: DirectiveParameters<this>): typeof import("../lit-html.js").noChange | undefined;
protected commitValue(value: unknown, index: number): void;
}

@@ -40,3 +34,3 @@ /**

*/
export declare const asyncAppend: (value: AsyncIterable<unknown>, _mapper?: Mapper<unknown> | undefined) => import("../directive.js").DirectiveResult<typeof AsyncAppendDirective>;
export declare const asyncAppend: (value: AsyncIterable<unknown>, _mapper?: ((v: unknown, index?: number | undefined) => unknown) | undefined) => import("../directive.js").DirectiveResult<typeof AsyncAppendDirective>;
/**

@@ -43,0 +37,0 @@ * The type of the class that powers this directive. Necessary for naming the

@@ -6,7 +6,7 @@ /**

*/
import { noChange } from '../lit-html.js';
import { directive, PartType, } from '../directive.js';
import { AsyncDirective } from '../async-directive.js';
import { AsyncReplaceDirective } from './async-replace.js';
import { clearPart, insertPart, setChildPartValue, } from '../directive-helpers.js';
class AsyncAppendDirective extends AsyncDirective {
class AsyncAppendDirective extends AsyncReplaceDirective {
// Override AsyncReplace to narrow the allowed part type to ChildPart only
constructor(partInfo) {

@@ -18,58 +18,18 @@ super(partInfo);

}
// @ts-expect-error value not used, but we want a nice parameter for docs
// eslint-disable-next-line @typescript-eslint/no-unused-vars
render(value, _mapper) {
return noChange;
// Override AsyncReplace to save the part since we need to append into it
update(part, params) {
this.__childPart = part;
return super.update(part, params);
}
update(part, [value, mapper]) {
// If we've already set up this particular iterable, we don't need
// to do anything.
if (value === this._value) {
return;
// Override AsyncReplace to append rather than replace
commitValue(value, index) {
// When we get the first value, clear the part. This lets the
// previous value display until we can replace it.
if (index === 0) {
clearPart(this.__childPart);
}
this._value = value;
this.__iterate(part, mapper);
return noChange;
// Create and insert a new part and set its value to the next value
const newPart = insertPart(this.__childPart);
setChildPartValue(newPart, value);
}
// Separate function to avoid an iffe in update; update can't be async
// because its return value must be `noChange`
async __iterate(part, mapper) {
let i = 0;
const { _value: value } = this;
for await (let v of value) {
// Check to make sure that value is the still the current value of
// the part, and if not bail because a new value owns this part
if (this._value !== value) {
break;
}
// If we were disconnected, pause until reconnected
if (this._reconnectPromise) {
await this._reconnectPromise;
}
// When we get the first value, clear the part. This lets the
// previous value display until we can replace it.
if (i === 0) {
clearPart(part);
}
// As a convenience, because functional-programming-style
// transforms of iterables and async iterables requires a library,
// we accept a mapper function. This is especially convenient for
// rendering a template for each item.
if (mapper !== undefined) {
v = mapper(v, i);
}
const newPart = insertPart(part);
setChildPartValue(newPart, v);
i++;
}
}
disconnected() {
// Pause iteration while disconnected
this._reconnectPromise = new Promise((resolve) => (this._reconnectResolver = resolve));
}
reconnected() {
// Resume iteration when reconnected
this._reconnectPromise = undefined;
this._reconnectResolver();
}
}

@@ -76,0 +36,0 @@ /**

@@ -10,9 +10,9 @@ /**

declare type Mapper<T> = (v: T, index?: number) => unknown;
declare class AsyncReplaceDirective extends AsyncDirective {
private _value?;
private _reconnectResolver?;
private _reconnectPromise?;
export declare class AsyncReplaceDirective extends AsyncDirective {
private __value?;
private __weakThis;
private __pauser;
render<T>(value: AsyncIterable<T>, _mapper?: Mapper<T>): symbol;
update(_part: ChildPart, [value, mapper]: DirectiveParameters<this>): typeof noChange | undefined;
private __iterate;
protected commitValue(value: unknown, _index: number): void;
disconnected(): void;

@@ -40,7 +40,3 @@ reconnected(): void;

export declare const asyncReplace: (value: AsyncIterable<unknown>, _mapper?: Mapper<unknown> | undefined) => import("../directive.js").DirectiveResult<typeof AsyncReplaceDirective>;
/**
* The type of the class that powers this directive. Necessary for naming the
* directive's return type.
*/
export type { AsyncReplaceDirective };
export {};
//# sourceMappingURL=async-replace.d.ts.map

@@ -9,3 +9,9 @@ /**

import { AsyncDirective } from '../async-directive.js';
class AsyncReplaceDirective extends AsyncDirective {
import { Pauser, PseudoWeakRef, forAwaitOf } from './private-async-helpers.js';
export class AsyncReplaceDirective extends AsyncDirective {
constructor() {
super(...arguments);
this.__weakThis = new PseudoWeakRef(this);
this.__pauser = new Pauser();
}
// @ts-expect-error value not used, but we want a nice parameter for docs

@@ -17,45 +23,60 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars

update(_part, [value, mapper]) {
// If our initial render occurs while disconnected, ensure that the pauser
// and weakThis are in the disconnected state
if (!this.isConnected) {
this.disconnected();
}
// If we've already set up this particular iterable, we don't need
// to do anything.
if (value === this._value) {
if (value === this.__value) {
return;
}
this._value = value;
this.__iterate(mapper);
return noChange;
}
// Separate function to avoid an iffe in update; update can't be async
// because its return value must be `noChange`
async __iterate(mapper) {
this.__value = value;
let i = 0;
const { _value: value } = this;
for await (let v of value) {
// Check to make sure that value is the still the current value of
// the part, and if not bail because a new value owns this part
if (this._value !== value) {
break;
const { __weakThis: weakThis, __pauser: pauser } = this;
// Note, the callback avoids closing over `this` so that the directive
// can be gc'ed before the promise resolves; instead `this` is retrieved
// from `weakThis`, which can break the hard reference in the closure when
// the directive disconnects
forAwaitOf(value, async (v) => {
// The while loop here handles the case that the connection state
// thrashes, causing the pauser to resume and then get re-paused
while (pauser.get()) {
await pauser.get();
}
// If we were disconnected, pause until reconnected
if (this._reconnectPromise) {
await this._reconnectPromise;
// If the callback gets here and there is no `this`, it means that the
// directive has been disconnected and garbage collected and we don't
// need to do anything else
const _this = weakThis.deref();
if (_this !== undefined) {
// Check to make sure that value is the still the current value of
// the part, and if not bail because a new value owns this part
if (_this.__value !== value) {
return false;
}
// As a convenience, because functional-programming-style
// transforms of iterables and async iterables requires a library,
// we accept a mapper function. This is especially convenient for
// rendering a template for each item.
if (mapper !== undefined) {
v = mapper(v, i);
}
_this.commitValue(v, i);
i++;
}
// As a convenience, because functional-programming-style
// transforms of iterables and async iterables requires a library,
// we accept a mapper function. This is especially convenient for
// rendering a template for each item.
if (mapper !== undefined) {
v = mapper(v, i);
}
this.setValue(v);
i++;
}
return true;
});
return noChange;
}
// Override point for AsyncAppend to append rather than replace
commitValue(value, _index) {
this.setValue(value);
}
disconnected() {
// Pause iteration while disconnected
this._reconnectPromise = new Promise((resolve) => (this._reconnectResolver = resolve));
this.__weakThis.disconnect();
this.__pauser.pause();
}
reconnected() {
// Resume iteration when reconnected
this._reconnectPromise = undefined;
this._reconnectResolver();
this.__weakThis.reconnect(this);
this.__pauser.resume();
}

@@ -62,0 +83,0 @@ }

@@ -21,3 +21,3 @@ /**

*
* ```
* ```js
* let checked = false;

@@ -24,0 +24,0 @@ *

@@ -6,3 +6,3 @@ /**

*/
import { render, nothing } from '../lit-html.js';
import { render, nothing, } from '../lit-html.js';
import { directive, Directive, } from '../directive.js';

@@ -33,2 +33,3 @@ import { clearPart, getCommittedValue, insertPart, isTemplateResult, setCommittedValue, } from '../directive-helpers.js';

cachedContainerPart = render(nothing, fragment);
cachedContainerPart.setConnected(false);
this._templateCache.set(this._value.strings, cachedContainerPart);

@@ -39,3 +40,2 @@ }

insertPart(cachedContainerPart, undefined, childPart);
childPart.setConnected(false);
}

@@ -56,3 +56,2 @@ // If the new value is a TemplateResult and the previous value is not,

setCommittedValue(containerPart, [cachedPart]);
cachedPart.setConnected(true);
}

@@ -74,3 +73,3 @@ }

*
* ```
* ```js
* let checked = false;

@@ -77,0 +76,0 @@ *

@@ -27,3 +27,5 @@ /**

*
* ```js
* html`<input .value=${live(x)}>`
* ```
*

@@ -30,0 +32,0 @@ * `live()` performs a strict equality check agains the live DOM value, and if

@@ -69,3 +69,5 @@ /**

*
* ```js
* html`<input .value=${live(x)}>`
* ```
*

@@ -72,0 +74,0 @@ * `live()` performs a strict equality check agains the live DOM value, and if

@@ -50,11 +50,12 @@ /**

* @example
* ```js
* // Using Ref object
* const inputRef = createRef();
* render(html`<input ${ref(inputRef)}>`, container);
* inputRef.value.focus();
*
* // Using Ref object
* const inputRef = createRef();
* render(html`<input ${ref(inputRef)}>`, container);
* inputRef.value.focus();
*
* // Using callback
* const callback = (inputElement) => inputElement.focus();
* render(html`<input ${ref(callback)}>`, container);
* // Using callback
* const callback = (inputElement) => inputElement.focus();
* render(html`<input ${ref(callback)}>`, container);
* ```
*/

@@ -61,0 +62,0 @@ export declare const ref: (_ref: RefOrCallback) => import("../directive.js").DirectiveResult<typeof RefDirective>;

@@ -99,13 +99,14 @@ /**

* @example
* ```js
* // Using Ref object
* const inputRef = createRef();
* render(html`<input ${ref(inputRef)}>`, container);
* inputRef.value.focus();
*
* // Using Ref object
* const inputRef = createRef();
* render(html`<input ${ref(inputRef)}>`, container);
* inputRef.value.focus();
*
* // Using callback
* const callback = (inputElement) => inputElement.focus();
* render(html`<input ${ref(callback)}>`, container);
* // Using callback
* const callback = (inputElement) => inputElement.focus();
* render(html`<input ${ref(callback)}>`, container);
* ```
*/
export const ref = directive(RefDirective);
//# sourceMappingURL=ref.js.map

@@ -41,3 +41,4 @@ /**

// don't have to export ResultType and possibly encourage this pattern.
_$litType$: this.constructor
// This property needs to remain unminified.
['_$litType$']: this.constructor
.resultType,

@@ -44,0 +45,0 @@ strings,

@@ -8,7 +8,11 @@ /**

import { AsyncDirective } from '../async-directive.js';
declare class UntilDirective extends AsyncDirective {
private _lastRenderedIndex;
private _values;
export declare class UntilDirective extends AsyncDirective {
private __lastRenderedIndex;
private __values;
private __weakThis;
private __pauser;
render(...args: Array<unknown>): unknown;
update(_part: Part, args: Array<unknown>): unknown;
disconnected(): void;
reconnected(): void;
}

@@ -39,3 +43,2 @@ /**

*/
export type { UntilDirective };
//# sourceMappingURL=until.d.ts.map

@@ -10,2 +10,3 @@ /**

import { AsyncDirective } from '../async-directive.js';
import { Pauser, PseudoWeakRef } from './private-async-helpers.js';
const isPromise = (x) => {

@@ -15,8 +16,10 @@ return !isPrimitive(x) && typeof x.then === 'function';

// Effectively infinity, but a SMI.
const _infinity = 0x7fffffff;
class UntilDirective extends AsyncDirective {
const _infinity = 0x3fffffff;
export class UntilDirective extends AsyncDirective {
constructor() {
super(...arguments);
this._lastRenderedIndex = _infinity;
this._values = [];
this.__lastRenderedIndex = _infinity;
this.__values = [];
this.__weakThis = new PseudoWeakRef(this);
this.__pauser = new Pauser();
}

@@ -28,8 +31,15 @@ render(...args) {

update(_part, args) {
const previousValues = this._values;
const previousValues = this.__values;
let previousLength = previousValues.length;
this._values = args;
this.__values = args;
const weakThis = this.__weakThis;
const pauser = this.__pauser;
// If our initial render occurs while disconnected, ensure that the pauser
// and weakThis are in the disconnected state
if (!this.isConnected) {
this.disconnected();
}
for (let i = 0; i < args.length; i++) {
// If we've rendered a higher-priority value already, stop.
if (i > this._lastRenderedIndex) {
if (i > this.__lastRenderedIndex) {
break;

@@ -40,3 +50,3 @@ }

if (!isPromise(value)) {
this._lastRenderedIndex = i;
this.__lastRenderedIndex = i;
// Since a lower-priority value will never overwrite a higher-priority

@@ -52,13 +62,29 @@ // synchronous value, we can stop processing now.

// changed. Forget what we rendered before.
this._lastRenderedIndex = _infinity;
this.__lastRenderedIndex = _infinity;
previousLength = 0;
Promise.resolve(value).then((resolvedValue) => {
const index = this._values.indexOf(value);
// If state.values doesn't contain the value, we've re-rendered without
// the value, so don't render it. Then, only render if the value is
// higher-priority than what's already been rendered.
if (index > -1 && index < this._lastRenderedIndex) {
this._lastRenderedIndex = index;
this.setValue(resolvedValue);
// Note, the callback avoids closing over `this` so that the directive
// can be gc'ed before the promise resolves; instead `this` is retrieved
// from `weakThis`, which can break the hard reference in the closure when
// the directive disconnects
Promise.resolve(value).then(async (result) => {
// If we're disconnected, wait until we're (maybe) reconnected
// The while loop here handles the case that the connection state
// thrashes, causing the pauser to resume and then get re-paused
while (pauser.get()) {
await pauser.get();
}
// If the callback gets here and there is no `this`, it means that the
// directive has been disconnected and garbage collected and we don't
// need to do anything else
const _this = weakThis.deref();
if (_this !== undefined) {
const index = _this.__values.indexOf(value);
// If state.values doesn't contain the value, we've re-rendered without
// the value, so don't render it. Then, only render if the value is
// higher-priority than what's already been rendered.
if (index > -1 && index < _this.__lastRenderedIndex) {
_this.__lastRenderedIndex = index;
_this.setValue(result);
}
}
});

@@ -68,2 +94,10 @@ }

}
disconnected() {
this.__weakThis.disconnect();
this.__pauser.pause();
}
reconnected() {
this.__weakThis.reconnect(this);
this.__pauser.resume();
}
}

@@ -90,2 +124,7 @@ /**

export const until = directive(UntilDirective);
/**
* The type of the class that powers this directive. Necessary for naming the
* directive's return type.
*/
// export type {UntilDirective};
//# sourceMappingURL=until.js.map

@@ -6,6 +6,6 @@ /**

*/
import { noChange, _Σ } from './lit-html.js';
import { noChange, _$LH } from './lit-html.js';
import { PartType } from './directive.js';
import { isPrimitive, isSingleExpression, isTemplateResult, } from './directive-helpers.js';
const { _TemplateInstance: TemplateInstance, _isIterable: isIterable, _resolveDirective: resolveDirective, _ChildPart: ChildPart, _ElementPart: ElementPart, } = _Σ;
const { _TemplateInstance: TemplateInstance, _isIterable: isIterable, _resolveDirective: resolveDirective, _ChildPart: ChildPart, _ElementPart: ElementPart, } = _$LH;
/**

@@ -54,4 +54,5 @@ * hydrate() operates on a container with server-side rendered content and

// TODO(kschaaf): Do we need a helper for _$litPart$ ("part for node")?
// This property needs to remain unminified.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (container._$litPart$ !== undefined) {
if (container['_$litPart$'] !== undefined) {
throw new Error('container already contains a live render');

@@ -102,4 +103,5 @@ }

console.assert(rootPart !== undefined, 'there should be exactly one root part in a render container');
// This property needs to remain unminified.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
container._$litPart$ = rootPart;
container['_$litPart$'] = rootPart;
};

@@ -106,0 +108,0 @@ const openChildPart = (rootValue, marker, stack, options) => {

@@ -46,6 +46,2 @@ /**

declare type ResultType = typeof HTML_RESULT | typeof SVG_RESULT;
declare const ATTRIBUTE_PART = 1;
declare const CHILD_PART = 2;
declare const ELEMENT_PART = 6;
declare const COMMENT_PART = 7;
/**

@@ -55,3 +51,3 @@ * The return type of the template tag functions.

export declare type TemplateResult<T extends ResultType = ResultType> = {
_$litType$: T;
['_$litType$']: T;
strings: TemplateStringsArray;

@@ -63,3 +59,3 @@ values: unknown[];

export interface CompiledTemplateResult {
_$litType$: CompiledTemplate;
['_$litType$']: CompiledTemplate;
values: unknown[];

@@ -116,3 +112,3 @@ }

export declare const render: {
(value: unknown, container: HTMLElement | DocumentFragment, options?: RenderOptions | undefined): ChildPart;
(value: unknown, container: HTMLElement | DocumentFragment, options?: RenderOptions | undefined): RootPart;
setSanitizer: (newSanitizer: SanitizerFactory) => void;

@@ -124,13 +120,9 @@ createSanitizer: SanitizerFactory;

_$parent?: DirectiveParent;
_$isConnected: boolean;
__directive?: Directive;
__directives?: Array<Directive | undefined>;
}
/** @internal */
export type { Template };
declare class Template {
/** @internal */
el: HTMLTemplateElement;
/** @internal */
parts: Array<TemplatePart>;
constructor({ strings, _$litType$: type }: TemplateResult, options?: RenderOptions);
constructor({ strings, ['_$litType$']: type }: TemplateResult, options?: RenderOptions);
/** @nocollapse */
static createElement(html: TrustedHTML, _options?: RenderOptions): HTMLTemplateElement;

@@ -141,2 +133,3 @@ }

_$disconnectableChildren?: Set<Disconnectable>;
_$isConnected: boolean;
}

@@ -148,71 +141,18 @@ declare function resolveDirective(part: ChildPart | AttributePart | ElementPart, value: unknown, parent?: DirectiveParent, attributeIndex?: number): unknown;

*/
declare class TemplateInstance {
/** @internal */
_$template: Template;
/** @internal */
_parts: Array<Part | undefined>;
/** @internal */
_$parent: Disconnectable;
/** @internal */
_$disconnectableChildren?: Set<Disconnectable>;
declare class TemplateInstance implements Disconnectable {
constructor(template: Template, parent: ChildPart);
get _$isConnected(): boolean;
_clone(options: RenderOptions | undefined): Node;
_update(values: Array<unknown>): void;
}
declare type AttributeTemplatePart = {
readonly type: typeof ATTRIBUTE_PART;
readonly index: number;
readonly name: string;
/** @internal */
readonly ctor: typeof AttributePart;
/** @internal */
readonly strings: ReadonlyArray<string>;
};
declare type NodeTemplatePart = {
readonly type: typeof CHILD_PART;
readonly index: number;
};
declare type ElementTemplatePart = {
readonly type: typeof ELEMENT_PART;
readonly index: number;
};
declare type CommentTemplatePart = {
readonly type: typeof COMMENT_PART;
readonly index: number;
};
/**
* A TemplatePart represents a dynamic part in a template, before the template
* is instantiated. When a template is instantiated Parts are created from
* TemplateParts.
*/
declare type TemplatePart = NodeTemplatePart | AttributeTemplatePart | ElementTemplatePart | CommentTemplatePart;
export declare type Part = ChildPart | AttributePart | PropertyPart | BooleanAttributePart | ElementPart | EventPart;
export type { ChildPart };
declare class ChildPart {
declare class ChildPart implements Disconnectable {
readonly type = 2;
readonly options: RenderOptions | undefined;
_$committedValue: unknown;
/** @internal */
__directive?: Directive;
/** @internal */
_$startNode: ChildNode;
/** @internal */
_$endNode: ChildNode | null;
private _textSanitizer;
/** @internal */
_$parent: Disconnectable | undefined;
/** @internal */
_$disconnectableChildren?: Set<Disconnectable>;
/** @internal */
_$setChildPartConnected?(isConnected: boolean, removeFromParent?: boolean, from?: number): void;
/** @internal */
_$reparentDisconnectables?(parent: Disconnectable): void;
get _$isConnected(): boolean;
constructor(startNode: ChildNode, endNode: ChildNode | null, parent: TemplateInstance | ChildPart | undefined, options: RenderOptions | undefined);
/**
* Sets the connection state for any `AsyncDirectives` contained
* within this part and runs their `disconnected` or `reconnected`, according
* to the `isConnected` argument.
*/
setConnected(isConnected: boolean): void;
/**
* The parent node into which the part renders its content.

@@ -251,20 +191,28 @@ *

private _commitTemplateResult;
/** @internal */
_$getTemplate(result: TemplateResult): Template;
private _commitIterable;
}
/**
* A top-level `ChildPart` returned from `render` that manages the connected
* state of `AsyncDirective`s created throughout the tree below it.
*/
export interface RootPart extends ChildPart {
/**
* Removes the nodes contained within this Part from the DOM.
* Sets the connection state for `AsyncDirective`s contained within this root
* ChildPart.
*
* @param start Start node to clear from, for clearing a subset of the part's
* DOM (used when truncating iterables)
* @param from When `start` is specified, the index within the iterable from
* which ChildParts are being removed, used for disconnecting directives in
* those Parts.
* lit-html does not automatically monitor the connectedness of DOM rendered;
* as such, it is the responsibility of the caller to `render` to ensure that
* `part.setConnected(false)` is called before the part object is potentially
* discarded, to ensure that `AsyncDirective`s have a chance to dispose of
* any resources being held. If a RootPart that was prevously
* disconnected is subsequently re-connected (and its `AsyncDirective`s should
* re-connect), `setConnected(true)` should be called.
*
* @internal
* @param isConnected Whether directives within this tree should be connected
* or not
*/
_$clear(start?: ChildNode | null, from?: number): void;
setConnected(isConnected: boolean): void;
}
export type { AttributePart };
declare class AttributePart {
declare class AttributePart implements Disconnectable {
readonly type: 1 | 3 | 4 | 5;

@@ -280,40 +228,6 @@ readonly element: HTMLElement;

readonly strings?: ReadonlyArray<string>;
/** @internal */
_$committedValue: unknown | Array<unknown>;
/** @internal */
__directives?: Array<Directive | undefined>;
/** @internal */
_$parent: Disconnectable | undefined;
/** @internal */
_$disconnectableChildren?: Set<Disconnectable>;
protected _sanitizer: ValueSanitizer | undefined;
/** @internal */
_setDirectiveConnected?: (directive: Directive | undefined, isConnected: boolean, removeFromParent?: boolean) => void;
get tagName(): string;
constructor(element: HTMLElement, name: string, strings: ReadonlyArray<string>, parent: Disconnectable | undefined, options: RenderOptions | undefined);
/**
* Sets the value of this part by resolving the value from possibly multiple
* values and static strings and committing it to the DOM.
* If this part is single-valued, `this._strings` will be undefined, and the
* method will be called with a single value argument. If this part is
* multi-value, `this._strings` will be defined, and the method is called
* with the value array of the part's owning TemplateInstance, and an offset
* into the value array from which the values should be read.
* This method is overloaded this way to eliminate short-lived array slices
* of the template instance values, and allow a fast-path for single-valued
* parts.
*
* @param value The part value, or an array of values for multi-valued parts
* @param valueIndex the index to start reading values from. `undefined` for
* single-valued parts
* @param noCommit causes the part to not commit its value to the DOM. Used
* in hydration to prime attribute parts with their first-rendered value,
* but not set the attribute, and in SSR to no-op the DOM operation and
* capture the value for serialization.
*
* @internal
*/
_$setValue(value: unknown | Array<unknown>, directiveParent?: DirectiveParent, valueIndex?: number, noCommit?: boolean): void;
/** @internal */
_commitValue(value: unknown): void;
get _$isConnected(): boolean;
constructor(element: HTMLElement, name: string, strings: ReadonlyArray<string>, parent: Disconnectable, options: RenderOptions | undefined);
}

@@ -323,4 +237,2 @@ export type { PropertyPart };

readonly type = 3;
/** @internal */
_commitValue(value: unknown): void;
}

@@ -330,4 +242,2 @@ export type { BooleanAttributePart };

readonly type = 4;
/** @internal */
_commitValue(value: unknown): void;
}

@@ -348,21 +258,12 @@ /**

readonly type = 5;
/** @internal */
_$setValue(newListener: unknown, directiveParent?: DirectiveParent): void;
handleEvent(event: Event): void;
}
export type { ElementPart };
declare class ElementPart {
declare class ElementPart implements Disconnectable {
element: Element;
readonly type = 6;
/** @internal */
__directive?: Directive;
_$committedValue: undefined;
/** @internal */
_$parent: Disconnectable | undefined;
/** @internal */
_$disconnectableChildren?: Set<Disconnectable>;
/** @internal */
_setDirectiveConnected?: (directive: Directive | undefined, isConnected: boolean, removeFromParent?: boolean) => void;
options: RenderOptions | undefined;
constructor(element: Element, parent: Disconnectable, options: RenderOptions | undefined);
get _$isConnected(): boolean;
_$setValue(value: unknown): void;

@@ -378,3 +279,3 @@ }

* to keep a number of (otherwise private) top-level exports mangled in the
* client side code, we export a _Σ object containing those members (or
* client side code, we export a _$LH object containing those members (or
* helper methods for accessing private fields of those members), and then

@@ -389,3 +290,3 @@ * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the

*/
export declare const _Σ: {
export declare const _$LH: {
_boundAttributeSuffix: string;

@@ -392,0 +293,0 @@ _marker: string;

@@ -11,6 +11,13 @@ /**

const ENABLE_SHADYDOM_NOPATCH = true;
/**
* `true` if we're building for google3 with temporary back-compat helpers.
* This export is not present in prod builds.
* @internal
*/
export const INTERNAL = true;
if (DEV_MODE) {
console.warn('lit-html is in dev mode. Not recommended for production!');
}
const wrap = ENABLE_SHADYDOM_NOPATCH && ((_a = window.ShadyDOM) === null || _a === void 0 ? void 0 : _a.inUse) &&
const wrap = ENABLE_SHADYDOM_NOPATCH &&
((_a = window.ShadyDOM) === null || _a === void 0 ? void 0 : _a.inUse) &&
((_b = window.ShadyDOM) === null || _b === void 0 ? void 0 : _b.noPatch) === true

@@ -156,7 +163,17 @@ ? window.ShadyDOM.wrap

*/
const tag = (_$litType$) => (strings, ...values) => ({
_$litType$,
strings,
values,
});
const tag = (type) => (strings, ...values) => {
// Warn against templates octal escape sequences
// We do this here rather than in render so that the warning is closer to the
// template definition.
if (DEV_MODE && strings.some((s) => s === undefined)) {
console.warn('Some template strings are undefined.\n' +
'This is probably caused by illegal octal escape sequences.');
}
return {
// This property needs to remain unminified.
['_$litType$']: type,
strings,
values,
};
};
/**

@@ -196,10 +213,24 @@ * Interprets a template literal as an HTML template that can efficiently

export const render = (value, container, options) => {
var _a, _b;
var _a, _b, _c;
const partOwnerNode = (_a = options === null || options === void 0 ? void 0 : options.renderBefore) !== null && _a !== void 0 ? _a : container;
// This property needs to remain unminified.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let part = partOwnerNode._$litPart$;
let part = partOwnerNode['_$litPart$'];
if (part === undefined) {
const endNode = (_b = options === null || options === void 0 ? void 0 : options.renderBefore) !== null && _b !== void 0 ? _b : null;
// Internal modification: don't clear container to match lit-html 2.0
if (INTERNAL &&
((_c = options) === null || _c === void 0 ? void 0 : _c.clearContainerForLit2MigrationOnly) ===
true) {
let n = container.firstChild;
// Clear only up to the `endNode` aka `renderBefore` node.
while (n && n !== endNode) {
const next = n.nextSibling;
n.remove();
n = next;
}
}
// This property needs to remain unminified.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
partOwnerNode._$litPart$ = part = new ChildPart(container.insertBefore(createMarker(), endNode), endNode, undefined, options);
partOwnerNode['_$litPart$'] = part = new ChildPart(container.insertBefore(createMarker(), endNode), endNode, undefined, options !== null && options !== void 0 ? options : {});
}

@@ -213,3 +244,4 @@ part._$setValue(value);

if (DEV_MODE) {
render._testOnlyClearSanitizerFactoryDoNotCallOrElse = _testOnlyClearSanitizerFactoryDoNotCallOrElse;
render._testOnlyClearSanitizerFactoryDoNotCallOrElse =
_testOnlyClearSanitizerFactoryDoNotCallOrElse;
}

@@ -377,3 +409,5 @@ }

class Template {
constructor({ strings, _$litType$: type }, options) {
constructor(
// This property needs to remain unminified.
{ strings, ['_$litType$']: type }, options) {
/** @internal */

@@ -502,2 +536,3 @@ this.parts = [];

// Overridden via `litHtmlPlatformSupport` to provide platform support.
/** @nocollapse */
static createElement(html, _options) {

@@ -518,8 +553,11 @@ const el = d.createElement('template');

let currentDirective = attributeIndex !== undefined
? (_a = parent.__directives) === null || _a === void 0 ? void 0 : _a[attributeIndex] : parent.__directive;
? (_a = parent.__directives) === null || _a === void 0 ? void 0 : _a[attributeIndex]
: parent.__directive;
const nextDirectiveConstructor = isPrimitive(value)
? undefined
: value._$litDirective$;
: // This property needs to remain unminified.
value['_$litDirective$'];
if ((currentDirective === null || currentDirective === void 0 ? void 0 : currentDirective.constructor) !== nextDirectiveConstructor) {
(_b = currentDirective === null || currentDirective === void 0 ? void 0 : currentDirective._$setDirectiveConnected) === null || _b === void 0 ? void 0 : _b.call(currentDirective, false);
// This property needs to remain unminified.
(_b = currentDirective === null || currentDirective === void 0 ? void 0 : currentDirective['_$notifyDirectiveConnectionChanged']) === null || _b === void 0 ? void 0 : _b.call(currentDirective, false);
if (nextDirectiveConstructor === undefined) {

@@ -533,3 +571,4 @@ currentDirective = undefined;

if (attributeIndex !== undefined) {
((_c = (_d = parent).__directives) !== null && _c !== void 0 ? _c : (_d.__directives = []))[attributeIndex] = currentDirective;
((_c = (_d = parent).__directives) !== null && _c !== void 0 ? _c : (_d.__directives = []))[attributeIndex] =
currentDirective;
}

@@ -558,2 +597,6 @@ else {

}
// See comment in Disconnectable interface for why this is a getter
get _$isConnected() {
return this._$parent._$isConnected;
}
// This method is separate from the constructor because we need to return a

@@ -614,2 +657,9 @@ // DocumentFragment and we don't want to hold onto it with an instance field.

this.type = CHILD_PART;
// TODO(kschaaf): There's currently no way to have the initial render
// of a part be `isConnected: false`. We may want to add this via renderOptions
// so that if a LitElement ends up performing its initial render while
// disconnected, the directives aren't in the wrong state
// https://github.com/lit/lit/issues/2051
/** @internal */
this.__isConnected = true;
// The following fields will be patched onto ChildParts when required by

@@ -628,10 +678,9 @@ // AsyncDirective

}
/**
* Sets the connection state for any `AsyncDirectives` contained
* within this part and runs their `disconnected` or `reconnected`, according
* to the `isConnected` argument.
*/
setConnected(isConnected) {
var _a;
(_a = this._$setChildPartConnected) === null || _a === void 0 ? void 0 : _a.call(this, isConnected);
// See comment in Disconnectable interface for why this is a getter
get _$isConnected() {
var _a, _b;
// ChildParts that are not at the root should always be created with a
// parent; only RootChildNode's won't, so they return the local isConnected
// state
return (_b = (_a = this._$parent) === null || _a === void 0 ? void 0 : _a._$isConnected) !== null && _b !== void 0 ? _b : this.__isConnected;
}

@@ -688,4 +737,5 @@ /**

}
// This property needs to remain unminified.
}
else if (value._$litType$ !== undefined) {
else if (value['_$litType$'] !== undefined) {
this._commitTemplateResult(value);

@@ -763,3 +813,4 @@ }

var _a;
const { values, _$litType$ } = result;
// This property needs to remain unminified.
const { values, ['_$litType$']: type } = result;
// If $litType$ is a number, result is a plain TemplateResult and we get

@@ -769,7 +820,7 @@ // the template from the template cache. If not, result is a

// to create the <template> element the first time we see it.
const template = typeof _$litType$ === 'number'
const template = typeof type === 'number'
? this._$getTemplate(result)
: (_$litType$.el === undefined &&
(_$litType$.el = Template.createElement(_$litType$.h, this.options)),
_$litType$);
: (type.el === undefined &&
(type.el = Template.createElement(type.h, this.options)),
type);
if (((_a = this._$committedValue) === null || _a === void 0 ? void 0 : _a._$template) === template) {

@@ -849,3 +900,3 @@ this._$committedValue._update(values);

var _a;
(_a = this._$setChildPartConnected) === null || _a === void 0 ? void 0 : _a.call(this, false, true, from);
(_a = this._$notifyConnectionChanged) === null || _a === void 0 ? void 0 : _a.call(this, false, true, from);
while (start && start !== this._$endNode) {

@@ -857,2 +908,20 @@ const n = wrap(start).nextSibling;

}
/**
* Implementation of RootPart's `isConnected`. Note that this metod
* should only be called on `RootPart`s (the `ChildPart` returned from a
* top-level `render()` call). It has no effect on non-root ChildParts.
* @param isConnected Whether to set
* @internal
*/
setConnected(isConnected) {
var _a;
if (this._$parent === undefined) {
this.__isConnected = isConnected;
(_a = this._$notifyConnectionChanged) === null || _a === void 0 ? void 0 : _a.call(this, isConnected);
}
else if (DEV_MODE) {
throw new Error('part.setConnected() may only be called on a ' +
'RootPart returned from render().');
}
}
}

@@ -866,4 +935,2 @@ class AttributePart {

this._$disconnectableChildren = undefined;
/** @internal */
this._setDirectiveConnected = undefined;
this.element = element;

@@ -887,2 +954,6 @@ this.name = name;

}
// See comment in Disconnectable interface for why this is a getter
get _$isConnected() {
return this._$parent._$isConnected;
}
/**

@@ -1009,3 +1080,4 @@ * Sets the value of this part by resolving the value from possibly multiple

var _a;
newListener = (_a = resolveDirective(this, newListener, directiveParent, 0)) !== null && _a !== void 0 ? _a : nothing;
newListener =
(_a = resolveDirective(this, newListener, directiveParent, 0)) !== null && _a !== void 0 ? _a : nothing;
if (newListener === noChange) {

@@ -1057,7 +1129,9 @@ return;

this._$disconnectableChildren = undefined;
/** @internal */
this._setDirectiveConnected = undefined;
this._$parent = parent;
this.options = options;
}
// See comment in Disconnectable interface for why this is a getter
get _$isConnected() {
return this._$parent._$isConnected;
}
_$setValue(value) {

@@ -1075,3 +1149,3 @@ resolveDirective(this, value);

* to keep a number of (otherwise private) top-level exports mangled in the
* client side code, we export a _Σ object containing those members (or
* client side code, we export a _$LH object containing those members (or
* helper methods for accessing private fields of those members), and then

@@ -1086,3 +1160,3 @@ * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the

*/
export const _Σ = {
export const _$LH = {
// Used in lit-ssr

@@ -1113,3 +1187,3 @@ _boundAttributeSuffix: boundAttributeSuffix,

// eslint-disable-next-line @typescript-eslint/no-explicit-any
((_e = (_f = globalThis)['litHtmlVersions']) !== null && _e !== void 0 ? _e : (_f['litHtmlVersions'] = [])).push('2.0.0-rc.3');
((_e = (_f = globalThis)['litHtmlVersions']) !== null && _e !== void 0 ? _e : (_f['litHtmlVersions'] = [])).push('2.0.0-rc.4');
//# sourceMappingURL=lit-html.js.map

@@ -32,3 +32,3 @@ /**

strings: TemplateStringsArray;
_$litType$?: string;
['_$litType$']?: string;
}

@@ -35,0 +35,0 @@ interface Directive {

@@ -35,3 +35,4 @@ "use strict";

// );
var wrap = ENABLE_SHADYDOM_NOPATCH && ((_a = window.ShadyDOM) === null || _a === void 0 ? void 0 : _a.inUse) &&
var wrap = ENABLE_SHADYDOM_NOPATCH &&
((_a = window.ShadyDOM) === null || _a === void 0 ? void 0 : _a.inUse) &&
((_b = window.ShadyDOM) === null || _b === void 0 ? void 0 : _b.noPatch) === true

@@ -72,3 +73,8 @@ ? window.ShadyDOM.wrap

if (hasScopeCss && window.ShadyCSS.nativeShadow) {
template.content.appendChild(template.content.querySelector('style'));
// If there were styles but the CSS text was empty, ShadyCSS will
// eliminate the style altogether, so the style here could be null
var style = template.content.querySelector('style');
if (style !== null) {
template.content.appendChild(style);
}
}

@@ -90,12 +96,16 @@ };

}
var scopeCss = cssForScope(scope);
// Remove styles and store textContent.
var styles = element.content.querySelectorAll('style');
// Store the css in this template in the scope css and remove the <style>
// from the template _before_ the node-walk captures part indices
scopeCss.push.apply(scopeCss, Array.from(styles).map(function (style) {
var _a;
(_a = style.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(style);
return style.textContent;
}));
// Process styles only if this scope is being prepared. Otherwise,
// leave styles as is for back compat with Lit1.
if (needsPrepareStyles(scope)) {
var scopeCss = cssForScope(scope);
// Remove styles and store textContent.
var styles = element.content.querySelectorAll('style');
// Store the css in this template in the scope css and remove the <style>
// from the template _before_ the node-walk captures part indices
scopeCss.push.apply(scopeCss, Array.from(styles).map(function (style) {
var _a;
(_a = style.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(style);
return style.textContent;
}));
}
}

@@ -136,3 +146,5 @@ return element;

// is not being rendered.
var template = ((_b = value) === null || _b === void 0 ? void 0 : _b._$litType$) ? this._$committedValue._$template.el
// This property needs to remain unminified.
var template = ((_b = value) === null || _b === void 0 ? void 0 : _b['_$litType$'])
? this._$committedValue._$template.el
: document.createElement('template');

@@ -178,4 +190,5 @@ prepareStyles(scope, template);

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new
globalThis['litHtmlPlatformSupport'].noPatchSupported = ENABLE_SHADYDOM_NOPATCH;
globalThis['litHtmlPlatformSupport'].noPatchSupported =
ENABLE_SHADYDOM_NOPATCH;
}
//# sourceMappingURL=polyfill-support.js.map

@@ -7,4 +7,4 @@ /**

/// <reference types="trusted-types" />
import { Directive, PartInfo } from './directive.js';
import { AttributePart, Part } from './lit-html.js';
import { Directive, PartInfo, DirectiveClass, DirectiveResult } from './directive.js';
import { AttributePart, Part, Disconnectable } from './lit-html.js';
export type { Template } from './lit-html.js';

@@ -16,3 +16,3 @@ /**

* to keep a number of (otherwise private) top-level exports mangled in the
* client side code, we export a _Σ object containing those members (or
* client side code, we export a _$LH object containing those members (or
* helper methods for accessing private fields of those members), and then

@@ -23,3 +23,3 @@ * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the

*/
export declare const _Σ: {
export declare const _$LH: {
boundAttributeSuffix: string;

@@ -38,6 +38,7 @@ marker: string;

__directive?: Directive | undefined;
_$parent: import("./lit-html.js").Disconnectable;
_$disconnectableChildren?: Set<import("./lit-html.js").Disconnectable> | undefined;
_$setDirectiveConnected?(isConnected: boolean): void;
_$initialize(part: Part, parent: import("./lit-html.js").Disconnectable, attributeIndex: number | undefined): void;
_$parent: Disconnectable;
_$disconnectableChildren?: Set<Disconnectable> | undefined;
_$notifyDirectiveConnectionChanged?(isConnected: boolean): void;
readonly _$isConnected: boolean;
_$initialize(part: Part, parent: Disconnectable, attributeIndex: number | undefined): void;
render: ((...props: unknown[]) => unknown) & (() => unknown);

@@ -47,3 +48,5 @@ update(_part: Part, props: unknown[]): unknown;

};
setDirectiveClass(value: DirectiveResult, directiveClass: DirectiveClass): void;
getAttributePartCommittedValue: (part: AttributePart, value: unknown, index: number | undefined) => unknown;
connectedDisconnectable: (props?: object | undefined) => Disconnectable;
resolveDirective: (part: import("./lit-html.js").ChildPart | AttributePart | import("./lit-html.js").ElementPart, value: unknown, parent?: import("./lit-html.js").DirectiveParent, attributeIndex?: number | undefined) => unknown;

@@ -50,0 +53,0 @@ AttributePart: typeof AttributePart;

@@ -6,3 +6,3 @@ /**

*/
import { _Σ as p, noChange } from './lit-html.js';
import { _$LH as p, noChange, } from './lit-html.js';
/**

@@ -13,3 +13,3 @@ * END USERS SHOULD NOT RELY ON THIS OBJECT.

* to keep a number of (otherwise private) top-level exports mangled in the
* client side code, we export a _Σ object containing those members (or
* client side code, we export a _$LH object containing those members (or
* helper methods for accessing private fields of those members), and then

@@ -20,3 +20,3 @@ * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the

*/
export const _Σ = {
export const _$LH = {
boundAttributeSuffix: p._boundAttributeSuffix,

@@ -32,2 +32,6 @@ marker: p._marker,

},
setDirectiveClass(value, directiveClass) {
// This property needs to remain unminified.
value['_$litDirective$'] = directiveClass;
},
getAttributePartCommittedValue: (part, value, index) => {

@@ -44,2 +48,6 @@ // Use the part setter to resolve directives/concatenate multiple parts

},
connectedDisconnectable: (props) => ({
...props,
_$isConnected: true,
}),
resolveDirective: p._resolveDirective,

@@ -46,0 +54,0 @@ AttributePart: p._AttributePart,

@@ -22,7 +22,7 @@ /**

export const unsafeStatic = (value) => ({
_$litStatic$: value,
['_$litStatic$']: value,
});
const textFromStatic = (value) => {
if (value._$litStatic$ !== undefined) {
return value._$litStatic$;
if (value['_$litStatic$'] !== undefined) {
return value['_$litStatic$'];
}

@@ -49,3 +49,3 @@ else {

export const literal = (strings, ...values) => ({
_$litStatic$: values.reduce((acc, v, idx) => acc + textFromStatic(v) + strings[idx + 1], strings[0]),
['_$litStatic$']: values.reduce((acc, v, idx) => acc + textFromStatic(v) + strings[idx + 1], strings[0]),
});

@@ -73,3 +73,4 @@ const stringsCache = new Map();

((dynamicValue = values[i]),
(staticValue = (_a = dynamicValue) === null || _a === void 0 ? void 0 : _a._$litStatic$)) !== undefined) {
(staticValue = (_a = dynamicValue) === null || _a === void 0 ? void 0 : _a['_$litStatic$'])) !==
undefined) {
s += staticValue + strings[++i];

@@ -76,0 +77,0 @@ hasStatics = true;

@@ -8,2 +8,3 @@ /**

import { DirectiveResult, DirectiveClass, PartInfo } from './directive.js';
declare type Primitive = null | undefined | boolean | number | string | symbol | bigint;
/**

@@ -14,3 +15,3 @@ * Tests if a value is a primitive value.

*/
export declare const isPrimitive: (value: unknown) => value is string | number | bigint | boolean | symbol | null | undefined;
export declare const isPrimitive: (value: unknown) => value is Primitive;
export declare const TemplateResultType: {

@@ -24,3 +25,3 @@ readonly HTML: 1;

*/
export declare const isTemplateResult: (value: unknown, type?: 1 | 2 | undefined) => value is TemplateResult<1 | 2>;
export declare const isTemplateResult: (value: unknown, type?: TemplateResultType | undefined) => value is TemplateResult<1 | 2>;
/**

@@ -107,2 +108,3 @@ * Tests if a value is a DirectiveResult.

export declare const clearPart: (part: import("./lit-html.js").ChildPart) => void;
export {};
//# sourceMappingURL=directive-helpers.d.ts.map

@@ -1,2 +0,2 @@

import{_Σ as o}from"./lit-html.js";
import{_$LH as o}from"./lit-html.js";
/**

@@ -6,3 +6,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const{et:t}=o,i=o=>null===o||"object"!=typeof o&&"function"!=typeof o,n={HTML:1,SVG:2},v=(o,t)=>{var i,n;return void 0===t?void 0!==(null===(i=o)||void 0===i?void 0:i._$litType$):(null===(n=o)||void 0===n?void 0:n._$litType$)===t},l=o=>{var t;return void 0!==(null===(t=o)||void 0===t?void 0:t._$litDirective$)},r=o=>{var t;return null===(t=o)||void 0===t?void 0:t._$litDirective$},d=o=>void 0===o.strings,e=()=>document.createComment(""),u=(o,i,n)=>{var v;const l=o.A.parentNode,r=void 0===i?o.B:i.A;if(void 0===n){const i=l.insertBefore(e(),r),v=l.insertBefore(e(),r);n=new t(i,v,o,o.options)}else{const t=n.B.nextSibling,i=n.M!==o;if(i&&(null===(v=n.Q)||void 0===v||v.call(n,o),n.M=o),t!==r||i){let o=n.A;for(;o!==t;){const t=o.nextSibling;l.insertBefore(o,r),o=t}}}return n},c=(o,t,i=o)=>(o.I(t,i),o),s={},f=(o,t=s)=>o.H=t,a=o=>o.H,m=o=>{var t;null===(t=o.P)||void 0===t||t.call(o,!1,!0);let i=o.A;const n=o.B.nextSibling;for(;i!==n;){const o=i.nextSibling;i.remove(),i=o}},p=o=>{o.R()};export{n as TemplateResultType,p as clearPart,a as getCommittedValue,r as getDirectiveClass,u as insertPart,l as isDirectiveResult,i as isPrimitive,d as isSingleExpression,v as isTemplateResult,m as removePart,c as setChildPartValue,f as setCommittedValue};
*/const{H:i}=o,t=o=>null===o||"object"!=typeof o&&"function"!=typeof o,n={HTML:1,SVG:2},v=(o,i)=>{var t,n;return void 0===i?void 0!==(null===(t=o)||void 0===t?void 0:t._$litType$):(null===(n=o)||void 0===n?void 0:n._$litType$)===i},l=o=>{var i;return void 0!==(null===(i=o)||void 0===i?void 0:i._$litDirective$)},d=o=>{var i;return null===(i=o)||void 0===i?void 0:i._$litDirective$},r=o=>void 0===o.strings,e=()=>document.createComment(""),u=(o,t,n)=>{var v;const l=o._$AA.parentNode,d=void 0===t?o._$AB:t._$AA;if(void 0===n){const t=l.insertBefore(e(),d),v=l.insertBefore(e(),d);n=new i(t,v,o,o.options)}else{const i=n._$AB.nextSibling,t=n._$AM,r=t!==o;if(r){let i;null===(v=n._$AQ)||void 0===v||v.call(n,o),n._$AM=o,void 0!==n._$AP&&(i=o._$AU)!==t._$AU&&n._$AP(i)}if(i!==d||r){let o=n._$AA;for(;o!==i;){const i=o.nextSibling;l.insertBefore(o,d),o=i}}}return n},c=(o,i,t=o)=>(o._$AI(i,t),o),f={},s=(o,i=f)=>o._$AH=i,a=o=>o._$AH,m=o=>{var i;null===(i=o._$AP)||void 0===i||i.call(o,!1,!0);let t=o._$AA;const n=o._$AB.nextSibling;for(;t!==n;){const o=t.nextSibling;t.remove(),t=o}},p=o=>{o._$AR()};export{n as TemplateResultType,p as clearPart,a as getCommittedValue,d as getDirectiveClass,u as insertPart,l as isDirectiveResult,t as isPrimitive,r as isSingleExpression,v as isTemplateResult,m as removePart,c as setChildPartValue,s as setCommittedValue};
//# sourceMappingURL=directive-helpers.js.map

@@ -7,3 +7,3 @@ /**

import { Disconnectable, Part } from './lit-html';
export { AttributePart, BooleanAttributePart, ChildPart, ElementPart, EventPart, Part, } from './lit-html';
export { AttributePart, BooleanAttributePart, ChildPart, ElementPart, EventPart, Part, PropertyPart, } from './lit-html';
export interface DirectiveClass {

@@ -22,6 +22,2 @@ new (part: PartInfo): Directive;

export interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {
/** @internal */
_$litDirective$: C;
/** @internal */
values: DirectiveParameters<InstanceType<C>>;
}

@@ -66,14 +62,5 @@ export declare const PartType: {

*/
export declare abstract class Directive {
__part: Part;
__attributeIndex: number | undefined;
__directive?: Directive;
_$parent: Disconnectable;
_$disconnectableChildren?: Set<Disconnectable>;
_$setDirectiveConnected?(isConnected: boolean): void;
export declare abstract class Directive implements Disconnectable {
constructor(_partInfo: PartInfo);
/** @internal */
_$initialize(part: Part, parent: Disconnectable, attributeIndex: number | undefined): void;
/** @internal */
_$resolve(part: Part, props: Array<unknown>): unknown;
get _$isConnected(): boolean;
abstract render(...props: Array<unknown>): unknown;

@@ -80,0 +67,0 @@ update(_part: Part, props: Array<unknown>): unknown;

@@ -6,3 +6,3 @@ /**

*/
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},i=t=>(...i)=>({_$litDirective$:t,values:i});class s{constructor(t){}T(t,i,s){this.Σdt=t,this.M=i,this.Σct=s}S(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}export{s as Directive,t as PartType,i as directive};
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};
//# sourceMappingURL=directive.js.map

@@ -6,16 +6,10 @@ /**

*/
import { ChildPart, noChange } from '../lit-html.js';
import { ChildPart } from '../lit-html.js';
import { DirectiveParameters, PartInfo } from '../directive.js';
import { AsyncDirective } from '../async-directive.js';
declare type Mapper<T> = (v: T, index?: number) => unknown;
declare class AsyncAppendDirective extends AsyncDirective {
private _value?;
private _reconnectResolver?;
private _reconnectPromise?;
import { AsyncReplaceDirective } from './async-replace.js';
declare class AsyncAppendDirective extends AsyncReplaceDirective {
private __childPart;
constructor(partInfo: PartInfo);
render<T>(value: AsyncIterable<T>, _mapper?: Mapper<T>): symbol;
update(part: ChildPart, [value, mapper]: DirectiveParameters<this>): typeof noChange | undefined;
private __iterate;
disconnected(): void;
reconnected(): void;
update(part: ChildPart, params: DirectiveParameters<this>): typeof import("../lit-html.js").noChange | undefined;
protected commitValue(value: unknown, index: number): void;
}

@@ -40,3 +34,3 @@ /**

*/
export declare const asyncAppend: (value: AsyncIterable<unknown>, _mapper?: Mapper<unknown> | undefined) => import("../directive.js").DirectiveResult<typeof AsyncAppendDirective>;
export declare const asyncAppend: (value: AsyncIterable<unknown>, _mapper?: ((v: unknown, index?: number | undefined) => unknown) | undefined) => import("../directive.js").DirectiveResult<typeof AsyncAppendDirective>;
/**

@@ -43,0 +37,0 @@ * The type of the class that powers this directive. Necessary for naming the

@@ -1,2 +0,2 @@

import{noChange as t}from"../lit-html.js";import{directive as e,PartType as i}from"../directive.js";import{clearPart as s,insertPart as r,setChildPartValue as o}from"../directive-helpers.js";import{AsyncDirective as n}from"../async-directive.js";
import{directive as r,PartType as e}from"../directive.js";import{AsyncReplaceDirective as s}from"./async-replace.js";import{clearPart as t,insertPart as o,setChildPartValue as i}from"../directive-helpers.js";
/**

@@ -6,3 +6,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const c=e(class extends n{constructor(t){if(super(t),t.type!==i.CHILD)throw Error("asyncAppend can only be used in child expressions")}render(e,i){return t}update(e,[i,s]){if(i!==this.vt)return this.vt=i,this.Σft(e,s),t}async Σft(t,e){let i=0;const{vt:n}=this;for await(let c of n){if(this.vt!==n)break;this.wt&&await this.wt,0===i&&s(t),void 0!==e&&(c=e(c,i));const h=r(t);o(h,c),i++}}disconnected(){this.wt=new Promise((t=>this.yt=t))}reconnected(){this.wt=void 0,this.yt()}});export{c as asyncAppend};
*/const c=r(class extends s{constructor(r){if(super(r),r.type!==e.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(r,e){return this._$CX=r,super.update(r,e)}commitValue(r,e){0===e&&t(this._$CX);const s=o(this._$CX);i(s,r)}});export{c as asyncAppend};
//# sourceMappingURL=async-append.js.map

@@ -10,9 +10,9 @@ /**

declare type Mapper<T> = (v: T, index?: number) => unknown;
declare class AsyncReplaceDirective extends AsyncDirective {
private _value?;
private _reconnectResolver?;
private _reconnectPromise?;
export declare class AsyncReplaceDirective extends AsyncDirective {
private __value?;
private __weakThis;
private __pauser;
render<T>(value: AsyncIterable<T>, _mapper?: Mapper<T>): symbol;
update(_part: ChildPart, [value, mapper]: DirectiveParameters<this>): typeof noChange | undefined;
private __iterate;
protected commitValue(value: unknown, _index: number): void;
disconnected(): void;

@@ -40,7 +40,3 @@ reconnected(): void;

export declare const asyncReplace: (value: AsyncIterable<unknown>, _mapper?: Mapper<unknown> | undefined) => import("../directive.js").DirectiveResult<typeof AsyncReplaceDirective>;
/**
* The type of the class that powers this directive. Necessary for naming the
* directive's return type.
*/
export type { AsyncReplaceDirective };
export {};
//# sourceMappingURL=async-replace.d.ts.map

@@ -1,2 +0,2 @@

import{noChange as t}from"../lit-html.js";import{directive as i}from"../directive.js";import{AsyncDirective as e}from"../async-directive.js";
import{noChange as t}from"../lit-html.js";import{directive as i}from"../directive.js";import{AsyncDirective as s}from"../async-directive.js";import{PseudoWeakRef as r,Pauser as e,forAwaitOf as n}from"./private-async-helpers.js";
/**

@@ -6,3 +6,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const s=i(class extends e{render(i,e){return t}update(i,[e,s]){if(e!==this.vt)return this.vt=e,this.Σft(s),t}async Σft(t){let i=0;const{vt:e}=this;for await(let s of e){if(this.vt!==e)break;this.wt&&await this.wt,void 0!==t&&(s=t(s,i)),this.setValue(s),i++}}disconnected(){this.wt=new Promise((t=>this.yt=t))}reconnected(){this.wt=void 0,this.yt()}});export{s as asyncReplace};
*/class o extends s{constructor(){super(...arguments),this._$CU=new r(this),this._$CY=new e}render(i,s){return t}update(i,[s,r]){if(this.isConnected||this.disconnected(),s===this._$CJ)return;this._$CJ=s;let e=0;const{_$CU:o,_$CY:h}=this;return n(s,(async t=>{for(;h.get();)await h.get();const i=o.deref();if(void 0!==i){if(i._$CJ!==s)return!1;void 0!==r&&(t=r(t,e)),i.commitValue(t,e),e++}return!0})),t}commitValue(t,i){this.setValue(t)}disconnected(){this._$CU.disconnect(),this._$CY.pause()}reconnected(){this._$CU.reconnect(this),this._$CY.resume()}}const h=i(o);export{o as AsyncReplaceDirective,h as asyncReplace};
//# sourceMappingURL=async-replace.js.map

@@ -21,3 +21,3 @@ /**

*
* ```
* ```js
* let checked = false;

@@ -24,0 +24,0 @@ *

@@ -6,3 +6,3 @@ import{render as t,nothing as i}from"../lit-html.js";import{directive as s,Directive as e}from"../directive.js";import{isTemplateResult as o,getCommittedValue as r,setCommittedValue as h,insertPart as n,clearPart as c}from"../directive-helpers.js";

* SPDX-License-Identifier: BSD-3-Clause
*/const d=s(class extends e{constructor(t){super(t),this._t=new WeakMap}render(t){return[t]}update(s,[e]){if(o(this.vt)&&(!o(e)||this.vt.strings!==e.strings)){const e=r(s).pop();let o=this._t.get(this.vt.strings);if(void 0===o){const s=document.createDocumentFragment();o=t(i,s),this._t.set(this.vt.strings,o)}h(o,[e]),n(o,void 0,e),e.setConnected(!1)}if(o(e)){if(!o(this.vt)||this.vt.strings!==e.strings){const t=this._t.get(e.strings);if(void 0!==t){const i=r(t).pop();c(s),n(s,void 0,i),h(s,[i]),i.setConnected(!0)}}this.vt=e}else this.vt=void 0;return this.render(e)}});export{d as cache};
*/const d=s(class extends e{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(s,[e]){if(o(this.it)&&(!o(e)||this.it.strings!==e.strings)){const e=r(s).pop();let o=this.tt.get(this.it.strings);if(void 0===o){const s=document.createDocumentFragment();o=t(i,s),o.setConnected(!1),this.tt.set(this.it.strings,o)}h(o,[e]),n(o,void 0,e)}if(o(e)){if(!o(this.it)||this.it.strings!==e.strings){const t=this.tt.get(e.strings);if(void 0!==t){const i=r(t).pop();c(s),n(s,void 0,i),h(s,[i])}}this.it=e}else this.it=void 0;return this.render(e)}});export{d as cache};
//# sourceMappingURL=cache.js.map

@@ -6,3 +6,3 @@ import{noChange as t}from"../lit-html.js";import{directive as s,Directive as r,PartType as i}from"../directive.js";

* SPDX-License-Identifier: BSD-3-Clause
*/const e=s(class extends r{constructor(t){var s;if(super(t),t.type!==i.ATTRIBUTE||"class"!==t.name||(null===(s=t.strings)||void 0===s?void 0:s.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).filter((s=>t[s])).join(" ")}update(s,[r]){if(void 0===this.bt){this.bt=new Set;for(const t in r)r[t]&&this.bt.add(t);return this.render(r)}const i=s.element.classList;this.bt.forEach((t=>{t in r||(i.remove(t),this.bt.delete(t))}));for(const t in r){const s=!!r[t];s!==this.bt.has(t)&&(s?(i.add(t),this.bt.add(t)):(i.remove(t),this.bt.delete(t)))}return t}});export{e as classMap};
*/const e=s(class extends r{constructor(t){var s;if(super(t),t.type!==i.ATTRIBUTE||"class"!==t.name||(null===(s=t.strings)||void 0===s?void 0:s.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).filter((s=>t[s])).join(" ")}update(s,[r]){if(void 0===this.st){this.st=new Set;for(const t in r)r[t]&&this.st.add(t);return this.render(r)}const i=s.element.classList;this.st.forEach((t=>{t in r||(i.remove(t),this.st.delete(t))}));for(const t in r){const s=!!r[t];s!==this.st.has(t)&&(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return t}});export{e as classMap};
//# sourceMappingURL=class-map.js.map

@@ -7,3 +7,3 @@ import{noChange as r}from"../lit-html.js";import{directive as t,Directive as s}from"../directive.js";

*/
const e={},i=t(class extends s{constructor(){super(...arguments),this.$t=e}render(r,t){return t()}update(t,[s,e]){if(Array.isArray(s)){if(Array.isArray(this.$t)&&this.$t.length===s.length&&s.every(((r,t)=>r===this.$t[t])))return r}else if(this.$t===s)return r;return this.$t=Array.isArray(s)?Array.from(s):s,this.render(s,e)}});export{i as guard};
const e={},i=t(class extends s{constructor(){super(...arguments),this.et=e}render(r,t){return t()}update(t,[s,e]){if(Array.isArray(s)){if(Array.isArray(this.et)&&this.et.length===s.length&&s.every(((r,t)=>r===this.et[t])))return r}else if(this.et===s)return r;return this.et=Array.isArray(s)?Array.from(s):s,this.render(s,e)}});export{i as guard};
//# sourceMappingURL=guard.js.map

@@ -27,3 +27,5 @@ /**

*
* ```js
* html`<input .value=${live(x)}>`
* ```
*

@@ -30,0 +32,0 @@ * `live()` performs a strict equality check agains the live DOM value, and if

@@ -50,11 +50,12 @@ /**

* @example
* ```js
* // Using Ref object
* const inputRef = createRef();
* render(html`<input ${ref(inputRef)}>`, container);
* inputRef.value.focus();
*
* // Using Ref object
* const inputRef = createRef();
* render(html`<input ${ref(inputRef)}>`, container);
* inputRef.value.focus();
*
* // Using callback
* const callback = (inputElement) => inputElement.focus();
* render(html`<input ${ref(callback)}>`, container);
* // Using callback
* const callback = (inputElement) => inputElement.focus();
* render(html`<input ${ref(callback)}>`, container);
* ```
*/

@@ -61,0 +62,0 @@ export declare const ref: (_ref: RefOrCallback) => import("../directive.js").DirectiveResult<typeof RefDirective>;

@@ -1,2 +0,2 @@

import{nothing as t}from"../lit-html.js";import{directive as i}from"../directive.js";import{AsyncDirective as s}from"../async-directive.js";
import{nothing as t}from"../lit-html.js";import{AsyncDirective as i}from"../async-directive.js";import{directive as s}from"../directive.js";
/**

@@ -6,3 +6,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const e=()=>new o;class o{}const h=new WeakMap,n=i(class extends s{render(i){return t}update(i,[s]){var e;const o=s!==this.gt;return o&&void 0!==this.gt&&this.xt(void 0),(o||this.Tt!==this.Et)&&(this.gt=s,this.At=null===(e=i.options)||void 0===e?void 0:e.host,this.xt(this.Et=i.element)),t}xt(t){"function"==typeof this.gt?(void 0!==h.get(this.gt)&&this.gt.call(this.At,void 0),h.set(this.gt,t),void 0!==t&&this.gt.call(this.At,t)):this.gt.value=t}get Tt(){var t;return"function"==typeof this.gt?h.get(this.gt):null===(t=this.gt)||void 0===t?void 0:t.value}disconnected(){this.Tt===this.Et&&this.xt(void 0)}reconnected(){this.xt(this.Et)}});export{e as createRef,n as ref};
*/const e=()=>new o;class o{}const h=new WeakMap,n=s(class extends i{render(i){return t}update(i,[s]){var e;const o=s!==this.q;return o&&void 0!==this.q&&this.nt(void 0),(o||this.ot!==this.rt)&&(this.q=s,this.lt=null===(e=i.options)||void 0===e?void 0:e.host,this.nt(this.rt=i.element)),t}nt(t){"function"==typeof this.q?(void 0!==h.get(this.q)&&this.q.call(this.lt,void 0),h.set(this.q,t),void 0!==t&&this.q.call(this.lt,t)):this.q.value=t}get ot(){var t;return"function"==typeof this.q?h.get(this.q):null===(t=this.q)||void 0===t?void 0:t.value}disconnected(){this.ot===this.rt&&this.nt(void 0)}reconnected(){this.nt(this.rt)}});export{e as createRef,n as ref};
//# sourceMappingURL=ref.js.map

@@ -7,3 +7,3 @@ import{noChange as e}from"../lit-html.js";import{directive as s,Directive as t,PartType as r}from"../directive.js";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from"../directive-helpers.js";

*/
const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error("repeat() can only be used in text expressions")}Mt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.Mt(e,s,t).values}update(s,[t,r,c]){var d;const p=l(s),{values:v,keys:a}=this.Mt(t,r,c);if(!p)return this.Pt=a,v;const h=null!==(d=this.Pt)&&void 0!==d?d:this.Pt=[],m=[];let x,y,j=0,k=p.length-1,w=0,b=v.length-1;for(;j<=k&&w<=b;)if(null===p[j])j++;else if(null===p[k])k--;else if(h[j]===a[w])m[w]=o(p[j],v[w]),j++,w++;else if(h[k]===a[b])m[b]=o(p[k],v[b]),k--,b--;else if(h[j]===a[b])m[b]=o(p[j],v[b]),i(s,m[b+1],p[j]),j++,b--;else if(h[k]===a[w])m[w]=o(p[k],v[w]),i(s,p[j],p[k]),k--,w++;else if(void 0===x&&(x=u(a,w,b),y=u(h,j,k)),x.has(h[j]))if(x.has(h[k])){const e=y.get(a[w]),t=void 0!==e?p[e]:null;if(null===t){const e=i(s,p[j]);o(e,v[w]),m[w]=e}else m[w]=o(t,v[w]),i(s,p[j],t),p[e]=null;w++}else n(p[k]),k--;else n(p[j]),j++;for(;w<=b;){const e=i(s,m[b+1]);o(e,v[w]),m[w++]=e}for(;j<=k;){const e=p[j++];null!==e&&n(e)}return this.Pt=a,f(s,m),e}});export{c as repeat};
const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error("repeat() can only be used in text expressions")}ht(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.ht(e,s,t).values}update(s,[t,r,c]){var d;const p=l(s),{values:v,keys:a}=this.ht(t,r,c);if(!p)return this.dt=a,v;const h=null!==(d=this.dt)&&void 0!==d?d:this.dt=[],m=[];let x,y,j=0,k=p.length-1,w=0,b=v.length-1;for(;j<=k&&w<=b;)if(null===p[j])j++;else if(null===p[k])k--;else if(h[j]===a[w])m[w]=o(p[j],v[w]),j++,w++;else if(h[k]===a[b])m[b]=o(p[k],v[b]),k--,b--;else if(h[j]===a[b])m[b]=o(p[j],v[b]),i(s,m[b+1],p[j]),j++,b--;else if(h[k]===a[w])m[w]=o(p[k],v[w]),i(s,p[j],p[k]),k--,w++;else if(void 0===x&&(x=u(a,w,b),y=u(h,j,k)),x.has(h[j]))if(x.has(h[k])){const e=y.get(a[w]),t=void 0!==e?p[e]:null;if(null===t){const e=i(s,p[j]);o(e,v[w]),m[w]=e}else m[w]=o(t,v[w]),i(s,p[j],t),p[e]=null;w++}else n(p[k]),k--;else n(p[j]),j++;for(;w<=b;){const e=i(s,m[b+1]);o(e,v[w]),m[w++]=e}for(;j<=k;){const e=p[j++];null!==e&&n(e)}return this.dt=a,f(s,m),e}});export{c as repeat};
//# sourceMappingURL=repeat.js.map

@@ -6,3 +6,3 @@ import{noChange as t}from"../lit-html.js";import{directive as e,Directive as r,PartType as s}from"../directive.js";

* SPDX-License-Identifier: BSD-3-Clause
*/const i=e(class extends r{constructor(t){var e;if(super(t),t.type!==s.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.St){this.St=new Set;for(const t in r)this.St.add(t);return this.render(r)}this.St.forEach((t=>{null==r[t]&&(this.St.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")}));for(const t in r){const e=r[t];null!=e&&(this.St.add(t),t.includes("-")?s.setProperty(t,e):s[t]=e)}return t}});export{i as styleMap};
*/const i=e(class extends r{constructor(t){var e;if(super(t),t.type!==s.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ct){this.ct=new Set;for(const t in r)this.ct.add(t);return this.render(r)}this.ct.forEach((t=>{null==r[t]&&(this.ct.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")}));for(const t in r){const e=r[t];null!=e&&(this.ct.add(t),t.includes("-")?s.setProperty(t,e):s[t]=e)}return t}});export{i as styleMap};
//# sourceMappingURL=style-map.js.map

@@ -6,3 +6,3 @@ import{noChange as t}from"../lit-html.js";import{directive as r,Directive as e,PartType as n}from"../directive.js";

* SPDX-License-Identifier: BSD-3-Clause
*/const o=r(class extends e{constructor(t){if(super(t),t.type!==n.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.kt===r?t:(this.kt=r,document.importNode(r.content,!0))}});export{o as templateContent};
*/const o=r(class extends e{constructor(t){if(super(t),t.type!==n.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.ut===r?t:(this.ut=r,document.importNode(r.content,!0))}});export{o as templateContent};
//# sourceMappingURL=template-content.js.map

@@ -6,3 +6,3 @@ import{nothing as t,noChange as i}from"../lit-html.js";import{Directive as r,PartType as s,directive as e}from"../directive.js";

* SPDX-License-Identifier: BSD-3-Clause
*/class n extends r{constructor(i){if(super(i),this.vt=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===t)return this.Vt=void 0,this.vt=r;if(r===i)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.vt)return this.Vt;this.vt=r;const s=[r];return s.raw=s,this.Vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}n.directiveName="unsafeHTML",n.resultType=1;const o=e(n);export{n as UnsafeHTMLDirective,o as unsafeHTML};
*/class n extends r{constructor(i){if(super(i),this.it=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===t)return this.vt=void 0,this.it=r;if(r===i)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this.vt;this.it=r;const s=[r];return s.raw=s,this.vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}n.directiveName="unsafeHTML",n.resultType=1;const o=e(n);export{n as UnsafeHTMLDirective,o as unsafeHTML};
//# sourceMappingURL=unsafe-html.js.map

@@ -8,7 +8,11 @@ /**

import { AsyncDirective } from '../async-directive.js';
declare class UntilDirective extends AsyncDirective {
private _lastRenderedIndex;
private _values;
export declare class UntilDirective extends AsyncDirective {
private __lastRenderedIndex;
private __values;
private __weakThis;
private __pauser;
render(...args: Array<unknown>): unknown;
update(_part: Part, args: Array<unknown>): unknown;
disconnected(): void;
reconnected(): void;
}

@@ -39,3 +43,2 @@ /**

*/
export type { UntilDirective };
//# sourceMappingURL=until.d.ts.map

@@ -1,2 +0,2 @@

import{noChange as t}from"../lit-html.js";import{directive as r}from"../directive.js";import{isPrimitive as s}from"../directive-helpers.js";import{AsyncDirective as i}from"../async-directive.js";
import{noChange as t}from"../lit-html.js";import{directive as s}from"../directive.js";import{isPrimitive as i}from"../directive-helpers.js";import{AsyncDirective as r}from"../async-directive.js";import{PseudoWeakRef as e,Pauser as o}from"./private-async-helpers.js";
/**

@@ -6,3 +6,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const e=t=>!s(t)&&"function"==typeof t.then,o=r(class extends i{constructor(){super(...arguments),this.Ct=2147483647,this.Rt=[]}render(...r){var s;return null!==(s=r.find((t=>!e(t))))&&void 0!==s?s:t}update(r,s){const i=this.Rt;let o=i.length;this.Rt=s;for(let t=0;t<s.length&&!(t>this.Ct);t++){const r=s[t];if(!e(r))return this.Ct=t,r;t<o&&r===i[t]||(this.Ct=2147483647,o=0,Promise.resolve(r).then((t=>{const s=this.Rt.indexOf(r);s>-1&&s<this.Ct&&(this.Ct=s,this.setValue(t))})))}return t}});export{o as until};
*/const n=t=>!i(t)&&"function"==typeof t.then;class h extends r{constructor(){super(...arguments),this._$Cft=1073741823,this._$Cwt=[],this._$CU=new e(this),this._$CY=new o}render(...s){var i;return null!==(i=s.find((t=>!n(t))))&&void 0!==i?i:t}update(s,i){const r=this._$Cwt;let e=r.length;this._$Cwt=i;const o=this._$CU,h=this._$CY;this.isConnected||this.disconnected();for(let t=0;t<i.length&&!(t>this._$Cft);t++){const s=i[t];if(!n(s))return this._$Cft=t,s;t<e&&s===r[t]||(this._$Cft=1073741823,e=0,Promise.resolve(s).then((async t=>{for(;h.get();)await h.get();const i=o.deref();if(void 0!==i){const r=i._$Cwt.indexOf(s);r>-1&&r<i._$Cft&&(i._$Cft=r,i.setValue(t))}})))}return t}disconnected(){this._$CU.disconnect(),this._$CY.pause()}reconnected(){this._$CU.reconnect(this),this._$CY.resume()}}const c=s(h);export{h as UntilDirective,c as until};
//# sourceMappingURL=until.js.map

@@ -1,2 +0,2 @@

import{noChange as e,_Σ as t}from"./lit-html.js";import{PartType as r}from"./directive.js";import{isPrimitive as n,isTemplateResult as o,isSingleExpression as l}from"./directive-helpers.js";
import{noChange as e,_$LH as t}from"./lit-html.js";import{PartType as r}from"./directive.js";import{isPrimitive as n,isTemplateResult as o,isSingleExpression as l}from"./directive-helpers.js";
/**

@@ -6,3 +6,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const{tt:i,it:a,st:s,et:c,ht:d}=t,p=(e,t,r={})=>{if(void 0!==t._$litPart$)throw Error("container already contains a live render");let n,o;const l=[],i=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT,null,!1);let a;for(;null!==(a=i.nextNode());){const t=a.data;if(t.startsWith("lit-part")){if(0===l.length&&void 0!==n)throw Error("there must be only one root part per container");o=f(e,a,l,r),null!=n||(n=o)}else if(t.startsWith("lit-node")){u(a,l,r);const e=a.parentElement;e.hasAttribute("defer-hydration")&&e.removeAttribute("defer-hydration")}else if(t.startsWith("/lit-part")){if(1===l.length&&o!==n)throw Error("internal error");o=h(a,o,l)}}console.assert(void 0!==n,"there should be exactly one root part in a render container"),t._$litPart$=n},f=(t,r,l,d)=>{let p,f;if(0===l.length)f=new c(r,null,void 0,d),p=t;else{const e=l[l.length-1];if("template-instance"===e.type)f=new c(r,null,e.instance,d),e.instance.l.push(f),p=e.result.values[e.instancePartIndex++],e.templatePartIndex++;else if("iterable"===e.type){f=new c(r,null,e.part,d);const t=e.iterator.next();if(t.done)throw p=void 0,e.done=!0,Error("Unhandled shorter than expected iterable");p=t.value,e.part.H.push(f)}else f=new c(r,null,e.part,d)}if(p=s(f,p),p===e)l.push({part:f,type:"leaf"});else if(n(p))l.push({part:f,type:"leaf"}),f.H=p;else if(o(p)){const e="lit-part "+m(p);if(r.data!==e)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const e=c.prototype.C(p),t=new i(e,f);l.push({type:"template-instance",instance:t,part:f,templatePartIndex:0,instancePartIndex:0,result:p}),f.H=t}}else a(p)?(l.push({part:f,type:"iterable",value:p,iterator:p[Symbol.iterator](),done:!1}),f.H=[]):(l.push({part:f,type:"leaf"}),f.H=null==p?"":p);return f},h=(e,t,r)=>{if(void 0===t)throw Error("unbalanced part marker");t.B=e;const n=r.pop();if("iterable"===n.type&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(r.length>0)return r[r.length-1].part},u=(e,t,n)=>{var o;const i=/lit-node (\d+)/.exec(e.data),a=parseInt(i[1]),c=null!==(o=e.previousSibling)&&void 0!==o?o:e.parentElement,p=t[t.length-1];if("template-instance"!==p.type)throw Error("internal error");{const e=p.instance;for(;;){const t=e.D.parts[p.templatePartIndex];if(void 0===t||t.type!==r.ATTRIBUTE&&t.type!==r.ELEMENT||t.index!==a)break;if(t.type===r.ATTRIBUTE){const o=new t.ctor(c,t.name,t.strings,p.instance,n),i=l(o)?p.result.values[p.instancePartIndex]:p.result.values,a=!(o.type===r.EVENT||o.type===r.PROPERTY);o.I(i,o,p.instancePartIndex,a),p.instancePartIndex+=t.strings.length-1,e.l.push(o)}else{const t=new d(c,p.instance,n);s(t,p.result.values[p.instancePartIndex++]),e.l.push(t)}p.templatePartIndex++}}},m=e=>{const t=new Uint32Array(2).fill(5381);for(const r of e.strings)for(let e=0;e<r.length;e++)t[e%2]=33*t[e%2]^r.charCodeAt(e);return btoa(String.fromCharCode(...new Uint8Array(t.buffer)))};export{m as digestForTemplateResult,p as hydrate};
*/const{D:i,L:a,j:s,H:c,F:d}=t,p=(e,t,r={})=>{if(void 0!==t._$litPart$)throw Error("container already contains a live render");let n,o;const l=[],i=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT,null,!1);let a;for(;null!==(a=i.nextNode());){const t=a.data;if(t.startsWith("lit-part")){if(0===l.length&&void 0!==n)throw Error("there must be only one root part per container");o=f(e,a,l,r),null!=n||(n=o)}else if(t.startsWith("lit-node")){u(a,l,r);const e=a.parentElement;e.hasAttribute("defer-hydration")&&e.removeAttribute("defer-hydration")}else if(t.startsWith("/lit-part")){if(1===l.length&&o!==n)throw Error("internal error");o=h(a,o,l)}}console.assert(void 0!==n,"there should be exactly one root part in a render container"),t._$litPart$=n},f=(t,r,l,d)=>{let p,f;if(0===l.length)f=new c(r,null,void 0,d),p=t;else{const e=l[l.length-1];if("template-instance"===e.type)f=new c(r,null,e.instance,d),e.instance.v.push(f),p=e.result.values[e.instancePartIndex++],e.templatePartIndex++;else if("iterable"===e.type){f=new c(r,null,e.part,d);const t=e.iterator.next();if(t.done)throw p=void 0,e.done=!0,Error("Unhandled shorter than expected iterable");p=t.value,e.part._$AH.push(f)}else f=new c(r,null,e.part,d)}if(p=s(f,p),p===e)l.push({part:f,type:"leaf"});else if(n(p))l.push({part:f,type:"leaf"}),f._$AH=p;else if(o(p)){const e="lit-part "+m(p);if(r.data!==e)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const e=c.prototype._$AC(p),t=new i(e,f);l.push({type:"template-instance",instance:t,part:f,templatePartIndex:0,instancePartIndex:0,result:p}),f._$AH=t}}else a(p)?(l.push({part:f,type:"iterable",value:p,iterator:p[Symbol.iterator](),done:!1}),f._$AH=[]):(l.push({part:f,type:"leaf"}),f._$AH=null==p?"":p);return f},h=(e,t,r)=>{if(void 0===t)throw Error("unbalanced part marker");t._$AB=e;const n=r.pop();if("iterable"===n.type&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(r.length>0)return r[r.length-1].part},u=(e,t,n)=>{var o;const i=/lit-node (\d+)/.exec(e.data),a=parseInt(i[1]),c=null!==(o=e.previousSibling)&&void 0!==o?o:e.parentElement,p=t[t.length-1];if("template-instance"!==p.type)throw Error("internal error");{const e=p.instance;for(;;){const t=e._$AD.parts[p.templatePartIndex];if(void 0===t||t.type!==r.ATTRIBUTE&&t.type!==r.ELEMENT||t.index!==a)break;if(t.type===r.ATTRIBUTE){const o=new t.ctor(c,t.name,t.strings,p.instance,n),i=l(o)?p.result.values[p.instancePartIndex]:p.result.values,a=!(o.type===r.EVENT||o.type===r.PROPERTY);o._$AI(i,o,p.instancePartIndex,a),p.instancePartIndex+=t.strings.length-1,e.v.push(o)}else{const t=new d(c,p.instance,n);s(t,p.result.values[p.instancePartIndex++]),e.v.push(t)}p.templatePartIndex++}}},m=e=>{const t=new Uint32Array(2).fill(5381);for(const r of e.strings)for(let e=0;e<r.length;e++)t[e%2]=33*t[e%2]^r.charCodeAt(e);return btoa(String.fromCharCode(...new Uint8Array(t.buffer)))};export{m as digestForTemplateResult,p as hydrate};
//# sourceMappingURL=experimental-hydrate.js.map

@@ -46,6 +46,2 @@ /**

declare type ResultType = typeof HTML_RESULT | typeof SVG_RESULT;
declare const ATTRIBUTE_PART = 1;
declare const CHILD_PART = 2;
declare const ELEMENT_PART = 6;
declare const COMMENT_PART = 7;
/**

@@ -55,3 +51,3 @@ * The return type of the template tag functions.

export declare type TemplateResult<T extends ResultType = ResultType> = {
_$litType$: T;
['_$litType$']: T;
strings: TemplateStringsArray;

@@ -63,3 +59,3 @@ values: unknown[];

export interface CompiledTemplateResult {
_$litType$: CompiledTemplate;
['_$litType$']: CompiledTemplate;
values: unknown[];

@@ -116,3 +112,3 @@ }

export declare const render: {
(value: unknown, container: HTMLElement | DocumentFragment, options?: RenderOptions | undefined): ChildPart;
(value: unknown, container: HTMLElement | DocumentFragment, options?: RenderOptions | undefined): RootPart;
setSanitizer: (newSanitizer: SanitizerFactory) => void;

@@ -124,13 +120,9 @@ createSanitizer: SanitizerFactory;

_$parent?: DirectiveParent;
_$isConnected: boolean;
__directive?: Directive;
__directives?: Array<Directive | undefined>;
}
/** @internal */
export type { Template };
declare class Template {
/** @internal */
el: HTMLTemplateElement;
/** @internal */
parts: Array<TemplatePart>;
constructor({ strings, _$litType$: type }: TemplateResult, options?: RenderOptions);
constructor({ strings, ['_$litType$']: type }: TemplateResult, options?: RenderOptions);
/** @nocollapse */
static createElement(html: TrustedHTML, _options?: RenderOptions): HTMLTemplateElement;

@@ -141,2 +133,3 @@ }

_$disconnectableChildren?: Set<Disconnectable>;
_$isConnected: boolean;
}

@@ -148,71 +141,18 @@ declare function resolveDirective(part: ChildPart | AttributePart | ElementPart, value: unknown, parent?: DirectiveParent, attributeIndex?: number): unknown;

*/
declare class TemplateInstance {
/** @internal */
_$template: Template;
/** @internal */
_parts: Array<Part | undefined>;
/** @internal */
_$parent: Disconnectable;
/** @internal */
_$disconnectableChildren?: Set<Disconnectable>;
declare class TemplateInstance implements Disconnectable {
constructor(template: Template, parent: ChildPart);
get _$isConnected(): boolean;
_clone(options: RenderOptions | undefined): Node;
_update(values: Array<unknown>): void;
}
declare type AttributeTemplatePart = {
readonly type: typeof ATTRIBUTE_PART;
readonly index: number;
readonly name: string;
/** @internal */
readonly ctor: typeof AttributePart;
/** @internal */
readonly strings: ReadonlyArray<string>;
};
declare type NodeTemplatePart = {
readonly type: typeof CHILD_PART;
readonly index: number;
};
declare type ElementTemplatePart = {
readonly type: typeof ELEMENT_PART;
readonly index: number;
};
declare type CommentTemplatePart = {
readonly type: typeof COMMENT_PART;
readonly index: number;
};
/**
* A TemplatePart represents a dynamic part in a template, before the template
* is instantiated. When a template is instantiated Parts are created from
* TemplateParts.
*/
declare type TemplatePart = NodeTemplatePart | AttributeTemplatePart | ElementTemplatePart | CommentTemplatePart;
export declare type Part = ChildPart | AttributePart | PropertyPart | BooleanAttributePart | ElementPart | EventPart;
export type { ChildPart };
declare class ChildPart {
declare class ChildPart implements Disconnectable {
readonly type = 2;
readonly options: RenderOptions | undefined;
_$committedValue: unknown;
/** @internal */
__directive?: Directive;
/** @internal */
_$startNode: ChildNode;
/** @internal */
_$endNode: ChildNode | null;
private _textSanitizer;
/** @internal */
_$parent: Disconnectable | undefined;
/** @internal */
_$disconnectableChildren?: Set<Disconnectable>;
/** @internal */
_$setChildPartConnected?(isConnected: boolean, removeFromParent?: boolean, from?: number): void;
/** @internal */
_$reparentDisconnectables?(parent: Disconnectable): void;
get _$isConnected(): boolean;
constructor(startNode: ChildNode, endNode: ChildNode | null, parent: TemplateInstance | ChildPart | undefined, options: RenderOptions | undefined);
/**
* Sets the connection state for any `AsyncDirectives` contained
* within this part and runs their `disconnected` or `reconnected`, according
* to the `isConnected` argument.
*/
setConnected(isConnected: boolean): void;
/**
* The parent node into which the part renders its content.

@@ -251,20 +191,28 @@ *

private _commitTemplateResult;
/** @internal */
_$getTemplate(result: TemplateResult): Template;
private _commitIterable;
}
/**
* A top-level `ChildPart` returned from `render` that manages the connected
* state of `AsyncDirective`s created throughout the tree below it.
*/
export interface RootPart extends ChildPart {
/**
* Removes the nodes contained within this Part from the DOM.
* Sets the connection state for `AsyncDirective`s contained within this root
* ChildPart.
*
* @param start Start node to clear from, for clearing a subset of the part's
* DOM (used when truncating iterables)
* @param from When `start` is specified, the index within the iterable from
* which ChildParts are being removed, used for disconnecting directives in
* those Parts.
* lit-html does not automatically monitor the connectedness of DOM rendered;
* as such, it is the responsibility of the caller to `render` to ensure that
* `part.setConnected(false)` is called before the part object is potentially
* discarded, to ensure that `AsyncDirective`s have a chance to dispose of
* any resources being held. If a RootPart that was prevously
* disconnected is subsequently re-connected (and its `AsyncDirective`s should
* re-connect), `setConnected(true)` should be called.
*
* @internal
* @param isConnected Whether directives within this tree should be connected
* or not
*/
_$clear(start?: ChildNode | null, from?: number): void;
setConnected(isConnected: boolean): void;
}
export type { AttributePart };
declare class AttributePart {
declare class AttributePart implements Disconnectable {
readonly type: 1 | 3 | 4 | 5;

@@ -280,40 +228,6 @@ readonly element: HTMLElement;

readonly strings?: ReadonlyArray<string>;
/** @internal */
_$committedValue: unknown | Array<unknown>;
/** @internal */
__directives?: Array<Directive | undefined>;
/** @internal */
_$parent: Disconnectable | undefined;
/** @internal */
_$disconnectableChildren?: Set<Disconnectable>;
protected _sanitizer: ValueSanitizer | undefined;
/** @internal */
_setDirectiveConnected?: (directive: Directive | undefined, isConnected: boolean, removeFromParent?: boolean) => void;
get tagName(): string;
constructor(element: HTMLElement, name: string, strings: ReadonlyArray<string>, parent: Disconnectable | undefined, options: RenderOptions | undefined);
/**
* Sets the value of this part by resolving the value from possibly multiple
* values and static strings and committing it to the DOM.
* If this part is single-valued, `this._strings` will be undefined, and the
* method will be called with a single value argument. If this part is
* multi-value, `this._strings` will be defined, and the method is called
* with the value array of the part's owning TemplateInstance, and an offset
* into the value array from which the values should be read.
* This method is overloaded this way to eliminate short-lived array slices
* of the template instance values, and allow a fast-path for single-valued
* parts.
*
* @param value The part value, or an array of values for multi-valued parts
* @param valueIndex the index to start reading values from. `undefined` for
* single-valued parts
* @param noCommit causes the part to not commit its value to the DOM. Used
* in hydration to prime attribute parts with their first-rendered value,
* but not set the attribute, and in SSR to no-op the DOM operation and
* capture the value for serialization.
*
* @internal
*/
_$setValue(value: unknown | Array<unknown>, directiveParent?: DirectiveParent, valueIndex?: number, noCommit?: boolean): void;
/** @internal */
_commitValue(value: unknown): void;
get _$isConnected(): boolean;
constructor(element: HTMLElement, name: string, strings: ReadonlyArray<string>, parent: Disconnectable, options: RenderOptions | undefined);
}

@@ -323,4 +237,2 @@ export type { PropertyPart };

readonly type = 3;
/** @internal */
_commitValue(value: unknown): void;
}

@@ -330,4 +242,2 @@ export type { BooleanAttributePart };

readonly type = 4;
/** @internal */
_commitValue(value: unknown): void;
}

@@ -348,21 +258,12 @@ /**

readonly type = 5;
/** @internal */
_$setValue(newListener: unknown, directiveParent?: DirectiveParent): void;
handleEvent(event: Event): void;
}
export type { ElementPart };
declare class ElementPart {
declare class ElementPart implements Disconnectable {
element: Element;
readonly type = 6;
/** @internal */
__directive?: Directive;
_$committedValue: undefined;
/** @internal */
_$parent: Disconnectable | undefined;
/** @internal */
_$disconnectableChildren?: Set<Disconnectable>;
/** @internal */
_setDirectiveConnected?: (directive: Directive | undefined, isConnected: boolean, removeFromParent?: boolean) => void;
options: RenderOptions | undefined;
constructor(element: Element, parent: Disconnectable, options: RenderOptions | undefined);
get _$isConnected(): boolean;
_$setValue(value: unknown): void;

@@ -378,3 +279,3 @@ }

* to keep a number of (otherwise private) top-level exports mangled in the
* client side code, we export a _Σ object containing those members (or
* client side code, we export a _$LH object containing those members (or
* helper methods for accessing private fields of those members), and then

@@ -389,3 +290,3 @@ * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the

*/
export declare const _Σ: {
export declare const _$LH: {
_boundAttributeSuffix: string;

@@ -392,0 +293,0 @@ _marker: string;

@@ -6,3 +6,3 @@ /**

*/
var t,i,s,e;const o=globalThis.trustedTypes,l=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,n=`lit$${(Math.random()+"").slice(9)}$`,h="?"+n,r=`<${h}>`,u=document,c=(t="")=>u.createComment(t),d=t=>null===t||"object"!=typeof t&&"function"!=typeof t,v=Array.isArray,a=t=>{var i;return v(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])},f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,$=/'/g,g=/"/g,y=/^(?:script|style|textarea)$/i,b=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),T=b(1),x=b(2),w=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),P=new WeakMap,V=(t,i,s)=>{var e,o;const l=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let n=l._$litPart$;if(void 0===n){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;l._$litPart$=n=new C(i.insertBefore(c(),t),t,void 0,s)}return n.I(t),n},E=u.createTreeWalker(u,129,null,!1),M=(t,i)=>{const s=t.length-1,e=[];let o,h=2===i?"<svg>":"",u=f;for(let i=0;i<s;i++){const s=t[i];let l,c,d=-1,v=0;for(;v<s.length&&(u.lastIndex=v,c=u.exec(s),null!==c);)v=u.lastIndex,u===f?"!--"===c[1]?u=_:void 0!==c[1]?u=m:void 0!==c[2]?(y.test(c[2])&&(o=RegExp("</"+c[2],"g")),u=p):void 0!==c[3]&&(u=p):u===p?">"===c[0]?(u=null!=o?o:f,d=-1):void 0===c[1]?d=-2:(d=u.lastIndex-c[2].length,l=c[1],u=void 0===c[3]?p:'"'===c[3]?g:$):u===g||u===$?u=p:u===_||u===m?u=f:(u=p,o=void 0);const a=u===p&&t[i+1].startsWith("/>")?" ":"";h+=u===f?s+r:d>=0?(e.push(l),s.slice(0,d)+"$lit$"+s.slice(d)+n+a):s+n+(-2===d?(e.push(void 0),i):a)}const c=h+(t[s]||"<?>")+(2===i?"</svg>":"");return[void 0!==l?l.createHTML(c):c,e]};class N{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let l=0,r=0;const u=t.length-1,d=this.parts,[v,a]=M(t,i);if(this.el=N.createElement(v,s),E.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=E.nextNode())&&d.length<u;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(n)){const s=a[r++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+"$lit$").split(n),i=/([.?@])?(.*)/.exec(s);d.push({type:1,index:l,name:i[2],strings:t,ctor:"."===i[1]?I:"?"===i[1]?L:"@"===i[1]?R:H})}else d.push({type:6,index:l})}for(const i of t)e.removeAttribute(i)}if(y.test(e.tagName)){const t=e.textContent.split(n),i=t.length-1;if(i>0){e.textContent=o?o.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],c()),E.nextNode(),d.push({type:2,index:++l});e.append(t[i],c())}}}else if(8===e.nodeType)if(e.data===h)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=e.data.indexOf(n,t+1));)d.push({type:7,index:l}),t+=n.length-1}l++}}static createElement(t,i){const s=u.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){var o,l,n,h;if(i===w)return i;let r=void 0!==e?null===(o=s.Σi)||void 0===o?void 0:o[e]:s.Σo;const u=d(i)?void 0:i._$litDirective$;return(null==r?void 0:r.constructor)!==u&&(null===(l=null==r?void 0:r.O)||void 0===l||l.call(r,!1),void 0===u?r=void 0:(r=new u(t),r.T(t,s,e)),void 0!==e?(null!==(n=(h=s).Σi)&&void 0!==n?n:h.Σi=[])[e]=r:s.Σo=r),void 0!==r&&(i=S(t,r.S(t,i.values),r,e)),i}class k{constructor(t,i){this.l=[],this.N=void 0,this.D=t,this.M=i}u(t){var i;const{el:{content:s},parts:e}=this.D,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:u).importNode(s,!0);E.currentNode=o;let l=E.nextNode(),n=0,h=0,r=e[0];for(;void 0!==r;){if(n===r.index){let i;2===r.type?i=new C(l,l.nextSibling,this,t):1===r.type?i=new r.ctor(l,r.name,r.strings,this,t):6===r.type&&(i=new z(l,this,t)),this.l.push(i),r=e[++h]}n!==(null==r?void 0:r.index)&&(l=E.nextNode(),n++)}return o}v(t){let i=0;for(const s of this.l)void 0!==s&&(void 0!==s.strings?(s.I(t,s,i),i+=s.strings.length-2):s.I(t[i])),i++}}class C{constructor(t,i,s,e){this.type=2,this.N=void 0,this.A=t,this.B=i,this.M=s,this.options=e}setConnected(t){var i;null===(i=this.P)||void 0===i||i.call(this,t)}get parentNode(){return this.A.parentNode}get startNode(){return this.A}get endNode(){return this.B}I(t,i=this){t=S(this,t,i),d(t)?t===A||null==t||""===t?(this.H!==A&&this.R(),this.H=A):t!==this.H&&t!==w&&this.m(t):void 0!==t._$litType$?this._(t):void 0!==t.nodeType?this.$(t):a(t)?this.g(t):this.m(t)}k(t,i=this.B){return this.A.parentNode.insertBefore(t,i)}$(t){this.H!==t&&(this.R(),this.H=this.k(t))}m(t){const i=this.A.nextSibling;null!==i&&3===i.nodeType&&(null===this.B?null===i.nextSibling:i===this.B.previousSibling)?i.data=t:this.$(u.createTextNode(t)),this.H=t}_(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this.C(t):(void 0===e.el&&(e.el=N.createElement(e.h,this.options)),e);if((null===(i=this.H)||void 0===i?void 0:i.D)===o)this.H.v(s);else{const t=new k(o,this),i=t.u(this.options);t.v(s),this.$(i),this.H=t}}C(t){let i=P.get(t.strings);return void 0===i&&P.set(t.strings,i=new N(t)),i}g(t){v(this.H)||(this.H=[],this.R());const i=this.H;let s,e=0;for(const o of t)e===i.length?i.push(s=new C(this.k(c()),this.k(c()),this,this.options)):s=i[e],s.I(o),e++;e<i.length&&(this.R(s&&s.B.nextSibling,e),i.length=e)}R(t=this.A.nextSibling,i){var s;for(null===(s=this.P)||void 0===s||s.call(this,!1,!0,i);t&&t!==this.B;){const i=t.nextSibling;t.remove(),t=i}}}class H{constructor(t,i,s,e,o){this.type=1,this.H=A,this.N=void 0,this.V=void 0,this.element=t,this.name=i,this.M=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this.H=Array(s.length-1).fill(A),this.strings=s):this.H=A}get tagName(){return this.element.tagName}I(t,i=this,s,e){const o=this.strings;let l=!1;if(void 0===o)t=S(this,t,i,0),l=!d(t)||t!==this.H&&t!==w,l&&(this.H=t);else{const e=t;let n,h;for(t=o[0],n=0;n<o.length-1;n++)h=S(this,e[s+n],i,n),h===w&&(h=this.H[n]),l||(l=!d(h)||h!==this.H[n]),h===A?t=A:t!==A&&(t+=(null!=h?h:"")+o[n+1]),this.H[n]=h}l&&!e&&this.W(t)}W(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class I extends H{constructor(){super(...arguments),this.type=3}W(t){this.element[this.name]=t===A?void 0:t}}class L extends H{constructor(){super(...arguments),this.type=4}W(t){t&&t!==A?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class R extends H{constructor(){super(...arguments),this.type=5}I(t,i=this){var s;if((t=null!==(s=S(this,t,i,0))&&void 0!==s?s:A)===w)return;const e=this.H,o=t===A&&e!==A||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,l=t!==A&&(e===A||o);o&&this.element.removeEventListener(this.name,this,e),l&&this.element.addEventListener(this.name,this,t),this.H=t}handleEvent(t){var i,s;"function"==typeof this.H?this.H.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this.H.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this.N=void 0,this.V=void 0,this.M=i,this.options=s}I(t){S(this,t)}}const Z={Z:"$lit$",U:n,Y:h,q:1,X:M,tt:k,it:a,st:S,et:C,ot:H,nt:L,rt:R,lt:I,ht:z};null===(i=(t=globalThis).litHtmlPlatformSupport)||void 0===i||i.call(t,N,C),(null!==(s=(e=globalThis).litHtmlVersions)&&void 0!==s?s:e.litHtmlVersions=[]).push("2.0.0-rc.3");export{Z as _Σ,T as html,w as noChange,A as nothing,V as render,x as svg};
var t,i,s,e;const o=globalThis.trustedTypes,n=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,l=`lit$${(Math.random()+"").slice(9)}$`,h="?"+l,r=`<${h}>`,u=document,c=(t="")=>u.createComment(t),d=t=>null===t||"object"!=typeof t&&"function"!=typeof t,v=Array.isArray,a=t=>{var i;return v(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])},f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,$=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,g=/'/g,p=/"/g,y=/^(?:script|style|textarea)$/i,b=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),T=b(1),x=b(2),w=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,P=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new k(i.insertBefore(c(),t),t,void 0,null!=s?s:{})}return l._$AI(t),l},V=u.createTreeWalker(u,129,null,!1),E=(t,i)=>{const s=t.length-1,e=[];let o,h=2===i?"<svg>":"",u=f;for(let i=0;i<s;i++){const s=t[i];let n,c,d=-1,v=0;for(;v<s.length&&(u.lastIndex=v,c=u.exec(s),null!==c);)v=u.lastIndex,u===f?"!--"===c[1]?u=_:void 0!==c[1]?u=m:void 0!==c[2]?(y.test(c[2])&&(o=RegExp("</"+c[2],"g")),u=$):void 0!==c[3]&&(u=$):u===$?">"===c[0]?(u=null!=o?o:f,d=-1):void 0===c[1]?d=-2:(d=u.lastIndex-c[2].length,n=c[1],u=void 0===c[3]?$:'"'===c[3]?p:g):u===p||u===g?u=$:u===_||u===m?u=f:(u=$,o=void 0);const a=u===$&&t[i+1].startsWith("/>")?" ":"";h+=u===f?s+r:d>=0?(e.push(n),s.slice(0,d)+"$lit$"+s.slice(d)+l+a):s+l+(-2===d?(e.push(void 0),i):a)}const c=h+(t[s]||"<?>")+(2===i?"</svg>":"");return[void 0!==n?n.createHTML(c):c,e]};class M{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let n=0,r=0;const u=t.length-1,d=this.parts,[v,a]=E(t,i);if(this.el=M.createElement(v,s),V.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=V.nextNode())&&d.length<u;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(l)){const s=a[r++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+"$lit$").split(l),i=/([.?@])?(.*)/.exec(s);d.push({type:1,index:n,name:i[2],strings:t,ctor:"."===i[1]?I:"?"===i[1]?L:"@"===i[1]?R:H})}else d.push({type:6,index:n})}for(const i of t)e.removeAttribute(i)}if(y.test(e.tagName)){const t=e.textContent.split(l),i=t.length-1;if(i>0){e.textContent=o?o.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],c()),V.nextNode(),d.push({type:2,index:++n});e.append(t[i],c())}}}else if(8===e.nodeType)if(e.data===h)d.push({type:2,index:n});else{let t=-1;for(;-1!==(t=e.data.indexOf(l,t+1));)d.push({type:7,index:n}),t+=l.length-1}n++}}static createElement(t,i){const s=u.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){var o,n,l,h;if(i===w)return i;let r=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const u=d(i)?void 0:i._$litDirective$;return(null==r?void 0:r.constructor)!==u&&(null===(n=null==r?void 0:r._$AO)||void 0===n||n.call(r,!1),void 0===u?r=void 0:(r=new u(t),r._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Cl)&&void 0!==l?l:h._$Cl=[])[e]=r:s._$Cu=r),void 0!==r&&(i=N(t,r._$AS(t,i.values),r,e)),i}class S{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:u).importNode(s,!0);V.currentNode=o;let n=V.nextNode(),l=0,h=0,r=e[0];for(;void 0!==r;){if(l===r.index){let i;2===r.type?i=new k(n,n.nextSibling,this,t):1===r.type?i=new r.ctor(n,r.name,r.strings,this,t):6===r.type&&(i=new z(n,this,t)),this.v.push(i),r=e[++h]}l!==(null==r?void 0:r.index)&&(n=V.nextNode(),l++)}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class k{constructor(t,i,s,e){this.type=2,this._$C_=!0,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$C_}get parentNode(){return this._$AA.parentNode}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=N(this,t,i),d(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==w&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.A(t):a(t)?this.M(t):this.$(t)}C(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}A(t){this._$AH!==t&&(this._$AR(),this._$AH=this.C(t))}$(t){const i=this._$AA.nextSibling;null!==i&&3===i.nodeType&&(null===this._$AB?null===i.nextSibling:i===this._$AB.previousSibling)?i.data=t:this.A(u.createTextNode(t)),this._$AH=t}T(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=M.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else{const t=new S(o,this),i=t.p(this.options);t.m(s),this.A(i),this._$AH=t}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new M(t)),i}M(t){v(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new k(this.C(c()),this.C(c()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class H{constructor(t,i,s,e,o){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(A),this.strings=s):this._$AH=A}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=N(this,t,i,0),n=!d(t)||t!==this._$AH&&t!==w,n&&(this._$AH=t);else{const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=N(this,e[s+l],i,l),h===w&&(h=this._$AH[l]),n||(n=!d(h)||h!==this._$AH[l]),h===A?t=A:t!==A&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h}n&&!e&&this.P(t)}P(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class I extends H{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===A?void 0:t}}class L extends H{constructor(){super(...arguments),this.type=4}P(t){t&&t!==A?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class R extends H{constructor(){super(...arguments),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=N(this,t,i,0))&&void 0!==s?s:A)===w)return;const e=this._$AH,o=t===A&&e!==A||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==A&&(e===A||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){N(this,t)}}const Z={V:"$lit$",k:l,R:h,I:1,N:E,D:S,L:a,j:N,H:k,O:H,W:L,Z:R,B:I,F:z};null===(i=(t=globalThis).litHtmlPlatformSupport)||void 0===i||i.call(t,M,k),(null!==(s=(e=globalThis).litHtmlVersions)&&void 0!==s?s:e.litHtmlVersions=[]).push("2.0.0-rc.4");export{Z as _$LH,T as html,w as noChange,A as nothing,P as render,x as svg};
//# sourceMappingURL=lit-html.js.map
{
"name": "lit-html",
"version": "2.0.0-rc.3",
"version": "2.0.0-rc.4",
"description": "HTML templates literals in JavaScript",

@@ -80,5 +80,3 @@ "license": "BSD-3-Clause",

"!/development/test/",
"/directives/",
"/src/",
"!/src/test/"
"/directives/"
],

@@ -94,3 +92,3 @@ "dependencies": {

"@webcomponents/template": "^1.4.4",
"@webcomponents/webcomponentsjs": "^2.5.0",
"@webcomponents/webcomponentsjs": "^2.6.0",
"chokidar-cli": "^2.1.0",

@@ -97,0 +95,0 @@ "concurrently": "^5.3.0",

@@ -32,3 +32,3 @@ /**

strings: TemplateStringsArray;
_$litType$?: string;
['_$litType$']?: string;
}

@@ -35,0 +35,0 @@ interface Directive {

@@ -6,3 +6,3 @@ !function(i){"function"==typeof define&&define.amd?define(i):i()}((function(){"use strict";

* SPDX-License-Identifier: BSD-3-Clause
*/var i,n,o=new Set,t=new Map;null!==(i=(n=globalThis).litHtmlPlatformSupport)&&void 0!==i||(n.litHtmlPlatformSupport=function(i,n){if(void 0!==window.ShadyCSS&&(!window.ShadyCSS.nativeShadow||window.ShadyCSS.ApplyShim)){var d=function(i){var n=t.get(i);return void 0===n&&t.set(i,n=[]),n},v=new Map,e=i.createElement;i.createElement=function(n,o){var t=e.call(i,n,o),v=null==o?void 0:o.scope;if(void 0!==v){window.ShadyCSS.nativeShadow||window.ShadyCSS.prepareTemplateDom(t,v);var u=d(v),r=t.content.querySelectorAll("style");u.push.apply(u,Array.from(r).map((function(i){var n;return null===(n=i.parentNode)||void 0===n||n.removeChild(i),i.textContent})))}return t};var u=document.createDocumentFragment(),r=document.createComment(""),l=n.prototype,a=l.I;l.I=function(i,n){var v,e,l;void 0===n&&(n=this);var s,w=this.A.parentNode,f=null===(v=this.options)||void 0===v?void 0:v.scope;if(w instanceof ShadowRoot&&void 0!==(s=f)&&!o.has(s)){var c=this.A,h=this.B;u.appendChild(r),this.A=r,this.B=null,a.call(this,i,n);var y=(null===(e=i)||void 0===e?void 0:e._$litType$)?this.H.D.el:document.createElement("template");if(function(i,n){var v=d(i),e=0!==v.length;if(e){var u=document.createElement("style");u.textContent=v.join("\n"),n.content.appendChild(u)}o.add(i),t.delete(i),window.ShadyCSS.prepareTemplateStyles(n,i),e&&window.ShadyCSS.nativeShadow&&n.content.appendChild(n.content.querySelector("style"))}(f,y),u.removeChild(r),null===(l=window.ShadyCSS)||void 0===l?void 0:l.nativeShadow){var m=y.content.querySelector("style");null!==m&&u.appendChild(m.cloneNode(!0))}w.insertBefore(u,h),this.A=c,this.B=h}else a.call(this,i,n)},l.C=function(n){var o,t=null===(o=this.options)||void 0===o?void 0:o.scope,d=v.get(t);void 0===d&&v.set(t,d=new Map);var e=d.get(n.strings);return void 0===e&&d.set(n.strings,e=new i(n,this.options)),e}}})}));
*/var i,n,o=new Set,t=new Map;null!==(i=(n=globalThis).litHtmlPlatformSupport)&&void 0!==i||(n.litHtmlPlatformSupport=function(i,n){if(void 0!==window.ShadyCSS&&(!window.ShadyCSS.nativeShadow||window.ShadyCSS.ApplyShim)){var d=function(i){return void 0!==i&&!o.has(i)},v=function(i){var n=t.get(i);return void 0===n&&t.set(i,n=[]),n},e=new Map,u=i.createElement;i.createElement=function(n,o){var t=u.call(i,n,o),e=null==o?void 0:o.scope;if(void 0!==e&&(window.ShadyCSS.nativeShadow||window.ShadyCSS.prepareTemplateDom(t,e),d(e))){var l=v(e),r=t.content.querySelectorAll("style");l.push.apply(l,Array.from(r).map((function(i){var n;return null===(n=i.parentNode)||void 0===n||n.removeChild(i),i.textContent})))}return t};var l=document.createDocumentFragment(),r=document.createComment(""),a=n.prototype,s=a._$AI;a._$AI=function(i,n){var e,u,a;void 0===n&&(n=this);var w=this._$AA.parentNode,f=null===(e=this.options)||void 0===e?void 0:e.scope;if(w instanceof ShadowRoot&&d(f)){var c=this._$AA,h=this._$AB;l.appendChild(r),this._$AA=r,this._$AB=null,s.call(this,i,n);var y=(null===(u=i)||void 0===u?void 0:u._$litType$)?this._$AH._$AD.el:document.createElement("template");if(function(i,n){var d,e=v(i),u=0!==e.length;u&&((d=document.createElement("style")).textContent=e.join("\n"),n.content.appendChild(d)),o.add(i),t.delete(i),window.ShadyCSS.prepareTemplateStyles(n,i),u&&window.ShadyCSS.nativeShadow&&null!==(d=n.content.querySelector("style"))&&n.content.appendChild(d)}(f,y),l.removeChild(r),null===(a=window.ShadyCSS)||void 0===a?void 0:a.nativeShadow){var m=y.content.querySelector("style");null!==m&&l.appendChild(m.cloneNode(!0))}w.insertBefore(l,h),this._$AA=c,this._$AB=h}else s.call(this,i,n)},a._$AC=function(n){var o,t=null===(o=this.options)||void 0===o?void 0:o.scope,d=e.get(t);void 0===d&&e.set(t,d=new Map);var v=d.get(n.strings);return void 0===v&&d.set(n.strings,v=new i(n,this.options)),v}}})}));
//# sourceMappingURL=polyfill-support.js.map

@@ -7,4 +7,4 @@ /**

/// <reference types="trusted-types" />
import { Directive, PartInfo } from './directive.js';
import { AttributePart, Part } from './lit-html.js';
import { Directive, PartInfo, DirectiveClass, DirectiveResult } from './directive.js';
import { AttributePart, Part, Disconnectable } from './lit-html.js';
export type { Template } from './lit-html.js';

@@ -16,3 +16,3 @@ /**

* to keep a number of (otherwise private) top-level exports mangled in the
* client side code, we export a _Σ object containing those members (or
* client side code, we export a _$LH object containing those members (or
* helper methods for accessing private fields of those members), and then

@@ -23,3 +23,3 @@ * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the

*/
export declare const _Σ: {
export declare const _$LH: {
boundAttributeSuffix: string;

@@ -38,6 +38,7 @@ marker: string;

__directive?: Directive | undefined;
_$parent: import("./lit-html.js").Disconnectable;
_$disconnectableChildren?: Set<import("./lit-html.js").Disconnectable> | undefined;
_$setDirectiveConnected?(isConnected: boolean): void;
_$initialize(part: Part, parent: import("./lit-html.js").Disconnectable, attributeIndex: number | undefined): void;
_$parent: Disconnectable;
_$disconnectableChildren?: Set<Disconnectable> | undefined;
_$notifyDirectiveConnectionChanged?(isConnected: boolean): void;
readonly _$isConnected: boolean;
_$initialize(part: Part, parent: Disconnectable, attributeIndex: number | undefined): void;
render: ((...props: unknown[]) => unknown) & (() => unknown);

@@ -47,3 +48,5 @@ update(_part: Part, props: unknown[]): unknown;

};
setDirectiveClass(value: DirectiveResult, directiveClass: DirectiveClass): void;
getAttributePartCommittedValue: (part: AttributePart, value: unknown, index: number | undefined) => unknown;
connectedDisconnectable: (props?: object | undefined) => Disconnectable;
resolveDirective: (part: import("./lit-html.js").ChildPart | AttributePart | import("./lit-html.js").ElementPart, value: unknown, parent?: import("./lit-html.js").DirectiveParent, attributeIndex?: number | undefined) => unknown;

@@ -50,0 +53,0 @@ AttributePart: typeof AttributePart;

@@ -1,2 +0,2 @@

import{_Σ as t,noChange as e}from"./lit-html.js";
import{_$LH as t,noChange as e}from"./lit-html.js";
/**

@@ -6,3 +6,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const r={boundAttributeSuffix:t.Z,marker:t.U,markerMatch:t.Y,HTML_RESULT:t.q,getTemplateHtml:t.X,overrideDirectiveResolve:(t,e)=>class extends t{S(t,r){return e(this,r)}},getAttributePartCommittedValue:(t,r,a)=>{let i=e;return t.W=t=>i=t,t.I(r,t,a),i},resolveDirective:t.st,AttributePart:t.ot,PropertyPart:t.lt,BooleanAttributePart:t.nt,EventPart:t.rt,ElementPart:t.ht};export{r as _Σ};
*/const r={boundAttributeSuffix:t.V,marker:t.k,markerMatch:t.R,HTML_RESULT:t.I,getTemplateHtml:t.N,overrideDirectiveResolve:(t,e)=>class extends t{_$AS(t,r){return e(this,r)}},setDirectiveClass(t,e){t._$litDirective$=e},getAttributePartCommittedValue:(t,r,i)=>{let a=e;return t.P=t=>a=t,t._$AI(r,t,i),a},connectedDisconnectable:t=>({...t,_$AU:!0}),resolveDirective:t.j,AttributePart:t.O,PropertyPart:t.B,BooleanAttributePart:t.W,EventPart:t.Z,ElementPart:t.F};export{r as _$LH};
//# sourceMappingURL=private-ssr-support.js.map

@@ -6,3 +6,3 @@ import{html as t,svg as e}from"./lit-html.js";

* SPDX-License-Identifier: BSD-3-Clause
*/const o=t=>({It:t}),r=(t,...e)=>({It:e.reduce(((e,o,r)=>e+(t=>{if(void 0!==t.It)return t.It;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+t[r+1]),t[0])}),i=new Map,a=t=>(e,...o)=>{var r;const a=o.length;let l,s;const n=[],u=[];let c,$=0,v=!1;for(;$<a;){for(c=e[$];$<a&&void 0!==(s=o[$],l=null===(r=s)||void 0===r?void 0:r.It);)c+=l+e[++$],v=!0;u.push(s),n.push(c),$++}if($===a&&n.push(e[a]),v){const t=n.join("$$lit$$");void 0===(e=i.get(t))&&i.set(t,e=n),o=u}return t(e,...o)},l=a(t),s=a(e);export{l as html,r as literal,s as svg,o as unsafeStatic,a as withStatic};
*/const o=t=>({_$litStatic$:t}),r=(t,...e)=>({_$litStatic$:e.reduce(((e,o,r)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+t[r+1]),t[0])}),i=new Map,a=t=>(e,...o)=>{var r;const a=o.length;let l,s;const n=[],u=[];let c,$=0,v=!1;for(;$<a;){for(c=e[$];$<a&&void 0!==(s=o[$],l=null===(r=s)||void 0===r?void 0:r._$litStatic$);)c+=l+e[++$],v=!0;u.push(s),n.push(c),$++}if($===a&&n.push(e[a]),v){const t=n.join("$$lit$$");void 0===(e=i.get(t))&&i.set(t,e=n),o=u}return t(e,...o)},l=a(t),s=a(e);export{l as html,r as literal,s as svg,o as unsafeStatic,a as withStatic};
//# sourceMappingURL=static.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc