@naculus/connect-appkit-ui 0.14.0 → 0.15.0

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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ra=Object.create;var Tt=Object.defineProperty;var aa=Object.getOwnPropertyDescriptor;var sa=Object.getOwnPropertyNames;var ia=Object.getPrototypeOf,la=Object.prototype.hasOwnProperty;var W=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ca=(t,e)=>{for(var n in e)Tt(t,n,{get:e[n],enumerable:!0})},Qn=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of sa(e))!la.call(t,r)&&r!==n&&Tt(t,r,{get:()=>e[r],enumerable:!(o=aa(e,r))||o.enumerable});return t};var tn=(t,e,n)=>(n=t!=null?ra(ia(t)):{},Qn(e||!t||!t.__esModule?Tt(n,"default",{value:t,enumerable:!0}):n,t)),da=t=>Qn(Tt({},"__esModule",{value:!0}),t);var lo=W((mi,io)=>{"use strict";io.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Ae=W(Ue=>{"use strict";var an,ya=[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];Ue.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};Ue.getSymbolTotalCodewords=function(e){return ya[e]};Ue.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Ue.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');an=e};Ue.isKanjiModeEnabled=function(){return typeof an<"u"};Ue.toSJIS=function(e){return an(e)}});var zt=W(pe=>{"use strict";pe.L={bit:1};pe.M={bit:0};pe.Q={bit:3};pe.H={bit:2};function va(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return pe.L;case"m":case"medium":return pe.M;case"q":case"quartile":return pe.Q;case"h":case"high":return pe.H;default:throw new Error("Unknown EC Level: "+t)}}pe.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};pe.from=function(e,n){if(pe.isValid(e))return e;try{return va(e)}catch{return n}}});var mo=W((gi,uo)=>{"use strict";function co(){this.buffer=[],this.length=0}co.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};uo.exports=co});var fo=W((hi,po)=>{"use strict";function ht(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}ht.prototype.set=function(t,e,n,o){let r=t*this.size+e;this.data[r]=n,o&&(this.reservedBit[r]=!0)};ht.prototype.get=function(t,e){return this.data[t*this.size+e]};ht.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};ht.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};po.exports=ht});var go=W(Mt=>{"use strict";var Ca=Ae().getSymbolSize;Mt.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,o=Ca(e),r=o===145?26:Math.ceil((o-13)/(2*n-2))*2,a=[o-7];for(let i=1;i<n-1;i++)a[i]=a[i-1]-r;return a.push(6),a.reverse()};Mt.getPositions=function(e){let n=[],o=Mt.getRowColCoords(e),r=o.length;for(let a=0;a<r;a++)for(let i=0;i<r;i++)a===0&&i===0||a===0&&i===r-1||a===r-1&&i===0||n.push([o[a],o[i]]);return n}});var xo=W(bo=>{"use strict";var Na=Ae().getSymbolSize,ho=7;bo.getPositions=function(e){let n=Na(e);return[[0,0],[n-ho,0],[0,n-ho]]}});var yo=W(H=>{"use strict";H.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var He={N1:3,N2:3,N3:40,N4:10};H.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};H.from=function(e){return H.isValid(e)?parseInt(e,10):void 0};H.getPenaltyN1=function(e){let n=e.size,o=0,r=0,a=0,i=null,s=null;for(let l=0;l<n;l++){r=a=0,i=s=null;for(let c=0;c<n;c++){let u=e.get(l,c);u===i?r++:(r>=5&&(o+=He.N1+(r-5)),i=u,r=1),u=e.get(c,l),u===s?a++:(a>=5&&(o+=He.N1+(a-5)),s=u,a=1)}r>=5&&(o+=He.N1+(r-5)),a>=5&&(o+=He.N1+(a-5))}return o};H.getPenaltyN2=function(e){let n=e.size,o=0;for(let r=0;r<n-1;r++)for(let a=0;a<n-1;a++){let i=e.get(r,a)+e.get(r,a+1)+e.get(r+1,a)+e.get(r+1,a+1);(i===4||i===0)&&o++}return o*He.N2};H.getPenaltyN3=function(e){let n=e.size,o=0,r=0,a=0;for(let i=0;i<n;i++){r=a=0;for(let s=0;s<n;s++)r=r<<1&2047|e.get(i,s),s>=10&&(r===1488||r===93)&&o++,a=a<<1&2047|e.get(s,i),s>=10&&(a===1488||a===93)&&o++}return o*He.N3};H.getPenaltyN4=function(e){let n=0,o=e.data.length;for(let a=0;a<o;a++)n+=e.data[a];return Math.abs(Math.ceil(n*100/o/5)-10)*He.N4};function wa(t,e,n){switch(t){case H.Patterns.PATTERN000:return(e+n)%2===0;case H.Patterns.PATTERN001:return e%2===0;case H.Patterns.PATTERN010:return n%3===0;case H.Patterns.PATTERN011:return(e+n)%3===0;case H.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2===0;case H.Patterns.PATTERN101:return e*n%2+e*n%3===0;case H.Patterns.PATTERN110:return(e*n%2+e*n%3)%2===0;case H.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}H.applyMask=function(e,n){let o=n.size;for(let r=0;r<o;r++)for(let a=0;a<o;a++)n.isReserved(a,r)||n.xor(a,r,wa(e,a,r))};H.getBestMask=function(e,n){let o=Object.keys(H.Patterns).length,r=0,a=1/0;for(let i=0;i<o;i++){n(i),H.applyMask(i,e);let s=H.getPenaltyN1(e)+H.getPenaltyN2(e)+H.getPenaltyN3(e)+H.getPenaltyN4(e);H.applyMask(i,e),s<a&&(a=s,r=i)}return r}});var ln=W(sn=>{"use strict";var Ee=zt(),Lt=[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],It=[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];sn.getBlocksCount=function(e,n){switch(n){case Ee.L:return Lt[(e-1)*4+0];case Ee.M:return Lt[(e-1)*4+1];case Ee.Q:return Lt[(e-1)*4+2];case Ee.H:return Lt[(e-1)*4+3];default:return}};sn.getTotalCodewordsCount=function(e,n){switch(n){case Ee.L:return It[(e-1)*4+0];case Ee.M:return It[(e-1)*4+1];case Ee.Q:return It[(e-1)*4+2];case Ee.H:return It[(e-1)*4+3];default:return}}});var vo=W(Vt=>{"use strict";var bt=new Uint8Array(512),Wt=new Uint8Array(256);(function(){let e=1;for(let n=0;n<255;n++)bt[n]=e,Wt[e]=n,e<<=1,e&256&&(e^=285);for(let n=255;n<512;n++)bt[n]=bt[n-255]})();Vt.log=function(e){if(e<1)throw new Error("log("+e+")");return Wt[e]};Vt.exp=function(e){return bt[e]};Vt.mul=function(e,n){return e===0||n===0?0:bt[Wt[e]+Wt[n]]}});var Co=W(xt=>{"use strict";var cn=vo();xt.mul=function(e,n){let o=new Uint8Array(e.length+n.length-1);for(let r=0;r<e.length;r++)for(let a=0;a<n.length;a++)o[r+a]^=cn.mul(e[r],n[a]);return o};xt.mod=function(e,n){let o=new Uint8Array(e);for(;o.length-n.length>=0;){let r=o[0];for(let i=0;i<n.length;i++)o[i]^=cn.mul(n[i],r);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o};xt.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let o=0;o<e;o++)n=xt.mul(n,new Uint8Array([1,cn.exp(o)]));return n}});var ko=W((wi,wo)=>{"use strict";var No=Co();function dn(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}dn.prototype.initialize=function(e){this.degree=e,this.genPoly=No.generateECPolynomial(this.degree)};dn.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let n=new Uint8Array(e.length+this.degree);n.set(e);let o=No.mod(n,this.genPoly),r=this.degree-o.length;if(r>0){let a=new Uint8Array(this.degree);return a.set(o,r),a}return o};wo.exports=dn});var un=W(Ro=>{"use strict";Ro.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var mn=W(Se=>{"use strict";var So="[0-9]+",ka="[A-Z $%*+\\-./:]+",yt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";yt=yt.replace(/u/g,"\\u");var Ra="(?:(?![A-Z0-9 $%*+\\-./:]|"+yt+`)(?:.|[\r
1
+ "use strict";var ra=Object.create;var Tt=Object.defineProperty;var aa=Object.getOwnPropertyDescriptor;var sa=Object.getOwnPropertyNames;var ia=Object.getPrototypeOf,la=Object.prototype.hasOwnProperty;var W=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},ca=(t,e)=>{for(var n in e)Tt(t,n,{get:e[n],enumerable:!0})},Qn=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of sa(e))!la.call(t,r)&&r!==n&&Tt(t,r,{get:()=>e[r],enumerable:!(o=aa(e,r))||o.enumerable});return t};var tn=(t,e,n)=>(n=t!=null?ra(ia(t)):{},Qn(e||!t||!t.__esModule?Tt(n,"default",{value:t,enumerable:!0}):n,t)),da=t=>Qn(Tt({},"__esModule",{value:!0}),t);var lo=W((mi,io)=>{"use strict";io.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Ae=W(Ue=>{"use strict";var an,ya=[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];Ue.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};Ue.getSymbolTotalCodewords=function(e){return ya[e]};Ue.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Ue.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');an=e};Ue.isKanjiModeEnabled=function(){return typeof an<"u"};Ue.toSJIS=function(e){return an(e)}});var zt=W(pe=>{"use strict";pe.L={bit:1};pe.M={bit:0};pe.Q={bit:3};pe.H={bit:2};function va(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return pe.L;case"m":case"medium":return pe.M;case"q":case"quartile":return pe.Q;case"h":case"high":return pe.H;default:throw new Error("Unknown EC Level: "+t)}}pe.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};pe.from=function(e,n){if(pe.isValid(e))return e;try{return va(e)}catch{return n}}});var mo=W((gi,uo)=>{"use strict";function co(){this.buffer=[],this.length=0}co.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};uo.exports=co});var fo=W((hi,po)=>{"use strict";function ht(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}ht.prototype.set=function(t,e,n,o){let r=t*this.size+e;this.data[r]=n,o&&(this.reservedBit[r]=!0)};ht.prototype.get=function(t,e){return this.data[t*this.size+e]};ht.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};ht.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};po.exports=ht});var go=W(Mt=>{"use strict";var Ca=Ae().getSymbolSize;Mt.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,o=Ca(e),r=o===145?26:Math.ceil((o-13)/(2*n-2))*2,a=[o-7];for(let i=1;i<n-1;i++)a[i]=a[i-1]-r;return a.push(6),a.reverse()};Mt.getPositions=function(e){let n=[],o=Mt.getRowColCoords(e),r=o.length;for(let a=0;a<r;a++)for(let i=0;i<r;i++)a===0&&i===0||a===0&&i===r-1||a===r-1&&i===0||n.push([o[a],o[i]]);return n}});var xo=W(bo=>{"use strict";var Na=Ae().getSymbolSize,ho=7;bo.getPositions=function(e){let n=Na(e);return[[0,0],[n-ho,0],[0,n-ho]]}});var yo=W(H=>{"use strict";H.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var He={N1:3,N2:3,N3:40,N4:10};H.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};H.from=function(e){return H.isValid(e)?parseInt(e,10):void 0};H.getPenaltyN1=function(e){let n=e.size,o=0,r=0,a=0,i=null,s=null;for(let l=0;l<n;l++){r=a=0,i=s=null;for(let c=0;c<n;c++){let u=e.get(l,c);u===i?r++:(r>=5&&(o+=He.N1+(r-5)),i=u,r=1),u=e.get(c,l),u===s?a++:(a>=5&&(o+=He.N1+(a-5)),s=u,a=1)}r>=5&&(o+=He.N1+(r-5)),a>=5&&(o+=He.N1+(a-5))}return o};H.getPenaltyN2=function(e){let n=e.size,o=0;for(let r=0;r<n-1;r++)for(let a=0;a<n-1;a++){let i=e.get(r,a)+e.get(r,a+1)+e.get(r+1,a)+e.get(r+1,a+1);(i===4||i===0)&&o++}return o*He.N2};H.getPenaltyN3=function(e){let n=e.size,o=0,r=0,a=0;for(let i=0;i<n;i++){r=a=0;for(let s=0;s<n;s++)r=r<<1&2047|e.get(i,s),s>=10&&(r===1488||r===93)&&o++,a=a<<1&2047|e.get(s,i),s>=10&&(a===1488||a===93)&&o++}return o*He.N3};H.getPenaltyN4=function(e){let n=0,o=e.data.length;for(let a=0;a<o;a++)n+=e.data[a];return Math.abs(Math.ceil(n*100/o/5)-10)*He.N4};function wa(t,e,n){switch(t){case H.Patterns.PATTERN000:return(e+n)%2===0;case H.Patterns.PATTERN001:return e%2===0;case H.Patterns.PATTERN010:return n%3===0;case H.Patterns.PATTERN011:return(e+n)%3===0;case H.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2===0;case H.Patterns.PATTERN101:return e*n%2+e*n%3===0;case H.Patterns.PATTERN110:return(e*n%2+e*n%3)%2===0;case H.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}H.applyMask=function(e,n){let o=n.size;for(let r=0;r<o;r++)for(let a=0;a<o;a++)n.isReserved(a,r)||n.xor(a,r,wa(e,a,r))};H.getBestMask=function(e,n){let o=Object.keys(H.Patterns).length,r=0,a=1/0;for(let i=0;i<o;i++){n(i),H.applyMask(i,e);let s=H.getPenaltyN1(e)+H.getPenaltyN2(e)+H.getPenaltyN3(e)+H.getPenaltyN4(e);H.applyMask(i,e),s<a&&(a=s,r=i)}return r}});var ln=W(sn=>{"use strict";var Ee=zt(),Lt=[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],It=[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];sn.getBlocksCount=function(e,n){switch(n){case Ee.L:return Lt[(e-1)*4+0];case Ee.M:return Lt[(e-1)*4+1];case Ee.Q:return Lt[(e-1)*4+2];case Ee.H:return Lt[(e-1)*4+3];default:return}};sn.getTotalCodewordsCount=function(e,n){switch(n){case Ee.L:return It[(e-1)*4+0];case Ee.M:return It[(e-1)*4+1];case Ee.Q:return It[(e-1)*4+2];case Ee.H:return It[(e-1)*4+3];default:return}}});var vo=W(Vt=>{"use strict";var bt=new Uint8Array(512),Wt=new Uint8Array(256);(function(){let e=1;for(let n=0;n<255;n++)bt[n]=e,Wt[e]=n,e<<=1,e&256&&(e^=285);for(let n=255;n<512;n++)bt[n]=bt[n-255]})();Vt.log=function(e){if(e<1)throw new Error("log("+e+")");return Wt[e]};Vt.exp=function(e){return bt[e]};Vt.mul=function(e,n){return e===0||n===0?0:bt[Wt[e]+Wt[n]]}});var Co=W(xt=>{"use strict";var cn=vo();xt.mul=function(e,n){let o=new Uint8Array(e.length+n.length-1);for(let r=0;r<e.length;r++)for(let a=0;a<n.length;a++)o[r+a]^=cn.mul(e[r],n[a]);return o};xt.mod=function(e,n){let o=new Uint8Array(e);for(;o.length-n.length>=0;){let r=o[0];for(let i=0;i<n.length;i++)o[i]^=cn.mul(n[i],r);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o};xt.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let o=0;o<e;o++)n=xt.mul(n,new Uint8Array([1,cn.exp(o)]));return n}});var ko=W((wi,wo)=>{"use strict";var No=Co();function dn(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}dn.prototype.initialize=function(e){this.degree=e,this.genPoly=No.generateECPolynomial(this.degree)};dn.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let n=new Uint8Array(e.length+this.degree);n.set(e);let o=No.mod(n,this.genPoly),r=this.degree-o.length;if(r>0){let a=new Uint8Array(this.degree);return a.set(o,r),a}return o};wo.exports=dn});var un=W(Ro=>{"use strict";Ro.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var mn=W(Se=>{"use strict";var So="[0-9]+",ka="[A-Z $%*+\\-./:]+",yt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";yt=yt.replace(/u/g,"\\u");var Ra="(?:(?![A-Z0-9 $%*+\\-./:]|"+yt+`)(?:.|[\r
2
2
  ]))+`;Se.KANJI=new RegExp(yt,"g");Se.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Se.BYTE=new RegExp(Ra,"g");Se.NUMERIC=new RegExp(So,"g");Se.ALPHANUMERIC=new RegExp(ka,"g");var Sa=new RegExp("^"+yt+"$"),Ta=new RegExp("^"+So+"$"),Ba=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Se.testKanji=function(e){return Sa.test(e)};Se.testNumeric=function(e){return Ta.test(e)};Se.testAlphanumeric=function(e){return Ba.test(e)}});var De=W(te=>{"use strict";var Pa=un(),pn=mn();te.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};te.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};te.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};te.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};te.MIXED={bit:-1};te.getCharCountIndicator=function(e,n){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Pa.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]};te.getBestModeForData=function(e){return pn.testNumeric(e)?te.NUMERIC:pn.testAlphanumeric(e)?te.ALPHANUMERIC:pn.testKanji(e)?te.KANJI:te.BYTE};te.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};te.isValid=function(e){return e&&e.bit&&e.ccBits};function Aa(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return te.NUMERIC;case"alphanumeric":return te.ALPHANUMERIC;case"kanji":return te.KANJI;case"byte":return te.BYTE;default:throw new Error("Unknown mode: "+t)}}te.from=function(e,n){if(te.isValid(e))return e;try{return Aa(e)}catch{return n}}});var Eo=W(Oe=>{"use strict";var Ut=Ae(),Ea=ln(),To=zt(),ze=De(),fn=un(),Po=7973,Bo=Ut.getBCHDigit(Po);function Da(t,e,n){for(let o=1;o<=40;o++)if(e<=Oe.getCapacity(o,n,t))return o}function Ao(t,e){return ze.getCharCountIndicator(t,e)+4}function za(t,e){let n=0;return t.forEach(function(o){let r=Ao(o.mode,e);n+=r+o.getBitsLength()}),n}function Ma(t,e){for(let n=1;n<=40;n++)if(za(t,n)<=Oe.getCapacity(n,e,ze.MIXED))return n}Oe.from=function(e,n){return fn.isValid(e)?parseInt(e,10):n};Oe.getCapacity=function(e,n,o){if(!fn.isValid(e))throw new Error("Invalid QR Code version");typeof o>"u"&&(o=ze.BYTE);let r=Ut.getSymbolTotalCodewords(e),a=Ea.getTotalCodewordsCount(e,n),i=(r-a)*8;if(o===ze.MIXED)return i;let s=i-Ao(o,e);switch(o){case ze.NUMERIC:return Math.floor(s/10*3);case ze.ALPHANUMERIC:return Math.floor(s/11*2);case ze.KANJI:return Math.floor(s/13);case ze.BYTE:default:return Math.floor(s/8)}};Oe.getBestVersionForData=function(e,n){let o,r=To.from(n,To.M);if(Array.isArray(e)){if(e.length>1)return Ma(e,r);if(e.length===0)return 1;o=e[0]}else o=e;return Da(o.mode,o.getLength(),r)};Oe.getEncodedBits=function(e){if(!fn.isValid(e)||e<7)throw new Error("Invalid QR Code version");let n=e<<12;for(;Ut.getBCHDigit(n)-Bo>=0;)n^=Po<<Ut.getBCHDigit(n)-Bo;return e<<12|n}});var Lo=W(Mo=>{"use strict";var gn=Ae(),zo=1335,La=21522,Do=gn.getBCHDigit(zo);Mo.getEncodedBits=function(e,n){let o=e.bit<<3|n,r=o<<10;for(;gn.getBCHDigit(r)-Do>=0;)r^=zo<<gn.getBCHDigit(r)-Do;return(o<<10|r)^La}});var Wo=W((Pi,Io)=>{"use strict";var Ia=De();function et(t){this.mode=Ia.NUMERIC,this.data=t.toString()}et.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};et.prototype.getLength=function(){return this.data.length};et.prototype.getBitsLength=function(){return et.getBitsLength(this.data.length)};et.prototype.write=function(e){let n,o,r;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),r=parseInt(o,10),e.put(r,10);let a=this.data.length-n;a>0&&(o=this.data.substr(n),r=parseInt(o,10),e.put(r,a*3+1))};Io.exports=et});var Uo=W((Ai,Vo)=>{"use strict";var Wa=De(),hn=["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 tt(t){this.mode=Wa.ALPHANUMERIC,this.data=t}tt.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};tt.prototype.getLength=function(){return this.data.length};tt.prototype.getBitsLength=function(){return tt.getBitsLength(this.data.length)};tt.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let o=hn.indexOf(this.data[n])*45;o+=hn.indexOf(this.data[n+1]),e.put(o,11)}this.data.length%2&&e.put(hn.indexOf(this.data[n]),6)};Vo.exports=tt});var Oo=W((Ei,Ho)=>{"use strict";var Va=De();function nt(t){this.mode=Va.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}nt.getBitsLength=function(e){return e*8};nt.prototype.getLength=function(){return this.data.length};nt.prototype.getBitsLength=function(){return nt.getBitsLength(this.data.length)};nt.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)};Ho.exports=nt});var Fo=W((Di,_o)=>{"use strict";var Ua=De(),Ha=Ae();function ot(t){this.mode=Ua.KANJI,this.data=t}ot.getBitsLength=function(e){return e*13};ot.prototype.getLength=function(){return this.data.length};ot.prototype.getBitsLength=function(){return ot.getBitsLength(this.data.length)};ot.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=Ha.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
3
  Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};_o.exports=ot});var Ko=W((zi,bn)=>{"use strict";var vt={single_source_shortest_paths:function(t,e,n){var o={},r={};r[e]=0;var a=vt.PriorityQueue.make();a.push(e,0);for(var i,s,l,c,u,d,p,x,g;!a.empty();){i=a.pop(),s=i.value,c=i.cost,u=t[s]||{};for(l in u)u.hasOwnProperty(l)&&(d=u[l],p=c+d,x=r[l],g=typeof r[l]>"u",(g||x>p)&&(r[l]=p,a.push(l,p),o[l]=s))}if(typeof n<"u"&&typeof r[n]>"u"){var f=["Could not find a path from ",e," to ",n,"."].join("");throw new Error(f)}return o},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],o=e,r;o;)n.push(o),r=t[o],o=t[o];return n.reverse(),n},find_path:function(t,e,n){var o=vt.single_source_shortest_paths(t,e,n);return vt.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(t){var e=vt.PriorityQueue,n={},o;t=t||{};for(o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);return n.queue=[],n.sorter=t.sorter||e.default_sorter,n},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof bn<"u"&&(bn.exports=vt)});var Xo=W(rt=>{"use strict";var M=De(),Qo=Wo(),$o=Uo(),Go=Oo(),Yo=Fo(),Ct=mn(),Ht=Ae(),Oa=Ko();function qo(t){return unescape(encodeURIComponent(t)).length}function Nt(t,e,n){let o=[],r;for(;(r=t.exec(n))!==null;)o.push({data:r[0],index:r.index,mode:e,length:r[0].length});return o}function Jo(t){let e=Nt(Ct.NUMERIC,M.NUMERIC,t),n=Nt(Ct.ALPHANUMERIC,M.ALPHANUMERIC,t),o,r;return Ht.isKanjiModeEnabled()?(o=Nt(Ct.BYTE,M.BYTE,t),r=Nt(Ct.KANJI,M.KANJI,t)):(o=Nt(Ct.BYTE_KANJI,M.BYTE,t),r=[]),e.concat(n,o,r).sort(function(i,s){return i.index-s.index}).map(function(i){return{data:i.data,mode:i.mode,length:i.length}})}function xn(t,e){switch(e){case M.NUMERIC:return Qo.getBitsLength(t);case M.ALPHANUMERIC:return $o.getBitsLength(t);case M.KANJI:return Yo.getBitsLength(t);case M.BYTE:return Go.getBitsLength(t)}}function _a(t){return t.reduce(function(e,n){let o=e.length-1>=0?e[e.length-1]:null;return o&&o.mode===n.mode?(e[e.length-1].data+=n.data,e):(e.push(n),e)},[])}function Fa(t){let e=[];for(let n=0;n<t.length;n++){let o=t[n];switch(o.mode){case M.NUMERIC:e.push([o,{data:o.data,mode:M.ALPHANUMERIC,length:o.length},{data:o.data,mode:M.BYTE,length:o.length}]);break;case M.ALPHANUMERIC:e.push([o,{data:o.data,mode:M.BYTE,length:o.length}]);break;case M.KANJI:e.push([o,{data:o.data,mode:M.BYTE,length:qo(o.data)}]);break;case M.BYTE:e.push([{data:o.data,mode:M.BYTE,length:qo(o.data)}])}}return e}function Ka(t,e){let n={},o={start:{}},r=["start"];for(let a=0;a<t.length;a++){let i=t[a],s=[];for(let l=0;l<i.length;l++){let c=i[l],u=""+a+l;s.push(u),n[u]={node:c,lastCount:0},o[u]={};for(let d=0;d<r.length;d++){let p=r[d];n[p]&&n[p].node.mode===c.mode?(o[p][u]=xn(n[p].lastCount+c.length,c.mode)-xn(n[p].lastCount,c.mode),n[p].lastCount+=c.length):(n[p]&&(n[p].lastCount=c.length),o[p][u]=xn(c.length,c.mode)+4+M.getCharCountIndicator(c.mode,e))}}r=s}for(let a=0;a<r.length;a++)o[r[a]].end=0;return{map:o,table:n}}function jo(t,e){let n,o=M.getBestModeForData(t);if(n=M.from(e,o),n!==M.BYTE&&n.bit<o.bit)throw new Error('"'+t+'" cannot be encoded with mode '+M.toString(n)+`.
