@fluid-topics/ft-reader-content 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-reader-content.min.js +14 -14
- package/package.json +7 -7
|
@@ -12,38 +12,38 @@
|
|
|
12
12
|
* subject to an additional IP rights grant found at
|
|
13
13
|
* http://polymer.github.io/PATENTS.txt
|
|
14
14
|
*/
|
|
15
|
-
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,o=window.customElements.define,e=window.customElements.get,r=window.customElements,i=new WeakMap,n=new WeakMap,s=new WeakMap,a=new WeakMap;let c;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,i){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(i))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const a=i.prototype.attributeChangedCallback,c=new Set(i.observedAttributes||[]);p(i,c,a);const l={elementClass:i,connectedCallback:i.prototype.connectedCallback,disconnectedCallback:i.prototype.disconnectedCallback,adoptedCallback:i.prototype.adoptedCallback,attributeChangedCallback:a,formAssociated:i.formAssociated,formAssociatedCallback:i.prototype.formAssociatedCallback,formDisabledCallback:i.prototype.formDisabledCallback,formResetCallback:i.prototype.formResetCallback,formStateRestoreCallback:i.prototype.formStateRestoreCallback,observedAttributes:c};this._definitionsByTag.set(t,l),this._definitionsByClass.set(i,l);let h=e.call(r,t);h||(h=f(t),o.call(r,t,h)),this===window.customElements&&(s.set(i,l),l.standInClass=h);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)n.delete(t),u(t,l,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(i),this._whenDefinedPromises.delete(t)),i}upgrade(){g.push(this),r.upgrade.apply(r,arguments),g.pop()}get(t){const o=this._definitionsByTag.get(t);return o?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const o=this._getDefinition(t);if(void 0!==o)return Promise.resolve(o.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,o,e){let r=this._awaitingUpgrade.get(o);r||this._awaitingUpgrade.set(o,r=new Set),e?r.add(t):r.delete(t)}},window.HTMLElement=function(){let o=c;if(o)return c=void 0,o;const e=s.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return o=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(o,this.constructor.prototype),i.set(o,e),o},window.HTMLElement.prototype=t.prototype;const l=t=>t===document||t instanceof ShadowRoot,h=t=>{let o=t.getRootNode();if(!l(o)){const t=g[g.length-1];if(t instanceof CustomElementRegistry)return t;o=t.getRootNode(),l(o)||(o=a.get(o)?.getRootNode()||document)}return o.customElements},f=o=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const r=h(e)||window.customElements,i=r._getDefinition(o);return i?u(e,i):n.set(e,r),e}connectedCallback(){const t=i.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,o,!0)}disconnectedCallback(){const t=i.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,o,!1)}adoptedCallback(){const t=i.get(this);t?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=i.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=i.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=i.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=i.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},p=(t,o,e)=>{if(0===o.size||void 0===e)return;const r=t.prototype.setAttribute;r&&(t.prototype.setAttribute=function(t,i){const n=t.toLowerCase();if(o.has(n)){const t=this.getAttribute(n);r.call(this,n,i),e.call(this,n,t,i)}else r.call(this,n,i)});const i=t.prototype.removeAttribute;i&&(t.prototype.removeAttribute=function(t){const r=t.toLowerCase();if(o.has(r)){const t=this.getAttribute(r);i.call(this,r),e.call(this,r,t,null)}else i.call(this,r)});const n=t.prototype.toggleAttribute;n&&(t.prototype.toggleAttribute=function(t,r){const i=t.toLowerCase();if(o.has(i)){const t=this.getAttribute(i);n.call(this,i,r);const o=this.getAttribute(i);e.call(this,i,t,o)}else n.call(this,i,r)})},d=o=>{const e=Object.getPrototypeOf(o);if(e!==window.HTMLElement)return e===t?Object.setPrototypeOf(o,window.HTMLElement):d(e)},u=(t,o,e=!1)=>{Object.setPrototypeOf(t,o.elementClass.prototype),i.set(t,o),c=t;try{new o.elementClass}catch(t){d(o.elementClass),new o.elementClass}o.attributeChangedCallback&&o.observedAttributes.forEach((e=>{t.hasAttribute(e)&&o.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&o.connectedCallback&&t.isConnected&&o.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const o=y.apply(this,arguments);return t.customElements&&(o.customElements=t.customElements),o};let g=[document];const b=(t,o,e=void 0)=>{const r=(e?Object.getPrototypeOf(e):t.prototype)[o];t.prototype[o]=function(){g.push(this);const t=r.apply(e||this,arguments);return void 0!==t&&a.set(t,this),g.pop(),t}};b(ShadowRoot,"createElement",document),b(ShadowRoot,"importNode",document),b(Element,"insertAdjacentHTML");const m=(t,o)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,o);Object.defineProperty(t.prototype,o,{...e,set(t){g.push(this),e.set.call(this,t),g.pop()}})};if(m(Element,"innerHTML"),m(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,o=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const r=o.call(this,...e);return t.set(r,this),r},e.forEach((o=>{const e=window.ElementInternals.prototype,r=e[o];e[o]=function(...o){const e=t.get(this);if(!0===i.get(e).formAssociated)return r?.call(this,...o);throw new DOMException(`Failed to execute ${r} on 'ElementInternals': The target element is not a form-associated custom element.`)}}));class r extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const o=new Map;t.forEach(((t,e)=>{const r=t.getAttribute("name"),i=o.get(r)||[];this[+e]=t,i.push(t),o.set(r,i)})),this.length=t.length,o.forEach(((t,o)=>{t&&(1===t.length?this[o]=t[0]:this[o]=new r(t))}))}namedItem(t){return this[t]}}const s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=s.get.call(this,[]),o=[];for(const e of t){const t=i.get(e);t&&!0!==t.formAssociated||o.push(e)}return new n(o)}})}}try{window.customElements.define("custom-element",null)}catch(ce){const t=window.customElements.define;window.customElements.define=(o,e,r)=>{if(null!==e)try{t.bind(window.customElements)(o,e,r)}catch(t){console.info(o,e,r,t)}}}
|
|
15
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,o=window.customElements.define,e=window.customElements.get,r=window.customElements,i=new WeakMap,n=new WeakMap,s=new WeakMap,a=new WeakMap;let c;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,i){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(i))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const a=i.prototype.attributeChangedCallback,c=new Set(i.observedAttributes||[]);p(i,c,a);const l={elementClass:i,connectedCallback:i.prototype.connectedCallback,disconnectedCallback:i.prototype.disconnectedCallback,adoptedCallback:i.prototype.adoptedCallback,attributeChangedCallback:a,formAssociated:i.formAssociated,formAssociatedCallback:i.prototype.formAssociatedCallback,formDisabledCallback:i.prototype.formDisabledCallback,formResetCallback:i.prototype.formResetCallback,formStateRestoreCallback:i.prototype.formStateRestoreCallback,observedAttributes:c};this._definitionsByTag.set(t,l),this._definitionsByClass.set(i,l);let h=e.call(r,t);h||(h=f(t),o.call(r,t,h)),this===window.customElements&&(s.set(i,l),l.standInClass=h);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)n.delete(t),u(t,l,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(i),this._whenDefinedPromises.delete(t)),i}upgrade(){g.push(this),r.upgrade.apply(r,arguments),g.pop()}get(t){const o=this._definitionsByTag.get(t);return o?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const o=this._getDefinition(t);if(void 0!==o)return Promise.resolve(o.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,o,e){let r=this._awaitingUpgrade.get(o);r||this._awaitingUpgrade.set(o,r=new Set),e?r.add(t):r.delete(t)}},window.HTMLElement=function(){let o=c;if(o)return c=void 0,o;const e=s.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return o=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(o,this.constructor.prototype),i.set(o,e),o},window.HTMLElement.prototype=t.prototype;const l=t=>t===document||t instanceof ShadowRoot,h=t=>{let o=t.getRootNode();if(!l(o)){const t=g[g.length-1];if(t instanceof CustomElementRegistry)return t;o=t.getRootNode(),l(o)||(o=a.get(o)?.getRootNode()||document)}return o.customElements},f=o=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const r=h(e)||window.customElements,i=r._getDefinition(o);return i?u(e,i):n.set(e,r),e}connectedCallback(){const t=i.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,o,!0)}disconnectedCallback(){const t=i.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,o,!1)}adoptedCallback(){const t=i.get(this);t?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=i.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=i.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=i.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=i.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},p=(t,o,e)=>{if(0===o.size||void 0===e)return;const r=t.prototype.setAttribute;r&&(t.prototype.setAttribute=function(t,i){const n=t.toLowerCase();if(o.has(n)){const t=this.getAttribute(n);r.call(this,n,i),e.call(this,n,t,i)}else r.call(this,n,i)});const i=t.prototype.removeAttribute;i&&(t.prototype.removeAttribute=function(t){const r=t.toLowerCase();if(o.has(r)){const t=this.getAttribute(r);i.call(this,r),e.call(this,r,t,null)}else i.call(this,r)});const n=t.prototype.toggleAttribute;n&&(t.prototype.toggleAttribute=function(t,r){const i=t.toLowerCase();if(o.has(i)){const t=this.getAttribute(i);n.call(this,i,r);const o=this.getAttribute(i);e.call(this,i,t,o)}else n.call(this,i,r)})},d=o=>{const e=Object.getPrototypeOf(o);if(e!==window.HTMLElement)return e===t?Object.setPrototypeOf(o,window.HTMLElement):d(e)},u=(t,o,e=!1)=>{Object.setPrototypeOf(t,o.elementClass.prototype),i.set(t,o),c=t;try{new o.elementClass}catch(t){d(o.elementClass),new o.elementClass}o.attributeChangedCallback&&o.observedAttributes.forEach((e=>{t.hasAttribute(e)&&o.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&o.connectedCallback&&t.isConnected&&o.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const o=y.apply(this,arguments);return t.customElements&&(o.customElements=t.customElements),o};let g=[document];const b=(t,o,e=void 0)=>{const r=(e?Object.getPrototypeOf(e):t.prototype)[o];t.prototype[o]=function(){g.push(this);const t=r.apply(e||this,arguments);return void 0!==t&&a.set(t,this),g.pop(),t}};b(ShadowRoot,"createElement",document),b(ShadowRoot,"importNode",document),b(Element,"insertAdjacentHTML");const m=(t,o)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,o);Object.defineProperty(t.prototype,o,{...e,set(t){g.push(this),e.set.call(this,t),g.pop()}})};if(m(Element,"innerHTML"),m(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,o=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const r=o.call(this,...e);return t.set(r,this),r},e.forEach((o=>{const e=window.ElementInternals.prototype,r=e[o];e[o]=function(...o){const e=t.get(this);if(!0===i.get(e).formAssociated)return r?.call(this,...o);throw new DOMException(`Failed to execute ${r} on 'ElementInternals': The target element is not a form-associated custom element.`)}}));class r extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const o=new Map;t.forEach(((t,e)=>{const r=t.getAttribute("name"),i=o.get(r)||[];this[+e]=t,i.push(t),o.set(r,i)})),this.length=t.length,o.forEach(((t,o)=>{t&&(1===t.length?this[o]=t[0]:this[o]=new r(t))}))}namedItem(t){return this[t]}}const s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=s.get.call(this,[]),o=[];for(const e of t){const t=i.get(e);t&&!0!==t.formAssociated||o.push(e)}return new n(o)}})}}try{window.customElements.define("custom-element",null)}catch(ce){const t=window.customElements.define;window.customElements.define=(o,e,r)=>{if(null!==e)try{t.bind(window.customElements)(o,e,r)}catch(t){console.info(o,e,r,t)}}}
|
|
16
16
|
/**
|
|
17
17
|
* @license
|
|
18
18
|
* Copyright 2019 Google LLC
|
|
19
19
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
|
-
*/const
|
|
20
|
+
*/const o=globalThis,e=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),i=new WeakMap;const n=t=>new class{constructor(t,o,e){if(this._$cssResult$=!0,e!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=o}get styleSheet(){let t=this.o;const o=this.t;if(e&&void 0===t){const e=void 0!==o&&1===o.length;e&&(t=i.get(o)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(o,t))}return t}toString(){return this.cssText}}("string"==typeof t?t:t+"",void 0,r),s=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let o="";for(const e of t.cssRules)o+=e.cssText;return n(o)})(t):t
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/,{is:
|
|
25
|
+
*/,{is:a,defineProperty:c,getOwnPropertyDescriptor:l,getOwnPropertyNames:h,getOwnPropertySymbols:f,getPrototypeOf:p}=Object,d=globalThis,u=d.trustedTypes,y=u?u.emptyScript:"",g=d.reactiveElementPolyfillSupport,b=(t,o)=>t,m={toAttribute(t,o){switch(o){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,o){let e=t;switch(o){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},O=(t,o)=>!a(t,o),N={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:O};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let v=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,o=N){if(o.state&&(o.attribute=!1),this._$Ei(),this.elementProperties.set(t,o),!o.noAccessor){const e=Symbol(),r=this.getPropertyDescriptor(t,e,o);void 0!==r&&c(this.prototype,t,r)}}static getPropertyDescriptor(t,o,e){const{get:r,set:i}=l(this.prototype,t)??{get(){return this[o]},set(t){this[o]=t}};return{get(){return r?.call(this)},set(o){const n=r?.call(this);i.call(this,o),this.requestUpdate(t,n,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??N}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,o=[...h(t),...f(t)];for(const e of o)this.createProperty(e,t[e])}const t=this[Symbol.metadata];if(null!==t){const o=litPropertyMetadata.get(t);if(void 0!==o)for(const[t,e]of o)this.elementProperties.set(t,e)}this._$Eh=new Map;for(const[t,o]of this.elementProperties){const e=this._$Eu(t,o);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const o=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)o.unshift(s(t))}else void 0!==t&&o.push(s(t));return o}static _$Eu(t,o){const e=o.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$E_?.delete(t)}_$ES(){const t=new Map,o=this.constructor.elementProperties;for(const e of o.keys())this.hasOwnProperty(e)&&(t.set(e,this[e]),delete this[e]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,r)=>{if(e)t.adoptedStyleSheets=r.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of r){const r=document.createElement("style"),i=o.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=e.cssText,t.appendChild(r)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,o,e){this._$AK(t,e)}_$EO(t,o){const e=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,e);if(void 0!==r&&!0===e.reflect){const i=(void 0!==e.converter?.toAttribute?e.converter:m).toAttribute(o,e.type);this._$Em=t,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,o){const e=this.constructor,r=e._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=e.getPropertyOptions(r),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:m;this._$Em=r,this[r]=i.fromAttribute(o,t.type),this._$Em=null}}requestUpdate(t,o,e,r=!1,i){if(void 0!==t){if(e??=this.constructor.getPropertyOptions(t),!(e.hasChanged??O)(r?i:this[t],o))return;this.C(t,o,e)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,o,e){this._$AL.has(t)||this._$AL.set(t,o),!0===e.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,o]of this._$Ep)this[t]=o;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[o,e]of t)!0!==e.wrapped||this._$AL.has(o)||void 0===this[o]||this.C(o,this[o],e)}let t=!1;const o=this._$AL;try{t=this.shouldUpdate(o),t?(this.willUpdate(o),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(o)):this._$ET()}catch(o){throw t=!1,this._$ET(),o}t&&this._$AE(o)}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}};v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[b("elementProperties")]=new Map,v[b("finalized")]=new Map,g?.({ReactiveElement:v}),(d.reactiveElementVersions??=[]).push("2.0.2");
|
|
26
26
|
/**
|
|
27
27
|
* @license
|
|
28
28
|
* Copyright 2017 Google LLC
|
|
29
29
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
30
|
*/
|
|
31
|
-
const
|
|
31
|
+
const S={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:O},w=(t=S,o,e)=>{const{kind:r,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(void 0===n&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,t),"accessor"===r){const{name:r}=e;return{set(e){const i=o.get.call(this);o.set.call(this,e),this.requestUpdate(r,i,t)},init(o){return void 0!==o&&this.C(r,void 0,t),o}}}if("setter"===r){const{name:r}=e;return function(e){const i=this[r];o.call(this,e),this.requestUpdate(r,i,t)}}throw Error("Unsupported decorator location: "+r)};function C(t){return(o,e)=>"object"==typeof e?w(t,o,e):((t,o,e)=>{const r=o.hasOwnProperty(e);return o.constructor.createProperty(e,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(o,e):void 0})(t,o,e)
|
|
32
32
|
/**
|
|
33
33
|
* @license
|
|
34
34
|
* Copyright 2017 Google LLC
|
|
35
35
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
36
|
-
*/}function
|
|
36
|
+
*/}function x(t){return C({...t,state:!0,attribute:!1})}
|
|
37
37
|
/**
|
|
38
38
|
* @license
|
|
39
39
|
* Copyright 2017 Google LLC
|
|
40
40
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
-
*/const
|
|
41
|
+
*/const R=(t,o,e)=>(e.configurable=!0,e.enumerable=!0,e)
|
|
42
42
|
/**
|
|
43
43
|
* @license
|
|
44
44
|
* Copyright 2017 Google LLC
|
|
45
45
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
46
|
-
*/;function
|
|
46
|
+
*/;function E(t,o){return(e,r,i)=>{const n=o=>o.renderRoot?.querySelector(t)??null;if(o){const{get:t,set:o}="object"==typeof r?e:i??(()=>{const t=Symbol();return{get(){return this[t]},set(o){this[t]=o}}})();return R(0,0,{get(){let e=t.call(this);return void 0===e&&(e=n(this),(null!==e||this.hasUpdated)&&o.call(this,e)),e}})}return R(0,0,{get(){return n(this)}})}}class U{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,o){return this.callbacks=[t],this.debounce(o)}queue(t,o){return this.callbacks.push(t),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return null==this.promise&&(this.promise=new Promise(((t,o)=>{this.resolvePromise=t,this.rejectPromise=o}))),this.clearTimeout(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout),this.promise}async runCallbacks(){var t,o;const e=[...this.callbacks];this.callbacks=[];const r=null!==(t=this.rejectPromise)&&void 0!==t?t:()=>null,i=null!==(o=this.resolvePromise)&&void 0!==o?o:()=>null;this.clearPromise();for(let t of e)try{await t()}catch(t){return void r(t)}i(!0)}clearTimeout(){null!=this._debounce&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}}function I(t,o){try{return function(t,o){if(t===o)return!0;if(t&&o&&"object"==typeof t&&"object"==typeof o){if(t.constructor!==o.constructor)return!1;var e,r,i;if(Array.isArray(t)){if((e=t.length)!=o.length)return!1;for(r=e;0!=r--;)if(!I(t[r],o[r]))return!1;return!0}if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(r of t.entries())if(!o.has(r[0]))return!1;for(r of t.entries())if(!I(r[1],o.get(r[0])))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(r of t.entries())if(!o.has(r[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===o.source&&t.flags===o.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===o.valueOf();if((e=(i=Object.keys(t)).length)!==Object.keys(o).length)return!1;for(r=e;0!=r--;)if(!Object.prototype.hasOwnProperty.call(o,i[r]))return!1;for(r=e;0!=r--;){var n=i[r];if(!I(t[n],o[n]))return!1}return!0}return t!=t&&o!=o}(t,o)}catch(t){return!1}}const L=t=>o=>{window.customElements.get(t)||window.customElements.define(t,o)};
|
|
47
47
|
/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2017 Google LLC
|
|
@@ -78,7 +78,7 @@ let Oo=class extends At{constructor(){super(...arguments),this.renderOptions={ho
|
|
|
78
78
|
* Copyright 2019 Google LLC
|
|
79
79
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
80
80
|
*/
|
|
81
|
-
const xo=window,Ro=xo.ShadowRoot&&(void 0===xo.ShadyCSS||xo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;class Eo extends Oo{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([o,e])=>t.registry.define(o,e))));const o={...t.shadowRootOptions,customElements:t.registry},e=this.renderOptions.creationScope=this.attachShadow(o);return((t,o)=>{Ro?t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((o=>{const e=document.createElement("style"),r=xo.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=o.cssText,t.appendChild(e)}))})(e,t.elementStyles),e}}var Uo,Io=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};const Lo=Symbol("constructorPrototype"),Wo=Symbol("constructorName"),ko=Symbol("exportpartsDebouncer");class Ko extends Eo{constructor(){super(),this[Uo]=new
|
|
81
|
+
const xo=window,Ro=xo.ShadowRoot&&(void 0===xo.ShadyCSS||xo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;class Eo extends Oo{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([o,e])=>t.registry.define(o,e))));const o={...t.shadowRootOptions,customElements:t.registry},e=this.renderOptions.creationScope=this.attachShadow(o);return((t,o)=>{Ro?t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((o=>{const e=document.createElement("style"),r=xo.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=o.cssText,t.appendChild(e)}))})(e,t.elementStyles),e}}var Uo,Io=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};const Lo=Symbol("constructorPrototype"),Wo=Symbol("constructorName"),ko=Symbol("exportpartsDebouncer");class Ko extends Eo{constructor(){super(),this[Uo]=new U(5),this[Wo]=this.constructor.name,this[Lo]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Wo]&&Object.setPrototypeOf(this,this[Lo])}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var o,e;if((null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==e?e:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this[ko].run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var o,e,r,i,n,s;const a=t=>null!=t&&t.trim().length>0,c=t.filter(a).map((t=>t.trim()));if(0===c.length)return void this.removeAttribute("exportparts");const l=new Set;for(let t of null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll("[part],[exportparts]"))&&void 0!==e?e:[]){const o=null!==(i=null===(r=t.getAttribute("part"))||void 0===r?void 0:r.split(" "))&&void 0!==i?i:[],e=null!==(s=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==s?s:[];new Array(...o,...e).filter(a).map((t=>t.trim())).forEach((t=>l.add(t)))}if(0===l.size)return void this.removeAttribute("exportparts");const h=[...l.values()].flatMap((t=>c.map((o=>`${t}:${o}--${t}`))));this.setAttribute("exportparts",[...this.part,...h].join(", "))}}Uo=ko,Io([C()],Ko.prototype,"exportpartsPrefix",void 0),Io([function(t,o){const e=()=>JSON.parse(JSON.stringify(t));return C({type:Object,converter:{fromAttribute:t=>{if(null==t)return e();try{return JSON.parse(t)}catch{return e()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,o)=>!I(t,o),...null!=o?o:{}})}([])],Ko.prototype,"exportpartsPrefixes",void 0),Io([C()],Ko.prototype,"customStylesheet",void 0);const Zo=So.create("--ft-utils-highlight-html-background-color","","COLOR","#FFF26E");function $o(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var Ao,Mo,Fo;Nt`
|
|
82
82
|
.highlight-html-match {
|
|
83
83
|
background: ${Zo};
|
|
84
84
|
}
|
|
@@ -114,7 +114,7 @@ const xo=window,Ro=xo.ShadowRoot&&(void 0===xo.ShadyCSS||xo.ShadyCSS.nativeShado
|
|
|
114
114
|
display: inline-block;
|
|
115
115
|
width: 0;
|
|
116
116
|
}
|
|
117
|
-
`;const Bo=Symbol("internalReduxEventsUnsubscribers"),zo=Symbol("internalStoresUnsubscribers"),Do=Symbol("internalStores");class To extends Ko{constructor(){super(...arguments),this[Ao]=new Map,this[Mo]=new Map,this[Fo]=[]}update(t){var o;super.update(t),(null===(o=this.reduxReactiveProperties)||void 0===o?void 0:o.some((o=>t.has(o))))&&this.updateFromStores()}getUnnamedStore(){if(this[Do].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Do].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Do].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:$o(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[Do].delete(o)}setupStore(t,o){this[Do].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Do].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[zo].has(t.store):this[zo].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[zo].set(t,o.subscribe((()=>this.updateFromStores()))),$o(o)&&o.eventBus&&(null===(e=this.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const r=t=>this[e](t);o.eventBus.addEventListener(t.eventName,r),this[Bo].push((()=>o.eventBus.removeEventListener(t.eventName,r)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[zo].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[Bo].forEach((t=>t())),this[Bo]=[]}unsubscribeFromStore(t){this[zo].has(t)&&this[zo].get(t)(),this[zo].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Ao=zo,Mo=Do,Fo=Bo,window.ftReduxStores||(window.ftReduxStores={});const Po=t=>{const o=null!=t?t:{};return(t,e)=>{var r;const i={hasChanged:(t,o)=>!I(t,o),attribute:!1,...o};
|
|
117
|
+
`;const Bo=Symbol("internalReduxEventsUnsubscribers"),zo=Symbol("internalStoresUnsubscribers"),Do=Symbol("internalStores");class To extends Ko{constructor(){super(...arguments),this[Ao]=new Map,this[Mo]=new Map,this[Fo]=[]}update(t){var o;super.update(t),(null===(o=this.reduxReactiveProperties)||void 0===o?void 0:o.some((o=>t.has(o))))&&this.updateFromStores()}getUnnamedStore(){if(this[Do].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Do].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Do].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:$o(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[Do].delete(o)}setupStore(t,o){this[Do].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Do].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[zo].has(t.store):this[zo].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[zo].set(t,o.subscribe((()=>this.updateFromStores()))),$o(o)&&o.eventBus&&(null===(e=this.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const r=t=>this[e](t);o.eventBus.addEventListener(t.eventName,r),this[Bo].push((()=>o.eventBus.removeEventListener(t.eventName,r)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[zo].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[Bo].forEach((t=>t())),this[Bo]=[]}unsubscribeFromStore(t){this[zo].has(t)&&this[zo].get(t)(),this[zo].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Ao=zo,Mo=Do,Fo=Bo,window.ftReduxStores||(window.ftReduxStores={});const Po=t=>{const o=null!=t?t:{};return(t,e)=>{var r;const i={hasChanged:(t,o)=>!I(t,o),attribute:!1,...o};C(i)(t,e);const n=t;n.reduxProperties=n.reduxProperties||new Map,n.reduxProperties.set(e,{selector:null!==(r=o.selector)&&void 0!==r?r:t=>t[e],store:o.store})}};var _o,jo,Go;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(jo=null===(_o=window.safari)||void 0===_o?void 0:_o.pushNotification)||void 0===jo||jo.toString()),function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"}(Go||(Go={}));var Ho=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};class Yo extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const Jo=Symbol("registerInterval");class Vo extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[Jo]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Jo]):this.dispatchEvent(new Yo)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=Jo,Ho([x()],e.prototype,"stateManager",void 0),e}(To)){}
|
|
118
118
|
/**
|
|
119
119
|
* @license
|
|
120
120
|
* Copyright 2017 Google LLC
|
|
@@ -174,7 +174,7 @@ class ce extends Qo{constructor(t){if(super(t),this.et=X,t.type!==qo)throw Error
|
|
|
174
174
|
.rendered {
|
|
175
175
|
display: flow-root;
|
|
176
176
|
}
|
|
177
|
-
`;var ue=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};class ye extends CustomEvent{constructor(t,o){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:o}})}}class ge extends Event{constructor(){super("scrolled-to-target")}}class be extends Ko{constructor(){super(...arguments),this.items=[],this.renderItem=()=>eo``,this.getItemKey=(t,o)=>`${o} - ${JSON.stringify(t)}`,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.visibleItems=[],this.scrolledToTarget=!1,this.scrolling=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new
|
|
177
|
+
`;var ue=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};class ye extends CustomEvent{constructor(t,o){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:o}})}}class ge extends Event{constructor(){super("scrolled-to-target")}}class be extends Ko{constructor(){super(...arguments),this.items=[],this.renderItem=()=>eo``,this.getItemKey=(t,o)=>`${o} - ${JSON.stringify(t)}`,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.visibleItems=[],this.scrolledToTarget=!1,this.scrolling=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new U(5),this.scrollDoneDebouncer=new U(10),this.onVisibilityChange=t=>{let o=new Set(this.visibleItems),e=new Set;for(let r of t){let t=+r.target.attributes.getNamedItem("data-item-index").value;r.intersectionRect.height>0?(o.add(t),e.add(t)):e.has(t)||o.delete(t)}this.visibleItems=[...o].sort(((t,o)=>t-o))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.scrollingDebouncer=new U(100),this.scrollListener=()=>{this.scrolling=!0,this.scrollingDebouncer.run((()=>{this.scrolling=!1}))},this.onResize=t=>{this.triggerFindScrollableParent();let o=this.searchFirstVisibleItem([...this.itemsContainer.children]),e=this.scrollable.scrollTop-this.getOffset(o);for(const o of t){const t=+o.target.parentElement.getAttribute("data-item-index");(this.alreadyRenderedIndexes.has(t)||o.target.classList.contains("rendered"))&&(o.target.parentElement.style.height=o.target.clientHeight+"px")}null!=o&&null!=e&&this.scrolledToTarget&&(this.scrollable.scrollTop=this.getOffset(o)+Math.min(e,o.clientHeight))},this.resizeObserver=new ResizeObserver(this.onResize),this.onMutation=()=>{[...this.itemsContainer.children].forEach((t=>{this.resizeObserver.observe(t.children.item(0)),this.intersectionObserver.observe(t)}))},this.mutationObserver=new MutationObserver(this.onMutation),this.resetVisibleItemsDebouncer=new U(10)}get scrollable(){var t;return null!==(t=this.internalScroll?this.internalScrollable:this.firstScrollableParent)&&void 0!==t?t:document.body}render(){return eo`
|
|
178
178
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
179
179
|
tabindex="-1"
|
|
180
180
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
@@ -188,16 +188,16 @@ class ce extends Qo{constructor(t){if(super(t),this.et=X,t.type!==qo)throw Error
|
|
|
188
188
|
${r?(()=>{const e=this.renderItem(t,o);return"string"==typeof e?eo`${le(e)}`:e})():null}
|
|
189
189
|
</div>
|
|
190
190
|
</div>
|
|
191
|
-
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;let o=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;o>=this.items.length&&(o=-1);let e=this.getItem(o);this.scrollToTarget(e),this.scrollDoneDebouncer.run((()=>{this.onMutation(),this.scrolledToTarget=!0}))}))}getItem(t){var o;return null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`#item-${t}`)}scrollToTarget(t){var o;if(t){let e=+(null!==(o=t.getAttribute("data-item-index"))&&void 0!==o?o:"0");this.scrollable&&0===e?this.scrollable.scrollTop=0:this.scrollable.scrollTop=this.getOffset(t)}}getOffset(t){var o;let e=0,r=t;for(;r&&r.offsetParent!==this.scrollable.offsetParent;)e+=r.offsetTop,r=r.offsetParent;return e+(null!==(o=null==r?void 0:r.offsetTop)&&void 0!==o?o:0)-this.scrollable.offsetTop}getBottomOffset(t){var o;return this.getOffset(t)+(null!==(o=null==t?void 0:t.clientHeight)&&void 0!==o?o:0)}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){var o;let e,r;t.stopPropagation();for(let o of t.composedPath()){const t=o,i=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&i){e=t;break}i&&(r=t)}let i=e||r;i!==this.firstScrollableParent&&(null===(o=this.firstScrollableParent)||void 0===o||o.removeEventListener("scroll",this.scrollListener),null==i||i.addEventListener("scroll",this.scrollListener),this.firstScrollableParent=i,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}searchFirstVisibleItem(t,o,e){if(o=null!=o?o:0,(e=null!=e?e:t.length-1)-o<=0)return t[o];const r=Math.floor((e-o)/2)+o;return this.getOffset(t[r])>this.scrollable.scrollTop?this.searchFirstVisibleItem(t,o,r-1):this.getBottomOffset(t[r])<this.scrollable.scrollTop?this.searchFirstVisibleItem(t,r+1,e):t[r]}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),!t.has("scrollToItem")&&!t.has("scrollToIndex")||null==this.scrollToItem&&null==this.scrollToIndex||this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.onVisibleItemsChange(),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new ge)}onVisibleItemsChange(){const t=this.visibleItems.every(((t,o)=>null==this.visibleItems[o+1]||t+1===this.visibleItems[o+1]));t||I(this.visibleItems,this.lastNotOkVisibleItems)?(this.resetVisibleItemsDebouncer.cancel(),this.dispatchEvent(new ye(this.visibleItems,this.visibleItems.map((t=>this.items[t]))))):this.resetVisibleItemsDebouncer.run((()=>{this.lastNotOkVisibleItems=[...this.visibleItems],this.visibleItems=[],this.initIntersectionObserver(),this.onMutation()}))}}be.styles=de,ue([
|
|
191
|
+
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;let o=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;o>=this.items.length&&(o=-1);let e=this.getItem(o);this.scrollToTarget(e),this.scrollDoneDebouncer.run((()=>{this.onMutation(),this.scrolledToTarget=!0}))}))}getItem(t){var o;return null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`#item-${t}`)}scrollToTarget(t){var o;if(t){let e=+(null!==(o=t.getAttribute("data-item-index"))&&void 0!==o?o:"0");this.scrollable&&0===e?this.scrollable.scrollTop=0:this.scrollable.scrollTop=this.getOffset(t)}}getOffset(t){var o;let e=0,r=t;for(;r&&r.offsetParent!==this.scrollable.offsetParent;)e+=r.offsetTop,r=r.offsetParent;return e+(null!==(o=null==r?void 0:r.offsetTop)&&void 0!==o?o:0)-this.scrollable.offsetTop}getBottomOffset(t){var o;return this.getOffset(t)+(null!==(o=null==t?void 0:t.clientHeight)&&void 0!==o?o:0)}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){var o;let e,r;t.stopPropagation();for(let o of t.composedPath()){const t=o,i=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&i){e=t;break}i&&(r=t)}let i=e||r;i!==this.firstScrollableParent&&(null===(o=this.firstScrollableParent)||void 0===o||o.removeEventListener("scroll",this.scrollListener),null==i||i.addEventListener("scroll",this.scrollListener),this.firstScrollableParent=i,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}searchFirstVisibleItem(t,o,e){if(o=null!=o?o:0,(e=null!=e?e:t.length-1)-o<=0)return t[o];const r=Math.floor((e-o)/2)+o;return this.getOffset(t[r])>this.scrollable.scrollTop?this.searchFirstVisibleItem(t,o,r-1):this.getBottomOffset(t[r])<this.scrollable.scrollTop?this.searchFirstVisibleItem(t,r+1,e):t[r]}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),!t.has("scrollToItem")&&!t.has("scrollToIndex")||null==this.scrollToItem&&null==this.scrollToIndex||this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.onVisibleItemsChange(),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new ge)}onVisibleItemsChange(){const t=this.visibleItems.every(((t,o)=>null==this.visibleItems[o+1]||t+1===this.visibleItems[o+1]));t||I(this.visibleItems,this.lastNotOkVisibleItems)?(this.resetVisibleItemsDebouncer.cancel(),this.dispatchEvent(new ye(this.visibleItems,this.visibleItems.map((t=>this.items[t]))))):this.resetVisibleItemsDebouncer.run((()=>{this.lastNotOkVisibleItems=[...this.visibleItems],this.visibleItems=[],this.initIntersectionObserver(),this.onMutation()}))}}be.styles=de,ue([C({type:Array})],be.prototype,"items",void 0),ue([C({attribute:!1})],be.prototype,"renderItem",void 0),ue([C({attribute:!1})],be.prototype,"getItemKey",void 0),ue([C({type:Object})],be.prototype,"scrollToItem",void 0),ue([C({type:Number})],be.prototype,"scrollToIndex",void 0),ue([C({type:Boolean})],be.prototype,"internalScroll",void 0),ue([C({type:Number})],be.prototype,"renderBeforeFirst",void 0),ue([C({type:Number})],be.prototype,"renderAfterLast",void 0),ue([x({hasChanged:(t,o)=>null!=t&&null==o||t.length!==o.length||t[0]!==o[0]})],be.prototype,"visibleItems",void 0),ue([E(".scrollable")],be.prototype,"internalScrollable",void 0),ue([E(".items-container")],be.prototype,"itemsContainer",void 0),ue([x()],be.prototype,"scrolledToTarget",void 0),ue([x()],be.prototype,"scrolling",void 0),L("ft-infinite-scroll")(be);const me=Nt`
|
|
192
192
|
`,Oe=Nt`
|
|
193
193
|
`;var Ne=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};class ve extends Vo{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return eo`
|
|
194
194
|
<article id=${this.tocId}>
|
|
195
195
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
196
196
|
</article>
|
|
197
|
-
`}registerComponent(t){t.stopPropagation();const o=t.composedPath()[0];this.register(o)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((o=>t.has(o)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}ve.styles=Oe,Ne([Po({selector:t=>{var o;return null===(o=t.map)||void 0===o?void 0:o.id}})],ve.prototype,"mapId",void 0),Ne([
|
|
197
|
+
`}registerComponent(t){t.stopPropagation();const o=t.composedPath()[0];this.register(o)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((o=>t.has(o)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}ve.styles=Oe,Ne([Po({selector:t=>{var o;return null===(o=t.map)||void 0===o?void 0:o.id}})],ve.prototype,"mapId",void 0),Ne([C()],ve.prototype,"tocId",void 0),Ne([C({type:Boolean})],ve.prototype,"disableContextInteractions",void 0),Ne([x()],ve.prototype,"tocNode",void 0),L("ft-reader-topic-context")(ve);var Se=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};class we extends Vo{constructor(){super(...arguments),this.renderTopic=()=>eo`
|
|
198
198
|
<ft-reader-topic-title></ft-reader-topic-title>
|
|
199
199
|
<ft-reader-topic-content></ft-reader-topic-content>
|
|
200
|
-
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new
|
|
200
|
+
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new U(50)}render(){var t;const o=(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[];return 0===o.length?io:eo`
|
|
201
201
|
<ft-infinite-scroll class="ft-reader-content"
|
|
202
202
|
.items=${o}
|
|
203
203
|
.renderItem=${(t,o)=>this.renderTopicInContext(t,o)}
|
|
@@ -214,4 +214,4 @@ class ce extends Qo{constructor(t){if(super(t),this.et=X,t.type!==qo)throw Error
|
|
|
214
214
|
<ft-reader-topic-context tocId="${t}" ?disableContextInteractions=${this.disableContextInteractions}>
|
|
215
215
|
${this.renderTopic(t,o)}
|
|
216
216
|
</ft-reader-topic-context>
|
|
217
|
-
`}getScrollTarget(){var t,o,e,r,i;if(this.disableContextInteractions)return null;const n=null!==(r=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(e=null===(o=this.scrollTarget)||void 0===o?void 0:o.tocId)&&void 0!==e?e:""))&&void 0!==r&&r;return!(null===(i=this.scrollTarget)||void 0===i?void 0:i.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var o;return null===(o=this.stateManager)||void 0===o?void 0:o.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,o;this.disableContextInteractions||(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(o=this.stateManager)||void 0===o||o.scrollDone()}}we.elementDefinitions={"ft-infinite-scroll":be},we.styles=me,Se([
|
|
217
|
+
`}getScrollTarget(){var t,o,e,r,i;if(this.disableContextInteractions)return null;const n=null!==(r=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(e=null===(o=this.scrollTarget)||void 0===o?void 0:o.tocId)&&void 0!==e?e:""))&&void 0!==r&&r;return!(null===(i=this.scrollTarget)||void 0===i?void 0:i.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var o;return null===(o=this.stateManager)||void 0===o?void 0:o.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,o;this.disableContextInteractions||(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(o=this.stateManager)||void 0===o||o.scrollDone()}}we.elementDefinitions={"ft-infinite-scroll":be},we.styles=me,Se([C()],we.prototype,"renderTopic",void 0),Se([C({type:Boolean})],we.prototype,"disableContextInteractions",void 0),Se([Po()],we.prototype,"currentPage",void 0),Se([Po()],we.prototype,"scrollTarget",void 0),Se([Po()],we.prototype,"visibleTopics",void 0),Se([Po({selector:t=>{var o,e;return null!==(e=null===(o=t.configuration)||void 0===o?void 0:o.loadBeforeFirstVisibleTopic)&&void 0!==e?e:5}})],we.prototype,"renderBeforeFirst",void 0),Se([Po({selector:t=>{var o,e;return null!==(e=null===(o=t.configuration)||void 0===o?void 0:o.loadAfterLastVisibleTopic)&&void 0!==e?e:5}})],we.prototype,"renderAfterLast",void 0),Se([E(".ft-reader-content")],we.prototype,"container",void 0),L("ft-reader-content")(we),t.FtReaderContent=we,t.FtReaderContentCssVariables={},t.styles=me}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-content",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Main content for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-infinite-scroll": "1.1.
|
|
23
|
-
"@fluid-topics/ft-reader-topic-content": "1.1.
|
|
24
|
-
"@fluid-topics/ft-reader-topic-context": "1.1.
|
|
25
|
-
"@fluid-topics/ft-reader-topic-title": "1.1.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-infinite-scroll": "1.1.3",
|
|
23
|
+
"@fluid-topics/ft-reader-topic-content": "1.1.3",
|
|
24
|
+
"@fluid-topics/ft-reader-topic-context": "1.1.3",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-title": "1.1.3",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.1.3",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "0d44a470e710f185c37e42ee87be4481a3bdf793"
|
|
30
30
|
}
|