1234567 |
- import{j as _,r as I,h as Q,F as re,s as x,f as N,ao as oe,v as ne,w as se,d4 as ie,cd as ae,ai as le,ag as ce,T as ue,z as he,D as de,Q as fe,K as me}from"./index-DT8qTvyx.js";var ge=Object.defineProperty,L=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,U=(h,n,a)=>n in h?ge(h,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):h[n]=a,b=(h,n)=>{for(var a in n||(n={}))k.call(n,a)&&U(h,a,n[a]);if(L)for(var a of L(n))H.call(n,a)&&U(h,a,n[a]);return h},O=(h,n)=>{var a={};for(var i in h)k.call(h,i)&&n.indexOf(i)<0&&(a[i]=h[i]);if(h!=null&&L)for(var i of L(h))n.indexOf(i)<0&&H.call(h,i)&&(a[i]=h[i]);return a},A;(h=>{const n=class{constructor(e,t,r,o){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<n.MIN_VERSION||e>n.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=e*4+17;let s=[];for(let l=0;l<this.size;l++)s.push(!1);for(let l=0;l<this.size;l++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const c=this.addEccAndInterleave(r);if(this.drawCodewords(c),o==-1){let l=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);const f=this.getPenaltyScore();f<l&&(o=g,l=f),this.applyMask(g)}}u(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(e,t){const r=h.QrSegment.makeSegments(e);return n.encodeSegments(r,t)}static encodeBinary(e,t){const r=h.QrSegment.makeBytes(e);return n.encodeSegments([r],t)}static encodeSegments(e,t,r=1,o=40,s=-1,c=!0){if(!(n.MIN_VERSION<=r&&r<=o&&o<=n.MAX_VERSION)||s<-1||s>7)throw new RangeError("Invalid value");let l,g;for(l=r;;l++){const C=n.getNumDataCodewords(l,t)*8,p=E.getTotalBits(e,l);if(p<=C){g=p;break}if(l>=o)throw new RangeError("Data too long")}for(const C of[n.Ecc.MEDIUM,n.Ecc.QUARTILE,n.Ecc.HIGH])c&&g<=n.getNumDataCodewords(l,C)*8&&(t=C);let f=[];for(const C of e){i(C.mode.modeBits,4,f),i(C.numChars,C.mode.numCharCountBits(l),f);for(const p of C.getData())f.push(p)}u(f.length==g);const M=n.getNumDataCodewords(l,t)*8;u(f.length<=M),i(0,Math.min(4,M-f.length),f),i(0,(8-f.length%8)%8,f),u(f.length%8==0);for(let C=236;f.length<M;C^=253)i(C,8,f);let v=[];for(;v.length*8<f.length;)v.push(0);return f.forEach((C,p)=>v[p>>>3]|=C<<7-(p&7)),new n(l,t,v,s)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let r=0;r<t;r++)for(let o=0;o<t;o++)r==0&&o==0||r==0&&o==t-1||r==t-1&&o==0||this.drawAlignmentPattern(e[r],e[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let r=t;for(let s=0;s<10;s++)r=r<<1^(r>>>9)*1335;const o=(t<<10|r)^21522;u(o>>>15==0);for(let s=0;s<=5;s++)this.setFunctionModule(8,s,m(o,s));this.setFunctionModule(8,7,m(o,6)),this.setFunctionModule(8,8,m(o,7)),this.setFunctionModule(7,8,m(o,8));for(let s=9;s<15;s++)this.setFunctionModule(14-s,8,m(o,s));for(let s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,m(o,s));for(let s=8;s<15;s++)this.setFunctionModule(8,this.size-15+s,m(o,s));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let r=0;r<12;r++)e=e<<1^(e>>>11)*7973;const t=this.version<<12|e;u(t>>>18==0);for(let r=0;r<18;r++){const o=m(t,r),s=this.size-11+r%3,c=Math.floor(r/3);this.setFunctionModule(s,c,o),this.setFunctionModule(c,s,o)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let o=-4;o<=4;o++){const s=Math.max(Math.abs(o),Math.abs(r)),c=e+o,l=t+r;0<=c&&c<this.size&&0<=l&&l<this.size&&this.setFunctionModule(c,l,s!=2&&s!=4)}}drawAlignmentPattern(e,t){for(let r=-2;r<=2;r++)for(let o=-2;o<=2;o++)this.setFunctionModule(e+o,t+r,Math.max(Math.abs(o),Math.abs(r))!=1)}setFunctionModule(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0}addEccAndInterleave(e){const t=this.version,r=this.errorCorrectionLevel;if(e.length!=n.getNumDataCodewords(t,r))throw new RangeError("Invalid argument");const o=n.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t],s=n.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t],c=Math.floor(n.getNumRawDataModules(t)/8),l=o-c%o,g=Math.floor(c/o);let f=[];const M=n.reedSolomonComputeDivisor(s);for(let C=0,p=0;C<o;C++){let w=e.slice(p,p+g-s+(C<l?0:1));p+=w.length;const y=n.reedSolomonComputeRemainder(w,M);C<l&&w.push(0),f.push(w.concat(y))}let v=[];for(let C=0;C<f[0].length;C++)f.forEach((p,w)=>{(C!=g-s||w>=l)&&v.push(p[C])});return u(v.length==c),v}drawCodewords(e){if(e.length!=Math.floor(n.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(let o=0;o<this.size;o++)for(let s=0;s<2;s++){const c=r-s,g=(r+1&2)==0?this.size-1-o:o;!this.isFunction[g][c]&&t<e.length*8&&(this.modules[g][c]=m(e[t>>>3],7-(t&7)),t++)}}u(t==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let o;switch(e){case 0:o=(r+t)%2==0;break;case 1:o=t%2==0;break;case 2:o=r%3==0;break;case 3:o=(r+t)%3==0;break;case 4:o=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:o=r*t%2+r*t%3==0;break;case 6:o=(r*t%2+r*t%3)%2==0;break;case 7:o=((r+t)%2+r*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][r]&&o&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let e=0;for(let s=0;s<this.size;s++){let c=!1,l=0,g=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[s][f]==c?(l++,l==5?e+=n.PENALTY_N1:l>5&&e++):(this.finderPenaltyAddHistory(l,g),c||(e+=this.finderPenaltyCountPatterns(g)*n.PENALTY_N3),c=this.modules[s][f],l=1);e+=this.finderPenaltyTerminateAndCount(c,l,g)*n.PENALTY_N3}for(let s=0;s<this.size;s++){let c=!1,l=0,g=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[f][s]==c?(l++,l==5?e+=n.PENALTY_N1:l>5&&e++):(this.finderPenaltyAddHistory(l,g),c||(e+=this.finderPenaltyCountPatterns(g)*n.PENALTY_N3),c=this.modules[f][s],l=1);e+=this.finderPenaltyTerminateAndCount(c,l,g)*n.PENALTY_N3}for(let s=0;s<this.size-1;s++)for(let c=0;c<this.size-1;c++){const l=this.modules[s][c];l==this.modules[s][c+1]&&l==this.modules[s+1][c]&&l==this.modules[s+1][c+1]&&(e+=n.PENALTY_N2)}let t=0;for(const s of this.modules)t=s.reduce((c,l)=>c+(l?1:0),t);const r=this.size*this.size,o=Math.ceil(Math.abs(t*20-r*10)/r)-1;return u(0<=o&&o<=9),e+=o*n.PENALTY_N4,u(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{const e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2;let r=[6];for(let o=this.size-7;r.length<e;o-=t)r.splice(1,0,o);return r}}static getNumRawDataModules(e){if(e<n.MIN_VERSION||e>n.MAX_VERSION)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const r=Math.floor(e/7)+2;t-=(25*r-10)*r-55,e>=7&&(t-=36)}return u(208<=t&&t<=29648),t}static getNumDataCodewords(e,t){return Math.floor(n.getNumRawDataModules(e)/8)-n.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*n.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let t=[];for(let o=0;o<e-1;o++)t.push(0);t.push(1);let r=1;for(let o=0;o<e;o++){for(let s=0;s<t.length;s++)t[s]=n.reedSolomonMultiply(t[s],r),s+1<t.length&&(t[s]^=t[s+1]);r=n.reedSolomonMultiply(r,2)}return t}static reedSolomonComputeRemainder(e,t){let r=t.map(o=>0);for(const o of e){const s=o^r.shift();r.push(0),t.forEach((c,l)=>r[l]^=n.reedSolomonMultiply(c,s))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let r=0;for(let o=7;o>=0;o--)r=r<<1^(r>>>7)*285,r^=(t>>>o&1)*e;return u(r>>>8==0),r}finderPenaltyCountPatterns(e){const t=e[1];u(t<=this.size*3);const r=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(r&&e[0]>=t*4&&e[6]>=t?1:0)+(r&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};let a=n;a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],a.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],h.QrCode=a;function i(e,t,r){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let o=t-1;o>=0;o--)r.push(e>>>o&1)}function m(e,t){return(e>>>t&1)!=0}function u(e){if(!e)throw new Error("Assertion error")}const d=class{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(e){let t=[];for(const r of e)i(r,8,t);return new d(d.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!d.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let r=0;r<e.length;){const o=Math.min(e.length-r,3);i(parseInt(e.substr(r,o),10),o*3+1,t),r+=o}return new d(d.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!d.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t=[],r;for(r=0;r+2<=e.length;r+=2){let o=d.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r))*45;o+=d.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r+1)),i(o,11,t)}return r<e.length&&i(d.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r)),6,t),new d(d.Mode.ALPHANUMERIC,e.length,t)}static makeSegments(e){return e==""?[]:d.isNumeric(e)?[d.makeNumeric(e)]:d.isAlphanumeric(e)?[d.makeAlphanumeric(e)]:[d.makeBytes(d.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)i(e,8,t);else if(e<16384)i(2,2,t),i(e,14,t);else if(e<1e6)i(6,3,t),i(e,21,t);else throw new RangeError("ECI assignment value out of range");return new d(d.Mode.ECI,0,t)}static isNumeric(e){return d.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return d.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let r=0;for(const o of e){const s=o.mode.numCharCountBits(t);if(o.numChars>=1<<s)return 1/0;r+=4+s+o.bitData.length}return r}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let r=0;r<e.length;r++)e.charAt(r)!="%"?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substr(r+1,2),16)),r+=2);return t}};let E=d;E.NUMERIC_REGEX=/^[0-9]*$/,E.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,E.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",h.QrSegment=E})(A||(A={}));(h=>{(n=>{const a=class{constructor(m,u){this.ordinal=m,this.formatBits=u}};let i=a;i.LOW=new a(0,1),i.MEDIUM=new a(1,0),i.QUARTILE=new a(2,3),i.HIGH=new a(3,2),n.Ecc=i})(h.QrCode||(h.QrCode={}))})(A||(A={}));(h=>{(n=>{const a=class{constructor(m,u){this.modeBits=m,this.numBitsCharCount=u}numCharCountBits(m){return this.numBitsCharCount[Math.floor((m+7)/17)]}};let i=a;i.NUMERIC=new a(1,[10,12,14]),i.ALPHANUMERIC=new a(2,[9,11,13]),i.BYTE=new a(4,[8,16,16]),i.KANJI=new a(8,[8,10,12]),i.ECI=new a(7,[0,0,0]),n.Mode=i})(h.QrSegment||(h.QrSegment={}))})(A||(A={}));var P=A;/**
- * @license qrcode.react
- * Copyright (c) Paul O'Shannessy
- * SPDX-License-Identifier: ISC
- */var $={L:P.QrCode.Ecc.LOW,M:P.QrCode.Ecc.MEDIUM,Q:P.QrCode.Ecc.QUARTILE,H:P.QrCode.Ecc.HIGH},Y=128,j="L",V="#FFFFFF",G="#000000",X=!1,B=4,Ce=.1;function W(h,n=0){const a=[];return h.forEach(function(i,m){let u=null;i.forEach(function(d,E){if(!d&&u!==null){a.push(`M${u+n} ${m+n}h${E-u}v1H${u+n}z`),u=null;return}if(E===i.length-1){if(!d)return;u===null?a.push(`M${E+n},${m+n} h1v1H${E+n}z`):a.push(`M${u+n},${m+n} h${E+1-u}v1H${u+n}z`);return}d&&u===null&&(u=E)})}),a.join("")}function K(h,n){return h.slice().map((a,i)=>i<n.y||i>=n.y+n.h?a:a.map((m,u)=>u<n.x||u>=n.x+n.w?m:!1))}function q(h,n,a,i){if(i==null)return null;const m=a?B:0,u=h.length+m*2,d=Math.floor(n*Ce),E=u/n,e=(i.width||d)*E,t=(i.height||d)*E,r=i.x==null?h.length/2-e/2:i.x*E,o=i.y==null?h.length/2-t/2:i.y*E;let s=null;if(i.excavate){let c=Math.floor(r),l=Math.floor(o),g=Math.ceil(e+r-c),f=Math.ceil(t+o-l);s={x:c,y:l,w:g,h:f}}return{x:r,y:o,h:t,w:e,excavation:s}}var Ee=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function pe(h){const n=h,{value:a,size:i=Y,level:m=j,bgColor:u=V,fgColor:d=G,includeMargin:E=X,style:e,imageSettings:t}=n,r=O(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),o=t==null?void 0:t.src,s=I.useRef(null),c=I.useRef(null),[l,g]=I.useState(!1);I.useEffect(()=>{if(s.current!=null){const v=s.current,C=v.getContext("2d");if(!C)return;let p=P.QrCode.encodeText(a,$[m]).getModules();const w=E?B:0,y=p.length+w*2,R=q(p,i,E,t),S=c.current,F=R!=null&&S!==null&&S.complete&&S.naturalHeight!==0&&S.naturalWidth!==0;F&&R.excavation!=null&&(p=K(p,R.excavation));const T=window.devicePixelRatio||1;v.height=v.width=i*T;const z=i/y*T;C.scale(z,z),C.fillStyle=u,C.fillRect(0,0,y,y),C.fillStyle=d,Ee?C.fill(new Path2D(W(p,w))):p.forEach(function(Z,J){Z.forEach(function(ee,te){ee&&C.fillRect(te+w,J+w,1,1)})}),F&&C.drawImage(S,R.x+w,R.y+w,R.w,R.h)}}),I.useEffect(()=>{g(!1)},[o]);const f=b({height:i,width:i},e);let M=null;return o!=null&&(M=_("img",{src:o,style:{display:"none"},onLoad:()=>{g(!0)},ref:c},o)),Q(re,{children:[_("canvas",{...b({style:f,height:i,width:i,ref:s},r)}),M]})}function we(h){const n=h,{value:a,size:i=Y,level:m=j,bgColor:u=V,fgColor:d=G,includeMargin:E=X,imageSettings:e}=n,t=O(n,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let r=P.QrCode.encodeText(a,$[m]).getModules();const o=E?B:0,s=r.length+o*2,c=q(r,i,E,e);let l=null;e!=null&&c!=null&&(c.excavation!=null&&(r=K(r,c.excavation)),l=_("image",{xlinkHref:e.src,height:c.h,width:c.w,x:c.x+o,y:c.y+o,preserveAspectRatio:"none"}));const g=W(r,o);return Q("svg",{...b({height:i,width:i,viewBox:`0 0 ${s} ${s}`},t),children:[_("path",{fill:u,d:`M0,0 h${s}v${s}H0z`,shapeRendering:"crispEdges"}),_("path",{fill:d,d:g,shapeRendering:"crispEdges"}),l]})}var ve=h=>{const n=h,{renderAs:a}=n,i=O(n,["renderAs"]);return a==="svg"?_(we,{...b({},i)}):_(pe,{...b({},i)})};function D(h,n){var a=URL.createObjectURL(h),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(function(){return URL.revokeObjectURL(a)},500)}var Me=function(h){x(n,h);function n(a){var i=h.call(this,a)||this;return i.ref=N.createRef(),i}return n.prototype.getImageSettings=function(){var a=this.props,i=a.imageSettings,m=a.data;if(!(!i||!oe(i)||!i.src||typeof i.src!="string"))return ne(i.src)&&(i.src=se(i.src,m,"| raw")),ie(i,function(u,d){return~["width","height","x","y"].indexOf(d)?ae(u)?Number(u):null:u})},n.prototype.doAction=function(a,i,m,u){var d,E=this.props.codeSize,e=a==null?void 0:a.actionType;if(e==="saveAs"&&!((d=this.ref)===null||d===void 0)&&d.current)if(this.props.mode==="svg"){var t=this.ref.current.querySelector("svg");if(t){var r='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" height="'.concat(E,'" width="').concat(E,'" viewBox="').concat(t.getAttribute("viewBox")||"0 0 37 37",`">
- `).concat(t.innerHTML,`
- </svg>`),o=new Blob([r],{type:"image/svg+xml"});D(o,(u==null?void 0:u.name)||"qr-code.svg")}}else{var s=this.ref.current.querySelector("canvas");s&&s.toBlob(function(c){c&&D(c,u!=null&&u.name?u.name.replace(/\.svg$/,".png"):"qr-code.png")},"image/png")}},n.prototype.render=function(){var a=this.props,i=a.className,m=a.style,u=a.qrcodeClassName,d=a.codeSize,E=a.backgroundColor,e=a.foregroundColor,t=a.placeholder,r=a.level,o=a.defaultValue,s=a.data,c=a.mode,l=a.translate,g=a.classPrefix,f=le(this.props,function(){return me(o,s,"| raw")||void 0});return N.createElement("div",{className:ce("".concat(g,"QrCode"),i),style:m,ref:this.ref},f?f.length>2953?N.createElement("span",{className:"text-danger"},l("QRCode.tooLong",{max:2953})):N.createElement(ve,{className:u,value:f,size:d,bgColor:E,fgColor:e,level:r||"L",imageSettings:this.getImageSettings(),renderAs:c}):N.createElement("span",{className:"".concat(g,"QrCode--placeholder")},t))},n.defaultProps={codeSize:128,qrcodeClassName:"",backgroundColor:"#fff",foregroundColor:"#000",level:"L",placeholder:"-",mode:"canvas"},n}(N.Component),_e=function(h){x(n,h);function n(a,i){var m=h.call(this,a)||this,u=i;return u.registerComponent(m),m}return n.prototype.componentWillUnmount=function(){var a;(a=h.prototype.componentWillUnmount)===null||a===void 0||a.call(this);var i=this.context;i.unRegisterComponent(this)},n.contextType=ue,n=he([de({type:"qrcode",alias:["qr-code"],name:"qrcode"}),fe("design:paramtypes",[Object,Object])],n),n}(Me);export{_e as QRCodeRenderer,Me as default};
|