@bitjson/qr-code
Version:
QR Code Web Component
2 lines • 49.8 kB
JavaScript
/*! Built with http://stenciljs.com */
var _a;import{h}from"./qr-code.core.js";var s4=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},uuid=function(){return s4()+s4()+s4()+s4()+s4()+s4()+s4()+s4()};function isDefined(t){return!!t||0===t||!1===t}function isFunction(t){return"function"==typeof t}function isNumber(t){return"number"==typeof t}function isObject(t){return"object"==typeof t&&!!t}function isString(t){return"string"==typeof t}function isArrayLike(t){return t&&isFinite(t.length)&&!isString(t)&&!isFunction(t)}function isDOM(t){return t.nodeType||t instanceof SVGElement}function isOwner(t,e){return t.hasOwnProperty(e)}var S_INACTIVE=1,S_PAUSED=2,S_PLAYING=3,_=void 0,measureExpression=/^([+|-]*[0-9]*[.]*?[0-9]+)([a-z%]+)*$/i,CONFIG="config";function includes(t,e){return-1!==getIndex(t,e)}function getIndex(t,e){return t.indexOf(e)}function find(t,e,r){var n=t&&t.length;if(!n)return _;if(e===_)return t[r?n-1:0];if(r){for(var i=n-1;i>-1;i--)if(e(t[i]))return t[i]}else for(i=0;i<n;i++)if(e(t[i]))return t[i];return _}function remove(t,e){var r=t.indexOf(e);return-1!==r?t.splice(r,1):_}function sortBy(t){return function(e,r){var n=e[t],i=r[t];return n<i?-1:n>i?1:0}}function list(t){return isDefined(t)?isArrayLike(t)?t:[t]:[]}function push(t,e){return e!==_&&Array.prototype.push.call(t,e),e}function pushDistinct(t,e){return includes(t,e)||push(t,e),e}function mapFlatten(t,e){var r=[];return all(t,function(t){var n=e(t);isArrayLike(n)?all(n,function(t){return push(r,t)}):push(r,n)}),r}function all(t,e){for(var r=list(t),n=0,i=r.length;n<i;n++)e(r[n],n,i)}var APPEND="append",CANCEL="cancel",DESTROY="destroy",FINISH="finish",INSERT="insert",PAUSE="pause",PLAY="play",REVERSE="reverse",SET="set",TICK="tick",UPDATE="update",UPDATE_RATE="rate",UPDATE_TIME="time",raf=requestAnimationFrame,caf=cancelAnimationFrame,now=function(){return performance.now()},active=[],lastHandle=_,lastTime=_;function cancel(){caf(lastHandle),lastHandle=lastTime=_}function update(){var t=active.length;if(lastTime=lastTime||now(),t){var e=now(),r=e-lastTime;lastTime=e,lastHandle=raf(update);for(var n=t-1;n>-1;n--){var i=active[n];dispatch(TICK,i,r)}}else cancel()}function loopOn(t){includes(active,t)||push(active,t),lastHandle||(lastHandle=raf(update))}function loopOff(t){remove(active,t),active.length||cancel()}var cancel$1=function(t,e,r){all(t.players,function(t){return t.cancel()}),t.state=S_INACTIVE,t.time=_,t.round=_,t.players=_,loopOff(t.id),r.trigger(CANCEL)},destroy=function(t,e,r){cancel$1(t,_,r),r.destroyed=!0},abs=Math.abs,flr=Math.floor,max=Math.max,min=Math.min;function inRange(t,e,r){return t!==_&&e<=t&&t<=r}function minMax(t,e,r){return min(max(t,e),r)}var plugins={};function addPlugin(t){plugins[t.name]=t}var refId=0,objNameExp=/\[object ([a-z]+)\]/i;function getName(t){var e=t.id||t.name;if(!e){e=Object.prototype.toString.call(t);var r=objNameExp.exec(e);r&&(e=r[1])}return"@"+e+"_"+ ++refId}function assignRef(t,e){for(var r in t)if(t[r]===e)return r;var n=getName(e);return t[n]=e,n}function replaceWithRefs(t,e,r){if(!isDefined(e)||isString(e)||isNumber(e))return e;if(isArrayLike(e))return mapFlatten(e,function(e){return replaceWithRefs(t,e,r)});if(isFunction(e))return assignRef(t,e);if(r){for(var n in e)isOwner(e,n)&&(e[n]=replaceWithRefs(t,e[n],r&&"targets"!==n));return e}return assignRef(t,e)}function resolveRefs(t,e,r){if(!isDefined(e)||isNumber(e)||isFunction(e))return e;if(isString(e)){var n=e;return isOwner(t,n)&&"@"===n.charAt(0)?t[n]:n}if(isArrayLike(e)){var i=[];return all(e,function(e){return push(i,resolveRefs(t,e,r))}),i}if(!r||isDOM(e))return e;var a={};for(var o in e)if(isOwner(e,o)){var u=e[o];a[o]=r?resolveRefs(t,u,"targets"!==o):u}return a}function getTargets(t){return isString(t)?Array.prototype.slice.call(document.querySelectorAll(t)):isFunction(t)?getTargets(t()):isArrayLike(t)?mapFlatten(t,getTargets):isObject(t)?[t]:[]}function assign(){var t={};return all(arguments,function(e){for(var r in e)isOwner(e,r)&&(t[r]=e[r])}),t}function resolveProperty(t,e,r,n){return isFunction(t)?resolveProperty(t(e,r,n),e,r,n):t}var offsetSorter=sortBy("offset");function toEffects(t){var e=t.keyframes,r=t.from,n=t.to,i=t.stagger||0,a=t.duration,o=[];return all(getTargets(t.target),function(u,s,f){var l={},c={};for(var d in all(e,function(t){var e=l[t.prop]||(l[t.prop]=[]),n=(t.time-r)/(a||1),i=t.easing,o=t.interpolate,s=resolveProperty(t.value,u,t.index,f);c[t.prop]=t.plugin;var d=find(e,function(t){return t.offset===n})||push(e,{easing:i,offset:n,value:s,interpolate:o});d.easing=i,d.value=s,d.interpolate=o}),plugins){var p=plugins[d];if(p.onWillAnimate&&t.keyframes.some(function(t){return t.plugin===d})){var g=assign(t,{target:u});p.onWillAnimate(g,l,c)}}for(var h in l){var v=l[h],m=c[h],y=plugins[m];v&&(v.sort(offsetSorter),ensureFirstFrame(t,v,u,y,h),fillValues(v),fillInterpolators(v),ensureLastFrame(t,v),push(o,{plugin:c[h],target:u,prop:h,from:r+(i?i*s:0),to:n+(i?i*s:0),keyframes:v}))}}),o}function fillValues(t){var e;all(t,function(t){t.value!==_?e=t.value:t.value=e})}function fillInterpolators(t){for(var e,r=t.length-1;r>-1;r--){var n=t[r];n.interpolate!==_?e=n.interpolate:n.interpolate=e}}function ensureFirstFrame(t,e,r,n,i){var a=find(e,function(t){return 0===t.offset});if(a===_||a.value===_){var o=n.getValue(r,i);a===_?e.splice(0,0,{offset:0,value:o,easing:t.easing,interpolate:_}):(a.value=o,a.easing=t.easing,a.interpolate=_)}}function ensureLastFrame(t,e){var r=find(e,function(t){return 1===t.offset},!0);if(r===_||r.value===_){var n=e[e.length-1].value;r===_?push(e,{offset:1,value:n,easing:t.easing,interpolate:_}):(r.value=n,r.easing=r.easing||t.easing)}}function calculatePlayers(t){t.duration=max.apply(_,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}function setup(t){t.players=[],all(t.configs,function(e){return setupTarget(t,e)}),calculatePlayers(t)}function setupTarget(t,e){all(toEffects(resolveRefs(t.refs,e,!0)),function(e){var r=plugins[e.plugin].animate(e);r&&(r.from=e.from,r.to=e.to,push(t.players,r))})}var update$1=function(t,e,r){t.players===_&&setup(t);var n=t.state===S_PLAYING,i=t.time;n||loopOff(t.id),all(t.players,function(e){var r=e.from,a=e.to,o=n&&inRange(flr(i),r,a),u=minMax((i-r)/(a-r),0,1);e.update(u,t.rate,o)}),r.trigger(UPDATE)},finish=function(t,e,r){t.round=0,t.state=S_PAUSED,t.yoyo||(t.time=t.rate<0?0:t.duration),loopOff(t.id),update$1(t,_,r),r.trigger(FINISH),t.destroy&&destroy(t,_,r)},pause=function(t,e,r){t.state=S_PAUSED,loopOff(t.id),update$1(t,_,r),r.trigger(PAUSE)},play=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=S_PLAYING;var n=t.rate>=0;n&&t.time===t.duration?t.time=0:n||0!==t.time||(t.time=t.duration),loopOn(t.id),update$1(t,_,r),r.trigger(PLAY)},reverse=function(t,e,r){t.rate*=-1,update$1(t,_,r),r.trigger(REVERSE)},tick=function(t,e,r){var n=t.duration,i=t.repeat,a=t.rate,o=t.time===_?a<0?n:0:t.time,u=t.round||0,s=a<0,f=!1;inRange(o+=e*a,0,n)||(t.round=++u,o=s?0:n,f=!0,t.yoyo&&(t.rate=-1*(t.rate||0)),o=t.rate<0?n:0),t.time=o,t.round=u,f&&i===u?finish(t,_,r):update$1(t,_,r)},updateRate=function(t,e,r){t.rate=e||1,update$1(t,_,r)},updateTime=function(t,e,r){var n=+e;t.time=isFinite(n)?n:t.rate<0?t.duration:0,update$1(t,_,r)},calculateConfigs=function(t){for(var e=0,r=0,n=t.configs,i=0,a=n.length;i<a;i++){var o=n[i],u=o.keyframes.map(function(t){return t.time}),s=max.apply(_,u),f=min.apply(_,u);o.to=s,o.from=f,o.duration=s-f,e=max(s,e),r=max(s+o.endDelay,r)}t.cursor=r,t.duration=e},propKeyframeSort=sortBy("time"),insert=function(t,e,r){all(e,function(e){if(e.to===_)throw new Error("missing duration");all((e=replaceWithRefs(t.refs,e,!0)).targets,function(n,i,a){var o=addPropertyKeyframes(t,n,i,a,e);r.dirty(o)})}),calculateConfigs(t),r.trigger(CONFIG)};function addPropertyKeyframes(t,e,r,n,i){var a=resolveProperty(i.delay,e,r,n)||0,o=find(t.configs,function(t){return t.target===e})||push(t.configs,{from:max(i.from+a,0),to:max(i.to+a,0),easing:i.easing||"ease",duration:i.to-i.from,endDelay:resolveProperty(i.endDelay,e,r,n)||0,stagger:i.stagger||0,target:e,targetLength:n,propNames:[],keyframes:[]}),u=i.stagger&&i.stagger*(r+1)||0,s=resolveProperty(i.delay,o,r,o.targetLength)||0,f=max(u+s+i.from,0),l=i.to-i.from,c=i.easing||"ease";for(var d in plugins)if(isOwner(i,d)){var p=i[d];for(var g in p){var h=p[g];isOwner(p,g)&&isDefined(h)&&addProperty(o,d,r,g,h,l,f,c)}}return o.keyframes.sort(propKeyframeSort),o}function addProperty(t,e,r,n,i,a,o,u){var s,f;if(!isArrayLike(i)&&isObject(i)){var l=i;l.easing&&(u=l.easing),l.interpolate&&(s=l.interpolate),f=list(l.value)}else f=list(i);var c=f.map(function(e,n,i){var a=resolveProperty(e,t.target,r,t.targetLength),o=a,f=isObject(a),l=f?o.value:a,c=f&&isNumber(o.offset)?o.offset:n===i.length-1?1:0===n?0:_,d=o&&o.interpolate||s;return{offset:c,value:l,easing:o&&o.easing||u,interpolate:d}});inferOffsets(c),all(c,function(i){var u=i.offset,s=i.value,f=flr(a*u+o);(find(t.keyframes,function(t){return t.prop===n&&t.time===f})||push(t.keyframes,{plugin:e,easing:i.easing,index:r,prop:n,time:f,value:s,interpolate:i.interpolate})).value=s}),find(t.keyframes,function(t){return t.prop===n&&t.time===o})||push(t.keyframes,{plugin:e,easing:u,index:r,prop:n,time:o,value:_,interpolate:s});var d=o+a;find(t.keyframes,function(t){return t.prop===n&&t.time===d},!0)||push(t.keyframes,{plugin:e,easing:u,index:r,prop:n,time:d,value:_,interpolate:s}),pushDistinct(t.propNames,n)}function inferOffsets(t){if(t.length){var e=find(t,function(t){return 0===t.offset})||t[0];isDefined(e.offset)||(e.offset=0);var r=find(t,function(t){return 1===t.offset},!0)||t[t.length-1];t.length>1&&!isDefined(r.offset)&&(r.offset=1);for(var n=1,i=t.length;n<i;n++)if(!isDefined(t[n].offset))for(var a=n+1;a<i;a++){var o=t[a].offset;if(isDefined(o)){for(var u=t[n-1].offset,s=o-u,f=a-n+1,l=1;l<f;l++)t[l-1+n].offset=l/a*s+u;n=a;break}}}}var append=function(t,e,r){var n=t.cursor,i=list(e).map(function(t){var e=t.to,r=t.from,i=t.duration,a=isDefined(e),o=isDefined(r),u=isDefined(i),s=t;return s.to=a&&(o||u)?e:u&&o?r+i:a&&!u?n+e:u?n+i:_,s.from=o&&(a||u)?r:a&&u?e-i:a||u?n:_,s});insert(t,i,r)},set=function(t,e,r){var n=Object.keys(plugins),i=list(e).map(function(e){var r=e.at||t.cursor,i={};for(var a in e)if(includes(n,a)){var o=e[a],u={};for(var s in o){var f=o[s];u[s]=[_,f]}i[a]=u}else i[a]=e[a];return i.from=r-1e-9,i.to=r,i});insert(t,i,r)};function rebuild(t,e){var r=t.state;switch(all(t.players,function(t){return t.cancel()}),t.players=_,r){case S_PAUSED:pause(t,_,e);break;case S_PLAYING:play(t,_,e)}}var stateSubs=[],stores={},reducers=((_a={})[APPEND]=append,_a[CANCEL]=cancel$1,_a[DESTROY]=destroy,_a[FINISH]=finish,_a[INSERT]=insert,_a[PAUSE]=pause,_a[PLAY]=play,_a[REVERSE]=reverse,_a[SET]=set,_a[TICK]=tick,_a[UPDATE]=update$1,_a[UPDATE_RATE]=updateRate,_a[UPDATE_TIME]=updateTime,_a);function createInitial(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:_,rate:1,refs:e,repeat:_,round:_,state:S_INACTIVE,time:_,yoyo:!1}}function getState(t){var e=stores[t];if(!e)throw new Error("not found");return e.state}function addState(t){stores[t.id]={state:createInitial(t),subs:{}}}function on(t,e,r){var n=stores[t];n&&pushDistinct(n.subs[e]=n.subs[e]||[],r)}function off(t,e,r){var n=stores[t];n&&remove(n.subs[e],r)}function dispatch(t,e,r){var n=reducers[t],i=stores[e];if(!n||!i)throw new Error("not found");var a={events:[],needUpdate:[],trigger:trigger,dirty:dirty},o=i.state;n(o,r,a),all(a.events,function(t){var e=i.subs[t];e&&all(e,function(t){t(o.time)})}),a.destroyed?delete stores[e]:a.needUpdate.length&&(o.state!==S_INACTIVE?rebuild(o,a):calculateConfigs(o),all(stateSubs,function(t){t(i)}))}function trigger(t){pushDistinct(this.events,t)}function dirty(t){pushDistinct(this.needUpdate,t)}"undefined"!=typeof window&&(window.just_devtools={dispatch:dispatch,subscribe:function(t){pushDistinct(stateSubs,t)},unsubscribe:function(t){remove(stateSubs,t)}});var timelineProto={get state(){return getState(this.id).state},get duration(){return getState(this.id).duration},get currentTime(){return getState(this.id).time},set currentTime(t){dispatch(UPDATE_TIME,this.id,t)},get playbackRate(){return getState(this.id).rate},set playbackRate(t){dispatch(UPDATE_RATE,this.id,t)},add:function(t){return dispatch(APPEND,this.id,t),this},animate:function(t){return dispatch(APPEND,this.id,t),this},fromTo:function(t,e,r){return all(r,function(r){r.to=e,r.from=t}),dispatch(INSERT,this.id,r),this},cancel:function(){return dispatch(CANCEL,this.id),this},destroy:function(){dispatch(DESTROY,this.id)},finish:function(){return dispatch(FINISH,this.id),this},on:function(t,e){return on(this.id,t,e),this},once:function(t,e){var r=this;return r.on(t,function n(i){r.off(t,n),e(i)}),r},off:function(t,e){return off(this.id,t,e),this},pause:function(){return dispatch(PAUSE,this.id),this},play:function(t){return dispatch(PLAY,this.id,t),this},reverse:function(){return dispatch(REVERSE,this.id),this},seek:function(t){return dispatch(UPDATE_TIME,this.id,t),this},sequence:function(t){var e=this;return all(t,function(t){return dispatch(APPEND,e.id,t)}),this},set:function(t){return dispatch(SET,this.id,t),this}};function timeline(t){var e=Object.create(timelineProto);return(t=t||{}).id=t.id||uuid(),e.id=t.id,addState(t),e}var pi=Math.PI,epsilon=1e-4,c="cubic-bezier",s="steps",ease=c+"(.25,.1,.25,1)",easeIn=c+"(.42,0,1,1)",easeInOut=c+"(.42,0,.58,1)",easeOut=c+"(0,0,.58,1)",linear=c+"(0,0,1,1)",stepEnd=s+"(1,0)",stepStart=s+"(1,1)",steps=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}},bezier=function(t,e,r){return 3*t*(1-r)*(1-r)*r+3*e*(1-r)*r*r+r*r*r},cubicBezier$$1=function(t,e,r,n){return t<0||t>1||r<0||r>1?function(t){return t}:function(i){if(0===i||1===i)return i;var a=0,o=1,u=19;do{var s=.5*(a+o),f=bezier(t,r,s);if(abs$1(i-f)<epsilon)return bezier(e,n,s);f<i?a=s:o=s}while(--u);return i}},camelCaseRegex=/([a-z])[- ]([a-z])/gi,cssFunctionRegex=/^([a-z-]+)\(([^\)]+)\)$/i,cssEasings={ease:ease,easeIn:easeIn,easeOut:easeOut,easeInOut:easeInOut,stepStart:stepStart,stepEnd:stepEnd,linear:linear},camelCaseMatcher=function(t,e,r){return e+r.toUpperCase()},toCamelCase=function(t){return"string"==typeof t?t.replace(camelCaseRegex,camelCaseMatcher):""},find$1=function(t){var e=toCamelCase(t),r=cssEasings[e]||t,n=cssFunctionRegex.exec(r);if(!n)throw new Error("css parse error");return[n[1]].concat(n[2].split(","))},cssFunction=function(t){var e=find$1(t),r=e[0];if("steps"===r)return steps(+e[1],e[2]);if("cubic-bezier"===r)return cubicBezier$$1(+e[1],+e[2],+e[3],+e[4]);throw new Error("css parse error")},abs$1=Math.abs;function memoize(t){var e=[];return function(){for(var r=arguments,n=0,i=e.length;n<i;n++){var a=e[n].args,o=r.length;if(a.length===o){for(var u=0,s=0;s<o&&a[s]===r[s];s++)++u;if(u===o)return e[n].value}}var f=t.apply(_,r);return e.push({args:r,value:f}),f}}function findEndIndex(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n]>e)return n;return r-1}var getEasing=memoize(cssFunction),getInterpolator=memoize(function(t){return memoize(t)});function interpolate(t,e,r){return t+(e-t)*r}function fallbackInterpolator(t,e,r){return r<.5?t:e}function interpolator(t,e){var r=e.map(function(e){return e.offset*t});return all(e,function(t){var e=!isFunction(t.interpolate);t.simpleFn=e,t.interpolate=e?isNumber(t.value)?interpolate:fallbackInterpolator:getInterpolator(t.interpolate)}),function(n){var i=t*n,a=findEndIndex(r,i),o=a?a-1:0,u=r[a],s=r[o],f=e[o],l=(i-s)/(u-s),c=f.easing?getEasing(f.easing)(l):l;return f.simpleFn?f.interpolate(f.value,e[a].value,c):f.interpolate(f.value,e[a].value)(c)}}function hyphenate(t){return t.replace(/([A-Z])/g,function(t){return"-"+t[0].toLowerCase()})}function csvToList(t){return t.split(",")}var PROPERTY=0,ATTRIBUTE=1,ATTRIBUTE_HYPHENATE=2,CSSVAR=3,cssVarExp=/^\-\-[a-z0-9\-]+$/i,viewbox="viewBox",svgReadonly=[viewbox],noHyphenate=[viewbox],propsPlugin={name:"props",animate:function(t){var e=t.target,r=t.prop,n=interpolator(t.to-t.from,t.keyframes),i=getTargetSetter(e,r),a=getTargetGetter(e,r),o=_;return{cancel:function(){o!==_&&i(o),o=_},update:function(t,e,r){o===_&&(o=a()),i(n(t))}}},getValue:function(t,e){return getTargetGetter(t,e)()}};function getTargetType(t,e){return isDOM(t)?cssVarExp.test(e)?CSSVAR:void 0===t[e]||includes(svgReadonly,e)?includes(noHyphenate,e)?ATTRIBUTE:ATTRIBUTE_HYPHENATE:PROPERTY:PROPERTY}function getTargetGetter(t,e){var r=getTargetType(t,e);return r===CSSVAR?getVariable(t,e):r===ATTRIBUTE?getAttribute(t,e):r===ATTRIBUTE_HYPHENATE?getAttributeHyphenate(t,e):getProperty(t,e)}function getTargetSetter(t,e){var r=getTargetType(t,e);return r===CSSVAR?setVariable(t,e):r===ATTRIBUTE?setAttribute(t,e):r===ATTRIBUTE_HYPHENATE?setAttributeHyphenate(t,e):setProperty(t,e)}function getAttribute(t,e){return function(){return t.getAttribute(e)}}function setAttribute(t,e){return function(r){return t.setAttribute(e,r)}}function setAttributeHyphenate(t,e){var r=hyphenate(e);return function(e){return t.setAttribute(r,e)}}function getAttributeHyphenate(t,e){var r=hyphenate(e);return function(){return t.getAttribute(r)}}function getVariable(t,e){return function(){return t.style.getPropertyValue(e)}}function setVariable(t,e){return function(r){return t.style.setProperty(e,r?r+"":"")}}function setProperty(t,e){return function(r){return t[e]=r}}function getProperty(t,e){return function(){return t[e]}}function animate(t){return timeline().add(t)}addPlugin(propsPlugin);var RUNNING="running",PX="px",DEG="deg",X="X",Y="Y",Z="Z",TRANSLATE="translate",TRANSFORM="transform",transformAngles=csvToList("rotateX,rotateY,rotateZ,rotate"),transformScales=csvToList("scaleX,scaleY,scaleZ,scale"),transformLengths=csvToList("perspective,x,y,z"),transforms=transformAngles.concat(transformScales,transformLengths),aliases={x:TRANSLATE+X,y:TRANSLATE+Y,z:TRANSLATE+Z},cssLengths=csvToList("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"),frameSize=17;function animate$1(t){var e=t.keyframes,r=t.prop,n=t.from,i=t.to,a=t.target,o=i-n,u=memoize(function(){var t=e.map(function(t){var e,n=t.offset,i=t.value,a=t.easing;return(e={offset:n})[r]=i,e.easing=a,e}),n=a.animate(t,{duration:o,fill:"both"});return n.pause(),n});return{cancel:function(){u().cancel()},update:function(t,e,r){var n=u(),i=o*t;if(abs(n.currentTime-i)>1&&(n.currentTime=i),r&&n.playbackRate!==e){var a=n.currentTime;a<1?n.currentTime=1:a>=o-1&&(n.currentTime=o-1),n.playbackRate=e}r&&!(n.playState===RUNNING||"finish"===n.playState)&&!(e<0&&i<frameSize)&&!(e>=0&&i>o-frameSize)&&n.play(),!r&&(n.playState===RUNNING||"pending"===n.playState)&&n.pause()}}}function appendUnits(t){for(var e in t)if(includes(cssLengths,e)){var r=t[e];for(var n in r){var i=r[n];isDefined(i)&&isNumber(i.value)&&(i.value+=PX)}}}function parseUnit(t){var e={unit:_,value:_};if(!isDefined(t))return e;if(Number(t))return e.value=+t,e;var r=measureExpression.exec(t);return r&&(e.unit=r[2]||_,e.value=r[1]?parseFloat(r[1]):_),e}function combineTransforms(t,e,r){var n=t.propNames.filter(function(t){return includes(transforms,t)});if(n.length){if(includes(t.propNames,TRANSFORM))throw new Error("transform + shorthand is not allowed");var i=[],a={};all(n,function(t){var r=e[t];r&&all(r,function(t){a[t.offset]=t.easing,pushDistinct(i,t.offset)})}),i.sort();for(var o=i.map(function(t){var r={};return all(n,function(n){var i=find(e[n],function(e){return e.offset===t});r[n]=i?i.value:_}),{offset:t,easing:a[t],values:r}}),u=o.length,s=u-1;s>-1;--s){var f=o[s];for(var l in f.values)if(!isDefined(f.values[l])){for(var c=_,d=s-1;d>-1;d--)if(isDefined(o[d].values[l])){c=d;break}for(var p=_,g=s+1;g<u;g++)if(isDefined(o[g].values[l])){p=g;break}var h=c!==_;if(h&&p!==_)for(var v=o[c],m=o[p],y=parseUnit(v.values[l]),w=parseUnit(m.values[l]),b=c+1;b<p;b++){var R=(i[b]-v.offset)/(m.offset-v.offset),A=y.value+(w.value-y.value)*R+(w.unit||y.unit||"");o[b].values[l]=A}else if(h)for(b=c+1;b<u;b++)o[b].values[l]=o[c].values[l]}}if(o.length){all(n,function(t){e[t]=_});var T=[];all(o,function(t){var e=_;for(var r in t.values){var n=parseUnit(t.values[r]);n.value!==_&&(n.unit||(n.unit=includes(transformLengths,r)?PX:includes(transformAngles,r)?DEG:""),e=(e?e+" ":"")+(aliases[r]||r)+"("+n.value+n.unit+")")}T.push({offset:t.offset,value:e,easing:t.easing,interpolate:_})}),e[TRANSFORM]=T,r[TRANSFORM]="web"}}}var waapiPlugin={name:"web",animate:animate$1,getValue:function(t,e){return getComputedStyle(t)[e]},onWillAnimate:function(t,e,r){isDOM(t.target)&&(appendUnits(e),combineTransforms(t,e,r))}};function createCommonjsModule(t,e){return t(e={exports:{}},e.exports),e.exports}var HorizontalFocalPoint,VerticalFocalPoint,qrcode_1=createCommonjsModule(function(t,e){var r,n=function(){var t=function(t,e){var r=t,n=i[e],o=null,g=0,h=null,m=[],y={},w=function(t,e){o=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}(g=4*r+17),b(0,0),b(g-7,0),b(0,g-7),A(),R(),C(t,e),r>=7&&T(t),null==h&&(h=S(r,n,m)),P(h,e)},b=function(t,e){for(var r=-1;r<=7;r+=1)if(!(t+r<=-1||g<=t+r))for(var n=-1;n<=7;n+=1)e+n<=-1||g<=e+n||(o[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)},R=function(){for(var t=8;t<g-8;t+=1)null==o[t][6]&&(o[t][6]=t%2==0);for(var e=8;e<g-8;e+=1)null==o[6][e]&&(o[6][e]=e%2==0)},A=function(){for(var t=a.getPatternPosition(r),e=0;e<t.length;e+=1)for(var n=0;n<t.length;n+=1){var i=t[e],u=t[n];if(null==o[i][u])for(var s=-2;s<=2;s+=1)for(var f=-2;f<=2;f+=1)o[i+s][u+f]=-2==s||2==s||-2==f||2==f||0==s&&0==f}},T=function(t){for(var e=a.getBCHTypeNumber(r),n=0;n<18;n+=1){var i=!t&&1==(e>>n&1);o[Math.floor(n/3)][n%3+g-8-3]=i}for(n=0;n<18;n+=1)i=!t&&1==(e>>n&1),o[n%3+g-8-3][Math.floor(n/3)]=i},C=function(t,e){for(var r=n<<3|e,i=a.getBCHTypeInfo(r),u=0;u<15;u+=1){var s=!t&&1==(i>>u&1);u<6?o[u][8]=s:u<8?o[u+1][8]=s:o[g-15+u][8]=s}for(u=0;u<15;u+=1)s=!t&&1==(i>>u&1),u<8?o[8][g-u-1]=s:u<9?o[8][15-u-1+1]=s:o[8][15-u-1]=s;o[g-8][8]=!t},P=function(t,e){for(var r=-1,n=g-1,i=7,u=0,s=a.getMaskFunction(e),f=g-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var l=0;l<2;l+=1)if(null==o[n][f-l]){var c=!1;u<t.length&&(c=1==(t[u]>>>i&1)),s(n,f-l)&&(c=!c),o[n][f-l]=c,-1==(i-=1)&&(u+=1,i=7)}if((n+=r)<0||g<=n){n-=r,r=-r;break}}},S=function(t,e,r){for(var n=s.getRSBlocks(t,e),i=f(),o=0;o<r.length;o+=1){var l=r[o];i.put(l.getMode(),4),i.put(l.getLength(),a.getLengthInBits(l.getMode(),t)),l.write(i)}var c=0;for(o=0;o<n.length;o+=1)c+=n[o].dataCount;if(i.getLengthInBits()>8*c)throw"code length overflow. ("+i.getLengthInBits()+">"+8*c+")";for(i.getLengthInBits()+4<=8*c&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*c||(i.put(236,8),i.getLengthInBits()>=8*c));)i.put(17,8);return function(t,e){for(var r=0,n=0,i=0,o=new Array(e.length),s=new Array(e.length),f=0;f<e.length;f+=1){var l=e[f].dataCount,c=e[f].totalCount-l;n=Math.max(n,l),i=Math.max(i,c),o[f]=new Array(l);for(var d=0;d<o[f].length;d+=1)o[f][d]=255&t.getBuffer()[d+r];r+=l;var p=a.getErrorCorrectPolynomial(c),g=u(o[f],p.getLength()-1).mod(p);for(s[f]=new Array(p.getLength()-1),d=0;d<s[f].length;d+=1){var h=d+g.getLength()-s[f].length;s[f][d]=h>=0?g.getAt(h):0}}var v=0;for(d=0;d<e.length;d+=1)v+=e[d].totalCount;var m=new Array(v),y=0;for(d=0;d<n;d+=1)for(f=0;f<e.length;f+=1)d<o[f].length&&(m[y]=o[f][d],y+=1);for(d=0;d<i;d+=1)for(f=0;f<e.length;f+=1)d<s[f].length&&(m[y]=s[f][d],y+=1);return m}(i,n)};return y.addData=function(t,e){var r=null;switch(e=e||"Byte"){case"Numeric":r=l(t);break;case"Alphanumeric":r=c(t);break;case"Byte":r=d(t);break;case"Kanji":r=p(t);break;default:throw"mode:"+e}m.push(r),h=null},y.isDark=function(t,e){if(t<0||g<=t||e<0||g<=e)throw t+","+e;return o[t][e]},y.getModuleCount=function(){return g},y.make=function(){if(r<1){for(var t=1;t<40;t++){for(var e=s.getRSBlocks(t,n),i=f(),o=0;o<m.length;o++){var u=m[o];i.put(u.getMode(),4),i.put(u.getLength(),a.getLengthInBits(u.getMode(),t)),u.write(i)}var l=0;for(o=0;o<e.length;o++)l+=e[o].dataCount;if(i.getLengthInBits()<=8*l)break}r=t}w(!1,function(){for(var t=0,e=0,r=0;r<8;r+=1){w(!0,r);var n=a.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 i=0;i<y.getModuleCount();i+=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,i)?"#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,i,a,o=y.getModuleCount()*t+2*e,u="";for(a="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",u+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',u+=' width="'+o+'px"',u+=' height="'+o+'px"',u+=' viewBox="0 0 '+o+" "+o+'" ',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(i=n*t+e,r=0;r<y.getModuleCount();r+=1)y.isDark(n,r)&&(u+="M"+(r*t+e)+","+i+a);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,i=r-e;return v(r,r,function(e,r){if(n<=e&&e<i&&n<=r&&r<i){var a=Math.floor((e-n)/t),o=Math.floor((r-n)/t);return y.isDark(o,a)?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,i="";return i+="<img",i+=' src="',i+=y.createDataURL(t,e),i+='"',i+=' width="',i+=n,i+='"',i+=' height="',i+=n,i+='"',r&&(i+=' alt="',i+=r,i+='"'),i+"/>"},y.renderTo2dContext=function(t,e){e=e||2;for(var r=y.getModuleCount(),n=0;n<r;n++)for(var i=0;i<r;i++)t.fillStyle=y.isDark(n,i)?"black":"white",t.fillRect(n*e,i*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=h(t),n=function(){var t=r.read();if(-1==t)throw"eof";return t},i=0,a={};;){var o=r.read();if(-1==o)break;var u=n(),s=n()<<8|n();a[String.fromCharCode(o<<8|u)]=s,i+=1}if(i!=e)throw i+" != "+e;return a}(),n="?".charCodeAt(0);return function(t){for(var e=[],i=0;i<t.length;i+=1){var a=t.charCodeAt(i);if(a<128)e.push(a);else{var o=r[t.charAt(i)];"number"==typeof o?(255&o)==o?e.push(o):(e.push(o>>>8),e.push(255&o)):e.push(n)}}return e}};var e,r,n,i={L:1,M:0,Q:3,H:2},a=(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,o.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 i=0;i<e;i+=1){for(var a=0,o=t.isDark(n,i),u=-1;u<=1;u+=1)if(!(n+u<0||e<=n+u))for(var s=-1;s<=1;s+=1)i+s<0||e<=i+s||0==u&&0==s||o==t.isDark(n+u,i+s)&&(a+=1);a>5&&(r+=3+a-5)}for(n=0;n<e-1;n+=1)for(i=0;i<e-1;i+=1){var f=0;t.isDark(n,i)&&(f+=1),t.isDark(n+1,i)&&(f+=1),t.isDark(n,i+1)&&(f+=1),t.isDark(n+1,i+1)&&(f+=1),0!=f&&4!=f||(r+=3)}for(n=0;n<e;n+=1)for(i=0;i<e-6;i+=1)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(i=0;i<e;i+=1)for(n=0;n<e-6;n+=1)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);var l=0;for(i=0;i<e;i+=1)for(n=0;n<e;n+=1)t.isDark(n,i)&&(l+=1);return r+Math.abs(100*l/e/e-50)/5*10},r),o=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),i=0;i<t.length-r;i+=1)n[i]=t[i+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 i=0;i<t.getLength();i+=1)e[r+i]^=o.gexp(o.glog(n.getAt(r))+o.glog(t.getAt(i)));return u(e,0)},mod:function(t){if(n.getLength()-t.getLength()<0)return n;for(var e=o.glog(n.getAt(0))-o.glog(t.getAt(0)),r=new Array(n.getLength()),i=0;i<n.getLength();i+=1)r[i]=n.getAt(i);for(i=0;i<t.getLength();i+=1)r[i]^=o.gexp(o.glog(t.getAt(i))+e);return u(r,0).mod(t)}};return n}var s=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 a=function(e,r){switch(r){case i.L:return t[4*(e-1)+0];case i.M:return t[4*(e-1)+1];case i.Q:return t[4*(e-1)+2];case i.H:return t[4*(e-1)+3];default:return}}(r,n);if(void 0===a)throw"bad rs block @ typeNumber:"+r+"/errorCorrectionLevel:"+n;for(var o=a.length/3,u=[],s=0;s<o;s+=1)for(var f=a[3*s+0],l=a[3*s+1],c=a[3*s+2],d=0;d<f;d+=1)u.push(e(l,c));return u}};return r}(),f=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},l=function(t){var e=t,r={getMode:function(){return 1},getLength:function(t){return e.length},write:function(t){for(var r=e,i=0;i+2<r.length;)t.put(n(r.substring(i,i+3)),10),i+=3;i<r.length&&(r.length-i==1?t.put(n(r.substring(i,i+1)),4):r.length-i==2&&t.put(n(r.substring(i,i+2)),7))}},n=function(t){for(var e=0,r=0;r<t.length;r+=1)e=10*e+i(t.charAt(r));return e},i=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return r},c=function(t){var e=t,r={getMode:function(){return 2},getLength:function(t){return e.length},write:function(t){for(var r=e,i=0;i+1<r.length;)t.put(45*n(r.charAt(i))+n(r.charAt(i+1)),11),i+=2;i<r.length&&t.put(n(r.charAt(i)),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)}}},p=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 i=(255&e[r])<<8|255&e[r+1];if(33088<=i&&i<=40956)i-=33088;else{if(!(57408<=i&&i<=60351))throw"illegal char at "+(r+1)+"/"+i;i-=49472}i=192*(i>>>8&255)+(255&i),t.put(i,13),r+=2}if(r<e.length)throw"illegal char at "+(r+1)}}},g=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 i=0;i<n;i+=1)e.writeByte(t[i+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},h=function(t){var e=t,r=0,n=0,i=0,a={read:function(){for(;i<8;){if(r>=e.length){if(0==i)return-1;throw"unexpected end of file./"+i}var t=e.charAt(r);if(r+=1,"="==t)return i=0,-1;t.match(/^\s$/)||(n=n<<6|o(t.charCodeAt(0)),i+=6)}var a=n>>>i-8&255;return i-=8,a}},o=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 a},v=function(t,e,r){for(var n=function(t,e){var r=t,n=e,i=new Array(t*e),a={setPixel:function(t,e,n){i[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=o(2);t.writeByte(2);for(var i=0;e.length-i>255;)t.writeByte(255),t.writeBytes(e,i,255),i+=255;t.writeByte(e.length-i),t.writeBytes(e,i,e.length-i),t.writeByte(0),t.writeString(";")}},o=function(t){for(var e=1<<t,r=1+(1<<t),n=t+1,a=u(),o=0;o<e;o+=1)a.add(String.fromCharCode(o));a.add(String.fromCharCode(e)),a.add(String.fromCharCode(r));var s,f,l,c=g(),d=(s=c,f=0,l=0,{write:function(t,e){if(t>>>e!=0)throw"length over";for(;f+e>=8;)s.writeByte(255&(t<<f|l)),e-=8-f,t>>>=8-f,l=0,f=0;l|=t<<f,f+=e},flush:function(){f>0&&s.writeByte(l)}});d.write(e,n);var p=0,h=String.fromCharCode(i[p]);for(p+=1;p<i.length;){var v=String.fromCharCode(i[p]);p+=1,a.contains(h+v)?h+=v:(d.write(a.indexOf(h),n),a.size()<4095&&(a.size()==1<<n&&(n+=1),a.add(h+v)),h=v)}return d.write(a.indexOf(h),n),d.write(r,n),d.flush(),c.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 a}(t,e),i=0;i<e;i+=1)for(var a=0;a<t;a+=1)n.setPixel(a,i,r(a,i));var o=g();n.write(o);for(var u,s,f,l,c,d,p,h=(u=0,s=0,f=0,l="",d=function(t){l+=String.fromCharCode(p(63&t))},p=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},(c={}).writeByte=function(t){for(u=u<<8|255&t,s+=8,f+=1;s>=6;)d(u>>>s-6),s-=6},c.flush=function(){if(s>0&&(d(u<<6-s),u=0,s=0),f%3!=0)for(var t=3-f%3,e=0;e<t;e+=1)l+="="},c.toString=function(){return l},c),v=o.toByteArray(),m=0;m<v.length;m+=1)h.writeByte(v[m]);return h.flush(),"data:image/gif;base64,"+h};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()}),distanceBetween=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"}(HorizontalFocalPoint||(HorizontalFocalPoint={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Bottom=2]="Bottom"}(VerticalFocalPoint||(VerticalFocalPoint={}));var translatePoint=function(t){return function(e,r,n,i){return{adjustedX:n===HorizontalFocalPoint.Left?e:n===HorizontalFocalPoint.Right?e+t:e+t/2,adjustedY:i===VerticalFocalPoint.Top?r:i===VerticalFocalPoint.Bottom?r+t:r+t/2}}},adjustRing=translatePoint(7),adjustCenter=translatePoint(3);function focalPoint(t,e,r,n,i){return t<e?r:t>e?i:n}var QRCodeEntity,AnimationPreset,innermostPoint=function(t,e,r,n){var i=r/2,a=focalPoint(t,i,HorizontalFocalPoint.Right,HorizontalFocalPoint.Middle,HorizontalFocalPoint.Left),o=focalPoint(e,i,VerticalFocalPoint.Bottom,VerticalFocalPoint.Center,VerticalFocalPoint.Top);return n===QRCodeEntity.PositionCenter?adjustCenter(t,e,a,o):n===QRCodeEntity.PositionRing?adjustRing(t,e,a,o):{adjustedX:t,adjustedY:e}},underdampedHarmonicOscillationMaximums=function(t,e,r){var n=e-Math.pow(r,2);if(n<0)throw new Error("This method only supports underdamped oscillation.");var i=Math.sqrt(n),a=function(e){return function(e){return t*Math.pow(Math.E,-r*e)}(e)*Math.cos(i*e+0)},o=function(t){return(Math.atan(-r/i)+t*Math.PI-0)/i},u=[];u.push({time:0,amplitude:a(0)});for(var s=0;Math.abs(u[u.length-1].amplitude)>.01;s++)o(s)>=0&&u.push({time:o(s),amplitude:a(o(s))});return u},scaleOscillationsToOffset=function(t,e,r){var n=(e-t)/r[r.length-1].time;return r.map(function(e){var r=e.time,i=e.amplitude;return{offset:t+r*n,value:i}})},applyToValues=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"}(QRCodeEntity||(QRCodeEntity={})),function(t){t.FadeInTopDown="FadeInTopDown",t.FadeInCenterOut="FadeInCenterOut",t.RadialRipple="RadialRipple",t.RadialRippleIn="RadialRippleIn",t.MaterializeIn="MaterializeIn"}(AnimationPreset||(AnimationPreset={}));var FadeInTopDown=function(t,e,r,n,i){return{targets:t,from:20*r,duration:300,web:{opacity:[0,1]}}},FadeInCenterOut=function(t,e,r,n,i){var a=innermostPoint(e,r,n,i),o=a.adjustedX,u=a.adjustedY,s=n/2;return{targets:t,from:20*distanceBetween(o,u,s,s),duration:200,web:{opacity:[0,1]}}},MaterializeIn=function(t,e,r,n,i){return{targets:t,from:i===QRCodeEntity.Module?200*Math.random():200,duration:200,web:{opacity:[0,1]}}},beginOscillation=.2,endOscillation=1,amplitude=5,stiffness=50,damping=3,radialRippleMaximums=underdampedHarmonicOscillationMaximums(amplitude,stiffness,damping),radialRippleOscillationKeyframes=scaleOscillationsToOffset(beginOscillation,endOscillation,radialRippleMaximums),RadialRipple=function(t,e,r,n,i){var a=innermostPoint(e,r,n,i),o=a.adjustedX,u=a.adjustedY,s=n/2;return{targets:t,from:7*distanceBetween(o,u,s,s),easing:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",duration:1e3,web:{scale:(i===QRCodeEntity.Icon?[{offset:0,value:1},{offset:.1,value:.7},{offset:.2,value:1}]:[{offset:0,value:1}]).concat(applyToValues(radialRippleOscillationKeyframes,function(t){return 1+t/amplitude*.1}),[1])}}},RadialRippleIn=function(t,e,r,n,i){var a=innermostPoint(e,r,n,i),o=a.adjustedX,u=a.adjustedY,s=n/2;return{targets:t,from:7*distanceBetween(o,u,s,s),easing:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",duration:1e3,web:{scale:(i===QRCodeEntity.Icon?[{offset:0,value:1},{offset:.1,value:.7},{offset:.2,value:1}]:[{offset:0,value:0}]).concat(applyToValues(radialRippleOscillationKeyframes,function(t){return 1+t/amplitude*.1}),[1]),opacity:[{offset:0,value:0},{offset:.05,value:1}]}}},getAnimationPreset=function(t){switch(t){case AnimationPreset.FadeInTopDown:return FadeInTopDown;case AnimationPreset.FadeInCenterOut:return FadeInCenterOut;case AnimationPreset.RadialRipple:return RadialRipple;case AnimationPreset.RadialRippleIn:return RadialRippleIn;case AnimationPreset.MaterializeIn:return MaterializeIn;default:throw new Error(t+" is not a valid AnimationPreset.")}};addPlugin(waapiPlugin);var BpQRCode=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?getAnimationPreset(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")),i=Array.from(this.qrCodeElement.shadowRoot.querySelectorAll(".position-center")),a=Array.from(this.qrCodeElement.shadowRoot.querySelectorAll("#icon-wrapper")),o=function(t,e){return t.map(function(t){return{element:t,entityType:e}})};animate(o(r,QRCodeEntity.Module).concat(o(n,QRCodeEntity.PositionRing),o(i,QRCodeEntity.PositionCenter),o(a,QRCodeEntity.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=qrcode_1(0,"H");r.addData(t),r.make(),this.moduleCount=r.getModuleCount();var n=this.moduleCount+8,i=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-i)+" "+(0-i)+" "+n+" "+n+'"\n preserveAspectRatio="xMinYMin meet">\n <rect\n width="100%"\n height="100%"\n fill="white"\n fill-opacity="0"\n cx="'+-i+'"\n cy="'+-i+'"/>\n '+(this.squares?void 0:function(t,e,r,n,i){return"\n "+a(4,4,4,r,n,i)+"\n "+a(t-7+4,4,4,r,n,i)+"\n "+a(4,t-7+4,4,r,n,i)+"\n "}(this.moduleCount,0,this.positionRingColor,this.positionCenterColor,i))+"\n "+function(t,e,r,n,i,a,s,f){for(var l="",c=0;c<e;c+=1)for(var d=c+4,p=0;p<e;p+=1)if(t.isDark(c,p)&&(a||!o(p,c,e)&&!u(p,c,e,n,i))){var g=p+4;l+=a?'\n <rect x="'+(d-.5-f)+'" y="'+(g-.5-f)+'" width="1" height="1" />\n ':'\n <circle\n class="module"\n fill="'+s+'"\n cx="'+(d-f)+'"\n cy="'+(g-f)+'"\n data-column="'+c+'"\n data-row="'+p+'"\n r="0.5"/>'}return l}(r,this.moduleCount,0,e,this.maskXToYRatio,this.squares,this.moduleColor,i)+"\n </svg>";function a(t,e,r,n,i,a){return'\n <path class="position-ring" fill="'+n+'" data-column="'+(t-r)+'" data-row="'+(e-r)+'" d="M'+(t-a)+" "+(e-.5-a)+'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="'+i+'" data-column="'+(t-r+2)+'" data-row="'+(e-r+2)+'" d="M'+(t+2-a)+" "+(e+1.5-a)+'h2s.5 0 .5 .5v2s0 .5-.5 .5h-2s-.5 0-.5-.5v-2s0-.5 .5-.5z"/>\n '}function o(t,e,r){return t<=7?e<=7||e>=r-7:e<=7&&t>=r-7}function u(t,e,r,n,i){if(!n)return!1;var a=r/2,o=Math.floor(r*Math.sqrt(.1)/2),u=o*i,s=o/i;return t>=a-s&&t<=a+s&&e>=a-u&&e<=a+u}},t.prototype.render=function(){return h("div",{id:"qr-container"},h("div",{id:"icon-container",style:this.squares?{display:"none",visibility:"hidden"}:{}},h("div",{id:"icon-wrapper",style:{width:18*this.maskXToYRatio+"%"},"data-column":this.moduleCount/2,"data-row":this.moduleCount/2},h("slot",{name:"icon"}))),h("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":host{display:block;contain:content}#qr-container{position:relative}#icon-container{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}();export{BpQRCode as QrCode};