@hcaptcha/vue-hcaptcha
Advanced tools
Comparing version 0.3.1-alpha.3 to 0.3.1
@@ -219,3 +219,3 @@ module.exports = | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var _hcaptcha_vue_vue_type_template_id_4427113e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("da32"); | ||
/* harmony import */ var _hcaptcha_vue_vue_type_template_id_a37603b0___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8414"); | ||
/* harmony import */ var _hcaptcha_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fa1f"); | ||
@@ -233,4 +233,4 @@ /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _hcaptcha_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _hcaptcha_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); | ||
_hcaptcha_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], | ||
_hcaptcha_vue_vue_type_template_id_4427113e___WEBPACK_IMPORTED_MODULE_0__[/* render */ "a"], | ||
_hcaptcha_vue_vue_type_template_id_4427113e___WEBPACK_IMPORTED_MODULE_0__[/* staticRenderFns */ "b"], | ||
_hcaptcha_vue_vue_type_template_id_a37603b0___WEBPACK_IMPORTED_MODULE_0__[/* render */ "a"], | ||
_hcaptcha_vue_vue_type_template_id_a37603b0___WEBPACK_IMPORTED_MODULE_0__[/* staticRenderFns */ "b"], | ||
false, | ||
@@ -370,2 +370,21 @@ null, | ||
/***/ "8414": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
// EXPORTS | ||
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ render; }); | ||
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ staticRenderFns; }); | ||
// CONCATENATED MODULE: /home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"78657f6c-vue-loader-template"}!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/cache-loader/dist/cjs.js??ref--0-0!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/vue-loader/lib??vue-loader-options!./src/hcaptcha.vue?vue&type=template&id=a37603b0& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"hcap-script"}})} | ||
var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/hcaptcha.vue?vue&type=template&id=a37603b0& | ||
/***/ }), | ||
/***/ "cada": | ||
@@ -537,3 +556,4 @@ /***/ (function(module, exports, __webpack_require__) { | ||
onChallengeExpired: function onChallengeExpired() { | ||
this.$emit('challenge-expired'); | ||
// vue3 will transform this `camelCase` event name into `kebab-case` | ||
this.$emit('challengeExpired'); | ||
}, | ||
@@ -552,21 +572,2 @@ onOpen: function onOpen() { | ||
/***/ "da32": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
// EXPORTS | ||
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ render; }); | ||
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ staticRenderFns; }); | ||
// CONCATENATED MODULE: /home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"78657f6c-vue-loader-template"}!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/cache-loader/dist/cjs.js??ref--0-0!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/vue-loader/lib??vue-loader-options!./src/hcaptcha.vue?vue&type=template&id=4427113e& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"hcap-script"}})} | ||
var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/hcaptcha.vue?vue&type=template&id=4427113e& | ||
/***/ }), | ||
/***/ "dfcd": | ||
@@ -573,0 +574,0 @@ /***/ (function(module, exports, __webpack_require__) { |
@@ -228,3 +228,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var _hcaptcha_vue_vue_type_template_id_4427113e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("da32"); | ||
/* harmony import */ var _hcaptcha_vue_vue_type_template_id_a37603b0___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8414"); | ||
/* harmony import */ var _hcaptcha_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fa1f"); | ||
@@ -242,4 +242,4 @@ /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _hcaptcha_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _hcaptcha_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); | ||
_hcaptcha_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], | ||
_hcaptcha_vue_vue_type_template_id_4427113e___WEBPACK_IMPORTED_MODULE_0__[/* render */ "a"], | ||
_hcaptcha_vue_vue_type_template_id_4427113e___WEBPACK_IMPORTED_MODULE_0__[/* staticRenderFns */ "b"], | ||
_hcaptcha_vue_vue_type_template_id_a37603b0___WEBPACK_IMPORTED_MODULE_0__[/* render */ "a"], | ||
_hcaptcha_vue_vue_type_template_id_a37603b0___WEBPACK_IMPORTED_MODULE_0__[/* staticRenderFns */ "b"], | ||
false, | ||
@@ -379,2 +379,21 @@ null, | ||
/***/ "8414": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
// EXPORTS | ||
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ render; }); | ||
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ staticRenderFns; }); | ||
// CONCATENATED MODULE: /home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"78657f6c-vue-loader-template"}!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/cache-loader/dist/cjs.js??ref--0-0!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/vue-loader/lib??vue-loader-options!./src/hcaptcha.vue?vue&type=template&id=a37603b0& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"hcap-script"}})} | ||
var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/hcaptcha.vue?vue&type=template&id=a37603b0& | ||
/***/ }), | ||
/***/ "cada": | ||
@@ -546,3 +565,4 @@ /***/ (function(module, exports, __webpack_require__) { | ||
onChallengeExpired: function onChallengeExpired() { | ||
this.$emit('challenge-expired'); | ||
// vue3 will transform this `camelCase` event name into `kebab-case` | ||
this.$emit('challengeExpired'); | ||
}, | ||
@@ -561,21 +581,2 @@ onOpen: function onOpen() { | ||
/***/ "da32": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
// EXPORTS | ||
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ render; }); | ||
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ staticRenderFns; }); | ||
// CONCATENATED MODULE: /home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"78657f6c-vue-loader-template"}!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/cache-loader/dist/cjs.js??ref--0-0!/home/runner/work/vue-hcaptcha/vue-hcaptcha/node_modules/vue-loader/lib??vue-loader-options!./src/hcaptcha.vue?vue&type=template&id=4427113e& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"hcap-script"}})} | ||
var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/hcaptcha.vue?vue&type=template&id=4427113e& | ||
/***/ }), | ||
/***/ "dfcd": | ||
@@ -582,0 +583,0 @@ /***/ (function(module, exports, __webpack_require__) { |
@@ -1,2 +0,2 @@ | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["@hcaptcha/vue-hcaptcha"]=t():e["@hcaptcha/vue-hcaptcha"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="1c25")}({"1c25":function(e,t,n){"use strict";n.r(t);n("e754");var i=n("56d7"),r=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=r.a},"2be6":function(e,t,n){"use strict";function i(e,t,n,i,r,o,a,c){var d,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=d):r&&(d=c?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),d)if(u.functional){u._injectStyles=d;var s=u.render;u.render=function(e,t){return d.call(t),s(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,d):[d]}return{exports:e,options:u}}n.d(t,"a",(function(){return i}))},"407a":function(e,t,n){"use strict";n.r(t);var i=n("da32"),r=n("fa1f");for(var o in r)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var a=n("2be6"),c=Object(a["a"])(r["default"],i["a"],i["b"],!1,null,null,null);t["default"]=c.exports},4141:function(e,t){(function(e){var t="currentScript",n=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(i){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(e in n)if(n[e].src==t||"interactive"==n[e].readyState)return n[e];return null}}})})(document)},"56d7":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.install=o;var i=r(n("407a"));function r(e){return e&&e.__esModule?e:{default:e}}function o(e){o.installed||(o.installed=!0,e.component("vuehcaptcha",i.default),e.component("VueHcaptcha",i.default))}var a={install:o},c=null;"undefined"!==typeof window?c=window.Vue:"undefined"!==typeof e&&(c=e.Vue),c&&c.use(a);var d=i.default;t.default=d}).call(this,n("7d15"))},"7d15":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}e.exports=n},cada:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n("dfcd"),r={name:"VueHcaptcha",props:{sitekey:{type:String,required:!0},theme:{type:String,default:void 0},size:{type:String,default:void 0},tabindex:{type:String,default:void 0},language:{type:String,default:void 0},reCaptchaCompat:{type:Boolean,default:!0},challengeContainer:{type:String,default:void 0},rqdata:{type:String,default:void 0},sentry:{type:Boolean,default:!0},apiEndpoint:{type:String,default:"https://hcaptcha.com/1/api.js"},endpoint:{type:String,default:void 0},reportapi:{type:String,default:void 0},assethost:{type:String,default:void 0},imghost:{type:String,default:void 0}},data:function(){return{widgetId:null,hcaptcha:null}},mounted:function(){return(0,i.loadApiEndpointIfNotAlready)(this.$props).then(this.onApiLoaded).catch(this.onError)},unmounted:function(){var e=this;this.widgetId&&this.hcaptcha.then((function(){e.hcaptcha.reset(e.widgetId),e.hcaptcha.remove(e.widgetId)}))},methods:{onApiLoaded:function(){this.hcaptcha=window.hcaptcha;var e={sitekey:this.sitekey,theme:this.theme,size:this.size,tabindex:this.tabindex,callback:this.onVerify,"expired-callback":this.onExpired,"chalexpired-callback":this.onChallengeExpired,"error-callback":this.onError,"open-callback":this.onOpen,"close-callback":this.onClose};this.challengeContainer&&(e["challenge-container"]=this.challengeContainer),this.widgetId=this.hcaptcha.render(this.$el,e),this.rqdata&&this.hcaptcha.setData(this.widgetId,{rqdata:this.rqdata}),this.onRendered()},execute:function(){this.widgetId?(this.hcaptcha.execute(this.widgetId),this.onExecuted()):this.$on("rendered",this.execute)},reset:function(){this.widgetId?(this.hcaptcha.reset(this.widgetId),this.onReset()):this.$emit("error","Element is not rendered yet and thus cannot reset it. Wait for `rendered` event to safely call reset.")},onRendered:function(){this.$emit("rendered")},onExecuted:function(){this.$emit("executed")},onReset:function(){this.$emit("reset")},onError:function(e){this.$emit("error",e),this.reset()},onVerify:function(){var e=this.hcaptcha.getResponse(this.widgetId),t=this.hcaptcha.getRespKey(this.widgetId);this.$emit("verify",e,t)},onExpired:function(){this.$emit("expired")},onChallengeExpired:function(){this.$emit("challenge-expired")},onOpen:function(){this.$emit("opened")},onClose:function(){this.$emit("closed")}}};t.default=r},da32:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"hcap-script"}})},r=[]},dfcd:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCRIPT_ID=void 0,t.addQueryParamIfDefined=s,t.getScriptSrc=u,t.loadApiEndpointIfNotAlready=d;var i="hcaptcha-api-script-id";t.SCRIPT_ID=i;var r,o,a="_hcaptchaOnLoad",c=new Promise((function(e,t){r=e,o=t}));function d(e){if(window.hcaptcha)return r(),c;if(document.getElementById(i))return c;window[a]=r;var t=u(e),n=document.createElement("script");return n.id=i,n.src=t,n.async=!0,n.defer=!0,n.onerror=function(e){console.error("Failed to load api: "+t,e),o("Failed to load api.js")},document.head.appendChild(n),c}function u(e){var t=e.apiEndpoint;return t=s(t,"render","explicit"),t=s(t,"onload",a),t=s(t,"recaptchacompat",!1===e.reCaptchaCompat?"off":null),t=s(t,"hl",e.language),t=s(t,"sentry",e.sentry),t=s(t,"endpoint",e.endpoint),t=s(t,"assethost",e.assethost),t=s(t,"imghost",e.imghost),t=s(t,"reportapi",e.reportapi),t}function s(e,t,n){if(void 0!==n&&null!==n){var i=e.includes("?")?"&":"?";return e+i+t+"="+encodeURIComponent(n)}return e}},e754:function(e,t,n){"use strict";var i;"undefined"!==typeof window&&(n("4141"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=i[1]))},fa1f:function(e,t,n){"use strict";n.r(t);var i=n("cada"),r=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=r.a}})})); | ||
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["@hcaptcha/vue-hcaptcha"]=e():t["@hcaptcha/vue-hcaptcha"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="1c25")}({"1c25":function(t,e,n){"use strict";n.r(e);n("e754");var i=n("56d7"),r=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=r.a},"2be6":function(t,e,n){"use strict";function i(t,e,n,i,r,o,a,c){var d,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(d=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=d):r&&(d=c?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),d)if(u.functional){u._injectStyles=d;var s=u.render;u.render=function(t,e){return d.call(e),s(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,d):[d]}return{exports:t,options:u}}n.d(e,"a",(function(){return i}))},"407a":function(t,e,n){"use strict";n.r(e);var i=n("8414"),r=n("fa1f");for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);var a=n("2be6"),c=Object(a["a"])(r["default"],i["a"],i["b"],!1,null,null,null);e["default"]=c.exports},4141:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(i){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},"56d7":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.install=o;var i=r(n("407a"));function r(t){return t&&t.__esModule?t:{default:t}}function o(t){o.installed||(o.installed=!0,t.component("vuehcaptcha",i.default),t.component("VueHcaptcha",i.default))}var a={install:o},c=null;"undefined"!==typeof window?c=window.Vue:"undefined"!==typeof t&&(c=t.Vue),c&&c.use(a);var d=i.default;e.default=d}).call(this,n("7d15"))},"7d15":function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}t.exports=n},8414:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"hcap-script"}})},r=[]},cada:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("dfcd"),r={name:"VueHcaptcha",props:{sitekey:{type:String,required:!0},theme:{type:String,default:void 0},size:{type:String,default:void 0},tabindex:{type:String,default:void 0},language:{type:String,default:void 0},reCaptchaCompat:{type:Boolean,default:!0},challengeContainer:{type:String,default:void 0},rqdata:{type:String,default:void 0},sentry:{type:Boolean,default:!0},apiEndpoint:{type:String,default:"https://hcaptcha.com/1/api.js"},endpoint:{type:String,default:void 0},reportapi:{type:String,default:void 0},assethost:{type:String,default:void 0},imghost:{type:String,default:void 0}},data:function(){return{widgetId:null,hcaptcha:null}},mounted:function(){return(0,i.loadApiEndpointIfNotAlready)(this.$props).then(this.onApiLoaded).catch(this.onError)},unmounted:function(){var t=this;this.widgetId&&this.hcaptcha.then((function(){t.hcaptcha.reset(t.widgetId),t.hcaptcha.remove(t.widgetId)}))},methods:{onApiLoaded:function(){this.hcaptcha=window.hcaptcha;var t={sitekey:this.sitekey,theme:this.theme,size:this.size,tabindex:this.tabindex,callback:this.onVerify,"expired-callback":this.onExpired,"chalexpired-callback":this.onChallengeExpired,"error-callback":this.onError,"open-callback":this.onOpen,"close-callback":this.onClose};this.challengeContainer&&(t["challenge-container"]=this.challengeContainer),this.widgetId=this.hcaptcha.render(this.$el,t),this.rqdata&&this.hcaptcha.setData(this.widgetId,{rqdata:this.rqdata}),this.onRendered()},execute:function(){this.widgetId?(this.hcaptcha.execute(this.widgetId),this.onExecuted()):this.$on("rendered",this.execute)},reset:function(){this.widgetId?(this.hcaptcha.reset(this.widgetId),this.onReset()):this.$emit("error","Element is not rendered yet and thus cannot reset it. Wait for `rendered` event to safely call reset.")},onRendered:function(){this.$emit("rendered")},onExecuted:function(){this.$emit("executed")},onReset:function(){this.$emit("reset")},onError:function(t){this.$emit("error",t),this.reset()},onVerify:function(){var t=this.hcaptcha.getResponse(this.widgetId),e=this.hcaptcha.getRespKey(this.widgetId);this.$emit("verify",t,e)},onExpired:function(){this.$emit("expired")},onChallengeExpired:function(){this.$emit("challengeExpired")},onOpen:function(){this.$emit("opened")},onClose:function(){this.$emit("closed")}}};e.default=r},dfcd:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCRIPT_ID=void 0,e.addQueryParamIfDefined=s,e.getScriptSrc=u,e.loadApiEndpointIfNotAlready=d;var i="hcaptcha-api-script-id";e.SCRIPT_ID=i;var r,o,a="_hcaptchaOnLoad",c=new Promise((function(t,e){r=t,o=e}));function d(t){if(window.hcaptcha)return r(),c;if(document.getElementById(i))return c;window[a]=r;var e=u(t),n=document.createElement("script");return n.id=i,n.src=e,n.async=!0,n.defer=!0,n.onerror=function(t){console.error("Failed to load api: "+e,t),o("Failed to load api.js")},document.head.appendChild(n),c}function u(t){var e=t.apiEndpoint;return e=s(e,"render","explicit"),e=s(e,"onload",a),e=s(e,"recaptchacompat",!1===t.reCaptchaCompat?"off":null),e=s(e,"hl",t.language),e=s(e,"sentry",t.sentry),e=s(e,"endpoint",t.endpoint),e=s(e,"assethost",t.assethost),e=s(e,"imghost",t.imghost),e=s(e,"reportapi",t.reportapi),e}function s(t,e,n){if(void 0!==n&&null!==n){var i=t.includes("?")?"&":"?";return t+i+e+"="+encodeURIComponent(n)}return t}},e754:function(t,e,n){"use strict";var i;"undefined"!==typeof window&&(n("4141"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=i[1]))},fa1f:function(t,e,n){"use strict";n.r(e);var i=n("cada"),r=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=r.a}})})); | ||
//# sourceMappingURL=vue-hcaptcha.umd.min.js.map |
{ | ||
"name": "@hcaptcha/vue-hcaptcha", | ||
"version": "0.3.1-alpha.3", | ||
"version": "0.3.1", | ||
"types": "types/index.d.ts", | ||
@@ -122,3 +122,3 @@ "main": "./dist/@hcaptcha/vue-hcaptcha.umd.min.js", | ||
}, | ||
"gitHead": "11ba5322ce5028ffdbec11f41bb5a15d4be56ce5" | ||
"gitHead": "74c1f6d54004dce39e03b6be29e7cff358b1441a" | ||
} |
@@ -85,3 +85,3 @@ # Vue.js hCaptcha Component Library | ||
|`expired`|-|When the current token expires.| | ||
|`challenge-expired`|-|When the unfinished challenge expires.| | ||
|`challengeExpired`|-|When the unfinished challenge expires.| | ||
|`opened`|-|When the challenge is opened.| | ||
@@ -88,0 +88,0 @@ |`closed`|-|When the challenge is closed.| |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
142528
1258