all files / qrcode/ qr-code-util.js

96.51% Statements 856/887
86.65% Branches 370/427
93.94% Functions 31/33
96.51% Lines 856/887
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289   509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509×     508×     509×                 509× 509×                 1002× 1002× 1002× 1002×           3005469×     3005469×   1021× 1021× 1021×   513× 513× 3004911×     509× 509× 509× 508× 508× 508× 508× 508× 508× 508× 508× 508× 508× 508× 508× 508× 508×   508×         508×         508× 508× 508× 508× 508× 508×                           508× 508× 508× 508× 508× 508× 508× 50832× 6287444× 6287444× 6287444× 5445914× 2738583×     6287444× 3004961× 3004961× 3004961× 3004906×     6287444×   50832× 50832×   508× 508×   508× 508× 508×         1110×         508× 508×   508× 508× 508× 508× 508× 508× 508× 508× 508× 508× 508× 508× 508× 506×   506×     505×       505×                 508× 508×   508×   509× 509× 509× 509× 48821× 48821× 5889357×     509× 509× 509× 509× 509× 486× 486× 2192× 2192× 11292× 11292× 9834×         509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509× 509×   1527× 1527× 1527× 10689× 10689× 10689× 10689× 10689× 10689× 10689× 7126× 7126× 7126×   3563× 3563× 3563× 3563×   10689× 10689× 10689× 10689× 10689× 10689× 10689× 7126× 7126× 7126×   3563× 3563× 3563× 3563×     1527× 509× 509× 509×   1018× 509× 509× 509×   509× 509× 509× 509×   1527× 1527× 1527× 7635× 7635× 7635× 7635× 7635× 7635× 7635× 7635× 7635× 7635× 7635× 7635×   1527× 1527× 1527× 4581× 4581× 4581× 4581× 4581× 4581× 4581× 4581× 4581× 4581× 4581× 4581×   1527× 1527× 1527×   509× 20593× 20593× 20593× 20593× 20593× 20593× 20593× 20593×   509× 509×   509× 509×   509× 509× 472944×   144723×       144544×   179×   177× 177×         509×                           509× 509× 13×       509× 509× 493× 493× 481×   160×   40× 40×   40× 40×   40× 40×   40× 40×   160×   161×   41× 41×   40× 40×   40× 40×   40× 40×   161×   160×   40× 40×   40× 40×   40× 40×   40× 40×   160×       12× 12×           11× 11×     493× 493× 9986× 493×     493×   16× 16× 15× 15×   11×   15×   15×                                                                           509× 509× 509× 509× 509× 509× 50857× 50857× 50857× 6288069× 6288069×     509× 50857× 50857× 50857× 50857× 50857× 50857× 50857× 50857×   509× 48821× 48821× 48821× 48821× 48821× 48821× 48821× 48821× 48821× 5889357× 5889357×     48821× 48821× 48821× 48821× 48821× 48821× 48821× 48821×   509× 50857× 50857× 50857× 50857× 50857× 50857× 50857× 50857×   509× 509×   509× 509× 509× 3563× 509×     3054×     3563×   509× 509× 3563× 509×     3054×     3563×   509× 509×   509× 509× 48821× 48821× 5889357×     509× 509× 12078× 1460134×   1371993× 1338583× 1338460×   1338583× 445292×       893291×     1338583×   1371993× 1371993× 1371868×   1371993× 456542×       915451×     1371993×       12078× 12078× 509×   12078× 1460134×   1373220× 1362326× 1360835×   1362326× 907564×       454762×     1362326×   1373220× 1373220× 1371472×   1373220× 915850×       457370×     1373220×         509× 48821× 5889357× 5446122× 5446122× 2707448×     2738674×           509× 4581× 4581×   509× 4072× 4072×   509× 409× 409× 409× 2454× 7362×   7362× 7362×   7362×         9834× 9834× 9834× 49170× 49170× 49170× 49170× 49170× 49170× 49170× 49170×   9834× 29502× 29502× 29502× 29502× 29502× 29502× 29502× 29502×   9834× 9834×   486× 486×   19× 19×   13× 13×   19× 19×   13× 13×   13× 13×   12× 12×   13× 13×   11× 11×   13× 13×   12× 12×   12× 12×   12× 12×   11× 11×   12× 12×   13× 13×   12× 12×   12× 12×   13× 13×   11× 11×   13× 13×   11× 11×   10× 10×       10× 10×   10× 10×   10× 10×   13× 13×   13× 13×   12× 12×   11× 11×   14× 14×   16× 16×   16× 16×   14× 14×   12× 12×   12× 12×   12× 12×   13× 13×   486×   509× 509×   164× 164× 164× 164× 164×   166× 166× 166× 166× 166×   179× 16× 16×     179× 179× 179× 179× 179×   509× 509× 136×   40× 40×   42× 42×   54× 54×     373× 195×   57× 57×   69× 69×   69× 69×       178×   67× 67×   55× 55×   56× 56×     509× 509× 6306×   509× 164× 164× 164× 301936× 301936× 301936× 100683× 100604×   79× 45×     34×   100683× 100683× 1006491× 1006491×         345× 166× 166× 166× 166× 170816× 170816× 170816× 85384×   170816× 85384× 85384× 85384× 85384× 939224× 939224×   85384×   170816× 85432× 48× 48× 48× 48× 288× 288×           179× 179× 179× 117866× 117866×   117862×               117866× 117866× 942928× 942928×       509× 509× 2036×     2034×     509× 1762× 509×     1253×     509× 6460× 237×     6223× 6223× 6223× 6223× 6223× 6223× 6223× 6223×   6223× 272×     5951× 5951× 5951× 5951× 5951× 5951× 5951× 5951×     509× 509× 509× 509× 385×   509× 509× 509× 385× 385× 385× 1488128×     509× 509× 509× 5680×   509× 385× 385× 1347328×   385× 385× 385× 4999×     509× 509× 509× 63625× 1334875× 10679000× 2997976×         509× 509× 509× 509× 509× 385×     124×   509× 509× 509× 509× 5680× 5680×   509× 385× 385× 4999× 4999×     509× 124× 2410× 11100× 88800× 88768×             385× 10654× 294591× 2356728× 2356400×             509×   100685× 100685× 100685× 100685× 301938×   100685× 1006507×   100685×   203807× 203807× 1888746×   203807×   10679× 10679× 374747×   10679×   894× 894× 894× 894× 894× 894× 10679× 10679× 374747×     894× 2997976× 373853× 373853× 373853× 373853× 9785× 9785×     2997976×   894× 894×     24753564× 24753564× 24753564×        
define(["require", "exports", "../barcode/enum/enum", "./qr-barcode-values", "./qr-error-correction", "../barcode/utility/dom-util", "../barcode/rendering/renderer"], function (require, exports, enum_1, qr_barcode_values_1, qr_error_correction_1, dom_util_1, renderer_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var QRCode = (function () {
        function QRCode() {
            this.mVersion = enum_1.QRCodeVersion.Version01;
            this.mInputMode = 'NumericMode';
            this.validInput = true;
            this.totalBits = 0;
            this.mModuleValue = [];
            this.mDataAllocationValues = [[], []];
            this.mixVersionERC = true;
            this.mixExecutablePart = null;
            this.mixDataCount = 0;
            this.mNoOfModules = 21;
            this.mIsUserMentionedMode = false;
            this.chooseDefaultMode = false;
            this.mixRemainingPart = null;
            this.isXdimension = false;
            this.mXDimension = 1;
            this.mIsEci = false;
            this.mIsUserMentionedErrorCorrectionLevel = false;
            this.mEciAssignmentNumber = 3;
            this.mIsUserMentionedVersion = false;
            this.mErrorCorrectionLevel = enum_1.ErrorCorrectionLevel.Low;
            this.textList = [];
            this.mode = [];
        }
        Object.defineProperty(QRCode.prototype, "XDimension", {
            get: function () {
                return this.mXDimension;
            },
            set: function (value) {
                this.mXDimension = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(QRCode.prototype, "inputMode", {
            get: function () {
                return this.mInputMode;
            },
            set: function (value) {
                this.mInputMode = value;
                this.mIsUserMentionedMode = true;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(QRCode.prototype, "version", {
            get: function () {
                return this.mVersion;
            },
            set: function (value) {
                this.mVersion = value;
                this.mNoOfModules = (this.mVersion - 1) * 4 + 21;
                Eif (value !== enum_1.QRCodeVersion.Auto) {
                    this.mIsUserMentionedVersion = true;
                }
            },
            enumerable: true,
            configurable: true
        });
        QRCode.prototype.getBaseAttributes = function (width, height, offSetX, offsetY, color, strokeColor) {
            var options = {
                width: width, height: height, x: offSetX, y: offsetY, color: color, strokeColor: strokeColor
            };
            return options;
        };
        QRCode.prototype.getInstance = function (id) {
            var barCode = document.getElementById(id);
            var barcodeRenderer = new renderer_1.BarcodeRenderer(barCode.id, this.isSvgMode);
            return barcodeRenderer;
        };
        QRCode.prototype.drawImage = function (canvas, options) {
            var barcodeRenderer = this.getInstance(canvas.id);
            for (var i = 0; i < options.length; i++) {
                barcodeRenderer.renderRectElement(canvas, options[parseInt(i.toString(), 10)]);
            }
        };
        QRCode.prototype.draw = function (char, canvas, height, width, margin, displayText, mode, foreColor, logo) {
            this.isSvgMode = mode;
            this.generateValues();
            if (this.validInput) {
                var size = void 0;
                var actualWidth = width - (margin.left + margin.right);
                var actualHeight = height - (margin.top + margin.bottom);
                size = (actualWidth >= actualHeight) ? actualHeight : actualWidth;
                var dimension = this.XDimension;
                var quietZone = enum_1.QuietZone.All;
                var x = (actualWidth >= size) ? (actualWidth - size) / 2 : 0;
                var y = (actualHeight >= size) ? (actualHeight - size) / 2 : 0;
                y += margin.top;
                x += margin.left;
                var textBounds = void 0;
                Eif (char && displayText.visibility) {
                    textBounds = this.drawDisplayText(canvas, x, y, size, actualHeight, displayText, char, margin, foreColor);
                    actualHeight -= (textBounds.height);
                }
                if (displayText.margin.bottom > 0) {
                    if (displayText.position === 'Top') {
                        y += (displayText.margin.bottom);
                        actualHeight -= (displayText.margin.bottom);
                    }
                    else {
                        actualHeight -= displayText.margin.bottom;
                    }
                }
                if (displayText.margin.top > 0) {
                    if (displayText.position === 'Top') {
                        y += (displayText.margin.top);
                        actualHeight -= (displayText.margin.top);
                    }
                    else {
                        actualHeight -= displayText.margin.top;
                    }
                }
                size = (actualWidth >= actualHeight) ? actualHeight : actualWidth;
                var moduleCount = this.mNoOfModules + 2 * quietZone + 1;
                dimension = size / moduleCount;
                var imageBound = null;
                var imageAttributes = null;
                if (logo !== null && logo.imageSource !== '') {
                    x = ((actualWidth >= size) ? (actualWidth - size) / 2 : 0) + margin.left;
                    var qrsize = size - (((2 * quietZone) + 1) * dimension);
                    var sizeRatio = 0.3;
                    var imgwidth = logo.width ? Math.min(logo.width, qrsize * sizeRatio) : qrsize * sizeRatio;
                    var imgheight = logo.height ? Math.min(logo.height, qrsize * sizeRatio) : qrsize * sizeRatio;
                    var ximg = (x + (quietZone * dimension)) + (qrsize / 2) - (imgwidth / 2);
                    var yimg = (y + (quietZone * dimension)) + (qrsize / 2) - (imgheight / 2);
                    imageAttributes = {
                        x: ximg,
                        y: yimg,
                        width: imgwidth,
                        height: imgheight,
                        color: 'transparent',
                        imageSource: logo.imageSource
                    };
                    imageBound = {
                        x: imageAttributes.x,
                        y: imageAttributes.y,
                        width: imageAttributes.width,
                        height: imageAttributes.height
                    };
                }
                this.isXdimension = true;
                width = (this.mNoOfModules + 2 * quietZone) * dimension;
                height = (this.mNoOfModules + 2 * quietZone) * dimension;
                var w = this.mNoOfModules + 2 * quietZone;
                var h = this.mNoOfModules + 2 * quietZone;
                var optionsCollection = [];
                for (var i = 0; i < w; i++) {
                    for (var j = 0; j < h; j++) {
                        var color = void 0;
                        color = (this.mModuleValue[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack) ? foreColor : 'white';
                        if (this.mDataAllocationValues[parseInt(j.toString(), 10)][parseInt(i.toString(), 10)].isFilled) {
                            if (this.mDataAllocationValues[parseInt(j.toString(), 10)][parseInt(i.toString(), 10)].isBlack) {
                                color = foreColor;
                            }
                        }
                        if (color !== 'white') {
                            var options = this.getBaseAttributes(dimension, dimension, x, displayText.position === 'Bottom' ? y : y + textBounds.height / 2, color);
                            var currentBound = { x: options.x, y: options.y, width: dimension, height: dimension };
                            if (imageBound == null || !this.containsRect(imageBound, currentBound)) {
                                optionsCollection.push(options);
                            }
                        }
                        x = x + dimension;
                    }
                    y = y + dimension;
                    x = ((actualWidth >= size) ? (actualWidth - size) / 2 : 0) + margin.left;
                }
                this.drawImage(canvas, optionsCollection);
                if (imageAttributes) {
                    this.drawImage(canvas, [imageAttributes]);
                }
                this.mModuleValue = undefined;
                this.mDataAllocationValues = undefined;
                return true;
            }
            else {
                return false;
            }
        };
        QRCode.prototype.containsRect = function (rect1, rect2) {
            return rect1.x <= rect2.x &&
                rect1.x + rect1.width >= rect2.x + rect2.width &&
                rect1.y <= rect2.y &&
                rect1.y + rect1.height >= rect2.y + rect2.height;
        };
        QRCode.prototype.drawText = function (canvas, options) {
            var barcodeRenderer = this.getInstance(canvas.id);
            barcodeRenderer.renderTextElement(canvas, options);
        };
        QRCode.prototype.drawDisplayText = function (canvas, x, y, width, height, text, value, margin, foreColor) {
            var displayText = text;
            dom_util_1.createMeasureElements();
            var options = this.getBaseAttributes(width, height, x, y, 'black');
            options.string = (displayText.text ? displayText.text : value);
            options.color = foreColor;
            options.fontStyle = displayText.font;
            options.stringSize = displayText.size;
            options.visibility = displayText.visibility;
            var textSize = dom_util_1.measureText(options);
            var textHeight = (textSize.height / 2) + 2;
            options.height = textHeight;
            options.x = ((x + width / 2) - textSize.width / 2) + displayText.margin.left - displayText.margin.right;
            if (text.position === 'Bottom') {
                if (text.margin.top > 0) {
                    options.y = ((y + height));
                }
                if (text.margin.bottom > 0) {
                    options.y = ((y + height)) - displayText.margin.bottom;
                }
                else {
                    Iif (margin.top < 10) {
                        options.y = height + textSize.height / 2;
                    }
                    else {
                        options.y = height + margin.top;
                    }
                }
            }
            else {
                if (text.margin.top > 0) {
                    options.y = y + text.margin.top + textSize.height / 2;
                }
                else {
                    options.y = y + textSize.height / 2;
                }
            }
            Eif (text.visibility) {
                this.drawText(canvas, options);
            }
            return options;
        };
        QRCode.prototype.generateValues = function () {
            this.mQrBarcodeValues = new qr_barcode_values_1.PdfQRBarcodeValues(this.mVersion, this.mErrorCorrectionLevel);
            this.initialize();
            this.mQrBarcodeValues = new qr_barcode_values_1.PdfQRBarcodeValues(this.mVersion, this.mErrorCorrectionLevel);
            for (var i = 0; i < this.mNoOfModules; i++) {
                this.mModuleValue.push([0]);
                for (var j = 0; j < this.mNoOfModules; j++) {
                    this.mModuleValue[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] = new ModuleValue();
                }
            }
            this.drawPDP(0, 0);
            this.drawPDP(this.mNoOfModules - 7, 0);
            this.drawPDP(0, this.mNoOfModules - 7);
            this.drawTimingPattern();
            if (this.mVersion !== 1) {
                var allignCoOrdinates = this.getAlignmentPatternCoOrdinates();
                for (var _i = 0, _a = Object.keys(allignCoOrdinates); _i < _a.length; _i++) {
                    var i = _a[_i];
                    for (var _b = 0, _c = Object.keys(allignCoOrdinates); _b < _c.length; _b++) {
                        var j = _c[_b];
                        if (!this.mModuleValue[allignCoOrdinates["" + i]][allignCoOrdinates["" + j]].isPdp) {
                            this.drawAlignmentPattern(allignCoOrdinates["" + i], allignCoOrdinates["" + j]);
                        }
                    }
                }
            }
            this.allocateFormatAndVersionInformation();
            var encodeData = null;
            encodeData = this.encodeData();
            this.dataAllocationAndMasking(encodeData);
            this.drawFormatInformation();
            this.addQuietZone();
            this.mQrBarcodeValues.FormatInformation = undefined;
            this.mQrBarcodeValues.NumberOfDataCodeWord = undefined;
            this.mQrBarcodeValues.NumberOfErrorCorrectingCodeWords = undefined;
            this.mQrBarcodeValues.VersionInformation = undefined;
            this.mQrBarcodeValues.alphanumericDataCapacityHigh = undefined;
            this.mQrBarcodeValues.alphanumericDataCapacityLow = undefined;
            this.mQrBarcodeValues.alphanumericDataCapacityMedium = undefined;
            this.mQrBarcodeValues.alphanumericDataCapacityQuartile = undefined;
            this.mQrBarcodeValues.binaryDataCapacityHigh = undefined;
            this.mQrBarcodeValues.dataCapacityValues = undefined;
            this.mQrBarcodeValues.endValues = undefined;
            this.mQrBarcodeValues.dataCapacityValues = undefined;
            this.mQrBarcodeValues = undefined;
            this.mIsUserMentionedVersion = undefined;
            this.mVersion = undefined;
        };
        QRCode.prototype.drawPDP = function (x, y) {
            var i;
            var j;
            for (i = x, j = y; i < x + 7; i++, j++) {
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isBlack = true;
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isPdp = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 6].isBlack = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 6].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 6].isPdp = true;
                if (y + 7 < this.mNoOfModules) {
                    this.mModuleValue[parseInt(i.toString(), 10)][y + 7].isBlack = false;
                    this.mModuleValue[parseInt(i.toString(), 10)][y + 7].isFilled = true;
                    this.mModuleValue[parseInt(i.toString(), 10)][y + 7].isPdp = true;
                }
                else Eif (y - 1 >= 0) {
                    this.mModuleValue[parseInt(i.toString(), 10)][y - 1].isBlack = false;
                    this.mModuleValue[parseInt(i.toString(), 10)][y - 1].isFilled = true;
                    this.mModuleValue[parseInt(i.toString(), 10)][y - 1].isPdp = true;
                }
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isBlack = true;
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isFilled = true;
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isPdp = true;
                this.mModuleValue[x + 6][parseInt(j.toString(), 10)].isBlack = true;
                this.mModuleValue[x + 6][parseInt(j.toString(), 10)].isFilled = true;
                this.mModuleValue[x + 6][parseInt(j.toString(), 10)].isPdp = true;
                if (x + 7 < this.mNoOfModules) {
                    this.mModuleValue[x + 7][parseInt(j.toString(), 10)].isBlack = false;
                    this.mModuleValue[x + 7][parseInt(j.toString(), 10)].isFilled = true;
                    this.mModuleValue[x + 7][parseInt(j.toString(), 10)].isPdp = true;
                }
                else Eif (x - 1 >= 0) {
                    this.mModuleValue[x - 1][parseInt(j.toString(), 10)].isBlack = false;
                    this.mModuleValue[x - 1][parseInt(j.toString(), 10)].isFilled = true;
                    this.mModuleValue[x - 1][parseInt(j.toString(), 10)].isPdp = true;
                }
            }
            if (x + 7 < this.mNoOfModules && y + 7 < this.mNoOfModules) {
                this.mModuleValue[x + 7][y + 7].isBlack = false;
                this.mModuleValue[x + 7][y + 7].isFilled = true;
                this.mModuleValue[x + 7][y + 7].isPdp = true;
            }
            else if (x + 7 < this.mNoOfModules && y + 7 >= this.mNoOfModules) {
                this.mModuleValue[x + 7][y - 1].isBlack = false;
                this.mModuleValue[x + 7][y - 1].isFilled = true;
                this.mModuleValue[x + 7][y - 1].isPdp = true;
            }
            else Eif (x + 7 >= this.mNoOfModules && y + 7 < this.mNoOfModules) {
                this.mModuleValue[x - 1][y + 7].isBlack = false;
                this.mModuleValue[x - 1][y + 7].isFilled = true;
                this.mModuleValue[x - 1][y + 7].isPdp = true;
            }
            x++;
            y++;
            for (i = x, j = y; i < x + 5; i++, j++) {
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isBlack = false;
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isPdp = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 4].isBlack = false;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 4].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 4].isPdp = true;
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isBlack = false;
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isFilled = true;
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isPdp = true;
                this.mModuleValue[x + 4][parseInt(j.toString(), 10)].isBlack = false;
                this.mModuleValue[x + 4][parseInt(j.toString(), 10)].isFilled = true;
                this.mModuleValue[x + 4][parseInt(j.toString(), 10)].isPdp = true;
            }
            x++;
            y++;
            for (i = x, j = y; i < x + 3; i++, j++) {
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isBlack = true;
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][parseInt(y.toString(), 10)].isPdp = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 2].isBlack = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 2].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 2].isPdp = true;
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isBlack = true;
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isFilled = true;
                this.mModuleValue[parseInt(x.toString(), 10)][parseInt(j.toString(), 10)].isPdp = true;
                this.mModuleValue[x + 2][parseInt(j.toString(), 10)].isBlack = true;
                this.mModuleValue[x + 2][parseInt(j.toString(), 10)].isFilled = true;
                this.mModuleValue[x + 2][parseInt(j.toString(), 10)].isPdp = true;
            }
            this.mModuleValue[x + 1][y + 1].isBlack = true;
            this.mModuleValue[x + 1][y + 1].isFilled = true;
            this.mModuleValue[x + 1][y + 1].isPdp = true;
        };
        QRCode.prototype.drawTimingPattern = function () {
            for (var i = 8; i < this.mNoOfModules - 8; i += 2) {
                this.mModuleValue[parseInt(i.toString(), 10)][6].isBlack = true;
                this.mModuleValue[parseInt(i.toString(), 10)][6].isFilled = true;
                this.mModuleValue[i + 1][6].isBlack = false;
                this.mModuleValue[i + 1][6].isFilled = true;
                this.mModuleValue[6][parseInt(i.toString(), 10)].isBlack = true;
                this.mModuleValue[6][parseInt(i.toString(), 10)].isFilled = true;
                this.mModuleValue[6][i + 1].isBlack = false;
                this.mModuleValue[6][i + 1].isFilled = true;
            }
            this.mModuleValue[this.mNoOfModules - 8][8].isBlack = true;
            this.mModuleValue[this.mNoOfModules - 8][8].isFilled = true;
        };
        QRCode.prototype.initialize = function () {
            Eif (!this.mIsUserMentionedMode) {
                this.chooseDefaultMode = true;
            }
            var mode = 'NumericMode';
            for (var i = 0; i < this.text.length; i++) {
                if (this.text.charCodeAt(i) < 58 && this.text.charCodeAt(i) > 47) {
                }
                else if ((this.text.charCodeAt(i) < 91 && this.text.charCodeAt(i) > 64) ||
                    this.text[parseInt(i.toString(), 10)] === '$' || this.text[parseInt(i.toString(), 10)] === '%' || this.text[parseInt(i.toString(), 10)] === '*' ||
                    this.text[parseInt(i.toString(), 10)] === '+' || this.text[parseInt(i.toString(), 10)] === '-' || this.text[parseInt(i.toString(), 10)] === '.' ||
                    this.text[parseInt(i.toString(), 10)] === '/' || this.text[parseInt(i.toString(), 10)] === ':' || this.text[parseInt(i.toString(), 10)] === ' ') {
                    mode = 'AlphaNumericMode';
                }
                else if ((this.text.charCodeAt(i) >= 65377 && this.text.charCodeAt(i) <= 65439) ||
                    (this.text.charCodeAt(i) >= 97 && this.text.charCodeAt(i) <= 122)) {
                    mode = 'BinaryMode';
                    break;
                }
                else {
                    mode = 'BinaryMode';
                    this.mIsEci = true;
                    break;
                }
            }
            Iif (this.mIsUserMentionedMode) {
                if (mode !== this.mInputMode) {
                    if (((mode === 'AlphaNumericMode' || mode === 'BinaryMode') && this.mInputMode === 'NumericMode')
                        || (mode === 'BinaryMode' && this.mInputMode === 'AlphaNumericMode')) {
                        this.validInput = false;
                        if (mode !== this.mInputMode) {
                            if (((mode === 'AlphaNumericMode' || mode === 'BinaryMode') && this.mInputMode === 'NumericMode')
                                || (mode === 'BinaryMode' && this.mInputMode === 'AlphaNumericMode')) {
                                this.validInput = false;
                            }
                        }
                    }
                }
            }
            this.inputMode = mode;
            if (this.mIsEci === true) {
                for (var i = 0; i < this.text.length; i++) {
                    if (this.text.charCodeAt(i) >= 32 && this.text.charCodeAt(i) <= 255) {
                        continue;
                    }
                }
            }
            Eif (this.mixVersionERC) {
                if (!this.mIsUserMentionedVersion || (this.mVersion & enum_1.QRCodeVersion.Auto)) {
                    var dataCapacityOfVersions = null;
                    if (this.mIsUserMentionedErrorCorrectionLevel) {
                        switch (this.mInputMode) {
                            case 'NumericMode':
                                switch (this.mErrorCorrectionLevel) {
                                    case 7:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.numericDataCapacityLow;
                                        break;
                                    case 15:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.numericDataCapacityMedium;
                                        break;
                                    case 25:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.numericDataCapacityQuartile;
                                        break;
                                    case 30:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.numericDataCapacityHigh;
                                        break;
                                }
                                break;
                            case 'AlphaNumericMode':
                                switch (this.mErrorCorrectionLevel) {
                                    case 7:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.alphanumericDataCapacityLow;
                                        break;
                                    case 15:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.alphanumericDataCapacityMedium;
                                        break;
                                    case 25:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.alphanumericDataCapacityQuartile;
                                        break;
                                    case 30:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.alphanumericDataCapacityHigh;
                                        break;
                                }
                                break;
                            case 'BinaryMode':
                                switch (this.mErrorCorrectionLevel) {
                                    case 7:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.binaryDataCapacityLow;
                                        break;
                                    case 15:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.binaryDataCapacityMedium;
                                        break;
                                    case 25:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.binaryDataCapacityQuartile;
                                        break;
                                    case 30:
                                        dataCapacityOfVersions = this.mQrBarcodeValues.binaryDataCapacityHigh;
                                        break;
                                }
                                break;
                        }
                    }
                    else {
                        this.mErrorCorrectionLevel = enum_1.ErrorCorrectionLevel.Medium;
                        switch (this.mInputMode) {
                            case 'NumericMode':
                                dataCapacityOfVersions = this.mQrBarcodeValues.numericDataCapacityMedium;
                                break;
                            case 'AlphaNumericMode':
                                dataCapacityOfVersions = this.mQrBarcodeValues.alphanumericDataCapacityMedium;
                                break;
                            case 'BinaryMode':
                                dataCapacityOfVersions = this.mQrBarcodeValues.binaryDataCapacityMedium;
                                break;
                        }
                    }
                    var i = void 0;
                    for (i = 0; i < dataCapacityOfVersions.length; i++) {
                        if (dataCapacityOfVersions[parseInt(i.toString(), 10)] > this.text.length) {
                            break;
                        }
                    }
                    this.version = i + 1;
                }
                else Eif (this.mIsUserMentionedVersion) {
                    if (this.mIsUserMentionedErrorCorrectionLevel) {
                        var capacity = 0;
                        if (this.mInputMode === 'AlphaNumericMode') {
                            capacity = this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion, this.mErrorCorrectionLevel);
                        }
                        else if (this.mInputMode === 'NumericMode') {
                            capacity = this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion, this.mErrorCorrectionLevel);
                        }
                        if (this.mInputMode === 'BinaryMode') {
                            capacity = this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion, this.mErrorCorrectionLevel);
                        }
                        Iif (capacity < this.text.length) {
                            if (!this.chooseDefaultMode) {
                                this.validInput = false;
                            }
                            else {
                                this.mixVersionERC = false;
                            }
                        }
                    }
                    else {
                        var capacityLow = 0;
                        var capacityMedium = 0;
                        var capacityQuartile = 0;
                        var capacityHigh = 0;
                        Iif (this.mInputMode === 'AlphaNumericMode') {
                            capacityLow = this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Low);
                            capacityMedium = this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Medium);
                            capacityQuartile = this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Quartile);
                            capacityHigh = this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.High);
                        }
                        else Iif (this.mInputMode === 'NumericMode') {
                            capacityLow = this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Low);
                            capacityMedium = this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Medium);
                            capacityQuartile = this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Quartile);
                            capacityHigh = this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.High);
                        }
                        else Eif (this.mInputMode === 'BinaryMode') {
                            capacityLow = this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Low);
                            capacityMedium = this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Medium);
                            capacityQuartile = this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.Quartile);
                            capacityHigh = this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion, enum_1.ErrorCorrectionLevel.High);
                        }
                        Eif (capacityHigh > this.text.length) {
                            this.mErrorCorrectionLevel = enum_1.ErrorCorrectionLevel.High;
                        }
                        else if (capacityQuartile > this.text.length) {
                            this.mErrorCorrectionLevel = enum_1.ErrorCorrectionLevel.Quartile;
                        }
                        else if (capacityMedium > this.text.length) {
                            this.mErrorCorrectionLevel = enum_1.ErrorCorrectionLevel.Medium;
                        }
                        else if (capacityLow > this.text.length) {
                            this.mErrorCorrectionLevel = enum_1.ErrorCorrectionLevel.Low;
                        }
                        else {
                            this.validInput = false;
                        }
                    }
                }
            }
        };
        QRCode.prototype.addQuietZone = function () {
            var quietZone = enum_1.QuietZone.All;
            var w = this.mNoOfModules + 2 * quietZone;
            var h = this.mNoOfModules + 2 * quietZone;
            var tempValue1 = [];
            var tempValue2 = [];
            for (var i = 0; i < w; i++) {
                tempValue1.push([0]);
                tempValue2.push([0]);
                for (var j = 0; j < h; j++) {
                    tempValue1[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] = new ModuleValue();
                    tempValue2[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] = new ModuleValue();
                }
            }
            for (var i = 0; i < h; i++) {
                tempValue1[0][parseInt(i.toString(), 10)] = new ModuleValue();
                tempValue1[0][parseInt(i.toString(), 10)].isBlack = false;
                tempValue1[0][parseInt(i.toString(), 10)].isFilled = false;
                tempValue1[0][parseInt(i.toString(), 10)].isPdp = false;
                tempValue2[0][parseInt(i.toString(), 10)] = new ModuleValue();
                tempValue2[0][parseInt(i.toString(), 10)].isBlack = false;
                tempValue2[0][parseInt(i.toString(), 10)].isFilled = false;
                tempValue2[0][parseInt(i.toString(), 10)].isPdp = false;
            }
            for (var i = quietZone; i < w - quietZone; i++) {
                tempValue1[parseInt(i.toString(), 10)][0] = new ModuleValue();
                tempValue1[parseInt(i.toString(), 10)][0].isBlack = false;
                tempValue1[parseInt(i.toString(), 10)][0].isFilled = false;
                tempValue1[parseInt(i.toString(), 10)][0].isPdp = false;
                tempValue2[parseInt(i.toString(), 10)][0] = new ModuleValue();
                tempValue2[parseInt(i.toString(), 10)][0].isBlack = false;
                tempValue2[parseInt(i.toString(), 10)][0].isFilled = false;
                tempValue2[parseInt(i.toString(), 10)][0].isPdp = false;
                for (var j = quietZone; j < h - quietZone; j++) {
                    tempValue1[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] = this.mModuleValue[i - quietZone][j - quietZone];
                    tempValue2[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] =
                        this.mDataAllocationValues[i - quietZone][j - quietZone];
                }
                tempValue1[parseInt(i.toString(), 10)][h - quietZone] = new ModuleValue();
                tempValue1[parseInt(i.toString(), 10)][h - quietZone].isBlack = false;
                tempValue1[parseInt(i.toString(), 10)][h - quietZone].isFilled = false;
                tempValue1[parseInt(i.toString(), 10)][h - quietZone].isPdp = false;
                tempValue2[parseInt(i.toString(), 10)][h - quietZone] = new ModuleValue();
                tempValue2[parseInt(i.toString(), 10)][h - quietZone].isBlack = false;
                tempValue2[parseInt(i.toString(), 10)][h - quietZone].isFilled = false;
                tempValue2[parseInt(i.toString(), 10)][h - quietZone].isPdp = false;
            }
            for (var i = 0; i < h; i++) {
                tempValue1[w - quietZone][parseInt(i.toString(), 10)] = new ModuleValue();
                tempValue1[w - quietZone][parseInt(i.toString(), 10)].isBlack = false;
                tempValue1[w - quietZone][parseInt(i.toString(), 10)].isFilled = false;
                tempValue1[w - quietZone][parseInt(i.toString(), 10)].isPdp = false;
                tempValue2[w - quietZone][parseInt(i.toString(), 10)] = new ModuleValue();
                tempValue2[w - quietZone][parseInt(i.toString(), 10)].isBlack = false;
                tempValue2[w - quietZone][parseInt(i.toString(), 10)].isFilled = false;
                tempValue2[w - quietZone][parseInt(i.toString(), 10)].isPdp = false;
            }
            this.mModuleValue = tempValue1;
            this.mDataAllocationValues = tempValue2;
        };
        QRCode.prototype.drawFormatInformation = function () {
            var formatInformation = this.mQrBarcodeValues.FormatInformation;
            var count = 0;
            for (var i = 0; i < 7; i++) {
                if (i === 6) {
                    this.mModuleValue[i + 1][8].isBlack = formatInformation[parseInt(count.toString(), 10)] === 1 ? true : false;
                }
                else {
                    this.mModuleValue[parseInt(i.toString(), 10)][8].isBlack =
                        formatInformation[parseInt(count.toString(), 10)] === 1 ? true : false;
                }
                this.mModuleValue[8][this.mNoOfModules - i - 1].isBlack = formatInformation[count++] === 1 ? true : false;
            }
            count = 14;
            for (var i = 0; i < 7; i++) {
                if (i === 6) {
                    this.mModuleValue[8][i + 1].isBlack = formatInformation[parseInt(count.toString(), 10)] === 1 ? true : false;
                }
                else {
                    this.mModuleValue[8][parseInt(i.toString(), 10)].isBlack =
                        formatInformation[parseInt(count.toString(), 10)] === 1 ? true : false;
                }
                this.mModuleValue[this.mNoOfModules - i - 1][8].isBlack = formatInformation[count--] === 1 ? true : false;
            }
            this.mModuleValue[8][8].isBlack = formatInformation[7] === 1 ? true : false;
            this.mModuleValue[8][this.mNoOfModules - 8].isBlack = formatInformation[7] === 1 ? true : false;
        };
        QRCode.prototype.dataAllocationAndMasking = function (data) {
            this.mDataAllocationValues = [];
            for (var i = 0; i < this.mNoOfModules; i++) {
                this.mDataAllocationValues.push([0]);
                for (var j = 0; j < this.mNoOfModules; j++) {
                    this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] = new ModuleValue();
                }
            }
            var point = 0;
            for (var i = this.mNoOfModules - 1; i >= 0; i -= 2) {
                for (var j = this.mNoOfModules - 1; j >= 0; j--) {
                    if (!(this.mModuleValue[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isFilled
                        && this.mModuleValue[i - 1][parseInt(j.toString(), 10)].isFilled)) {
                        if (!this.mModuleValue[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isFilled) {
                            if (point + 1 < data.length) {
                                this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack = data[point++];
                            }
                            if ((i + j) % 3 === 0) {
                                this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack =
                                    (this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack) ? true : false;
                            }
                            else {
                                this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack =
                                    (this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack) ? false : true;
                            }
                            this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isFilled = true;
                        }
                        Eif (!this.mModuleValue[i - 1][parseInt(j.toString(), 10)].isFilled) {
                            if (point + 1 < data.length) {
                                this.mDataAllocationValues[i - 1][parseInt(j.toString(), 10)].isBlack = data[point++];
                            }
                            if ((i - 1 + j) % 3 === 0) {
                                this.mDataAllocationValues[i - 1][parseInt(j.toString(), 10)].isBlack =
                                    (this.mDataAllocationValues[i - 1][parseInt(j.toString(), 10)].isBlack) ? true : false;
                            }
                            else {
                                this.mDataAllocationValues[i - 1][parseInt(j.toString(), 10)].isBlack =
                                    (this.mDataAllocationValues[i - 1][parseInt(j.toString(), 10)].isBlack) ? false : true;
                            }
                            this.mDataAllocationValues[i - 1][parseInt(j.toString(), 10)].isFilled = true;
                        }
                    }
                }
                i -= 2;
                if (i === 6) {
                    i--;
                }
                for (var k = 0; k < this.mNoOfModules; k++) {
                    if (!(this.mModuleValue[parseInt(i.toString(), 10)][parseInt(k.toString(), 10)].isFilled
                        && this.mModuleValue[i - 1][parseInt(k.toString(), 10)].isFilled)) {
                        if (!this.mModuleValue[parseInt(i.toString(), 10)][parseInt(k.toString(), 10)].isFilled) {
                            if (point + 1 < data.length) {
                                this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(k.toString(), 10)].isBlack = data[point++];
                            }
                            if ((i + k) % 3 !== 0) {
                                this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(k.toString(), 10)].isBlack =
                                    (this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(k.toString(), 10)].isBlack) ? false : true;
                            }
                            else {
                                this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(k.toString(), 10)].isBlack =
                                    (this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(k.toString(), 10)].isBlack) ? true : false;
                            }
                            this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(k.toString(), 10)].isFilled = true;
                        }
                        Eif (!this.mModuleValue[i - 1][parseInt(k.toString(), 10)].isFilled) {
                            if (point + 1 < data.length) {
                                this.mDataAllocationValues[i - 1][parseInt(k.toString(), 10)].isBlack = data[point++];
                            }
                            if ((i - 1 + k) % 3 !== 0) {
                                this.mDataAllocationValues[i - 1][parseInt(k.toString(), 10)].isBlack =
                                    (this.mDataAllocationValues[i - 1][parseInt(k.toString(), 10)].isBlack) ? false : true;
                            }
                            else {
                                this.mDataAllocationValues[i - 1][parseInt(k.toString(), 10)].isBlack =
                                    (this.mDataAllocationValues[i - 1][parseInt(k.toString(), 10)].isBlack) ? true : false;
                            }
                            this.mDataAllocationValues[i - 1][parseInt(k.toString(), 10)].isFilled = true;
                        }
                    }
                }
            }
            for (var i = 0; i < this.mNoOfModules; i++) {
                for (var j = 0; j < this.mNoOfModules; j++) {
                    if (!this.mModuleValue[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isFilled) {
                        var flag = this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack;
                        if (flag) {
                            this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack = false;
                        }
                        else {
                            this.mDataAllocationValues[parseInt(i.toString(), 10)][parseInt(j.toString(), 10)].isBlack = true;
                        }
                    }
                }
            }
        };
        QRCode.prototype.allocateFormatAndVersionInformation = function () {
            for (var i = 0; i < 9; i++) {
                this.mModuleValue[8][parseInt(i.toString(), 10)].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][8].isFilled = true;
            }
            for (var i = this.mNoOfModules - 8; i < this.mNoOfModules; i++) {
                this.mModuleValue[8][parseInt(i.toString(), 10)].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][8].isFilled = true;
            }
            if (this.mVersion > 6) {
                var versionInformation = this.mQrBarcodeValues.VersionInformation;
                var count = 0;
                for (var i = 0; i < 6; i++) {
                    for (var j = 2; j >= 0; j--) {
                        this.mModuleValue[parseInt(i.toString(), 10)][this.mNoOfModules - 9 - j].isBlack =
                            versionInformation[parseInt(count.toString(), 10)] === 1 ? true : false;
                        this.mModuleValue[parseInt(i.toString(), 10)][this.mNoOfModules - 9 - j].isFilled = true;
                        this.mModuleValue[this.mNoOfModules - 9 - j][parseInt(i.toString(), 10)].isBlack =
                            versionInformation[count++] === 1 ? true : false;
                        this.mModuleValue[this.mNoOfModules - 9 - j][parseInt(i.toString(), 10)].isFilled = true;
                    }
                }
            }
        };
        QRCode.prototype.drawAlignmentPattern = function (x, y) {
            var i;
            var j;
            for (i = x - 2, j = y - 2; i < x + 3; i++, j++) {
                this.mModuleValue[parseInt(i.toString(), 10)][y - 2].isBlack = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y - 2].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 2].isBlack = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 2].isFilled = true;
                this.mModuleValue[x - 2][parseInt(j.toString(), 10)].isBlack = true;
                this.mModuleValue[x - 2][parseInt(j.toString(), 10)].isFilled = true;
                this.mModuleValue[x + 2][parseInt(j.toString(), 10)].isBlack = true;
                this.mModuleValue[x + 2][parseInt(j.toString(), 10)].isFilled = true;
            }
            for (i = x - 1, j = y - 1; i < x + 2; i++, j++) {
                this.mModuleValue[parseInt(i.toString(), 10)][y - 1].isBlack = false;
                this.mModuleValue[parseInt(i.toString(), 10)][y - 1].isFilled = true;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 1].isBlack = false;
                this.mModuleValue[parseInt(i.toString(), 10)][y + 1].isFilled = true;
                this.mModuleValue[x - 1][parseInt(j.toString(), 10)].isBlack = false;
                this.mModuleValue[x - 1][parseInt(j.toString(), 10)].isFilled = true;
                this.mModuleValue[x + 1][parseInt(j.toString(), 10)].isBlack = false;
                this.mModuleValue[x + 1][parseInt(j.toString(), 10)].isFilled = true;
            }
            this.mModuleValue[parseInt(x.toString(), 10)][parseInt(y.toString(), 10)].isBlack = true;
            this.mModuleValue[parseInt(x.toString(), 10)][parseInt(y.toString(), 10)].isFilled = true;
        };
        QRCode.prototype.getAlignmentPatternCoOrdinates = function () {
            var allign = null;
            switch ((this.mVersion)) {
                case 2:
                    allign = [6, 18];
                    break;
                case 3:
                    allign = [6, 22];
                    break;
                case 4:
                    allign = [6, 26];
                    break;
                case 5:
                    allign = [6, 30];
                    break;
                case 6:
                    allign = [6, 34];
                    break;
                case 7:
                    allign = [6, 22, 38];
                    break;
                case 8:
                    allign = [6, 24, 42];
                    break;
                case 9:
                    allign = [6, 26, 46];
                    break;
                case 10:
                    allign = [6, 28, 50];
                    break;
                case 11:
                    allign = [6, 30, 54];
                    break;
                case 12:
                    allign = [6, 32, 58];
                    break;
                case 13:
                    allign = [6, 34, 62];
                    break;
                case 14:
                    allign = [6, 26, 46, 66];
                    break;
                case 15:
                    allign = [6, 26, 48, 70];
                    break;
                case 16:
                    allign = [6, 26, 50, 74];
                    break;
                case 17:
                    allign = [6, 30, 54, 78];
                    break;
                case 18:
                    allign = [6, 30, 56, 82];
                    break;
                case 19:
                    allign = [6, 30, 58, 86];
                    break;
                case 20:
                    allign = [6, 34, 62, 90];
                    break;
                case 21:
                    allign = [6, 28, 50, 72, 94];
                    break;
                case 22:
                    allign = [6, 26, 50, 74, 98];
                    break;
                case 23:
                    allign = [6, 30, 54, 78, 102];
                    break;
                case 24:
                    allign = [6, 28, 54, 80, 106];
                    break;
                case 25:
                    allign = [6, 32, 58, 84, 110];
                    break;
                case 26:
                    allign = [6, 30, 58, 86, 114];
                    break;
                case 27:
                    allign = [6, 34, 62, 90, 118];
                    break;
                case 28:
                    allign = [6, 26, 50, 74, 98, 122];
                    break;
                case 29:
                    allign = [6, 30, 54, 78, 102, 126];
                    break;
                case 30:
                    allign = [6, 26, 52, 78, 104, 130];
                    break;
                case 31:
                    allign = [6, 30, 56, 82, 108, 134];
                    break;
                case 32:
                    allign = [6, 34, 60, 86, 112, 138];
                    break;
                case 33:
                    allign = [6, 30, 58, 86, 114, 142];
                    break;
                case 34:
                    allign = [6, 34, 62, 90, 118, 146];
                    break;
                case 35:
                    allign = [6, 30, 54, 78, 102, 126, 150];
                    break;
                case 36:
                    allign = [6, 24, 50, 76, 102, 128, 154];
                    break;
                case 37:
                    allign = [6, 28, 54, 80, 106, 132, 158];
                    break;
                case 38:
                    allign = [6, 32, 58, 84, 110, 136, 162];
                    break;
                case 39:
                    allign = [6, 26, 54, 82, 110, 138, 166];
                    break;
                case 40:
                    allign = [6, 30, 58, 86, 114, 142, 170];
                    break;
            }
            return allign;
        };
        QRCode.prototype.encodeData = function () {
            var encodeData = [];
            switch (this.mInputMode) {
                case 'NumericMode':
                    encodeData.push(false);
                    encodeData.push(false);
                    encodeData.push(false);
                    encodeData.push(true);
                    break;
                case 'AlphaNumericMode':
                    encodeData.push(false);
                    encodeData.push(false);
                    encodeData.push(true);
                    encodeData.push(false);
                    break;
                case 'BinaryMode':
                    if (this.mIsEci) {
                        encodeData.push(false);
                        encodeData.push(true);
                        encodeData.push(true);
                        encodeData.push(true);
                        var numberInBool = this.stringToBoolArray(this.mEciAssignmentNumber.toString(), 8);
                        for (var _i = 0, _a = Object.keys(numberInBool); _i < _a.length; _i++) {
                            var x = _a[_i];
                            encodeData.push(numberInBool["" + x]);
                        }
                    }
                    encodeData.push(false);
                    encodeData.push(true);
                    encodeData.push(false);
                    encodeData.push(false);
                    break;
            }
            var numberOfBitsInCharacterCountIndicator = 0;
            if (this.mVersion < 10) {
                switch (this.mInputMode) {
                    case 'NumericMode':
                        numberOfBitsInCharacterCountIndicator = 10;
                        break;
                    case 'AlphaNumericMode':
                        numberOfBitsInCharacterCountIndicator = 9;
                        break;
                    case 'BinaryMode':
                        numberOfBitsInCharacterCountIndicator = 8;
                        break;
                }
            }
            else if (this.mVersion < 27) {
                switch (this.mInputMode) {
                    case 'NumericMode':
                        numberOfBitsInCharacterCountIndicator = 12;
                        break;
                    case 'AlphaNumericMode':
                        numberOfBitsInCharacterCountIndicator = 11;
                        break;
                    case 'BinaryMode':
                        numberOfBitsInCharacterCountIndicator = 16;
                        break;
                }
            }
            else {
                switch (this.mInputMode) {
                    case 'NumericMode':
                        numberOfBitsInCharacterCountIndicator = 14;
                        break;
                    case 'AlphaNumericMode':
                        numberOfBitsInCharacterCountIndicator = 13;
                        break;
                    case 'BinaryMode':
                        numberOfBitsInCharacterCountIndicator = 16;
                        break;
                }
            }
            var numberOfBitsInCharacterCountIndicatorInBool = this.intToBoolArray(this.text.length, numberOfBitsInCharacterCountIndicator);
            for (var i = 0; i < numberOfBitsInCharacterCountIndicator; i++) {
                encodeData.push(numberOfBitsInCharacterCountIndicatorInBool[parseInt(i.toString(), 10)]);
            }
            if (this.mInputMode === 'NumericMode') {
                var dataStringArray = this.text.split('');
                var number = '';
                for (var i = 0; i < dataStringArray.length; i++) {
                    var numberInBool = void 0;
                    number += dataStringArray[parseInt(i.toString(), 10)];
                    if (i % 3 === 2 && i !== 0 || i === dataStringArray.length - 1) {
                        if (number.toString().length === 3) {
                            numberInBool = this.stringToBoolArray(number, 10);
                        }
                        else if (number.toString().length === 2) {
                            numberInBool = this.stringToBoolArray(number, 7);
                        }
                        else {
                            numberInBool = this.stringToBoolArray(number, 4);
                        }
                        number = '';
                        for (var _b = 0, _c = Object.keys(numberInBool); _b < _c.length; _b++) {
                            var x = _c[_b];
                            encodeData.push(numberInBool["" + x]);
                        }
                    }
                }
            }
            else if (this.mInputMode === 'AlphaNumericMode') {
                var dataStringArray = this.text.split('');
                var numberInString = '';
                var number = 0;
                for (var i = 0; i < dataStringArray.length; i++) {
                    var numberInBool = void 0;
                    numberInString += dataStringArray[parseInt(i.toString(), 10)];
                    if (i % 2 === 0 && i + 1 !== dataStringArray.length) {
                        number = 45 * this.mQrBarcodeValues.getAlphaNumericValues(dataStringArray[parseInt(i.toString(), 10)]);
                    }
                    if (i % 2 === 1 && i !== 0) {
                        number += this.mQrBarcodeValues.getAlphaNumericValues(dataStringArray[parseInt(i.toString(), 10)]);
                        numberInBool = this.intToBoolArray(number, 11);
                        number = 0;
                        for (var _d = 0, _e = Object.keys(numberInBool); _d < _e.length; _d++) {
                            var x = _e[_d];
                            encodeData.push(numberInBool["" + x]);
                        }
                        numberInString = '';
                    }
                    if (i !== 1 && numberInString !== '') {
                        if (i + 1 === dataStringArray.length && numberInString.length === 1) {
                            number = this.mQrBarcodeValues.getAlphaNumericValues(dataStringArray[parseInt(i.toString(), 10)]);
                            numberInBool = this.intToBoolArray(number, 6);
                            number = 0;
                            for (var _f = 0, _g = Object.keys(numberInBool); _f < _g.length; _f++) {
                                var x = _g[_f];
                                encodeData.push(numberInBool["" + x]);
                            }
                        }
                    }
                }
            }
            else Eif (this.mInputMode === 'BinaryMode') {
                var dataStringArray = this.text.split('');
                for (var i = 0; i < dataStringArray.length; i++) {
                    var number = 0;
                    if ((this.text.charCodeAt(i) >= 32 && this.text.charCodeAt(i) <= 126) || (this.text.charCodeAt(i) >= 161 &&
                        this.text.charCodeAt(i) <= 255 || (this.text.charCodeAt(i) === 10 || this.text.charCodeAt(i) === 13))) {
                        number = dataStringArray[parseInt(i.toString(), 10)].charCodeAt(0);
                    }
                    else Iif (this.text.charCodeAt(i) >= 65377 && this.text.charCodeAt(i) <= 65439) {
                        number = dataStringArray[parseInt(i.toString(), 10)].charCodeAt(0) - 65216;
                    }
                    else Iif ((this.text.charCodeAt(i) >= 1025 && this.text.charCodeAt(i) <= 1119)) {
                        number = dataStringArray[parseInt(i.toString(), 10)].charCodeAt(0) - 864;
                    }
                    else {
                        this.validInput = false;
                    }
                    var numberInBool = this.intToBoolArray(number, 8);
                    for (var _h = 0, _j = Object.keys(numberInBool); _h < _j.length; _h++) {
                        var x = _j[_h];
                        encodeData.push(numberInBool[x]);
                    }
                }
            }
            Eif (this.mixDataCount === 0) {
                for (var i = 0; i < 4; i++) {
                    if (encodeData.length / 8 === this.mQrBarcodeValues.NumberOfDataCodeWord) {
                        break;
                    }
                    else {
                        encodeData.push(false);
                    }
                }
                for (;;) {
                    if (encodeData.length % 8 === 0) {
                        break;
                    }
                    else {
                        encodeData.push(false);
                    }
                }
                for (;;) {
                    if (encodeData.length / 8 === this.mQrBarcodeValues.NumberOfDataCodeWord) {
                        break;
                    }
                    else {
                        encodeData.push(true);
                        encodeData.push(true);
                        encodeData.push(true);
                        encodeData.push(false);
                        encodeData.push(true);
                        encodeData.push(true);
                        encodeData.push(false);
                        encodeData.push(false);
                    }
                    if (encodeData.length / 8 === this.mQrBarcodeValues.NumberOfDataCodeWord) {
                        break;
                    }
                    else {
                        encodeData.push(false);
                        encodeData.push(false);
                        encodeData.push(false);
                        encodeData.push(true);
                        encodeData.push(false);
                        encodeData.push(false);
                        encodeData.push(false);
                        encodeData.push(true);
                    }
                }
                var dataBits = this.mQrBarcodeValues.NumberOfDataCodeWord;
                var blocks = this.mQrBarcodeValues.NumberOfErrorCorrectionBlocks;
                var totalBlockSize = blocks[0];
                if (blocks.length === 6) {
                    totalBlockSize = blocks[0] + blocks[3];
                }
                var ds1 = [];
                var testEncodeData = encodeData;
                if (blocks.length === 6) {
                    var dataCodeWordLength = blocks[0] * blocks[2] * 8;
                    testEncodeData = [];
                    for (var i = 0; i < dataCodeWordLength; i++) {
                        testEncodeData.push(encodeData[parseInt(i.toString(), 10)]);
                    }
                }
                var dsOne = [];
                dsOne = this.createBlocks(testEncodeData, blocks[0]);
                for (var i = 0; i < blocks[0]; i++) {
                    ds1[parseInt(i.toString(), 10)] = this.splitCodeWord(dsOne, i, testEncodeData.length / 8 / blocks[0]);
                }
                if (blocks.length === 6) {
                    testEncodeData = [];
                    for (var i = blocks[0] * blocks[2] * 8; i < encodeData.length; i++) {
                        testEncodeData.push(encodeData[parseInt(i.toString(), 10)]);
                    }
                    var dsTwo = [];
                    dsTwo = this.createBlocks(testEncodeData, blocks[3]);
                    for (var i = blocks[0], count_1 = 0; i < totalBlockSize; i++) {
                        ds1[parseInt(i.toString(), 10)] = this.splitCodeWord(dsTwo, count_1++, testEncodeData.length / 8 / blocks[3]);
                    }
                }
                encodeData = null;
                encodeData = [];
                for (var i = 0; i < 125; i++) {
                    for (var k = 0; k < totalBlockSize; k++) {
                        for (var j = 0; j < 8; j++) {
                            if (i < ds1[parseInt(k.toString(), 10)].length) {
                                encodeData.push(ds1[parseInt(k.toString(), 10)][parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] === '1' ? true : false);
                            }
                        }
                    }
                }
                var ec = new qr_error_correction_1.ErrorCorrectionCodewords(this.mVersion, this.mErrorCorrectionLevel);
                dataBits = this.mQrBarcodeValues.NumberOfDataCodeWord;
                var eccw = this.mQrBarcodeValues.NumberOfErrorCorrectingCodeWords;
                blocks = this.mQrBarcodeValues.NumberOfErrorCorrectionBlocks;
                if (blocks.length === 6) {
                    ec.DataBits = (dataBits - blocks[3] * blocks[5]) / blocks[0];
                }
                else {
                    ec.DataBits = dataBits / blocks[0];
                }
                ec.Eccw = eccw / totalBlockSize;
                var polynomial = [];
                var count = 0;
                for (var i = 0; i < blocks[0]; i++) {
                    ec.DC = ds1[parseInt(count.toString(), 10)];
                    polynomial[count++] = ec.getErcw();
                }
                if (blocks.length === 6) {
                    ec.DataBits = (dataBits - blocks[0] * blocks[2]) / blocks[3];
                    for (var i = 0; i < blocks[3]; i++) {
                        ec.DC = ds1[parseInt(count.toString(), 10)];
                        polynomial[count++] = ec.getErcw();
                    }
                }
                if (blocks.length !== 6) {
                    for (var i = 0; i < polynomial[0].length; i++) {
                        for (var k = 0; k < blocks[0]; k++) {
                            for (var j = 0; j < 8; j++) {
                                if (i < polynomial[parseInt(k.toString(), 10)].length) {
                                    encodeData.push(polynomial[parseInt(k.toString(), 10)][parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] === '1' ? true : false);
                                }
                            }
                        }
                    }
                }
                else {
                    for (var i = 0; i < polynomial[0].length; i++) {
                        for (var k = 0; k < totalBlockSize; k++) {
                            for (var j = 0; j < 8; j++) {
                                if (i < polynomial[parseInt(k.toString(), 10)].length) {
                                    encodeData.push(polynomial[parseInt(k.toString(), 10)][parseInt(i.toString(), 10)][parseInt(j.toString(), 10)] === '1' ? true : false);
                                }
                            }
                        }
                    }
                }
            }
            return encodeData;
        };
        QRCode.prototype.stringToBoolArray = function (numberInString, noOfBits) {
            var numberInBool = [];
            var dataStringArray = numberInString.split('');
            var number = 0;
            for (var i = 0; i < dataStringArray.length; i++) {
                number = number * 10 + dataStringArray[parseInt(i.toString(), 10)].charCodeAt(0) - 48;
            }
            for (var i = 0; i < noOfBits; i++) {
                numberInBool[noOfBits - i - 1] = ((number >> i) & 1) === 1;
            }
            return numberInBool;
        };
        QRCode.prototype.intToBoolArray = function (number, noOfBits) {
            var numberInBool = [];
            for (var i = 0; i < noOfBits; i++) {
                numberInBool[noOfBits - i - 1] = ((number >> i) & 1) === 1;
            }
            return numberInBool;
        };
        QRCode.prototype.splitCodeWord = function (ds, blk, count) {
            var ds1 = [];
            for (var i = 0; i < count; i++) {
                ds1.push(ds[parseInt(blk.toString(), 10)][parseInt(i.toString(), 10)]);
            }
            return ds1;
        };
        QRCode.prototype.createBlocks = function (encodeData, noOfBlocks) {
            var ret = [];
            var cols = encodeData.length / 8 / noOfBlocks;
            var stringValue = '';
            var i = 0;
            var blockNumber = 0;
            for (var i_1 = 0; i_1 < noOfBlocks; i_1++) {
                ret.push([0]);
                for (var j = 0; j < cols; j++) {
                    ret[parseInt(i_1.toString(), 10)][parseInt(j.toString(), 10)] = '';
                }
            }
            for (var j = 0; j < encodeData.length; j++) {
                if (j % 8 === 0 && j !== 0) {
                    ret[parseInt(blockNumber.toString(), 10)][parseInt(i.toString(), 10)] = stringValue;
                    stringValue = '';
                    i++;
                    if (i === (encodeData.length / noOfBlocks / 8)) {
                        blockNumber++;
                        i = 0;
                    }
                }
                stringValue += encodeData[parseInt(j.toString(), 10)] ? '1' : '0';
            }
            ret[parseInt(blockNumber.toString(), 10)][parseInt(i.toString(), 10)] = stringValue;
            return ret;
        };
        return QRCode;
    }());
    exports.QRCode = QRCode;
    var ModuleValue = (function () {
        function ModuleValue() {
            this.isBlack = false;
            this.isFilled = false;
            this.isPdp = false;
        }
        return ModuleValue;
    }());
    exports.ModuleValue = ModuleValue;
});