@bitjson/qr-code
Version:
QR Code Web Component
2 lines • 44.1 kB
JavaScript
/*! Built with http://stenciljs.com */
QrCode.loadBundle("mu42bxql",["exports"],function(t){var e,r=window.QrCode.h,n=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},o=function(){return n()+n()+n()+n()+n()+n()+n()+n()};function i(t){return!!t||0===t||!1===t}function a(t){return"function"==typeof t}function u(t){return"number"==typeof t}function f(t){return"object"==typeof t&&!!t}function s(t){return"string"==typeof t}function c(t){return t&&isFinite(t.length)&&!s(t)&&!a(t)}function l(t){return t.nodeType||t instanceof SVGElement}function d(t,e){return t.hasOwnProperty(e)}var g=1,h=2,v=3,p=void 0,m=/^([+|-]*[0-9]*[.]*?[0-9]+)([a-z%]+)*$/i;function y(t,e){return-1!==function(t,e){return t.indexOf(e)}(t,e)}function w(t,e,r){var n=t&&t.length;if(!n)return p;if(e===p)return t[r?n-1:0];if(r){for(var o=n-1;o>-1;o--)if(e(t[o]))return t[o]}else for(o=0;o<n;o++)if(e(t[o]))return t[o];return p}function b(t,e){var r=t.indexOf(e);return-1!==r?t.splice(r,1):p}function C(t){return function(e,r){var n=e[t],o=r[t];return n<o?-1:n>o?1:0}}function k(t){return i(t)?c(t)?t:[t]:[]}function B(t,e){return e!==p&&Array.prototype.push.call(t,e),e}function M(t,e){return y(t,e)||B(t,e),e}function A(t,e){var r=[];return R(t,function(t){var n=e(t);c(n)?R(n,function(t){return B(r,t)}):B(r,n)}),r}function R(t,e){for(var r=k(t),n=0,o=r.length;n<o;n++)e(r[n],n,o)}var x="tick",S=requestAnimationFrame,L=cancelAnimationFrame,T=function(){return performance.now()},D=[],I=p,z=p;function q(){L(I),I=z=p}function P(){var t=D.length;if(z=z||T(),t){var e=T(),r=e-z;z=e,I=S(P);for(var n=t-1;n>-1;n--){var o=D[n];vt(x,o,r)}}else q()}function j(t){b(D,t),D.length||q()}var E=function(t,e,r){R(t.players,function(t){return t.cancel()}),t.state=g,t.time=p,t.round=p,t.players=p,j(t.id),r.trigger("cancel")},F=function(t,e,r){E(t,0,r),r.destroyed=!0},O=Math.abs,Q=Math.floor,Y=Math.max,X=Math.min;function W(t,e,r){return t!==p&&e<=t&&t<=r}var H={};function N(t){H[t.name]=t}var G=0,U=/\[object ([a-z]+)\]/i;function V(t,e){for(var r in t)if(t[r]===e)return r;var n=function(t){var e=t.id||t.name;if(!e){e=Object.prototype.toString.call(t);var r=U.exec(e);r&&(e=r[1])}return"@"+e+"_"+ ++G}(e);return t[n]=e,n}function Z(t){return s(t)?Array.prototype.slice.call(document.querySelectorAll(t)):a(t)?Z(t()):c(t)?A(t,Z):f(t)?[t]:[]}function $(){var t={};return R(arguments,function(e){for(var r in e)d(e,r)&&(t[r]=e[r])}),t}function _(t,e,r,n){return a(t)?_(t(e,r,n),e,r,n):t}var J=C("offset");function K(t){var e;R(t,function(t){t.value!==p?e=t.value:t.value=e})}function tt(t){for(var e,r=t.length-1;r>-1;r--){var n=t[r];n.interpolate!==p?e=n.interpolate:n.interpolate=e}}function et(t,e,r,n,o){var i=w(e,function(t){return 0===t.offset});if(i===p||i.value===p){var a=n.getValue(r,o);i===p?e.splice(0,0,{offset:0,value:a,easing:t.easing,interpolate:p}):(i.value=a,i.easing=t.easing,i.interpolate=p)}}function rt(t,e){var r=w(e,function(t){return 1===t.offset},!0);if(r===p||r.value===p){var n=e[e.length-1].value;r===p?B(e,{offset:1,value:n,easing:t.easing,interpolate:p}):(r.value=n,r.easing=r.easing||t.easing)}}var nt=function(t,e,r){t.players===p&&function(t){t.players=[],R(t.configs,function(e){return function(t,e){R(function(t){var e=t.keyframes,r=t.from,n=t.to,o=t.stagger||0,i=t.duration,a=[];return R(Z(t.target),function(u,f,s){var c={},l={};for(var d in R(e,function(t){var e=c[t.prop]||(c[t.prop]=[]),n=(t.time-r)/(i||1),o=t.easing,a=t.interpolate,f=_(t.value,u,t.index,s);l[t.prop]=t.plugin;var d=w(e,function(t){return t.offset===n})||B(e,{easing:o,offset:n,value:f,interpolate:a});d.easing=o,d.value=f,d.interpolate=a}),H){var g=H[d];if(g.onWillAnimate&&t.keyframes.some(function(t){return t.plugin===d})){var h=$(t,{target:u});g.onWillAnimate(h,c,l)}}for(var v in c){var p=c[v],m=l[v],y=H[m];p&&(p.sort(J),et(t,p,u,y,v),K(p),tt(p),rt(t,p),B(a,{plugin:l[v],target:u,prop:v,from:r+(o?o*f:0),to:n+(o?o*f:0),keyframes:p}))}}),a}(function t(e,r,n){if(!i(r)||u(r)||a(r))return r;if(s(r)){var o=r;return d(e,o)&&"@"===o.charAt(0)?e[o]:o}if(c(r)){var f=[];return R(r,function(r){return B(f,t(e,r,n))}),f}if(!n||l(r))return r;var g={};for(var h in r)if(d(r,h)){var v=r[h];g[h]=n?t(e,v,"targets"!==h):v}return g}(t.refs,e,!0)),function(e){var r=H[e.plugin].animate(e);r&&(r.from=e.from,r.to=e.to,B(t.players,r))})}(t,e)}),function(t){t.duration=Y.apply(p,t.players.filter(function(t){return isFinite(t.to)}).map(function(t){return t.to})),t.time=isFinite(t.time)?t.time:t.rate<0?t.duration:0}(t)}(t);var n=t.state===v,o=t.time;n||j(t.id),R(t.players,function(e){var r=e.from,i=e.to,a=n&&W(Q(o),r,i),u=(1,X(Y((o-r)/(i-r),0),1));e.update(u,t.rate,a)}),r.trigger("update")},ot=function(t,e,r){t.round=0,t.state=h,t.yoyo||(t.time=t.rate<0?0:t.duration),j(t.id),nt(t,0,r),r.trigger("finish"),t.destroy&&F(t,0,r)},it=function(t,e,r){t.state=h,j(t.id),nt(t,0,r),r.trigger("pause")},at=function(t,e,r){e&&(t.repeat=e.repeat,t.yoyo=!!e.alternate,t.destroy=!!e.destroy),t.repeat=t.repeat||1,t.yoyo=t.yoyo||!1,t.state=v;var n,o=t.rate>=0;o&&t.time===t.duration?t.time=0:o||0!==t.time||(t.time=t.duration),n=t.id,y(D,n)||B(D,n),I||(I=S(P)),nt(t,0,r),r.trigger("play")},ut=function(t){for(var e=0,r=0,n=t.configs,o=0,i=n.length;o<i;o++){var a=n[o],u=a.keyframes.map(function(t){return t.time}),f=Y.apply(p,u),s=X.apply(p,u);a.to=f,a.from=s,a.duration=f-s,e=Y(f,e),r=Y(f+a.endDelay,r)}t.cursor=r,t.duration=e},ft=C("time"),st=function(t,e,r){R(e,function(e){if(e.to===p)throw new Error("missing duration");R((e=function t(e,r,n){if(!i(r)||s(r)||u(r))return r;if(c(r))return A(r,function(r){return t(e,r,n)});if(a(r))return V(e,r);if(n){for(var o in r)d(r,o)&&(r[o]=t(e,r[o],n&&"targets"!==o));return r}return V(e,r)}(t.refs,e,!0)).targets,function(n,o,a){var u=function(t,e,r,n,o){var a=_(o.delay,e,r,n)||0,u=w(t.configs,function(t){return t.target===e})||B(t.configs,{from:Y(o.from+a,0),to:Y(o.to+a,0),easing:o.easing||"ease",duration:o.to-o.from,endDelay:_(o.endDelay,e,r,n)||0,stagger:o.stagger||0,target:e,targetLength:n,propNames:[],keyframes:[]}),f=o.stagger&&o.stagger*(r+1)||0,s=_(o.delay,u,r,u.targetLength)||0,c=Y(f+s+o.from,0),l=o.to-o.from,g=o.easing||"ease";for(var h in H)if(d(o,h)){var v=o[h];for(var p in v){var m=v[p];d(v,p)&&i(m)&&ct(u,h,r,p,m,l,c,g)}}return u.keyframes.sort(ft),u}(t,n,o,a,e);r.dirty(u)})}),ut(t),r.trigger("config")};function ct(t,e,r,n,o,a,s,l){var d,g;if(!c(o)&&f(o)){var h=o;h.easing&&(l=h.easing),h.interpolate&&(d=h.interpolate),g=k(h.value)}else g=k(o);var v=g.map(function(e,n,o){var i=_(e,t.target,r,t.targetLength),a=i,s=f(i),c=s?a.value:i,g=s&&u(a.offset)?a.offset:n===o.length-1?1:0===n?0:p,h=a&&a.interpolate||d;return{offset:g,value:c,easing:a&&a.easing||l,interpolate:h}});!function(t){if(t.length){var e=w(t,function(t){return 0===t.offset})||t[0];i(e.offset)||(e.offset=0);var r=w(t,function(t){return 1===t.offset},!0)||t[t.length-1];t.length>1&&!i(r.offset)&&(r.offset=1);for(var n=1,o=t.length;n<o;n++){if(!i(t[n].offset))for(var a=n+1;a<o;a++){var u=t[a].offset;if(i(u)){for(var f=t[n-1].offset,s=u-f,c=a-n+1,l=1;l<c;l++)t[l-1+n].offset=l/a*s+f;n=a;break}}}}}(v),R(v,function(o){var i=o.offset,u=o.value,f=Q(a*i+s);(w(t.keyframes,function(t){return t.prop===n&&t.time===f})||B(t.keyframes,{plugin:e,easing:o.easing,index:r,prop:n,time:f,value:u,interpolate:o.interpolate})).value=u}),w(t.keyframes,function(t){return t.prop===n&&t.time===s})||B(t.keyframes,{plugin:e,easing:l,index:r,prop:n,time:s,value:p,interpolate:d});var m=s+a;w(t.keyframes,function(t){return t.prop===n&&t.time===m},!0)||B(t.keyframes,{plugin:e,easing:l,index:r,prop:n,time:m,value:p,interpolate:d}),M(t.propNames,n)}var lt=[],dt={},gt=((e={}).append=function(t,e,r){var n=t.cursor,o=k(e).map(function(t){var e=t.to,r=t.from,o=t.duration,a=i(e),u=i(r),f=i(o),s=t;return s.to=a&&(u||f)?e:f&&u?r+o:a&&!f?n+e:f?n+o:p,s.from=u&&(a||f)?r:a&&f?e-o:a||f?n:p,s});st(t,o,r)},e.cancel=E,e.destroy=F,e.finish=ot,e.insert=st,e.pause=it,e.play=at,e.reverse=function(t,e,r){t.rate*=-1,nt(t,0,r),r.trigger("reverse")},e.set=function(t,e,r){var n=Object.keys(H),o=k(e).map(function(e){var r=e.at||t.cursor,o={};for(var i in e)if(y(n,i)){var a=e[i],u={};for(var f in a){var s=a[f];u[f]=[p,s]}o[i]=u}else o[i]=e[i];return o.from=r-1e-9,o.to=r,o});st(t,o,r)},e[x]=function(t,e,r){var n=t.duration,o=t.repeat,i=t.rate,a=t.time===p?i<0?n:0:t.time,u=t.round||0,f=i<0,s=!1;W(a+=e*i,0,n)||(t.round=++u,a=f?0:n,s=!0,t.yoyo&&(t.rate=-1*(t.rate||0)),a=t.rate<0?n:0),t.time=a,t.round=u,s&&o===u?ot(t,0,r):nt(t,0,r)},e.update=nt,e.rate=function(t,e,r){t.rate=e||1,nt(t,0,r)},e.time=function(t,e,r){var n=+e;t.time=isFinite(n)?n:t.rate<0?t.duration:0,nt(t,0,r)},e);function ht(t){var e=dt[t];if(!e)throw new Error("not found");return e.state}function vt(t,e,r){var n=gt[t],o=dt[e];if(!n||!o)throw new Error("not found");var i={events:[],needUpdate:[],trigger:pt,dirty:mt},a=o.state;n(a,r,i),R(i.events,function(t){var e=o.subs[t];e&&R(e,function(t){t(a.time)})}),i.destroyed?delete dt[e]:i.needUpdate.length&&(a.state!==g?function(t,e){var r=t.state;switch(R(t.players,function(t){return t.cancel()}),t.players=p,r){case h:it(t,p,e);break;case v:at(t,p,e)}}(a,i):ut(a),R(lt,function(t){t(o)}))}function pt(t){M(this.events,t)}function mt(t){M(this.needUpdate,t)}"undefined"!=typeof window&&(window.just_devtools={dispatch:vt,subscribe:function(t){M(lt,t)},unsubscribe:function(t){b(lt,t)}});var yt={get state(){return ht(this.id).state},get duration(){return ht(this.id).duration},get currentTime(){return ht(this.id).time},set currentTime(t){vt("time",this.id,t)},get playbackRate(){return ht(this.id).rate},set playbackRate(t){vt("rate",this.id,t)},add:function(t){return vt("append",this.id,t),this},animate:function(t){return vt("append",this.id,t),this},fromTo:function(t,e,r){return R(r,function(r){r.to=e,r.from=t}),vt("insert",this.id,r),this},cancel:function(){return vt("cancel",this.id),this},destroy:function(){vt("destroy",this.id)},finish:function(){return vt("finish",this.id),this},on:function(t,e){var r,n,o,i;return r=this.id,n=t,o=e,(i=dt[r])&&M(i.subs[n]=i.subs[n]||[],o),this},once:function(t,e){var r=this;return r.on(t,function n(o){r.off(t,n),e(o)}),r},off:function(t,e){var r,n,o,i;return r=this.id,n=t,o=e,(i=dt[r])&&b(i.subs[n],o),this},pause:function(){return vt("pause",this.id),this},play:function(t){return vt("play",this.id,t),this},reverse:function(){return vt("reverse",this.id),this},seek:function(t){return vt("time",this.id,t),this},sequence:function(t){var e=this;return R(t,function(t){return vt("append",e.id,t)}),this},set:function(t){return vt("set",this.id,t),this}};Math.PI;var wt=function(t,e,r){return 3*t*(1-r)*(1-r)*r+3*e*(1-r)*r*r+r*r*r},bt=/([a-z])[- ]([a-z])/gi,Ct=/^([a-z-]+)\(([^\)]+)\)$/i,kt={ease:"cubic-bezier(.25,.1,.25,1)",easeIn:"cubic-bezier(.42,0,1,1)",easeOut:"cubic-bezier(0,0,.58,1)",easeInOut:"cubic-bezier(.42,0,.58,1)",stepStart:"steps(1,1)",stepEnd:"steps(1,0)",linear:"cubic-bezier(0,0,1,1)"},Bt=function(t,e,r){return e+r.toUpperCase()},Mt=Math.abs;function At(t){var e=[];return function(){for(var r=arguments,n=0,o=e.length;n<o;n++){var i=e[n].args,a=r.length;if(i.length===a){for(var u=0,f=0;f<a&&i[f]===r[f];f++)++u;if(u===a)return e[n].value}}var s=t.apply(p,r);return e.push({args:r,value:s}),s}}var Rt=At(function(t){var e,r,n,o,i=function(t){var e,r="string"==typeof(e=t)?e.replace(bt,Bt):"",n=kt[r]||t,o=Ct.exec(n);if(!o)throw new Error("css parse error");return[o[1]].concat(o[2].split(","))}(t),a=i[0];if("steps"===a)return function(t,e){var r=t/1,n="end"===e?0:"start"===e?1:e||0;return function(t){return t>=1?1:n*r+t-(n*r+t)%r}}(+i[1],i[2]);if("cubic-bezier"===a)return e=+i[1],r=+i[2],n=+i[3],o=+i[4],e<0||e>1||n<0||n>1?function(t){return t}:function(t){if(0===t||1===t)return t;var i=0,a=1,u=19;do{var f=.5*(i+a),s=wt(e,n,f);if(Mt(t-s)<1e-4)return wt(r,o,f);s<t?i=f:a=f}while(--u);return t};throw new Error("css parse error")}),xt=At(function(t){return At(t)});function St(t,e,r){return t+(e-t)*r}function Lt(t,e,r){return r<.5?t:e}function Tt(t){return t.replace(/([A-Z])/g,function(t){return"-"+t[0].toLowerCase()})}function Dt(t){return t.split(",")}var It=0,zt=1,qt=2,Pt=3,jt=/^\-\-[a-z0-9\-]+$/i,Et=["viewBox"],Ft=["viewBox"];function Ot(t,e){return l(t)?jt.test(e)?Pt:void 0===t[e]||y(Et,e)?y(Ft,e)?zt:qt:It:It}function Qt(t,e){var r=Ot(t,e);return r===Pt?function(t,e){return function(){return t.style.getPropertyValue(e)}}(t,e):r===zt?function(t,e){return function(){return t.getAttribute(e)}}(t,e):r===qt?function(t,r){var n=Tt(e);return function(){return t.getAttribute(n)}}(t):function(t,e){return function(){return t[e]}}(t,e)}function Yt(t){return(r=Object.create(yt),(e=e||{}).id=e.id||o(),r.id=e.id,function(t){dt[t.id]={state:function(t){var e={};if(t.references)for(var r in t.references)e["@"+r]=t.references[r];return{configs:[],cursor:0,duration:0,id:t.id,players:p,rate:1,refs:e,repeat:p,round:p,state:g,time:p,yoyo:!1}}(t),subs:{}}}(e),r).add(t);var e,r}N({name:"props",animate:function(t){var e,r,n,o=t.target,i=t.prop,f=(e=t.to-t.from,r=t.keyframes,n=r.map(function(t){return t.offset*e}),R(r,function(t){var e=!a(t.interpolate);t.simpleFn=e,t.interpolate=e?u(t.value)?St:Lt:xt(t.interpolate)}),function(t){var o=e*t,i=function(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n]>e)return n;return r-1}(n,o),a=i?i-1:0,u=n[i],f=n[a],s=r[a],c=(o-f)/(u-f),l=s.easing?Rt(s.easing)(c):c;return s.simpleFn?s.interpolate(s.value,r[i].value,l):s.interpolate(s.value,r[i].value)(l)}),s=function(t,e){var r=Ot(t,e);return r===Pt?function(t,e){return function(r){return t.style.setProperty(e,r?r+"":"")}}(t,e):r===zt?function(t,e){return function(r){return t.setAttribute(e,r)}}(t,e):r===qt?function(t,r){var n=Tt(e);return function(e){return t.setAttribute(n,e)}}(t):function(t,e){return function(r){return t[e]=r}}(t,e)}(o,i),c=Qt(o,i),l=p;return{cancel:function(){l!==p&&s(l),l=p},update:function(t,e,r){l===p&&(l=c()),s(f(t))}}},getValue:function(t,e){return Qt(t,e)()}});var Xt=Dt("rotateX,rotateY,rotateZ,rotate"),Wt=Dt("scaleX,scaleY,scaleZ,scale"),Ht=Dt("perspective,x,y,z"),Nt=Xt.concat(Wt,Ht),Gt={x:"translateX",y:"translateY",z:"translateZ"},Ut=Dt("backgroundSize,border,borderBottom,borderBottomLeftRadius,borderBottomRightRadius,borderBottomWidth,borderLeft,borderLeftWidth,borderRadius,borderRight,borderRightWidth,borderTop,borderTopLeftRadius,borderTopRightRadius,borderTopWidth,borderWidth,bottom,columnGap,columnRuleWidth,columnWidth,columns,flexBasis,font,fontSize,gridColumnGap,gridGap,gridRowGap,height,left,letterSpacing,lineHeight,margin,marginBottom,marginLeft,marginRight,marginTop,maskSize,maxHeight,maxWidth,minHeight,minWidth,outline,outlineOffset,outlineWidth,padding,paddingBottom,paddingLeft,paddingRight,paddingTop,perspective,right,shapeMargin,tabSize,top,width,wordSpacing");function Vt(t){var e={unit:p,value:p};if(!i(t))return e;if(Number(t))return e.value=+t,e;var r=m.exec(t);return r&&(e.unit=r[2]||p,e.value=r[1]?parseFloat(r[1]):p),e}var Zt,$t,_t,Jt={name:"web",animate:function(t){var e=t.keyframes,r=t.prop,n=t.from,o=t.to,i=t.target,a=o-n,u=At(function(){var t=e.map(function(t){var e,n=t.offset,o=t.value,i=t.easing;return(e={offset:n})[r]=o,e.easing=i,e}),n=i.animate(t,{duration:a,fill:"both"});return n.pause(),n});return{cancel:function(){u().cancel()},update:function(t,e,r){var n=u(),o=a*t;if(O(n.currentTime-o)>1&&(n.currentTime=o),r&&n.playbackRate!==e){var i=n.currentTime;i<1?n.currentTime=1:i>=a-1&&(n.currentTime=a-1),n.playbackRate=e}r&&!("running"===n.playState||"finish"===n.playState)&&!(e<0&&o<17)&&!(e>=0&&o>a-17)&&n.play(),!r&&("running"===n.playState||"pending"===n.playState)&&n.pause()}}},getValue:function(t,e){return getComputedStyle(t)[e]},onWillAnimate:function(t,e,r){l(t.target)&&(function(t){for(var e in t)if(y(Ut,e)){var r=t[e];for(var n in r){var o=r[n];i(o)&&u(o.value)&&(o.value+="px")}}}(e),function(t,e,r){var n=t.propNames.filter(function(t){return y(Nt,t)});if(n.length){if(y(t.propNames,"transform"))throw new Error("transform + shorthand is not allowed");var o=[],a={};R(n,function(t){var r=e[t];r&&R(r,function(t){a[t.offset]=t.easing,M(o,t.offset)})}),o.sort();for(var u=o.map(function(t){var r={};return R(n,function(n){var o=w(e[n],function(e){return e.offset===t});r[n]=o?o.value:p}),{offset:t,easing:a[t],values:r}}),f=u.length,s=f-1;s>-1;--s){var c=u[s];for(var l in c.values)if(!i(c.values[l])){for(var d=p,g=s-1;g>-1;g--)if(i(u[g].values[l])){d=g;break}for(var h=p,v=s+1;v<f;v++)if(i(u[v].values[l])){h=v;break}var m=d!==p;if(m&&h!==p)for(var b=u[d],C=u[h],k=Vt(b.values[l]),B=Vt(C.values[l]),A=d+1;A<h;A++){var x=(o[A]-b.offset)/(C.offset-b.offset),S=k.value+(B.value-k.value)*x+(B.unit||k.unit||"");u[A].values[l]=S}else if(m)for(A=d+1;A<f;A++)u[A].values[l]=u[d].values[l]}}if(u.length){R(n,function(t){e[t]=p});var L=[];R(u,function(t){var e=p;for(var r in t.values){var n=Vt(t.values[r]);n.value!==p&&(n.unit||(n.unit=y(Ht,r)?"px":y(Xt,r)?"deg":""),e=(e?e+" ":"")+(Gt[r]||r)+"("+n.value+n.unit+")")}L.push({offset:t.offset,value:e,easing:t.easing,interpolate:p})}),e.transform=L,r.transform="web"}}}(t,e,r))}},Kt=(function(t,e){var r,n=function(){var t=function(t,e){var r=t,n=o[e],a=null,h=0,v=null,m=[],y={},w=function(t,e){a=function(t){for(var e=new Array(t),r=0;r<t;r+=1){e[r]=new Array(t);for(var n=0;n<t;n+=1)e[r][n]=null}return e}(h=4*r+17),b(0,0),b(h-7,0),b(0,h-7),k(),C(),M(t,e),r>=7&&B(t),null==v&&(v=R(r,n,m)),A(v,e)},b=function(t,e){for(var r=-1;r<=7;r+=1)if(!(t+r<=-1||h<=t+r))for(var n=-1;n<=7;n+=1)e+n<=-1||h<=e+n||(a[t+r][e+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},C=function(){for(var t=8;t<h-8;t+=1)null==a[t][6]&&(a[t][6]=t%2==0);for(var e=8;e<h-8;e+=1)null==a[6][e]&&(a[6][e]=e%2==0)},k=function(){for(var t=i.getPatternPosition(r),e=0;e<t.length;e+=1)for(var n=0;n<t.length;n+=1){var o=t[e],u=t[n];if(null==a[o][u])for(var f=-2;f<=2;f+=1)for(var s=-2;s<=2;s+=1)a[o+f][u+s]=-2==f||2==f||-2==s||2==s||0==f&&0==s}},B=function(t){for(var e=i.getBCHTypeNumber(r),n=0;n<18;n+=1){var o=!t&&1==(e>>n&1);a[Math.floor(n/3)][n%3+h-8-3]=o}for(n=0;n<18;n+=1)o=!t&&1==(e>>n&1),a[n%3+h-8-3][Math.floor(n/3)]=o},M=function(t,e){for(var r=n<<3|e,o=i.getBCHTypeInfo(r),u=0;u<15;u+=1){var f=!t&&1==(o>>u&1);u<6?a[u][8]=f:u<8?a[u+1][8]=f:a[h-15+u][8]=f}for(u=0;u<15;u+=1)f=!t&&1==(o>>u&1),u<8?a[8][h-u-1]=f:u<9?a[8][15-u-1+1]=f:a[8][15-u-1]=f;a[h-8][8]=!t},A=function(t,e){for(var r=-1,n=h-1,o=7,u=0,f=i.getMaskFunction(e),s=h-1;s>0;s-=2)for(6==s&&(s-=1);;){for(var c=0;c<2;c+=1)if(null==a[n][s-c]){var l=!1;u<t.length&&(l=1==(t[u]>>>o&1)),f(n,s-c)&&(l=!l),a[n][s-c]=l,-1==(o-=1)&&(u+=1,o=7)}if((n+=r)<0||h<=n){n-=r,r=-r;break}}},R=function(t,e,r){for(var n=f.getRSBlocks(t,e),o=s(),a=0;a<r.length;a+=1){var c=r[a];o.put(c.getMode(),4),o.put(c.getLength(),i.getLengthInBits(c.getMode(),t)),c.write(o)}var l=0;for(a=0;a<n.length;a+=1)l+=n[a].dataCount;if(o.getLengthInBits()>8*l)throw"code length overflow. ("+o.getLengthInBits()+">"+8*l+")";for(o.getLengthInBits()+4<=8*l&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*l||(o.put(236,8),o.getLengthInBits()>=8*l));)o.put(17,8);return function(t,e){for(var r=0,n=0,o=0,a=new Array(e.length),f=new Array(e.length),s=0;s<e.length;s+=1){var c=e[s].dataCount,l=e[s].totalCount-c;n=Math.max(n,c),o=Math.max(o,l),a[s]=new Array(c);for(var d=0;d<a[s].length;d+=1)a[s][d]=255&t.getBuffer()[d+r];r+=c;var g=i.getErrorCorrectPolynomial(l),h=u(a[s],g.getLength()-1).mod(g);for(f[s]=new Array(g.getLength()-1),d=0;d<f[s].length;d+=1){var v=d+h.getLength()-f[s].length;f[s][d]=v>=0?h.getAt(v):0}}var p=0;for(d=0;d<e.length;d+=1)p+=e[d].totalCount;var m=new Array(p),y=0;for(d=0;d<n;d+=1)for(s=0;s<e.length;s+=1)d<a[s].length&&(m[y]=a[s][d],y+=1);for(d=0;d<o;d+=1)for(s=0;s<e.length;s+=1)d<f[s].length&&(m[y]=f[s][d],y+=1);return m}(o,n)};return y.addData=function(t,e){var r=null;switch(e=e||"Byte"){case"Numeric":r=c(t);break;case"Alphanumeric":r=l(t);break;case"Byte":r=d(t);break;case"Kanji":r=g(t);break;default:throw"mode:"+e}m.push(r),v=null},y.isDark=function(t,e){if(t<0||h<=t||e<0||h<=e)throw t+","+e;return a[t][e]},y.getModuleCount=function(){return h},y.make=function(){if(r<1){for(var t=1;t<40;t++){for(var e=f.getRSBlocks(t,n),o=s(),a=0;a<m.length;a++){var u=m[a];o.put(u.getMode(),4),o.put(u.getLength(),i.getLengthInBits(u.getMode(),t)),u.write(o)}var c=0;for(a=0;a<e.length;a++)c+=e[a].dataCount;if(o.getLengthInBits()<=8*c)break}r=t}w(!1,function(){for(var t=0,e=0,r=0;r<8;r+=1){w(!0,r);var n=i.getLostPoint(y);(0==r||t>n)&&(t=n,e=r)}return e}())},y.createTableTag=function(t,e){t=t||2;var r="";r+='<table style="',r+=" border-width: 0px; border-style: none;",r+=" border-collapse: collapse;",r+=" padding: 0px; margin: "+(e=void 0===e?4*t:e)+"px;",r+='">',r+="<tbody>";for(var n=0;n<y.getModuleCount();n+=1){r+="<tr>";for(var o=0;o<y.getModuleCount();o+=1)r+='<td style="',r+=" border-width: 0px; border-style: none;",r+=" border-collapse: collapse;",r+=" padding: 0px; margin: 0px;",r+=" width: "+t+"px;",r+=" height: "+t+"px;",r+=" background-color: ",r+=y.isDark(n,o)?"#000000":"#ffffff",r+=";",r+='"/>';r+="</tr>"}return(r+="</tbody>")+"</table>"},y.createSvgTag=function(t,e){t=t||2,e=void 0===e?4*t:e;var r,n,o,i,a=y.getModuleCount()*t+2*e,u="";for(i="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",u+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',u+=' width="'+a+'px"',u+=' height="'+a+'px"',u+=' viewBox="0 0 '+a+" "+a+'" ',u+=' preserveAspectRatio="xMinYMin meet">',u+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',u+='<path d="',n=0;n<y.getModuleCount();n+=1)for(o=n*t+e,r=0;r<y.getModuleCount();r+=1)y.isDark(n,r)&&(u+="M"+(r*t+e)+","+o+i);return(u+='" stroke="transparent" fill="black"/>')+"</svg>"},y.createDataURL=function(t,e){t=t||2,e=void 0===e?4*t:e;var r=y.getModuleCount()*t+2*e,n=e,o=r-e;return p(r,r,function(e,r){if(n<=e&&e<o&&n<=r&&r<o){var i=Math.floor((e-n)/t),a=Math.floor((r-n)/t);return y.isDark(a,i)?0:1}return 1})},y.createImgTag=function(t,e,r){t=t||2,e=void 0===e?4*t:e;var n=y.getModuleCount()*t+2*e,o="";return o+="<img",o+=' src="',o+=y.createDataURL(t,e),o+='"',o+=' width="',o+=n,o+='"',o+=' height="',o+=n,o+='"',r&&(o+=' alt="',o+=r,o+='"'),o+"/>"},y.renderTo2dContext=function(t,e){e=e||2;for(var r=y.getModuleCount(),n=0;n<r;n++)for(var o=0;o<r;o++)t.fillStyle=y.isDark(n,o)?"black":"white",t.fillRect(n*e,o*e,e,e)},y};t.stringToBytes=(t.stringToBytesFuncs={default:function(t){for(var e=[],r=0;r<t.length;r+=1){var n=t.charCodeAt(r);e.push(255&n)}return e}}).default,t.createStringToBytes=function(t,e){var r=function(){for(var r=v(t),n=function(){var t=r.read();if(-1==t)throw"eof";return t},o=0,i={};;){var a=r.read();if(-1==a)break;var u=n(),f=n()<<8|n();i[String.fromCharCode(a<<8|u)]=f,o+=1}if(o!=e)throw o+" != "+e;return i}(),n="?".charCodeAt(0);return function(t){for(var e=[],o=0;o<t.length;o+=1){var i=t.charCodeAt(o);if(i<128)e.push(i);else{var a=r[t.charAt(o)];"number"==typeof a?(255&a)==a?e.push(a):(e.push(a>>>8),e.push(255&a)):e.push(n)}}return e}};var e,r,n,o={L:1,M:0,Q:3,H:2},i=(e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=function(t){for(var e=0;0!=t;)e+=1,t>>>=1;return e},(r={}).getBCHTypeInfo=function(t){for(var e=t<<10;n(e)-n(1335)>=0;)e^=1335<<n(e)-n(1335);return 21522^(t<<10|e)},r.getBCHTypeNumber=function(t){for(var e=t<<12;n(e)-n(7973)>=0;)e^=7973<<n(e)-n(7973);return t<<12|e},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(t){switch(t){case 0:return function(t,e){return(t+e)%2==0};case 1:return function(t,e){return t%2==0};case 2:return function(t,e){return e%3==0};case 3:return function(t,e){return(t+e)%3==0};case 4:return function(t,e){return(Math.floor(t/2)+Math.floor(e/3))%2==0};case 5:return function(t,e){return t*e%2+t*e%3==0};case 6:return function(t,e){return(t*e%2+t*e%3)%2==0};case 7:return function(t,e){return(t*e%3+(t+e)%2)%2==0};default:throw"bad maskPattern:"+t}},r.getErrorCorrectPolynomial=function(t){for(var e=u([1],0),r=0;r<t;r+=1)e=e.multiply(u([1,a.gexp(r)],0));return e},r.getLengthInBits=function(t,e){if(1<=e&&e<10)switch(t){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+t}else if(e<27)switch(t){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+t}else{if(!(e<41))throw"type:"+e;switch(t){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+t}}},r.getLostPoint=function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n+=1)for(var o=0;o<e;o+=1){for(var i=0,a=t.isDark(n,o),u=-1;u<=1;u+=1)if(!(n+u<0||e<=n+u))for(var f=-1;f<=1;f+=1)o+f<0||e<=o+f||0==u&&0==f||a==t.isDark(n+u,o+f)&&(i+=1);i>5&&(r+=3+i-5)}for(n=0;n<e-1;n+=1)for(o=0;o<e-1;o+=1){var s=0;t.isDark(n,o)&&(s+=1),t.isDark(n+1,o)&&(s+=1),t.isDark(n,o+1)&&(s+=1),t.isDark(n+1,o+1)&&(s+=1),0!=s&&4!=s||(r+=3)}for(n=0;n<e;n+=1)for(o=0;o<e-6;o+=1)t.isDark(n,o)&&!t.isDark(n,o+1)&&t.isDark(n,o+2)&&t.isDark(n,o+3)&&t.isDark(n,o+4)&&!t.isDark(n,o+5)&&t.isDark(n,o+6)&&(r+=40);for(o=0;o<e;o+=1)for(n=0;n<e-6;n+=1)t.isDark(n,o)&&!t.isDark(n+1,o)&&t.isDark(n+2,o)&&t.isDark(n+3,o)&&t.isDark(n+4,o)&&!t.isDark(n+5,o)&&t.isDark(n+6,o)&&(r+=40);var c=0;for(o=0;o<e;o+=1)for(n=0;n<e;n+=1)t.isDark(n,o)&&(c+=1);return r+Math.abs(100*c/e/e-50)/5*10},r),a=function(){for(var t=new Array(256),e=new Array(256),r=0;r<8;r+=1)t[r]=1<<r;for(r=8;r<256;r+=1)t[r]=t[r-4]^t[r-5]^t[r-6]^t[r-8];for(r=0;r<255;r+=1)e[t[r]]=r;return{glog:function(t){if(t<1)throw"glog("+t+")";return e[t]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return t[e]}}}();function u(t,e){if(void 0===t.length)throw t.length+"/"+e;var r=function(){for(var r=0;r<t.length&&0==t[r];)r+=1;for(var n=new Array(t.length-r+e),o=0;o<t.length-r;o+=1)n[o]=t[o+r];return n}(),n={getAt:function(t){return r[t]},getLength:function(){return r.length},multiply:function(t){for(var e=new Array(n.getLength()+t.getLength()-1),r=0;r<n.getLength();r+=1)for(var o=0;o<t.getLength();o+=1)e[r+o]^=a.gexp(a.glog(n.getAt(r))+a.glog(t.getAt(o)));return u(e,0)},mod:function(t){if(n.getLength()-t.getLength()<0)return n;for(var e=a.glog(n.getAt(0))-a.glog(t.getAt(0)),r=new Array(n.getLength()),o=0;o<n.getLength();o+=1)r[o]=n.getAt(o);for(o=0;o<t.getLength();o+=1)r[o]^=a.gexp(a.glog(t.getAt(o))+e);return u(r,0).mod(t)}};return n}var f=function(){var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(t,e){var r={};return r.totalCount=t,r.dataCount=e,r},r={getRSBlocks:function(r,n){var i=function(e,r){switch(r){case o.L:return t[4*(e-1)+0];case o.M:return t[4*(e-1)+1];case o.Q:return t[4*(e-1)+2];case o.H:return t[4*(e-1)+3];default:return}}(r,n);if(void 0===i)throw"bad rs block @ typeNumber:"+r+"/errorCorrectionLevel:"+n;for(var a=i.length/3,u=[],f=0;f<a;f+=1)for(var s=i[3*f+0],c=i[3*f+1],l=i[3*f+2],d=0;d<s;d+=1)u.push(e(c,l));return u}};return r}(),s=function(){var t=[],e=0,r={getBuffer:function(){return t},getAt:function(e){var r=Math.floor(e/8);return 1==(t[r]>>>7-e%8&1)},put:function(t,e){for(var n=0;n<e;n+=1)r.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return e},putBit:function(r){var n=Math.floor(e/8);t.length<=n&&t.push(0),r&&(t[n]|=128>>>e%8),e+=1}};return r},c=function(t){var e=t,r={getMode:function(){return 1},getLength:function(t){return e.length},write:function(t){for(var r=e,o=0;o+2<r.length;)t.put(n(r.substring(o,o+3)),10),o+=3;o<r.length&&(r.length-o==1?t.put(n(r.substring(o,o+1)),4):r.length-o==2&&t.put(n(r.substring(o,o+2)),7))}},n=function(t){for(var e=0,r=0;r<t.length;r+=1)e=10*e+o(t.charAt(r));return e},o=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return r},l=function(t){var e=t,r={getMode:function(){return 2},getLength:function(t){return e.length},write:function(t){for(var r=e,o=0;o+1<r.length;)t.put(45*n(r.charAt(o))+n(r.charAt(o+1)),11),o+=2;o<r.length&&t.put(n(r.charAt(o)),6)}},n=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+t}};return r},d=function(e){var r=t.stringToBytes(e);return{getMode:function(){return 4},getLength:function(t){return r.length},write:function(t){for(var e=0;e<r.length;e+=1)t.put(r[e],8)}}},g=function(e){var r=t.stringToBytesFuncs.SJIS;if(!r)throw"sjis not supported.";!function(t,e){var n=r("友");if(2!=n.length||38726!=(n[0]<<8|n[1]))throw"sjis not supported."}();var n=r(e);return{getMode:function(){return 8},getLength:function(t){return~~(n.length/2)},write:function(t){for(var e=n,r=0;r+1<e.length;){var o=(255&e[r])<<8|255&e[r+1];if(33088<=o&&o<=40956)o-=33088;else{if(!(57408<=o&&o<=60351))throw"illegal char at "+(r+1)+"/"+o;o-=49472}o=192*(o>>>8&255)+(255&o),t.put(o,13),r+=2}if(r<e.length)throw"illegal char at "+(r+1)}}},h=function(){var t=[],e={writeByte:function(e){t.push(255&e)},writeShort:function(t){e.writeByte(t),e.writeByte(t>>>8)},writeBytes:function(t,r,n){r=r||0,n=n||t.length;for(var o=0;o<n;o+=1)e.writeByte(t[o+r])},writeString:function(t){for(var r=0;r<t.length;r+=1)e.writeByte(t.charCodeAt(r))},toByteArray:function(){return t},toString:function(){var e="";e+="[";for(var r=0;r<t.length;r+=1)r>0&&(e+=","),e+=t[r];return e+"]"}};return e},v=function(t){var e=t,r=0,n=0,o=0,i={read:function(){for(;o<8;){if(r>=e.length){if(0==o)return-1;throw"unexpected end of file./"+o}var t=e.charAt(r);if(r+=1,"="==t)return o=0,-1;t.match(/^\s$/)||(n=n<<6|a(t.charCodeAt(0)),o+=6)}var i=n>>>o-8&255;return o-=8,i}},a=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return i},p=function(t,e,r){for(var n=function(t,e){var r=t,n=e,o=new Array(t*e),i={setPixel:function(t,e,n){o[e*r+t]=n},write:function(t){t.writeString("GIF87a"),t.writeShort(r),t.writeShort(n),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(r),t.writeShort(n),t.writeByte(0);var e=a(2);t.writeByte(2);for(var o=0;e.length-o>255;)t.writeByte(255),t.writeBytes(e,o,255),o+=255;t.writeByte(e.length-o),t.writeBytes(e,o,e.length-o),t.writeByte(0),t.writeString(";")}},a=function(t){for(var e=1<<t,r=1+(1<<t),n=t+1,i=u(),a=0;a<e;a+=1)i.add(String.fromCharCode(a));i.add(String.fromCharCode(e)),i.add(String.fromCharCode(r));var f,s,c,l=h(),d=(f=l,s=0,c=0,{write:function(t,e){if(t>>>e!=0)throw"length over";for(;s+e>=8;)f.writeByte(255&(t<<s|c)),e-=8-s,t>>>=8-s,c=0,s=0;c|=t<<s,s+=e},flush:function(){s>0&&f.writeByte(c)}});d.write(e,n);var g=0,v=String.fromCharCode(o[g]);for(g+=1;g<o.length;){var p=String.fromCharCode(o[g]);g+=1,i.contains(v+p)?v+=p:(d.write(i.indexOf(v),n),i.size()<4095&&(i.size()==1<<n&&(n+=1),i.add(v+p)),v=p)}return d.write(i.indexOf(v),n),d.write(r,n),d.flush(),l.toByteArray()},u=function(){var t={},e=0,r={add:function(n){if(r.contains(n))throw"dup key:"+n;t[n]=e,e+=1},size:function(){return e},indexOf:function(e){return t[e]},contains:function(e){return void 0!==t[e]}};return r};return i}(t,e),o=0;o<e;o+=1)for(var i=0;i<t;i+=1)n.setPixel(i,o,r(i,o));var a=h();n.write(a);for(var u,f,s,c,l,d,g,v=(u=0,f=0,s=0,c="",d=function(t){c+=String.fromCharCode(g(63&t))},g=function(t){if(t<0);else{if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47}throw"n:"+t},(l={}).writeByte=function(t){for(u=u<<8|255&t,f+=8,s+=1;f>=6;)d(u>>>f-6),f-=6},l.flush=function(){if(f>0&&(d(u<<6-f),u=0,f=0),s%3!=0)for(var t=3-s%3,e=0;e<t;e+=1)c+="="},l.toString=function(){return c},l),p=a.toByteArray(),m=0;m<p.length;m+=1)v.writeByte(p[m]);return v.flush(),"data:image/gif;base64,"+v};return t}();n.stringToBytesFuncs["UTF-8"]=function(t){return function(t){for(var e=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e.push(n):n<2048?e.push(192|n>>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&t.charCodeAt(r)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return e}(t)},r=function(){return n},t.exports=r()}(Zt={exports:{}}),Zt.exports),te=function(t,e,r,n){return Math.hypot(r-t,n-e)};!function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"}($t||($t={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Bottom=2]="Bottom"}(_t||(_t={}));var ee=function(t){return function(e,r,n,o){return{adjustedX:n===$t.Left?e:n===$t.Right?e+t:e+t/2,adjustedY:o===_t.Top?r:o===_t.Bottom?r+t:r+t/2}}},re=ee(7),ne=ee(3);function oe(t,e,r,n,o){return t<e?r:t>e?o:n}var ie,ae,ue=function(t,e,r,n){var o=r/2,i=oe(t,o,$t.Right,$t.Middle,$t.Left),a=oe(e,o,_t.Bottom,_t.Center,_t.Top);return n===ie.PositionCenter?ne(t,e,i,a):n===ie.PositionRing?re(t,e,i,a):{adjustedX:t,adjustedY:e}},fe=function(t,e){return t.map(function(t){return{offset:t.offset,value:e(t.value)}})};!function(t){t.Module="module",t.PositionRing="position-ring",t.PositionCenter="position-center",t.Icon="icon"}(ie||(ie={})),function(t){t.FadeInTopDown="FadeInTopDown",t.FadeInCenterOut="FadeInCenterOut",t.RadialRipple="RadialRipple",t.RadialRippleIn="RadialRippleIn",t.MaterializeIn="MaterializeIn"}(ae||(ae={}));var se,ce,le=function(t,e,r,n,o){return{targets:t,from:20*r,duration:300,web:{opacity:[0,1]}}},de=function(t,e,r,n,o){var i=ue(e,r,n,o),a=i.adjustedX,u=i.adjustedY,f=n/2;return{targets:t,from:20*te(a,u,f,f),duration:200,web:{opacity:[0,1]}}},ge=function(t,e,r,n,o){return{targets:t,from:o===ie.Module?200*Math.random():200,duration:200,web:{opacity:[0,1]}}},he=function(t,e,r){var n=50-Math.pow(3,2);if(n<0)throw new Error("This method only supports underdamped oscillation.");var o=Math.sqrt(n),i=function(t){return function(t){return 5*Math.pow(Math.E,-3*t)}(t)*Math.cos(o*t+0)},a=function(t){return(Math.atan(-3/o)+t*Math.PI-0)/o},u=[];u.push({time:0,amplitude:i(0)});for(var f=0;Math.abs(u[u.length-1].amplitude)>.01;f++)a(f)>=0&&u.push({time:a(f),amplitude:i(a(f))});return u}(),ve=(ce=(1-.2)/(se=he)[se.length-1].time,se.map(function(t){var e=t.time,r=t.amplitude;return{offset:.2+e*ce,value:r}})),pe=function(t,e,r,n,o){var i=ue(e,r,n,o),a=i.adjustedX,u=i.adjustedY,f=n/2;return{targets:t,from:7*te(a,u,f,f),easing:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",duration:1e3,web:{scale:(o===ie.Icon?[{offset:0,value:1},{offset:.1,value:.7},{offset:.2,value:1}]:[{offset:0,value:1}]).concat(fe(ve,function(t){return 1+t/5*.1}),[1])}}},me=function(t,e,r,n,o){var i=ue(e,r,n,o),a=i.adjustedX,u=i.adjustedY,f=n/2;return{targets:t,from:7*te(a,u,f,f),easing:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",duration:1e3,web:{scale:(o===ie.Icon?[{offset:0,value:1},{offset:.1,value:.7},{offset:.2,value:1}]:[{offset:0,value:0}]).concat(fe(ve,function(t){return 1+t/5*.1}),[1]),opacity:[{offset:0,value:0},{offset:.05,value:1}]}}};N(Jt);var ye=function(){function t(){this.contents="",this.protocol="",this.moduleColor="#000",this.positionRingColor="#000",this.positionCenterColor="#000",this.maskXToYRatio=1,this.squares=!1}return t.prototype.componentDidLoad=function(){this.updateQR()},t.prototype.componentDidUpdate=function(){this.codeRendered.emit()},t.prototype.updateQR=function(){var t=this.qrCodeElement===this.qrCodeElement.shadowRoot,e=this.qrCodeElement.shadowRoot.querySelector("slot"),r=t?!!this.qrCodeElement.querySelector("[slot]"):!!e&&e.assignedNodes().length>0;this.data=this.generateQRCodeSVG(this.contents,r)},t.prototype.animateQRCode=function(t){this.executeAnimation("string"==typeof t?function(t){switch(t){case ae.FadeInTopDown:return le;case ae.FadeInCenterOut:return de;case ae.RadialRipple:return pe;case ae.RadialRippleIn:return me;case ae.MaterializeIn:return ge;default:throw new Error(t+" is not a valid AnimationPreset.")}}(t):t)},t.prototype.getModuleCount=function(){return this.moduleCount},t.prototype.executeAnimation=function(t){var e=this,r=Array.from(this.qrCodeElement.shadowRoot.querySelectorAll(".module")),n=Array.from(this.qrCodeElement.shadowRoot.querySelectorAll(".position-ring")),o=Array.from(this.qrCodeElement.shadowRoot.querySelectorAll(".position-center")),i=Array.from(this.qrCodeElement.shadowRoot.querySelectorAll("#icon-wrapper")),a=function(t,e){return t.map(function(t){return{element:t,entityType:e}})};Yt(a(r,ie.Module).concat(a(n,ie.PositionRing),a(o,ie.PositionCenter),a(i,ie.Icon)).map(function(t){var e=t.element,r=t.entityType;return{element:e,positionX:parseInt(e.dataset.column,10),positionY:parseInt(e.dataset.row,10),entityType:r}}).map(function(r){return t(r.element,r.positionX,r.positionY,e.moduleCount,r.entityType)})).play()},t.prototype.generateQRCodeSVG=function(t,e){var r=Kt(0,"H");r.addData(t),r.make(),this.moduleCount=r.getModuleCount();var n=this.moduleCount+8,o=n/2;return'\n <svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="100%"\n height="100%"\n viewBox="'+(0-o)+" "+(0-o)+" "+n+" "+n+'"\n preserveAspectRatio="xMinYMin meet">\n <rect\n width="100%"\n height="100%"\n fill="white"\n fill-opacity="0"\n cx="'+-o+'"\n cy="'+-o+'"/>\n '+(this.squares?void 0:function(t,e,r,n,o){return"\n "+i(4,4,4,r,n,o)+"\n "+i(t-7+4,4,4,r,n,o)+"\n "+i(4,t-7+4,4,r,n,o)+"\n "}(this.moduleCount,0,this.positionRingColor,this.positionCenterColor,o))+"\n "+function(t,e,r,n,o,i,f,s){for(var c="",l=0;l<e;l+=1)for(var d=l+4,g=0;g<e;g+=1)if(t.isDark(l,g)&&(i||!a(g,l,e)&&!u(g,l,e,n,o))){var h=g+4;c+=i?'\n <rect x="'+(d-.5-s)+'" y="'+(h-.5-s)+'" width="1" height="1" />\n ':'\n <circle\n class="module"\n fill="'+f+'"\n cx="'+(d-s)+'"\n cy="'+(h-s)+'"\n data-column="'+l+'"\n data-row="'+g+'"\n r="0.5"/>'}return c}(r,this.moduleCount,0,e,this.maskXToYRatio,this.squares,this.moduleColor,o)+"\n </svg>";function i(t,e,r,n,o,i){return'\n <path class="position-ring" fill="'+n+'" data-column="'+(t-r)+'" data-row="'+(e-r)+'" d="M'+(t-i)+" "+(e-.5-i)+'h6s.5 0 .5 .5v6s0 .5-.5 .5h-6s-.5 0-.5-.5v-6s0-.5 .5-.5zm.75 1s-.25 0-.25 .25v4.5s0 .25 .25 .25h4.5s.25 0 .25-.25v-4.5s0-.25 -.25 -.25h-4.5z"/>\n <path class="position-center" fill="'+o+'" data-column="'+(t-r+2)+'" data-row="'+(e-r+2)+'" d="M'+(t+2-i)+" "+(e+1.5-i)+'h2s.5 0 .5 .5v2s0 .5-.5 .5h-2s-.5 0-.5-.5v-2s0-.5 .5-.5z"/>\n '}function a(t,e,r){return t<=7?e<=7||e>=r-7:e<=7&&t>=r-7}function u(t,e,r,n,o){if(!n)return!1;var i=r/2,a=Math.floor(r*Math.sqrt(.1)/2),u=a*o,f=a/o;return t>=i-f&&t<=i+f&&e>=i-u&&e<=i+u}},t.prototype.render=function(){return r("div",{id:"qr-container"},r("div",{id:"icon-container",style:this.squares?{display:"none",visibility:"hidden"}:{}},r("div",{id:"icon-wrapper",style:{width:18*this.maskXToYRatio+"%"},"data-column":this.moduleCount/2,"data-row":this.moduleCount/2},r("slot",{name:"icon"}))),r("div",{innerHTML:this.data}))},Object.defineProperty(t,"is",{get:function(){return"qr-code"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{animateQRCode:{method:!0},contents:{type:String,attr:"contents",watchCallbacks:["updateQR"]},data:{state:!0},getModuleCount:{method:!0},maskXToYRatio:{type:Number,attr:"mask-x-to-y-ratio",watchCallbacks:["updateQR"]},moduleColor:{type:String,attr:"module-color",watchCallbacks:["updateQR"]},moduleCount:{state:!0},positionCenterColor:{type:String,attr:"position-center-color",watchCallbacks:["updateQR"]},positionRingColor:{type:String,attr:"position-ring-color",watchCallbacks:["updateQR"]},protocol:{type:String,attr:"protocol",watchCallbacks:["updateQR"]},qrCodeElement:{elementRef:!0},squares:{type:Boolean,attr:"squares",watchCallbacks:["updateQR"]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"events",{get:function(){return[{name:"codeRendered",method:"codeRendered",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"[data-qr-code-host]{display:block;contain:content}#qr-container[data-qr-code]{position:relative}#icon-container[data-qr-code]{position:absolute;width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}"},enumerable:!0,configurable:!0}),t}();t.QrCode=ye,Object.defineProperty(t,"__esModule",{value:!0})});