UNPKG

sth-qrcode

Version:

A web component to generate QR codes for SmartHoldem payments.

5 lines 12.5 kB
/*! Built with http://stenciljs.com */ (function(Context,appNamespace,hydratedCssClass,publicPath){"use strict"; var s=document.querySelector("script[data-namespace='sthqrcode']");if(s){publicPath=s.getAttribute('data-path');} (function(n,t,e,o,i){"use strict";function c(n,t,e,o,i){let c=t.is+(e||""),l=t[c];if(l||(l=t[c=t.is]),l){let e=n.n;if(n.t)if("shadow"===t.e)e=o.shadowRoot;else for(;o=n.o(o);)if(o.host&&o.host.shadowRoot){e=o.host.shadowRoot;break}const r=e.i=e.i||{};if(!r[c]){i=l.content.cloneNode(!0);const t=e.querySelector("[data-visibility]");n.c(e,i,t&&t.nextSibling||e.l),r[c]=!0}}}function l(n){return{r:n[0],f:n[1],u:!!n[2],s:!!n[3],a:!!n[4]}}function r(n,t){if(E(t)){if(n===Boolean||3===n)return"false"!==t&&(""===t||!!t);if(n===Number||4===n)return parseFloat(t)}return t}function f(n,t,e){n.d&&((e=n.d.$activeLoading)&&((t=e.indexOf(n))>-1&&e.splice(t,1),!e.length&&n.d.$initLoad()),n.d=null)}function u(n,t,e){for(var o,i=!1,c=!1,l=arguments.length;l-- >2;)M.push(arguments[l]);for(;M.length;)if((e=M.pop())&&void 0!==e.pop)for(l=e.length;l--;)M.push(e[l]);else"boolean"==typeof e&&(e=null),(c="function"!=typeof n)&&(null==e?e="":"number"==typeof e?e=String(e):"string"!=typeof e&&(c=!1)),c&&i?o[o.length-1].p+=e:void 0===o?o=[c?s(e):e]:o.push(c?s(e):e),i=c;const r=new A;if(r.m=n,r.v=o,t&&(r.b=t,r.y=t.g,r.w=t.ref,t.className&&(t.class=t.className),"object"==typeof t.class)){for(l in t.class)t.class[l]&&M.push(l);t.class=M.join(" "),M.length=0}return r}function s(n){const t=new A;return t.p=n,t}function a(n,t){t.C||(t.C=!0,n.N.add(()=>{t.C=!1,d(n,t)}))}function d(n,t){if(!t.j){const e=!t.O;if(e){const e=t.d;if(e&&!e.$rendered)return void(e.$onRender=e.$onRender||[]).push(()=>{d(n,t)});(function e(n,t,o){try{o=n.x(t).k,t.O=new o,function i(n,t,e,o,c,l){o.S=e,e.T=e.T||{},c=Object.assign({mode:{type:String},color:{type:String}},t.properties);for(l in c)m(n,c[l],e,o,l)}(n,o,t,t.O)}catch(e){t.O={},n.A(e,7,t,!0)}})(n,t)}p(n,t,e)}}function p(n,t,e){try{(function o(n,t,e,i){const c=t.O,l=e.host;if(c.render||c.hostData||l){n.M=!0;const o=c.render&&c.render();n.M=!1;const l=t.P||new A;l.B=t,t.P=n.render(l,u(null,void 0,o),i,t.L,e.e)}n.R(n.q,e,c.mode,t),t.$rendered=!0,t.$onRender&&(t.$onRender.forEach(n=>n()),t.$onRender=null)})(n,t,n.x(t).k,!e)}catch(e){n.A(e,8,t,!0)}try{e?t.$initLoad():t.O.componentDidUpdate&&t.O.componentDidUpdate()}catch(e){n.A(e,6,t,!0)}}function m(n,t,e,o,i){function c(n){return(n=this.S)&&n.T&&n.T[i]}function l(e,o){(o=this.S)&&(t.state||t.mutable)&&v(n,o,i,e)}if(t.type||t.state){if(!t.state){if(t.attr&&(void 0===e.T[i]||""===e.T[i])){const o=n.q.D(e,t.attr);null!=o&&(e.T[i]=r(t.type,o))}e.hasOwnProperty(i)&&(void 0===e.T[i]&&(e.T[i]=e[i]),delete e[i])}o.hasOwnProperty(i)&&void 0===e.T[i]&&(e.T[i]=o[i]),t.watchCallbacks&&(e.T[P+i]=t.watchCallbacks.slice()),b(o,i,c,l)}else t.elementRef?h(o,i,e):t.method&&h(e,i,o[i].bind(o))}function v(n,t,e,o,i,c,l){const r=(i=t.T=t.T||{})[e];if(o!==r&&(i[e]=o,c=t.O)){if(l=i[P+e])for(let n=0;n<l.length;n++)try{c[l[n]].call(c,o,r)}catch(n){}n.M||a(n,t)}}function h(n,t,e){Object.defineProperty(n,t,{configurable:!0,value:e})}function b(n,t,e,o){Object.defineProperty(n,t,{configurable:!0,get:e,set:o})}function y(n,t,e,o,i){const c=11===e.B.nodeType&&e.B.host?e.B.host:e.B,l=t&&t.b||N,r=e.b||N;for(i in l)r&&null!=r[i]||null==l[i]||g(n,c,i,l[i],void 0,o);for(i in r)i in l&&r[i]===("value"===i||"checked"===i?c[i]:l[i])||g(n,c,i,l[i],r[i],o)}function g(n,t,e,o,i,c,l,r){if("class"!==e||c)if("style"===e){o=o||N,i=i||N;for(l in o)i[l]||(t.style[l]="");for(l in i)i[l]!==o[l]&&(t.style[l]=i[l])}else if("o"!==e[0]||"n"!==e[1]||e in t)if("list"!==e&&"type"!==e&&!c&&(e in t||-1!==["object","function"].indexOf(typeof i)&&null!==i)){const o=n.x(t);o&&o.H&&o.H[e]?w(t,e,i):"ref"!==e&&(w(t,e,null==i?"":i),null!=i&&!1!==i||t.removeAttribute(e))}else null!=i&&(l=e!==(e=e.replace(/^xlink\:?/,"")),1!==B[e]||i&&"false"!==i?"function"!=typeof i&&(l?t.setAttributeNS(L,x(e),i):t.setAttribute(e,i)):l?t.removeAttributeNS(L,x(e)):t.removeAttribute(e));else e=x(e.substring(2)),i?o||n.q.z(t,e,i):n.q.F(t,e);else if(o!==i){const n=null==o||""===o?j:o.trim().split(/\s+/),e=null==i||""===i?j:i.trim().split(/\s+/);let c=null==t.className||""===t.className?j:t.className.trim().split(/\s+/);for(l=0,r=n.length;l<r;l++)-1===e.indexOf(n[l])&&(c=c.filter(t=>t!==n[l]));for(l=0,r=e.length;l<r;l++)-1===n.indexOf(e[l])&&(c=[...c,e[l]]);t.className=c.join(" ")}}function w(n,t,e){try{n[t]=e}catch(n){}}function $(n,t){n&&(n.w&&n.w(t?null:n.B),n.v&&n.v.forEach(n=>{$(n,t)}))}function C(n,t,e,o){return function(){const i=arguments;return function c(n,t,e){return new Promise(o=>{let i=t[e];i||(i=n.I.querySelector(e)),i||(i=t[e]=n.W(e),n.Z(n.I,i)),i.componentOnReady(o)})}(n,t,e).then(n=>n[o].apply(n,i))}}const N={},j=[],O={enter:13,escape:27,space:32,tab:9,left:37,up:38,right:39,down:40},E=n=>void 0!==n&&null!==n,k=n=>void 0===n||null===n,x=n=>n.toLowerCase(),S=n=>x(n.replace(/([A-Z])/g,n=>" "+n[0]).trim().replace(/ /g,"-")),T=()=>{};class A{}const M=[],P="wc-",B={allowfullscreen:1,async:1,autofocus:1,autoplay:1,checked:1,controls:1,disabled:1,enabled:1,formnovalidate:1,hidden:1,multiple:1,noresize:1,readonly:1,required:1,selected:1,spellcheck:1},L="http://www.w3.org/1999/xlink";let R=!1;const q=n[o]=n[o]||{};{const o=function D(t,e,o,i,s,d){const p={html:{}},m={},g=function w(n,t){const e=new WeakMap,o={G:t.documentElement,n:t.head,I:t.body,J:!1,K:n=>n.nodeType,W:n=>t.createElement(n),Q:(n,e)=>t.createElementNS(n,e),U:n=>t.createTextNode(n),V:n=>t.createComment(n),c:(n,t,e)=>n.insertBefore(t,e),X:(n,t)=>n.removeChild(t),Z:(n,t)=>n.appendChild(t),Y:n=>n.childNodes,o:n=>n.parentNode,_:n=>n.nextSibling,nn:n=>x(n.tagName),tn:n=>n.textContent,en:(n,t)=>n.textContent=t,D:(n,t)=>n.getAttribute(t),on:(n,t,e)=>n.setAttribute(t,e),in:(n,t,e,o)=>n.setAttributeNS(t,e,o),cn:(n,t)=>n.removeAttribute(t),ln:(e,i)=>"child"===i?e.firstElementChild:"parent"===i?o.rn(e):"body"===i?o.I:"document"===i?t:"window"===i?n:e,z:(n,t,i,c,l,r,f,u)=>{const s=t;let a=n,d=e.get(n);if(d&&d[s]&&d[s](),"string"==typeof r?a=o.ln(n,r):"object"==typeof r?a=r:(u=t.split(":")).length>1&&(a=o.ln(n,u[0]),t=u[1]),!a)return;let p=i;(u=t.split(".")).length>1&&(t=u[0],p=(n=>{n.keyCode===O[u[1]]&&i(n)})),f=o.J?{capture:!!c,passive:!!l}:!!c,a.addEventListener(t,p,f),d||e.set(n,d={}),d[s]=(()=>{a&&a.removeEventListener(t,p,f),d[s]=null})},F:(n,t)=>{const o=e.get(n);o&&(t?o[t]&&o[t]():(Object.keys(o).forEach(n=>{o[n]&&o[n]()}),e.delete(n)))}};return o.fn=((n,t)=>n.attachShadow(t)),o.t=!!o.G.attachShadow,o.rn=((n,t)=>(t=o.o(n))&&11===o.K(t)?t.host:t),o}(o,i);t.isServer=t.isPrerender=!(t.isClient=!0),t.window=o,t.location=o.location,t.document=i,t.publicPath=s,e.h=u,e.Context=t;const N=o.$definedCmps=o.$definedCmps||{},j={un:function A(n,e){e.mode||(e.mode=g.D(e,"mode")||t.mode),g.D(e,"data-ssrv")||function o(n,t){return n&&1===t.e}(g.t,n)||function i(n,t,e){t.$defaultHolder||n.c(t,t.$defaultHolder=n.V(""),e[0]);let o,i,c,l=0;for(;l<e.length;l++){var r=e[l];1===n.K(r)&&null!=(o=n.D(r,"slot"))?(c=c||{})[o]?c[o].push(r):c[o]=[r]:i?i.push(r):i=[r]}t.L={sn:i,an:c}}(g,e,e.childNodes),g.t||1!==n.e||(e.shadowRoot=e)},q:g,dn:function M(n,t){if(!N[n.pn]){N[n.pn]=!0,function e(n,t,o,i){o.connectedCallback=function(){(function e(n,t,o){o.$connected||(o.$connected=!0,o.j=null,function i(n,t,e){for(e=t;e=n.q.rn(e);)if(n.mn(e)){e.vn||(t.d=e,(e.$activeLoading=e.$activeLoading||[]).push(t));break}}(n,o),n.N.add(()=>{n.un(t,o),n.hn(t,o.mode,()=>a(n,o))},3))})(n,t,this)},o.attributeChangedCallback=function(n,e,o){(function i(n,t,e,o,c,l){if(o!==c&&n){e=x(e);for(l in n)if(n[l].bn===e){t[l]=r(n[l].yn,c);break}}})(t.H,this,n,e,o)},o.disconnectedCallback=function(){(function t(n,e){!n.gn&&function o(n,t){for(;t;){if(!n.o(t))return 9!==n.K(t);t=n.o(t)}}(n.q,e)&&(e.j=!0,f(e),$(e.P,!0),n.q.F(e),e.L&&(e.L=e.L.sn=e.L.an=null),e.O&&(e.O=e.O.S=null),e.$activeLoading=e.$connected=e.$defaultHolder=e.wn=e.T=e.P=e.d=e.vn=e.C=e.$n=null)})(n,this)},o.componentOnReady=function(n,t){return n||(t=new Promise(t=>n=t)),function e(n,t){n.j||(n.vn?t(n):(n.Cn=n.Cn||[]).push(t))}(this,n),t},o.$initLoad=function(){(function t(n,e,o){if(e.O&&!e.j&&(!e.$activeLoading||!e.$activeLoading.length)){e.$activeLoading=null,e.vn=!0;try{$(e.P),e.Cn&&(e.Cn.forEach(n=>n(e)),e.Cn=null),e.O.componentDidLoad&&e.O.componentDidLoad()}catch(t){n.A(t,4,e)}e.classList.add(o),f(e)}})(n,this,i)},o.Nn=function(){a(n,this)},function c(n,t,e){t&&Object.keys(t).forEach(o=>{const i=t[o].jn;1===i||2===i?b(e,o,function n(){return(this.T=this.T||{})[o]},function t(e){v(n,this,o,e)}):6===i&&h(e,o,T)})}(n,t.H,o)}(j,n,t.prototype,d);{const e=[];for(var i in n.H)n.H[i].bn&&e.push(n.H[i].bn),t.observedAttributes=e}o.customElements.define(n.pn,t)}},On:t.emit,x:n=>p[g.nn(n)],En:n=>t[n],isClient:!0,mn:n=>!(!N[g.nn(n)]&&!j.x(n)),hn:function P(n,t,e){if(n.k)e();else{const o=n.kn[t]||n.kn,c=s+o+(function o(n,t){return 2===t.e||1===t.e&&!n}(g.t,n)?".sc":"")+".js";import(c).then(t=>{try{n.k||(n.k=t[(i=n.pn,x(i).split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""))]),function o(n,t){const e=t.style;if(e){const o=t.is+(t.styleMode||"");if(!t[o]){const i=n.W("template");t[o]=i,i.innerHTML="<style>"+e+"</style>",n.Z(n.n,i)}}}(g,n.k)}catch(t){n.k=class{}}e()}).catch(n=>void 0)}var i},A:(n,t,e)=>void 0,xn:n=>(function t(n,e,o){return{create:C(n,e,o,"create"),componentOnReady:C(n,e,o,"componentOnReady")}})(g,m,n),N:function B(t,e,o){function i(){for(;s.length>0;)s.shift()();e=!1}function c(n){for(n=r(),i();a.length>0&&r()-n<40;)a.shift()();(o=a.length>0)&&f(l)}function l(n){for(i(),n=4+r();a.length>0&&r()<n;)a.shift()();(o=a.length>0)&&f(c)}const r=()=>t.performance.now(),f=t=>n.requestAnimationFrame(t),u=Promise.resolve(),s=[],a=[];return{add:(n,t)=>{3===t?(s.push(n),e||(e=!0,u.then(i))):(a.push(n),o||(o=!0,f(c)))}}}(o),Sn:n=>(n||[]).map(n=>(function t(n,e,o){const i={pn:n[0],H:{color:{bn:"color"}}};i.kn=n[1];const c=n[3];if(c)for(var r=0;r<c.length;r++){var f=c[r];i.H[f[0]]={jn:f[1],bn:f[2]?1===o?x(f[0]):S(f[0]):0,yn:f[3]}}return i.e=n[4],n[5]&&(i.Tn=n[5].map(l)),e[i.pn]=i})(n,p))};j.render=function L(n,t){function e(o,i,c){let l=0;if("function"==typeof o.m&&(o=o.m(Object.assign({},o.b,{An:o.v}))),!s&&"slot"===o.m){if(u){a&&t.on(i,a+"-slot","");let e,c=o.b&&o.b.name;if(e=E(c)?u.an&&u.an[c]:u.sn,E(e)){for(n.gn=!0;l<e.length;l++)t.Z(i,t.X(t.o(e[l]),e[l]));n.gn=!1}}return null}if(E(o.p))o.B=t.U(o.p);else{const i=o.B=R||"svg"===o.m?t.Q("http://www.w3.org/2000/svg",o.m):t.W(o.m);R="svg"===o.m||"foreignObject"!==o.m&&R,y(n,null,o,R),null!==a&&i.Mn!==a&&t.on(i,i.Mn=a,"");const c=o.v;if(c){let n;for(;l<c.length;++l)(n=e(c[l],i))&&t.Z(i,n)}}return o.B}function o(n,o,i,c,l){const r=n.$defaultHolder&&t.o(n.$defaultHolder)||n;let f;for(;c<=l;++c){var u=i[c];E(u)&&(f=E(u.p)?t.U(u.p):e(u,n),E(f)&&(u.B=f,t.c(r,f,o)))}}function i(n,e,o,i){for(;o<=i;++o)E(e[o])&&t.X(n,e[o].B)}function c(n,t){return n.m===t.m&&n.y===t.y}function l(n,t,e){let o,i,c,l={};for(o=t;o<=e;++o)null!=(c=n[o])&&void 0!==(i=c.y)&&(l.Pn=o);return l}function r(f,u){const s=u.B=f.B,a=f.v,d=u.v;if(R=u.B&&null!=u.B.parentElement&&void 0!==u.B.Bn,R="svg"===u.m||"foreignObject"!==u.m&&R,k(u.p))"slot"!==u.m&&y(n,f,u,R),E(a)&&E(d)?function p(n,f,u){let s,a,d,p,m=0,v=0,h=f.length-1,b=f[0],y=f[h],g=u.length-1,w=u[0],$=u[g];for(;m<=h&&v<=g;)null==b?b=f[++m]:null==y?y=f[--h]:null==w?w=u[++v]:null==$?$=u[--g]:c(b,w)?(r(b,w),b=f[++m],w=u[++v]):c(y,$)?(r(y,$),y=f[--h],$=u[--g]):c(b,$)?(r(b,$),t.c(n,b.B,t._(y.B)),b=f[++m],$=u[--g]):c(y,w)?(r(y,w),t.c(n,y.B,b.B),y=f[--h],w=u[++v]):(k(s)&&(s=l(f,m,h)),a=s[w.y],k(a)?(p=e(w,n),w=u[++v]):((d=f[a]).m!==w.m?p=e(w,n):(r(d,w),f[a]=void 0,p=d.B),w=u[++v]),p&&t.c(n,p,b.B));m>h?o(n,null==u[g+1]?null:u[g+1].B,u,v,g):v>g&&i(n,f,m,h)}(s,a,d):E(d)?(E(f.p)&&t.en(s,""),o(s,null,d,0,d.length-1)):E(a)&&i(s,a,0,a.length-1);else if(s.L&&s.L.sn){let n=s.L.sn[0].parentElement;t.en(n,u.p),s.L.sn=[n.childNodes[0]]}else f.p!==u.p&&t.en(s,u.p)}let f,u,s,a;return function n(e,o,i,c,l,d){return f=i,u=c,a="scoped"===l||"shadow"===l&&!t.t?"data-"+t.nn(e.B):null,s="shadow"===l&&t.t,f||(s?e.B=t.fn(e.B,{mode:"open"}):a&&t.on(e.B,a+"-host","")),r(e,o),o}}(j,g);const q=g.G;return q.$rendered=!0,q.$activeLoading=[],q.$initLoad=(()=>q.vn=!0),j.R=c,j}(e,q,n,t,i,hydratedCssClass);o.Sn(q.components).forEach(n=>o.dn(n,class extends HTMLElement{}))}})(window,document,Context,appNamespace,publicPath); })({},"sthqrcode","hydrated","/build/sthqrcode/");