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G,EAAWtB,EAAW4B,GAEtBN,WACKA,EAASI,UAAU1G,KAAK+F,uCAEC,IAA5BhB,EAAQ+C,wBACH9C,EAAW4B,KAKxB3F,EAAOuB,OAAS,WACd,IAAI8C,EAAaP,EAAQO,WAErBnB,EAAcnE,KAAKmB,MAEnB+G,GADoB/D,EAAYiC,kBACjBjC,EAAY+D,cAC3B9D,EArNZ,SAAuC1E,EAAQ2E,GAAY,GAAc,MAAV3E,EAAgB,MAAO,GAAI,IAA2DC,EAAKJ,EAA5DD,EAAS,GAAQgF,EAAalF,OAAOmF,KAAK7E,GAAqB,IAAKH,EAAI,EAAGA,EAAI+E,EAAW7E,OAAQF,IAAOI,EAAM2E,EAAW/E,GAAQ8E,EAASG,QAAQ7E,IAAQ,IAAaL,EAAOK,GAAOD,EAAOC,IAAQ,OAAOL,EAqNjR,CAA8B6E,EAAa,CAAC,oBAAqB,iBAQlF,OALImB,GAAgC,oBAAXH,SACvBf,EAAWkB,QAA4C,IAAvBH,OAAOG,GAA8BH,OAAOG,QAAcjE,GAG5F+C,EAAWM,IAAMwD,GACV,IAAAvF,eAAc4C,EAAkBnB,IAGlCsB,EA/MT,CAgNE,EAAAyC,WAKEC,GAAqB,IAAAC,aAAW,SAAUlH,EAAOuD,GACnD,OAAO,IAAA/B,eAAc+C,EAAmB,EAAS,GAAIvE,EAAO,CAC1D+G,aAAcxD,QAOlB,OAJA0D,EAAmBzD,YAAc,qBAAuBa,EAAuB,IAC/E4C,EAAmBxD,UAAY,CAC7BwB,kBAAmB,UAEd,IAAagC,EAAoB7C,KC/NzCnF,GChBH","sources":["webpack://gyldendal-uddannelse/./node_modules/react-google-recaptcha/lib/esm/recaptcha.js","webpack://gyldendal-uddannelse/./node_modules/react-async-script/lib/esm/async-script-loader.js","webpack://gyldendal-uddannelse/./node_modules/react-google-recaptcha/lib/esm/recaptcha-wrapper.js","webpack://gyldendal-uddannelse/./node_modules/react-google-recaptcha/lib/esm/index.js"],"sourcesContent":["function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nvar ReCAPTCHA =\n/*#__PURE__*/\nfunction (_React$Component) {\n  _inheritsLoose(ReCAPTCHA, _React$Component);\n\n  function ReCAPTCHA() {\n    var _this;\n\n    _this = _React$Component.call(this) || this;\n    _this.handleExpired = _this.handleExpired.bind(_assertThisInitialized(_this));\n    _this.handleErrored = _this.handleErrored.bind(_assertThisInitialized(_this));\n    _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));\n    _this.handleRecaptchaRef = _this.handleRecaptchaRef.bind(_assertThisInitialized(_this));\n    return _this;\n  }\n\n  var _proto = ReCAPTCHA.prototype;\n\n  _proto.getValue = function getValue() {\n    if (this.props.grecaptcha && this._widgetId !== undefined) {\n      return this.props.grecaptcha.getResponse(this._widgetId);\n    }\n\n    return null;\n  };\n\n  _proto.getWidgetId = function getWidgetId() {\n    if (this.props.grecaptcha && this._widgetId !== undefined) {\n      return this._widgetId;\n    }\n\n    return null;\n  };\n\n  _proto.execute = function execute() {\n    var grecaptcha = this.props.grecaptcha;\n\n    if (grecaptcha && this._widgetId !== undefined) {\n      return grecaptcha.execute(this._widgetId);\n    } else {\n      this._executeRequested = true;\n    }\n  };\n\n  _proto.executeAsync = function executeAsync() {\n    var _this2 = this;\n\n    return new Promise(function (resolve, reject) {\n      _this2.executionResolve = resolve;\n      _this2.executionReject = reject;\n\n      _this2.execute();\n    });\n  };\n\n  _proto.reset = function reset() {\n    if (this.props.grecaptcha && this._widgetId !== undefined) {\n      this.props.grecaptcha.reset(this._widgetId);\n    }\n  };\n\n  _proto.handleExpired = function handleExpired() {\n    if (this.props.onExpired) {\n      this.props.onExpired();\n    } else {\n      this.handleChange(null);\n    }\n  };\n\n  _proto.handleErrored = function handleErrored() {\n    if (this.props.onErrored) {\n      this.props.onErrored();\n    }\n\n    if (this.executionReject) {\n      this.executionReject();\n      delete this.executionResolve;\n      delete this.executionReject;\n    }\n  };\n\n  _proto.handleChange = function handleChange(token) {\n    if (this.props.onChange) {\n      this.props.onChange(token);\n    }\n\n    if (this.executionResolve) {\n      this.executionResolve(token);\n      delete this.executionReject;\n      delete this.executionResolve;\n    }\n  };\n\n  _proto.explicitRender = function explicitRender() {\n    if (this.props.grecaptcha && this.props.grecaptcha.render && this._widgetId === undefined) {\n      var wrapper = document.createElement(\"div\");\n      this._widgetId = this.props.grecaptcha.render(wrapper, {\n        sitekey: this.props.sitekey,\n        callback: this.handleChange,\n        theme: this.props.theme,\n        type: this.props.type,\n        tabindex: this.props.tabindex,\n        \"expired-callback\": this.handleExpired,\n        \"error-callback\": this.handleErrored,\n        size: this.props.size,\n        stoken: this.props.stoken,\n        hl: this.props.hl,\n        badge: this.props.badge\n      });\n      this.captcha.appendChild(wrapper);\n    }\n\n    if (this._executeRequested && this.props.grecaptcha && this._widgetId !== undefined) {\n      this._executeRequested = false;\n      this.execute();\n    }\n  };\n\n  _proto.componentDidMount = function componentDidMount() {\n    this.explicitRender();\n  };\n\n  _proto.componentDidUpdate = function componentDidUpdate() {\n    this.explicitRender();\n  };\n\n  _proto.componentWillUnmount = function componentWillUnmount() {\n    if (this._widgetId !== undefined) {\n      this.delayOfCaptchaIframeRemoving();\n      this.reset();\n    }\n  };\n\n  _proto.delayOfCaptchaIframeRemoving = function delayOfCaptchaIframeRemoving() {\n    var temporaryNode = document.createElement(\"div\");\n    document.body.appendChild(temporaryNode);\n    temporaryNode.style.display = \"none\"; // move of the recaptcha to a temporary node\n\n    while (this.captcha.firstChild) {\n      temporaryNode.appendChild(this.captcha.firstChild);\n    } // delete the temporary node after reset will be done\n\n\n    setTimeout(function () {\n      document.body.removeChild(temporaryNode);\n    }, 5000);\n  };\n\n  _proto.handleRecaptchaRef = function handleRecaptchaRef(elem) {\n    this.captcha = elem;\n  };\n\n  _proto.render = function render() {\n    // consume properties owned by the reCATPCHA, pass the rest to the div so the user can style it.\n\n    /* eslint-disable no-unused-vars */\n    var _this$props = this.props,\n        sitekey = _this$props.sitekey,\n        onChange = _this$props.onChange,\n        theme = _this$props.theme,\n        type = _this$props.type,\n        tabindex = _this$props.tabindex,\n        onExpired = _this$props.onExpired,\n        onErrored = _this$props.onErrored,\n        size = _this$props.size,\n        stoken = _this$props.stoken,\n        grecaptcha = _this$props.grecaptcha,\n        badge = _this$props.badge,\n        hl = _this$props.hl,\n        childProps = _objectWithoutPropertiesLoose(_this$props, [\"sitekey\", \"onChange\", \"theme\", \"type\", \"tabindex\", \"onExpired\", \"onErrored\", \"size\", \"stoken\", \"grecaptcha\", \"badge\", \"hl\"]);\n    /* eslint-enable no-unused-vars */\n\n\n    return React.createElement(\"div\", _extends({}, childProps, {\n      ref: this.handleRecaptchaRef\n    }));\n  };\n\n  return ReCAPTCHA;\n}(React.Component);\n\nexport { ReCAPTCHA as default };\nReCAPTCHA.displayName = \"ReCAPTCHA\";\nReCAPTCHA.propTypes = {\n  sitekey: PropTypes.string.isRequired,\n  onChange: PropTypes.func,\n  grecaptcha: PropTypes.object,\n  theme: PropTypes.oneOf([\"dark\", \"light\"]),\n  type: PropTypes.oneOf([\"image\", \"audio\"]),\n  tabindex: PropTypes.number,\n  onExpired: PropTypes.func,\n  onErrored: PropTypes.func,\n  size: PropTypes.oneOf([\"compact\", \"normal\", \"invisible\"]),\n  stoken: PropTypes.string,\n  hl: PropTypes.string,\n  badge: PropTypes.oneOf([\"bottomright\", \"bottomleft\", \"inline\"])\n};\nReCAPTCHA.defaultProps = {\n  onChange: function onChange() {},\n  theme: \"light\",\n  type: \"image\",\n  tabindex: 0,\n  size: \"normal\",\n  badge: \"bottomright\"\n};","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nimport { Component, createElement, forwardRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nvar SCRIPT_MAP = {}; // A counter used to generate a unique id for each component that uses the function\n\nvar idCount = 0;\nexport default function makeAsyncScript(getScriptURL, options) {\n  options = options || {};\n  return function wrapWithAsyncScript(WrappedComponent) {\n    var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n\n    var AsyncScriptLoader =\n    /*#__PURE__*/\n    function (_Component) {\n      _inheritsLoose(AsyncScriptLoader, _Component);\n\n      function AsyncScriptLoader(props, context) {\n        var _this;\n\n        _this = _Component.call(this, props, context) || this;\n        _this.state = {};\n        _this.__scriptURL = \"\";\n        return _this;\n      }\n\n      var _proto = AsyncScriptLoader.prototype;\n\n      _proto.asyncScriptLoaderGetScriptLoaderID = function asyncScriptLoaderGetScriptLoaderID() {\n        if (!this.__scriptLoaderID) {\n          this.__scriptLoaderID = \"async-script-loader-\" + idCount++;\n        }\n\n        return this.__scriptLoaderID;\n      };\n\n      _proto.setupScriptURL = function setupScriptURL() {\n        this.__scriptURL = typeof getScriptURL === \"function\" ? getScriptURL() : getScriptURL;\n        return this.__scriptURL;\n      };\n\n      _proto.asyncScriptLoaderHandleLoad = function asyncScriptLoaderHandleLoad(state) {\n        var _this2 = this;\n\n        // use reacts setState callback to fire props.asyncScriptOnLoad with new state/entry\n        this.setState(state, function () {\n          return _this2.props.asyncScriptOnLoad && _this2.props.asyncScriptOnLoad(_this2.state);\n        });\n      };\n\n      _proto.asyncScriptLoaderTriggerOnScriptLoaded = function asyncScriptLoaderTriggerOnScriptLoaded() {\n        var mapEntry = SCRIPT_MAP[this.__scriptURL];\n\n        if (!mapEntry || !mapEntry.loaded) {\n          throw new Error(\"Script is not loaded.\");\n        }\n\n        for (var obsKey in mapEntry.observers) {\n          mapEntry.observers[obsKey](mapEntry);\n        }\n\n        delete window[options.callbackName];\n      };\n\n      _proto.componentDidMount = function componentDidMount() {\n        var _this3 = this;\n\n        var scriptURL = this.setupScriptURL();\n        var key = this.asyncScriptLoaderGetScriptLoaderID();\n        var _options = options,\n            globalName = _options.globalName,\n            callbackName = _options.callbackName,\n            scriptId = _options.scriptId; // check if global object already attached to window\n\n        if (globalName && typeof window[globalName] !== \"undefined\") {\n          SCRIPT_MAP[scriptURL] = {\n            loaded: true,\n            observers: {}\n          };\n        } // check if script loading already\n\n\n        if (SCRIPT_MAP[scriptURL]) {\n          var entry = SCRIPT_MAP[scriptURL]; // if loaded or errored then \"finish\"\n\n          if (entry && (entry.loaded || entry.errored)) {\n            this.asyncScriptLoaderHandleLoad(entry);\n            return;\n          } // if still loading then callback to observer queue\n\n\n          entry.observers[key] = function (entry) {\n            return _this3.asyncScriptLoaderHandleLoad(entry);\n          };\n\n          return;\n        }\n        /*\n         * hasn't started loading\n         * start the \"magic\"\n         * setup script to load and observers\n         */\n\n\n        var observers = {};\n\n        observers[key] = function (entry) {\n          return _this3.asyncScriptLoaderHandleLoad(entry);\n        };\n\n        SCRIPT_MAP[scriptURL] = {\n          loaded: false,\n          observers: observers\n        };\n        var script = document.createElement(\"script\");\n        script.src = scriptURL;\n        script.async = true;\n\n        for (var attribute in options.attributes) {\n          script.setAttribute(attribute, options.attributes[attribute]);\n        }\n\n        if (scriptId) {\n          script.id = scriptId;\n        }\n\n        var callObserverFuncAndRemoveObserver = function callObserverFuncAndRemoveObserver(func) {\n          if (SCRIPT_MAP[scriptURL]) {\n            var mapEntry = SCRIPT_MAP[scriptURL];\n            var observersMap = mapEntry.observers;\n\n            for (var obsKey in observersMap) {\n              if (func(observersMap[obsKey])) {\n                delete observersMap[obsKey];\n              }\n            }\n          }\n        };\n\n        if (callbackName && typeof window !== \"undefined\") {\n          window[callbackName] = function () {\n            return _this3.asyncScriptLoaderTriggerOnScriptLoaded();\n          };\n        }\n\n        script.onload = function () {\n          var mapEntry = SCRIPT_MAP[scriptURL];\n\n          if (mapEntry) {\n            mapEntry.loaded = true;\n            callObserverFuncAndRemoveObserver(function (observer) {\n              if (callbackName) {\n                return false;\n              }\n\n              observer(mapEntry);\n              return true;\n            });\n          }\n        };\n\n        script.onerror = function () {\n          var mapEntry = SCRIPT_MAP[scriptURL];\n\n          if (mapEntry) {\n            mapEntry.errored = true;\n            callObserverFuncAndRemoveObserver(function (observer) {\n              observer(mapEntry);\n              return true;\n            });\n          }\n        };\n\n        document.body.appendChild(script);\n      };\n\n      _proto.componentWillUnmount = function componentWillUnmount() {\n        // Remove tag script\n        var scriptURL = this.__scriptURL;\n\n        if (options.removeOnUnmount === true) {\n          var allScripts = document.getElementsByTagName(\"script\");\n\n          for (var i = 0; i < allScripts.length; i += 1) {\n            if (allScripts[i].src.indexOf(scriptURL) > -1) {\n              if (allScripts[i].parentNode) {\n                allScripts[i].parentNode.removeChild(allScripts[i]);\n              }\n            }\n          }\n        } // Clean the observer entry\n\n\n        var mapEntry = SCRIPT_MAP[scriptURL];\n\n        if (mapEntry) {\n          delete mapEntry.observers[this.asyncScriptLoaderGetScriptLoaderID()];\n\n          if (options.removeOnUnmount === true) {\n            delete SCRIPT_MAP[scriptURL];\n          }\n        }\n      };\n\n      _proto.render = function render() {\n        var globalName = options.globalName; // remove asyncScriptOnLoad from childProps\n\n        var _this$props = this.props,\n            asyncScriptOnLoad = _this$props.asyncScriptOnLoad,\n            forwardedRef = _this$props.forwardedRef,\n            childProps = _objectWithoutPropertiesLoose(_this$props, [\"asyncScriptOnLoad\", \"forwardedRef\"]); // eslint-disable-line no-unused-vars\n\n\n        if (globalName && typeof window !== \"undefined\") {\n          childProps[globalName] = typeof window[globalName] !== \"undefined\" ? window[globalName] : undefined;\n        }\n\n        childProps.ref = forwardedRef;\n        return createElement(WrappedComponent, childProps);\n      };\n\n      return AsyncScriptLoader;\n    }(Component); // Note the second param \"ref\" provided by React.forwardRef.\n    // We can pass it along to AsyncScriptLoader as a regular prop, e.g. \"forwardedRef\"\n    // And it can then be attached to the Component.\n\n\n    var ForwardedComponent = forwardRef(function (props, ref) {\n      return createElement(AsyncScriptLoader, _extends({}, props, {\n        forwardedRef: ref\n      }));\n    });\n    ForwardedComponent.displayName = \"AsyncScriptLoader(\" + wrappedComponentName + \")\";\n    ForwardedComponent.propTypes = {\n      asyncScriptOnLoad: PropTypes.func\n    };\n    return hoistStatics(ForwardedComponent, WrappedComponent);\n  };\n}","import ReCAPTCHA from \"./recaptcha\";\nimport makeAsyncScriptLoader from \"react-async-script\";\nvar callbackName = \"onloadcallback\";\nvar globalName = \"grecaptcha\";\n\nfunction getOptions() {\n  return typeof window !== \"undefined\" && window.recaptchaOptions || {};\n}\n\nfunction getURL() {\n  var dynamicOptions = getOptions();\n  var hostname = dynamicOptions.useRecaptchaNet ? \"recaptcha.net\" : \"www.google.com\";\n  return \"https://\" + hostname + \"/recaptcha/api.js?onload=\" + callbackName + \"&render=explicit\";\n}\n\nexport default makeAsyncScriptLoader(getURL, {\n  callbackName: callbackName,\n  globalName: globalName\n})(ReCAPTCHA);","import RecaptchaWrapper from \"./recaptcha-wrapper\";\nimport ReCAPTCHA from \"./recaptcha\";\nexport default RecaptchaWrapper;\nexport { ReCAPTCHA };"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_assertThisInitialized","self","ReferenceError","ReCAPTCHA","_React$Component","subClass","superClass","_this","handleExpired","bind","handleErrored","handleChange","handleRecaptchaRef","create","constructor","__proto__","_proto","getValue","props","grecaptcha","undefined","_widgetId","getResponse","getWidgetId","execute","_executeRequested","executeAsync","_this2","Promise","resolve","reject","executionResolve","executionReject","reset","onExpired","onErrored","token","onChange","explicitRender","render","wrapper","document","createElement","sitekey","callback","theme","type","tabindex","size","stoken","hl","badge","captcha","appendChild","componentDidMount","componentDidUpdate","componentWillUnmount","delayOfCaptchaIframeRemoving","temporaryNode","body","style","display","firstChild","setTimeout","removeChild","elem","_this$props","childProps","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","ref","displayName","propTypes","defaultProps","getScriptURL","options","SCRIPT_MAP","idCount","callbackName","window","recaptchaOptions","useRecaptchaNet","globalName","WrappedComponent","wrappedComponentName","name","AsyncScriptLoader","_Component","context","state","__scriptURL","asyncScriptLoaderGetScriptLoaderID","__scriptLoaderID","setupScriptURL","asyncScriptLoaderHandleLoad","setState","asyncScriptOnLoad","asyncScriptLoaderTriggerOnScriptLoaded","mapEntry","loaded","Error","obsKey","observers","_this3","scriptURL","_options","scriptId","entry","errored","script","attribute","src","async","attributes","setAttribute","id","callObserverFuncAndRemoveObserver","func","observersMap","onload","observer","onerror","removeOnUnmount","allScripts","getElementsByTagName","parentNode","forwardedRef","Component","ForwardedComponent","forwardRef"],"sourceRoot":""}