UNPKG

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