You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
22 KiB
1 line
22 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[21291],{27666:function(e,t,n){var r=n(34706),o=n(71783);t.Z=function(e){let t;const n=n=>()=>{t=null,e.apply(void 0,(0,r.Z)(n))},i=function(){if(null==t){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];t=(0,o.Z)(n(r))}};return i.cancel=()=>{o.Z.cancel(t),t=null},i}},88522:function(e,t,n){var r=n(92310),o=n.n(r),i=n(75440),s=n(55405),l=n(59301),a=n(53487),c=n(92343),u=n(36355),h=n(57809);const{Option:d}=h.default;function f(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const g=(e,t)=>{const{prefixCls:n,className:r,popupClassName:a,dropdownClassName:g,children:m,dataSource:E}=e,p=(0,i.Z)(m);let C;1===p.length&&(0,c.l$)(p[0])&&!f(p[0])&&([C]=p);const w=C?()=>C:void 0;let M;M=p.length&&f(p[0])?m:E?E.map((e=>{if((0,c.l$)(e))return e;switch(typeof e){case"string":return l.createElement(d,{key:e,value:e},e);case"object":{const{value:t}=e;return l.createElement(d,{key:t,value:t},e.text)}default:return}})):[];const{getPrefixCls:v}=l.useContext(u.E_),R=v("select",n);return l.createElement(h.default,Object.assign({ref:t,suffixIcon:null},(0,s.Z)(e,["dataSource","dropdownClassName"]),{prefixCls:R,popupClassName:a||g,className:o()(`${R}-auto-complete`,r),mode:h.default.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:w}),M)},m=l.forwardRef(g),E=(0,a.Z)(m);m.Option=d,m._InternalPanelDoNotUseOrYouWillBeFired=E,t.Z=m},35304:function(e,t,n){n.d(t,{Z:function(){return b}});var r=n(81978),o=n(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"}}]},name:"vertical-align-top",theme:"outlined"},s=n(1393),l=function(e,t){return o.createElement(s.Z,(0,r.Z)({},e,{ref:t,icon:i}))};var a=o.forwardRef(l),c=n(92310),u=n.n(c),h=n(16934),d=n(55405),f=n(13845),g=n(92343),m=n(68031),E=n(27666),p=n(36355),C=n(83116),w=n(37613),M=n(17313);const v=e=>{const{componentCls:t,backTopFontSize:n,backTopSize:r,zIndexPopup:o}=e;return{[t]:Object.assign(Object.assign({},(0,M.Wf)(e)),{position:"fixed",insetInlineEnd:e.backTopInlineEnd,insetBlockEnd:e.backTopBlockEnd,zIndex:o,width:40,height:40,cursor:"pointer","&:empty":{display:"none"},[`${t}-content`]:{width:r,height:r,overflow:"hidden",color:e.backTopColor,textAlign:"center",backgroundColor:e.backTopBackground,borderRadius:r,transition:`all ${e.motionDurationMid}`,"&:hover":{backgroundColor:e.backTopHoverBackground,transition:`all ${e.motionDurationMid}`}},[`${t}-icon`]:{fontSize:n,lineHeight:`${r}px`}})}},R=e=>{const{componentCls:t}=e;return{[`@media (max-width: ${e.screenMD}px)`]:{[t]:{insetInlineEnd:e.backTopInlineEndMD}},[`@media (max-width: ${e.screenXS}px)`]:{[t]:{insetInlineEnd:e.backTopInlineEndXS}}}};var N=(0,C.Z)("BackTop",(e=>{const{fontSizeHeading3:t,colorTextDescription:n,colorTextLightSolid:r,colorText:o,controlHeightLG:i}=e,s=(0,w.TS)(e,{backTopBackground:n,backTopColor:r,backTopHoverBackground:o,backTopFontSize:t,backTopSize:i,backTopBlockEnd:1.25*i,backTopInlineEnd:2.5*i,backTopInlineEndMD:1.5*i,backTopInlineEndXS:.5*i});return[v(s),R(s)]}),(e=>({zIndexPopup:e.zIndexBase+10})));var b=e=>{const{prefixCls:t,className:n,rootClassName:r,visibilityHeight:i=400,target:s,onClick:l,duration:c=450}=e,[C,w]=o.useState(0===i),M=o.useRef(null),v=()=>M.current&&M.current.ownerDocument?M.current.ownerDocument:window,R=(0,E.Z)((e=>{const t=(0,f.Z)(e.target,!0);w(t>=i)}));o.useEffect((()=>{const e=(s||v)();return R({target:e}),null==e||e.addEventListener("scroll",R),()=>{R.cancel(),null==e||e.removeEventListener("scroll",R)}}),[s]);const{getPrefixCls:b,direction:y}=o.useContext(p.E_),k=b("back-top",t),S=b(),[x,A]=N(k),I=u()(A,k,{[`${k}-rtl`]:"rtl"===y},n,r),P=(0,d.Z)(e,["prefixCls","className","rootClassName","children","visibilityHeight","target"]),T=o.createElement("div",{className:`${k}-content`},o.createElement("div",{className:`${k}-icon`},o.createElement(a,null)));return x(o.createElement("div",Object.assign({},P,{className:I,onClick:e=>{(0,m.Z)(0,{getContainer:s||v,duration:c}),null==l||l(e)},ref:M}),o.createElement(h.default,{visible:C,motionName:`${S}-fade`},(t=>{let{className:n}=t;return(0,g.Tm)(e.children||T,(e=>{let{className:t}=e;return{className:u()(n,t)}}))}))))}},44e3:function(e,t,n){var r=n(84966),o=n(86737);const i=r.ZP;i.Header=r.h4,i.Footer=r.$_,i.Content=r.VY,i.Sider=o.Z,t.Z=i},72103:function(e,t,n){n.d(t,{Z:function(){return $}});var r=n(59301),o=n(81978),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},s=n(1393),l=function(e,t){return r.createElement(s.Z,(0,o.Z)({},e,{ref:t,icon:i}))};var a,c=r.forwardRef(l),u=n(92310),h=n.n(u),d=Object.defineProperty,f=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,E=(e,t,n)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))g.call(t,n)&&E(e,n,t[n]);if(f)for(var n of f(t))m.call(t,n)&&E(e,n,t[n]);return e},C=(e,t)=>{var n={};for(var r in e)g.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&f)for(var r of f(e))t.indexOf(r)<0&&m.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.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=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const l=this.addEccAndInterleave(r);if(this.drawCodewords(l),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const o=e.QrSegment.makeSegments(n);return t.encodeSegments(o,r)}static encodeBinary(n,r){const o=e.QrSegment.makeBytes(n);return t.encodeSegments([o],r)}static encodeSegments(e,n,o=1,s=40,a=-1,c=!0){if(!(t.MIN_VERSION<=o&&o<=s&&s<=t.MAX_VERSION)||a<-1||a>7)throw new RangeError("Invalid value");let u,h;for(u=o;;u++){const r=8*t.getNumDataCodewords(u,n),o=l.getTotalBits(e,u);if(o<=r){h=o;break}if(u>=s)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&h<=8*t.getNumDataCodewords(u,e)&&(n=e);let d=[];for(const t of e){r(t.mode.modeBits,4,d),r(t.numChars,t.mode.numCharCountBits(u),d);for(const e of t.getData())d.push(e)}i(d.length==h);const f=8*t.getNumDataCodewords(u,n);i(d.length<=f),r(0,Math.min(4,f-d.length),d),r(0,(8-d.length%8)%8,d),i(d.length%8==0);for(let e=236;d.length<f;e^=253)r(e,8,d);let g=[];for(;8*g.length<d.length;)g.push(0);return d.forEach(((e,t)=>g[t>>>3]|=e<<7-(7&t))),new t(u,n,g,a)}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 e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%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 n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);i(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){const n=o(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),i=e+r,s=t+n;0<=i&&i<this.size&&0<=s&&s<this.size&&this.setFunctionModule(i,s,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],l=Math.floor(t.getNumRawDataModules(n)/8),a=o-l%o,c=Math.floor(l/o);let u=[];const h=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<o;n++){let o=e.slice(r,r+c-s+(n<a?0:1));r+=o.length;const i=t.reedSolomonComputeRemainder(o,h);n<a&&o.push(0),u.push(o.concat(i))}let d=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=c-s||n>=a)&&d.push(t[e])}));return i(d.length==l),d}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const s=t-i,l=0==(t+1&2)?this.size-1-r:r;!this.isFunction[l][s]&&n<8*e.length&&(this.modules[l][s]=o(e[n>>>3],7-(7&n)),n++)}}i(n==8*e.length)}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 n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[n][s],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[s][n],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const o=this.modules[n][r];o==this.modules[n][r+1]&&o==this.modules[n+1][r]&&o==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-1;return i(0<=o&&o<=9),e+=o*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),n.forEach(((n,o)=>r[o]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&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){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function o(e,t){return 0!=(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.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]],n.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]],e.QrCode=n;const s=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)r(n,8,t);return new s(s.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const o=Math.min(e.length-n,3);r(parseInt(e.substr(n,o),10),3*o+1,t),n+=o}return new s(s.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let o=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));o+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(o,11,n)}return t<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new s(s.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new s(s.Mode.ECI,0,t)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let l=s;l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=l})(a||(a={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(a||(a={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(a||(a={}));var w=a,M={L:w.QrCode.Ecc.LOW,M:w.QrCode.Ecc.MEDIUM,Q:w.QrCode.Ecc.QUARTILE,H:w.QrCode.Ecc.HIGH},v=128,R="L",N="#FFFFFF",b="#000000",y=!1;function k(e,t=0){const n=[];return e.forEach((function(e,r){let o=null;e.forEach((function(i,s){if(!i&&null!==o)return n.push(`M${o+t} ${r+t}h${s-o}v1H${o+t}z`),void(o=null);if(s!==e.length-1)i&&null===o&&(o=s);else{if(!i)return;null===o?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${o+t},${r+t} h${s+1-o}v1H${o+t}z`)}}))})),n.join("")}function S(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function x(e,t,n,r){if(null==r)return null;const o=n?4:0,i=e.length+2*o,s=Math.floor(.1*t),l=i/t,a=(r.width||s)*l,c=(r.height||s)*l,u=null==r.x?e.length/2-a/2:r.x*l,h=null==r.y?e.length/2-c/2:r.y*l;let d=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(h);d={x:e,y:t,w:Math.ceil(a+u-e),h:Math.ceil(c+h-t)}}return{x:u,y:h,h:c,w:a,excavation:d}}var A=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function I(e){const t=e,{value:n,size:o=v,level:i=R,bgColor:s=N,fgColor:l=b,includeMargin:a=y,style:c,imageSettings:u}=t,h=C(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=null==u?void 0:u.src,f=(0,r.useRef)(null),g=(0,r.useRef)(null),[m,E]=(0,r.useState)(!1);(0,r.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let r=w.QrCode.encodeText(n,M[i]).getModules();const c=a?4:0,h=r.length+2*c,d=x(r,o,a,u),m=g.current,E=null!=d&&null!==m&&m.complete&&0!==m.naturalHeight&&0!==m.naturalWidth;E&&null!=d.excavation&&(r=S(r,d.excavation));const p=window.devicePixelRatio||1;e.height=e.width=o*p;const C=o/h*p;t.scale(C,C),t.fillStyle=s,t.fillRect(0,0,h,h),t.fillStyle=l,A?t.fill(new Path2D(k(r,c))):r.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),E&&t.drawImage(m,d.x+c,d.y+c,d.w,d.h)}})),(0,r.useEffect)((()=>{E(!1)}),[d]);const I=p({height:o,width:o},c);let P=null;return null!=d&&(P=r.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{E(!0)},ref:g})),r.createElement(r.Fragment,null,r.createElement("canvas",p({style:I,height:o,width:o,ref:f},h)),P)}function P(e){const t=e,{value:n,size:o=v,level:i=R,bgColor:s=N,fgColor:l=b,includeMargin:a=y,imageSettings:c}=t,u=C(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let h=w.QrCode.encodeText(n,M[i]).getModules();const d=a?4:0,f=h.length+2*d,g=x(h,o,a,c);let m=null;null!=c&&null!=g&&(null!=g.excavation&&(h=S(h,g.excavation)),m=r.createElement("image",{xlinkHref:c.src,height:g.h,width:g.w,x:g.x+d,y:g.y+d,preserveAspectRatio:"none"}));const E=k(h,d);return r.createElement("svg",p({height:o,width:o,viewBox:`0 0 ${f} ${f}`},u),r.createElement("path",{fill:s,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),r.createElement("path",{fill:l,d:E,shapeRendering:"crispEdges"}),m)}var T=n(3113),O=n(36355),z=n(9763),_=n(71418),B=n(88088),L=n(17313),D=n(83116),F=n(37613);var H=(0,D.Z)("QRCode",(e=>(e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign({},(0,L.Wf)(e)),{display:"flex",justifyContent:"center",alignItems:"center",padding:e.paddingSM,backgroundColor:e.colorWhite,borderRadius:e.borderRadiusLG,border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,position:"relative",width:"100%",height:"100%",overflow:"hidden",[`& > ${t}-mask`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:10,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",color:e.colorText,lineHeight:e.lineHeight,background:e.QRCodeMaskBackgroundColor,textAlign:"center",[`& > ${t}-expired`]:{color:e.QRCodeExpiredTextColor}},"&-icon":{marginBlockEnd:e.marginXS,fontSize:e.controlHeight}}),[`${t}-borderless`]:{borderColor:"transparent"}}})((0,F.TS)(e,{QRCodeExpiredTextColor:"rgba(0, 0, 0, 0.88)",QRCodeMaskBackgroundColor:"rgba(255, 255, 255, 0.96)"}))));var $=e=>{const[,t]=(0,B.Z)(),{value:n,type:o="canvas",icon:i="",size:s=160,iconSize:l=40,color:a=t.colorText,errorLevel:u="M",status:d="active",bordered:f=!0,onRefresh:g,style:m,className:E,rootClassName:p,prefixCls:C,bgColor:w="transparent"}=e,{getPrefixCls:M}=(0,r.useContext)(O.E_),v=M("qrcode",C),[R,N]=H(v),b={src:i,x:void 0,y:void 0,height:l,width:l,excavate:!0},y={value:n,size:s-2*(t.paddingSM+t.lineWidth),level:u,bgColor:w,fgColor:a,imageSettings:i?b:void 0},[k]=(0,z.Z)("QRCode");if(!n)return null;const S=h()(v,E,p,N,{[`${v}-borderless`]:!f});return R(r.createElement("div",{style:Object.assign(Object.assign({},m),{width:s,height:s,backgroundColor:w}),className:S},"active"!==d&&r.createElement("div",{className:`${v}-mask`},"loading"===d&&r.createElement(_.Z,null),"expired"===d&&r.createElement(r.Fragment,null,r.createElement("p",{className:`${v}-expired`},null==k?void 0:k.expired),g&&r.createElement(T.ZP,{type:"link",icon:r.createElement(c,null),onClick:g},null==k?void 0:k.refresh))),"canvas"===o?r.createElement(I,Object.assign({},y)):r.createElement(P,Object.assign({},y))))}}}]); |