4
4
  Suggested mode is: `+M.toString(o));switch(n===M.KANJI&&!Ht.isKanjiModeEnabled()&&(n=M.BYTE),n){case M.NUMERIC:return new Qo(t);case M.ALPHANUMERIC:return new $o(t);case M.KANJI:return new Yo(t);case M.BYTE:return new Go(t)}}rt.fromArray=function(e){return e.reduce(function(n,o){return typeof o=="string"?n.push(jo(o,null)):o.data&&n.push(jo(o.data,o.mode)),n},[])};rt.fromString=function(e,n){let o=Jo(e,Ht.isKanjiModeEnabled()),r=Fa(o),a=Ka(r,n),i=Oa.find_path(a.map,"start","end"),s=[];for(let l=1;l<i.length-1;l++)s.push(a.table[i[l]].node);return rt.fromArray(_a(s))};rt.rawSplit=function(e){return rt.fromArray(Jo(e,Ht.isKanjiModeEnabled()))}});var er=W(Zo=>{"use strict";var _t=Ae(),yn=zt(),qa=mo(),ja=fo(),Qa=go(),$a=xo(),Nn=yo(),wn=ln(),Ga=ko(),Ot=Eo(),Ya=Lo(),Ja=De(),vn=Xo();function Xa(t,e){let n=t.size,o=$a.getPositions(e);for(let r=0;r<o.length;r++){let a=o[r][0],i=o[r][1];for(let s=-1;s<=7;s++)if(!(a+s<=-1||n<=a+s))for(let l=-1;l<=7;l++)i+l<=-1||n<=i+l||(s>=0&&s<=6&&(l===0||l===6)||l>=0&&l<=6&&(s===0||s===6)||s>=2&&s<=4&&l>=2&&l<=4?t.set(a+s,i+l,!0,!0):t.set(a+s,i+l,!1,!0))}}function Za(t){let e=t.size;for(let n=8;n<e-8;n++){let o=n%2===0;t.set(n,6,o,!0),t.set(6,n,o,!0)}}function es(t,e){let n=Qa.getPositions(e);for(let o=0;o<n.length;o++){let r=n[o][0],a=n[o][1];for(let i=-2;i<=2;i++)for(let s=-2;s<=2;s++)i===-2||i===2||s===-2||s===2||i===0&&s===0?t.set(r+i,a+s,!0,!0):t.set(r+i,a+s,!1,!0)}}function ts(t,e){let n=t.size,o=Ot.getEncodedBits(e),r,a,i;for(let s=0;s<18;s++)r=Math.floor(s/3),a=s%3+n-8-3,i=(o>>s&1)===1,t.set(r,a,i,!0),t.set(a,r,i,!0)}function Cn(t,e,n){let o=t.size,r=Ya.getEncodedBits(e,n),a,i;for(a=0;a<15;a++)i=(r>>a&1)===1,a<6?t.set(a,8,i,!0):a<8?t.set(a+1,8,i,!0):t.set(o-15+a,8,i,!0),a<8?t.set(8,o-a-1,i,!0):a<9?t.set(8,15-a-1+1,i,!0):t.set(8,15-a-1,i,!0);t.set(o-8,8,1,!0)}function ns(t,e){let n=t.size,o=-1,r=n-1,a=7,i=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let l=0;l<2;l++)if(!t.isReserved(r,s-l)){let c=!1;i<e.length&&(c=(e[i]>>>a&1)===1),t.set(r,s-l,c),a--,a===-1&&(i++,a=7)}if(r+=o,r<0||n<=r){r-=o,o=-o;break}}}function os(t,e,n){let o=new qa;n.forEach(function(l){o.put(l.mode.bit,4),o.put(l.getLength(),Ja.getCharCountIndicator(l.mode,t)),l.write(o)});let r=_t.getSymbolTotalCodewords(t),a=wn.getTotalCodewordsCount(t,e),i=(r-a)*8;for(o.getLengthInBits()+4<=i&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);let s=(i-o.getLengthInBits())/8;for(let l=0;l<s;l++)o.put(l%2?17:236,8);return rs(o,t,e)}function rs(t,e,n){let o=_t.getSymbolTotalCodewords(e),r=wn.getTotalCodewordsCount(e,n),a=o-r,i=wn.getBlocksCount(e,n),s=o%i,l=i-s,c=Math.floor(o/i),u=Math.floor(a/i),d=u+1,p=c-u,x=new Ga(p),g=0,f=new Array(i),N=new Array(i),E=0,m=new Uint8Array(t.buffer);for(let S=0;S<i;S++){let re=S<l?u:d;f[S]=m.slice(g,g+re),N[S]=x.encode(f[S]),g+=re,E=Math.max(E,re)}let h=new Uint8Array(o),B=0,P,G;for(P=0;P<E;P++)for(G=0;G<i;G++)P<f[G].length&&(h[B++]=f[G][P]);for(P=0;P<p;P++)for(G=0;G<i;G++)h[B++]=N[G][P];return h}function as(t,e,n,o){let r;if(Array.isArray(t))r=vn.fromArray(t);else if(typeof t=="string"){let c=e;if(!c){let u=vn.rawSplit(t);c=Ot.getBestVersionForData(u,n)}r=vn.fromString(t,c||40)}else throw new Error("Invalid data");let a=Ot.getBestVersionForData(r,n);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`