mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
3 lines
7.5 KiB
JavaScript
3 lines
7.5 KiB
JavaScript
(function(){'use strict';(function(){window.HTMLImports=window.HTMLImports||{flags:{}};var i={};i.noOpts||location.search.slice(1).split('&').forEach(function(y){var z=y.split('='),A;z[0]&&(A=z[0].match(/wc-(.+)/))&&(i[A[1]]=z[1]||!0)});var j='html-imports.js',o=document.querySelector('script[src*="'+j+'"]').getAttribute('src'),s=o.slice(0,o.indexOf(j));['base.js','module.js','path.js','xhr.js','Loader.js','Observer.js','parser.js','importer.js','dynamic.js','boot.js'].forEach(function(y){document.write('<script src="'+s+y+'"></script>')}),window.HTMLImports.flags=i})(),function(i){'use strict';var j=i.flags.shadydom;j&&(window.ShadyDOM=window.ShadyDOM||{},ShadyDOM.force=j);var o=i.flags.register||i.flags.ce;o&&window.customElements&&(customElements.forcePolyfill=o)}(window.WebComponents),function(){function i(){this.a=new Map,this.j=new Map,this.h=new Map,this.o=new Set,this.C=new MutationObserver(this.D.bind(this)),this.f=null,this.F=new Set,this.enableFlush=!0,this.s=!1,this.m=null}function j(){return A.customElements}function o(J){if(!/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(J)||-1!==B.indexOf(J))return Error('The element name \''+J+'\' is not valid.')}function s(J,K,L,M){var N=j();return J=L?D.call(J,K,L):D.call(J,K),(K=N.a.get(K.toLowerCase()))&&N.u(J,K,M),N.b(J),J}function y(J,K,L,M){K=K.toLowerCase();var N=J.getAttribute(K);M.call(J,K,L),1==J.__$CE_upgraded&&(M=j().a.get(J.localName),L=M.A,(M=M.i)&&0<=L.indexOf(K)&&(L=J.getAttribute(K),L!==N&&M.call(J,K,N,L,null)))}var z=document,A=window;if(!(j()&&(j().g=function(){},!j().forcePolyfill))){var B='annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph'.split(' ');i.prototype.L=function(J,K){function L(R){var S=O[R];if(void 0!==S&&'function'!=typeof S)throw Error(N+' \''+R+'\' is not a Function');return S}if('function'!=typeof K)throw new TypeError('constructor must be a Constructor');var M=o(J);if(M)throw M;if(this.a.has(J))throw Error('An element with name \''+J+'\' is already defined');if(this.j.has(K))throw Error('Definition failed for \''+J+'\': The constructor is already used.');var N=J,O=K.prototype;if('object'!=typeof O)throw new TypeError('Definition failed for \''+J+'\': constructor.prototype must be an object');var M=L('connectedCallback'),P=L('disconnectedCallback'),Q=L('attributeChangedCallback');this.a.set(N,{name:J,localName:N,constructor:K,v:M,w:P,i:Q,A:Q&&K.observedAttributes||[]}),this.j.set(K,N),this.K(),(J=this.h.get(N))&&(J.resolve(void 0),this.h.delete(N))},i.prototype.get=function(J){return(J=this.a.get(J))?J.constructor:void 0},i.prototype.M=function(J){var K=o(J);if(K)return Promise.reject(K);if(this.a.has(J))return Promise.resolve();if(K=this.h.get(J))return K.N;var L,M=new Promise(function(N){L=N}),K={N:M,resolve:L};return this.h.set(J,K),M},i.prototype.g=function(){this.enableFlush&&(this.l(this.m.takeRecords()),this.D(this.C.takeRecords()),this.o.forEach(function(J){this.l(J.takeRecords())},this))},i.prototype.K=function(){var J=this;if(!this.s){this.s=!0;var K=function(){J.s=!1,J.m||(J.m=J.b(z)),J.c(z.childNodes)};window.HTMLImports?window.HTMLImports.whenReady(K):K()}},i.prototype.I=function(J){this.f=J},i.prototype.b=function(J){return null==J.__$CE_observer?(J.__$CE_observer=new MutationObserver(this.l.bind(this)),J.__$CE_observer.observe(J,{childList:!0,subtree:!0}),this.enableFlush&&this.o.add(J.__$CE_observer),J.__$CE_observer):J.__$CE_observer},i.prototype.J=function(J){null!=J.__$CE_observer&&(J.__$CE_observer.disconnect(),this.enableFlush&&this.o.delete(J.__$CE_observer),J.__$CE_observer=null)},i.prototype.l=function(J){for(var K=0;K<J.length;K++){var L=J[K];if('childList'===L.type){var M=L.removedNodes;this.c(L.addedNodes),this.H(M)}}},i.prototype.c=function(J,K){K=K||new Set;for(var L=0;L<J.length;L++){var M=J[L];if(M.nodeType===Node.ELEMENT_NODE){this.J(M),M=z.createTreeWalker(M,NodeFilter.SHOW_ELEMENT,null,!1);do this.G(M.currentNode,K);while(M.nextNode())}}},i.prototype.G=function(J,K){if(!K.has(J)){K.add(J);var L=this.a.get(J.localName);if(L){J.__$CE_upgraded||this.u(J,L,!0);var M;if(M=J.__$CE_upgraded&&!J.__$CE_attached)a:{M=J;do{if(M.__$CE_attached||M.nodeType===Node.DOCUMENT_NODE){M=!0;break a}M=M.parentNode||M.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&M.host}while(M);M=!1}M&&(J.__$CE_attached=!0,L.v&&L.v.call(J))}J.shadowRoot&&this.c(J.shadowRoot.childNodes,K),'LINK'===J.tagName&&J.rel&&-1!==J.rel.toLowerCase().split(' ').indexOf('import')&&this.B(J,K)}},i.prototype.B=function(J,K){var L=J.import;if(L)K.has(L)||(K.add(L),L.__$CE_observer||this.b(L),this.c(L.childNodes,K));else if(K=J.href,!this.F.has(K)){this.F.add(K);var M=this,N=function(){J.removeEventListener('load',N),J.import.__$CE_observer||M.b(J.import),M.c(J.import.childNodes)};J.addEventListener('load',N)}},i.prototype.H=function(J){for(var K=0;K<J.length;K++){var L=J[K];if(L.nodeType===Node.ELEMENT_NODE){this.b(L),L=z.createTreeWalker(L,NodeFilter.SHOW_ELEMENT,null,!1);do{var M=L.currentNode;if(M.__$CE_upgraded&&M.__$CE_attached){M.__$CE_attached=!1;var N=this.a.get(M.localName);N&&N.w&&N.w.call(M)}}while(L.nextNode())}}},i.prototype.u=function(J,K,L){if(J.__proto__=K.constructor.prototype,L&&(this.I(J),new K.constructor,J.__$CE_upgraded=!0,console.assert(!this.f)),L=K.A,(K=K.i)&&0<L.length){this.C.observe(J,{attributes:!0,attributeOldValue:!0,attributeFilter:L});for(var M=0;M<L.length;M++){var N=L[M];if(J.hasAttribute(N)){var O=J.getAttribute(N);K.call(J,N,null,O,null)}}}},i.prototype.D=function(J){for(var K=0;K<J.length;K++){var L=J[K];if('attributes'===L.type){var M=L.target,N=this.a.get(M.localName),O=L.attributeName,P=L.oldValue,Q=M.getAttribute(O);Q!==P&&N.i.call(M,O,P,Q,L.attributeNamespace)}}},window.CustomElementRegistry=i,i.prototype.define=i.prototype.L,i.prototype.get=i.prototype.get,i.prototype.whenDefined=i.prototype.M,i.prototype.flush=i.prototype.g,i.prototype.polyfilled=!0,i.prototype._observeRoot=i.prototype.b,i.prototype._addImport=i.prototype.B;var C=A.HTMLElement;i.prototype.nativeHTMLElement=C,A.HTMLElement=function(){var J=j();if(J.f){var K=J.f;return J.f=null,K}if(this.constructor)return J=J.j.get(this.constructor),s(z,J,void 0,!1);throw Error('Unknown constructor. Did you call customElements.define()?')},A.HTMLElement.prototype=C.prototype;var D=z.createElement;z.createElement=function(J,K){return s(z,J,K,!0)};var E=z.createElementNS;z.createElementNS=function(J,K){return'http://www.w3.org/1999/xhtml'===J?z.createElement(K):E.call(z,J,K)};var F=Element.prototype.attachShadow;F&&Object.defineProperty(Element.prototype,'attachShadow',{value:function(J){return J=F.call(this,J),j().b(J),J}});var G=z.importNode;z.importNode=function(J,K){return J=G.call(z,J,K),j().c(J.nodeType===Node.ELEMENT_NODE?[J]:J.childNodes),J};var H=Element.prototype.setAttribute;Element.prototype.setAttribute=function(J,K){y(this,J,K,H)};var I=Element.prototype.removeAttribute;Element.prototype.removeAttribute=function(J){y(this,J,null,I)},Object.defineProperty(window,'customElements',{value:new i,configurable:!0,enumerable:!0}),window.CustomElements={takeRecords:function(){j().g&&j().g()}}}}(),function(){'use strict';HTMLImports.whenReady(function(){requestAnimationFrame(function(){window.dispatchEvent(new CustomEvent('WebComponentsReady'))})})}(window.WebComponents),function(){var i=document.createElement('style');i.textContent='body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n';var j=document.querySelector('head');j.insertBefore(i,j.firstChild)}(window.WebComponents)})();
|
|
//# sourceMappingURL=webcomponents-hi-ce.min.js.map
|