apollo-elements/apollo-elements

View on GitHub
docs/_assets/_static/apollo-elements-haunted.js.map

Summary

Maintainability
Test Coverage
{
  "version": 3,
  "sources": ["../../../node_modules/ts-invariant/node_modules/tslib/tslib.js", "../../../node_modules/haunted/lib/symbols.js", "../../../node_modules/haunted/lib/interface.js", "../../../node_modules/haunted/lib/hook.js", "../../../node_modules/haunted/lib/create-effect.js", "../../../node_modules/haunted/lib/use-layout-effect.js", "../../../node_modules/haunted/lib/use-state.js", "../../../node_modules/haunted/lib/use-controller.js", "../../../packages/core/lib/is-valid-gql.ts", "../../../packages/core/events.ts", "../../../packages/core/apollo-controller.ts", "../../../packages/core/lib/bound.ts", "../../../packages/core/apollo-mutation-controller.ts", "../../../packages/haunted/useMutation.ts", "../../../node_modules/ts-invariant/node_modules/tslib/modules/index.js", "../../../node_modules/ts-invariant/src/invariant.ts", "../../../node_modules/@apollo/src/core/networkStatus.ts", "../../../node_modules/@apollo/src/core/index.ts", "../../../packages/core/apollo-query-controller.ts", "../../../packages/haunted/useQuery.ts", "../../../packages/core/apollo-subscription-controller.ts", "../../../packages/haunted/useSubscription.ts", "../../../node_modules/lit-html/src/lib/directive.ts", "../../../node_modules/lit-html/src/lib/dom.ts", "../../../node_modules/lit-html/src/lib/part.ts", "../../../node_modules/lit-html/src/lib/template.ts", "../../../node_modules/lit-html/src/lib/template-instance.ts", "../../../node_modules/lit-html/src/lib/template-result.ts", "../../../node_modules/lit-html/src/lib/parts.ts", "../../../node_modules/lit-html/src/lib/default-template-processor.ts", "../../../node_modules/lit-html/src/lib/template-factory.ts", "../../../node_modules/lit-html/src/lib/render.ts", "../../../node_modules/lit-html/src/lit-html.ts", "../../../node_modules/haunted/lib/state.js", "../../../node_modules/haunted/lib/scheduler.js", "../../../node_modules/haunted/lib/component.js", "../../../node_modules/haunted/lib/use-effect.js", "../../../node_modules/haunted/lib/use-context.js", "../../../node_modules/haunted/lib/create-context.js", "../../../node_modules/haunted/lib/use-memo.js", "../../../node_modules/haunted/lib/use-callback.js", "../../../node_modules/haunted/lib/use-reducer.js", "../../../node_modules/haunted/lib/use-ref.js", "../../../node_modules/haunted/lib/core.js", "../../../node_modules/haunted/lib/virtual.js", "../../../node_modules/haunted/lib/lit-haunted.js"],
  "sourcesContent": ["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __createBinding;\r\n(function (factory) {\r\n    var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n    if (typeof define === \"function\" && define.amd) {\r\n        define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n    }\r\n    else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n        factory(createExporter(root, createExporter(module.exports)));\r\n    }\r\n    else {\r\n        factory(createExporter(root));\r\n    }\r\n    function createExporter(exports, previous) {\r\n        if (exports !== root) {\r\n            if (typeof Object.create === \"function\") {\r\n                Object.defineProperty(exports, \"__esModule\", { value: true });\r\n            }\r\n            else {\r\n                exports.__esModule = true;\r\n            }\r\n        }\r\n        return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n    }\r\n})\r\n(function (exporter) {\r\n    var extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n    __extends = function (d, b) {\r\n        if (typeof b !== \"function\" && b !== null)\r\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n        extendStatics(d, b);\r\n        function __() { this.constructor = d; }\r\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n    };\r\n\r\n    __assign = Object.assign || function (t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    };\r\n\r\n    __rest = function (s, e) {\r\n        var t = {};\r\n        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n            t[p] = s[p];\r\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                    t[p[i]] = s[p[i]];\r\n            }\r\n        return t;\r\n    };\r\n\r\n    __decorate = function (decorators, target, key, desc) {\r\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n    };\r\n\r\n    __param = function (paramIndex, decorator) {\r\n        return function (target, key) { decorator(target, key, paramIndex); }\r\n    };\r\n\r\n    __metadata = function (metadataKey, metadataValue) {\r\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n    };\r\n\r\n    __awaiter = function (thisArg, _arguments, P, generator) {\r\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n        return new (P || (P = Promise))(function (resolve, reject) {\r\n            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n            function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n        });\r\n    };\r\n\r\n    __generator = function (thisArg, body) {\r\n        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n        return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n        function verb(n) { return function (v) { return step([n, v]); }; }\r\n        function step(op) {\r\n            if (f) throw new TypeError(\"Generator is already executing.\");\r\n            while (_) try {\r\n                if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n                if (y = 0, t) op = [op[0] & 2, t.value];\r\n                switch (op[0]) {\r\n                    case 0: case 1: t = op; break;\r\n                    case 4: _.label++; return { value: op[1], done: false };\r\n                    case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                    case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                    default:\r\n                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                        if (t[2]) _.ops.pop();\r\n                        _.trys.pop(); continue;\r\n                }\r\n                op = body.call(thisArg, _);\r\n            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n        }\r\n    };\r\n\r\n    __exportStar = function(m, o) {\r\n        for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n    };\r\n\r\n    __createBinding = Object.create ? (function(o, m, k, k2) {\r\n        if (k2 === undefined) k2 = k;\r\n        Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n    }) : (function(o, m, k, k2) {\r\n        if (k2 === undefined) k2 = k;\r\n        o[k2] = m[k];\r\n    });\r\n\r\n    __values = function (o) {\r\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n        if (m) return m.call(o);\r\n        if (o && typeof o.length === \"number\") return {\r\n            next: function () {\r\n                if (o && i >= o.length) o = void 0;\r\n                return { value: o && o[i++], done: !o };\r\n            }\r\n        };\r\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n    };\r\n\r\n    __read = function (o, n) {\r\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n        if (!m) return o;\r\n        var i = m.call(o), r, ar = [], e;\r\n        try {\r\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n        }\r\n        catch (error) { e = { error: error }; }\r\n        finally {\r\n            try {\r\n                if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n            }\r\n            finally { if (e) throw e.error; }\r\n        }\r\n        return ar;\r\n    };\r\n\r\n    /** @deprecated */\r\n    __spread = function () {\r\n        for (var ar = [], i = 0; i < arguments.length; i++)\r\n            ar = ar.concat(__read(arguments[i]));\r\n        return ar;\r\n    };\r\n\r\n    /** @deprecated */\r\n    __spreadArrays = function () {\r\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n                r[k] = a[j];\r\n        return r;\r\n    };\r\n\r\n    __spreadArray = function (to, from) {\r\n        for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n            to[j] = from[i];\r\n        return to;\r\n    };\r\n\r\n    __await = function (v) {\r\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n    };\r\n\r\n    __asyncGenerator = function (thisArg, _arguments, generator) {\r\n        if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n        return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);  }\r\n        function fulfill(value) { resume(\"next\", value); }\r\n        function reject(value) { resume(\"throw\", value); }\r\n        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n    };\r\n\r\n    __asyncDelegator = function (o) {\r\n        var i, p;\r\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n    };\r\n\r\n    __asyncValues = function (o) {\r\n        if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n        var m = o[Symbol.asyncIterator], i;\r\n        return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n    };\r\n\r\n    __makeTemplateObject = function (cooked, raw) {\r\n        if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n        return cooked;\r\n    };\r\n\r\n    var __setModuleDefault = Object.create ? (function(o, v) {\r\n        Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n    }) : function(o, v) {\r\n        o[\"default\"] = v;\r\n    };\r\n\r\n    __importStar = function (mod) {\r\n        if (mod && mod.__esModule) return mod;\r\n        var result = {};\r\n        if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n        __setModuleDefault(result, mod);\r\n        return result;\r\n    };\r\n\r\n    __importDefault = function (mod) {\r\n        return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n    };\r\n\r\n    __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n        if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n        return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n    };\r\n\r\n    __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n        if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n        if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n        return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n    };\r\n\r\n    exporter(\"__extends\", __extends);\r\n    exporter(\"__assign\", __assign);\r\n    exporter(\"__rest\", __rest);\r\n    exporter(\"__decorate\", __decorate);\r\n    exporter(\"__param\", __param);\r\n    exporter(\"__metadata\", __metadata);\r\n    exporter(\"__awaiter\", __awaiter);\r\n    exporter(\"__generator\", __generator);\r\n    exporter(\"__exportStar\", __exportStar);\r\n    exporter(\"__createBinding\", __createBinding);\r\n    exporter(\"__values\", __values);\r\n    exporter(\"__read\", __read);\r\n    exporter(\"__spread\", __spread);\r\n    exporter(\"__spreadArrays\", __spreadArrays);\r\n    exporter(\"__spreadArray\", __spreadArray);\r\n    exporter(\"__await\", __await);\r\n    exporter(\"__asyncGenerator\", __asyncGenerator);\r\n    exporter(\"__asyncDelegator\", __asyncDelegator);\r\n    exporter(\"__asyncValues\", __asyncValues);\r\n    exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n    exporter(\"__importStar\", __importStar);\r\n    exporter(\"__importDefault\", __importDefault);\r\n    exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n    exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n});\r\n", "const phaseSymbol = Symbol('haunted.phase');\nconst hookSymbol = Symbol('haunted.hook');\nconst updateSymbol = Symbol('haunted.update');\nconst commitSymbol = Symbol('haunted.commit');\nconst effectsSymbol = Symbol('haunted.effects');\nconst layoutEffectsSymbol = Symbol('haunted.layoutEffects');\nconst contextEvent = 'haunted.context';\nexport { phaseSymbol, hookSymbol, updateSymbol, commitSymbol, effectsSymbol, layoutEffectsSymbol, contextEvent, };\n", "let current;\nlet currentId = 0;\nfunction setCurrent(state) {\n    current = state;\n}\nfunction clear() {\n    current = null;\n    currentId = 0;\n}\nfunction notify() {\n    return currentId++;\n}\nexport { clear, current, setCurrent, notify };\n", "import { current, notify } from './interface.js';\nimport { hookSymbol } from './symbols.js';\nclass Hook {\n    constructor(id, state) {\n        this.id = id;\n        this.state = state;\n    }\n}\nfunction use(Hook, ...args) {\n    let id = notify();\n    let hooks = current[hookSymbol];\n    let hook = hooks.get(id);\n    if (!hook) {\n        hook = new Hook(id, current, ...args);\n        hooks.set(id, hook);\n    }\n    return hook.update(...args);\n}\nfunction hook(Hook) {\n    return use.bind(null, Hook);\n}\nexport { hook, Hook };\n", "import { Hook, hook } from './hook.js';\nfunction createEffect(setEffects) {\n    return hook(class extends Hook {\n        constructor(id, state, ignored1, ignored2) {\n            super(id, state);\n            setEffects(state, this);\n        }\n        update(callback, values) {\n            this.callback = callback;\n            this.values = values;\n        }\n        call() {\n            if (!this.values || this.hasChanged()) {\n                this.run();\n            }\n            this.lastValues = this.values;\n        }\n        run() {\n            this.teardown();\n            this._teardown = this.callback.call(this.state);\n        }\n        teardown() {\n            if (typeof this._teardown === 'function') {\n                this._teardown();\n            }\n        }\n        hasChanged() {\n            return !this.lastValues || this.values.some((value, i) => this.lastValues[i] !== value);\n        }\n    });\n}\nexport { createEffect };\n", "import { layoutEffectsSymbol } from './symbols.js';\nimport { createEffect } from './create-effect.js';\nfunction setLayoutEffects(state, cb) {\n    state[layoutEffectsSymbol].push(cb);\n}\nconst useLayoutEffect = createEffect(setLayoutEffects);\nexport { useLayoutEffect };\n", "import { hook, Hook } from './hook.js';\nconst useState = hook(class extends Hook {\n    constructor(id, state, initialValue) {\n        super(id, state);\n        this.updater = this.updater.bind(this);\n        if (typeof initialValue === 'function') {\n            initialValue = initialValue();\n        }\n        this.makeArgs(initialValue);\n    }\n    update() {\n        return this.args;\n    }\n    updater(value) {\n        if (typeof value === 'function') {\n            const updaterFn = value;\n            const [previousValue] = this.args;\n            value = updaterFn(previousValue);\n        }\n        this.makeArgs(value);\n        this.state.update();\n    }\n    makeArgs(value) {\n        this.args = Object.freeze([value, this.updater]);\n    }\n});\n;\nexport { useState };\n", "/**\n * @license\n * Portions Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { useLayoutEffect } from './use-layout-effect.js';\nimport { useState } from './use-state.js';\nconst microtask = Promise.resolve();\n/**\n * An implementation of ReactiveControllerHost that is driven by Haunted hooks\n * and `useController()`.\n */\nclass HauntedControllerHost {\n    constructor(count, kick) {\n        this.count = count;\n        this.kick = kick;\n        this._controllers = [];\n        this._updatePending = true;\n        this._updateCompletePromise = new Promise(res => {\n            this._resolveUpdate = res;\n        });\n    }\n    addController(controller) {\n        this._controllers.push(controller);\n    }\n    removeController(controller) {\n        // Note, if the indexOf is -1, the >>> will flip the sign which makes the\n        // splice do nothing.\n        this._controllers && this._controllers.splice(this._controllers.indexOf(controller) >>> 0, 1);\n    }\n    requestUpdate() {\n        if (!this._updatePending) {\n            this._updatePending = true;\n            microtask.then(() => this.kick(this.count + 1));\n        }\n    }\n    get updateComplete() {\n        return this._updateCompletePromise;\n    }\n    connected() {\n        this._controllers.forEach(c => c.hostConnected && c.hostConnected());\n    }\n    disconnected() {\n        this._controllers.forEach(c => c.hostDisconnected && c.hostDisconnected());\n    }\n    update() {\n        this._controllers.forEach(c => c.hostUpdate && c.hostUpdate());\n    }\n    updated() {\n        this._updatePending = false;\n        const resolve = this._resolveUpdate;\n        // Create a new updateComplete Promise for the next update,\n        // before resolving the current one.\n        this._updateCompletePromise = new Promise(res => {\n            this._resolveUpdate = res;\n        });\n        this._controllers.forEach(c => c.hostUpdated && c.hostUpdated());\n        resolve(this._updatePending);\n    }\n}\n/**\n * Creates and stores a stateful ReactiveController instance and provides it\n * with a ReactiveControllerHost that drives the controller lifecycle.\n *\n * Use this hook to convert a ReactiveController into a Haunted hook.\n *\n * @param createController A function that creates a controller instance. This\n * function is given a HauntedControllerHost to pass to the controller. The\n * create function is only called once per component.\n */\nexport function useController(createController) {\n    const [count, kick] = useState(0);\n    const [host] = useState(() => {\n        const host = new HauntedControllerHost(count, kick);\n        const controller = createController(host);\n        host.primaryController = controller;\n        host.connected();\n        return host;\n    });\n    // We use useLayoutEffect because we need updated() called synchronously\n    // after rendering.\n    useLayoutEffect(() => host.updated());\n    // Returning a cleanup function simulates hostDisconnected timing. An empty\n    // deps array tells Haunted to only call this once: on mount with the cleanup\n    // called on unmount.\n    useLayoutEffect(() => () => host.disconnected(), []);\n    host.update();\n    return host.primaryController;\n}\n", "import type { DocumentNode } from '@apollo/client/core';\n\n/**\n * Validates a graphql document node.\n *\n * ```haskell\n * isValidGql :: DocumentNode a => a -> Bool\n * ```\n * @param doc Maybe a DocumentNode\n * @return Whether the argument is a DocumentNode\n */\nexport function isValidGql(doc: unknown): doc is DocumentNode {\n  return !!(\n    doc &&\n    typeof doc === 'object' &&\n    'kind' in doc &&\n    'definitions' in doc\n  );\n}\n", "import type { ApolloController } from './apollo-controller.js';\nimport type { Data } from '@apollo-elements/core/types';\nimport type {\n  ApolloClient,\n  ApolloError,\n  ApolloQueryResult,\n  FetchResult,\n  NormalizedCacheObject,\n} from '@apollo/client/core';\n\ntype ApolloEventType = `apollo-${'controller'|'element'}-${'connected'|'disconnected'}`;\ntype ApolloElementEventType = `apollo-element-${'disconnected'|'connected'}`;\ntype ApolloControllerEventType = `apollo-controller-${'disconnected'|'connected'}`;\n\ninterface ApolloControllerHost extends HTMLElement {\n  controller: ApolloController;\n}\n\nexport type ApolloQueryResultEvent<TData = unknown> =\n  CustomEvent<ApolloQueryResult<TData>>;\n\nexport type ApolloMutationResultEvent<TData = unknown> =\n  CustomEvent<FetchResult<TData>>;\n\nexport type ApolloSubscriptionResultEvent<D = unknown> = CustomEvent<{\n  client: ApolloClient<NormalizedCacheObject>;\n  subscriptionData: {\n    data: Data<D> | null;\n    loading: boolean;\n    error: null;\n  };\n}>;\n\nexport abstract class ApolloEvent<T = ApolloControllerHost> extends CustomEvent<T> {\n  public abstract type: ApolloEventType\n  public declare controller?: ApolloController;\n  constructor(type: ApolloEventType, options?: CustomEventInit) {\n    super(type, { ...options, bubbles: true, composed: true });\n  }\n}\n\n/**\n * @summary Fired when an ApolloElement connects to or disconnects from the DOM\n */\nexport class ApolloElementEvent<T = ApolloControllerHost> extends ApolloEvent<T> {\n  public declare static type: ApolloElementEventType;\n  public declare type: ApolloElementEventType;\n  constructor(type: ApolloElementEventType, detail: T) {\n    super(type, { detail });\n  }\n}\n\nexport abstract class ApolloControllerEvent extends ApolloEvent {\n  public abstract controller: ApolloController;\n  public abstract type: ApolloControllerEventType\n  constructor(type: ApolloControllerEventType) {\n    super(type);\n  }\n}\n\n/**\n * @summary Fired when a controlled element connects to the DOM\n */\nexport class ApolloControllerConnectedEvent extends ApolloControllerEvent {\n  public static type = 'apollo-controller-connected' as const;\n  public declare type: 'apollo-controller-connected';\n  constructor(public controller: ApolloController) {\n    super(ApolloControllerConnectedEvent.type);\n  }\n}\n\n/**\n * @summary Fired when a controlled element disconnects from the DOM\n */\nexport class ApolloControllerDisconnectedEvent extends ApolloControllerEvent {\n  public static type = 'apollo-controller-disconnected' as const;\n  public declare type: 'apollo-controller-disconnected';\n  constructor(public controller: ApolloController) {\n    super(ApolloControllerDisconnectedEvent.type);\n  }\n}\n\ndeclare global {\n  interface HTMLElementEventMap {\n    'apollo-controller-connected': ApolloControllerConnectedEvent;\n    'apollo-controller-disconnected': ApolloControllerDisconnectedEvent;\n    'apollo-element-connected': ApolloElementEvent;\n    'apollo-element-disconnected': ApolloElementEvent;\n    'apollo-error': CustomEvent<ApolloError>;\n    'apollo-mutation-result': ApolloMutationResultEvent;\n    'apollo-query-result': ApolloQueryResultEvent;\n    'apollo-subscription-result': ApolloSubscriptionResultEvent;\n  }\n\n  interface WindowEventMap {\n    'apollo-element-disconnected': ApolloElementEvent;\n    'apollo-controller-disconnected': ApolloControllerDisconnectedEvent;\n  }\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport type {\n  ApolloClient,\n  ApolloError,\n  ErrorPolicy,\n  NormalizedCacheObject,\n} from '@apollo/client/core';\n\n\nimport type {\n  ComponentDocument,\n  Data,\n  GraphQLError,\n  MaybeTDN,\n  MaybeVariables,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport { isValidGql } from './lib/is-valid-gql.js';\n\nimport { ApolloControllerConnectedEvent, ApolloControllerDisconnectedEvent } from './events.js';\n\nexport interface ApolloControllerOptions<D, V> {\n  /** The `ApolloClient` instance for the controller. */\n  client?: ApolloClient<NormalizedCacheObject>;\n  /** Variables for the operation. */\n  variables?: Variables<D, V>;\n  /** Context passed to the link execution chain. */\n  context?: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n  /**\n   * errorPolicy determines the level of events for errors in the execution result. The options are:\n   * - `none` (default): any errors from the request are treated like runtime errors and the observable is stopped (XXX this is default to lower breaking changes going from AC 1.0 => 2.0)\n   * - `ignore`: errors from the request do not stop the observable, but also don't call `next`\n   * - `all`: errors are treated like data and will notify observables\n   * @summary [Error Policy](https://www.apollographql.com/docs/react/api/core/ApolloClient/#ErrorPolicy) for the query.\n   */\n  errorPolicy?: ErrorPolicy;\n  /** When provided, the controller will fall back to this element to fire events */\n  hostElement?: HTMLElement;\n  /** Host update callback */\n  [update]?(properties?: Record<string, unknown>): void;\n}\n\nexport const update = Symbol('update');\n\ninterface ReflectingReactiveControllerHost extends ReactiveControllerHost {\n  [update](properties?: Record<string, unknown>): void;\n}\n\nfunction isReflectingHost(host: ReactiveControllerHost): host is ReflectingReactiveControllerHost {\n  return typeof (host as ReactiveControllerHost & { [update]: unknown })[update] === 'function';\n}\n\nexport abstract class ApolloController<\n  D extends MaybeTDN = MaybeTDN,\n  V = MaybeVariables<D>\n>\nimplements ReactiveController {\n  #options: ApolloControllerOptions<D, V> = {};\n\n  #client: ApolloClient<NormalizedCacheObject> | null = null;\n\n  #document: ComponentDocument<D> | null = null;\n\n  /** @summary The event emitter to use when firing events, usually the host element. */\n  protected emitter: EventTarget;\n\n  called = true;\n\n  /** @summary Latest data for the operation, or `null`. */\n  data: Data<D> | null = null;\n\n  /** @summary Latest error from the operation, or `null`. */\n  error: ApolloError | null = null;\n\n  /** @summary Latest errors from the operation, or `[]`. */\n  errors: readonly GraphQLError[] = [];\n\n  /** @summary Whether a request is in-flight. */\n  loading = false;\n\n  /** @summary Options for the operation and controller. */\n  get options(): ApolloControllerOptions<D, V> {\n    return this.#options;\n  }\n\n  set options(v: ApolloControllerOptions<D, V>) {\n    const u = this.#options[update];\n    this.#options = { [update]: u, ...v };\n  }\n\n  /** @summary The `ApolloClient` instance for this controller. */\n  get client(): ApolloClient<NormalizedCacheObject> | null {\n    return this.#client;\n  }\n\n  set client(v: ApolloClient<NormalizedCacheObject> | null) {\n    this.#client = v;\n    this.clientChanged?.(v); /* c8 ignore next */ // covered\n    this.notify('client');\n  }\n\n  /** @summary The GraphQL document for the operation. */\n  get document(): ComponentDocument<D> | null { return this.#document; }\n\n  set document(document: ComponentDocument<D> | null) {\n    if (document === this.#document)\n      return; /* c8 ignore next */ // covered\n    else if (!document)\n      this.#document = null; /* c8 ignore next */ // covered\n    else if (!isValidGql(document)) { /* c8 ignore next */ // covered\n      const name = (this.constructor.name).replace(/Apollo(\\w+)Controller/, '$1');\n      throw new TypeError(`${name} must be a parsed GraphQL document.`);\n    } else {\n      this.#document = document;\n      this[update]({ document });\n      this.documentChanged?.(document);/* c8 ignore next */\n    }\n  }\n\n  /** @summary Variables for the operation. */\n  get variables(): Variables<D, V> | null {\n    return this.options?.variables ?? null;\n  }\n\n  set variables(variables: Variables<D, V> | null) {\n    if (!variables)\n      delete this.options.variables;/* c8 ignore next */ // covered\n    else if (variables === this.options.variables)\n      return; /* c8 ignore next */ // covered\n    else\n      this.options.variables = variables;\n    this[update]({ variables });\n    this.variablesChanged?.(variables);/* c8 ignore next */\n  }\n\n  constructor(public host: ReactiveControllerHost, options?: ApolloControllerOptions<D, V>) {\n    /* c8 ignore start */ // these are all covered\n    if (host instanceof EventTarget)\n      this.emitter = host;\n    else if (options?.hostElement instanceof EventTarget)\n      this.emitter = options.hostElement;\n    else\n      this.emitter = new EventTarget();\n    this.options = options ?? {};\n    this.client = this.options.client ?? window.__APOLLO_CLIENT__ ?? null;\n    host.addController?.(this);\n    /* c8 ignore stop */\n  }\n\n  /** @summary requests an update on the host. */\n  private [update](properties?: Record<string, unknown>): void {\n    this.host.requestUpdate();\n    /* c8 ignore start */ // these are all covered\n    if (isReflectingHost(this.host))\n      this.host[update](properties);\n    else\n      this.options[update]?.(properties);\n    /* c8 ignore stop */\n  }\n\n  /** @summary callback for when the GraphQL document changes. */\n  protected documentChanged?(document?: ComponentDocument<D> | null): void;\n\n  /** @summary callback for when the GraphQL variables change. */\n  protected variablesChanged?(variables?: Variables<D, V> | null): void;\n\n  /** @summary callback for when the Apollo client changes. */\n  protected clientChanged?(client?: ApolloClient<NormalizedCacheObject> | null): void;\n\n  /** @summary Notifies about updated properties. */\n  protected notify(...keys: (keyof this)[]): void {\n    this[update](Object.fromEntries(keys.map(x => [x, this[x]])));\n  }\n\n  /** @summary Assigns the controller's variables and GraphQL document. */\n  protected init(document: ComponentDocument<D> | null): void {\n    this.variables ??= this.options.variables ?? null;\n    this.document = document;\n  }\n\n  /** @fires {ApolloControllerConnectedEvent} apollo-controller-connected when the controller's host connects to the document. */\n  hostConnected(): void {\n    this.emitter.dispatchEvent(new ApolloControllerConnectedEvent(this));\n  }\n\n  /** @fires {ApolloControllerDisconnectedEvent} apollo-controller-disconnected when the controller's host disconnects from the document. */\n  hostDisconnected(): void {\n    this.emitter.dispatchEvent(new ApolloControllerDisconnectedEvent(this));\n    window.dispatchEvent(new ApolloControllerDisconnectedEvent(this));\n  }\n}\n", "const configurable = true;\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport function bound(_: any, key: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n  if (typeof descriptor?.value !== 'function')\n    throw new TypeError(`Only methods can be decorated with @bound. <${key ?? _.name}> is not a method!`); /* c8 ignore next */\n  return {\n    configurable,\n    get() {\n      const value = descriptor.value.bind(this);\n      Object.defineProperty(this, key, { value, configurable, writable: true });\n      return value;\n    },\n  };\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport type {\n  ComponentDocument,\n  Data,\n  MaybeTDN,\n  MaybeVariables,\n  OptimisticResponseType,\n  RefetchQueriesType,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport type {\n  ApolloError,\n  ErrorPolicy,\n  FetchPolicy,\n  FetchResult,\n  MutationOptions,\n  MutationUpdaterFn,\n} from '@apollo/client/core';\n\nimport { ApolloController, ApolloControllerOptions } from './apollo-controller.js';\n\nimport { bound } from './lib/bound.js';\n\nexport interface ApolloMutationControllerOptions<D, V> extends ApolloControllerOptions<D, V> {\n  /**\n   * An object that maps from the name of a variable as used in the mutation GraphQL document to that variable's value.\n   *\n   * @summary Mutation variables.\n   */\n  variables?: Variables<D, V>,\n  refetchQueries?: RefetchQueriesType<D> | null,\n  context?: Record<string, unknown>,\n  optimisticResponse?: OptimisticResponseType<D, V>,\n  errorPolicy?: ErrorPolicy;\n  fetchPolicy?: Extract<FetchPolicy, 'no-cache'>,\n  awaitRefetchQueries?: boolean,\n  onCompleted?(data: Data<D>|null): void,\n  onError?(error: Error): void,\n  update?(\n    ...p: Parameters<MutationUpdaterFn<Data<D>>>\n  ): ReturnType<MutationUpdaterFn<Data<D>>>,\n  ignoreResults?: boolean,\n}\n\nexport class ApolloMutationController<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>\n  extends ApolloController<D, V> implements ReactiveController {\n  /**\n   * The ID number of the most recent mutation since the element was instantiated.\n   */\n  private mostRecentMutationId = 0;\n\n  // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/40220\n  declare options: ApolloMutationControllerOptions<D, V>;\n\n  called = false;\n\n  get mutation(): ComponentDocument<D> | null { return this.document; }\n\n  set mutation(document: ComponentDocument<D> | null) { this.document = document; }\n\n  constructor(\n    host: ReactiveControllerHost,\n    mutation?: ComponentDocument<D> | null,\n    options?: ApolloMutationControllerOptions<D, V>\n  ) {\n    super(host, options);\n    this.init(mutation ?? null);/* c8 ignore next */\n  }\n\n  /**\n   * @summary Fires a mutation\n   * This resolves a single mutation according to the options specified and returns a Promise which is either resolved with the resulting data or rejected with an error.\n   */\n  @bound public async mutate(\n    params?: Partial<MutationOptions<Data<D>, Variables<D, V>>>\n  ): Promise<FetchResult<Data<D>>> {\n    if (!this.client)\n      throw new TypeError('No Apollo client. See https://apolloelements.dev/guides/getting-started/apollo-client/'); /* c8 ignore next */ // covered\n    const mutationId = this.generateMutationId();\n\n    this.loading = true;\n    this.called = true;\n    this.error = null;\n    this.errors = [];\n    this.data = null;\n    this.notify('called', 'data', 'error', 'errors', 'loading');\n\n    return this.client.mutate<Data<D>, Variables<D, V>>({\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      mutation: this.mutation!,\n\n      awaitRefetchQueries: this.options.awaitRefetchQueries,\n      context: this.options.context,\n      errorPolicy: this.options.errorPolicy,\n      fetchPolicy: this.options.fetchPolicy,\n      optimisticResponse: this.options.optimisticResponse,\n      refetchQueries: this.options.refetchQueries ?? undefined,\n      update: this.options.update,\n      variables: this.variables ?? undefined,\n      ...params,\n    })\n      .then(this.onCompletedMutation.bind(this, mutationId))\n      .catch(this.onMutationError.bind(this, mutationId));\n  }\n\n  /**\n   * Increments and returns the most recent mutation id.\n   */\n  private generateMutationId(): number {\n    this.mostRecentMutationId += 1;\n    return this.mostRecentMutationId;\n  }\n\n  /**\n   * Returns true when an ID matches the most recent mutation id.\n   */\n  private isMostRecentMutation(mutationId: number): boolean {\n    return this.mostRecentMutationId === mutationId;\n  }\n\n  /**\n   * Callback for when a mutation is completed.\n   */\n  private onCompletedMutation(\n    mutationId: number,\n    response: FetchResult<Data<D>>\n  ): FetchResult<Data<D>> {\n    const { data } = response;\n    this.emitter.dispatchEvent(new CustomEvent('apollo-mutation-result', { detail: response }));\n    if (this.isMostRecentMutation(mutationId)) {\n      this.loading = false;\n      if (!this.options.ignoreResults) {\n        this.error = null;\n        this.data = data ?? null;/* c8 ignore next */\n        this.errors = response.errors ?? [];\n        this.options.onCompleted?.(this.data); /* c8 ignore next */\n      }\n      this.notify('data', 'error', 'errors', 'loading');\n    }\n    return response;\n  }\n\n  /**\n   * Callback for when a mutation fails.\n   */\n  private onMutationError(mutationId: number, error: ApolloError): never {\n    this.emitter.dispatchEvent(new CustomEvent('apollo-error', { detail: error }));\n    if (this.isMostRecentMutation(mutationId)) {\n      this.loading = false;\n      this.data = null;\n      this.error = error;\n    }\n    this.options.onError?.(error);\n    this.notify('data', 'error', 'loading');\n    throw error;\n  }\n}\n", "import type {\n  ComponentDocument,\n  Data,\n  MaybeTDN,\n  MaybeVariables,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport type { FetchResult, MutationOptions } from '@apollo/client/core';\n\nimport { useController } from 'haunted/lib/use-controller';\n\nimport {\n  ApolloMutationController,\n  ApolloMutationControllerOptions,\n} from '@apollo-elements/core/apollo-mutation-controller';\n\nexport function useMutation<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>(\n  mutation: ComponentDocument<D>,\n  options?: ApolloMutationControllerOptions<D, V>\n): [\n  (params?: Partial<MutationOptions<Data<D>, Variables<D, V>>>) => Promise<FetchResult<Data<D>>>,\n  ApolloMutationController<D, V>\n] {\n  const controller = useController(host =>\n    new ApolloMutationController<D, V>(host, mutation, options));\n  return [controller.mutate, controller];\n}\n", "import tslib from '../tslib.js';\r\nconst {\r\n    __extends,\r\n    __assign,\r\n    __rest,\r\n    __decorate,\r\n    __param,\r\n    __metadata,\r\n    __awaiter,\r\n    __generator,\r\n    __exportStar,\r\n    __createBinding,\r\n    __values,\r\n    __read,\r\n    __spread,\r\n    __spreadArrays,\r\n    __spreadArray,\r\n    __await,\r\n    __asyncGenerator,\r\n    __asyncDelegator,\r\n    __asyncValues,\r\n    __makeTemplateObject,\r\n    __importStar,\r\n    __importDefault,\r\n    __classPrivateFieldGet,\r\n    __classPrivateFieldSet,\r\n} = tslib;\r\nexport {\r\n    __extends,\r\n    __assign,\r\n    __rest,\r\n    __decorate,\r\n    __param,\r\n    __metadata,\r\n    __awaiter,\r\n    __generator,\r\n    __exportStar,\r\n    __createBinding,\r\n    __values,\r\n    __read,\r\n    __spread,\r\n    __spreadArrays,\r\n    __spreadArray,\r\n    __await,\r\n    __asyncGenerator,\r\n    __asyncDelegator,\r\n    __asyncValues,\r\n    __makeTemplateObject,\r\n    __importStar,\r\n    __importDefault,\r\n    __classPrivateFieldGet,\r\n    __classPrivateFieldSet,\r\n};\r\n", "const genericMessage = \"Invariant Violation\";\nconst {\n  setPrototypeOf = function (obj: any, proto: any) {\n    obj.__proto__ = proto;\n    return obj;\n  },\n} = Object as any;\n\nexport class InvariantError extends Error {\n  framesToPop = 1;\n  name = genericMessage;\n  constructor(message: string | number = genericMessage) {\n    super(\n      typeof message === \"number\"\n        ? `${genericMessage}: ${message} (see https://github.com/apollographql/invariant-packages)`\n        : message\n    );\n    setPrototypeOf(this, InvariantError.prototype);\n  }\n}\n\nexport function invariant(\n  condition: any,\n  message?: string | number,\n): asserts condition {\n  if (!condition) {\n    throw new InvariantError(message);\n  }\n}\n\nconst verbosityLevels = [\"log\", \"warn\", \"error\", \"silent\"] as const;\ntype VerbosityLevel = (typeof verbosityLevels)[number];\ntype ConsoleMethodName = Exclude<VerbosityLevel, \"silent\">;\nlet verbosityLevel = verbosityLevels.indexOf(\"log\");\n\nfunction wrapConsoleMethod<M extends ConsoleMethodName>(method: M) {\n  return function () {\n    if (verbosityLevels.indexOf(method) >= verbosityLevel) {\n      return console[method].apply(console, arguments as any);\n    }\n  } as (typeof console)[M];\n}\n\nexport namespace invariant {\n  export const log = wrapConsoleMethod(\"log\");\n  export const warn = wrapConsoleMethod(\"warn\");\n  export const error = wrapConsoleMethod(\"error\");\n}\n\nexport function setVerbosity(level: VerbosityLevel): VerbosityLevel {\n  const old = verbosityLevels[verbosityLevel];\n  verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));\n  return old;\n}\n\n// Code that uses ts-invariant with rollup-plugin-invariant may want to\n// import this process stub to avoid errors evaluating process.env.NODE_ENV.\n// However, because most ESM-to-CJS compilers will rewrite the process import\n// as tsInvariant.process, which prevents proper replacement by minifiers, we\n// also export processStub, so you can import { invariant, processStub } from\n// \"ts-invariant\" and assign processStub to a local variable named process.\nexport const processStub: {\n  env: Record<string, any>;\n  [key: string]: any;\n} = (\n  typeof process === \"object\" &&\n  typeof process.env === \"object\"\n) ? process : { env: {} };\n\nexport { processStub as process };\n\nexport default invariant;\n", "/**\n * The current status of a query\u2019s execution in our system.\n */\nexport enum NetworkStatus {\n  /**\n   * The query has never been run before and the query is now currently running. A query will still\n   * have this network status even if a partial data result was returned from the cache, but a\n   * query was dispatched anyway.\n   */\n  loading = 1,\n\n  /**\n   * If `setVariables` was called and a query was fired because of that then the network status\n   * will be `setVariables` until the result of that query comes back.\n   */\n  setVariables = 2,\n\n  /**\n   * Indicates that `fetchMore` was called on this query and that the query created is currently in\n   * flight.\n   */\n  fetchMore = 3,\n\n  /**\n   * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n   * and the refetch request is currently in flight.\n   */\n  refetch = 4,\n\n  /**\n   * Indicates that a polling query is currently in flight. So for example if you are polling a\n   * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n   * a poll request has been sent but not resolved.\n   */\n  poll = 6,\n\n  /**\n   * No request is in flight for this query, and no errors happened. Everything is OK.\n   */\n  ready = 7,\n\n  /**\n   * No request is in flight for this query, but one or more errors were detected.\n   */\n  error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n  networkStatus?: NetworkStatus,\n): boolean {\n  return networkStatus ? networkStatus < 7 : false;\n}\n", "/* Core */\n\nexport {\n  ApolloClient,\n  ApolloClientOptions,\n  DefaultOptions,\n  mergeOptions,\n} from './ApolloClient';\nexport {\n  ObservableQuery,\n  FetchMoreOptions,\n  UpdateQueryOptions,\n} from './ObservableQuery';\nexport {\n  QueryOptions,\n  WatchQueryOptions,\n  MutationOptions,\n  SubscriptionOptions,\n  FetchPolicy,\n  WatchQueryFetchPolicy,\n  ErrorPolicy,\n  FetchMoreQueryOptions,\n  SubscribeToMoreOptions,\n  MutationUpdaterFn,\n} from './watchQueryOptions';\nexport { NetworkStatus } from './networkStatus';\nexport * from './types';\nexport {\n  Resolver,\n  FragmentMatcher,\n} from './LocalState';\nexport { isApolloError, ApolloError } from '../errors';\n\n/* Cache */\n\nexport {\n  // All the exports (types and values) from ../cache, minus cacheSlot,\n  // which we want to keep semi-private.\n  Cache,\n  ApolloCache,\n  Transaction,\n  DataProxy,\n  InMemoryCache,\n  InMemoryCacheConfig,\n  MissingFieldError,\n  defaultDataIdFromObject,\n  ReactiveVar,\n  makeVar,\n  TypePolicies,\n  TypePolicy,\n  FieldPolicy,\n  FieldReadFunction,\n  FieldMergeFunction,\n  FieldFunctionOptions,\n  PossibleTypesMap,\n} from '../cache';\n\nexport * from '../cache/inmemory/types';\n\n/* Link */\n\nexport * from '../link/core';\nexport * from '../link/http';\nexport {\n  fromError,\n  toPromise,\n  fromPromise,\n  ServerError,\n  throwServerError,\n} from '../link/utils';\n\n/* Utilities */\n\nexport {\n  Observable,\n  Observer,\n  ObservableSubscription,\n  Reference,\n  isReference,\n  makeReference,\n  StoreObject,\n} from '../utilities';\n\n/* Supporting */\n\n// The verbosity of invariant.{log,warn,error} can be controlled globally\n// (for anyone using the same ts-invariant package) by passing \"log\",\n// \"warn\", \"error\", or \"silent\" to setVerbosity (\"log\" is the default).\n// Note that all invariant.* logging is hidden in production.\nimport { setVerbosity } from \"ts-invariant\";\nexport { setVerbosity as setLogVerbosity }\nsetVerbosity(\"log\");\n\n// Note that importing `gql` by itself, then destructuring\n// additional properties separately before exporting, is intentional.\n// Due to the way the `graphql-tag` library is setup, certain bundlers\n// can't find the properties added to the exported `gql` function without\n// additional guidance (e.g. Rollup - see\n// https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module).\n// Instead of having people that are using bundlers with `@apollo/client` add\n// extra bundler config to help `graphql-tag` exports be found (which would be\n// awkward since they aren't importing `graphql-tag` themselves), this\n// workaround of pulling the extra properties off the `gql` function,\n// then re-exporting them separately, helps keeps bundlers happy without any\n// additional config changes.\nexport {\n  default as gql,\n  resetCaches,\n  disableFragmentWarnings,\n  enableExperimentalFragmentVariables,\n  disableExperimentalFragmentVariables,\n} from 'graphql-tag';\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport type {\n  ComponentDocument,\n  Data,\n  FetchMoreParams,\n  MaybeTDN,\n  MaybeVariables,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport type {\n  ApolloError,\n  ApolloQueryResult,\n  DocumentNode,\n  ObservableQuery,\n  QueryOptions,\n  SubscribeToMoreOptions,\n  SubscriptionOptions,\n  WatchQueryOptions,\n} from '@apollo/client/core';\n\nimport { NetworkStatus } from '@apollo/client/core';\n\nimport { ApolloController, ApolloControllerOptions } from './apollo-controller.js';\n\nimport { bound } from './lib/bound.js';\n\nexport interface ApolloQueryControllerOptions<D, V> extends\n    ApolloControllerOptions<D, V>,\n    Partial<WatchQueryOptions<Variables<D, V>, Data<D>>> {\n  variables?: Variables<D, V>;\n  noAutoSubscribe?: boolean;\n  shouldSubscribe?: (options?: Partial<SubscriptionOptions<Variables<D, V>, Data<D>>>) => boolean;\n  onData?: (data: Data<D>) => void;\n  onError?: (error: Error) => void;\n}\n\nexport class ApolloQueryController<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>\n  extends ApolloController<D, V>\n  implements ReactiveController {\n  private observableQuery?: ObservableQuery<Data<D>, Variables<D, V>>;\n\n  private pollingInterval?: number;\n\n  /** @summary Options to customize the query and to interface with the controller. */ // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/40220\n  declare options: ApolloQueryControllerOptions<D, V>;\n\n  /**\n   * `networkStatus` is useful if you want to display a different loading indicator (or no indicator at all)\n   * depending on your network status as it provides a more detailed view into the state of a network request\n   * on your component than `loading` does. `networkStatus` is an enum with different number values between 1 and 8.\n   * These number values each represent a different network state.\n   *\n   * 1. `loading`: The query has never been run before and the request is now pending. A query will still have this network status even if a result was returned from the cache, but a query was dispatched anyway.\n   * 2. `setVariables`: If a query\u2019s variables change and a network request was fired then the network status will be setVariables until the result of that query comes back. React users will see this when options.variables changes on their queries.\n   * 3. `fetchMore`: Indicates that fetchMore was called on this query and that the network request created is currently in flight.\n   * 4. `refetch`: It means that refetch was called on a query and the refetch request is currently in flight.\n   * 5. Unused.\n   * 6. `poll`: Indicates that a polling query is currently in flight. So for example if you are polling a query every 10 seconds then the network status will switch to poll every 10 seconds whenever a poll request has been sent but not resolved.\n   * 7. `ready`: No request is in flight for this query, and no errors happened. Everything is OK.\n   * 8. `error`: No request is in flight for this query, but one or more errors were detected.\n   *\n   * If the network status is less then 7 then it is equivalent to `loading` being true. In fact you could\n   * replace all of your `loading` checks with `networkStatus < 7` and you would not see a difference.\n   * It is recommended that you use `loading`, however.\n   */\n  networkStatus = NetworkStatus.ready;\n\n  /**\n   * If data was read from the cache with missing fields,\n   * partial will be true. Otherwise, partial will be falsy.\n   *\n   * @summary True when the query returned partial data.\n   */\n  partial = false;\n\n  #hasDisconnected = false;\n\n  #lastQueryDocument?: DocumentNode;\n\n  /** @summary A GraphQL document containing a single query. */\n  get query(): ComponentDocument<D> | null { return this.document; }\n\n  set query(document: ComponentDocument<D> | null) { this.document = document; }\n\n  /** @summary Flags an element that's ready and able to auto-subscribe */\n  public get canAutoSubscribe(): boolean {\n    return (\n      !!this.client &&\n      !!this.document &&\n      !this.options.noAutoSubscribe &&\n      this.shouldSubscribe()\n    );\n  }\n\n  constructor(\n    host: ReactiveControllerHost,\n    query?: ComponentDocument<D> | null,\n    options?: ApolloQueryControllerOptions<D, V>\n  ) {\n    super(host, options);\n    this.init(query ?? null);/* c8 ignore next */\n  }\n\n  /** @summary initializes or reinitializes the query */\n  override hostConnected(): void {\n    super.hostConnected();\n    if (this.#hasDisconnected && this.observableQuery) { /* c8 ignore next */\n      this.observableQuery.reobserve();\n      this.#hasDisconnected = false;\n    } else\n      this.documentChanged(this.query);\n  }\n\n  override hostDisconnected(): void {\n    this.#hasDisconnected = true;\n    super.hostDisconnected();\n  }\n\n  private shouldSubscribe(opts?: Partial<SubscriptionOptions<Variables<D, V>, Data<D>>>): boolean {\n    return this.options.shouldSubscribe?.(opts) ?? true;/* c8 ignore next */\n  }\n\n  /**\n   * Determines whether the element is able to automatically subscribe\n   */\n  private canSubscribe(\n    options?: Partial<SubscriptionOptions<Variables<D, V> | null, Data<D>>>\n  ): boolean {\n    /* c8 ignore next 4 */\n    return (\n      !(this.options.noAutoSubscribe ?? false) &&\n      !!this.client &&\n      !!(options?.query ?? this.document)\n    );\n  }\n\n  /**\n   * Creates an instance of ObservableQuery with the options provided by the element.\n   * - `context` Context to be passed to link execution chain\n   * - `errorPolicy` Specifies the ErrorPolicy to be used for this query\n   * - `fetchPolicy` Specifies the FetchPolicy to be used for this query\n   * - `fetchResults` Whether or not to fetch results\n   * - `metadata` Arbitrary metadata stored in the store with this query. Designed for debugging, developer tools, etc.\n   * - `notifyOnNetworkStatusChange` Whether or not updates to the network status should trigger next on the observer of this query\n   * - `pollInterval` The time interval (in milliseconds) on which this query should be refetched from the server.\n   * - `query` A GraphQL document that consists of a single query to be sent down to the server.\n   * - `variables` A map going from variable name to variable value, where the variables are used within the GraphQL query.\n   */\n  @bound private watchQuery(\n    params?: Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>\n  ): ObservableQuery<Data<D>, Variables<D, V>> {\n    if (!this.client)\n      throw new TypeError('No Apollo client. See https://apolloelements.dev/guides/getting-started/apollo-client/'); /* c8 ignore next */ // covered\n\n    return this.client.watchQuery({\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      query: this.query!,\n      variables: this.variables ?? undefined,\n      context: this.options.context,\n      errorPolicy: this.options.errorPolicy,\n      fetchPolicy: this.options.fetchPolicy,\n      notifyOnNetworkStatusChange: this.options.notifyOnNetworkStatusChange,\n      partialRefetch: this.options.partialRefetch,\n      pollInterval: this.options.pollInterval,\n      returnPartialData: this.options.returnPartialData,\n      nextFetchPolicy: this.options.nextFetchPolicy,\n      ...params,\n    }) as ObservableQuery<Data<D>, Variables<D, V>>;\n  }\n\n  private nextData(result: ApolloQueryResult<Data<D>>): void {\n    this.emitter.dispatchEvent(new CustomEvent('apollo-query-result', { detail: result }));\n    this.data = result.data;\n    this.error = result.error ?? null;/* c8 ignore next */\n    this.errors = result.errors ?? [];\n    this.loading = result.loading ?? false;/* c8 ignore next */\n    this.networkStatus = result.networkStatus;\n    this.partial = result.partial ?? false;\n    this.options.onData?.(result.data);/* c8 ignore next */\n    this.notify('data', 'error', 'errors', 'loading', 'networkStatus', 'partial');\n  }\n\n  private nextError(error: ApolloError): void {\n    this.emitter.dispatchEvent(new CustomEvent('apollo-error', { detail: error }));\n    this.error = error;\n    this.loading = false;\n    this.options.onError?.(error);/* c8 ignore next */\n    this.notify('error', 'loading');\n  }\n\n  protected override clientChanged(): void {\n    if (this.canSubscribe() && this.shouldSubscribe())/* c8 ignore next */\n      this.subscribe();/* c8 ignore next */\n  }\n\n  protected override documentChanged(doc?: ComponentDocument<D> | null): void {\n    const query = doc ?? undefined;/* c8 ignore next */\n    if (doc === this.#lastQueryDocument)\n      return;/* c8 ignore next */\n    if (this.canSubscribe({ query }) && this.shouldSubscribe({ query }))/* c8 ignore next */\n      this.subscribe({ query }); /* c8 ignore next */ // covered\n  }\n\n  protected override variablesChanged(variables?: Variables<D, V>): void {\n    if (this.observableQuery)\n      this.refetch(variables);/* c8 ignore next */\n    else if (this.canSubscribe({ variables }) && this.shouldSubscribe({ variables }))/* c8 ignore next */\n      this.subscribe({ variables });/* c8 ignore next */\n  }\n\n  /**\n   * Exposes the [`ObservableQuery#refetch`](https://www.apollographql.com/docs/react/api/apollo-client.html#ObservableQuery.refetch) method.\n   *\n   * @param variables The new set of variables. If there are missing variables, the previous values of those variables will be used.\n   */\n  @bound public async refetch(variables?: Variables<D, V>): Promise<ApolloQueryResult<Data<D>>> {\n    if (!this.observableQuery)\n      throw new Error('Cannot refetch without an ObservableQuery'); /* c8 ignore next */ // covered\n    return this.observableQuery.refetch(variables as Variables<D, V>);\n  }\n\n  /**\n   * Resets the observableQuery and subscribes.\n   * @param params options for controlling how the subscription subscribes\n   */\n  @bound public subscribe(\n    params?: Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>\n  ): ZenObservable.Subscription {\n    if (this.observableQuery)\n      this.observableQuery.stopPolling(); /* c8 ignore next */ // covered\n\n    this.observableQuery = this.watchQuery({\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      query: this.query!,\n      variables: this.variables ?? undefined,\n      context: this.options.context,\n      errorPolicy: this.options.errorPolicy,\n      fetchPolicy: this.options.fetchPolicy,\n      pollInterval: this.options.pollInterval,\n      notifyOnNetworkStatusChange: this.options.notifyOnNetworkStatusChange,\n      returnPartialData: this.options.returnPartialData,\n      partialRefetch: this.options.partialRefetch,\n      ...params,\n    });\n\n    this.#lastQueryDocument = params?.query ?? this.query ?? undefined;/* c8 ignore next */\n\n    this.loading = true;\n    this.notify('loading');\n\n    return this.observableQuery?.subscribe({\n      next: this.nextData.bind(this),\n      error: this.nextError.bind(this),\n    });\n  }\n\n  /**\n   * Lets you pass a GraphQL subscription and updateQuery function\n   * to subscribe to more updates for your query.\n   *\n   * The `updateQuery` parameter is a function that takes the previous query data,\n   * then a `{ subscriptionData: TSubscriptionResult }` object,\n   * and returns an object with updated query data based on the new results.\n   */\n  @bound public subscribeToMore<TSubscriptionVariables, TSubscriptionData>(\n    options: SubscribeToMoreOptions<Data<D>, TSubscriptionVariables, TSubscriptionData>\n  ): (() => void) | void {\n    return this.observableQuery?.subscribeToMore(options);\n  }\n\n  /**\n   * @summary Executes a Query once and updates the with the result\n   */\n  @bound public async executeQuery(\n    params?: Partial<QueryOptions<Variables<D, V>, Data<D>>>\n  ): Promise<ApolloQueryResult<Data<D>>> {\n    try {\n      if (!this.client)\n        throw new TypeError('No Apollo client. See https://apolloelements.dev/guides/getting-started/apollo-client/'); /* c8 ignore next */ // covered\n\n      this.loading = true;\n      this.notify('loading');\n\n      const result = await this.client.query<Data<D>, Variables<D, V>>({\n        // It's better to let Apollo client throw this error, if needs be\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        query: this.query!, variables: this.variables!,\n        context: this.options.context,\n        errorPolicy: this.options.errorPolicy,\n        fetchPolicy:\n            this.options.fetchPolicy === 'cache-and-network' ? undefined/* c8 ignore next */\n          : this.options.fetchPolicy,\n        notifyOnNetworkStatusChange: this.options.notifyOnNetworkStatusChange,\n        partialRefetch: this.options.partialRefetch,\n        returnPartialData: this.options.returnPartialData,\n        ...params,\n      });\n      if (result) // NB: not sure why, but sometimes this returns undefined\n        this.nextData(result);\n      return result;/* c8 ignore next */\n    } catch (error) {\n      this.nextError(error);\n      throw error;\n    }\n  }\n\n  /**\n   * Exposes the `ObservableQuery#fetchMore` method.\n   * https://www.apollographql.com/docs/react/api/core/ObservableQuery/#ObservableQuery.fetchMore\n   *\n   * The optional `updateQuery` parameter is a function that takes the previous query data,\n   * then a `{ subscriptionData: TSubscriptionResult }` object,\n   * and returns an object with updated query data based on the new results.\n   *\n   * The optional `variables` parameter is an optional new variables object.\n   */\n  @bound public async fetchMore(\n    params?: Partial<FetchMoreParams<D, V>>\n  ): Promise<ApolloQueryResult<Data<D>>> {\n    this.loading = true;\n    this.notify('loading');\n\n    const options = {\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      query: this.query!,\n      context: this.options.context,\n      variables: this.variables,\n      ...params,\n    };\n\n    return (\n      this.observableQuery ??= this.watchQuery(\n        options as WatchQueryOptions<Variables<D, V>, Data<D>>\n      )\n    ).fetchMore({\n      ...options,\n      variables: (options.variables as Variables<D, V>) ?? undefined, /* c8 ignore next */\n    }).then(x => {\n      this.loading = false;\n      this.notify('loading');\n      return x;\n    });\n  }\n\n  /**\n   * @summary Start polling this query\n   * @param ms milliseconds to wait between fetches\n   */\n  @bound public startPolling(ms: number): void {\n    this.pollingInterval = window.setInterval(() => {\n      this.refetch();\n    }, ms);\n  }\n\n  /**\n   * @summary Stop polling this query\n   */\n  @bound public stopPolling(): void {\n    clearInterval(this.pollingInterval);\n  }\n}\n", "import type { ComponentDocument, MaybeTDN, MaybeVariables } from '@apollo-elements/core/types';\n\nimport { useController } from 'haunted/lib/use-controller';\n\nimport {\n  ApolloQueryController,\n  ApolloQueryControllerOptions,\n} from '@apollo-elements/core/apollo-query-controller';\n\nexport function useQuery<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>(\n  query: ComponentDocument<D>,\n  options?: ApolloQueryControllerOptions<D, V>\n): ApolloQueryController<D, V> {\n  return useController(host => new ApolloQueryController<D, V>(host, query, options));\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport type {\n  ComponentDocument,\n  Data,\n  MaybeTDN,\n  MaybeVariables,\n  SubscriptionDataOptions,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport type {\n  ApolloClient,\n  ApolloError,\n  DocumentNode,\n  FetchPolicy,\n  FetchResult,\n  NormalizedCacheObject,\n  Observable,\n  SubscriptionOptions,\n  WatchQueryOptions,\n} from '@apollo/client/core';\n\nimport { ApolloController, ApolloControllerOptions } from './apollo-controller.js';\n\nimport { bound } from './lib/bound.js';\n\nexport interface ApolloSubscriptionControllerOptions<D, V> extends ApolloControllerOptions<D, V>,\n          Partial<WatchQueryOptions<Variables<D, V>, Data<D>>> {\n  variables?: Variables<D, V>,\n  fetchPolicy?: FetchPolicy;\n  noAutoSubscribe?: boolean;\n  shouldSubscribe?: (options?: Partial<SubscriptionOptions<Variables<D, V>, Data<D>>>) => boolean;\n  shouldResubscribe?: boolean;\n  skip?: boolean;\n  onData?: (detail: {\n    client: ApolloClient<NormalizedCacheObject>;\n    subscriptionData: { data: Data<D> | null; loading: boolean; error: null; };\n  }) => void;\n  onComplete?: () => void;\n  onError?: (error: ApolloError) => void;\n}\n\nexport class ApolloSubscriptionController<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>\n  extends ApolloController<D, V>\n  implements ReactiveController {\n  private observable?: Observable<FetchResult<Data<D>>>;\n\n  private observableSubscription?: ZenObservable.Subscription;\n\n  // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/40220\n  declare options: ApolloSubscriptionControllerOptions<D, V>;\n\n  #hasDisconnected = false;\n\n  #lastSubscriptionDocument?: DocumentNode;\n\n  get subscription(): ComponentDocument<D> | null { return this.document; }\n\n  set subscription(document: ComponentDocument<D> | null) { this.document = document; }\n\n  /** Flags an element that's ready and able to auto-subscribe */\n  public get canAutoSubscribe(): boolean {\n    return (\n      !!this.client &&\n      !this.options.noAutoSubscribe &&\n      this.shouldSubscribe()\n    );\n  }\n\n  constructor(\n    host: ReactiveControllerHost,\n    subscription?: ComponentDocument<D> | null,\n    options?: ApolloSubscriptionControllerOptions<D, V>\n  ) {\n    super(host, options);\n    this.init(subscription ?? null);/* c8 ignore next */\n  }\n\n  override hostConnected(): void {\n    super.hostConnected();\n    /* c8 ignore start */ // covered\n    if (this.#hasDisconnected && this.observableSubscription)\n      this.subscribe(); /* c8 ignore stop */\n    else\n      this.documentChanged(this.subscription);\n  }\n\n  override hostDisconnected(): void {\n    this.endSubscription();\n    this.#hasDisconnected = true;\n    super.hostDisconnected();\n  }\n\n  /**\n   * Determines whether the element is able to automatically subscribe\n   */\n  private canSubscribe(\n    options?: Partial<SubscriptionOptions<Variables<D, V> | null, Data<D>>>\n  ): boolean {\n    /* c8 ignore next 4 */\n    return (\n      !this.options.noAutoSubscribe &&\n      !!this.client &&\n      (!this.observable || !!this.options.shouldResubscribe) &&\n      !!(options?.query ?? this.subscription)\n    );\n  }\n\n  private initObservable(params?: Partial<SubscriptionDataOptions<D, V>>): void {\n    const {\n      shouldResubscribe = this.options.shouldResubscribe,\n      client = this.client,\n      skip = this.options.skip,\n      ...rest\n    } = params ?? {}; /* c8 ignore start */ // covered\n\n    if (!client) /* c8 ignore start */ // covered\n      throw new TypeError('No Apollo client. See https://apolloelements.dev/guides/getting-started/apollo-client/');\n\n\n    if ((this.observable && !shouldResubscribe) || skip)\n      return; /* c8 ignore stop */\n\n    const query = params?.subscription ?? this.subscription as DocumentNode; /* c8 ignore next */\n    this.#lastSubscriptionDocument = query;\n    this.observable = client.subscribe({\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      variables: this.variables,\n      context: this.options.context,\n      errorPolicy: this.options.errorPolicy,\n      fetchPolicy: this.options.fetchPolicy,\n      ...rest,\n      query,\n    });\n  }\n\n  /**\n   * Sets `data`, `loading`, and `error` on the instance when new subscription results arrive.\n   */\n  private nextData(result: FetchResult<Data<D>>) {\n    const { data = null, errors } = result;\n    // If we got to this line without a client, it's because of user error\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    const client = this.client!;\n    const loading = false;\n    const subscriptionData = { data, loading, error: null };\n    const detail = { client, subscriptionData };\n    this.emitter.dispatchEvent(new CustomEvent('apollo-subscription-result', { detail }));\n    this.data = data;\n    this.error = null;\n    this.errors = errors ?? [];\n    this.loading = loading;\n    this.options.onData?.(detail); /* c8 ignore next */ // covered\n    this.notify('data', 'error', 'errors', 'loading');\n  }\n\n  /**\n   * Sets `error` and `loading` on the instance when the subscription errors.\n   */\n  private nextError(error: ApolloError) {\n    this.emitter.dispatchEvent(new CustomEvent('apollo-error', { detail: error }));\n    this.error = error;\n    this.loading = false;\n    this.options.onError?.(error); /* c8 ignore next */ // covered\n    this.notify('error', 'loading');\n  }\n\n  /**\n   * Shuts down the subscription\n   */\n  private onComplete(): void {\n    this.options.onComplete?.(); /* c8 ignore next */ // covered\n    this.endSubscription();\n    this.notify();\n  }\n\n  private endSubscription() {\n    if (this.observableSubscription)\n      this.observableSubscription.unsubscribe();\n  }\n\n  private shouldSubscribe(opts?: Partial<SubscriptionOptions<Variables<D, V>, Data<D>>>): boolean {\n    return this.options.shouldSubscribe?.(opts) ?? true; /* c8 ignore next */\n  }\n\n  protected override clientChanged(): void {\n    if (this.canSubscribe() && this.shouldSubscribe())/* c8 ignore next */\n      this.subscribe();/* c8 ignore next */\n  }\n\n  protected override documentChanged(doc?: ComponentDocument<D> | null): void {\n    const query = doc ?? undefined;/* c8 ignore next */\n    if (doc === this.#lastSubscriptionDocument)\n      return;/* c8 ignore next */\n    this.cancel();\n    if (this.canSubscribe({ query }) && this.shouldSubscribe({ query })) /* c8 ignore next */\n      this.subscribe();/* c8 ignore next */\n  }\n\n  protected override variablesChanged(variables?: Variables<D, V>): void {\n    this.cancel();\n    if (this.canSubscribe({ variables }) && this.shouldSubscribe({ variables }))/* c8 ignore next */\n      this.subscribe();/* c8 ignore next */\n  }\n\n  /**\n   * @summary Starts the subscription\n   */\n  @bound public subscribe(params?: Partial<SubscriptionDataOptions<D, V>>): void {\n    this.initObservable(params);\n\n    /* c8 ignore start */ // covered\n    const shouldResubscribe = params?.shouldResubscribe ?? this.options.shouldResubscribe;\n    if (this.observableSubscription && !shouldResubscribe) return;\n    /* c8 ignore stop */\n\n    this.loading = true;\n    this.notify('loading');\n\n    this.observableSubscription =\n      this.observable?.subscribe({\n        next: this.nextData.bind(this),\n        error: this.nextError.bind(this),\n        complete: this.onComplete.bind(this),\n      });\n  }\n\n  /**\n   * @summary Ends the subscription\n   */\n  @bound public cancel(): void {\n    this.endSubscription();\n    this.observableSubscription = undefined;\n    this.observable = undefined;\n  }\n}\n", "import type { ComponentDocument, MaybeTDN, MaybeVariables } from '@apollo-elements/core/types';\n\nimport { useController } from 'haunted/lib/use-controller';\n\nimport {\n  ApolloSubscriptionController,\n  ApolloSubscriptionControllerOptions,\n} from '@apollo-elements/core/apollo-subscription-controller';\n\nexport function useSubscription<D extends MaybeTDN, V = MaybeVariables<D>>(\n  query: ComponentDocument<D>,\n  options?: ApolloSubscriptionControllerOptions<D, V>\n): ApolloSubscriptionController<D, V> {\n  return useController(host => new ApolloSubscriptionController<D, V>(host, query, options));\n}\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {Part} from './part.js';\n\nconst directives = new WeakMap<object, true>();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DirectiveFactory = (...args: any[]) => object;\n\nexport type DirectiveFn = (part: Part) => void;\n\n/**\n * Brands a function as a directive factory function so that lit-html will call\n * the function during template rendering, rather than passing as a value.\n *\n * A _directive_ is a function that takes a Part as an argument. It has the\n * signature: `(part: Part) => void`.\n *\n * A directive _factory_ is a function that takes arguments for data and\n * configuration and returns a directive. Users of directive usually refer to\n * the directive factory as the directive. For example, \"The repeat directive\".\n *\n * Usually a template author will invoke a directive factory in their template\n * with relevant arguments, which will then return a directive function.\n *\n * Here's an example of using the `repeat()` directive factory that takes an\n * array and a function to render an item:\n *\n * ```js\n * html`<ul><${repeat(items, (item) => html`<li>${item}</li>`)}</ul>`\n * ```\n *\n * When `repeat` is invoked, it returns a directive function that closes over\n * `items` and the template function. When the outer template is rendered, the\n * return directive function is called with the Part for the expression.\n * `repeat` then performs it's custom logic to render multiple items.\n *\n * @param f The directive factory function. Must be a function that returns a\n * function of the signature `(part: Part) => void`. The returned function will\n * be called with the part object.\n *\n * @example\n *\n * import {directive, html} from 'lit-html';\n *\n * const immutable = directive((v) => (part) => {\n *   if (part.value !== v) {\n *     part.setValue(v)\n *   }\n * });\n */\nexport const directive = <F extends DirectiveFactory>(f: F): F =>\n    ((...args: unknown[]) => {\n      const d = f(...args);\n      directives.set(d, true);\n      return d;\n    }) as F;\n\nexport const isDirective = (o: unknown): o is DirectiveFn => {\n  return typeof o === 'function' && directives.has(o);\n};\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\ninterface MaybePolyfilledCe extends CustomElementRegistry {\n  readonly polyfillWrapFlushCallback?: object;\n}\n\n/**\n * True if the custom elements polyfill is in use.\n */\nexport const isCEPolyfill = typeof window !== 'undefined' &&\n    window.customElements != null &&\n    (window.customElements as MaybePolyfilledCe).polyfillWrapFlushCallback !==\n        undefined;\n\n/**\n * Reparents nodes, starting from `start` (inclusive) to `end` (exclusive),\n * into another container (could be the same container), before `before`. If\n * `before` is null, it appends the nodes to the container.\n */\nexport const reparentNodes =\n    (container: Node,\n     start: Node|null,\n     end: Node|null = null,\n     before: Node|null = null): void => {\n      while (start !== end) {\n        const n = start!.nextSibling;\n        container.insertBefore(start!, before);\n        start = n;\n      }\n    };\n\n/**\n * Removes nodes, starting from `start` (inclusive) to `end` (exclusive), from\n * `container`.\n */\nexport const removeNodes =\n    (container: Node, start: Node|null, end: Node|null = null): void => {\n      while (start !== end) {\n        const n = start!.nextSibling;\n        container.removeChild(start!);\n        start = n;\n      }\n    };\n", "/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * The Part interface represents a dynamic part of a template instance rendered\n * by lit-html.\n */\nexport interface Part {\n  readonly value: unknown;\n\n  /**\n   * Sets the current part value, but does not write it to the DOM.\n   * @param value The value that will be committed.\n   */\n  setValue(value: unknown): void;\n\n  /**\n   * Commits the current part value, causing it to actually be written to the\n   * DOM.\n   *\n   * Directives are run at the start of `commit`, so that if they call\n   * `part.setValue(...)` synchronously that value will be used in the current\n   * commit, and there's no need to call `part.commit()` within the directive.\n   * If directives set a part value asynchronously, then they must call\n   * `part.commit()` manually.\n   */\n  commit(): void;\n}\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = {};\n\n/**\n * A sentinel value that signals a NodePart to fully clear its content.\n */\nexport const nothing = {};\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {TemplateResult} from './template-result.js';\n\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nexport const marker = `{{lit-${String(Math.random()).slice(2)}}}`;\n\n/**\n * An expression marker used text-positions, multi-binding attributes, and\n * attributes with markup-like text values.\n */\nexport const nodeMarker = `<!--${marker}-->`;\n\nexport const markerRegex = new RegExp(`${marker}|${nodeMarker}`);\n\n/**\n * Suffix appended to all bound attribute names.\n */\nexport const boundAttributeSuffix = '$lit$';\n\n/**\n * An updatable Template that tracks the location of dynamic parts.\n */\nexport class Template {\n  readonly parts: TemplatePart[] = [];\n  readonly element: HTMLTemplateElement;\n\n  constructor(result: TemplateResult, element: HTMLTemplateElement) {\n    this.element = element;\n\n    const nodesToRemove: Node[] = [];\n    const stack: Node[] = [];\n    // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n    const walker = document.createTreeWalker(\n        element.content,\n        133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n        null,\n        false);\n    // Keeps track of the last index associated with a part. We try to delete\n    // unnecessary nodes, but we never want to associate two different parts\n    // to the same index. They must have a constant node between.\n    let lastPartIndex = 0;\n    let index = -1;\n    let partIndex = 0;\n    const {strings, values: {length}} = result;\n    while (partIndex < length) {\n      const node = walker.nextNode() as Element | Comment | Text | null;\n      if (node === null) {\n        // We've exhausted the content inside a nested template element.\n        // Because we still have parts (the outer for-loop), we know:\n        // - There is a template in the stack\n        // - The walker will find a nextNode outside the template\n        walker.currentNode = stack.pop()!;\n        continue;\n      }\n      index++;\n\n      if (node.nodeType === 1 /* Node.ELEMENT_NODE */) {\n        if ((node as Element).hasAttributes()) {\n          const attributes = (node as Element).attributes;\n          const {length} = attributes;\n          // Per\n          // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n          // attributes are not guaranteed to be returned in document order.\n          // In particular, Edge/IE can return them out of order, so we cannot\n          // assume a correspondence between part index and attribute index.\n          let count = 0;\n          for (let i = 0; i < length; i++) {\n            if (endsWith(attributes[i].name, boundAttributeSuffix)) {\n              count++;\n            }\n          }\n          while (count-- > 0) {\n            // Get the template literal section leading up to the first\n            // expression in this attribute\n            const stringForPart = strings[partIndex];\n            // Find the attribute name\n            const name = lastAttributeNameRegex.exec(stringForPart)![2];\n            // Find the corresponding attribute\n            // All bound attributes have had a suffix added in\n            // TemplateResult#getHTML to opt out of special attribute\n            // handling. To look up the attribute value we also need to add\n            // the suffix.\n            const attributeLookupName =\n                name.toLowerCase() + boundAttributeSuffix;\n            const attributeValue =\n                (node as Element).getAttribute(attributeLookupName)!;\n            (node as Element).removeAttribute(attributeLookupName);\n            const statics = attributeValue.split(markerRegex);\n            this.parts.push({type: 'attribute', index, name, strings: statics});\n            partIndex += statics.length - 1;\n          }\n        }\n        if ((node as Element).tagName === 'TEMPLATE') {\n          stack.push(node);\n          walker.currentNode = (node as HTMLTemplateElement).content;\n        }\n      } else if (node.nodeType === 3 /* Node.TEXT_NODE */) {\n        const data = (node as Text).data;\n        if (data.indexOf(marker) >= 0) {\n          const parent = node.parentNode!;\n          const strings = data.split(markerRegex);\n          const lastIndex = strings.length - 1;\n          // Generate a new text node for each literal section\n          // These nodes are also used as the markers for node parts\n          for (let i = 0; i < lastIndex; i++) {\n            let insert: Node;\n            let s = strings[i];\n            if (s === '') {\n              insert = createMarker();\n            } else {\n              const match = lastAttributeNameRegex.exec(s);\n              if (match !== null && endsWith(match[2], boundAttributeSuffix)) {\n                s = s.slice(0, match.index) + match[1] +\n                    match[2].slice(0, -boundAttributeSuffix.length) + match[3];\n              }\n              insert = document.createTextNode(s);\n            }\n            parent.insertBefore(insert, node);\n            this.parts.push({type: 'node', index: ++index});\n          }\n          // If there's no text, we must insert a comment to mark our place.\n          // Else, we can trust it will stick around after cloning.\n          if (strings[lastIndex] === '') {\n            parent.insertBefore(createMarker(), node);\n            nodesToRemove.push(node);\n          } else {\n            (node as Text).data = strings[lastIndex];\n          }\n          // We have a part for each match found\n          partIndex += lastIndex;\n        }\n      } else if (node.nodeType === 8 /* Node.COMMENT_NODE */) {\n        if ((node as Comment).data === marker) {\n          const parent = node.parentNode!;\n          // Add a new marker node to be the startNode of the Part if any of\n          // the following are true:\n          //  * We don't have a previousSibling\n          //  * The previousSibling is already the start of a previous part\n          if (node.previousSibling === null || index === lastPartIndex) {\n            index++;\n            parent.insertBefore(createMarker(), node);\n          }\n          lastPartIndex = index;\n          this.parts.push({type: 'node', index});\n          // If we don't have a nextSibling, keep this node so we have an end.\n          // Else, we can remove it to save future costs.\n          if (node.nextSibling === null) {\n            (node as Comment).data = '';\n          } else {\n            nodesToRemove.push(node);\n            index--;\n          }\n          partIndex++;\n        } else {\n          let i = -1;\n          while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n            // Comment node has a binding marker inside, make an inactive part\n            // The binding won't work, but subsequent bindings will\n            // TODO (justinfagnani): consider whether it's even worth it to\n            // make bindings in comments work\n            this.parts.push({type: 'node', index: -1});\n            partIndex++;\n          }\n        }\n      }\n    }\n\n    // Remove text binding nodes after the walk to not disturb the TreeWalker\n    for (const n of nodesToRemove) {\n      n.parentNode!.removeChild(n);\n    }\n  }\n}\n\nconst endsWith = (str: string, suffix: string): boolean => {\n  const index = str.length - suffix.length;\n  return index >= 0 && str.slice(index) === suffix;\n};\n\n/**\n * A placeholder for a dynamic expression in an HTML template.\n *\n * There are two built-in part types: AttributePart and NodePart. NodeParts\n * always represent a single dynamic expression, while AttributeParts may\n * represent as many expressions are contained in the attribute.\n *\n * A Template's parts are mutable, so parts can be replaced or modified\n * (possibly to implement different template semantics). The contract is that\n * parts can only be replaced, not removed, added or reordered, and parts must\n * always consume the correct number of values in their `update()` method.\n *\n * TODO(justinfagnani): That requirement is a little fragile. A\n * TemplateInstance could instead be more careful about which values it gives\n * to Part.update().\n */\nexport type TemplatePart = {\n  readonly type: 'node'; index: number;\n}|{\n  readonly type: 'attribute';\n  index: number;\n  readonly name: string;\n  readonly strings: ReadonlyArray<string>;\n};\n\nexport const isTemplatePartActive = (part: TemplatePart) => part.index !== -1;\n\n// Allows `document.createComment('')` to be renamed for a\n// small manual size-savings.\nexport const createMarker = () => document.createComment('');\n\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\x09\\x0a\\x0c\\x0d\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-characters\n *\n * \"\\0-\\x1F\\x7F-\\x9F\" are Unicode control characters, which includes every\n * space character except \" \".\n *\n * So an attribute is:\n *  * The name: any character except a control character, space character, ('),\n *    (\"), \">\", \"=\", or \"/\"\n *  * Followed by zero or more space characters\n *  * Followed by \"=\"\n *  * Followed by zero or more space characters\n *  * Followed by:\n *    * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n *    * (\") then any non-(\"), or\n *    * (') then any non-(')\n */\nexport const lastAttributeNameRegex =\n    // eslint-disable-next-line no-control-regex\n    /([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isCEPolyfill} from './dom.js';\nimport {Part} from './part.js';\nimport {RenderOptions} from './render-options.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\n/**\n * An instance of a `Template` that can be attached to the DOM and updated\n * with new values.\n */\nexport class TemplateInstance {\n  private readonly __parts: Array<Part|undefined> = [];\n  readonly processor: TemplateProcessor;\n  readonly options: RenderOptions;\n  readonly template: Template;\n\n  constructor(\n      template: Template, processor: TemplateProcessor,\n      options: RenderOptions) {\n    this.template = template;\n    this.processor = processor;\n    this.options = options;\n  }\n\n  update(values: readonly unknown[]) {\n    let i = 0;\n    for (const part of this.__parts) {\n      if (part !== undefined) {\n        part.setValue(values[i]);\n      }\n      i++;\n    }\n    for (const part of this.__parts) {\n      if (part !== undefined) {\n        part.commit();\n      }\n    }\n  }\n\n  _clone(): DocumentFragment {\n    // There are a number of steps in the lifecycle of a template instance's\n    // DOM fragment:\n    //  1. Clone - create the instance fragment\n    //  2. Adopt - adopt into the main document\n    //  3. Process - find part markers and create parts\n    //  4. Upgrade - upgrade custom elements\n    //  5. Update - set node, attribute, property, etc., values\n    //  6. Connect - connect to the document. Optional and outside of this\n    //     method.\n    //\n    // We have a few constraints on the ordering of these steps:\n    //  * We need to upgrade before updating, so that property values will pass\n    //    through any property setters.\n    //  * We would like to process before upgrading so that we're sure that the\n    //    cloned fragment is inert and not disturbed by self-modifying DOM.\n    //  * We want custom elements to upgrade even in disconnected fragments.\n    //\n    // Given these constraints, with full custom elements support we would\n    // prefer the order: Clone, Process, Adopt, Upgrade, Update, Connect\n    //\n    // But Safari does not implement CustomElementRegistry#upgrade, so we\n    // can not implement that order and still have upgrade-before-update and\n    // upgrade disconnected fragments. So we instead sacrifice the\n    // process-before-upgrade constraint, since in Custom Elements v1 elements\n    // must not modify their light DOM in the constructor. We still have issues\n    // when co-existing with CEv0 elements like Polymer 1, and with polyfills\n    // that don't strictly adhere to the no-modification rule because shadow\n    // DOM, which may be created in the constructor, is emulated by being placed\n    // in the light DOM.\n    //\n    // The resulting order is on native is: Clone, Adopt, Upgrade, Process,\n    // Update, Connect. document.importNode() performs Clone, Adopt, and Upgrade\n    // in one step.\n    //\n    // The Custom Elements v1 polyfill supports upgrade(), so the order when\n    // polyfilled is the more ideal: Clone, Process, Adopt, Upgrade, Update,\n    // Connect.\n\n    const fragment = isCEPolyfill ?\n        this.template.element.content.cloneNode(true) as DocumentFragment :\n        document.importNode(this.template.element.content, true);\n\n    const stack: Node[] = [];\n    const parts = this.template.parts;\n    // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n    const walker = document.createTreeWalker(\n        fragment,\n        133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n        null,\n        false);\n    let partIndex = 0;\n    let nodeIndex = 0;\n    let part: TemplatePart;\n    let node = walker.nextNode();\n    // Loop through all the nodes and parts of a template\n    while (partIndex < parts.length) {\n      part = parts[partIndex];\n      if (!isTemplatePartActive(part)) {\n        this.__parts.push(undefined);\n        partIndex++;\n        continue;\n      }\n\n      // Progress the tree walker until we find our next part's node.\n      // Note that multiple parts may share the same node (attribute parts\n      // on a single element), so this loop may not run at all.\n      while (nodeIndex < part.index) {\n        nodeIndex++;\n        if (node!.nodeName === 'TEMPLATE') {\n          stack.push(node!);\n          walker.currentNode = (node as HTMLTemplateElement).content;\n        }\n        if ((node = walker.nextNode()) === null) {\n          // We've exhausted the content inside a nested template element.\n          // Because we still have parts (the outer for-loop), we know:\n          // - There is a template in the stack\n          // - The walker will find a nextNode outside the template\n          walker.currentNode = stack.pop()!;\n          node = walker.nextNode();\n        }\n      }\n\n      // We've arrived at our part's node.\n      if (part.type === 'node') {\n        const part = this.processor.handleTextExpression(this.options);\n        part.insertAfterNode(node!.previousSibling!);\n        this.__parts.push(part);\n      } else {\n        this.__parts.push(...this.processor.handleAttributeExpressions(\n            node as Element, part.name, part.strings, this.options));\n      }\n      partIndex++;\n    }\n\n    if (isCEPolyfill) {\n      document.adoptNode(fragment);\n      customElements.upgrade(fragment);\n    }\n    return fragment;\n  }\n}\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * @module lit-html\n */\n\nimport {reparentNodes} from './dom.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {boundAttributeSuffix, lastAttributeNameRegex, marker, nodeMarker} from './template.js';\n\ndeclare const trustedTypes: typeof window.trustedTypes;\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = window.trustedTypes &&\n    trustedTypes!.createPolicy('lit-html', {createHTML: (s) => s});\n\nconst commentMarker = ` ${marker} `;\n\n/**\n * The return type of `html`, which holds a Template and the values from\n * interpolated expressions.\n */\nexport class TemplateResult {\n  readonly strings: TemplateStringsArray;\n  readonly values: readonly unknown[];\n  readonly type: string;\n  readonly processor: TemplateProcessor;\n\n  constructor(\n      strings: TemplateStringsArray, values: readonly unknown[], type: string,\n      processor: TemplateProcessor) {\n    this.strings = strings;\n    this.values = values;\n    this.type = type;\n    this.processor = processor;\n  }\n\n  /**\n   * Returns a string of HTML used to create a `<template>` element.\n   */\n  getHTML(): string {\n    const l = this.strings.length - 1;\n    let html = '';\n    let isCommentBinding = false;\n\n    for (let i = 0; i < l; i++) {\n      const s = this.strings[i];\n      // For each binding we want to determine the kind of marker to insert\n      // into the template source before it's parsed by the browser's HTML\n      // parser. The marker type is based on whether the expression is in an\n      // attribute, text, or comment position.\n      //   * For node-position bindings we insert a comment with the marker\n      //     sentinel as its text content, like <!--{{lit-guid}}-->.\n      //   * For attribute bindings we insert just the marker sentinel for the\n      //     first binding, so that we support unquoted attribute bindings.\n      //     Subsequent bindings can use a comment marker because multi-binding\n      //     attributes must be quoted.\n      //   * For comment bindings we insert just the marker sentinel so we don't\n      //     close the comment.\n      //\n      // The following code scans the template source, but is *not* an HTML\n      // parser. We don't need to track the tree structure of the HTML, only\n      // whether a binding is inside a comment, and if not, if it appears to be\n      // the first binding in an attribute.\n      const commentOpen = s.lastIndexOf('<!--');\n      // We're in comment position if we have a comment open with no following\n      // comment close. Because <-- can appear in an attribute value there can\n      // be false positives.\n      isCommentBinding = (commentOpen > -1 || isCommentBinding) &&\n          s.indexOf('-->', commentOpen + 1) === -1;\n      // Check to see if we have an attribute-like sequence preceding the\n      // expression. This can match \"name=value\" like structures in text,\n      // comments, and attribute values, so there can be false-positives.\n      const attributeMatch = lastAttributeNameRegex.exec(s);\n      if (attributeMatch === null) {\n        // We're only in this branch if we don't have a attribute-like\n        // preceding sequence. For comments, this guards against unusual\n        // attribute values like <div foo=\"<!--${'bar'}\">. Cases like\n        // <!-- foo=${'bar'}--> are handled correctly in the attribute branch\n        // below.\n        html += s + (isCommentBinding ? commentMarker : nodeMarker);\n      } else {\n        // For attributes we use just a marker sentinel, and also append a\n        // $lit$ suffix to the name to opt-out of attribute-specific parsing\n        // that IE and Edge do for style and certain SVG attributes.\n        html += s.substr(0, attributeMatch.index) + attributeMatch[1] +\n            attributeMatch[2] + boundAttributeSuffix + attributeMatch[3] +\n            marker;\n      }\n    }\n    html += this.strings[l];\n    return html;\n  }\n\n  getTemplateElement(): HTMLTemplateElement {\n    const template = document.createElement('template');\n    let value = this.getHTML();\n    if (policy !== undefined) {\n      // this is secure because `this.strings` is a TemplateStringsArray.\n      // TODO: validate this when\n      // https://github.com/tc39/proposal-array-is-template-object is\n      // implemented.\n      value = policy.createHTML(value) as unknown as string;\n    }\n    template.innerHTML = value;\n    return template;\n  }\n}\n\n/**\n * A TemplateResult for SVG fragments.\n *\n * This class wraps HTML in an `<svg>` tag in order to parse its contents in the\n * SVG namespace, then modifies the template to remove the `<svg>` tag so that\n * clones only container the original fragment.\n */\nexport class SVGTemplateResult extends TemplateResult {\n  getHTML(): string {\n    return `<svg>${super.getHTML()}</svg>`;\n  }\n\n  getTemplateElement(): HTMLTemplateElement {\n    const template = super.getTemplateElement();\n    const content = template.content;\n    const svgElement = content.firstChild!;\n    content.removeChild(svgElement);\n    reparentNodes(content, svgElement.firstChild);\n    return template;\n  }\n}\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isDirective} from './directive.js';\nimport {removeNodes} from './dom.js';\nimport {noChange, nothing, Part} from './part.js';\nimport {RenderOptions} from './render-options.js';\nimport {TemplateInstance} from './template-instance.js';\nimport {TemplateResult} from './template-result.js';\nimport {createMarker} from './template.js';\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\nexport type Primitive = null|undefined|boolean|number|string|symbol|bigint;\nexport const isPrimitive = (value: unknown): value is Primitive => {\n  return (\n      value === null ||\n      !(typeof value === 'object' || typeof value === 'function'));\n};\nexport const isIterable = (value: unknown): value is Iterable<unknown> => {\n  return Array.isArray(value) ||\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      !!(value && (value as any)[Symbol.iterator]);\n};\n\n/**\n * Writes attribute values to the DOM for a group of AttributeParts bound to a\n * single attribute. The value is only set once even if there are multiple parts\n * for an attribute.\n */\nexport class AttributeCommitter {\n  readonly element: Element;\n  readonly name: string;\n  readonly strings: ReadonlyArray<string>;\n  readonly parts: ReadonlyArray<AttributePart>;\n  dirty = true;\n\n  constructor(element: Element, name: string, strings: ReadonlyArray<string>) {\n    this.element = element;\n    this.name = name;\n    this.strings = strings;\n    this.parts = [];\n    for (let i = 0; i < strings.length - 1; i++) {\n      (this.parts as AttributePart[])[i] = this._createPart();\n    }\n  }\n\n  /**\n   * Creates a single part. Override this to create a differnt type of part.\n   */\n  protected _createPart(): AttributePart {\n    return new AttributePart(this);\n  }\n\n  protected _getValue(): unknown {\n    const strings = this.strings;\n    const l = strings.length - 1;\n    const parts = this.parts;\n\n    // If we're assigning an attribute via syntax like:\n    //    attr=\"${foo}\"  or  attr=${foo}\n    // but not\n    //    attr=\"${foo} ${bar}\" or attr=\"${foo} baz\"\n    // then we don't want to coerce the attribute value into one long\n    // string. Instead we want to just return the value itself directly,\n    // so that sanitizeDOMValue can get the actual value rather than\n    // String(value)\n    // The exception is if v is an array, in which case we do want to smash\n    // it together into a string without calling String() on the array.\n    //\n    // This also allows trusted values (when using TrustedTypes) being\n    // assigned to DOM sinks without being stringified in the process.\n    if (l === 1 && strings[0] === '' && strings[1] === '') {\n      const v = parts[0].value;\n      if (typeof v === 'symbol') {\n        return String(v);\n      }\n      if (typeof v === 'string' || !isIterable(v)) {\n        return v;\n      }\n    }\n    let text = '';\n\n    for (let i = 0; i < l; i++) {\n      text += strings[i];\n      const part = parts[i];\n      if (part !== undefined) {\n        const v = part.value;\n        if (isPrimitive(v) || !isIterable(v)) {\n          text += typeof v === 'string' ? v : String(v);\n        } else {\n          for (const t of v) {\n            text += typeof t === 'string' ? t : String(t);\n          }\n        }\n      }\n    }\n\n    text += strings[l];\n    return text;\n  }\n\n  commit(): void {\n    if (this.dirty) {\n      this.dirty = false;\n      this.element.setAttribute(this.name, this._getValue() as string);\n    }\n  }\n}\n\n/**\n * A Part that controls all or part of an attribute value.\n */\nexport class AttributePart implements Part {\n  readonly committer: AttributeCommitter;\n  value: unknown = undefined;\n\n  constructor(committer: AttributeCommitter) {\n    this.committer = committer;\n  }\n\n  setValue(value: unknown): void {\n    if (value !== noChange && (!isPrimitive(value) || value !== this.value)) {\n      this.value = value;\n      // If the value is a not a directive, dirty the committer so that it'll\n      // call setAttribute. If the value is a directive, it'll dirty the\n      // committer if it calls setValue().\n      if (!isDirective(value)) {\n        this.committer.dirty = true;\n      }\n    }\n  }\n\n  commit() {\n    while (isDirective(this.value)) {\n      const directive = this.value;\n      this.value = noChange;\n      directive(this);\n    }\n    if (this.value === noChange) {\n      return;\n    }\n    this.committer.commit();\n  }\n}\n\n/**\n * A Part that controls a location within a Node tree. Like a Range, NodePart\n * has start and end locations and can set and update the Nodes between those\n * locations.\n *\n * NodeParts support several value types: primitives, Nodes, TemplateResults,\n * as well as arrays and iterables of those types.\n */\nexport class NodePart implements Part {\n  readonly options: RenderOptions;\n  startNode!: Node;\n  endNode!: Node;\n  value: unknown = undefined;\n  private __pendingValue: unknown = undefined;\n\n  constructor(options: RenderOptions) {\n    this.options = options;\n  }\n\n  /**\n   * Appends this part into a container.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  appendInto(container: Node) {\n    this.startNode = container.appendChild(createMarker());\n    this.endNode = container.appendChild(createMarker());\n  }\n\n  /**\n   * Inserts this part after the `ref` node (between `ref` and `ref`'s next\n   * sibling). Both `ref` and its next sibling must be static, unchanging nodes\n   * such as those that appear in a literal section of a template.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  insertAfterNode(ref: Node) {\n    this.startNode = ref;\n    this.endNode = ref.nextSibling!;\n  }\n\n  /**\n   * Appends this part into a parent part.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  appendIntoPart(part: NodePart) {\n    part.__insert(this.startNode = createMarker());\n    part.__insert(this.endNode = createMarker());\n  }\n\n  /**\n   * Inserts this part after the `ref` part.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  insertAfterPart(ref: NodePart) {\n    ref.__insert(this.startNode = createMarker());\n    this.endNode = ref.endNode;\n    ref.endNode = this.startNode;\n  }\n\n  setValue(value: unknown): void {\n    this.__pendingValue = value;\n  }\n\n  commit() {\n    if (this.startNode.parentNode === null) {\n      return;\n    }\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange;\n      directive(this);\n    }\n    const value = this.__pendingValue;\n    if (value === noChange) {\n      return;\n    }\n    if (isPrimitive(value)) {\n      if (value !== this.value) {\n        this.__commitText(value);\n      }\n    } else if (value instanceof TemplateResult) {\n      this.__commitTemplateResult(value);\n    } else if (value instanceof Node) {\n      this.__commitNode(value);\n    } else if (isIterable(value)) {\n      this.__commitIterable(value);\n    } else if (value === nothing) {\n      this.value = nothing;\n      this.clear();\n    } else {\n      // Fallback, will render the string representation\n      this.__commitText(value);\n    }\n  }\n\n  private __insert(node: Node) {\n    this.endNode.parentNode!.insertBefore(node, this.endNode);\n  }\n\n  private __commitNode(value: Node): void {\n    if (this.value === value) {\n      return;\n    }\n    this.clear();\n    this.__insert(value);\n    this.value = value;\n  }\n\n  private __commitText(value: unknown): void {\n    const node = this.startNode.nextSibling!;\n    value = value == null ? '' : value;\n    // If `value` isn't already a string, we explicitly convert it here in case\n    // it can't be implicitly converted - i.e. it's a symbol.\n    const valueAsString: string =\n        typeof value === 'string' ? value : String(value);\n    if (node === this.endNode.previousSibling &&\n        node.nodeType === 3 /* Node.TEXT_NODE */) {\n      // If we only have a single text node between the markers, we can just\n      // set its value, rather than replacing it.\n      // TODO(justinfagnani): Can we just check if this.value is primitive?\n      (node as Text).data = valueAsString;\n    } else {\n      this.__commitNode(document.createTextNode(valueAsString));\n    }\n    this.value = value;\n  }\n\n  private __commitTemplateResult(value: TemplateResult): void {\n    const template = this.options.templateFactory(value);\n    if (this.value instanceof TemplateInstance &&\n        this.value.template === template) {\n      this.value.update(value.values);\n    } else {\n      // Make sure we propagate the template processor from the TemplateResult\n      // so that we use its syntax extension, etc. The template factory comes\n      // from the render function options so that it can control template\n      // caching and preprocessing.\n      const instance =\n          new TemplateInstance(template, value.processor, this.options);\n      const fragment = instance._clone();\n      instance.update(value.values);\n      this.__commitNode(fragment);\n      this.value = instance;\n    }\n  }\n\n  private __commitIterable(value: Iterable<unknown>): void {\n    // For an Iterable, we create a new InstancePart per item, then set its\n    // value to the item. This is a little bit of overhead for every item in\n    // an Iterable, but it lets us recurse easily and efficiently update Arrays\n    // of TemplateResults that will be commonly returned from expressions like:\n    // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n    // If _value is an array, then the previous render was of an\n    // iterable and _value will contain the NodeParts from the previous\n    // render. If _value is not an array, clear this part and make a new\n    // array for NodeParts.\n    if (!Array.isArray(this.value)) {\n      this.value = [];\n      this.clear();\n    }\n\n    // Lets us keep track of how many items we stamped so we can clear leftover\n    // items from a previous render\n    const itemParts = this.value as NodePart[];\n    let partIndex = 0;\n    let itemPart: NodePart|undefined;\n\n    for (const item of value) {\n      // Try to reuse an existing part\n      itemPart = itemParts[partIndex];\n\n      // If no existing part, create a new one\n      if (itemPart === undefined) {\n        itemPart = new NodePart(this.options);\n        itemParts.push(itemPart);\n        if (partIndex === 0) {\n          itemPart.appendIntoPart(this);\n        } else {\n          itemPart.insertAfterPart(itemParts[partIndex - 1]);\n        }\n      }\n      itemPart.setValue(item);\n      itemPart.commit();\n      partIndex++;\n    }\n\n    if (partIndex < itemParts.length) {\n      // Truncate the parts array so _value reflects the current state\n      itemParts.length = partIndex;\n      this.clear(itemPart && itemPart.endNode);\n    }\n  }\n\n  clear(startNode: Node = this.startNode) {\n    removeNodes(\n        this.startNode.parentNode!, startNode.nextSibling!, this.endNode);\n  }\n}\n\n/**\n * Implements a boolean attribute, roughly as defined in the HTML\n * specification.\n *\n * If the value is truthy, then the attribute is present with a value of\n * ''. If the value is falsey, the attribute is removed.\n */\nexport class BooleanAttributePart implements Part {\n  readonly element: Element;\n  readonly name: string;\n  readonly strings: readonly string[];\n  value: unknown = undefined;\n  private __pendingValue: unknown = undefined;\n\n  constructor(element: Element, name: string, strings: readonly string[]) {\n    if (strings.length !== 2 || strings[0] !== '' || strings[1] !== '') {\n      throw new Error(\n          'Boolean attributes can only contain a single expression');\n    }\n    this.element = element;\n    this.name = name;\n    this.strings = strings;\n  }\n\n  setValue(value: unknown): void {\n    this.__pendingValue = value;\n  }\n\n  commit() {\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange;\n      directive(this);\n    }\n    if (this.__pendingValue === noChange) {\n      return;\n    }\n    const value = !!this.__pendingValue;\n    if (this.value !== value) {\n      if (value) {\n        this.element.setAttribute(this.name, '');\n      } else {\n        this.element.removeAttribute(this.name);\n      }\n      this.value = value;\n    }\n    this.__pendingValue = noChange;\n  }\n}\n\n/**\n * Sets attribute values for PropertyParts, so that the value is only set once\n * even if there are multiple parts for a property.\n *\n * If an expression controls the whole property value, then the value is simply\n * assigned to the property under control. If there are string literals or\n * multiple expressions, then the strings are expressions are interpolated into\n * a string first.\n */\nexport class PropertyCommitter extends AttributeCommitter {\n  readonly single: boolean;\n\n  constructor(element: Element, name: string, strings: ReadonlyArray<string>) {\n    super(element, name, strings);\n    this.single =\n        (strings.length === 2 && strings[0] === '' && strings[1] === '');\n  }\n\n  protected _createPart(): PropertyPart {\n    return new PropertyPart(this);\n  }\n\n  protected _getValue() {\n    if (this.single) {\n      return this.parts[0].value;\n    }\n    return super._getValue();\n  }\n\n  commit(): void {\n    if (this.dirty) {\n      this.dirty = false;\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      (this.element as any)[this.name] = this._getValue();\n    }\n  }\n}\n\nexport class PropertyPart extends AttributePart {}\n\n// Detect event listener options support. If the `capture` property is read\n// from the options object, then options are supported. If not, then the third\n// argument to add/removeEventListener is interpreted as the boolean capture\n// value so we should only pass the `capture` property.\nlet eventOptionsSupported = false;\n\n// Wrap into an IIFE because MS Edge <= v41 does not support having try/catch\n// blocks right into the body of a module\n(() => {\n  try {\n    const options = {\n      get capture() {\n        eventOptionsSupported = true;\n        return false;\n      }\n    };\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    window.addEventListener('test', options as any, options);\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    window.removeEventListener('test', options as any, options);\n  } catch (_e) {\n    // event options not supported\n  }\n})();\n\ntype EventHandlerWithOptions =\n    EventListenerOrEventListenerObject&Partial<AddEventListenerOptions>;\nexport class EventPart implements Part {\n  readonly element: Element;\n  readonly eventName: string;\n  readonly eventContext?: EventTarget;\n  value: undefined|EventHandlerWithOptions = undefined;\n  private __options?: AddEventListenerOptions;\n  private __pendingValue: undefined|EventHandlerWithOptions = undefined;\n  private readonly __boundHandleEvent: (event: Event) => void;\n\n  constructor(element: Element, eventName: string, eventContext?: EventTarget) {\n    this.element = element;\n    this.eventName = eventName;\n    this.eventContext = eventContext;\n    this.__boundHandleEvent = (e) => this.handleEvent(e);\n  }\n\n  setValue(value: undefined|EventHandlerWithOptions): void {\n    this.__pendingValue = value;\n  }\n\n  commit() {\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange as EventHandlerWithOptions;\n      directive(this);\n    }\n    if (this.__pendingValue === noChange) {\n      return;\n    }\n\n    const newListener = this.__pendingValue;\n    const oldListener = this.value;\n    const shouldRemoveListener = newListener == null ||\n        oldListener != null &&\n            (newListener.capture !== oldListener.capture ||\n             newListener.once !== oldListener.once ||\n             newListener.passive !== oldListener.passive);\n    const shouldAddListener =\n        newListener != null && (oldListener == null || shouldRemoveListener);\n\n    if (shouldRemoveListener) {\n      this.element.removeEventListener(\n          this.eventName, this.__boundHandleEvent, this.__options);\n    }\n    if (shouldAddListener) {\n      this.__options = getOptions(newListener);\n      this.element.addEventListener(\n          this.eventName, this.__boundHandleEvent, this.__options);\n    }\n    this.value = newListener;\n    this.__pendingValue = noChange as EventHandlerWithOptions;\n  }\n\n  handleEvent(event: Event) {\n    if (typeof this.value === 'function') {\n      this.value.call(this.eventContext || this.element, event);\n    } else {\n      (this.value as EventListenerObject).handleEvent(event);\n    }\n  }\n}\n\n// We copy options because of the inconsistent behavior of browsers when reading\n// the third argument of add/removeEventListener. IE11 doesn't support options\n// at all. Chrome 41 only reads `capture` if the argument is an object.\nconst getOptions = (o: AddEventListenerOptions|undefined) => o &&\n    (eventOptionsSupported ?\n         {capture: o.capture, passive: o.passive, once: o.once} :\n         o.capture as AddEventListenerOptions);\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {Part} from './part.js';\nimport {AttributeCommitter, BooleanAttributePart, EventPart, NodePart, PropertyCommitter} from './parts.js';\nimport {RenderOptions} from './render-options.js';\nimport {TemplateProcessor} from './template-processor.js';\n\n/**\n * Creates Parts when a template is instantiated.\n */\nexport class DefaultTemplateProcessor implements TemplateProcessor {\n  /**\n   * Create parts for an attribute-position binding, given the event, attribute\n   * name, and string literals.\n   *\n   * @param element The element containing the binding\n   * @param name  The attribute name\n   * @param strings The string literals. There are always at least two strings,\n   *   event for fully-controlled bindings with a single expression.\n   */\n  handleAttributeExpressions(\n      element: Element, name: string, strings: string[],\n      options: RenderOptions): ReadonlyArray<Part> {\n    const prefix = name[0];\n    if (prefix === '.') {\n      const committer = new PropertyCommitter(element, name.slice(1), strings);\n      return committer.parts;\n    }\n    if (prefix === '@') {\n      return [new EventPart(element, name.slice(1), options.eventContext)];\n    }\n    if (prefix === '?') {\n      return [new BooleanAttributePart(element, name.slice(1), strings)];\n    }\n    const committer = new AttributeCommitter(element, name, strings);\n    return committer.parts;\n  }\n  /**\n   * Create parts for a text-position binding.\n   * @param templateFactory\n   */\n  handleTextExpression(options: RenderOptions) {\n    return new NodePart(options);\n  }\n}\n\nexport const defaultTemplateProcessor = new DefaultTemplateProcessor();\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {TemplateResult} from './template-result.js';\nimport {marker, Template} from './template.js';\n\n/**\n * A function type that creates a Template from a TemplateResult.\n *\n * This is a hook into the template-creation process for rendering that\n * requires some modification of templates before they're used, like ShadyCSS,\n * which must add classes to elements and remove styles.\n *\n * Templates should be cached as aggressively as possible, so that many\n * TemplateResults produced from the same expression only do the work of\n * creating the Template the first time.\n *\n * Templates are usually cached by TemplateResult.strings and\n * TemplateResult.type, but may be cached by other keys if this function\n * modifies the template.\n *\n * Note that currently TemplateFactories must not add, remove, or reorder\n * expressions, because there is no way to describe such a modification\n * to render() so that values are interpolated to the correct place in the\n * template instances.\n */\nexport type TemplateFactory = (result: TemplateResult) => Template;\n\n/**\n * The default TemplateFactory which caches Templates keyed on\n * result.type and result.strings.\n */\nexport function templateFactory(result: TemplateResult) {\n  let templateCache = templateCaches.get(result.type);\n  if (templateCache === undefined) {\n    templateCache = {\n      stringsArray: new WeakMap<TemplateStringsArray, Template>(),\n      keyString: new Map<string, Template>()\n    };\n    templateCaches.set(result.type, templateCache);\n  }\n\n  let template = templateCache.stringsArray.get(result.strings);\n  if (template !== undefined) {\n    return template;\n  }\n\n  // If the TemplateStringsArray is new, generate a key from the strings\n  // This key is shared between all templates with identical content\n  const key = result.strings.join(marker);\n\n  // Check if we already have a Template for this key\n  template = templateCache.keyString.get(key);\n  if (template === undefined) {\n    // If we have not seen this key before, create a new Template\n    template = new Template(result, result.getTemplateElement());\n    // Cache the Template for this key\n    templateCache.keyString.set(key, template);\n  }\n\n  // Cache all future queries for this TemplateStringsArray\n  templateCache.stringsArray.set(result.strings, template);\n  return template;\n}\n\n/**\n * The first argument to JS template tags retain identity across multiple\n * calls to a tag for the same literal, so we can cache work done per literal\n * in a Map.\n *\n * Safari currently has a bug which occasionally breaks this behavior, so we\n * need to cache the Template at two levels. We first cache the\n * TemplateStringsArray, and if that fails, we cache a key constructed by\n * joining the strings array.\n */\nexport interface TemplateCache {\n  readonly stringsArray: WeakMap<TemplateStringsArray, Template>;\n  readonly keyString: Map<string, Template>;\n}\n\nexport const templateCaches = new Map<string, TemplateCache>();\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {removeNodes} from './dom.js';\nimport {NodePart} from './parts.js';\nimport {RenderOptions} from './render-options.js';\nimport {templateFactory} from './template-factory.js';\n\nexport const parts = new WeakMap<Node, NodePart>();\n\n/**\n * Renders a template result or other value to a container.\n *\n * To update a container with new values, reevaluate the template literal and\n * call `render` with the new result.\n *\n * @param result Any value renderable by NodePart - typically a TemplateResult\n *     created by evaluating a template tag like `html` or `svg`.\n * @param container A DOM parent to render to. The entire contents are either\n *     replaced, or efficiently updated if the same result type was previous\n *     rendered there.\n * @param options RenderOptions for the entire render tree rendered to this\n *     container. Render options must *not* change between renders to the same\n *     container, as those changes will not effect previously rendered DOM.\n */\nexport const render =\n    (result: unknown,\n     container: Element|DocumentFragment,\n     options?: Partial<RenderOptions>) => {\n      let part = parts.get(container);\n      if (part === undefined) {\n        removeNodes(container, container.firstChild);\n        parts.set(container, part = new NodePart({\n                               templateFactory,\n                               ...options,\n                             }));\n        part.appendInto(container);\n      }\n      part.setValue(result);\n      part.commit();\n    };\n", "/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n *\n * Main lit-html module.\n *\n * Main exports:\n *\n * -  [[html]]\n * -  [[svg]]\n * -  [[render]]\n *\n * @packageDocumentation\n */\n\n/**\n * Do not remove this comment; it keeps typedoc from misplacing the module\n * docs.\n */\nimport {defaultTemplateProcessor} from './lib/default-template-processor.js';\nimport {SVGTemplateResult, TemplateResult} from './lib/template-result.js';\n\nexport {DefaultTemplateProcessor, defaultTemplateProcessor} from './lib/default-template-processor.js';\nexport {directive, DirectiveFn, isDirective} from './lib/directive.js';\n// TODO(justinfagnani): remove line when we get NodePart moving methods\nexport {removeNodes, reparentNodes} from './lib/dom.js';\nexport {noChange, nothing, Part} from './lib/part.js';\nexport {AttributeCommitter, AttributePart, BooleanAttributePart, EventPart, isIterable, isPrimitive, NodePart, PropertyCommitter, PropertyPart} from './lib/parts.js';\nexport {RenderOptions} from './lib/render-options.js';\nexport {parts, render} from './lib/render.js';\nexport {templateCaches, templateFactory} from './lib/template-factory.js';\nexport {TemplateInstance} from './lib/template-instance.js';\nexport {TemplateProcessor} from './lib/template-processor.js';\nexport {SVGTemplateResult, TemplateResult} from './lib/template-result.js';\nexport {createMarker, isTemplatePartActive, Template} from './lib/template.js';\n\ndeclare global {\n  interface Window {\n    litHtmlVersions: string[];\n  }\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n// TODO(justinfagnani): inject version number at build time\nif (typeof window !== 'undefined') {\n  (window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.4.1');\n}\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n */\nexport const html = (strings: TemplateStringsArray, ...values: unknown[]) =>\n    new TemplateResult(strings, values, 'html', defaultTemplateProcessor);\n\n/**\n * Interprets a template literal as an SVG template that can efficiently\n * render to and update a container.\n */\nexport const svg = (strings: TemplateStringsArray, ...values: unknown[]) =>\n    new SVGTemplateResult(strings, values, 'svg', defaultTemplateProcessor);\n", "import { setCurrent, clear } from './interface.js';\nimport { hookSymbol, effectsSymbol, layoutEffectsSymbol } from './symbols.js';\nclass State {\n    constructor(update, host) {\n        this.update = update;\n        this.host = host;\n        this[hookSymbol] = new Map();\n        this[effectsSymbol] = [];\n        this[layoutEffectsSymbol] = [];\n    }\n    run(cb) {\n        setCurrent(this);\n        let res = cb();\n        clear();\n        return res;\n    }\n    _runEffects(phase) {\n        let effects = this[phase];\n        setCurrent(this);\n        for (let effect of effects) {\n            effect.call(this);\n        }\n        clear();\n    }\n    runEffects() {\n        this._runEffects(effectsSymbol);\n    }\n    runLayoutEffects() {\n        this._runEffects(layoutEffectsSymbol);\n    }\n    teardown() {\n        let hooks = this[hookSymbol];\n        hooks.forEach(hook => {\n            if (typeof hook.teardown === 'function') {\n                hook.teardown();\n            }\n        });\n    }\n}\nexport { State };\n", "import { State } from './state.js';\nimport { commitSymbol, phaseSymbol, updateSymbol, effectsSymbol, layoutEffectsSymbol } from './symbols.js';\nconst defer = Promise.resolve().then.bind(Promise.resolve());\nfunction runner() {\n    let tasks = [];\n    let id;\n    function runTasks() {\n        id = null;\n        let t = tasks;\n        tasks = [];\n        for (var i = 0, len = t.length; i < len; i++) {\n            t[i]();\n        }\n    }\n    return function (task) {\n        tasks.push(task);\n        if (id == null) {\n            id = defer(runTasks);\n        }\n    };\n}\nconst read = runner();\nconst write = runner();\nclass BaseScheduler {\n    constructor(renderer, host) {\n        this.renderer = renderer;\n        this.host = host;\n        this.state = new State(this.update.bind(this), host);\n        this[phaseSymbol] = null;\n        this._updateQueued = false;\n    }\n    update() {\n        if (this._updateQueued)\n            return;\n        read(() => {\n            let result = this.handlePhase(updateSymbol);\n            write(() => {\n                this.handlePhase(commitSymbol, result);\n                write(() => {\n                    this.handlePhase(effectsSymbol);\n                });\n            });\n            this._updateQueued = false;\n        });\n        this._updateQueued = true;\n    }\n    handlePhase(phase, arg) {\n        this[phaseSymbol] = phase;\n        switch (phase) {\n            case commitSymbol:\n                this.commit(arg);\n                this.runEffects(layoutEffectsSymbol);\n                return;\n            case updateSymbol: return this.render();\n            case effectsSymbol: return this.runEffects(effectsSymbol);\n        }\n        this[phaseSymbol] = null;\n    }\n    render() {\n        return this.state.run(() => this.renderer.call(this.host, this.host));\n    }\n    runEffects(phase) {\n        this.state._runEffects(phase);\n    }\n    teardown() {\n        this.state.teardown();\n    }\n}\nexport { BaseScheduler };\n", "import { BaseScheduler } from './scheduler.js';\nconst toCamelCase = (val = '') => val.replace(/-+([a-z])?/g, (_, char) => char ? char.toUpperCase() : '');\nfunction makeComponent(render) {\n    class Scheduler extends BaseScheduler {\n        constructor(renderer, frag, host) {\n            super(renderer, host || frag);\n            this.frag = frag;\n        }\n        commit(result) {\n            render(result, this.frag);\n        }\n    }\n    function component(renderer, baseElementOrOptions, options) {\n        const BaseElement = (options || baseElementOrOptions || {}).baseElement || HTMLElement;\n        const { observedAttributes = [], useShadowDOM = true, shadowRootInit = {} } = options || baseElementOrOptions || {};\n        class Element extends BaseElement {\n            constructor() {\n                super();\n                if (useShadowDOM === false) {\n                    this._scheduler = new Scheduler(renderer, this);\n                }\n                else {\n                    this.attachShadow({ mode: 'open', ...shadowRootInit });\n                    this._scheduler = new Scheduler(renderer, this.shadowRoot, this);\n                }\n            }\n            static get observedAttributes() {\n                return renderer.observedAttributes || observedAttributes || [];\n            }\n            connectedCallback() {\n                this._scheduler.update();\n            }\n            disconnectedCallback() {\n                this._scheduler.teardown();\n            }\n            attributeChangedCallback(name, oldValue, newValue) {\n                if (oldValue === newValue) {\n                    return;\n                }\n                let val = newValue === '' ? true : newValue;\n                Reflect.set(this, toCamelCase(name), val);\n            }\n        }\n        ;\n        function reflectiveProp(initialValue) {\n            let value = initialValue;\n            let isSetup = false;\n            return Object.freeze({\n                enumerable: true,\n                configurable: true,\n                get() {\n                    return value;\n                },\n                set(newValue) {\n                    // Avoid scheduling update when prop value hasn't changed\n                    if (isSetup && value === newValue)\n                        return;\n                    isSetup = true;\n                    value = newValue;\n                    this._scheduler.update();\n                }\n            });\n        }\n        const proto = new Proxy(BaseElement.prototype, {\n            getPrototypeOf(target) {\n                return target;\n            },\n            set(target, key, value, receiver) {\n                let desc;\n                if (key in target) {\n                    desc = Object.getOwnPropertyDescriptor(target, key);\n                    if (desc && desc.set) {\n                        desc.set.call(receiver, value);\n                        return true;\n                    }\n                    Reflect.set(target, key, value, receiver);\n                    return true;\n                }\n                if (typeof key === 'symbol' || key[0] === '_') {\n                    desc = {\n                        enumerable: true,\n                        configurable: true,\n                        writable: true,\n                        value\n                    };\n                }\n                else {\n                    desc = reflectiveProp(value);\n                }\n                Object.defineProperty(receiver, key, desc);\n                if (desc.set) {\n                    desc.set.call(receiver, value);\n                }\n                return true;\n            }\n        });\n        Object.setPrototypeOf(Element.prototype, proto);\n        return Element;\n    }\n    return component;\n}\nexport { makeComponent };\n", "import { effectsSymbol } from './symbols.js';\nimport { createEffect } from './create-effect.js';\nfunction setEffects(state, cb) {\n    state[effectsSymbol].push(cb);\n}\nconst useEffect = createEffect(setEffects);\nexport { setEffects, useEffect };\n", "import { hook, Hook } from './hook.js';\nimport { contextEvent } from './symbols.js';\nimport { setEffects } from './use-effect.js';\nconst useContext = hook(class extends Hook {\n    constructor(id, state, _) {\n        super(id, state);\n        this._updater = this._updater.bind(this);\n        this._ranEffect = false;\n        this._unsubscribe = null;\n        setEffects(state, this);\n    }\n    update(Context) {\n        if (this.state.virtual) {\n            throw new Error('can\\'t be used with virtual components');\n        }\n        if (this.Context !== Context) {\n            this._subscribe(Context);\n            this.Context = Context;\n        }\n        return this.value;\n    }\n    call() {\n        if (!this._ranEffect) {\n            this._ranEffect = true;\n            if (this._unsubscribe)\n                this._unsubscribe();\n            this._subscribe(this.Context);\n            this.state.update();\n        }\n    }\n    _updater(value) {\n        this.value = value;\n        this.state.update();\n    }\n    _subscribe(Context) {\n        const detail = { Context, callback: this._updater };\n        this.state.host.dispatchEvent(new CustomEvent(contextEvent, {\n            detail,\n            bubbles: true,\n            cancelable: true,\n            composed: true,\n        }));\n        const { unsubscribe = null, value } = detail;\n        this.value = unsubscribe ? value : Context.defaultValue;\n        this._unsubscribe = unsubscribe;\n    }\n    teardown() {\n        if (this._unsubscribe) {\n            this._unsubscribe();\n        }\n    }\n});\nexport { useContext };\n", "import { contextEvent } from './symbols.js';\nimport { useContext } from './use-context.js';\nfunction makeContext(component) {\n    return (defaultValue) => {\n        const Context = {\n            Provider: class extends HTMLElement {\n                constructor() {\n                    super();\n                    this.listeners = new Set();\n                    this.addEventListener(contextEvent, this);\n                }\n                disconnectedCallback() {\n                    this.removeEventListener(contextEvent, this);\n                }\n                handleEvent(event) {\n                    const { detail } = event;\n                    if (detail.Context === Context) {\n                        detail.value = this.value;\n                        detail.unsubscribe = this.unsubscribe.bind(this, detail.callback);\n                        this.listeners.add(detail.callback);\n                        event.stopPropagation();\n                    }\n                }\n                unsubscribe(callback) {\n                    this.listeners.delete(callback);\n                }\n                set value(value) {\n                    this._value = value;\n                    for (let callback of this.listeners) {\n                        callback(value);\n                    }\n                }\n                get value() {\n                    return this._value;\n                }\n            },\n            Consumer: component(function ({ render }) {\n                const context = useContext(Context);\n                return render(context);\n            }),\n            defaultValue,\n        };\n        return Context;\n    };\n}\nexport { makeContext };\n", "import { hook, Hook } from './hook.js';\nconst useMemo = hook(class extends Hook {\n    constructor(id, state, fn, values) {\n        super(id, state);\n        this.value = fn();\n        this.values = values;\n    }\n    update(fn, values) {\n        if (this.hasChanged(values)) {\n            this.values = values;\n            this.value = fn();\n        }\n        return this.value;\n    }\n    hasChanged(values = []) {\n        return values.some((value, i) => this.values[i] !== value);\n    }\n});\nexport { useMemo };\n", "import { useMemo } from './use-memo.js';\nconst useCallback = (fn, inputs) => useMemo(() => fn, inputs);\nexport { useCallback };\n", "import { hook, Hook } from './hook.js';\nconst useReducer = hook(class extends Hook {\n    constructor(id, state, _, initialState, init) {\n        super(id, state);\n        this.dispatch = this.dispatch.bind(this);\n        this.currentState = init !== undefined ? init(initialState) : initialState;\n    }\n    update(reducer) {\n        this.reducer = reducer;\n        return [this.currentState, this.dispatch];\n    }\n    dispatch(action) {\n        this.currentState = this.reducer(this.currentState, action);\n        this.state.update();\n    }\n});\nexport { useReducer };\n", "import { useMemo } from './use-memo.js';\nconst useRef = (initialValue) => useMemo(() => ({\n    current: initialValue\n}), []);\nexport { useRef };\n", "import { makeComponent } from './component.js';\nimport { makeContext } from './create-context.js';\nfunction haunted({ render }) {\n    const component = makeComponent(render);\n    const createContext = makeContext(component);\n    return { component, createContext };\n}\nexport { haunted as default };\nexport { useCallback } from './use-callback.js';\nexport { useController } from './use-controller.js';\nexport { useEffect } from './use-effect.js';\nexport { useLayoutEffect } from './use-layout-effect.js';\nexport { useState } from './use-state.js';\nexport { useReducer } from './use-reducer.js';\nexport { useMemo } from './use-memo.js';\nexport { useContext } from './use-context.js';\nexport { useRef } from './use-ref.js';\nexport { hook, Hook } from './hook.js';\nexport { BaseScheduler } from './scheduler.js';\nexport { State } from './state.js';\n", "import { directive } from 'lit-html';\nimport { BaseScheduler } from './scheduler.js';\nconst includes = Array.prototype.includes;\nfunction makeVirtual() {\n    const partToScheduler = new WeakMap();\n    const schedulerToPart = new WeakMap();\n    class Scheduler extends BaseScheduler {\n        constructor(renderer, part) {\n            super(renderer, part);\n            this.state.virtual = true;\n        }\n        render() {\n            return this.state.run(() => this.renderer.apply(this.host, this.args));\n        }\n        commit(result) {\n            this.host.setValue(result);\n            this.host.commit();\n        }\n        teardown() {\n            super.teardown();\n            let part = schedulerToPart.get(this);\n            partToScheduler.delete(part);\n        }\n    }\n    function virtual(renderer) {\n        function factory(...args) {\n            return (part) => {\n                let cont = partToScheduler.get(part);\n                if (!cont) {\n                    cont = new Scheduler(renderer, part);\n                    partToScheduler.set(part, cont);\n                    schedulerToPart.set(cont, part);\n                    teardownOnRemove(cont, part);\n                }\n                cont.args = args;\n                cont.update();\n            };\n        }\n        return directive(factory);\n    }\n    return virtual;\n}\nfunction teardownOnRemove(cont, part, node = part.startNode) {\n    let frag = node.parentNode;\n    let mo = new MutationObserver(mutations => {\n        for (let mutation of mutations) {\n            if (includes.call(mutation.removedNodes, node)) {\n                mo.disconnect();\n                if (node.parentNode instanceof ShadowRoot) {\n                    teardownOnRemove(cont, part);\n                }\n                else {\n                    cont.teardown();\n                }\n                break;\n            }\n            else if (includes.call(mutation.addedNodes, node.nextSibling)) {\n                mo.disconnect();\n                teardownOnRemove(cont, part, node.nextSibling || undefined);\n                break;\n            }\n        }\n    });\n    mo.observe(frag, { childList: true });\n}\nexport { makeVirtual };\n", "import { html, render } from 'lit-html';\nimport haunted from './core.js';\nimport { makeVirtual } from './virtual.js';\nconst { component, createContext } = haunted({ render });\nconst virtual = makeVirtual();\nexport { component, createContext, virtual, html, render };\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAeA,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,IAAC,UAAU,SAAS;AAChB,UAAI,OAAO,OAAO,WAAW,WAAW,SAAS,OAAO,SAAS,WAAW,OAAO,OAAO,SAAS,WAAW,OAAO;AACrH,UAAI,OAAO,WAAW,cAAc,OAAO,KAAK;AAC5C,eAAO,SAAS,CAAC,YAAY,SAAU,UAAS;AAAE,kBAAQ,eAAe,MAAM,eAAe;AAAA;AAAA,iBAEzF,OAAO,WAAW,YAAY,OAAO,OAAO,YAAY,UAAU;AACvE,gBAAQ,eAAe,MAAM,eAAe,OAAO;AAAA,aAElD;AACD,gBAAQ,eAAe;AAAA;AAE3B,8BAAwB,UAAS,UAAU;AACvC,YAAI,aAAY,MAAM;AAClB,cAAI,OAAO,OAAO,WAAW,YAAY;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