mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-03-02 01:30:51 +03:00
5 lines
18 KiB
JavaScript
5 lines
18 KiB
JavaScript
![]() |
/* QRious v5.0.0 | (C) 2024 Tara Rostami | GPL v3 License
|
||
|
QRious v4.0.2 | (C) 2017 Alasdair Mercer | GPL v3 License
|
||
|
Based on jsqrencode | (C) 2010 tz@execpc.com | GPL v3 License
|
||
|
*/
|
||
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.QRious=e()}(this,function(){"use strict";var t=function(){},e=Object.prototype.hasOwnProperty,i=Array.prototype.slice;function s(t,s,n){n=i.call(arguments,2);for(var r,a,o=0,h=n.length;o<h;o++)for(r in a=n[o])(!t||e.call(a,r))&&(s[r]=a[r])}function n(){}n.class_="Nevis",n.super_=Object,n.extend=function(e,i,n,r){var a,o,h,f=this;return"string"!=typeof e&&(r=n,n=i,i=e,e=null),"function"!=typeof i&&(r=n,n=i,i=function(){return f.apply(this,arguments)}),s(!1,i,f,r),i.prototype=(a=f.prototype,o=n,"function"==typeof Object.create?h=Object.create(a):(t.prototype=a,h=new t,t.prototype=null),o&&s(!0,h,o),h),i.prototype.constructor=i,i.class_=e||f.class_,i.super_=f,i};var r=n.extend(function(t,e,i){this.qrious=t,this.element=e,this.element.qrious=t,this.enabled=!!i},{draw:function(t){},getElement:function(){return this.enabled||(this.enabled=!0,this.render()),this.element},getModuleSize:function(t){var e=this.qrious,i=e.padding||0;return Math.max(1,(e.size-2*i)/t.width)},getOffset:function(t){var e=this.qrious,i=e.padding,s=this.getModuleSize(t),n=Math.floor((e.size-s*t.width)/2);return null!=i&&i>n?i:Math.max(0,n)},render:function(t){this.enabled&&(this.resize(),this.reset(),this.draw(t))},reset:function(){},resize:function(){}}),a=r.extend({draw:function(t){var e,i,s=this.qrious,n=this.getModuleSize(t),r=this.getOffset(t),a=this.element.getContext("2d"),o=s.positionCorner,h=s.dataCornerTL,f=s.dataCornerTR,c=s.dataCornerBR,u=s.dataCornerBL,l=s.positionSep||"D",_=s.dataSep||"D";for(e=0,a.fillStyle=s.foreground,a.globalAlpha=s.foregroundAlpha;e<t.width;e++)for(i=0;i<t.width;i++)if(t.buffer[i*t.width+e]){var d=Math.floor(n*e+r),v=Math.floor(n*i+r),p=Math.ceil(n);if(t._isBoldMasked(e,i)){if("E"===l)var d=Math.ceil(n*e+r),v=Math.ceil(n*i+r),p=Math.floor(n);a.roundRect(d,v,p,p,o)}else{if("E"===_)var d=Math.ceil(n*e+r),v=Math.ceil(n*i+r),p=Math.floor(n);a.roundRect(d,v,p,p,[h,f,c,u])}}a.fill()},reset:function(){var t=this.qrious,e=this.element.getContext("2d"),i=t.size;e.lineWidth=1,e.clearRect(0,0,i,i),e.fillStyle=t.background,e.globalAlpha=t.backgroundAlpha,e.fillRect(0,0,i,i)},resize:function(){var t=this.element;t.width=t.height=this.qrious.size}}),o=n.extend(null,{BLOCK:[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28]}),h=n.extend(null,{BLOCKS:[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,
|