@snippyly/plugin-staging 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/snippyly.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snippyly/plugin-staging",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "snippyly.js",
6
6
  "scripts": {
package/snippyly.js CHANGED
@@ -8,19 +8,19 @@ const t=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */;var o;const r=window.trustedTypes,l=r?r.emptyScript:"",h=window.reactiveElementPolyfillSupport,a={toAttribute(t,i){switch(i){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},d=(t,i)=>i!==t&&(i==i||t==t),c={attribute:!0,type:String,converter:a,reflect:!1,hasChanged:d};class p extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var i;null!==(i=this.l)&&void 0!==i||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Eh(s,i);void 0!==e&&(this._$Eu.set(e,s),t.push(e))})),t}static createProperty(t,i=c){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e)}}static getPropertyDescriptor(t,i,s){return{get(){return this[i]},set(e){const n=this[t];this[i]=e,this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||c}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)i.unshift(n(t))}else void 0!==t&&i.push(n(t));return i}static _$Eh(t,i){const s=i.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,s;(null!==(i=this._$Eg)&&void 0!==i?i:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var i;null===(i=this._$Eg)||void 0===i||i.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Et.set(i,this[i]),delete this[i])}))}createRenderRoot(){var i;const s=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,s)=>{t?i.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((t=>{const s=document.createElement("style"),e=window.litNonce;void 0!==e&&s.setAttribute("nonce",e),s.textContent=t.cssText,i.appendChild(s)}))})(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$ES(t,i,s=c){var e,n;const o=this.constructor._$Eh(t,s);if(void 0!==o&&!0===s.reflect){const r=(null!==(n=null===(e=s.converter)||void 0===e?void 0:e.toAttribute)&&void 0!==n?n:a.toAttribute)(i,s.type);this._$Ei=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Ei=null}}_$AK(t,i){var s,e,n;const o=this.constructor,r=o._$Eu.get(t);if(void 0!==r&&this._$Ei!==r){const t=o.getPropertyOptions(r),l=t.converter,h=null!==(n=null!==(e=null===(s=l)||void 0===s?void 0:s.fromAttribute)&&void 0!==e?e:"function"==typeof l?l:null)&&void 0!==n?n:a.fromAttribute;this._$Ei=r,this[r]=h(i,t.type),this._$Ei=null}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||d)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,i)=>this[i]=t)),this._$Et=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$EU()}catch(t){throw i=!1,this._$EU(),t}i&&this._$AE(s)}willUpdate(t){}_$AE(t){var i;null===(i=this._$Eg)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$ES(i,this[i],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
11
+ */;var o;const r=window.trustedTypes,l=r?r.emptyScript:"",h=window.reactiveElementPolyfillSupport,a={toAttribute(t,i){switch(i){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},c=(t,i)=>i!==t&&(i==i||t==t),d={attribute:!0,type:String,converter:a,reflect:!1,hasChanged:c};class p extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var i;null!==(i=this.l)&&void 0!==i||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Eh(s,i);void 0!==e&&(this._$Eu.set(e,s),t.push(e))})),t}static createProperty(t,i=d){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e)}}static getPropertyDescriptor(t,i,s){return{get(){return this[i]},set(e){const n=this[t];this[i]=e,this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||d}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)i.unshift(n(t))}else void 0!==t&&i.push(n(t));return i}static _$Eh(t,i){const s=i.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,s;(null!==(i=this._$Eg)&&void 0!==i?i:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var i;null===(i=this._$Eg)||void 0===i||i.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Et.set(i,this[i]),delete this[i])}))}createRenderRoot(){var i;const s=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,s)=>{t?i.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((t=>{const s=document.createElement("style"),e=window.litNonce;void 0!==e&&s.setAttribute("nonce",e),s.textContent=t.cssText,i.appendChild(s)}))})(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$ES(t,i,s=d){var e,n;const o=this.constructor._$Eh(t,s);if(void 0!==o&&!0===s.reflect){const r=(null!==(n=null===(e=s.converter)||void 0===e?void 0:e.toAttribute)&&void 0!==n?n:a.toAttribute)(i,s.type);this._$Ei=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Ei=null}}_$AK(t,i){var s,e,n;const o=this.constructor,r=o._$Eu.get(t);if(void 0!==r&&this._$Ei!==r){const t=o.getPropertyOptions(r),l=t.converter,h=null!==(n=null!==(e=null===(s=l)||void 0===s?void 0:s.fromAttribute)&&void 0!==e?e:"function"==typeof l?l:null)&&void 0!==n?n:a.fromAttribute;this._$Ei=r,this[r]=h(i,t.type),this._$Ei=null}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||c)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,i)=>this[i]=t)),this._$Et=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$EU()}catch(t){throw i=!1,this._$EU(),t}i&&this._$AE(s)}willUpdate(t){}_$AE(t){var i;null===(i=this._$Eg)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$ES(i,this[i],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- var u;p.finalized=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:p}),(null!==(o=globalThis.reactiveElementVersions)&&void 0!==o?o:globalThis.reactiveElementVersions=[]).push("1.3.2");const v=globalThis.trustedTypes,y=v?v.createPolicy("lit-html",{createHTML:t=>t}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,m="?"+g,w=`<${m}>`,f=document,b=(t="")=>f.createComment(t),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$=/-->/g,k=/>/g,M=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,_=/'/g,L=/"/g,E=/^(?:script|style|textarea|title)$/i,A=(t=>(i,...s)=>({_$litType$:t,strings:i,values:s}))(1),U=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),O=new WeakMap,B=f.createTreeWalker(f,129,null,!1),R=(t,i)=>{const s=t.length-1,e=[];let n,o=2===i?"<svg>":"",r=C;for(let i=0;i<s;i++){const s=t[i];let l,h,a=-1,d=0;for(;d<s.length&&(r.lastIndex=d,h=r.exec(s),null!==h);)d=r.lastIndex,r===C?"!--"===h[1]?r=$:void 0!==h[1]?r=k:void 0!==h[2]?(E.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=M):void 0!==h[3]&&(r=M):r===M?">"===h[0]?(r=null!=n?n:C,a=-1):void 0===h[1]?a=-2:(a=r.lastIndex-h[2].length,l=h[1],r=void 0===h[3]?M:'"'===h[3]?L:_):r===L||r===_?r=M:r===$||r===k?r=C:(r=M,n=void 0);const c=r===M&&t[i+1].startsWith("/>")?" ":"";o+=r===C?s+w:a>=0?(e.push(l),s.slice(0,a)+"$lit$"+s.slice(a)+g+c):s+g+(-2===a?(e.push(void 0),i):c)}const l=o+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==y?y.createHTML(l):l,e]};class j{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let n=0,o=0;const r=t.length-1,l=this.parts,[h,a]=R(t,i);if(this.el=j.createElement(h,s),B.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=B.nextNode())&&l.length<r;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(g)){const s=a[o++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+"$lit$").split(g),i=/([.?@])?(.*)/.exec(s);l.push({type:1,index:n,name:i[2],strings:t,ctor:"."===i[1]?H:"?"===i[1]?F:"@"===i[1]?V:Z})}else l.push({type:6,index:n})}for(const i of t)e.removeAttribute(i)}if(E.test(e.tagName)){const t=e.textContent.split(g),i=t.length-1;if(i>0){e.textContent=v?v.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],b()),B.nextNode(),l.push({type:2,index:++n});e.append(t[i],b())}}}else if(8===e.nodeType)if(e.data===m)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=e.data.indexOf(g,t+1));)l.push({type:7,index:n}),t+=g.length-1}n++}}static createElement(t,i){const s=f.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){var n,o,r,l;if(i===U)return i;let h=void 0!==e?null===(n=s._$Cl)||void 0===n?void 0:n[e]:s._$Cu;const a=x(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==a&&(null===(o=null==h?void 0:h._$AO)||void 0===o||o.call(h,!1),void 0===a?h=void 0:(h=new a(t),h._$AT(t,s,e)),void 0!==e?(null!==(r=(l=s)._$Cl)&&void 0!==r?r:l._$Cl=[])[e]=h:s._$Cu=h),void 0!==h&&(i=N(t,h._$AS(t,i.values),h,e)),i}class z{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,n=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:f).importNode(s,!0);B.currentNode=n;let o=B.nextNode(),r=0,l=0,h=e[0];for(;void 0!==h;){if(r===h.index){let i;2===h.type?i=new P(o,o.nextSibling,this,t):1===h.type?i=new h.ctor(o,h.name,h.strings,this,t):6===h.type&&(i=new D(o,this,t)),this.v.push(i),h=e[++l]}r!==(null==h?void 0:h.index)&&(o=B.nextNode(),r++)}return n}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class P{constructor(t,i,s,e){var n;this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(n=null==e?void 0:e.isConnected)||void 0===n||n}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=N(this,t,i),x(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==U&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var i;return S(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.S(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==T&&x(this._$AH)?this._$AA.nextSibling.data=t:this.k(f.createTextNode(t)),this._$AH=t}T(t){var i;const{values:s,_$litType$:e}=t,n="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=j.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===n)this._$AH.m(s);else{const t=new z(n,this),i=t.p(this.options);t.m(s),this.k(i),this._$AH=t}}_$AC(t){let i=O.get(t.strings);return void 0===i&&O.set(t.strings,i=new j(t)),i}S(t){S(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const n of t)e===i.length?i.push(s=new P(this.M(b()),this.M(b()),this,this.options)):s=i[e],s._$AI(n),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Z{constructor(t,i,s,e,n){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const n=this.strings;let o=!1;if(void 0===n)t=N(this,t,i,0),o=!x(t)||t!==this._$AH&&t!==U,o&&(this._$AH=t);else{const e=t;let r,l;for(t=n[0],r=0;r<n.length-1;r++)l=N(this,e[s+r],i,r),l===U&&(l=this._$AH[r]),o||(o=!x(l)||l!==this._$AH[r]),l===T?t=T:t!==T&&(t+=(null!=l?l:"")+n[r+1]),this._$AH[r]=l}o&&!e&&this.C(t)}C(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class H extends Z{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===T?void 0:t}}const I=v?v.emptyScript:"";class F extends Z{constructor(){super(...arguments),this.type=4}C(t){t&&t!==T?this.element.setAttribute(this.name,I):this.element.removeAttribute(this.name)}}class V extends Z{constructor(t,i,s,e,n){super(t,i,s,e,n),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=N(this,t,i,0))&&void 0!==s?s:T)===U)return;const e=this._$AH,n=t===T&&e!==T||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,o=t!==T&&(e===T||n);n&&this.element.removeEventListener(this.name,this,e),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class D{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){N(this,t)}}const J=window.litHtmlPolyfillSupport;
17
+ var u;p.finalized=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:p}),(null!==(o=globalThis.reactiveElementVersions)&&void 0!==o?o:globalThis.reactiveElementVersions=[]).push("1.3.2");const v=globalThis.trustedTypes,y=v?v.createPolicy("lit-html",{createHTML:t=>t}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,m="?"+g,w=`<${m}>`,f=document,b=(t="")=>f.createComment(t),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$=/-->/g,E=/>/g,k=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,M=/'/g,_=/"/g,L=/^(?:script|style|textarea|title)$/i,A=(t=>(i,...s)=>({_$litType$:t,strings:i,values:s}))(1),U=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),O=new WeakMap,B=f.createTreeWalker(f,129,null,!1),R=(t,i)=>{const s=t.length-1,e=[];let n,o=2===i?"<svg>":"",r=C;for(let i=0;i<s;i++){const s=t[i];let l,h,a=-1,c=0;for(;c<s.length&&(r.lastIndex=c,h=r.exec(s),null!==h);)c=r.lastIndex,r===C?"!--"===h[1]?r=$:void 0!==h[1]?r=E:void 0!==h[2]?(L.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=k):void 0!==h[3]&&(r=k):r===k?">"===h[0]?(r=null!=n?n:C,a=-1):void 0===h[1]?a=-2:(a=r.lastIndex-h[2].length,l=h[1],r=void 0===h[3]?k:'"'===h[3]?_:M):r===_||r===M?r=k:r===$||r===E?r=C:(r=k,n=void 0);const d=r===k&&t[i+1].startsWith("/>")?" ":"";o+=r===C?s+w:a>=0?(e.push(l),s.slice(0,a)+"$lit$"+s.slice(a)+g+d):s+g+(-2===a?(e.push(void 0),i):d)}const l=o+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==y?y.createHTML(l):l,e]};class j{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let n=0,o=0;const r=t.length-1,l=this.parts,[h,a]=R(t,i);if(this.el=j.createElement(h,s),B.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=B.nextNode())&&l.length<r;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(g)){const s=a[o++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+"$lit$").split(g),i=/([.?@])?(.*)/.exec(s);l.push({type:1,index:n,name:i[2],strings:t,ctor:"."===i[1]?Z:"?"===i[1]?V:"@"===i[1]?F:I})}else l.push({type:6,index:n})}for(const i of t)e.removeAttribute(i)}if(L.test(e.tagName)){const t=e.textContent.split(g),i=t.length-1;if(i>0){e.textContent=v?v.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],b()),B.nextNode(),l.push({type:2,index:++n});e.append(t[i],b())}}}else if(8===e.nodeType)if(e.data===m)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=e.data.indexOf(g,t+1));)l.push({type:7,index:n}),t+=g.length-1}n++}}static createElement(t,i){const s=f.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){var n,o,r,l;if(i===U)return i;let h=void 0!==e?null===(n=s._$Cl)||void 0===n?void 0:n[e]:s._$Cu;const a=x(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==a&&(null===(o=null==h?void 0:h._$AO)||void 0===o||o.call(h,!1),void 0===a?h=void 0:(h=new a(t),h._$AT(t,s,e)),void 0!==e?(null!==(r=(l=s)._$Cl)&&void 0!==r?r:l._$Cl=[])[e]=h:s._$Cu=h),void 0!==h&&(i=N(t,h._$AS(t,i.values),h,e)),i}class z{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,n=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:f).importNode(s,!0);B.currentNode=n;let o=B.nextNode(),r=0,l=0,h=e[0];for(;void 0!==h;){if(r===h.index){let i;2===h.type?i=new P(o,o.nextSibling,this,t):1===h.type?i=new h.ctor(o,h.name,h.strings,this,t):6===h.type&&(i=new D(o,this,t)),this.v.push(i),h=e[++l]}r!==(null==h?void 0:h.index)&&(o=B.nextNode(),r++)}return n}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class P{constructor(t,i,s,e){var n;this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(n=null==e?void 0:e.isConnected)||void 0===n||n}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=N(this,t,i),x(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==U&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var i;return S(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.S(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==T&&x(this._$AH)?this._$AA.nextSibling.data=t:this.k(f.createTextNode(t)),this._$AH=t}T(t){var i;const{values:s,_$litType$:e}=t,n="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=j.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===n)this._$AH.m(s);else{const t=new z(n,this),i=t.p(this.options);t.m(s),this.k(i),this._$AH=t}}_$AC(t){let i=O.get(t.strings);return void 0===i&&O.set(t.strings,i=new j(t)),i}S(t){S(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const n of t)e===i.length?i.push(s=new P(this.M(b()),this.M(b()),this,this.options)):s=i[e],s._$AI(n),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class I{constructor(t,i,s,e,n){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const n=this.strings;let o=!1;if(void 0===n)t=N(this,t,i,0),o=!x(t)||t!==this._$AH&&t!==U,o&&(this._$AH=t);else{const e=t;let r,l;for(t=n[0],r=0;r<n.length-1;r++)l=N(this,e[s+r],i,r),l===U&&(l=this._$AH[r]),o||(o=!x(l)||l!==this._$AH[r]),l===T?t=T:t!==T&&(t+=(null!=l?l:"")+n[r+1]),this._$AH[r]=l}o&&!e&&this.C(t)}C(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Z extends I{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===T?void 0:t}}const H=v?v.emptyScript:"";class V extends I{constructor(){super(...arguments),this.type=4}C(t){t&&t!==T?this.element.setAttribute(this.name,H):this.element.removeAttribute(this.name)}}class F extends I{constructor(t,i,s,e,n){super(t,i,s,e,n),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=N(this,t,i,0))&&void 0!==s?s:T)===U)return;const e=this._$AH,n=t===T&&e!==T||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,o=t!==T&&(e===T||n);n&&this.element.removeEventListener(this.name,this,e),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class D{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){N(this,t)}}const J=window.litHtmlPolyfillSupport;
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
22
  */
