@qrauth/web-components 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +2 -2
- package/dist/qrauth-components.esm.js +1 -1
- package/dist/qrauth-components.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# @qrauth/web-components
|
|
2
2
|
|
|
3
|
+
## [0.4.3] — 2026-10-22
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Rebuilt with esbuild 0.28.2 (was 0.28.0). The bundler runtime helper differs; no attribute, event or behaviour change. Bundle size unchanged within 0.1 KB.
|
|
7
|
+
|
|
3
8
|
## [0.4.2] — 2026-10-13
|
|
4
9
|
|
|
5
10
|
### Security
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @qrauth/web-components
|
|
2
2
|
|
|
3
|
-
Drop-in Web Components for [QRAuth](https://qrauth.io) — passwordless QR authentication, 2FA, and ephemeral delegated access. Shadow DOM, framework-free,
|
|
3
|
+
Drop-in Web Components for [QRAuth](https://qrauth.io) — passwordless QR authentication, 2FA, and ephemeral delegated access. Shadow DOM, framework-free, 20.8 KB gzipped (0.4.3).
|
|
4
4
|
|
|
5
5
|
<a href="https://openid.net/certification/certified-openid-providers-profiles/"><img src="https://qrauth.io/assets/certifications/openid-certified.png" alt="OpenID Certified" width="180" /></a>
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ QRAuth is an **OpenID Certified™** OpenID Provider (Basic OP + Config OP profi
|
|
|
8
8
|
|
|
9
9
|
- `<qrauth-login>` — passwordless sign-in, button or inline. Mobile-aware pending state (tap-to-continue CTA with QR demoted under a "Use another device" expander).
|
|
10
10
|
- `<qrauth-2fa>` — drop-in second-factor step with session-token binding.
|
|
11
|
-
- `<qrauth-ephemeral>` — time-limited,
|
|
11
|
+
- `<qrauth-ephemeral>` — time-limited access QRs, optionally bound to a device fingerprint.
|
|
12
12
|
|
|
13
13
|
All three components bubble `qrauth:*` events across the Shadow DOM boundary (`composed: true`) so any framework can listen with plain `addEventListener`.
|
|
14
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @qrauth/web-components v0.4.
|
|
1
|
+
/* @qrauth/web-components v0.4.3 — https://qrauth.io */
|
|
2
2
|
var Ke=Object.create;var mt=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Je=Object.prototype.hasOwnProperty;var We=(i,e,t)=>e in i?mt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var g=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Ze=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ge(e))!Je.call(i,n)&&n!==t&&mt(i,n,{get:()=>e[n],enumerable:!(r=Ye(e,n))||r.enumerable});return i};var tr=(i,e,t)=>(t=i!=null?Ke(Xe(i)):{},Ze(e||!i||!i.__esModule?mt(t,"default",{value:i,enumerable:!0}):t,i));var p=(i,e,t)=>We(i,typeof e!="symbol"?e+"":e,t);var Ht=g((ei,Qt)=>{Qt.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var S=g(T=>{var bt,er=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];T.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};T.getSymbolTotalCodewords=function(e){return er[e]};T.getBCHDigit=function(i){let e=0;for(;i!==0;)e++,i>>>=1;return e};T.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');bt=e};T.isKanjiModeEnabled=function(){return typeof bt<"u"};T.toSJIS=function(e){return bt(e)}});var J=g(v=>{v.L={bit:1};v.M={bit:0};v.Q={bit:3};v.H={bit:2};function rr(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return v.L;case"m":case"medium":return v.M;case"q":case"quartile":return v.Q;case"h":case"high":return v.H;default:throw new Error("Unknown EC Level: "+i)}}v.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};v.from=function(e,t){if(v.isValid(e))return e;try{return rr(e)}catch{return t}}});var Kt=g((ni,jt)=>{function Ot(){this.buffer=[],this.length=0}Ot.prototype={get:function(i){let e=Math.floor(i/8);return(this.buffer[e]>>>7-i%8&1)===1},put:function(i,e){for(let t=0;t<e;t++)this.putBit((i>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),i&&(this.buffer[e]|=128>>>this.length%8),this.length++}};jt.exports=Ot});var Gt=g((si,Yt)=>{function V(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}V.prototype.set=function(i,e,t,r){let n=i*this.size+e;this.data[n]=t,r&&(this.reservedBit[n]=!0)};V.prototype.get=function(i,e){return this.data[i*this.size+e]};V.prototype.xor=function(i,e,t){this.data[i*this.size+e]^=t};V.prototype.isReserved=function(i,e){return this.reservedBit[i*this.size+e]};Yt.exports=V});var Xt=g(W=>{var ir=S().getSymbolSize;W.getRowColCoords=function(e){if(e===1)return[];let t=Math.floor(e/7)+2,r=ir(e),n=r===145?26:Math.ceil((r-13)/(2*t-2))*2,s=[r-7];for(let o=1;o<t-1;o++)s[o]=s[o-1]-n;return s.push(6),s.reverse()};W.getPositions=function(e){let t=[],r=W.getRowColCoords(e),n=r.length;for(let s=0;s<n;s++)for(let o=0;o<n;o++)s===0&&o===0||s===0&&o===n-1||s===n-1&&o===0||t.push([r[s],r[o]]);return t}});var Zt=g(Wt=>{var nr=S().getSymbolSize,Jt=7;Wt.getPositions=function(e){let t=nr(e);return[[0,0],[t-Jt,0],[0,t-Jt]]}});var te=g(f=>{f.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var R={N1:3,N2:3,N3:40,N4:10};f.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};f.from=function(e){return f.isValid(e)?parseInt(e,10):void 0};f.getPenaltyN1=function(e){let t=e.size,r=0,n=0,s=0,o=null,a=null;for(let l=0;l<t;l++){n=s=0,o=a=null;for(let d=0;d<t;d++){let c=e.get(l,d);c===o?n++:(n>=5&&(r+=R.N1+(n-5)),o=c,n=1),c=e.get(d,l),c===a?s++:(s>=5&&(r+=R.N1+(s-5)),a=c,s=1)}n>=5&&(r+=R.N1+(n-5)),s>=5&&(r+=R.N1+(s-5))}return r};f.getPenaltyN2=function(e){let t=e.size,r=0;for(let n=0;n<t-1;n++)for(let s=0;s<t-1;s++){let o=e.get(n,s)+e.get(n,s+1)+e.get(n+1,s)+e.get(n+1,s+1);(o===4||o===0)&&r++}return r*R.N2};f.getPenaltyN3=function(e){let t=e.size,r=0,n=0,s=0;for(let o=0;o<t;o++){n=s=0;for(let a=0;a<t;a++)n=n<<1&2047|e.get(o,a),a>=10&&(n===1488||n===93)&&r++,s=s<<1&2047|e.get(a,o),a>=10&&(s===1488||s===93)&&r++}return r*R.N3};f.getPenaltyN4=function(e){let t=0,r=e.data.length;for(let s=0;s<r;s++)t+=e.data[s];return Math.abs(Math.ceil(t*100/r/5)-10)*R.N4};function sr(i,e,t){switch(i){case f.Patterns.PATTERN000:return(e+t)%2===0;case f.Patterns.PATTERN001:return e%2===0;case f.Patterns.PATTERN010:return t%3===0;case f.Patterns.PATTERN011:return(e+t)%3===0;case f.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2===0;case f.Patterns.PATTERN101:return e*t%2+e*t%3===0;case f.Patterns.PATTERN110:return(e*t%2+e*t%3)%2===0;case f.Patterns.PATTERN111:return(e*t%3+(e+t)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}f.applyMask=function(e,t){let r=t.size;for(let n=0;n<r;n++)for(let s=0;s<r;s++)t.isReserved(s,n)||t.xor(s,n,sr(e,s,n))};f.getBestMask=function(e,t){let r=Object.keys(f.Patterns).length,n=0,s=1/0;for(let o=0;o<r;o++){t(o),f.applyMask(o,e);let a=f.getPenaltyN1(e)+f.getPenaltyN2(e)+f.getPenaltyN3(e)+f.getPenaltyN4(e);f.applyMask(o,e),a<s&&(s=a,n=o)}return n}});var yt=g(vt=>{var C=J(),Z=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],tt=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];vt.getBlocksCount=function(e,t){switch(t){case C.L:return Z[(e-1)*4+0];case C.M:return Z[(e-1)*4+1];case C.Q:return Z[(e-1)*4+2];case C.H:return Z[(e-1)*4+3];default:return}};vt.getTotalCodewordsCount=function(e,t){switch(t){case C.L:return tt[(e-1)*4+0];case C.M:return tt[(e-1)*4+1];case C.Q:return tt[(e-1)*4+2];case C.H:return tt[(e-1)*4+3];default:return}}});var ee=g(rt=>{var z=new Uint8Array(512),et=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)z[t]=e,et[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)z[t]=z[t-255]})();rt.log=function(e){if(e<1)throw new Error("log("+e+")");return et[e]};rt.exp=function(e){return z[e]};rt.mul=function(e,t){return e===0||t===0?0:z[et[e]+et[t]]}});var re=g(Q=>{var xt=ee();Q.mul=function(e,t){let r=new Uint8Array(e.length+t.length-1);for(let n=0;n<e.length;n++)for(let s=0;s<t.length;s++)r[n+s]^=xt.mul(e[n],t[s]);return r};Q.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){let n=r[0];for(let o=0;o<t.length;o++)r[o]^=xt.mul(t[o],n);let s=0;for(;s<r.length&&r[s]===0;)s++;r=r.slice(s)}return r};Q.generateECPolynomial=function(e){let t=new Uint8Array([1]);for(let r=0;r<e;r++)t=Q.mul(t,new Uint8Array([1,xt.exp(r)]));return t}});var se=g((hi,ne)=>{var ie=re();function _t(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}_t.prototype.initialize=function(e){this.degree=e,this.genPoly=ie.generateECPolynomial(this.degree)};_t.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let r=ie.mod(t,this.genPoly),n=this.degree-r.length;if(n>0){let s=new Uint8Array(this.degree);return s.set(r,n),s}return r};ne.exports=_t});var wt=g(oe=>{oe.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var Et=g(E=>{var ae="[0-9]+",or="[A-Z $%*+\\-./:]+",H="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";H=H.replace(/u/g,"\\u");var ar="(?:(?![A-Z0-9 $%*+\\-./:]|"+H+`)(?:.|[\r
|
|
3
3
|
]))+`;E.KANJI=new RegExp(H,"g");E.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");E.BYTE=new RegExp(ar,"g");E.NUMERIC=new RegExp(ae,"g");E.ALPHANUMERIC=new RegExp(or,"g");var lr=new RegExp("^"+H+"$"),dr=new RegExp("^"+ae+"$"),cr=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");E.testKanji=function(e){return lr.test(e)};E.testNumeric=function(e){return dr.test(e)};E.testAlphanumeric=function(e){return cr.test(e)}});var A=g(b=>{var ur=wt(),It=Et();b.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};b.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};b.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};b.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};b.MIXED={bit:-1};b.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!ur.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]};b.getBestModeForData=function(e){return It.testNumeric(e)?b.NUMERIC:It.testAlphanumeric(e)?b.ALPHANUMERIC:It.testKanji(e)?b.KANJI:b.BYTE};b.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};b.isValid=function(e){return e&&e.bit&&e.ccBits};function hr(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return b.NUMERIC;case"alphanumeric":return b.ALPHANUMERIC;case"kanji":return b.KANJI;case"byte":return b.BYTE;default:throw new Error("Unknown mode: "+i)}}b.from=function(e,t){if(b.isValid(e))return e;try{return hr(e)}catch{return t}}});var he=g(M=>{var it=S(),pr=yt(),le=J(),B=A(),kt=wt(),ce=7973,de=it.getBCHDigit(ce);function gr(i,e,t){for(let r=1;r<=40;r++)if(e<=M.getCapacity(r,t,i))return r}function ue(i,e){return B.getCharCountIndicator(i,e)+4}function fr(i,e){let t=0;return i.forEach(function(r){let n=ue(r.mode,e);t+=n+r.getBitsLength()}),t}function mr(i,e){for(let t=1;t<=40;t++)if(fr(i,t)<=M.getCapacity(t,e,B.MIXED))return t}M.from=function(e,t){return kt.isValid(e)?parseInt(e,10):t};M.getCapacity=function(e,t,r){if(!kt.isValid(e))throw new Error("Invalid QR Code version");typeof r>"u"&&(r=B.BYTE);let n=it.getSymbolTotalCodewords(e),s=pr.getTotalCodewordsCount(e,t),o=(n-s)*8;if(r===B.MIXED)return o;let a=o-ue(r,e);switch(r){case B.NUMERIC:return Math.floor(a/10*3);case B.ALPHANUMERIC:return Math.floor(a/11*2);case B.KANJI:return Math.floor(a/13);case B.BYTE:default:return Math.floor(a/8)}};M.getBestVersionForData=function(e,t){let r,n=le.from(t,le.M);if(Array.isArray(e)){if(e.length>1)return mr(e,n);if(e.length===0)return 1;r=e[0]}else r=e;return gr(r.mode,r.getLength(),n)};M.getEncodedBits=function(e){if(!kt.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;it.getBCHDigit(t)-de>=0;)t^=ce<<it.getBCHDigit(t)-de;return e<<12|t}});var me=g(fe=>{var St=S(),ge=1335,br=21522,pe=St.getBCHDigit(ge);fe.getEncodedBits=function(e,t){let r=e.bit<<3|t,n=r<<10;for(;St.getBCHDigit(n)-pe>=0;)n^=ge<<St.getBCHDigit(n)-pe;return(r<<10|n)^br}});var ve=g((vi,be)=>{var vr=A();function N(i){this.mode=vr.NUMERIC,this.data=i.toString()}N.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};N.prototype.getLength=function(){return this.data.length};N.prototype.getBitsLength=function(){return N.getBitsLength(this.data.length)};N.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);let s=this.data.length-t;s>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,s*3+1))};be.exports=N});var xe=g((yi,ye)=>{var yr=A(),Ct=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function D(i){this.mode=yr.ALPHANUMERIC,this.data=i}D.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};D.prototype.getLength=function(){return this.data.length};D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)};D.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=Ct.indexOf(this.data[t])*45;r+=Ct.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(Ct.indexOf(this.data[t]),6)};ye.exports=D});var we=g((xi,_e)=>{var xr=A();function U(i){this.mode=xr.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}U.getBitsLength=function(e){return e*8};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(i){for(let e=0,t=this.data.length;e<t;e++)i.put(this.data[e],8)};_e.exports=U});var Ie=g((_i,Ee)=>{var _r=A(),wr=S();function L(i){this.mode=_r.KANJI,this.data=i}L.getBitsLength=function(e){return e*13};L.prototype.getLength=function(){return this.data.length};L.prototype.getBitsLength=function(){return L.getBitsLength(this.data.length)};L.prototype.write=function(i){let e;for(e=0;e<this.data.length;e++){let t=wr.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
4
4
|
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),i.put(t,13)}};Ee.exports=L});var ke=g((wi,At)=>{"use strict";var O={single_source_shortest_paths:function(i,e,t){var r={},n={};n[e]=0;var s=O.PriorityQueue.make();s.push(e,0);for(var o,a,l,d,c,m,u,y,I;!s.empty();){o=s.pop(),a=o.value,d=o.cost,c=i[a]||{};for(l in c)c.hasOwnProperty(l)&&(m=c[l],u=d+m,y=n[l],I=typeof n[l]>"u",(I||y>u)&&(n[l]=u,s.push(l,u),r[l]=a))}if(typeof t<"u"&&typeof n[t]>"u"){var k=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(k)}return r},extract_shortest_path_from_predecessor_list:function(i,e){for(var t=[],r=e,n;r;)t.push(r),n=i[r],r=i[r];return t.reverse(),t},find_path:function(i,e,t){var r=O.single_source_shortest_paths(i,e,t);return O.extract_shortest_path_from_predecessor_list(r,t)},PriorityQueue:{make:function(i){var e=O.PriorityQueue,t={},r;i=i||{};for(r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t.queue=[],t.sorter=i.sorter||e.default_sorter,t},default_sorter:function(i,e){return i.cost-e.cost},push:function(i,e){var t={value:i,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof At<"u"&&(At.exports=O)});var Pe=g(F=>{var h=A(),Ae=ve(),Be=xe(),Te=we(),Re=Ie(),j=Et(),nt=S(),Er=ke();function Se(i){return unescape(encodeURIComponent(i)).length}function K(i,e,t){let r=[],n;for(;(n=i.exec(t))!==null;)r.push({data:n[0],index:n.index,mode:e,length:n[0].length});return r}function Me(i){let e=K(j.NUMERIC,h.NUMERIC,i),t=K(j.ALPHANUMERIC,h.ALPHANUMERIC,i),r,n;return nt.isKanjiModeEnabled()?(r=K(j.BYTE,h.BYTE,i),n=K(j.KANJI,h.KANJI,i)):(r=K(j.BYTE_KANJI,h.BYTE,i),n=[]),e.concat(t,r,n).sort(function(o,a){return o.index-a.index}).map(function(o){return{data:o.data,mode:o.mode,length:o.length}})}function Bt(i,e){switch(e){case h.NUMERIC:return Ae.getBitsLength(i);case h.ALPHANUMERIC:return Be.getBitsLength(i);case h.KANJI:return Re.getBitsLength(i);case h.BYTE:return Te.getBitsLength(i)}}function Ir(i){return i.reduce(function(e,t){let r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function kr(i){let e=[];for(let t=0;t<i.length;t++){let r=i[t];switch(r.mode){case h.NUMERIC:e.push([r,{data:r.data,mode:h.ALPHANUMERIC,length:r.length},{data:r.data,mode:h.BYTE,length:r.length}]);break;case h.ALPHANUMERIC:e.push([r,{data:r.data,mode:h.BYTE,length:r.length}]);break;case h.KANJI:e.push([r,{data:r.data,mode:h.BYTE,length:Se(r.data)}]);break;case h.BYTE:e.push([{data:r.data,mode:h.BYTE,length:Se(r.data)}])}}return e}function Sr(i,e){let t={},r={start:{}},n=["start"];for(let s=0;s<i.length;s++){let o=i[s],a=[];for(let l=0;l<o.length;l++){let d=o[l],c=""+s+l;a.push(c),t[c]={node:d,lastCount:0},r[c]={};for(let m=0;m<n.length;m++){let u=n[m];t[u]&&t[u].node.mode===d.mode?(r[u][c]=Bt(t[u].lastCount+d.length,d.mode)-Bt(t[u].lastCount,d.mode),t[u].lastCount+=d.length):(t[u]&&(t[u].lastCount=d.length),r[u][c]=Bt(d.length,d.mode)+4+h.getCharCountIndicator(d.mode,e))}}n=a}for(let s=0;s<n.length;s++)r[n[s]].end=0;return{map:r,table:t}}function Ce(i,e){let t,r=h.getBestModeForData(i);if(t=h.from(e,r),t!==h.BYTE&&t.bit<r.bit)throw new Error('"'+i+'" cannot be encoded with mode '+h.toString(t)+`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @qrauth/web-components v0.4.
|
|
1
|
+
/* @qrauth/web-components v0.4.3 — https://qrauth.io */
|
|
2
2
|
"use strict";var QRAuthComponents=(()=>{var Ye=Object.create;var V=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var Ze=(i,e,t)=>e in i?V(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var g=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),tr=(i,e)=>{for(var t in e)V(i,t,{get:e[t],enumerable:!0})},zt=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Xe(e))!We.call(i,n)&&n!==t&&V(i,n,{get:()=>e[n],enumerable:!(r=Ge(e,n))||r.enumerable});return i};var er=(i,e,t)=>(t=i!=null?Ye(Je(i)):{},zt(e||!i||!i.__esModule?V(t,"default",{value:i,enumerable:!0}):t,i)),rr=i=>zt(V({},"__esModule",{value:!0}),i);var p=(i,e,t)=>Ze(i,typeof e!="symbol"?e+"":e,t);var Ot=g((ni,Ht)=>{Ht.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var S=g(T=>{var bt,ir=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];T.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};T.getSymbolTotalCodewords=function(e){return ir[e]};T.getBCHDigit=function(i){let e=0;for(;i!==0;)e++,i>>>=1;return e};T.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');bt=e};T.isKanjiModeEnabled=function(){return typeof bt<"u"};T.toSJIS=function(e){return bt(e)}});var et=g(v=>{v.L={bit:1};v.M={bit:0};v.Q={bit:3};v.H={bit:2};function nr(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return v.L;case"m":case"medium":return v.M;case"q":case"quartile":return v.Q;case"h":case"high":return v.H;default:throw new Error("Unknown EC Level: "+i)}}v.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};v.from=function(e,t){if(v.isValid(e))return e;try{return nr(e)}catch{return t}}});var Yt=g((ai,Kt)=>{function jt(){this.buffer=[],this.length=0}jt.prototype={get:function(i){let e=Math.floor(i/8);return(this.buffer[e]>>>7-i%8&1)===1},put:function(i,e){for(let t=0;t<e;t++)this.putBit((i>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),i&&(this.buffer[e]|=128>>>this.length%8),this.length++}};Kt.exports=jt});var Xt=g((li,Gt)=>{function z(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}z.prototype.set=function(i,e,t,r){let n=i*this.size+e;this.data[n]=t,r&&(this.reservedBit[n]=!0)};z.prototype.get=function(i,e){return this.data[i*this.size+e]};z.prototype.xor=function(i,e,t){this.data[i*this.size+e]^=t};z.prototype.isReserved=function(i,e){return this.reservedBit[i*this.size+e]};Gt.exports=z});var Jt=g(rt=>{var sr=S().getSymbolSize;rt.getRowColCoords=function(e){if(e===1)return[];let t=Math.floor(e/7)+2,r=sr(e),n=r===145?26:Math.ceil((r-13)/(2*t-2))*2,s=[r-7];for(let o=1;o<t-1;o++)s[o]=s[o-1]-n;return s.push(6),s.reverse()};rt.getPositions=function(e){let t=[],r=rt.getRowColCoords(e),n=r.length;for(let s=0;s<n;s++)for(let o=0;o<n;o++)s===0&&o===0||s===0&&o===n-1||s===n-1&&o===0||t.push([r[s],r[o]]);return t}});var te=g(Zt=>{var or=S().getSymbolSize,Wt=7;Zt.getPositions=function(e){let t=or(e);return[[0,0],[t-Wt,0],[0,t-Wt]]}});var ee=g(f=>{f.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var R={N1:3,N2:3,N3:40,N4:10};f.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};f.from=function(e){return f.isValid(e)?parseInt(e,10):void 0};f.getPenaltyN1=function(e){let t=e.size,r=0,n=0,s=0,o=null,a=null;for(let l=0;l<t;l++){n=s=0,o=a=null;for(let d=0;d<t;d++){let c=e.get(l,d);c===o?n++:(n>=5&&(r+=R.N1+(n-5)),o=c,n=1),c=e.get(d,l),c===a?s++:(s>=5&&(r+=R.N1+(s-5)),a=c,s=1)}n>=5&&(r+=R.N1+(n-5)),s>=5&&(r+=R.N1+(s-5))}return r};f.getPenaltyN2=function(e){let t=e.size,r=0;for(let n=0;n<t-1;n++)for(let s=0;s<t-1;s++){let o=e.get(n,s)+e.get(n,s+1)+e.get(n+1,s)+e.get(n+1,s+1);(o===4||o===0)&&r++}return r*R.N2};f.getPenaltyN3=function(e){let t=e.size,r=0,n=0,s=0;for(let o=0;o<t;o++){n=s=0;for(let a=0;a<t;a++)n=n<<1&2047|e.get(o,a),a>=10&&(n===1488||n===93)&&r++,s=s<<1&2047|e.get(a,o),a>=10&&(s===1488||s===93)&&r++}return r*R.N3};f.getPenaltyN4=function(e){let t=0,r=e.data.length;for(let s=0;s<r;s++)t+=e.data[s];return Math.abs(Math.ceil(t*100/r/5)-10)*R.N4};function ar(i,e,t){switch(i){case f.Patterns.PATTERN000:return(e+t)%2===0;case f.Patterns.PATTERN001:return e%2===0;case f.Patterns.PATTERN010:return t%3===0;case f.Patterns.PATTERN011:return(e+t)%3===0;case f.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2===0;case f.Patterns.PATTERN101:return e*t%2+e*t%3===0;case f.Patterns.PATTERN110:return(e*t%2+e*t%3)%2===0;case f.Patterns.PATTERN111:return(e*t%3+(e+t)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}f.applyMask=function(e,t){let r=t.size;for(let n=0;n<r;n++)for(let s=0;s<r;s++)t.isReserved(s,n)||t.xor(s,n,ar(e,s,n))};f.getBestMask=function(e,t){let r=Object.keys(f.Patterns).length,n=0,s=1/0;for(let o=0;o<r;o++){t(o),f.applyMask(o,e);let a=f.getPenaltyN1(e)+f.getPenaltyN2(e)+f.getPenaltyN3(e)+f.getPenaltyN4(e);f.applyMask(o,e),a<s&&(s=a,n=o)}return n}});var yt=g(vt=>{var C=et(),it=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],nt=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];vt.getBlocksCount=function(e,t){switch(t){case C.L:return it[(e-1)*4+0];case C.M:return it[(e-1)*4+1];case C.Q:return it[(e-1)*4+2];case C.H:return it[(e-1)*4+3];default:return}};vt.getTotalCodewordsCount=function(e,t){switch(t){case C.L:return nt[(e-1)*4+0];case C.M:return nt[(e-1)*4+1];case C.Q:return nt[(e-1)*4+2];case C.H:return nt[(e-1)*4+3];default:return}}});var re=g(ot=>{var Q=new Uint8Array(512),st=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)Q[t]=e,st[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)Q[t]=Q[t-255]})();ot.log=function(e){if(e<1)throw new Error("log("+e+")");return st[e]};ot.exp=function(e){return Q[e]};ot.mul=function(e,t){return e===0||t===0?0:Q[st[e]+st[t]]}});var ie=g(H=>{var xt=re();H.mul=function(e,t){let r=new Uint8Array(e.length+t.length-1);for(let n=0;n<e.length;n++)for(let s=0;s<t.length;s++)r[n+s]^=xt.mul(e[n],t[s]);return r};H.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){let n=r[0];for(let o=0;o<t.length;o++)r[o]^=xt.mul(t[o],n);let s=0;for(;s<r.length&&r[s]===0;)s++;r=r.slice(s)}return r};H.generateECPolynomial=function(e){let t=new Uint8Array([1]);for(let r=0;r<e;r++)t=H.mul(t,new Uint8Array([1,xt.exp(r)]));return t}});var oe=g((fi,se)=>{var ne=ie();function _t(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}_t.prototype.initialize=function(e){this.degree=e,this.genPoly=ne.generateECPolynomial(this.degree)};_t.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let r=ne.mod(t,this.genPoly),n=this.degree-r.length;if(n>0){let s=new Uint8Array(this.degree);return s.set(r,n),s}return r};se.exports=_t});var wt=g(ae=>{ae.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var Et=g(E=>{var le="[0-9]+",lr="[A-Z $%*+\\-./:]+",O="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";O=O.replace(/u/g,"\\u");var dr="(?:(?![A-Z0-9 $%*+\\-./:]|"+O+`)(?:.|[\r
|
|
3
3
|
]))+`;E.KANJI=new RegExp(O,"g");E.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");E.BYTE=new RegExp(dr,"g");E.NUMERIC=new RegExp(le,"g");E.ALPHANUMERIC=new RegExp(lr,"g");var cr=new RegExp("^"+O+"$"),ur=new RegExp("^"+le+"$"),hr=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");E.testKanji=function(e){return cr.test(e)};E.testNumeric=function(e){return ur.test(e)};E.testAlphanumeric=function(e){return hr.test(e)}});var A=g(b=>{var pr=wt(),It=Et();b.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};b.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};b.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};b.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};b.MIXED={bit:-1};b.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!pr.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]};b.getBestModeForData=function(e){return It.testNumeric(e)?b.NUMERIC:It.testAlphanumeric(e)?b.ALPHANUMERIC:It.testKanji(e)?b.KANJI:b.BYTE};b.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};b.isValid=function(e){return e&&e.bit&&e.ccBits};function gr(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return b.NUMERIC;case"alphanumeric":return b.ALPHANUMERIC;case"kanji":return b.KANJI;case"byte":return b.BYTE;default:throw new Error("Unknown mode: "+i)}}b.from=function(e,t){if(b.isValid(e))return e;try{return gr(e)}catch{return t}}});var pe=g(M=>{var at=S(),fr=yt(),de=et(),B=A(),kt=wt(),ue=7973,ce=at.getBCHDigit(ue);function mr(i,e,t){for(let r=1;r<=40;r++)if(e<=M.getCapacity(r,t,i))return r}function he(i,e){return B.getCharCountIndicator(i,e)+4}function br(i,e){let t=0;return i.forEach(function(r){let n=he(r.mode,e);t+=n+r.getBitsLength()}),t}function vr(i,e){for(let t=1;t<=40;t++)if(br(i,t)<=M.getCapacity(t,e,B.MIXED))return t}M.from=function(e,t){return kt.isValid(e)?parseInt(e,10):t};M.getCapacity=function(e,t,r){if(!kt.isValid(e))throw new Error("Invalid QR Code version");typeof r>"u"&&(r=B.BYTE);let n=at.getSymbolTotalCodewords(e),s=fr.getTotalCodewordsCount(e,t),o=(n-s)*8;if(r===B.MIXED)return o;let a=o-he(r,e);switch(r){case B.NUMERIC:return Math.floor(a/10*3);case B.ALPHANUMERIC:return Math.floor(a/11*2);case B.KANJI:return Math.floor(a/13);case B.BYTE:default:return Math.floor(a/8)}};M.getBestVersionForData=function(e,t){let r,n=de.from(t,de.M);if(Array.isArray(e)){if(e.length>1)return vr(e,n);if(e.length===0)return 1;r=e[0]}else r=e;return mr(r.mode,r.getLength(),n)};M.getEncodedBits=function(e){if(!kt.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;at.getBCHDigit(t)-ce>=0;)t^=ue<<at.getBCHDigit(t)-ce;return e<<12|t}});var be=g(me=>{var St=S(),fe=1335,yr=21522,ge=St.getBCHDigit(fe);me.getEncodedBits=function(e,t){let r=e.bit<<3|t,n=r<<10;for(;St.getBCHDigit(n)-ge>=0;)n^=fe<<St.getBCHDigit(n)-ge;return(r<<10|n)^yr}});var ye=g((_i,ve)=>{var xr=A();function N(i){this.mode=xr.NUMERIC,this.data=i.toString()}N.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};N.prototype.getLength=function(){return this.data.length};N.prototype.getBitsLength=function(){return N.getBitsLength(this.data.length)};N.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);let s=this.data.length-t;s>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,s*3+1))};ve.exports=N});var _e=g((wi,xe)=>{var _r=A(),Ct=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function D(i){this.mode=_r.ALPHANUMERIC,this.data=i}D.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};D.prototype.getLength=function(){return this.data.length};D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)};D.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=Ct.indexOf(this.data[t])*45;r+=Ct.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(Ct.indexOf(this.data[t]),6)};xe.exports=D});var Ee=g((Ei,we)=>{var wr=A();function U(i){this.mode=wr.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}U.getBitsLength=function(e){return e*8};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(i){for(let e=0,t=this.data.length;e<t;e++)i.put(this.data[e],8)};we.exports=U});var ke=g((Ii,Ie)=>{var Er=A(),Ir=S();function L(i){this.mode=Er.KANJI,this.data=i}L.getBitsLength=function(e){return e*13};L.prototype.getLength=function(){return this.data.length};L.prototype.getBitsLength=function(){return L.getBitsLength(this.data.length)};L.prototype.write=function(i){let e;for(e=0;e<this.data.length;e++){let t=Ir.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
4
4
|
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),i.put(t,13)}};Ie.exports=L});var Se=g((ki,At)=>{"use strict";var j={single_source_shortest_paths:function(i,e,t){var r={},n={};n[e]=0;var s=j.PriorityQueue.make();s.push(e,0);for(var o,a,l,d,c,m,u,y,I;!s.empty();){o=s.pop(),a=o.value,d=o.cost,c=i[a]||{};for(l in c)c.hasOwnProperty(l)&&(m=c[l],u=d+m,y=n[l],I=typeof n[l]>"u",(I||y>u)&&(n[l]=u,s.push(l,u),r[l]=a))}if(typeof t<"u"&&typeof n[t]>"u"){var k=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(k)}return r},extract_shortest_path_from_predecessor_list:function(i,e){for(var t=[],r=e,n;r;)t.push(r),n=i[r],r=i[r];return t.reverse(),t},find_path:function(i,e,t){var r=j.single_source_shortest_paths(i,e,t);return j.extract_shortest_path_from_predecessor_list(r,t)},PriorityQueue:{make:function(i){var e=j.PriorityQueue,t={},r;i=i||{};for(r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t.queue=[],t.sorter=i.sorter||e.default_sorter,t},default_sorter:function(i,e){return i.cost-e.cost},push:function(i,e){var t={value:i,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof At<"u"&&(At.exports=j)});var qe=g(F=>{var h=A(),Be=ye(),Te=_e(),Re=Ee(),Me=ke(),K=Et(),lt=S(),kr=Se();function Ce(i){return unescape(encodeURIComponent(i)).length}function Y(i,e,t){let r=[],n;for(;(n=i.exec(t))!==null;)r.push({data:n[0],index:n.index,mode:e,length:n[0].length});return r}function Pe(i){let e=Y(K.NUMERIC,h.NUMERIC,i),t=Y(K.ALPHANUMERIC,h.ALPHANUMERIC,i),r,n;return lt.isKanjiModeEnabled()?(r=Y(K.BYTE,h.BYTE,i),n=Y(K.KANJI,h.KANJI,i)):(r=Y(K.BYTE_KANJI,h.BYTE,i),n=[]),e.concat(t,r,n).sort(function(o,a){return o.index-a.index}).map(function(o){return{data:o.data,mode:o.mode,length:o.length}})}function Bt(i,e){switch(e){case h.NUMERIC:return Be.getBitsLength(i);case h.ALPHANUMERIC:return Te.getBitsLength(i);case h.KANJI:return Me.getBitsLength(i);case h.BYTE:return Re.getBitsLength(i)}}function Sr(i){return i.reduce(function(e,t){let r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function Cr(i){let e=[];for(let t=0;t<i.length;t++){let r=i[t];switch(r.mode){case h.NUMERIC:e.push([r,{data:r.data,mode:h.ALPHANUMERIC,length:r.length},{data:r.data,mode:h.BYTE,length:r.length}]);break;case h.ALPHANUMERIC:e.push([r,{data:r.data,mode:h.BYTE,length:r.length}]);break;case h.KANJI:e.push([r,{data:r.data,mode:h.BYTE,length:Ce(r.data)}]);break;case h.BYTE:e.push([{data:r.data,mode:h.BYTE,length:Ce(r.data)}])}}return e}function Ar(i,e){let t={},r={start:{}},n=["start"];for(let s=0;s<i.length;s++){let o=i[s],a=[];for(let l=0;l<o.length;l++){let d=o[l],c=""+s+l;a.push(c),t[c]={node:d,lastCount:0},r[c]={};for(let m=0;m<n.length;m++){let u=n[m];t[u]&&t[u].node.mode===d.mode?(r[u][c]=Bt(t[u].lastCount+d.length,d.mode)-Bt(t[u].lastCount,d.mode),t[u].lastCount+=d.length):(t[u]&&(t[u].lastCount=d.length),r[u][c]=Bt(d.length,d.mode)+4+h.getCharCountIndicator(d.mode,e))}}n=a}for(let s=0;s<n.length;s++)r[n[s]].end=0;return{map:r,table:t}}function Ae(i,e){let t,r=h.getBestModeForData(i);if(t=h.from(e,r),t!==h.BYTE&&t.bit<r.bit)throw new Error('"'+i+'" cannot be encoded with mode '+h.toString(t)+`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qrauth/web-components",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "QRAuth Web Components — drop-in authentication elements",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/qrauth-components.js",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/qrcode": "^1.5.5",
|
|
57
|
-
"esbuild": "0.28.
|
|
57
|
+
"esbuild": "0.28.2",
|
|
58
58
|
"happy-dom": "^20.10.2",
|
|
59
59
|
"typescript": "5.9.3",
|
|
60
|
-
"vitest": "^
|
|
60
|
+
"vitest": "^4.1.12"
|
|
61
61
|
}
|
|
62
62
|
}
|