"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[397],{10397:function(Ne,V,w){w.d(V,{Z:function(){return ve}});var C=w(67294),K=w(87462),J=w(82947),q=w(93771),ee=function(r,u){return C.createElement(q.Z,(0,K.Z)({},r,{ref:u,icon:J.Z}))},te=C.forwardRef(ee),ne=w(93967),oe=w.n(ne),re=Object.defineProperty,b=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,D=(l,r,u)=>r in l?re(l,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[r]=u,O=(l,r)=>{for(var u in r||(r={}))F.call(r,u)&&D(l,u,r[u]);if(b)for(var u of b(r))z.call(r,u)&&D(l,u,r[u]);return l},T=(l,r)=>{var u={};for(var i in l)F.call(l,i)&&r.indexOf(i)<0&&(u[i]=l[i]);if(l!=null&&b)for(var i of b(l))r.indexOf(i)<0&&z.call(l,i)&&(u[i]=l[i]);return u};var S;(l=>{const r=class{constructor(e,t,n,o){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],er.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 a=0;a7)throw new RangeError("Invalid value");let a,E;for(a=n;;a++){const m=r.getNumDataCodewords(a,t)*8,R=M.getTotalBits(e,a);if(R<=m){E=R;break}if(a>=o)throw new RangeError("Data too long")}for(const m of[r.Ecc.MEDIUM,r.Ecc.QUARTILE,r.Ecc.HIGH])c&&E<=r.getNumDataCodewords(a,m)*8&&(t=m);let g=[];for(const m of e){i(m.mode.modeBits,4,g),i(m.numChars,m.mode.numCharCountBits(a),g);for(const R of m.getData())g.push(R)}h(g.length==E);const P=r.getNumDataCodewords(a,t)*8;h(g.length<=P),i(0,Math.min(4,P-g.length),g),i(0,(8-g.length%8)%8,g),h(g.length%8==0);for(let m=236;g.lengthv[R>>>3]|=m<<7-(R&7)),new r(a,t,v,s)}getModule(e,t){return 0<=e&&e>>9)*1335;const o=(t<<10|n)^21522;h(o>>>15==0);for(let s=0;s<=5;s++)this.setFunctionModule(8,s,f(o,s));this.setFunctionModule(8,7,f(o,6)),this.setFunctionModule(8,8,f(o,7)),this.setFunctionModule(7,8,f(o,8));for(let s=9;s<15;s++)this.setFunctionModule(14-s,8,f(o,s));for(let s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,f(o,s));for(let s=8;s<15;s++)this.setFunctionModule(8,this.size-15+s,f(o,s));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^(e>>>11)*7973;const t=this.version<<12|e;h(t>>>18==0);for(let n=0;n<18;n++){const o=f(t,n),s=this.size-11+n%3,c=Math.floor(n/3);this.setFunctionModule(s,c,o),this.setFunctionModule(c,s,o)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let o=-4;o<=4;o++){const s=Math.max(Math.abs(o),Math.abs(n)),c=e+o,a=t+n;0<=c&&c{(m!=E-s||p>=a)&&v.push(R[m])});return h(v.length==c),v}drawCodewords(e){if(e.length!=Math.floor(r.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){n==6&&(n=5);for(let o=0;o>>3],7-(t&7)),t++)}}h(t==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t5&&e++):(this.finderPenaltyAddHistory(a,E),c||(e+=this.finderPenaltyCountPatterns(E)*r.PENALTY_N3),c=this.modules[s][g],a=1);e+=this.finderPenaltyTerminateAndCount(c,a,E)*r.PENALTY_N3}for(let s=0;s5&&e++):(this.finderPenaltyAddHistory(a,E),c||(e+=this.finderPenaltyCountPatterns(E)*r.PENALTY_N3),c=this.modules[g][s],a=1);e+=this.finderPenaltyTerminateAndCount(c,a,E)*r.PENALTY_N3}for(let s=0;sc+(a?1:0),t);const n=this.size*this.size,o=Math.ceil(Math.abs(t*20-n*10)/n)-1;return h(0<=o&&o<=9),e+=o*r.PENALTY_N4,h(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 n=[6];for(let o=this.size-7;n.lengthr.MAX_VERSION)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return h(208<=t&&t<=29648),t}static getNumDataCodewords(e,t){return Math.floor(r.getNumRawDataModules(e)/8)-r.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*r.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;o0);for(const o of e){const s=o^n.shift();n.push(0),t.forEach((c,a)=>n[a]^=r.reedSolomonMultiply(c,s))}return n}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let n=0;for(let o=7;o>=0;o--)n=n<<1^(n>>>7)*285,n^=(t>>>o&1)*e;return h(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];h(t<=this.size*3);const n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};let u=r;u.MIN_VERSION=1,u.MAX_VERSION=40,u.PENALTY_N1=3,u.PENALTY_N2=3,u.PENALTY_N3=40,u.PENALTY_N4=10,u.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]],u.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]],l.QrCode=u;function i(e,t,n){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let o=t-1;o>=0;o--)n.push(e>>>o&1)}function f(e,t){return(e>>>t&1)!=0}function h(e){if(!e)throw new Error("Assertion error")}const d=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)i(n,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 n=0;n=1<{let r;(u=>{const i=class{constructor(h,d){this.ordinal=h,this.formatBits=d}};let f=i;f.LOW=new i(0,1),f.MEDIUM=new i(1,0),f.QUARTILE=new i(2,3),f.HIGH=new i(3,2),u.Ecc=f})(r=l.QrCode||(l.QrCode={}))})(S||(S={})),(l=>{let r;(u=>{const i=class{constructor(h,d){this.modeBits=h,this.numBitsCharCount=d}numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}};let f=i;f.NUMERIC=new i(1,[10,12,14]),f.ALPHANUMERIC=new i(2,[9,11,13]),f.BYTE=new i(4,[8,16,16]),f.KANJI=new i(8,[8,10,12]),f.ECI=new i(7,[0,0,0]),u.Mode=f})(r=l.QrSegment||(l.QrSegment={}))})(S||(S={}));var I=S;var Q={L:I.QrCode.Ecc.LOW,M:I.QrCode.Ecc.MEDIUM,Q:I.QrCode.Ecc.QUARTILE,H:I.QrCode.Ecc.HIGH},x=128,U="L",$="#FFFFFF",H="#000000",_=!1,B=4,se=.1;function k(l,r=0){const u=[];return l.forEach(function(i,f){let h=null;i.forEach(function(d,M){if(!d&&h!==null){u.push(`M${h+r} ${f+r}h${M-h}v1H${h+r}z`),h=null;return}if(M===i.length-1){if(!d)return;h===null?u.push(`M${M+r},${f+r} h1v1H${M+r}z`):u.push(`M${h+r},${f+r} h${M+1-h}v1H${h+r}z`);return}d&&h===null&&(h=M)})}),u.join("")}function Y(l,r){return l.slice().map((u,i)=>i=r.y+r.h?u:u.map((f,h)=>h=r.x+r.w?f:!1))}function j(l,r,u,i){if(i==null)return null;const f=u?B:0,h=l.length+f*2,d=Math.floor(r*se),M=h/r,e=(i.width||d)*M,t=(i.height||d)*M,n=i.x==null?l.length/2-e/2:i.x*M,o=i.y==null?l.length/2-t/2:i.y*M;let s=null;if(i.excavate){let c=Math.floor(n),a=Math.floor(o),E=Math.ceil(e+n-c),g=Math.ceil(t+o-a);s={x:c,y:a,w:E,h:g}}return{x:n,y:o,h:t,w:e,excavation:s}}var ie=function(){try{new Path2D().addPath(new Path2D)}catch(l){return!1}return!0}();function G(l){const r=l,{value:u,size:i=x,level:f=U,bgColor:h=$,fgColor:d=H,includeMargin:M=_,style:e,imageSettings:t}=r,n=T(r,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),o=t==null?void 0:t.src,s=(0,C.useRef)(null),c=(0,C.useRef)(null),[a,E]=(0,C.useState)(!1);(0,C.useEffect)(()=>{if(s.current!=null){const v=s.current,m=v.getContext("2d");if(!m)return;let R=I.QrCode.encodeText(u,Q[f]).getModules();const p=M?B:0,y=R.length+p*2,N=j(R,i,M,t),A=c.current,L=N!=null&&A!==null&&A.complete&&A.naturalHeight!==0&&A.naturalWidth!==0;L&&N.excavation!=null&&(R=Y(R,N.excavation));const X=window.devicePixelRatio||1;v.height=v.width=i*X;const Z=i/y*X;m.scale(Z,Z),m.fillStyle=h,m.fillRect(0,0,y,y),m.fillStyle=d,ie?m.fill(new Path2D(k(R,p))):R.forEach(function(we,pe){we.forEach(function(Ae,Pe){Ae&&m.fillRect(Pe+p,pe+p,1,1)})}),L&&m.drawImage(A,N.x+p,N.y+p,N.w,N.h)}}),(0,C.useEffect)(()=>{E(!1)},[o]);const g=O({height:i,width:i},e);let P=null;return o!=null&&(P=C.createElement("img",{src:o,key:o,style:{display:"none"},onLoad:()=>{E(!0)},ref:c})),C.createElement(C.Fragment,null,C.createElement("canvas",O({style:g,height:i,width:i,ref:s},n)),P)}function W(l){const r=l,{value:u,size:i=x,level:f=U,bgColor:h=$,fgColor:d=H,includeMargin:M=_,imageSettings:e}=r,t=T(r,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let n=I.QrCode.encodeText(u,Q[f]).getModules();const o=M?B:0,s=n.length+o*2,c=j(n,i,M,e);let a=null;e!=null&&c!=null&&(c.excavation!=null&&(n=Y(n,c.excavation)),a=C.createElement("image",{xlinkHref:e.src,height:c.h,width:c.w,x:c.x+o,y:c.y+o,preserveAspectRatio:"none"}));const E=k(n,o);return C.createElement("svg",O({height:i,width:i,viewBox:`0 0 ${s} ${s}`},t),C.createElement("path",{fill:h,d:`M0,0 h${s}v${s}H0z`,shapeRendering:"crispEdges"}),C.createElement("path",{fill:d,d:E,shapeRendering:"crispEdges"}),a)}var Se=l=>{const r=l,{renderAs:u}=r,i=T(r,["renderAs"]);return u==="svg"?React.createElement(W,O({},i)):React.createElement(G,O({},i))},le=w(14726),ae=w(53124),ce=w(10110),ue=w(75081),he=w(29691),de=w(54548),fe=w(10274),ge=w(14747),me=w(91945),Ee=w(45503);const Ce=l=>{const{componentCls:r,lineWidth:u,lineType:i,colorSplit:f}=l;return{[r]:Object.assign(Object.assign({},(0,ge.Wf)(l)),{display:"flex",justifyContent:"center",alignItems:"center",padding:l.paddingSM,backgroundColor:l.colorWhite,borderRadius:l.borderRadiusLG,border:`${(0,de.bf)(u)} ${i} ${f}`,position:"relative",overflow:"hidden",[`& > ${r}-mask`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:10,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",color:l.colorText,lineHeight:l.lineHeight,background:l.QRCodeMaskBackgroundColor,textAlign:"center",[`& > ${r}-expired, & > ${r}-scanned`]:{color:l.QRCodeTextColor}},"> canvas":{alignSelf:"stretch",flex:"auto",minWidth:0},"&-icon":{marginBlockEnd:l.marginXS,fontSize:l.controlHeight}}),[`${r}-borderless`]:{borderColor:"transparent"}}},Me=l=>({QRCodeMaskBackgroundColor:new fe.C(l.colorBgContainer).setAlpha(.96).toRgbString()});var Re=(0,me.I$)("QRCode",l=>{const r=(0,Ee.TS)(l,{QRCodeTextColor:l.colorText});return Ce(r)},Me),ve=l=>{const[,r]=(0,he.ZP)(),{value:u,type:i="canvas",icon:f="",size:h=160,iconSize:d=40,color:M=r.colorText,errorLevel:e="M",status:t="active",bordered:n=!0,onRefresh:o,style:s,className:c,rootClassName:a,prefixCls:E,bgColor:g="transparent"}=l,{getPrefixCls:P}=(0,C.useContext)(ae.E_),v=P("qrcode",E),[m,R,p]=Re(v),N={value:u,size:h,level:e,bgColor:g,fgColor:M,style:{width:void 0,height:void 0},imageSettings:f?{src:f,x:void 0,y:void 0,height:d,width:d,excavate:!0}:void 0},[A]=(0,ce.Z)("QRCode");if(!u)return null;const L=oe()(v,c,a,R,p,{[`${v}-borderless`]:!n});return m(C.createElement("div",{className:L,style:Object.assign(Object.assign({},s),{width:h,height:h,backgroundColor:g})},t!=="active"&&C.createElement("div",{className:`${v}-mask`},t==="loading"&&C.createElement(ue.Z,null),t==="expired"&&C.createElement(C.Fragment,null,C.createElement("p",{className:`${v}-expired`},A==null?void 0:A.expired),o&&C.createElement(le.ZP,{type:"link",icon:C.createElement(te,null),onClick:o},A==null?void 0:A.refresh)),t==="scanned"&&C.createElement("p",{className:`${v}-scanned`},A==null?void 0:A.scanned)),i==="canvas"?C.createElement(G,Object.assign({},N)):C.createElement(W,Object.assign({},N))))}}}]);