23
- var K,X;null==J||J(j,P),(null!==(u=globalThis.litHtmlVersions)&&void 0!==u?u:globalThis.litHtmlVersions=[]).push("2.2.6");class q extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,i;const s=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=s.firstChild),s}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,i,s)=>{var e,n;const o=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let r=o._$litPart$;if(void 0===r){const t=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:null;o._$litPart$=r=new P(i.insertBefore(b(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return U}}q.finalized=!0,q._$litElement$=!0,null===(K=globalThis.litElementHydrateSupport)||void 0===K||K.call(globalThis,{LitElement:q});const W=globalThis.litElementPolyfillSupport;null==W||W({LitElement:q}),(null!==(X=globalThis.litElementVersions)&&void 0!==X?X:globalThis.litElementVersions=[]).push("3.2.0");
23
+ var K,W;null==J||J(j,P),(null!==(u=globalThis.litHtmlVersions)&&void 0!==u?u:globalThis.litHtmlVersions=[]).push("2.2.6");class X extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,i;const s=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=s.firstChild),s}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,i,s)=>{var e,n;const o=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let r=o._$litPart$;if(void 0===r){const t=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:null;o._$litPart$=r=new P(i.insertBefore(b(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return U}}X.finalized=!0,X._$litElement$=!0,null===(K=globalThis.litElementHydrateSupport)||void 0===K||K.call(globalThis,{LitElement:X});const q=globalThis.litElementPolyfillSupport;null==q||q({LitElement:X}),(null!==(W=globalThis.litElementVersions)&&void 0!==W?W:globalThis.litElementVersions=[]).push("3.2.0");
24
24
  /**
25
25
  * @license
26
26
  * Copyright 2017 Google LLC
@@ -53,7 +53,7 @@ const it=1;
53
53
  * Copyright 2018 Google LLC
54
54
  * SPDX-License-Identifier: BSD-3-Clause
55
55
  */
56
- const st=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==it||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var s,e;if(void 0===this.et){this.et=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(s=this.st)||void 0===s?void 0:s.has(t))&&this.et.add(t);return this.render(i)}const n=t.element.classList;this.et.forEach((t=>{t in i||(n.remove(t),this.et.delete(t))}));for(const t in i){const s=!!i[t];s===this.et.has(t)||(null===(e=this.st)||void 0===e?void 0:e.has(t))||(s?(n.add(t),this.et.add(t)):(n.remove(t),this.et.delete(t)))}return U}}),et=(t,i=0)=>{try{let s=3735928559^i,e=1103547991^i;for(let i,n=0;n<t.length;n++)i=t.charCodeAt(n),s=Math.imul(s^i,2654435761),e=Math.imul(e^i,1597334677);return s=Math.imul(s^s>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),e=Math.imul(e^e>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),4294967296*(2097151&e)+(s>>>0)}catch(t){return console.warn("Error in cyrb53: ",t),0}},nt=(t,i,s=!1,e="localStorage")=>{try{const n=s?btoa(i):i;"localStorage"===e?localStorage.setItem(t,n):sessionStorage.setItem(t,n)}catch(t){console.warn("Error in setLocalStorage: ",t)}},ot=(t,i=!1,s="localStorage")=>{try{let e=null;return e="localStorage"===s?localStorage.getItem(t):sessionStorage.getItem(t),e&&i?atob(e):e}catch(t){return console.warn("Error in getLocalStorage: ",t),null}},rt=(t,i="localStorage")=>{try{"localStorage"===i?localStorage.removeItem(t):sessionStorage.removeItem(t)}catch(t){console.warn("Error in removeLocalStorageData: ",t)}};var lt=function(t,i,s,e){for(var n,o=arguments.length,r=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(o<3?n(r):o>3?n(i,s,r):n(i,s))||r);return o>3&&r&&Object.defineProperty(i,s,r),r};let ht=class extends q{constructor(){super(),this._loadPlugin=!1,this.comments=[],this._expanded=!0,this.staging=true,this.copyLinkTooltip="Copy Link",this.setWindowEventListner=()=>{window.addEventListener("locationchange",(()=>{this.checkUrl()}))},this.urlChangeListener=()=>{const t=history.pushState;history.pushState=function(){const i=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),i};const i=history.replaceState;history.replaceState=function(){const t=i.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))},this.checkUrl=()=>{try{const t=new URL(document.location),i=t.searchParams;if(i.has("snippyly_google_token")){const s=JSON.parse(atob(i.get("snippyly_google_token"))),e={};e.userId=s.uid,e.name=s.displayName,e.email=s.email,e.photoUrl=null==s?void 0:s.photoURL,e.contacts=window.SNIPPYLY_USER_CONTACTS||[],nt("snippyly-user",JSON.stringify(e),!0),i.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}if(i.has("review-mode"))if(nt("review-mode","true",!1,"sessionStorage"),i.has("review-doc-id"))this.loadPluginUI();else{const s=new URL(document.location);s.searchParams.delete("review-mode");const e=et(s.href);i.append("review-doc-id",`${e}`),window.history.replaceState({},document.title,t.href),this.loadPluginUI()}else if(ot("review-mode",!1,"sessionStorage")){const s=new URL(document.location);s.searchParams.delete("review-mode"),i.append("review-mode","true");const e=et(s.href);i.append("review-doc-id",`${e}`),window.history.replaceState({},document.title,t.href),this.loadPluginUI()}}catch(t){console.warn("Error in checkUrl: ",t)}},this.loadPluginUI=()=>{this.loadPlugin=!0;const t=document.createElement("snippyly-comments");window.document.body.appendChild(t);const i=document.createElement("snippyly-comments-sidebar");window.document.body.appendChild(i);const s=document.createElement("snippyly-cursor");window.document.body.appendChild(s),((t="latest",i=!1,s)=>{if(console.log("load snippyly called"),document.getElementById("snippylyScript"))s&&s();else{const e=document.createElement("script");e.src=`https://cdn.jsdelivr.net/npm/@snippyly/sdk${i?"-staging":""}@${t||"latest"}/snippyly.js`,e.id="snippylyScript",e.type="module",document.body.appendChild(e),e.onload=()=>{s&&s()}}})(void 0,this.staging,(()=>{window.Snippyly&&this.initializeSnippyly()}))},this.initializeSnippyly=async()=>{await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.init("UnHxMCCFcclkP4bErBL1")),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),ot("snippyly-user",!0)&&this.identifySnippyly()},this.identifySnippyly=async()=>{this.snippylyUser=JSON.parse(ot("snippyly-user",!0)),await Snippyly.identify(this.snippylyUser),this.getComments()},this.getComments=()=>{this.commentElement&&this.commentElement.getAllCommentPinAnnotationsOnCurrentDocument().subscribe((t=>{this.comments=t}))},this.toggleCommentSidebar=()=>{this.commentElement&&this.commentElement.toggleCommentSidebar()},this.toggleSnippylyPluginToolbar=()=>{this.expanded=!this.expanded},this.loginWithGoogle=()=>{window.open(`https://snippyly-login-staging.web.app/?redirect_url=${encodeURIComponent(window.location.href)}`,"_self")},this.removeSnippyly=async()=>{try{rt("review-mode","sessionStorage");const t=new URL(document.location),i=t.searchParams;i.delete("review-doc-id"),i.delete("review-mode"),window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{await Snippyly.signOutUser(),rt("snippyly-user"),this.snippylyUser=void 0,window.open(`https://snippyly-login-staging.web.app/?signout=true&redirect_url=${encodeURIComponent(window.location.href)}`,"_self")},this.toggleMenu=t=>{this.menuOpenedId===t?this.menuOpenedId=void 0:this.menuOpenedId=t},this.copyLink=()=>{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)},this.expanded=!0,this.setWindowEventListner(),this.urlChangeListener(),this.checkUrl(),console.log("*** Staging Mode ON! ***")}get loadPlugin(){return this._loadPlugin}set loadPlugin(t){this._loadPlugin=t,this.loadPlugin?this.classList.add("visible"):this.classList.remove("visible")}get expanded(){return this._expanded}set expanded(t){this._expanded=t,this.expanded?this.classList.add("expanded"):this.classList.remove("expanded")}render(){var t,i,s,e,n,o;return this.loadPlugin?A`
56
+ const st=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==it||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var s,e;if(void 0===this.et){this.et=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(s=this.st)||void 0===s?void 0:s.has(t))&&this.et.add(t);return this.render(i)}const n=t.element.classList;this.et.forEach((t=>{t in i||(n.remove(t),this.et.delete(t))}));for(const t in i){const s=!!i[t];s===this.et.has(t)||(null===(e=this.st)||void 0===e?void 0:e.has(t))||(s?(n.add(t),this.et.add(t)):(n.remove(t),this.et.delete(t)))}return U}}),et=(t,i=0)=>{try{let s=3735928559^i,e=1103547991^i;for(let i,n=0;n<t.length;n++)i=t.charCodeAt(n),s=Math.imul(s^i,2654435761),e=Math.imul(e^i,1597334677);return s=Math.imul(s^s>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),e=Math.imul(e^e>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),4294967296*(2097151&e)+(s>>>0)}catch(t){return console.warn("Error in cyrb53: ",t),0}},nt=(t,i,s=!1,e="localStorage")=>{try{const n=s?btoa(i):i;"localStorage"===e?localStorage.setItem(t,n):sessionStorage.setItem(t,n)}catch(t){console.warn("Error in setLocalStorage: ",t)}},ot=(t,i=!1,s="localStorage")=>{try{let e=null;return e="localStorage"===s?localStorage.getItem(t):sessionStorage.getItem(t),e&&i?atob(e):e}catch(t){return console.warn("Error in getLocalStorage: ",t),null}},rt=(t,i="localStorage")=>{try{"localStorage"===i?localStorage.removeItem(t):sessionStorage.removeItem(t)}catch(t){console.warn("Error in removeLocalStorageData: ",t)}};var lt=function(t,i,s,e){for(var n,o=arguments.length,r=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(o<3?n(r):o>3?n(i,s,r):n(i,s))||r);return o>3&&r&&Object.defineProperty(i,s,r),r};let ht=class extends X{constructor(){super(),this._loadPlugin=!1,this.comments=[],this._expanded=!0,this.staging=true,this.copyLinkTooltip="Copy Link",this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const i=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),i};const i=history.replaceState;history.replaceState=function(){const t=i.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{const t=new URL(document.location),i=t.searchParams;if(i.has("snippyly_google_token")){const s=JSON.parse(atob(i.get("snippyly_google_token"))),e={};e.userId=s.uid,e.name=s.displayName,e.email=s.email,e.photoUrl=null==s?void 0:s.photoURL,e.contacts=window.SNIPPYLY_USER_CONTACTS||[],nt("snippyly-user",JSON.stringify(e),!0),i.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}if(i.has("review-mode"))if(nt("review-mode","true",!1,"sessionStorage"),i.has("review-doc-id"))this.loadPluginUI();else{const s=new URL(document.location);s.searchParams.delete("review-mode");const e=et(s.href);i.append("review-doc-id",`${e}`),window.history.replaceState({},document.title,t.href),this.loadPluginUI()}else if(ot("review-mode",!1,"sessionStorage")){const s=new URL(document.location);s.searchParams.delete("review-mode"),i.append("review-mode","true");const e=et(s.href);i.append("review-doc-id",`${e}`),window.history.replaceState({},document.title,t.href),this.loadPluginUI()}}catch(t){console.warn("Error in checkUrl: ",t)}},this.loadPluginUI=()=>{try{this.loadPlugin=!0;const t=document.createElement("snippyly-comments");window.document.body.appendChild(t);const i=document.createElement("snippyly-comments-sidebar");window.document.body.appendChild(i);const s=document.createElement("snippyly-cursor");window.document.body.appendChild(s),((t="latest",i=!1,s)=>{if(console.log("load snippyly called"),document.getElementById("snippylyScript"))s&&s();else{const e=document.createElement("script");e.src=`https://cdn.jsdelivr.net/npm/@snippyly/sdk${i?"-staging":""}@${t||"latest"}/snippyly.js`,e.id="snippylyScript",e.type="module",document.body.appendChild(e),e.onload=()=>{s&&s()}}})(void 0,this.staging,(()=>{window.Snippyly&&this.initializeSnippyly()}))}catch(t){console.warn("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{try{await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.init(this.apiKey)),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),ot("snippyly-user",!0)&&this.identifySnippyly()}catch(t){console.warn("Error in initializeSnippyly: ",t)}},this.identifySnippyly=async()=>{try{this.snippylyUser=JSON.parse(ot("snippyly-user",!0)),await Snippyly.identify(this.snippylyUser),this.getComments()}catch(t){console.warn("Error in identifySnippyly: ",t)}},this.getComments=()=>{try{this.commentElement&&this.commentElement.getAllCommentPinAnnotationsOnCurrentDocument().subscribe((t=>{this.comments=t}))}catch(t){console.warn("Error in getComments: ",t)}},this.toggleCommentSidebar=()=>{try{this.commentElement&&this.commentElement.toggleCommentSidebar()}catch(t){console.warn("Error in toggleCommentSidebar: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t)}},this.loginWithGoogle=()=>{try{window.open(`https://snippyly-login-staging.web.app/?redirect_url=${encodeURIComponent(window.location.href)}`,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t)}},this.removeSnippyly=async()=>{try{rt("review-mode","sessionStorage");const t=new URL(document.location),i=t.searchParams;i.delete("review-doc-id"),i.delete("review-mode"),window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{await Snippyly.signOutUser(),rt("snippyly-user"),this.snippylyUser=void 0,window.open(`https://snippyly-login-staging.web.app/?signout=true&redirect_url=${encodeURIComponent(window.location.href)}`,"_self")}catch(t){console.warn("Error in signOutUser: ",t)}},this.toggleMenu=t=>{try{this.menuOpenedId===t?this.menuOpenedId=void 0:this.menuOpenedId=t}catch(t){console.warn("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t)}};try{this.expanded=!0,this.setWindowEventListner(),this.urlChangeListener(),this.checkUrl(),console.log("*** Staging Mode ON! ***")}catch(t){console.warn("Error in constructor: ",t)}}get loadPlugin(){return this._loadPlugin}set loadPlugin(t){this._loadPlugin=t,this.loadPlugin?this.classList.add("visible"):this.classList.remove("visible")}get expanded(){return this._expanded}set expanded(t){this._expanded=t,this.expanded?this.classList.add("expanded"):this.classList.remove("expanded")}render(){var t,i,s,e,n,o;return this.loadPlugin?A`
57
57
  <div class="snippyly-plugin-container">
58
58
  <div class="snippyly-btn-container snippyly-menu-trigger ${st({opened:"snippylyMenu"===this.menuOpenedId})}" id="snippylyMenu" @click=${()=>this.toggleMenu("snippylyMenu")}>
59
59
  <div class="btn snippyly-btn">