'use strict';window.Reci.Mst&&window.Reci.Mst.recap&&window.Reci.Mst.recap.type&&function(c){const f=window.Reci.Utils.eh,b={},g=new Promise(function(a){return grecaptcha.ready(a)});window.Reci||(window.Reci={});window.Reci.Utils||(window.Reci.Utils={});window.Reci.Utils.recap={render:function(a,h){if("v2_invisible"!==c.type&&"v2"!==c.type)return Promise.reject(new TypeError("invalid recap type"));if("undefined"!==typeof b[a])return Promise.reject(new TypeError("already rendered"));b[a]={ele:h,id:null, token:null,resolve:null,reject:null};return g.then(function(){const d={sitekey:c.key_pub,callback:function(e){b[a].token=e;"function"===typeof b[a].resolve&&b[a].resolve(e);f._call("recaptcha.executed",{act:a,token:e})},"expired-callback":function(){b[a].token=null;"function"===typeof b[a].reject&&b[a].reject({type:"expired",act:a});f._call("recaptcha.expired",{act:a})},"error-callback":function(){b[a].token=null;"function"===typeof b[a].reject&&b[a].reject({type:"error",act:a});f._call("recaptcha.error", {act:a})}};"v2_invisible"===c.type&&(d.size="invisible");b[a].id=grecaptcha.render(h,d);return b[a].id})},execute:function(a,h){return"v3"===c.type?g.then(function(){return grecaptcha.execute(c.key_pub,{action:a})}).then(function(d){f._call("recaptcha.executed",{act:a,token:d});return d}):"v2_invisible"===c.type?g.then(function(){if(!b[a]||null===b[a].id)throw{type:"fail",by:"recap",reason:"not.rended"};b[a].resolve=null;"function"===typeof b[a].reject&&b[a].reject({type:"cancel",act:a});b[a].reject= null;return new Promise(function(d,e){b[a].resolve=d;b[a].reject=e;grecaptcha.execute(b[a].id)})}):"v2"===c.type?g.then(function(){if(!b[a]||null===b[a].id)throw{type:"fail",by:"recap",reason:"not.rended"};if(null!==b[a].token)return b[a].token;if(!h)throw{type:"fail",by:"recap",reason:"not.executed",msg:"\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30fc\u78ba\u8a8d\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002"};return new Promise(function(d,e){b[a].resolve=d;b[a].reject=e})}):Promise.reject(new TypeError("invalid recap type"))}, reset:function(a){("v2_invisible"===c.type||"v2"===c.type)&&b[a]&&null!==b[a].id&&grecaptcha.reset(b[a].id)}}}(window.Reci.Mst.recap);