From d449961acae84fc37e1745e85aa150d2f7ba69c1 Mon Sep 17 00:00:00 2001 From: Roland Groen Date: Tue, 7 May 2019 00:07:54 +0200 Subject: [PATCH] The migration of the simplesamlphp-module-authirma plugin from the irma_api_server (https://github.com/privacybydesign/irma_api_server) to the new irmago server API (https://github.com/privacybydesign/irmago). The following changes have been applied: - The new irmajs library has been integrated, https://github.com/privacybydesign/irmajs in favor of https://github.com/credentials/irma_js. - The new API endpoints have been updated. - The session now created at the moment the button is clicked, instead of before, preventing timeout issues and refresh problems. The session endpoint is get_irma_session.php. - A missing dependency is added in composer.json. - Removal of the irma_web_server configuration setting - Fixing Undefined index: IRMA_INVALIDCREDENTIALS in /var/simplesamlphp/lib/SimpleSAML/Error/ErrorCodes.php --- composer.json | 3 +- docs/authirma.md | 1 - lib/Auth/Source/IRMA.php | 16 +++----- www/get_irma_session.php | 64 +++++++++++++++++++++++++++++++ www/irmalogin.php | 49 ++++++----------------- www/resources/irma.js | 9 +++++ www/resources/jquery-3.4.0.min.js | 2 + www/resources/verify.js | 50 +++++++++++++++--------- 8 files changed, 126 insertions(+), 68 deletions(-) create mode 100644 www/get_irma_session.php create mode 100644 www/resources/irma.js create mode 100644 www/resources/jquery-3.4.0.min.js diff --git a/composer.json b/composer.json index aec88dc..b037b74 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "license": "MIT", "require": { "simplesamlphp/composer-module-installer": "~1.0", - "firebase/php-jwt": "^4.0" + "firebase/php-jwt": "^4.0", + "ext-json": "*" } } diff --git a/docs/authirma.md b/docs/authirma.md index 2298769..685a43f 100644 --- a/docs/authirma.md +++ b/docs/authirma.md @@ -17,7 +17,6 @@ For example: 'irma' => array( 'authirma:IRMA', 'irma_api_server' => 'https://example.com', - 'irma_web_server' => 'https://example.com', 'jwt_privatekeyfile' => 'surfnet-idp-sk.pem', 'jwt_apiserver_publickeyfile' => 'apiserver-pk.pem', "issuer_id" => "my_issuer_id", diff --git a/lib/Auth/Source/IRMA.php b/lib/Auth/Source/IRMA.php index 7b00ab2..e11c8df 100644 --- a/lib/Auth/Source/IRMA.php +++ b/lib/Auth/Source/IRMA.php @@ -31,7 +31,6 @@ class sspmod_authirma_Auth_Source_IRMA extends SimpleSAML_Auth_Source { public $issuer_displayname; public $requested_attributes; public $irma_api_server; - public $irma_web_server; /** * Constructor for this authentication source. @@ -65,9 +64,6 @@ public function __construct($info, &$config) { if (array_key_exists('irma_api_server', $config)) { $this->irma_api_server = $config['irma_api_server']; } - if (array_key_exists('irma_web_server', $config)) { - $this->irma_web_server = $config['irma_web_server']; - } return; } @@ -125,8 +121,8 @@ public static function handleLogin($authStateId, $irma_result) { * username/password - if it is, we pass that error up to the login form, * if not, we let the generic error handler deal with it. */ - if ($e->getErrorCode() === 'IRMA_INVALIDCREDENTIALS' - || $e->getErrorCode() === 'IRMA_EXPIREDCREDENTIALS') { // TODO + if ($e->getErrorCode() === 'RESPONSESTATUSNOSUCCESS' + || $e->getErrorCode() === 'USERABORTED') { // TODO return $e->getErrorCode(); } /* Some other error occurred. Rethrow exception and let the generic error @@ -145,7 +141,7 @@ public static function handleLogin($authStateId, $irma_result) { * * On a successful login, this function should return the users attributes. On failure, * it should throw an exception. If the error was due to invalid IRMA credentials, - * a SimpleSAML_Error_Error('IRMA_INVALIDCREDENTIALS') should be thrown. + * a SimpleSAML_Error_Error('RESPONSESTATUSNOSUCCESS') should be thrown. * * @param string $irma_result The JWT token from the IRMA API server. * @return array Associative array with the users attributes. @@ -162,15 +158,15 @@ protected function login($irma_credential) { // validate IRMA credentials $decoded = (array) JWT::decode($irma_credential,$pubkey,array('RS256')); if ($decoded["status"] === "EXPIRED") - throw new SimpleSAML_Error_Error('IRMA_EXPIREDCREDENTIALS'); + throw new SimpleSAML_Error_Error('USERABORTED'); elseif ($decoded["status"] !== "VALID") - throw new SimpleSAML_Error_Error('IRMA_INVALIDCREDENTIALS'); + throw new SimpleSAML_Error_Error('RESPONSESTATUSNOSUCCESS'); $attributes = (array) $decoded['attributes']; } catch (SimpleSAML_Error_Error $e) { throw $e; } catch (Exception $e) { SimpleSAML\Logger::info('authirma:' . $this->authId . ': Validation error (IRMA credential ' . $irma_credential . ')'); - throw new SimpleSAML_Error_Error('IRMA_INVALIDCREDENTIALS', $e); + throw new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $e); } SimpleSAML\Logger::info('authirma:' . $this->authId . ': IRMA credential ' . $irma_credential . ' validated successfully'); return $attributes; diff --git a/www/get_irma_session.php b/www/get_irma_session.php new file mode 100644 index 0000000..7d0df36 --- /dev/null +++ b/www/get_irma_session.php @@ -0,0 +1,64 @@ +jwt_privatekeyfile); + $pk = openssl_pkey_get_private("file://$filename"); + if ($pk === false) + throw new Exception("Failed to load signing key"); + return $pk; +} + +function get_jwt($source) { + $sprequest = [ + "sub" => "verification_request", + "iss" => $source->issuer_id, + "iat" => time(), + "sprequest" => [ + "validity" => 60, + "request" => [ + "content" => $source->requested_attributes + ] + ] + ]; + return JWT::encode($sprequest, get_jwt_key($source), "RS256", $source->issuer_id); +} + +if (!array_key_exists('AuthState', $_REQUEST)) { + throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.'); +} +$authStateId = $_REQUEST['AuthState']; + +$state = SimpleSAML_Auth_State::loadState($authStateId, sspmod_authirma_Auth_Source_IRMA::STAGEID); +assert('array_key_exists(sspmod_authirma_Auth_Source_IRMA::AUTHID, $state)'); +$source = SimpleSAML_Auth_Source::getById($state[sspmod_authirma_Auth_Source_IRMA::AUTHID]); +if ($source === NULL) { + throw new Exception('Could not find authentication source with id ' . $state[sspmod_authirma_Auth_Source_IRMA::AUTHID]); +} + +$verification_jwt = get_jwt($source); +$irma_api_server = $source->irma_api_server; +$url = $source->irma_api_server . "/session"; +// use key 'http' even if you send the request to https://... +$options = array( + 'http' => array( + 'header' => "Content-type: text/plain\r\n", + 'method' => 'POST', + 'content' => $verification_jwt + ) +); +$context = stream_context_create($options); +$result = file_get_contents($url, false, $context); + +header("Content-Type: application/json"); + +echo $result; diff --git a/www/irmalogin.php b/www/irmalogin.php index f7f2829..f3dcd9c 100644 --- a/www/irmalogin.php +++ b/www/irmalogin.php @@ -9,31 +9,6 @@ * @package SimpleSAMLphp **/ -use \Firebase\JWT\JWT; - -function get_jwt_key($source) { - $filename = \SimpleSAML\Utils\Config::getCertPath($source->jwt_privatekeyfile); - $pk = openssl_pkey_get_private("file://$filename"); - if ($pk === false) - throw new Exception("Failed to load signing key"); - return $pk; -} - -function get_jwt($source) { - $sprequest = [ - "sub" => "verification_request", - "iss" => $source->issuer_displayname, - "iat" => time(), - "sprequest" => [ - "validity" => 60, - "request" => [ - "content" => $source->requested_attributes - ] - ] - ]; - return JWT::encode($sprequest, get_jwt_key($source), "RS256", $source->issuer_id); -} - if (!array_key_exists('AuthState', $_REQUEST)) { throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.'); } @@ -59,8 +34,6 @@ function get_jwt($source) { $errorCode = NULL; } -$verification_jwt = get_jwt($source); - $globalConfig = SimpleSAML_Configuration::getInstance(); $t = new SimpleSAML_XHTML_Template($globalConfig, 'authirma:irmalogin.php'); $t->data['stateparams'] = array('AuthState' => $authStateId); @@ -71,21 +44,21 @@ function get_jwt($source) { if (!isset($t->data['head'])) $t->data['head'] = ''; $t->data['head'] .= << - - - - - + + + - + IRMAHEADERS; $t->data['errorcodes'] = SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); -$t->data['errorcodes']['title']['IRMA_INVALIDCREDENTIALS'] = '{authirma:irma:title_error_invalid}'; -$t->data['errorcodes']['title']['IRMA_EXPIREDCREDENTIALS'] = '{authirma:irma:title_error_expired}'; -$t->data['errorcodes']['descr']['IRMA_INVALIDCREDENTIALS'] = '{authirma:irma:descr_error_invalid}'; -$t->data['errorcodes']['descr']['IRMA_EXPIREDCREDENTIALS'] = '{authirma:irma:descr_error_expired}'; +$t->data['errorcodes']['title']['RESPONSESTATUSNOSUCCESS'] = '{authirma:irma:title_error_invalid}'; +$t->data['errorcodes']['title']['USERABORTED'] = '{authirma:irma:title_error_expired}'; +$t->data['errorcodes']['descr']['RESPONSESTATUSNOSUCCESS'] = '{authirma:irma:descr_error_invalid}'; +$t->data['errorcodes']['descr']['USERABORTED'] = '{authirma:irma:descr_error_expired}'; $t->show(); exit(); diff --git a/www/resources/irma.js b/www/resources/irma.js new file mode 100644 index 0000000..c95ceeb --- /dev/null +++ b/www/resources/irma.js @@ -0,0 +1,9 @@ +var irma=function(t){function e(e){for(var n,o,i=e[0],a=e[1],s=0,c=[];s40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return r[t]},e.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(t){return n(t)}},function(t,e,n){var r=n(9),o=n(10);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!r.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return o.testNumeric(t)?e.NUMERIC:o.testAlphanumeric(t)?e.ALPHANUMERIC:o.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return n}}},function(t,e,n){"use strict";var r=n(3);i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}();var o=i.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function i(t,e,n){return i.TYPED_ARRAY_SUPPORT||this instanceof i?"number"==typeof t?u(this,t):function(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return function(t,e,n,r){if(n<0||e.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function s(t,e){var n;return i.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(e)).__proto__=i.prototype:(null===(n=t)&&(n=new i(e)),n.length=e),n}function u(t,e){var n=s(t,e<0?0:0|a(e));if(!i.TYPED_ARRAY_SUPPORT)for(var r=0;r55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function l(t){return i.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:f(t).length)}i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),i.prototype.write=function(t,e,n){void 0===e?(n=this.length,e=0):void 0===n&&"string"==typeof e?(n=this.length,e=0):isFinite(e)&&(e|=0,isFinite(n)?n|=0:n=void 0);var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(t,e,n,r){return function(t,e,n,r){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}(f(e,t.length-n),t,n,r)}(this,t,e,n)},i.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o=0&&t.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return n}}},function(t,e,n){n(19),t.exports=self.fetch.bind(self)},function(t,e,n){var r=n(20),o=n(22),i=n(39),a=n(40);function s(t,e,n,i,a){var s=[].slice.call(arguments,1),u=s.length,c="function"==typeof s[u-1];if(!c&&!r())throw new Error("Callback required as last argument");if(!c){if(u<1)throw new Error("Too few arguments provided");return 1===u?(n=e,e=i=void 0):2!==u||e.getContext||(i=n,n=e,e=void 0),new Promise(function(r,a){try{var s=o.create(n,i);r(t(s,e,i))}catch(t){a(t)}})}if(u<2)throw new Error("Too few arguments provided");2===u?(a=n,n=e,e=i=void 0):3===u&&(e.getContext&&void 0===a?(a=i,i=void 0):(a=i,i=n,n=e,e=void 0));try{var f=o.create(n,i);a(null,t(f,e,i))}catch(t){a(t)}}e.create=o.create,e.toCanvas=s.bind(null,i.render),e.toDataURL=s.bind(null,i.renderToDataURL),e.toString=s.bind(null,function(t,e,n){return a.render(t,n)})},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(4),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(t,e){switch(e){case r.L:return o[4*(t-1)+0];case r.M:return o[4*(t-1)+1];case r.Q:return o[4*(t-1)+2];case r.H:return o[4*(t-1)+3];default:return}},e.getTotalCodewordsCount=function(t,e){switch(e){case r.L:return i[4*(t-1)+0];case r.M:return i[4*(t-1)+1];case r.Q:return i[4*(t-1)+2];case r.H:return i[4*(t-1)+3];default:return}}},function(t,e){e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},function(t,e){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",r="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=new RegExp(n,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(r,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+n+"$"),i=new RegExp("^[0-9]+$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return o.test(t)},e.testNumeric=function(t){return i.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},function(t,e){function n(t){if("string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");var n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:r,scale:r?4:o,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,n){var r=e.getScale(t,n);return Math.floor((t+2*n.margin)*r)},e.qrToImageData=function(t,n,r){for(var o=n.modules.size,i=n.modules.data,a=e.getScale(o,r),s=Math.floor((o+2*r.margin)*a),u=r.margin*a,c=[r.color.light,r.color.dark],f=0;f=u&&l>=u&&f\n \n \n"},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!f){var t=s(h);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l1)for(var n=1;n-1};function a(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function s(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r.iterable&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function h(t){var e=new FileReader,n=l(e);return e.readAsArrayBuffer(t),n}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():r.arrayBuffer&&r.blob&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=l(e);return e.readAsText(t),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function v(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}}),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},p.call(A.prototype),p.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];w.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})};var y=self.DOMException;try{new y}catch(t){(y=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),y.prototype.constructor=y}function b(t,e){return new Promise(function(n,o){var i=new A(t,e);if(i.signal&&i.signal.aborted)return o(new y("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var t={status:a.status,statusText:a.statusText,headers:function(t){var e=new c;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}}),e}(a.getAllResponseHeaders()||"")};t.url="responseURL"in a?a.responseURL:t.headers.get("X-Request-URL");var e="response"in a?a.response:a.responseText;n(new w(e,t))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new y("Aborted","AbortError"))},a.open(i.method,i.url,!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&r.blob&&(a.responseType="blob"),i.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)})}b.polyfill=!0,self.fetch||(self.fetch=b,self.Headers=c,self.Request=A,self.Response=w)},function(t,e,n){"use strict";var r=n(21);t.exports=function(){return"function"==typeof r.Promise&&"function"==typeof r.Promise.prototype.then}},function(t,e,n){"use strict";(function(e){t.exports="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this}).call(this,n(7))},function(t,e,n){var r=n(2),o=n(0),i=n(4),a=n(23),s=n(24),u=n(25),c=n(26),f=n(27),l=n(8),h=n(28),d=n(31),p=n(32),g=n(1),A=n(33),v=n(3);function w(t,e,n){var r,o,i=t.size,a=p.getEncodedBits(e,n);for(r=0;r<15;r++)o=1==(a>>r&1),r<6?t.set(r,8,o,!0):r<8?t.set(r+1,8,o,!0):t.set(i-15+r,8,o,!0),r<8?t.set(8,i-r-1,o,!0):r<9?t.set(8,15-r-1+1,o,!0):t.set(8,15-r-1,o,!0);t.set(i-8,8,1,!0)}function m(t,e,n){var i=new a;n.forEach(function(e){i.put(e.mode.bit,4),i.put(e.getLength(),g.getCharCountIndicator(e.mode,t)),e.write(i)});var s=8*(o.getSymbolTotalCodewords(t)-l.getTotalCodewordsCount(t,e));for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);for(var u=(s-i.getLengthInBits())/8,c=0;c=0&&s<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===s||6===s)||s>=2&&s<=4&&u>=2&&u<=4?t.set(i+s,a+u,!0,!0):t.set(i+s,a+u,!1,!0))}(y,e),function(t){for(var e=t.size,n=8;n=7&&function(t,e){for(var n,r,o,i=t.size,a=d.getEncodedBits(e),s=0;s<18;s++)n=Math.floor(s/3),r=s%3+i-8-3,o=1==(a>>s&1),t.set(n,r,o,!0),t.set(r,n,o,!0)}(y,e),function(t,e){for(var n=t.size,r=-1,o=n-1,i=7,a=0,s=n-1;s>0;s-=2)for(6===s&&s--;;){for(var u=0;u<2;u++)if(!t.isReserved(o,s-u)){var c=!1;a>>i&1)),t.set(o,s-u,c),-1==--i&&(a++,i=7)}if((o+=r)<0||n<=o){o-=r,r=-r;break}}}(y,p),isNaN(r)&&(r=f.getBestMask(y,w.bind(null,y,n))),f.applyMask(r,y),w(y,n,r),{modules:y,version:e,errorCorrectionLevel:n,maskPattern:r,segments:i}}e.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var n,r,a=i.M;return void 0!==e&&(a=i.from(e.errorCorrectionLevel,i.M),n=d.from(e.version),r=f.from(e.maskPattern),e.toSJISFunc&&o.setToSJISFunction(e.toSJISFunc)),y(t,n,a,r)}},function(t,e){function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var n=0;n>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=n},function(t,e,n){var r=n(2);function o(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new r(t*t),this.data.fill(0),this.reservedBit=new r(t*t),this.reservedBit.fill(0)}o.prototype.set=function(t,e,n,r){var o=t*this.size+e;this.data[o]=n,r&&(this.reservedBit[o]=!0)},o.prototype.get=function(t,e){return this.data[t*this.size+e]},o.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},o.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=o},function(t,e,n){var r=n(0).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,n=r(t),o=145===n?26:2*Math.ceil((n-13)/(2*e-2)),i=[n-7],a=1;a=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){for(var e=t.size,r=0,o=0,i=0,a=null,s=null,u=0;u=5&&(r+=n+(o-5)),a=f,o=1),(f=t.get(c,u))===s?i++:(i>=5&&(r+=n+(i-5)),s=f,i=1)}o>=5&&(r+=n+(o-5)),i>=5&&(r+=n+(i-5))}return r},e.getPenaltyN2=function(t){for(var e=t.size,n=0,o=0;o=10&&(1488===r||93===r)&&n++,i=i<<1&2047|t.get(s,a),s>=10&&(1488===i||93===i)&&n++}return n*o},e.getPenaltyN4=function(t){for(var e=0,n=t.data.length,r=0;r0){var s=new r(this.degree);return s.fill(0),i.copy(s,a),s}return i},t.exports=i},function(t,e,n){var r=n(2),o=n(30);e.mul=function(t,e){var n=new r(t.length+e.length-1);n.fill(0);for(var i=0;i=0;){for(var i=n[0],a=0;a1)return function(t,n){for(var r=1;r<=40;r++)if(l(t,r)<=e.getCapacity(r,n,a.MIXED))return r}(t,o);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,n,r){for(var o=1;o<=40;o++)if(n<=e.getCapacity(o,r,t))return o}(r.mode,r.getLength(),o)},e.getEncodedBits=function(t){if(!s.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;r.getBCHDigit(e)-c>=0;)e^=7973<=0;)i^=1335<=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(a))},e.rawSplit=function(t){return e.fromArray(d(t,c.isKanjiModeEnabled()))}},function(t,e,n){var r=n(1);function o(t){this.mode=r.NUMERIC,this.data=t.toString()}o.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){var e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);var o=this.data.length-e;o>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*o+1))},t.exports=o},function(t,e,n){var r=n(1),o=["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"," ","$","%","*","+","-",".","/",":"];function i(t){this.mode=r.ALPHANUMERIC,this.data=t}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e+2<=this.data.length;e+=2){var n=45*o.indexOf(this.data[e]);n+=o.indexOf(this.data[e+1]),t.put(n,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},t.exports=i},function(t,e,n){var r=n(2),o=n(1);function i(t){this.mode=o.BYTE,this.data=new r(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(var e=0,n=this.data.length;e=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13)}},t.exports=i},function(t,e,n){"use strict";var r={single_source_shortest_paths:function(t,e,n){var o={},i={};i[e]=0;var a,s,u,c,f,l,h,d=r.PriorityQueue.make();for(d.push(e,0);!d.empty();)for(u in s=(a=d.pop()).value,c=a.cost,f=t[s]||{})f.hasOwnProperty(u)&&(l=c+f[u],h=i[u],(void 0===i[u]||h>l)&&(i[u]=l,d.push(u,l),o[u]=s));if(void 0!==n&&void 0===i[n]){var p=["Could not find a path from ",e," to ",n,"."].join("");throw new Error(p)}return o},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,e,n){var o=r.single_source_shortest_paths(t,e,n);return r.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(t){var e,n=r.PriorityQueue,o={};for(e in t=t||{},n)n.hasOwnProperty(e)&&(o[e]=n[e]);return o.queue=[],o.sorter=t.sorter||n.default_sorter,o},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=r},function(t,e,n){var r=n(11);e.render=function(t,e,n){var o=n,i=e;void 0!==o||e&&e.getContext||(o=e,e=void 0),e||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=r.getOptions(o);var a=r.getImageWidth(t.modules.size,o),s=i.getContext("2d"),u=s.createImageData(a,a);return r.qrToImageData(u.data,t,o),function(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(s,i,a),s.putImageData(u,0,0),i},e.renderToDataURL=function(t,n,r){var o=r;void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={});var i=e.render(t,n,o),a=o.type||"image/png",s=o.rendererOpts||{};return i.toDataURL(a,s.quality)}},function(t,e,n){var r=n(11);function o(t,e){var n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function i(t,e,n){var r=t+e;return void 0!==n&&(r+=" "+n),r}e.render=function(t,e,n){var a=r.getOptions(e),s=t.modules.size,u=t.modules.data,c=s+2*a.margin,f=a.color.light.a?"':"",l="0&&c>0&&t[u-1]||(r+=a?i("M",c+n,.5+f+n):i("m",o,0),o=0,a=!1),c+1',h='viewBox="0 0 '+c+" "+c+'"',d=''+f+l+"\n";return"function"==typeof n&&n(null,d),d}},function(t,e,n){var r=n(42);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(43)(!1)).push([t.i,"#irma-modal {\n position: fixed;\n top: 50%;\n left: 50%;\n height: auto;\n z-index: 2000;\n visibility: hidden;\n backface-visibility: hidden;\n transform: translateX(-50%) translateY(-50%); }\n #irma-modal #modal-irmaqr {\n width: 230px;\n height: 230px; }\n #irma-modal .modal-content {\n font: 100% Ubuntu, sans-serif;\n font-size: 14px;\n background-color: #004289;\n padding: 10px 10px 30px 10px; }\n #irma-modal p#irma-text {\n color: #004289;\n height: 75px;\n line-height: 130%; }\n #irma-modal .irma-page {\n margin: 0px auto; }\n #irma-modal .irma-content {\n background-color: white;\n position: relative;\n left: 0px;\n width: 330px;\n margin: 40px;\n box-sizing: content-box;\n border-style: solid;\n border-width: 0px;\n border-color: #004289;\n border-radius: 5px;\n padding: 20px;\n font-weight: 200;\n z-index: 1; }\n #irma-modal .irma-button-box {\n width: 370px;\n box-sizing: content-box;\n padding-top: 5px;\n margin-left: 40px;\n margin-top: -40px;\n margin-right: 40px;\n text-align: right; }\n #irma-modal .irma-logo-top {\n position: absolute;\n left: -40px;\n top: -40px;\n width: 160px;\n box-sizing: content-box;\n z-index: 2; }\n #irma-modal .irma-title {\n position: absolute;\n top: -30px;\n right: 0px;\n height: 40px;\n box-sizing: content-box;\n text-align: right;\n color: white;\n font-weight: 700;\n text-transform: uppercase;\n font-size: 20px; }\n #irma-modal .irma-option-container {\n text-align: center;\n margin: 30px auto; }\n #irma-modal .irma-option-box {\n width: 230px;\n height: 230px;\n box-sizing: content-box;\n border-style: solid;\n border-width: medium;\n border-color: #d0d0d0;\n border-radius: 6px;\n padding: 6px;\n display: inline-block;\n margin: 5px; }\n #irma-modal .irma-button {\n height: 40px;\n display: inline-block;\n box-sizing: content-box;\n margin: 0;\n padding: 0 0.5em;\n color: white;\n font-weight: 700;\n text-transform: uppercase;\n font-size: 16px;\n text-align: center;\n background-color: #888;\n border-radius: 5px;\n border: 0px none;\n cursor: pointer; }\n #irma-modal #irma-text {\n text-align: justify;\n padding-left: 125px; }\n #irma-modal .irma-dialog {\n box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);\n -webkit-transform: translateY(-30%);\n -moz-transform: translateY(-30%);\n -ms-transform: translateY(-30%);\n transform: translateY(-30%);\n opacity: 0;\n -webkit-transition: all 0.3s;\n -moz-transition: all 0.3s;\n transition: all 0.3s; }\n #irma-modal.irma-show .irma-dialog {\n -webkit-transform: translateY(0);\n -moz-transform: translateY(0);\n -ms-transform: translateY(0);\n transform: translateY(0);\n opacity: 1; }\n\n.irma-show {\n visibility: visible !important; }\n\n.irma-overlay {\n position: fixed;\n width: 100%;\n height: 100%;\n visibility: hidden;\n top: 0;\n left: 0;\n z-index: 1000;\n opacity: 0;\n background: rgba(0, 0, 0, 0.5);\n transition: all 0.3s; }\n\n.irma-show ~ .irma-overlay {\n opacity: 1;\n visibility: visible; }\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(r),i=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(i).concat([o]).join("\n")}return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o=0&&u.splice(e,1)}function p(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return g(e,t.attrs),h(t,e),e}function g(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function A(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var u=s++;n=a||(a=p(e)),r=w.bind(null,n,u,!1),o=w.bind(null,n,u,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),h(t,e),e}(e),r=function(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=c(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),o=function(){d(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){d(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=l(t,e);return f(n,e),function(t){for(var o=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n={qr:t,done:!1};return Promise.resolve().then(function(){switch(T("Session started",n.qr),n.options=function(t){T("Options:",t);var e=Object.assign({},v,t);e.userAgent=d?window.MSInputMethodContext&&document.documentMode?(T("Detected IE11"),B.Desktop):/Android/i.test(window.navigator.userAgent)?(T("Detected Android"),B.Android):/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream?(T("Detected iOS"),B.iOS):(T("Neither Android nor iOS, assuming desktop"),B.Desktop):null,d&&!e.disableMobile&&e.userAgent!==B.Desktop&&("mobile"!==e.method&&T("On mobile; using method mobile instead of "+e.method),e.method="mobile");switch(e.method){case"url":break;case"mobile":if(e.returnStatus!==A.Done)throw new Error("On mobile sessions, returnStatus must be Done");break;case"popup":if(!d)throw new Error("Cannot use method popup in node");if(!(e.language in l))throw new Error("Unsupported language, currently supported: "+Object.keys(l).join(", "));e.element="modal-irmaqr",e.returnStatus=A.Done;break;case"canvas":if(!d)throw new Error("Cannot use method canvas in node");if("string"!=typeof e.element||""===e.element)throw new Error("canvas method requires `element` to be provided in options");break;case"console":if(d)throw new Error("Cannot use console method in browser");break;default:throw new Error("Unsupported method")}if("string"!=typeof e.server)throw new Error("server must be a string (URL)");if(e.server.length>0&&e.returnStatus!==A.Done)throw new Error("If server option is used, returnStatus option must be SessionStatus.Done");if(e.server.length>0&&("string"!=typeof e.token||0===e.token.length))throw new Error("if server option is used, providing token option is required");if(e.resultJwt&&0===e.server.length)throw new Error("resultJwt option was enabled but no server to retrieve result from was provided");return e}(e),n.method=n.options.method,n.method){case"url":return n.done=!0,a.a.toDataURL(JSON.stringify(n.qr));case"mobile":!function(t,e){var n="qr/json/"+encodeURIComponent(JSON.stringify(t));if(e===B.Android){var r="intent://"+n+"#Intent;package=org.irmacard.cardemu;scheme=cardemu;l.timestamp="+Date.now()+";S.browser_fallback_url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.irmacard.cardemu;end";T("Navigating:",r),window.location.href=r}else e===B.iOS&&(T("Navigating:","irma://"+n),window.location.href="irma://"+n)}(t,n.options.userAgent);break;case"popup":!function(t,e){(function(){if(!d||window.document.getElementById("irma-modal"))return;var t=window.document.createElement("div");t.id="irma-modal",t.innerHTML=f.a,window.document.body.appendChild(t);var e=window.document.createElement("div");e.classList.add("irma-overlay"),window.document.body.appendChild(e),t.offsetHeight})(),function(t,e){S("irma-cancel-button","Common.Cancel",e),S("irma-title",P[t]+".Title",e),S("irma-text",P[t]+".Body",e)}(t.irmaqr,e),window.document.getElementById("irma-modal").classList.add("irma-show");var n=window.document.getElementById("irma-cancel-button");n.addEventListener("click",function e(){o()(t.u,{method:"DELETE"}),n.removeEventListener("click",e)})}(t,n.options.language);case"canvas":if(n.canvas=window.document.getElementById(n.options.element),!n.canvas)return Promise.reject("Specified canvas not found in DOM");!function(t,e){a.a.toCanvas(t,JSON.stringify(e),{width:"230",margin:"1"},function(t){if(t)throw t})}(n.canvas,n.qr);break;case"console":p.generate(JSON.stringify(n.qr))}return n.options.returnStatus===A.Initialized?(n.done=!0,A.Initialized):b(n.qr.u)}).then(function(t){if(n.done)return t;switch(T("Session state changed",t,n.qr.u),n.method){case"popup":S("irma-text","Messages.FollowInstructions",n.options.language);case"canvas":!function(t,e){var n=t.getContext("2d");if(n.clearRect(0,0,t.width,t.height),e){var r=window.devicePixelRatio;t.width=230*r,t.height=230*r,n.scale(r,r);var o=new Image;o.onload=function(){return n.drawImage(o,75.5,40,79,150)},o.src=u.a}}(n.canvas,n.options.showConnectedIcon)}return n.options.returnStatus===A.Connected?(n.done=!0,A.Connected):E(n.qr.u)}).then(function(t){return n.done?t:("popup"===n.method&&O(),0===n.options.server.length?(n.done=!0,t):I("".concat(n.options.server,"/session/").concat(n.options.token,"/").concat(n.options.resultJwt?"result-jwt":"result")))}).then(function(t){return n.done?t:n.options.resultJwt?t.text():t.json()}).catch(function(t){throw T("Error or unexpected status",t),"popup"===n.method&&O(),t})}function m(t,e,n,r,o){return Promise.resolve().then(function(){return"object"===h(e)?"publickey"==n||"hmac"==n?y(e,n,r,o):JSON.stringify(e):e}).then(function(e){var o={};switch(n){case void 0:case"none":o["Content-Type"]="application/json";break;case"token":o.Authorization=r,o["Content-Type"]="application/json";break;case"publickey":case"hmac":o["Content-Type"]="text/plain";break;default:throw new Error("Unsupported authentication method")}return I("".concat(t,"/session"),{method:"POST",headers:o,body:e})}).then(function(t){return t.json()})}function y(t,e,r,o){return Promise.all([n.e(2),n.e(0)]).then(n.t.bind(null,231,7)).then(function(n){var i,a;if(t.type?(i=t.type,a={request:t}):t.request&&(i=t.request.type,a=t),"disclosing"!==i&&"issuing"!==i&&"signing"!==i)throw new Error("Not an IRMA session request");if("publickey"!==e&&"hmac"!==e)throw new Error("Unsupported signing method");var s={algorithm:"publickey"===e?"RS256":"HS256",issuer:o,subject:{disclosing:"verification_request",issuing:"issue_request",signing:"signature_request"}[i]};return n.sign(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},{disclosing:"sprequest",issuing:"iprequest",signing:"absrequest"}[i],a),r,s)})}function b(t){return R(t,A.Initialized).then(function(t){return t!==A.Connected?Promise.reject(t):t})}function E(t){return R(t,A.Connected).then(function(t){return t!==A.Done?Promise.reject(t):t})}function R(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.Initialized;return new Promise(function(n,r){var o=d?window.EventSource:g;if(!o)return T("No support for EventSource, fallback to polling"),void C("".concat(t,"/status"),e,n,r);var i=new o("".concat(t,"/statusevents")),a=setTimeout(function(){return r("no open message received")},500);i.onopen=function(){clearTimeout(a)},i.onmessage=function(t){clearTimeout(a),i.close(),n(JSON.parse(t.data))},i.onerror=function(t){clearTimeout(a),T("Received server event error",t),i.close(),r(t)}}).catch(function(n){return T("error in server sent event, falling back to polling:",n),function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.Initialized;return new Promise(function(n,r){return C(t,e,n,r)})}("".concat(t,"/status"),e)})}var C=function t(e,n,r,o){return I(e).then(function(t){return t.json()}).then(function(i){return i!==n?r(i):setTimeout(t,500,e,n,r,o)}).catch(function(t){return o(t)})},B={Desktop:"Desktop",Android:"Android",iOS:"iOS"};function x(t){return t.ok?t:t.text().then(function(e){throw function(){console.warn.apply(console,arguments)}("Server returned error:",e),new Error(t.statusText)})}function I(){return o.a.apply(null,arguments).then(x)}function O(){d&&window.document.getElementById("irma-modal")&&window.document.getElementById("irma-modal").classList.remove("irma-show")}function T(){console.log.apply(console,arguments)}var P={disclosing:"Verify",issuing:"Issue",signing:"Sign"};function S(t,e,n){window.document.getElementById(t).innerText=function(t,e){var n=t.split("."),r=l[e];for(var o in n){if(void 0===r)break;r=r[n[o]]}if(void 0===r)for(o in r=l[v.language],n){if(void 0===r)break;r=r[n[o]]}return void 0===r?"":r}(e,n)}}]); \ No newline at end of file diff --git a/www/resources/jquery-3.4.0.min.js b/www/resources/jquery-3.4.0.min.js new file mode 100644 index 0000000..769a1d9 --- /dev/null +++ b/www/resources/jquery-3.4.0.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.0 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.0",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ae(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ne(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ne(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n=void 0,r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(Q.set(this,i,k.event.trigger(k.extend(r.shift(),k.Event.prototype),r,this)),e.stopImmediatePropagation())}})):k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0IRMA authentication cancelled.'); - } +$(function () { + var success_fun = function (data) { + console.log("IRMA authentication successful, submitting form"); + $("#jwt_result").attr("value", data); + $("form#irma_result_form").submit(); + }; + var cancel_fun = function (data) { + console.log("Authentication cancelled!"); + $("#irma_msg").html(''); + }; - var error_fun = function(data) { - console.log("Authentication failed!"); - console.log("Error data:", data); - $("#irma_msg").html(''); - } + var error_fun = function (data) { + console.log("Authentication failed!"); + console.log("Error data:", data); + $("#irma_msg").html(''); + }; - $("#irma_btn").on("click", function() { - console.log("Button clicked"); - IRMA.verify(verification_jwt, success_fun, cancel_fun, error_fun); + $("#irma_btn").on("click", function () { + console.log("Button clicked"); + $.getJSON('get_irma_session.php?AuthState=' + authStateId, function (data) { + var irma_session = data.sessionPtr; + var irma_token = data.token; + var promise = irma.handleSession(irma_session); + promise.then(function (data) { + if (data === 'DONE') { + $.get(irma_api_server + '/session/' + irma_token + '/getproof', function (result_jwt) { + success_fun(result_jwt); + }); + } else { + cancel_fun(data); + } + }); + promise.catch(error_fun); }); + }); });