├── test.js ├── tests ├── node_modules │ └── qr-code-scanner │ │ ├── test.js │ │ ├── index.js │ │ ├── index.html │ │ ├── package.json │ │ ├── README.md │ │ └── scripts │ │ ├── webqr.js │ │ ├── scanner-module.js │ │ └── scanner.js ├── index.js ├── package.json ├── index.html ├── npm-debug.log └── require.js ├── index.js ├── package.json ├── index.html ├── README.md └── scripts └── scanner.js /test.js: -------------------------------------------------------------------------------- 1 | import QRScanner from 'index.js' 2 | 3 | console.log(typeof QRScanner) -------------------------------------------------------------------------------- /tests/node_modules/qr-code-scanner/test.js: -------------------------------------------------------------------------------- 1 | import QRScanner from 'index.js' 2 | 3 | console.log(typeof QRScanner) -------------------------------------------------------------------------------- /tests/index.js: -------------------------------------------------------------------------------- 1 | let QRScanner = require('qr-code-scanner') 2 | console.log(JSON.stringify(QRScanner)) 3 | console.log('fooo') -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const QRScanner = require('./scripts/scanner.js') 2 | //export default QRScanner 3 | module.exports = QRScanner 4 | -------------------------------------------------------------------------------- /tests/node_modules/qr-code-scanner/index.js: -------------------------------------------------------------------------------- 1 | const QRScanner = require('./scripts/scanner.js') 2 | //console.log(typeof QRScanner) 3 | //export default QRScanner 4 | // 5 | module.exports = { a: 123 } 6 | -------------------------------------------------------------------------------- /tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tests", 3 | "version": "1.0.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Felipe Nascimento Moura (http://felipenmoura.com/)", 10 | "license": "ISC", 11 | "dependencies": { 12 | "qr-code-scanner": "^1.0.3" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qr-code-scanner", 3 | "version": "1.0.8", 4 | "description": "A SIMPLE qr-code scanner, that works and is simple to use. It will open the camera and wait for a match.", 5 | "main": "index.js", 6 | "repository": "https://github.com/felipenmoura/qr-code-scanner/", 7 | "keywords": [ 8 | "qrcode", 9 | "qr-code", 10 | "scanner", 11 | "reader", 12 | "decoder", 13 | "camera", 14 | "video" 15 | ], 16 | "scripts": {}, 17 | "author": "Felipe Nascimento Moura (http://felipenmoura.com/)", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/node_modules/qr-code-scanner/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/node_modules/qr-code-scanner/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "qr-code-scanner", 6 | "scope": null, 7 | "escapedName": "qr-code-scanner", 8 | "name": "qr-code-scanner", 9 | "rawSpec": "", 10 | "spec": "latest", 11 | "type": "tag" 12 | }, 13 | "/Library/WebServer/Documents/www/qr-code-scanner/tests" 14 | ] 15 | ], 16 | "_from": "qr-code-scanner@latest", 17 | "_id": "qr-code-scanner@1.0.3", 18 | "_inCache": true, 19 | "_location": "/qr-code-scanner", 20 | "_nodeVersion": "6.9.1", 21 | "_npmOperationalInternal": { 22 | "host": "packages-18-east.internal.npmjs.com", 23 | "tmp": "tmp/qr-code-scanner-1.0.3.tgz_1488656911704_0.0619359752163291" 24 | }, 25 | "_npmUser": { 26 | "name": "felipenmoura", 27 | "email": "felipenmoura@gmail.com" 28 | }, 29 | "_npmVersion": "4.1.2", 30 | "_phantomChildren": {}, 31 | "_requested": { 32 | "raw": "qr-code-scanner", 33 | "scope": null, 34 | "escapedName": "qr-code-scanner", 35 | "name": "qr-code-scanner", 36 | "rawSpec": "", 37 | "spec": "latest", 38 | "type": "tag" 39 | }, 40 | "_requiredBy": [ 41 | "#USER", 42 | "/" 43 | ], 44 | "_resolved": "https://registry.npmjs.org/qr-code-scanner/-/qr-code-scanner-1.0.3.tgz", 45 | "_shasum": "aff580c055b79818efaaab00b978b0cbe23e72c7", 46 | "_shrinkwrap": null, 47 | "_spec": "qr-code-scanner", 48 | "_where": "/Library/WebServer/Documents/www/qr-code-scanner/tests", 49 | "author": { 50 | "name": "Felipe Nascimento Moura", 51 | "email": "felipenmoura@gmail.com", 52 | "url": "http://felipenmoura.com/" 53 | }, 54 | "dependencies": {}, 55 | "description": "A SIMPLE qr-code scanner, that works and is simple to use. It will open the camera and wait for a match.", 56 | "devDependencies": {}, 57 | "directories": {}, 58 | "dist": { 59 | "shasum": "aff580c055b79818efaaab00b978b0cbe23e72c7", 60 | "tarball": "https://registry.npmjs.org/qr-code-scanner/-/qr-code-scanner-1.0.3.tgz" 61 | }, 62 | "gitHead": "db904cee14a7da832895be0ffee31b0950158487", 63 | "keywords": [ 64 | "qrcode", 65 | "qr-code", 66 | "scanner", 67 | "reader", 68 | "decoder", 69 | "camera", 70 | "video" 71 | ], 72 | "license": "MIT", 73 | "main": "index.js", 74 | "maintainers": [ 75 | { 76 | "name": "felipenmoura", 77 | "email": "felipenmoura@gmail.com" 78 | } 79 | ], 80 | "name": "qr-code-scanner", 81 | "optionalDependencies": {}, 82 | "readme": "ERROR: No README data found!", 83 | "scripts": {}, 84 | "version": "1.0.3" 85 | } 86 | -------------------------------------------------------------------------------- /tests/node_modules/qr-code-scanner/README.md: -------------------------------------------------------------------------------- 1 | ## QRCodeScanner 2 | 3 | This is a SIMPLE qr-code-scanner that will allow you to open the user's camera, scan it and match a pattern or read the string out of the QR Code. 4 | 5 | It is highly customizable for you to use it within your page's styles. 6 | 7 | ### How it works 8 | 9 | User will click a button, you will trigger the initiate method and a modal will open requesting permission to use the camera (only the first time). 10 | The user will see the camera's output. 11 | When a QRCode is found, it will trigger your _onResult_ method and close the modal. 12 | You can customize the modal and its layer. 13 | You can use a regex to match only what you expect, ensuring the result will not be garbage. 14 | 15 | ### How to use it: 16 | 17 | You can require it, or use it as global: 18 | 19 | ```js 20 | const QRScanner = require('QRScanner'); 21 | // OR 22 | window.QRScanner 23 | ``` 24 | 25 | * The global _QRScanner_ will only be created IF there is not require/define available in the page. 26 | 27 | ### API 28 | 29 | You will call the `initiate` method, sending the options, like so: 30 | 31 | ```js 32 | QRScanner.initiate({ 33 | match: /^[a-zA-Z0-9]{16,18}$/, // optional 34 | onResult: function (result) { console.info('DONE: ', result); }, 35 | onError: function (err) { console.error('ERR :::: ', err); }, // optional 36 | onTimeout: function () { console.warn('TIMEDOUT'); } // optional 37 | }) 38 | ``` 39 | 40 | #### Options 41 | 42 | In the options object, you can send: 43 | 44 | - onResult: A function to be triggered when a result is matched 45 | - onError: A function to be called in case of an error (or device not supported) [optional] 46 | - onTimeout: Your callback for the timeout event [optional] 47 | - match: A regular Expression matching what you expect to find in the QRCode (if found something but it does not match what you expected, it will not trigger the onResult) [optional] 48 | - timeout: A number in ms specifying for how long you will wait for a match. Default: 20000 [optional] 49 | - parent: The container where the video(from the camera) should be appended to. Default: document.body [optional] 50 | - lockLayerParent: The container on which the _lock-layer_ will be appended. Default: document.body [optional] 51 | - className: A CSS class added to the video container. Default: QRScanner-container [optional] 52 | - lockLayerClassName: A CSS class added to the lockLayer container. Default: QRScanner-lock-layer [optional] 53 | 54 | * LockLayer is the darker layer behind the video. 55 | 56 | ### Legacy 57 | 58 | This lib uses some ES6 features like _let, const_ and _arrow functions_, but inherits the reader from Lazar Laszlo's port of ZXing Java library. 59 | This project "cleans" some things like global variables and hardcoded ids from the previous projects, fixing some legacy problems. 60 | 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## QRCodeScanner 2 | 3 | This is a SIMPLE qr-code-scanner that will allow you to open the user's camera, scan it and match a pattern or read the string out of the QR Code. 4 | 5 | It is highly customizable for you to use it within your page's styles. 6 | 7 | ### How it works 8 | 9 | User will click a button, you will trigger the initiate method and a modal will open requesting permission to use the camera (only the first time). 10 | The user will see the camera's output. 11 | When a QRCode is found, it will trigger your _onResult_ method and close the modal. 12 | You can customize the modal and its layer. 13 | You can use a regex to match only what you expect, ensuring the result will not be garbage. 14 | 15 | ### How to use it: 16 | 17 | You can require it, or use it as global: 18 | 19 | ```js 20 | require(['qr-code-scanner'], function (QRScanner) {...}) 21 | // OR 22 | window.QRScanner 23 | ``` 24 | 25 | * The global _QRScanner_ will only be created IF there is not require/define available in the page. 26 | 27 | ### API 28 | 29 | You will call the `initiate` method, sending the options, like so: 30 | 31 | ```js 32 | QRScanner.initiate({ 33 | match: /^[a-zA-Z0-9]{16,18}$/, // optional 34 | onResult: function (result) { console.info('DONE: ', result); }, 35 | onError: function (err) { console.error('ERR :::: ', err); }, // optional 36 | onTimeout: function () { console.warn('TIMEOUT'); } // optional 37 | }) 38 | ``` 39 | 40 | #### Options 41 | 42 | In the options object, you can send: 43 | 44 | - onResult: A function to be triggered when a result is matched 45 | - onError: A function to be called in case of an error (or device not supported) [optional] 46 | - onTimeout: Your callback for the timeout event [optional] 47 | - match: A regular Expression matching what you expect to find in the QRCode (if found something but it does not match what you expected, it will not trigger the onResult) [optional] 48 | - timeout: A number in ms specifying for how long you will wait for a match. Default: 20000 [optional] 49 | - parent: The container where the video(from the camera) should be appended to. Default: document.body [optional] 50 | - lockLayerParent: The container on which the _lock-layer_ will be appended. Default: document.body [optional] 51 | - className: A CSS class added to the video container. Default: QRScanner-container [optional] 52 | - lockLayerClassName: A CSS class added to the lockLayer container. Default: QRScanner-lock-layer [optional] 53 | 54 | * LockLayer is the darker layer behind the video. 55 | 56 | ### Example 57 | 58 | ```js 59 | import QRScanner from 'qr-code-scanner'; 60 | 61 | QRScanner.initiate({ 62 | onResult: (result) => { yourCustomCallback(result); }, 63 | timeout: 10000, 64 | }); 65 | ``` 66 | 67 | ### Legacy 68 | 69 | This lib uses some ES6 features like _let, const_ and _arrow functions_, but inherits the reader from Lazar Laszlo's port of ZXing Java library. 70 | This project "cleans" some things like global variables and hardcoded ids from the previous projects, fixing some legacy problems. 71 | 72 | -------------------------------------------------------------------------------- /tests/npm-debug.log: -------------------------------------------------------------------------------- 1 | 0 info it worked if it ends with ok 2 | 1 verbose cli [ '/usr/local/bin/node', 3 | 1 verbose cli '/Users/felipenmoura/.node/bin/npm', 4 | 1 verbose cli 'publish' ] 5 | 2 info using npm@4.1.2 6 | 3 info using node@v6.9.1 7 | 4 verbose publish [ '.' ] 8 | 5 silly cache add args [ '.', null ] 9 | 6 verbose cache add spec . 10 | 7 silly cache add parsed spec Result { 11 | 7 silly cache add raw: '.', 12 | 7 silly cache add scope: null, 13 | 7 silly cache add escapedName: null, 14 | 7 silly cache add name: null, 15 | 7 silly cache add rawSpec: '.', 16 | 7 silly cache add spec: '/Library/WebServer/Documents/www/qr-code-scanner/tests', 17 | 7 silly cache add type: 'directory' } 18 | 8 verbose addLocalDirectory /Users/felipenmoura/.npm/tests/1.0.1/package.tgz not in flight; packing 19 | 9 verbose correctMkdir /Users/felipenmoura/.npm correctMkdir not in flight; initializing 20 | 10 info lifecycle tests@1.0.1~prepublish: tests@1.0.1 21 | 11 silly lifecycle tests@1.0.1~prepublish: no script for prepublish, continuing 22 | 12 info lifecycle tests@1.0.1~prepare: tests@1.0.1 23 | 13 silly lifecycle tests@1.0.1~prepare: no script for prepare, continuing 24 | 14 verbose tar pack [ '/Users/felipenmoura/.npm/tests/1.0.1/package.tgz', 25 | 14 verbose tar pack '/Library/WebServer/Documents/www/qr-code-scanner/tests' ] 26 | 15 verbose tarball /Users/felipenmoura/.npm/tests/1.0.1/package.tgz 27 | 16 verbose folder /Library/WebServer/Documents/www/qr-code-scanner/tests 28 | 17 verbose addLocalTarball adding from inside cache /Users/felipenmoura/.npm/tests/1.0.1/package.tgz 29 | 18 verbose correctMkdir /Users/felipenmoura/.npm correctMkdir not in flight; initializing 30 | 19 silly cache afterAdd tests@1.0.1 31 | 20 verbose afterAdd /Users/felipenmoura/.npm/tests/1.0.1/package/package.json not in flight; writing 32 | 21 verbose correctMkdir /Users/felipenmoura/.npm correctMkdir not in flight; initializing 33 | 22 verbose afterAdd /Users/felipenmoura/.npm/tests/1.0.1/package/package.json written 34 | 23 silly publish { name: 'tests', 35 | 23 silly publish version: '1.0.1', 36 | 23 silly publish description: '', 37 | 23 silly publish main: 'index.js', 38 | 23 silly publish scripts: { test: 'echo "Error: no test specified" && exit 1' }, 39 | 23 silly publish author: 40 | 23 silly publish { name: 'Felipe Nascimento Moura', 41 | 23 silly publish email: 'felipenmoura@gmail.com', 42 | 23 silly publish url: 'http://felipenmoura.com/' }, 43 | 23 silly publish license: 'ISC', 44 | 23 silly publish dependencies: { 'qr-code-scanner': '^1.0.3' }, 45 | 23 silly publish readme: 'ERROR: No README data found!', 46 | 23 silly publish _id: 'tests@1.0.1', 47 | 23 silly publish _shasum: '64bcf807d282ff497bf9089e8aaa54a58d98ee29', 48 | 23 silly publish _from: '.' } 49 | 24 info lifecycle tests@1.0.1~prepublishOnly: tests@1.0.1 50 | 25 silly lifecycle tests@1.0.1~prepublishOnly: no script for prepublishOnly, continuing 51 | 26 verbose getPublishConfig undefined 52 | 27 silly mapToRegistry name tests 53 | 28 silly mapToRegistry using default registry 54 | 29 silly mapToRegistry registry https://registry.npmjs.org/ 55 | 30 silly mapToRegistry data Result { 56 | 30 silly mapToRegistry raw: 'tests', 57 | 30 silly mapToRegistry scope: null, 58 | 30 silly mapToRegistry escapedName: 'tests', 59 | 30 silly mapToRegistry name: 'tests', 60 | 30 silly mapToRegistry rawSpec: '', 61 | 30 silly mapToRegistry spec: 'latest', 62 | 30 silly mapToRegistry type: 'tag' } 63 | 31 silly mapToRegistry uri https://registry.npmjs.org/tests 64 | 32 verbose publish registryBase https://registry.npmjs.org/ 65 | 33 silly publish uploading /Users/felipenmoura/.npm/tests/1.0.1/package.tgz 66 | 34 verbose request uri https://registry.npmjs.org/tests 67 | 35 verbose request sending authorization for write operation 68 | 36 info attempt registry request try #1 at 5:01:08 PM 69 | 37 verbose request using bearer token for auth 70 | 38 verbose request id 1492fb7faa6d61ed 71 | 39 http request PUT https://registry.npmjs.org/tests 72 | 40 http 403 https://registry.npmjs.org/tests 73 | 41 verbose headers { 'content-type': 'application/json', 74 | 41 verbose headers 'cache-control': 'max-age=300', 75 | 41 verbose headers 'content-length': '99', 76 | 41 verbose headers 'accept-ranges': 'bytes', 77 | 41 verbose headers date: 'Sat, 04 Mar 2017 20:01:10 GMT', 78 | 41 verbose headers via: '1.1 varnish', 79 | 41 verbose headers connection: 'keep-alive', 80 | 41 verbose headers 'x-served-by': 'cache-gru7125-GRU', 81 | 41 verbose headers 'x-cache': 'MISS', 82 | 41 verbose headers 'x-cache-hits': '0', 83 | 41 verbose headers 'x-timer': 'S1488657669.823613,VS0,VE748', 84 | 41 verbose headers vary: 'Accept-Encoding' } 85 | 42 verbose request invalidating /Users/felipenmoura/.npm/registry.npmjs.org/tests on PUT 86 | 43 error publish Failed PUT 403 87 | 44 verbose stack Error: you do not have permission to publish "tests". Are you logged in as the correct user? : tests 88 | 44 verbose stack at makeError (/Users/felipenmoura/.node/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:304:12) 89 | 44 verbose stack at CachingRegistryClient. (/Users/felipenmoura/.node/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:292:14) 90 | 44 verbose stack at Request._callback (/Users/felipenmoura/.node/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:212:14) 91 | 44 verbose stack at Request.self.callback (/Users/felipenmoura/.node/lib/node_modules/npm/node_modules/request/request.js:186:22) 92 | 44 verbose stack at emitTwo (events.js:106:13) 93 | 44 verbose stack at Request.emit (events.js:191:7) 94 | 44 verbose stack at Request. (/Users/felipenmoura/.node/lib/node_modules/npm/node_modules/request/request.js:1081:10) 95 | 44 verbose stack at emitOne (events.js:96:13) 96 | 44 verbose stack at Request.emit (events.js:188:7) 97 | 44 verbose stack at IncomingMessage. (/Users/felipenmoura/.node/lib/node_modules/npm/node_modules/request/request.js:1001:12) 98 | 45 verbose statusCode 403 99 | 46 verbose pkgid tests 100 | 47 verbose cwd /Library/WebServer/Documents/www/qr-code-scanner/tests 101 | 48 error Darwin 16.4.0 102 | 49 error argv "/usr/local/bin/node" "/Users/felipenmoura/.node/bin/npm" "publish" 103 | 50 error node v6.9.1 104 | 51 error npm v4.1.2 105 | 52 error code E403 106 | 53 error you do not have permission to publish "tests". Are you logged in as the correct user? : tests 107 | 54 error If you need help, you may report this error at: 108 | 54 error 109 | 55 verbose exit [ 1, true ] 110 | -------------------------------------------------------------------------------- /tests/require.js: -------------------------------------------------------------------------------- 1 | /** vim: et:ts=4:sw=4:sts=4 2 | * @license RequireJS 2.3.3 Copyright jQuery Foundation and other contributors. 3 | * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE 4 | */ 5 | var requirejs,require,define;!function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var i;for(i=0;i-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,function(t,n){!i&&hasProp(e,n)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function t(e){var t,i;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}function i(e,i,r){var n,o,a,s,u,c,d,p,f,l,h,m,g=i&&i.split("/"),v=y.map,x=v&&v["*"];if(e&&(e=e.split("/"),d=e.length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[d])&&(e[d]=e[d].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&g&&(m=g.slice(0,g.length-1),e=m.concat(e)),t(e),e=e.join("/")),r&&v&&(g||x)){a=e.split("/");e:for(s=a.length;s>0;s-=1){if(c=a.slice(0,s).join("/"),g)for(u=g.length;u>0;u-=1)if(o=getOwn(v,g.slice(0,u).join("/")),o&&(o=getOwn(o,c))){p=o,f=s;break e}!l&&x&&getOwn(x,c)&&(l=getOwn(x,c),h=s)}!p&&l&&(p=l,f=h),p&&(a.splice(0,f,p),e=a.join("/"))}return n=getOwn(y.pkgs,e),n?n:e}function r(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0})}function n(e){var t=getOwn(y.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(T+=1)),c=o(e),d=c[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=r?e:s&&s.normalize?s.normalize(e,function(e){return i(e,p,n)}):e.indexOf("!")===-1?i(e,p,n):e:(h=i(e,p,n),c=o(h),d=c[0],h=c[1],r=!0,a=q.nameToUrl(h))),u=!d||s||r?"":"_unnormalized"+(A+=1),{prefix:d,name:h,parentMap:t,unnormalized:!!u,url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(S,t);return i||(i=S[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(S,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e),n.error&&"error"===t?i(n.error):n.on(t,i)):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,function(t){var i=getOwn(S,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))}),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)}),globalDefQueue=[])}function p(e){delete S[e],delete k[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,n){var o=r.id,a=getOwn(S,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))}),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(k,function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1}),o&&a.length)return e=makeError("timeout","Load timeout for modules: "+a,null,a),e.contextName=q.contextName,c(e);d&&each(s,function(e){f(e,{},{})}),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,l()},50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(e=O.shift(),null===e[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},k={},M={},O=[],j={},P={},R={},T=1,A=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;return this.shim?void q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(t){e=t}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&(t=this.module,t?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;if(this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad)){var a=[];each(this.depMaps,function(e){a.push(e.normalizedMap||e)}),req.onResourceLoad(q,this.map,a)}p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return i(e,h,!0)})||""),o=a(e.prefix+"!"+l,this.map.parentMap,!0),u(o,"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),d=getOwn(S,o.id),void(d&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,function(e){this.emit("error",e)})),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):(n=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),n.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)}),c(e)}),n.fromText=bind(this,function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)}),void r.load(e.name,m,n,y))})),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,function(e){this.emit("error",e)}))}i=e.id,r=S[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(S,e.id);t&&!t.enabled&&q.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:S,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,i){return(i.indexOf("?")===-1?"?":"&")+t}}var i=y.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(R[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e}),y.shim=i),e.packages&&each(e.packages,function(e){var t,i;e="string"==typeof e?{name:e}:e,i=e.name,t=e.location,t&&(y.paths[i]=e.location),y.pkgs[i]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(S,function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))}),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,n){function o(i,r,u){var d,p,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](S[t.id]):req.get?req.get(q,i,t,o):(p=a(i,t,!1,!0),d=p.id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick(function(){v(),f=s(a(null,t)),f.skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()}),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0],a="."===o||".."===o;return n!==-1&&(!a||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(S,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(S,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,function(t,i){t[0]===e&&O.splice(i,1)}),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){var t=getOwn(S,e.id);t&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(i=O.shift(),null===i[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,a,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,n=e.split("/"),o=n.length;o>0;o-=1)if(a=n.slice(0,o).join("/"),u=getOwn(r,a)){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s+=t||(/^data\:|^blob\:|\?/.test(s)||i?"":".js"),s=("/"===s.charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs&&!/^blob\:/.test(s)?s+y.urlArgs(e,s):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);if(!n(t.id)){var i=[];return eachProp(S,function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return i.push(r),!0})}),c(makeError("scripterror",'Script error for "'+t.id+(i.length?'", needed by: '+i.join(", "):'"'),e,[t.id]))}}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.3",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),n=getOwn(contexts,a),n||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return r=req.createNode(n,t,i),r.setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,n.onNodeCreated&&n.onNodeCreated(r,n,t,i),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout(function(){},0),importScripts(i),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||mainScript.indexOf("!")!==-1||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,i){t.push(i)}),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")])),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout); -------------------------------------------------------------------------------- /tests/node_modules/qr-code-scanner/scripts/webqr.js: -------------------------------------------------------------------------------- 1 | function QRCodeDecoder (scope) { 2 | var _aa={};_aa._ab=function(f,e){var d=qrcode.width;var b=qrcode.height;var c=true;for(var g=0;gd||h<-1||h>b){throw"Error._ab "}c=false;if(a==-1){e[g]=0;c=true}else{if(a==d){e[g]=d-1;c=true}}if(h==-1){e[g+1]=0;c=true}else{if(h==b){e[g+1]=b-1;c=true}}}c=true;for(var g=e.length-2;g>=0&&c;g-=2){var a=Math.floor(e[g]);var h=Math.floor(e[g+1]);if(a<-1||a>d||h<-1||h>b){throw"Error._ab "}c=false;if(a==-1){e[g]=0;c=true}else{if(a==d){e[g]=d-1;c=true}}if(h==-1){e[g+1]=0;c=true}else{if(h==b){e[g+1]=b-1;c=true}}}};_aa._af=function(b,d,a){var k=new _ac(d);var j=new Array(d<<1);for(var f=0;f>1)+0.5;j[h+1]=i}a._ad(j);_aa._ab(b,j);try{for(var h=0;h>1,f)}}}catch(c){throw"Error._ab"}}return k};_aa._ah=function(h,o,l,k,q,p,b,a,f,e,n,m,s,r,d,c,j,i){var g=_ae._ag(l,k,q,p,b,a,f,e,n,m,s,r,d,c,j,i);return _aa._af(h,o,g)};function _a1(b,a){this.count=b;this._fc=a;this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("_dm",function(){return this._fc})}function _a2(a,c,b){this._bm=a;if(b){this._do=new Array(c,b)}else{this._do=new Array(c)}this.__defineGetter__("_bo",function(){return this._bm});this.__defineGetter__("_dn",function(){return this._bm*this._fo});this.__defineGetter__("_fo",function(){var e=0;for(var d=0;d6){o._bq(q-11,0,3,6);o._bq(0,q-11,6,3)}return o};this._bu=function(i){return this._do[i.ordinal()]}}_a3._bv=new Array(31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017);_a3.VERSIONS=_ay();_a3._av=function(a){if(a<1||a>40){throw"bad arguments"}return _a3.VERSIONS[a-1]};_a3._at=function(b){if(b%4!=1){throw"Error _at"}try{return _a3._av((b-17)>>2)}catch(a){throw"Error _av"}};_a3._aw=function(d){var b=4294967295;var f=0;for(var c=0;c<_a3._bv.length;c++){var a=_a3._bv[c];if(a==d){return this._av(c+7)}var e=_ax._gj(d,a);if(eMath.abs(c-m);if(d){var r=m;m=l;l=r;r=c;c=b;b=r}var j=Math.abs(c-m);var i=Math.abs(b-l);var p=-j>>1;var u=l0){if(g==b){break}g+=u;p-=j}}var k=c-m;var q=b-l;return Math.sqrt((k*k+q*q))};this._bh=function(i,g,h,f){var b=this._bi(i,g,h,f);var e=1;var d=i-(h-i);if(d<0){e=i/(i-d);d=0}else{if(d>=qrcode.width){e=(qrcode.width-1-i)/(d-i);d=qrcode.width-1}}var c=Math.floor(g-(f-g)*e);e=1;if(c<0){e=g/(g-c);c=0}else{if(c>=qrcode.height){e=(qrcode.height-1-g)/(c-g);c=qrcode.height-1}}d=Math.floor(i+(d-i)*e);b+=this._bi(i,g,d,c);return b-1};this._bj=function(c,d){var b=this._bh(Math.floor(c.X),Math.floor(c.Y),Math.floor(d.X),Math.floor(d.Y));var e=this._bh(Math.floor(d.X),Math.floor(d.Y),Math.floor(c.X),Math.floor(c.Y));if(isNaN(b)){return e/7}if(isNaN(e)){return b/7}return(b+e)/14};this._bk=function(d,c,b){return(this._bj(d,c)+this._bj(d,b))/2};this.distance=function(d,b){var e=d.X-b.X;var c=d.Y-b.Y;return Math.sqrt((e*e+c*c))};this._bx=function(g,f,d,e){var b=Math.round(this.distance(g,f)/e);var c=Math.round(this.distance(g,d)/e);var h=((b+c)>>1)+7;switch(h&3){case 0:h++;break;case 2:h--;break;case 3:throw"Error"}return h};this._bl=function(g,f,d,j){var k=Math.floor(j*g);var h=Math.max(0,f-k);var i=Math.min(qrcode.width-1,f+k);if(i-h0){var f=h.X-j.X+n.X;var e=h.Y-j.Y+n.Y;var c=1-3/k;var t=Math.floor(j.X+c*(f-j.X));var s=Math.floor(j.Y+c*(e-j.Y));for(var p=4;p<=16;p<<=1){l=this._bl(d,t,s,p);break}}var g=this.createTransform(j,h,n,l,r);var m=this._bz(this.image,g,r);var o;if(l==null){o=new Array(n,j,h)}else{o=new Array(n,j,h,l)}return new _bg(m,o)};this.detect=function(){var b=new _cc()._ce(this.image);return this._cd(b)}}var _ca=21522;var _cb=new Array(new Array(21522,0),new Array(20773,1),new Array(24188,2),new Array(23371,3),new Array(17913,4),new Array(16590,5),new Array(20375,6),new Array(19104,7),new Array(30660,8),new Array(29427,9),new Array(32170,10),new Array(30877,11),new Array(26159,12),new Array(25368,13),new Array(27713,14),new Array(26998,15),new Array(5769,16),new Array(5054,17),new Array(7399,18),new Array(6608,19),new Array(1890,20),new Array(597,21),new Array(3340,22),new Array(2107,23),new Array(13663,24),new Array(12392,25),new Array(16177,26),new Array(14854,27),new Array(9396,28),new Array(8579,29),new Array(11994,30),new Array(11245,31));var _ch=new Array(0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4);function _ax(a){this._cf=_cg.forBits((a>>3)&3);this._fe=(a&7);this.__defineGetter__("_cg",function(){return this._cf});this.__defineGetter__("_dx",function(){return this._fe});this.GetHashCode=function(){return(this._cf.ordinal()<<3)|_fe};this.Equals=function(c){var b=c;return this._cf==b._cf&&this._fe==b._fe}}_ax._gj=function(d,c){d^=c;return _ch[d&15]+_ch[(_ew(d,4)&15)]+_ch[(_ew(d,8)&15)]+_ch[(_ew(d,12)&15)]+_ch[(_ew(d,16)&15)]+_ch[(_ew(d,20)&15)]+_ch[(_ew(d,24)&15)]+_ch[(_ew(d,28)&15)]};_ax._ci=function(a){var b=_ax._cj(a);if(b!=null){return b}return _ax._cj(a^_ca)};_ax._cj=function(d){var b=4294967295;var a=0;for(var c=0;c<_cb.length;c++){var g=_cb[c];var f=g[0];if(f==d){return new _ax(g[1])}var e=this._gj(d,f);if(e=FOR_BITS.length){throw"bad arguments"}return FOR_BITS[a]};var L=new _cg(0,1,"L");var M=new _cg(1,0,"M");var Q=new _cg(2,3,"Q");var H=new _cg(3,2,"H");var FOR_BITS=new Array(M,L,H,Q);function _ac(d,a){if(!a){a=d}if(d<1||a<1){throw"Both dimensions must be greater than 0"}this.width=d;this.height=a;var c=d>>5;if((d&31)!=0){c++}this.rowSize=c;this.bits=new Array(c*a);for(var b=0;b>5);return((_ew(this.bits[f],(e&31)))&1)!=0};this._dq=function(e,g){var f=g*this.rowSize+(e>>5);this.bits[f]|=1<<(e&31)};this.flip=function(e,g){var f=g*this.rowSize+(e>>5);this.bits[f]^=1<<(e&31)};this.clear=function(){var e=this.bits.length;for(var f=0;fthis.height||l>this.width){throw"The region must fit inside the matrix"}for(var i=j;i>5)]|=1<<(k&31)}}}}function _dl(a,b){this._dv=a;this._dw=b;this.__defineGetter__("_du",function(){return this._dv});this.__defineGetter__("Codewords",function(){return this._dw})}_dl._gn=function(c,h,r){if(c.length!=h._dp){throw"bad arguments"}var k=h._bu(r);var e=0;var d=k._fb();for(var q=0;q=0){var v=l[b]._dw.length;if(v==t){break}b--}b++;var g=t-k._bo;var a=0;for(var q=0;q=0;c--){g=this._dk(8,c,g)}this._co=_ax._ci(g);if(this._co!=null){return this._co}var f=this._au.Dimension;g=0;var d=f-8;for(var e=f-1;e>=d;e--){g=this._dk(e,8,g)}for(var c=f-7;c>2;if(f<=6){return _a3._av(f)}var g=0;var e=h-11;for(var c=5;c>=0;c--){for(var d=h-9;d>=e;d--){g=this._dk(d,c,g)}}this._cp=_a3._aw(g);if(this._cp!=null&&this._cp._cr==h){return this._cp}g=0;for(var d=5;d>=0;d--){for(var c=h-9;c>=e;c--){g=this._dk(d,c,g)}}this._cp=_a3._aw(g);if(this._cp!=null&&this._cp._cr==h){return this._cp}throw"Error _cq"};this._gk=function(){var q=this._cm();var o=this._cq();var c=_dx._gl(q._dx);var f=this._au.Dimension;c._dj(this._au,f);var k=o._aq();var n=true;var r=new Array(o._dp);var m=0;var p=0;var h=0;for(var e=f-1;e>0;e-=2){if(e==6){e--}for(var l=0;l7){throw"bad arguments"}return _dx._dy[a]};function _fg(){this._dj=function(c,d){for(var b=0;b=Math.floor(f/2)){var x=B;var g=o;var v=e;B=k;o=j;e=i;if(B.Zero){throw"r_{i-1} was zero"}k=x;var m=this._fa.Zero;var p=B._ex(B._ec);var h=this._fa.inverse(p);while(k._ec>=B._ec&&!k.Zero){var c=k._ec-B._ec;var A=this._fa.multiply(k._ex(k._ec),h);m=m._bd(this._fa._ba(c,A));k=k._bd(B._dc(c,A))}j=m.multiply1(o)._bd(g);i=m.multiply1(e)._bd(v)}var u=i._ex(0);if(u==0){throw"ReedSolomonException sigmaTilde(0) was zero"}var d=this._fa.inverse(u);var n=i.multiply2(d);var l=k.multiply2(d);return new Array(n,l)};this._ey=function(f){var g=f._ec;if(g==1){return new Array(f._ex(1))}var b=new Array(g);var d=0;for(var c=1;c<256&&d1&&e[0]==0){var d=1;while(dn.length){var j=o;o=n;n=j}var h=new Array(n.length);var k=n.length-o.length;for(var m=0;m=l._ec&&!o.Zero){var m=o._ec-l._ec;var h=this._fa.multiply(o._ex(o._ec),n);var i=l._dc(m,h);var k=this._fa._ba(m,h);j=j._bd(k);o=o._bd(i)}return new Array(j,o)}}function _az(b){this._gh=new Array(256);this._gi=new Array(256);var a=1;for(var e=0;e<256;e++){this._gh[e]=a;a<<=1;if(a>=256){a^=b}}for(var e=0;e<255;e++){this._gi[this._gh[e]]=e}var d=new Array(1);d[0]=0;this.zero=new _bp(this,new Array(d));var c=new Array(1);c[0]=1;this.one=new _bp(this,new Array(c));this.__defineGetter__("Zero",function(){return this.zero});this.__defineGetter__("One",function(){return this.one});this._ba=function(j,f){if(j<0){throw"bad arguments"}if(f==0){return zero}var h=new Array(j+1);for(var g=0;g-1){a=[{sourceId:f.deviceId}]}}console.log(f.kind+": "+f.label+" id = "+f.deviceId)})})}catch(b){console.log(b)}}else{console.log("no navigator.mediaDevices.enumerateDevices")}if(d.getUserMedia){d.getUserMedia({video:a,audio:false},qrcode.vidSuccess,qrcode.vidError)}else{if(d.webkitGetUserMedia){qrcode.webkit=true;d.webkitGetUserMedia({video:a,audio:false},qrcode.vidSuccess,qrcode.vidError)}else{if(d.mozGetUserMedia){qrcode.moz=true;d.mozGetUserMedia({video:a,audio:false},qrcode.vidSuccess,qrcode.vidError)}}}};qrcode.decode=function(d){if(arguments.length==0){if(qrcode.canvas_qr2){var b=qrcode.canvas_qr2;var a=qrcode.qrcontext2}else{var b=document.getElementById("qr-canvas");var a=b.getContext("2d")}qrcode.width=b.width;qrcode.height=b.height;qrcode.imagedata=a.getImageData(0,0,qrcode.width,qrcode.height);qrcode.result=qrcode.process(a);if(qrcode.callback!=null){qrcode.callback(qrcode.result)}return qrcode.result}else{var c=new Image();c.crossOrigin="Anonymous";c.onload=function(){var g=document.getElementById("out-canvas");if(g!=null){var j=g.getContext("2d");j.clearRect(0,0,320,240);j.drawImage(c,0,0,320,240)}var i=document.createElement("canvas");var h=i.getContext("2d");var f=c.height;var l=c.width;if(c.width*c.height>qrcode.maxImgSize){var k=c.width/c.height;f=Math.sqrt(qrcode.maxImgSize/k);l=k*f}i.width=l;i.height=f;h.drawImage(c,0,0,i.width,i.height);qrcode.width=i.width;qrcode.height=i.height;try{qrcode.imagedata=h.getImageData(0,0,i.width,i.height)}catch(m){qrcode.result="Cross domain image reading not supported in your browser! Save it to your computer then drag and drop the file!";if(qrcode.callback!=null){qrcode.callback(qrcode.result)}return}try{qrcode.result=qrcode.process(h)}catch(m){console.log(m);qrcode.result="error decoding QR Code"}if(qrcode.callback!=null){qrcode.callback(qrcode.result)}};c.onerror=function(){if(qrcode.callback!=null){qrcode.callback("Failed to load the image")}};c.src=d}};qrcode.isUrl=function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)};qrcode.decode_url=function(b){var d="";try{d=escape(b)}catch(c){console.log(c);d=b}var a="";try{a=decodeURIComponent(d)}catch(c){console.log(c);a=d}return a};qrcode.decode_utf8=function(a){if(qrcode.isUrl(a)){return qrcode.decode_url(a)}else{return a}};qrcode.process=function(q){var a=new Date().getTime();var c=qrcode.grayScaleToBitmap(qrcode.grayscale());if(qrcode.debug){for(var m=0;mf[a][o][1]){f[a][o][1]=h}}}}}var m=new Array(c);for(var b=0;b=0){return a>>b}else{return(a>>b)+(2<<~b)}}var _gf=3;var _eh=57;var _el=8;var _eg=2;qrcode._er=function(c){function b(m,k){var n=m.X-k.X;var l=m.Y-k.Y;return Math.sqrt((n*n+l*l))}function d(k,o,n){var m=o.x;var l=o.y;return((n.x-m)*(k.y-l))-((n.y-l)*(k.x-m))}var i=b(c[0],c[1]);var f=b(c[1],c[2]);var e=b(c[0],c[2]);var a,j,h;if(f>=i&&f>=e){j=c[0];a=c[1];h=c[2]}else{if(e>=f&&e>=i){j=c[1];a=c[0];h=c[2]}else{j=c[2];a=c[0];h=c[1]}}if(d(a,j,h)<0){var g=a;a=h;h=g}c[0]=a;c[1]=j;c[2]=h};function _cz(c,a,b){this.x=c;this.y=a;this.count=1;this._aj=b;this.__defineGetter__("_ei",function(){return this._aj});this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("X",function(){return this.x});this.__defineGetter__("Y",function(){return this.y});this._ek=function(){this.count++};this._ev=function(f,e,d){if(Math.abs(e-this.y)<=f&&Math.abs(d-this.x)<=f){var g=Math.abs(f-this._aj);return g<=1||g/this._aj<=1}return false}}function _es(a){this._go=a[0];this._gu=a[1];this._gr=a[2];this.__defineGetter__("_gp",function(){return this._go});this.__defineGetter__("_gq",function(){return this._gu});this.__defineGetter__("_gs",function(){return this._gr})}function _cc(){this.image=null;this._cv=[];this._ge=false;this._al=new Array(0,0,0,0,0);this._am=null;this.__defineGetter__("_da",function(){this._al[0]=0;this._al[1]=0;this._al[2]=0;this._al[3]=0;this._al[4]=0;return this._al});this._ao=function(f){var b=0;for(var d=0;d<5;d++){var e=f[d];if(e==0){return false}b+=e}if(b<7){return false}var c=Math.floor((b<<_el)/7);var a=Math.floor(c/2);return Math.abs(c-(f[0]<<_el))=0&&c[j+f*qrcode.width]){b[2]++;f--}if(f<0){return NaN}while(f>=0&&!c[j+f*qrcode.width]&&b[1]<=d){b[1]++;f--}if(f<0||b[1]>d){return NaN}while(f>=0&&c[j+f*qrcode.width]&&b[0]<=d){b[0]++;f--}if(b[0]>d){return NaN}f=a+1;while(f=d){return NaN}while(f=d){return NaN}var e=b[0]+b[1]+b[2]+b[3]+b[4];if(5*Math.abs(e-g)>=2*g){return NaN}return this._ao(b)?this._an(b,f):NaN};this._ej=function(b,a,e,h){var d=this.image;var i=qrcode.width;var c=this._da;var g=b;while(g>=0&&d[g+a*qrcode.width]){c[2]++;g--}if(g<0){return NaN}while(g>=0&&!d[g+a*qrcode.width]&&c[1]<=e){c[1]++;g--}if(g<0||c[1]>e){return NaN}while(g>=0&&d[g+a*qrcode.width]&&c[0]<=e){c[0]++;g--}if(c[0]>e){return NaN}g=b+1;while(g=e){return NaN}while(g=e){return NaN}var f=c[0]+c[1]+c[2]+c[3]+c[4];if(5*Math.abs(f-h)>=h){return NaN}return this._ao(c)?this._an(c,g):NaN};this._cu=function(c,f,e){var d=c[0]+c[1]+c[2]+c[3]+c[4];var n=this._an(c,e);var b=this._ap(f,Math.floor(n),c[2],d);if(!isNaN(b)){n=this._ej(Math.floor(n),Math.floor(b),c[2],d);if(!isNaN(n)){var l=d/7;var m=false;var h=this._cv.length;for(var g=0;g3){var b=0;var j=0;for(var d=0;d=0;d--){var f=this._cv[d];if(Math.abs(f._ei-a)>c){this._cv.splice(d,1)}}}if(this._cv.length>3){this._cv.sort(function(k,i){if(k.count>i.count){return -1}if(k.count=_eg){if(c==null){c=a}else{this._ge=true;return Math.floor((Math.abs(c.X-a.X)-Math.abs(c.Y-a.Y))/2)}}}return 0};this._cx=function(){var g=0;var c=0;var a=this._cv.length;for(var d=0;d=_eg){g++;c+=f._ei}}if(g<3){return false}var e=c/a;var b=0;for(var d=0;dd[2]){h+=m-d[2]-a;f=k-1}}}else{do{f++}while(f=h){return false}}return true};this._ap=function(h,q,l,o){var k=this.image;var p=qrcode.height;var j=this._al;j[0]=0;j[1]=0;j[2]=0;var n=h;while(n>=0&&k[q+n*qrcode.width]&&j[1]<=l){j[1]++;n--}if(n<0||j[1]>l){return NaN}while(n>=0&&!k[q+n*qrcode.width]&&j[0]<=l){j[0]++;n--}if(j[0]>l){return NaN}n=h+1;while(nl){return NaN}while(nl){return NaN}var m=j[0]+j[1]+j[2];if(5*Math.abs(m-o)>=2*o){return NaN}return this._ao(j)?this._an(j,n):NaN};this._cu=function(l,o,n){var m=l[0]+l[1]+l[2];var t=this._an(l,n);var k=this._ap(o,Math.floor(t),2*l[1],m);if(!isNaN(k)){var s=(l[0]+l[1]+l[2])/3;var q=this._cv.length;for(var p=0;p>1);var m=new Array(0,0,0);for(var k=0;k>1):-((k+1)>>1));m[0]=0;m[1]=0;m[2]=0;var n=p;while(n=10&&a<=26){this.dataLengthMode=1}else{if(a>=27&&a<=40){this.dataLengthMode=2}}}this._gd=function(f){var k=0;if(f>(this._cw-f+1);this._cw-=f;return k}else{if(f>(8-(f-(this._cw+1))));this._cw=this._cw-f%8;if(this._cw<0){this._cw=8+this._cw}return k}else{if(f>(8-(f-(this._cw+1+8)));k=g+d+l;this._cw=this._cw-(f-8)%8;if(this._cw<0){this._cw=8+this._cw}return k}else{return 0}}}};this.NextMode=function(){if((this._ed>this.blocks.length-this._en-2)){return 0}else{return this._gd(4)}};this.getDataLength=function(d){var e=0;while(true){if((d>>e)==1){break}e++}return this._gd(qrcode._eo[this.dataLengthMode][e])};this.getRomanAndFigureString=function(h){var f=h;var g=0;var j="";var d=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":");do{if(f>1){g=this._gd(11);var i=Math.floor(g/45);var e=g%45;j+=d[i];j+=d[e];f-=2}else{if(f==1){g=this._gd(6);j+=d[g];f-=1}}}while(f>0);return j};this.getFigureString=function(f){var d=f;var e=0;var g="";do{if(d>=3){e=this._gd(10);if(e<100){g+="0"}if(e<10){g+="0"}d-=3}else{if(d==2){e=this._gd(7);if(e<10){g+="0"}d-=2}else{if(d==1){e=this._gd(4);d-=1}}}g+=e}while(d>0);return g};this.get8bitByteArray=function(g){var e=g;var f=0;var d=new Array();do{f=this._gd(8);d.push(f);e--}while(e>0);return d};this.getKanjiString=function(j){var g=j;var i=0;var h="";do{i=_gd(13);var e=i%192;var f=i/192;var k=(f<<8)+e;var d=0;if(k+33088<=40956){d=k+33088}else{d=k+49472}h+=String.fromCharCode(d);g--}while(g>0);return h};this.__defineGetter__("DataByte",function(){var h=new Array();var e=1;var f=2;var d=4;var o=8;do{var l=this.NextMode();if(l==0){if(h.length>0){break}else{throw"Empty data block"}}if(l!=e&&l!=f&&l!=d&&l!=o){throw"Invalid mode: "+l+" in (block:"+this._ed+" bit:"+this._cw+")"}var g=this.getDataLength(l);if(g<1){throw"Invalid data length: "+g}switch(l){case e:var m=this.getFigureString(g);var k=new Array(m.length);for(var i=0;id||h<-1||h>b){throw"Error._ab "}c=false;if(a==-1){e[g]=0;c=true}else{if(a==d){e[g]=d-1;c=true}}if(h==-1){e[g+1]=0;c=true}else{if(h==b){e[g+1]=b-1;c=true}}}c=true;for(var g=e.length-2;g>=0&&c;g-=2){var a=Math.floor(e[g]);var h=Math.floor(e[g+1]);if(a<-1||a>d||h<-1||h>b){throw"Error._ab "}c=false;if(a==-1){e[g]=0;c=true}else{if(a==d){e[g]=d-1;c=true}}if(h==-1){e[g+1]=0;c=true}else{if(h==b){e[g+1]=b-1;c=true}}}};_aa._af=function(b,d,a){var k=new _ac(d);var j=new Array(d<<1);for(var f=0;f>1)+0.5;j[h+1]=i}a._ad(j);_aa._ab(b,j);try{for(var h=0;h>1,f)}}}catch(c){throw"Error._ab"}}return k};_aa._ah=function(h,o,l,k,q,p,b,a,f,e,n,m,s,r,d,c,j,i){var g=_ae._ag(l,k,q,p,b,a,f,e,n,m,s,r,d,c,j,i);return _aa._af(h,o,g)};function _a1(b,a){this.count=b;this._fc=a;this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("_dm",function(){return this._fc})}function _a2(a,c,b){this._bm=a;if(b){this._do=new Array(c,b)}else{this._do=new Array(c)}this.__defineGetter__("_bo",function(){return this._bm});this.__defineGetter__("_dn",function(){return this._bm*this._fo});this.__defineGetter__("_fo",function(){var e=0;for(var d=0;d6){o._bq(q-11,0,3,6);o._bq(0,q-11,6,3)}return o};this._bu=function(i){return this._do[i.ordinal()]}}_a3._bv=new Array(31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017);_a3.VERSIONS=_ay();_a3._av=function(a){if(a<1||a>40){throw"bad arguments"}return _a3.VERSIONS[a-1]};_a3._at=function(b){if(b%4!=1){throw"Error _at"}try{return _a3._av((b-17)>>2)}catch(a){throw"Error _av"}};_a3._aw=function(d){var b=4294967295;var f=0;for(var c=0;c<_a3._bv.length;c++){var a=_a3._bv[c];if(a==d){return this._av(c+7)}var e=_ax._gj(d,a);if(eMath.abs(c-m);if(d){var r=m;m=l;l=r;r=c;c=b;b=r}var j=Math.abs(c-m);var i=Math.abs(b-l);var p=-j>>1;var u=l0){if(g==b){break}g+=u;p-=j}}var k=c-m;var q=b-l;return Math.sqrt((k*k+q*q))};this._bh=function(i,g,h,f){var b=this._bi(i,g,h,f);var e=1;var d=i-(h-i);if(d<0){e=i/(i-d);d=0}else{if(d>=qrcode.width){e=(qrcode.width-1-i)/(d-i);d=qrcode.width-1}}var c=Math.floor(g-(f-g)*e);e=1;if(c<0){e=g/(g-c);c=0}else{if(c>=qrcode.height){e=(qrcode.height-1-g)/(c-g);c=qrcode.height-1}}d=Math.floor(i+(d-i)*e);b+=this._bi(i,g,d,c);return b-1};this._bj=function(c,d){var b=this._bh(Math.floor(c.X),Math.floor(c.Y),Math.floor(d.X),Math.floor(d.Y));var e=this._bh(Math.floor(d.X),Math.floor(d.Y),Math.floor(c.X),Math.floor(c.Y));if(isNaN(b)){return e/7}if(isNaN(e)){return b/7}return(b+e)/14};this._bk=function(d,c,b){return(this._bj(d,c)+this._bj(d,b))/2};this.distance=function(d,b){var e=d.X-b.X;var c=d.Y-b.Y;return Math.sqrt((e*e+c*c))};this._bx=function(g,f,d,e){var b=Math.round(this.distance(g,f)/e);var c=Math.round(this.distance(g,d)/e);var h=((b+c)>>1)+7;switch(h&3){case 0:h++;break;case 2:h--;break;case 3:throw"Error"}return h};this._bl=function(g,f,d,j){var k=Math.floor(j*g);var h=Math.max(0,f-k);var i=Math.min(qrcode.width-1,f+k);if(i-h0){var f=h.X-j.X+n.X;var e=h.Y-j.Y+n.Y;var c=1-3/k;var t=Math.floor(j.X+c*(f-j.X));var s=Math.floor(j.Y+c*(e-j.Y));for(var p=4;p<=16;p<<=1){l=this._bl(d,t,s,p);break}}var g=this.createTransform(j,h,n,l,r);var m=this._bz(this.image,g,r);var o;if(l==null){o=new Array(n,j,h)}else{o=new Array(n,j,h,l)}return new _bg(m,o)};this.detect=function(){var b=new _cc()._ce(this.image);return this._cd(b)}}var _ca=21522;var _cb=new Array(new Array(21522,0),new Array(20773,1),new Array(24188,2),new Array(23371,3),new Array(17913,4),new Array(16590,5),new Array(20375,6),new Array(19104,7),new Array(30660,8),new Array(29427,9),new Array(32170,10),new Array(30877,11),new Array(26159,12),new Array(25368,13),new Array(27713,14),new Array(26998,15),new Array(5769,16),new Array(5054,17),new Array(7399,18),new Array(6608,19),new Array(1890,20),new Array(597,21),new Array(3340,22),new Array(2107,23),new Array(13663,24),new Array(12392,25),new Array(16177,26),new Array(14854,27),new Array(9396,28),new Array(8579,29),new Array(11994,30),new Array(11245,31));var _ch=new Array(0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4);function _ax(a){this._cf=_cg.forBits((a>>3)&3);this._fe=(a&7);this.__defineGetter__("_cg",function(){return this._cf});this.__defineGetter__("_dx",function(){return this._fe});this.GetHashCode=function(){return(this._cf.ordinal()<<3)|_fe};this.Equals=function(c){var b=c;return this._cf==b._cf&&this._fe==b._fe}}_ax._gj=function(d,c){d^=c;return _ch[d&15]+_ch[(_ew(d,4)&15)]+_ch[(_ew(d,8)&15)]+_ch[(_ew(d,12)&15)]+_ch[(_ew(d,16)&15)]+_ch[(_ew(d,20)&15)]+_ch[(_ew(d,24)&15)]+_ch[(_ew(d,28)&15)]};_ax._ci=function(a){var b=_ax._cj(a);if(b!=null){return b}return _ax._cj(a^_ca)};_ax._cj=function(d){var b=4294967295;var a=0;for(var c=0;c<_cb.length;c++){var g=_cb[c];var f=g[0];if(f==d){return new _ax(g[1])}var e=this._gj(d,f);if(e=FOR_BITS.length){throw"bad arguments"}return FOR_BITS[a]};var L=new _cg(0,1,"L");var M=new _cg(1,0,"M");var Q=new _cg(2,3,"Q");var H=new _cg(3,2,"H");var FOR_BITS=new Array(M,L,H,Q);function _ac(d,a){if(!a){a=d}if(d<1||a<1){throw"Both dimensions must be greater than 0"}this.width=d;this.height=a;var c=d>>5;if((d&31)!=0){c++}this.rowSize=c;this.bits=new Array(c*a);for(var b=0;b>5);return((_ew(this.bits[f],(e&31)))&1)!=0};this._dq=function(e,g){var f=g*this.rowSize+(e>>5);this.bits[f]|=1<<(e&31)};this.flip=function(e,g){var f=g*this.rowSize+(e>>5);this.bits[f]^=1<<(e&31)};this.clear=function(){var e=this.bits.length;for(var f=0;fthis.height||l>this.width){throw"The region must fit inside the matrix"}for(var i=j;i>5)]|=1<<(k&31)}}}}function _dl(a,b){this._dv=a;this._dw=b;this.__defineGetter__("_du",function(){return this._dv});this.__defineGetter__("Codewords",function(){return this._dw})}_dl._gn=function(c,h,r){if(c.length!=h._dp){throw"bad arguments"}var k=h._bu(r);var e=0;var d=k._fb();for(var q=0;q=0){var v=l[b]._dw.length;if(v==t){break}b--}b++;var g=t-k._bo;var a=0;for(var q=0;q=0;c--){g=this._dk(8,c,g)}this._co=_ax._ci(g);if(this._co!=null){return this._co}var f=this._au.Dimension;g=0;var d=f-8;for(var e=f-1;e>=d;e--){g=this._dk(e,8,g)}for(var c=f-7;c>2;if(f<=6){return _a3._av(f)}var g=0;var e=h-11;for(var c=5;c>=0;c--){for(var d=h-9;d>=e;d--){g=this._dk(d,c,g)}}this._cp=_a3._aw(g);if(this._cp!=null&&this._cp._cr==h){return this._cp}g=0;for(var d=5;d>=0;d--){for(var c=h-9;c>=e;c--){g=this._dk(d,c,g)}}this._cp=_a3._aw(g);if(this._cp!=null&&this._cp._cr==h){return this._cp}throw"Error _cq"};this._gk=function(){var q=this._cm();var o=this._cq();var c=_dx._gl(q._dx);var f=this._au.Dimension;c._dj(this._au,f);var k=o._aq();var n=true;var r=new Array(o._dp);var m=0;var p=0;var h=0;for(var e=f-1;e>0;e-=2){if(e==6){e--}for(var l=0;l7){throw"bad arguments"}return _dx._dy[a]};function _fg(){this._dj=function(c,d){for(var b=0;b=Math.floor(f/2)){var x=B;var g=o;var v=e;B=k;o=j;e=i;if(B.Zero){throw"r_{i-1} was zero"}k=x;var m=this._fa.Zero;var p=B._ex(B._ec);var h=this._fa.inverse(p);while(k._ec>=B._ec&&!k.Zero){var c=k._ec-B._ec;var A=this._fa.multiply(k._ex(k._ec),h);m=m._bd(this._fa._ba(c,A));k=k._bd(B._dc(c,A))}j=m.multiply1(o)._bd(g);i=m.multiply1(e)._bd(v)}var u=i._ex(0);if(u==0){throw"ReedSolomonException sigmaTilde(0) was zero"}var d=this._fa.inverse(u);var n=i.multiply2(d);var l=k.multiply2(d);return new Array(n,l)};this._ey=function(f){var g=f._ec;if(g==1){return new Array(f._ex(1))}var b=new Array(g);var d=0;for(var c=1;c<256&&d1&&e[0]==0){var d=1;while(dn.length){var j=o;o=n;n=j}var h=new Array(n.length);var k=n.length-o.length;for(var m=0;m=l._ec&&!o.Zero){var m=o._ec-l._ec;var h=this._fa.multiply(o._ex(o._ec),n);var i=l._dc(m,h);var k=this._fa._ba(m,h);j=j._bd(k);o=o._bd(i)}return new Array(j,o)}}function _az(b){this._gh=new Array(256);this._gi=new Array(256);var a=1;for(var e=0;e<256;e++){this._gh[e]=a;a<<=1;if(a>=256){a^=b}}for(var e=0;e<255;e++){this._gi[this._gh[e]]=e}var d=new Array(1);d[0]=0;this.zero=new _bp(this,new Array(d));var c=new Array(1);c[0]=1;this.one=new _bp(this,new Array(c));this.__defineGetter__("Zero",function(){return this.zero});this.__defineGetter__("One",function(){return this.one});this._ba=function(j,f){if(j<0){throw"bad arguments"}if(f==0){return zero}var h=new Array(j+1);for(var g=0;g-1){a=[{sourceId:f.deviceId}]}}})})}catch(b){}}else{console.log("no navigator.mediaDevices.enumerateDevices")}if(d.getUserMedia){d.getUserMedia({video:a,audio:false},qrcode.vidSuccess,qrcode.vidError)}else{if(d.webkitGetUserMedia){qrcode.webkit=true;d.webkitGetUserMedia({video:a,audio:false},qrcode.vidSuccess,qrcode.vidError)}else{if(d.mozGetUserMedia){qrcode.moz=true;d.mozGetUserMedia({video:a,audio:false},qrcode.vidSuccess,qrcode.vidError)}}}};qrcode.decode=function(d){if(arguments.length==0){if(qrcode.canvas_qr2){var b=qrcode.canvas_qr2;var a=qrcode.qrcontext2}else{ 6 | var b= document.getElementById("QRScanner-canvasEl") || document.getElementById("qr-canvas");var a=b.getContext("2d")}qrcode.width=b.width;qrcode.height=b.height;qrcode.imagedata=a.getImageData(0,0,qrcode.width,qrcode.height);qrcode.result=qrcode.process(a);if(qrcode.callback!=null){qrcode.callback(qrcode.result)}return qrcode.result}else{var c=new Image();c.crossOrigin="Anonymous";c.onload=function(){var g=document.getElementById("out-canvas");if(g!=null){var j=g.getContext("2d");j.clearRect(0,0,320,240);j.drawImage(c,0,0,320,240)}var i=document.createElement("canvas");var h=i.getContext("2d");var f=c.height;var l=c.width;if(c.width*c.height>qrcode.maxImgSize){var k=c.width/c.height;f=Math.sqrt(qrcode.maxImgSize/k);l=k*f}i.width=l;i.height=f;h.drawImage(c,0,0,i.width,i.height);qrcode.width=i.width;qrcode.height=i.height;try{qrcode.imagedata=h.getImageData(0,0,i.width,i.height)}catch(m){qrcode.result="Cross domain image reading not supported in your browser! Save it to your computer then drag and drop the file!";if(qrcode.callback!=null){qrcode.callback(qrcode.result)}return}try{qrcode.result=qrcode.process(h)}catch(m){qrcode.result="error decoding QR Code"}if(qrcode.callback!=null){qrcode.callback(qrcode.result)}};c.onerror=function(){if(qrcode.callback!=null){qrcode.callback("Failed to load the image")}};c.src=d}};qrcode.isUrl=function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)};qrcode.decode_url=function(b){var d="";try{d=escape(b)}catch(c){d=b}var a="";try{a=decodeURIComponent(d)}catch(c){a=d}return a};qrcode.decode_utf8=function(a){if(qrcode.isUrl(a)){return qrcode.decode_url(a)}else{return a}};qrcode.process=function(q){var a=new Date().getTime();var c=qrcode.grayScaleToBitmap(qrcode.grayscale());if(qrcode.debug){for(var m=0;mf[a][o][1]){f[a][o][1]=h}}}}}var m=new Array(c);for(var b=0;b=0){return a>>b}else{return(a>>b)+(2<<~b)}}var _gf=3;var _eh=57;var _el=8;var _eg=2;qrcode._er=function(c){function b(m,k){var n=m.X-k.X;var l=m.Y-k.Y;return Math.sqrt((n*n+l*l))}function d(k,o,n){var m=o.x;var l=o.y;return((n.x-m)*(k.y-l))-((n.y-l)*(k.x-m))}var i=b(c[0],c[1]);var f=b(c[1],c[2]);var e=b(c[0],c[2]);var a,j,h;if(f>=i&&f>=e){j=c[0];a=c[1];h=c[2]}else{if(e>=f&&e>=i){j=c[1];a=c[0];h=c[2]}else{j=c[2];a=c[0];h=c[1]}}if(d(a,j,h)<0){var g=a;a=h;h=g}c[0]=a;c[1]=j;c[2]=h};function _cz(c,a,b){this.x=c;this.y=a;this.count=1;this._aj=b;this.__defineGetter__("_ei",function(){return this._aj});this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("X",function(){return this.x});this.__defineGetter__("Y",function(){return this.y});this._ek=function(){this.count++};this._ev=function(f,e,d){if(Math.abs(e-this.y)<=f&&Math.abs(d-this.x)<=f){var g=Math.abs(f-this._aj);return g<=1||g/this._aj<=1}return false}}function _es(a){this._go=a[0];this._gu=a[1];this._gr=a[2];this.__defineGetter__("_gp",function(){return this._go});this.__defineGetter__("_gq",function(){return this._gu});this.__defineGetter__("_gs",function(){return this._gr})}function _cc(){this.image=null;this._cv=[];this._ge=false;this._al=new Array(0,0,0,0,0);this._am=null;this.__defineGetter__("_da",function(){this._al[0]=0;this._al[1]=0;this._al[2]=0;this._al[3]=0;this._al[4]=0;return this._al});this._ao=function(f){var b=0;for(var d=0;d<5;d++){var e=f[d];if(e==0){return false}b+=e}if(b<7){return false}var c=Math.floor((b<<_el)/7);var a=Math.floor(c/2);return Math.abs(c-(f[0]<<_el))=0&&c[j+f*qrcode.width]){b[2]++;f--}if(f<0){return NaN}while(f>=0&&!c[j+f*qrcode.width]&&b[1]<=d){b[1]++;f--}if(f<0||b[1]>d){return NaN}while(f>=0&&c[j+f*qrcode.width]&&b[0]<=d){b[0]++;f--}if(b[0]>d){return NaN}f=a+1;while(f=d){return NaN}while(f=d){return NaN}var e=b[0]+b[1]+b[2]+b[3]+b[4];if(5*Math.abs(e-g)>=2*g){return NaN}return this._ao(b)?this._an(b,f):NaN};this._ej=function(b,a,e,h){var d=this.image;var i=qrcode.width;var c=this._da;var g=b;while(g>=0&&d[g+a*qrcode.width]){c[2]++;g--}if(g<0){return NaN}while(g>=0&&!d[g+a*qrcode.width]&&c[1]<=e){c[1]++;g--}if(g<0||c[1]>e){return NaN}while(g>=0&&d[g+a*qrcode.width]&&c[0]<=e){c[0]++;g--}if(c[0]>e){return NaN}g=b+1;while(g=e){return NaN}while(g=e){return NaN}var f=c[0]+c[1]+c[2]+c[3]+c[4];if(5*Math.abs(f-h)>=h){return NaN}return this._ao(c)?this._an(c,g):NaN};this._cu=function(c,f,e){var d=c[0]+c[1]+c[2]+c[3]+c[4];var n=this._an(c,e);var b=this._ap(f,Math.floor(n),c[2],d);if(!isNaN(b)){n=this._ej(Math.floor(n),Math.floor(b),c[2],d);if(!isNaN(n)){var l=d/7;var m=false;var h=this._cv.length;for(var g=0;g3){var b=0;var j=0;for(var d=0;d=0;d--){var f=this._cv[d];if(Math.abs(f._ei-a)>c){this._cv.splice(d,1)}}}if(this._cv.length>3){this._cv.sort(function(k,i){if(k.count>i.count){return -1}if(k.count=_eg){if(c==null){c=a}else{this._ge=true;return Math.floor((Math.abs(c.X-a.X)-Math.abs(c.Y-a.Y))/2)}}}return 0};this._cx=function(){var g=0;var c=0;var a=this._cv.length;for(var d=0;d=_eg){g++;c+=f._ei}}if(g<3){return false}var e=c/a;var b=0;for(var d=0;dd[2]){h+=m-d[2]-a;f=k-1}}}else{do{f++}while(f=h){return false}}return true};this._ap=function(h,q,l,o){var k=this.image;var p=qrcode.height;var j=this._al;j[0]=0;j[1]=0;j[2]=0;var n=h;while(n>=0&&k[q+n*qrcode.width]&&j[1]<=l){j[1]++;n--}if(n<0||j[1]>l){return NaN}while(n>=0&&!k[q+n*qrcode.width]&&j[0]<=l){j[0]++;n--}if(j[0]>l){return NaN}n=h+1;while(nl){return NaN}while(nl){return NaN}var m=j[0]+j[1]+j[2];if(5*Math.abs(m-o)>=2*o){return NaN}return this._ao(j)?this._an(j,n):NaN};this._cu=function(l,o,n){var m=l[0]+l[1]+l[2];var t=this._an(l,n);var k=this._ap(o,Math.floor(t),2*l[1],m);if(!isNaN(k)){var s=(l[0]+l[1]+l[2])/3;var q=this._cv.length;for(var p=0;p>1);var m=new Array(0,0,0);for(var k=0;k>1):-((k+1)>>1));m[0]=0;m[1]=0;m[2]=0;var n=p;while(n=10&&a<=26){this.dataLengthMode=1}else{if(a>=27&&a<=40){this.dataLengthMode=2}}}this._gd=function(f){var k=0;if(f>(this._cw-f+1);this._cw-=f;return k}else{if(f>(8-(f-(this._cw+1))));this._cw=this._cw-f%8;if(this._cw<0){this._cw=8+this._cw}return k}else{if(f>(8-(f-(this._cw+1+8)));k=g+d+l;this._cw=this._cw-(f-8)%8;if(this._cw<0){this._cw=8+this._cw}return k}else{return 0}}}};this.NextMode=function(){if((this._ed>this.blocks.length-this._en-2)){return 0}else{return this._gd(4)}};this.getDataLength=function(d){var e=0;while(true){if((d>>e)==1){break}e++}return this._gd(qrcode._eo[this.dataLengthMode][e])};this.getRomanAndFigureString=function(h){var f=h;var g=0;var j="";var d=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":");do{if(f>1){g=this._gd(11);var i=Math.floor(g/45);var e=g%45;j+=d[i];j+=d[e];f-=2}else{if(f==1){g=this._gd(6);j+=d[g];f-=1}}}while(f>0);return j};this.getFigureString=function(f){var d=f;var e=0;var g="";do{if(d>=3){e=this._gd(10);if(e<100){g+="0"}if(e<10){g+="0"}d-=3}else{if(d==2){e=this._gd(7);if(e<10){g+="0"}d-=2}else{if(d==1){e=this._gd(4);d-=1}}}g+=e}while(d>0);return g};this.get8bitByteArray=function(g){var e=g;var f=0;var d=new Array();do{f=this._gd(8);d.push(f);e--}while(e>0);return d};this.getKanjiString=function(j){var g=j;var i=0;var h="";do{i=_gd(13);var e=i%192;var f=i/192;var k=(f<<8)+e;var d=0;if(k+33088<=40956){d=k+33088}else{d=k+49472}h+=String.fromCharCode(d);g--}while(g>0);return h};this.__defineGetter__("DataByte",function(){var h=new Array();var e=1;var f=2;var d=4;var o=8;do{var l=this.NextMode();if(l==0){if(h.length>0){break}else{throw"Empty data block"}}if(l!=e&&l!=f&&l!=d&&l!=o){throw"Invalid mode: "+l+" in (block:"+this._ed+" bit:"+this._cw+")"}var g=this.getDataLength(l);if(g<1){throw"Invalid data length: "+g}switch(l){case e:var m=this.getFigureString(g);var k=new Array(m.length);for(var i=0;i tag 30 | var style = document.createElement("style"); 31 | 32 | // Add a media (and/or media query) here if you'd like! 33 | // style.setAttribute("media", "screen") 34 | // style.setAttribute("media", "only screen and (max-width : 1024px)") 35 | 36 | // WebKit hack :( 37 | style.appendChild(document.createTextNode("")); 38 | 39 | // Add the