diff --git a/js/dist/forum.js b/js/dist/forum.js index 3634b3b..a59f5d4 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t={24:(t,r,e)=>{var n=e(735).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var r,e={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function p(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{p({},"")}catch(r){p=function(t,r,e){return t[r]=e}}function d(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),a=new B(n||[]);return s(i,"_invoke",{value:O(t,e,a)}),i}function m(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",v="suspendedYield",g="executing",y="completed",b={};function w(){}function L(){}function x(){}var k={};p(k,c,(function(){return this}));var _=Object.getPrototypeOf,I=_&&_(_(F([])));I&&I!==i&&a.call(I,c)&&(k=I);var P=x.prototype=w.prototype=Object.create(k);function A(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function N(t,r){function e(o,i,s,u){var c=m(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,s,u)}),(function(t){e("throw",t,s,u)})):r.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return e("throw",t,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function O(t,e,n){var o=h;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var c=m(t,e,n);if("normal"===c.type){if(o=n.done?y:v,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function E(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=m(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,b;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,b):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function j(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function S(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function F(t){if(t||""===t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),S(e),b}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;S(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:F(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),b}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,r,e)=>{var n=e(24)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{components:()=>ot,extend:()=>nt});const t=flarum.core.compat["forum/app"];var r=e.n(t);const o=flarum.core.compat["common/extend"],i=flarum.core.compat["forum/components/UserSecurityPage"];var a=e.n(i);function s(t,r,e,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void e(t)}s.done?r(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var i=t.apply(r,e);function a(t){s(i,n,o,a,u,"next",t)}function u(t){s(i,n,o,a,u,"throw",t)}a(void 0)}))}}function c(t,r){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},c(t,r)}function l(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,c(t,r)}var f=e(183),p=e.n(f);const d=flarum.core.compat["common/Component"];var h=e.n(d);const v=flarum.core.compat["common/components/FieldSet"];var g=e.n(v);const y=flarum.core.compat["common/helpers/listItems"];var b=e.n(y);const w=flarum.core.compat["common/utils/ItemList"];var L=e.n(w);const x=flarum.core.compat["common/components/LoadingIndicator"];var k=e.n(x);const _=flarum.core.compat["common/helpers/icon"];var I=e.n(_);const P=flarum.core.compat["common/components/Button"];var A=e.n(P);const N=flarum.core.compat["common/helpers/humanTime"];var O=e.n(N);const E=flarum.core.compat["common/components/LabelValue"];var j=e.n(E),S=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var n=e.prototype;return n.view=function(t){var e=this.attrs.provider;return e.orphaned()?m("div",null,m("p",{className:"LinkedAccountsList-item-title"},e.name()),m("p",{className:"helpText"},r().translator.trans("fof-oauth.forum.user.settings.linked-account.orphaned-account")),m("div",{className:"LinkedAccountsList"},this.providerInfoItems(e).toArray())):e.linked()?m("div",null,m("p",{className:"LinkedAccountsList-item-title"},r().translator.trans("fof-oauth.forum.providers."+e.name())),m("div",{className:"LinkedAccountsList"},this.providerInfoItems(e).toArray())):m("div",null,m("p",{className:"LinkedAccountsList-item-title"},r().translator.trans("fof-oauth.forum.providers."+e.name())))},n.providerInfoItems=function(t){var e=new(L());return e.add("firstLogin",m(j(),{label:r().translator.trans("fof-oauth.forum.user.settings.linked-account.link-created-label"),value:O()(t.firstLogin())}),100),e.add("lastLogin",m(j(),{label:r().translator.trans("fof-oauth.forum.user.settings.linked-account.last-used-label"),value:O()(t.lastLogin())}),90),e},e}(h());const B=flarum.core.compat["common/utils/extractText"];var F=e.n(B),T=function(t){function e(){for(var r,e=arguments.length,n=new Array(e),o=0;o{var t={24:(t,r,e)=>{var n=e(735).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var r,e={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function p(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{p({},"")}catch(r){p=function(t,r,e){return t[r]=e}}function m(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),a=new B(n||[]);return s(i,"_invoke",{value:O(t,e,a)}),i}function d(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=m;var h="suspendedStart",v="suspendedYield",g="executing",y="completed",b={};function w(){}function L(){}function x(){}var k={};p(k,c,(function(){return this}));var _=Object.getPrototypeOf,I=_&&_(_(F([])));I&&I!==i&&a.call(I,c)&&(k=I);var P=x.prototype=w.prototype=Object.create(k);function A(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function N(t,r){function e(o,i,s,u){var c=d(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,s,u)}),(function(t){e("throw",t,s,u)})):r.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return e("throw",t,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function O(t,e,n){var o=h;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var c=d(t,e,n);if("normal"===c.type){if(o=n.done?y:v,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function E(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=d(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,b;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,b):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function j(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function S(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function F(t){if(t||""===t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),S(e),b}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;S(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:F(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),b}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,r,e)=>{var n=e(24)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{components:()=>at,extend:()=>it});const t=flarum.core.compat["forum/app"];var r=e.n(t);const o=flarum.core.compat["common/extend"],i=flarum.core.compat["forum/components/UserSecurityPage"];var a=e.n(i);function s(t,r,e,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void e(t)}s.done?r(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var i=t.apply(r,e);function a(t){s(i,n,o,a,u,"next",t)}function u(t){s(i,n,o,a,u,"throw",t)}a(void 0)}))}}function c(t,r){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},c(t,r)}function l(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,c(t,r)}var f=e(183),p=e.n(f);const d=flarum.core.compat["common/Component"];var h=e.n(d);const v=flarum.core.compat["common/components/FieldSet"];var g=e.n(v);const y=flarum.core.compat["common/helpers/listItems"];var b=e.n(y);const w=flarum.core.compat["common/utils/ItemList"];var L=e.n(w);const x=flarum.core.compat["common/components/LoadingIndicator"];var k=e.n(x);const _=flarum.core.compat["common/helpers/icon"];var I=e.n(_);const P=flarum.core.compat["common/components/Button"];var A=e.n(P);const N=flarum.core.compat["common/components/Link"];var O=e.n(N);const E=flarum.core.compat["common/helpers/humanTime"];var j=e.n(E);const S=flarum.core.compat["common/components/LabelValue"];var B=e.n(S),F=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var n=e.prototype;return n.view=function(t){var e=this.attrs.provider;return e.orphaned()?m("div",null,m("p",{className:"LinkedAccountsList-item-title"},e.name()),m("p",{className:"helpText"},r().translator.trans("fof-oauth.forum.user.settings.linked-account.orphaned-account")),m("div",{className:"LinkedAccountsList"},this.providerInfoItems(e).toArray())):e.linked()?m("div",null,m("p",{className:"LinkedAccountsList-item-title"},r().translator.trans("fof-oauth.forum.providers."+e.name())),m("div",{className:"LinkedAccountsList"},this.providerInfoItems(e).toArray())):m("div",null,m("p",{className:"LinkedAccountsList-item-title"},r().translator.trans("fof-oauth.forum.providers."+e.name())))},n.providerInfoItems=function(t){var e=new(L());return e.add("firstLogin",m(B(),{label:r().translator.trans("fof-oauth.forum.user.settings.linked-account.link-created-label"),value:j()(t.firstLogin())}),100),e.add("lastLogin",m(B(),{label:r().translator.trans("fof-oauth.forum.user.settings.linked-account.last-used-label"),value:j()(t.lastLogin())}),90),e},e}(h());const T=flarum.core.compat["common/utils/extractText"];var M=e.n(T),G=function(t){function e(){for(var r,e=arguments.length,n=new Array(e),o=0;o= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserSecurityPage'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/FieldSet'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LabelValue'];","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport type LinkedAccount from '../models/LinkedAccount';\nimport type Mithril from 'mithril';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LabelValue from 'flarum/common/components/LabelValue';\nimport ItemList from 'flarum/common/utils/ItemList';\n\ninterface IProviderInfoAttrs {\n provider: LinkedAccount;\n}\n\nexport default class ProviderInfo extends Component {\n view(vnode: Mithril.Vnode): Mithril.Children {\n const { provider } = this.attrs;\n\n if (provider.orphaned()) {\n return (\n
\n

{provider.name()}

\n

{app.translator.trans('fof-oauth.forum.user.settings.linked-account.orphaned-account')}

\n
{this.providerInfoItems(provider).toArray()}
\n
\n );\n }\n\n if (provider.linked()) {\n return (\n
\n

{app.translator.trans(`fof-oauth.forum.providers.${provider.name()}`)}

\n
{this.providerInfoItems(provider).toArray()}
\n
\n );\n }\n\n return (\n
\n

{app.translator.trans(`fof-oauth.forum.providers.${provider.name()}`)}

\n
\n );\n }\n\n providerInfoItems(provider: LinkedAccount): ItemList {\n const items = new ItemList();\n\n items.add(\n 'firstLogin',\n ,\n 100\n );\n\n items.add(\n 'lastLogin',\n ,\n 90\n );\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport LinkedAccount from '../models/LinkedAccount';\nimport User from 'flarum/common/models/User';\nimport ProviderInfo from './ProviderInfo';\nimport extractText from 'flarum/common/utils/extractText';\n\ninterface IAttrs extends ComponentAttrs {\n provider: LinkedAccount;\n user: User;\n}\n\nexport default class LinkStatus extends Component {\n state = {\n loading: false,\n };\n\n onbeforeupdate(vnode: Mithril.Vnode) {\n super.onbeforeupdate(vnode);\n if (app.fof_oauth_linkingInProgress && app.fof_oauth_linkingProvider === this.attrs.provider.name()) {\n this.state.loading = true;\n } else if (app.fof_oauth_linkingInProgress === false && app.fof_oauth_linkingProvider === this.attrs.provider.name()) {\n this.state.loading = false;\n delete app.fof_oauth_linkingInProgress;\n delete app.fof_oauth_linkingProvider;\n }\n }\n\n view(vnode: Mithril.Vnode): Mithril.Children {\n return (\n
\n {this.iconView()}\n {this.statusView()}\n {this.actionView()}\n
\n );\n }\n\n iconView() {\n return (\n
\n {icon(this.attrs.provider.icon(), { className: `Provider-Icon Provider-Icon--${this.attrs.provider.name()}` })}\n
\n );\n }\n\n statusView() {\n const provider = this.attrs.provider;\n\n return ;\n }\n\n actionView() {\n const provider = this.attrs.provider;\n const user = this.attrs.user;\n\n if (provider.linked()) {\n return (\n
\n this.deleteProvider(provider)}\n loading={this.state.loading}\n >\n {app.translator.trans('fof-oauth.forum.unlink')}\n \n
\n );\n } else if (!provider.orphaned() && (user.id() === app.session.user?.id() || !app.forum.attribute('fofOauthModerate'))) {\n return (\n
\n \n {app.translator.trans(`fof-oauth.forum.log_in.with_${provider.name()}_button`, {\n provider: app.translator.trans(`fof-oauth.forum.providers.${provider.name()}`),\n })}\n \n
\n );\n }\n return null;\n }\n\n async deleteProvider(provider: LinkedAccount) {\n if (\n confirm(\n extractText(\n app.translator.trans('fof-oauth.forum.user.settings.linked-account.unlink-confirm', {\n provider: app.translator.trans(`fof-oauth.forum.providers.${provider.name()}`),\n })\n )\n )\n ) {\n this.state.loading = true;\n await provider.delete();\n await app.store.find('users/' + this.attrs.user.id() + '/linked-accounts', {});\n this.state.loading = false;\n m.redraw();\n }\n }\n}\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nimport type Mithril from 'mithril';\nimport type User from 'flarum/common/models/User';\n\nimport LinkedAccount from '../models/LinkedAccount';\nimport LinkStatus from './LinkStatus';\n\ninterface IAttrs {\n user: User;\n}\n\ninterface IState {\n loadingAdditional: boolean;\n errorLoadingAdditional: boolean;\n}\n\nexport default class LinkedAccounts extends Component {\n state: IState = {\n loadingAdditional: true,\n errorLoadingAdditional: false,\n };\n\n oncreate(vnode: Mithril.VnodeDOM): void {\n super.oncreate(vnode);\n this.loadLinkedAccounts();\n }\n\n view(vnode: Mithril.Vnode) {\n const linkedAccounts = app.store.all('linked-accounts');\n\n return (\n
\n

{app.translator.trans('fof-oauth.forum.user.settings.linked-account.help')}

\n\n {this.state.loadingAdditional ? (\n \n ) : (\n
    {listItems(this.linkedAccountsItems(linkedAccounts, this.attrs.user).toArray())}
\n )}\n
\n );\n }\n\n linkedAccountsItems(linkedAccounts: LinkedAccount[], user: User): ItemList {\n const items = new ItemList();\n\n linkedAccounts.forEach((linkedAccount) => {\n items.add(linkedAccount.name(), , linkedAccount.priority());\n });\n\n return items;\n }\n\n async loadLinkedAccounts() {\n await app.store.find('users/' + this.attrs.user.id() + '/linked-accounts', {});\n this.state.loadingAdditional = false;\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInButtons'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SignUpModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/ForumApplication'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class LinkedAccount extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n\n icon() {\n return Model.attribute('icon').call(this);\n }\n\n priority() {\n return Model.attribute('priority').call(this);\n }\n\n linked() {\n return Model.attribute('linked').call(this);\n }\n\n orphaned() {\n return Model.attribute('orphaned').call(this);\n }\n\n identifier() {\n return Model.attribute('identifier').call(this);\n }\n\n providerIdentifier() {\n return Model.attribute('providerIdentifier').call(this);\n }\n\n firstLogin() {\n return Model.attribute('firstLogin', Model.transformDate).call(this);\n }\n\n lastLogin() {\n return Model.attribute('lastLogin', Model.transformDate).call(this);\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nimport LinkedAccount from './models/LinkedAccount';\n\nexport default [\n new Extend.Model(User) //\n .attribute('loginProvider'),\n\n new Extend.Store() //\n .add('linked-accounts', LinkedAccount),\n];\n","import LinkStatus from './LinkStatus';\nimport LinkedAccounts from './LinkedAccounts';\nimport ProviderInfo from './ProviderInfo';\n\nexport const components = {\n ProviderInfo,\n LinkStatus,\n LinkedAccounts,\n};\n","import app from 'flarum/forum/app';\nimport addLinkedAccountsToUserSecurityPage from './extenders/addLinkedAccountsToUserSecurityPage';\nimport extendLoginSignup from './extenders/extendLoginSignup';\n\nexport { default as extend } from './extend';\n\nexport * from './components';\n\napp.initializers.add('fof/oauth', () => {\n extendLoginSignup();\n addLinkedAccountsToUserSecurityPage();\n});\n","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport LogInButtons from 'flarum/forum/components/LogInButtons';\nimport LogInButton from 'flarum/forum/components/LogInButton';\nimport extractText from 'flarum/common/utils/extractText';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport SignUpModal from 'flarum/forum/components/SignUpModal';\nimport ForumApplication from 'flarum/forum/ForumApplication';\n\nexport default function () {\n extend(LogInButton, 'initAttrs', function (returnedValue, attrs) {\n const fullscreen = app.forum.attribute('fof-oauth.fullscreenPopup');\n\n if (fullscreen) {\n attrs.onclick = function () {\n window.open(app.forum.attribute('baseUrl') + attrs.path, 'logInPopup', 'fullscreen=yes');\n };\n } else {\n // Default values\n const defaultWidth = 580;\n const defaultHeight = 400;\n\n const width = app.forum.attribute('fof-oauth.popupWidth') || defaultWidth;\n const height = app.forum.attribute('fof-oauth.popupHeight') || defaultHeight;\n\n const $window = $(window);\n\n attrs.onclick = function () {\n window.open(\n app.forum.attribute('baseUrl') + attrs.path,\n 'logInPopup',\n `width=${width},` +\n `height=${height},` +\n `top=${$window.height() / 2 - height / 2},` +\n `left=${$window.width() / 2 - width / 2},` +\n 'status=no,scrollbars=yes,resizable=no'\n );\n };\n }\n });\n\n extend(LogInButtons.prototype, 'items', function (items) {\n const onlyIcons = !!app.forum.attribute('fof-oauth.only_icons');\n const buttons = app.forum.attribute('fof-oauth').filter(Boolean);\n const googleButton = buttons.splice(buttons.indexOf(buttons.find((b) => b.name === 'google')), 1);\n\n buttons.concat(googleButton).forEach(({ name, icon, priority }) => {\n let className = `Button FoFLogInButton LogInButton--${name}`;\n\n // Google branding does not allow inline icon, so we'll keep the full button\n if (onlyIcons && name !== 'google') {\n className += ' Button--icon';\n }\n\n items.add(\n name,\n
\n \n {app.translator.trans(`fof-oauth.forum.log_in.with_${name}_button`, {\n provider: app.translator.trans(`fof-oauth.forum.providers.${name}`),\n })}\n \n
,\n priority\n );\n });\n });\n\n override(LogInButton.prototype, 'view', function (orig, vnode) {\n const onlyIcons = !!app.forum.attribute('fof-oauth.only_icons');\n if (!onlyIcons) return orig(vnode);\n\n const child = orig(vnode);\n\n return {child};\n });\n\n extend(LogInButtons.prototype, 'view', function (vdom) {\n const onlyIcons = !!app.forum.attribute('fof-oauth.only_icons');\n if (!onlyIcons) return;\n\n vdom.attrs.className += ' FoFLogInButtons--icons';\n });\n\n extend(ForumApplication.prototype, 'authenticationComplete', function (_, payload) {\n if (payload.loggedIn) {\n app.fof_oauth_loginInProgress = true;\n // This will automatically be reset, as authenticationComplete also triggers a window reload.\n\n m.redraw();\n }\n });\n\n ForumApplication.prototype.linkingComplete = async function () {\n try {\n app.fof_oauth_linkingInProgress = true;\n m.redraw();\n\n // Refresh the list of providers\n const newProviders = await this.store.find('linked-accounts');\n\n // The store will contain an old version of the login provider (unlinked) that has\n // another ID than the new one (linked). We need to delete that one from the store\n // so that the UI gets updated correctly.\n\n // Find the old provider (one that has the same name as one of the new providers & has providerIdentifier===null)\n const oldProvider = this.store\n .all('linked-accounts')\n // Find the providers that have not yet been linked (providerIdentifier is null)\n .filter((p) => p.providerIdentifier() === null)\n // Match it with one of the newly fetched providers by name\n .find((p) => newProviders.some((np) => np.name() === p.name()));\n\n if (oldProvider) {\n delete this.store.data['linked-accounts'][oldProvider.id()];\n } else {\n window.location.reload();\n return;\n }\n\n // Refresh the session user\n await this.store.find('users', app.session.user.id());\n\n app.fof_oauth_linkingInProgress = false;\n m.redraw();\n } catch (error) {\n app.fof_oauth_linkingInProgress = false;\n m.redraw();\n }\n };\n\n extend(LogInModal.prototype, 'onbeforeupdate', function (vnode) {\n if (app.fof_oauth_loginInProgress) {\n this.loading = true;\n }\n });\n\n extend(SignUpModal.prototype, 'onbeforeupdate', function (vnode) {\n if (app.fof_oauth_loginInProgress) {\n this.loading = true;\n }\n });\n\n extend(SignUpModal.prototype, 'fields', function (items) {\n // If a suggested username was not provided by the OAuth service, display some help text to the user.\n if (!!this.attrs.token && !!!this.attrs.username) {\n items.add(\n 'username-help',\n
\n

{app.translator.trans('fof-oauth.forum.signup.username_help')}

\n
,\n 35\n );\n }\n\n return items;\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport UserSecurityPage from 'flarum/forum/components/UserSecurityPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport LinkedAccounts from '../components/LinkedAccounts';\nimport type Mithril from 'mithril';\n\nexport default function addLinkedAccountsToUserSecurityPage() {\n extend(UserSecurityPage.prototype, 'settingsItems', function (items: ItemList) {\n if (this.user !== app.session.user && !app.forum.attribute('fofOauthModerate')) {\n return;\n }\n\n items.add('linkedAccounts', , 5);\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","asyncGeneratorStep","gen","reject","_next","_throw","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","ProviderInfo","_Component","_proto","view","vnode","provider","attrs","orphaned","m","className","app","trans","providerInfoItems","toArray","linked","items","ItemList","add","LabelValue","label","humanTime","firstLogin","lastLogin","Component","LinkStatus","_this","_len","Array","_key","concat","state","loading","onbeforeupdate","iconView","statusView","actionView","icon","_app$session$user","_this2","user","Button","onclick","deleteProvider","id","attribute","path","_deleteProvider","_callee","_context","confirm","extractText","find","redraw","_x","LinkedAccounts","loadingAdditional","errorLoadingAdditional","oncreate","loadLinkedAccounts","linkedAccounts","all","FieldSet","LoadingIndicator","containerClassName","listItems","linkedAccountsItems","linkedAccount","priority","_loadLinkedAccounts","LinkedAccount","_Model","Model","identifier","providerIdentifier","Extend","User","components","extend","LogInButton","returnedValue","window","open","width","height","$window","$","LogInButtons","onlyIcons","buttons","filter","Boolean","googleButton","splice","indexOf","b","_ref","disabled","override","orig","child","Tooltip","text","children","vdom","ForumApplication","_","payload","loggedIn","linkingComplete","newProviders","oldProvider","store","some","np","data","location","reload","t0","LogInModal","SignUpModal","token","username","UserSecurityPage"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";0BAAA,IAAIA,EAAUC,EAAAA,KAAAA,QACd,SAASC,IACP,aACAC,EAAOC,QAAUF,EAAsB,WACrC,OAAOG,CACT,EAAGF,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAiB,QAAID,EAAOC,QACxE,IAAIG,EACFF,EAAI,CAAC,EACLG,EAAIC,OAAOC,UACXC,EAAIH,EAAEI,eACNC,EAAIJ,OAAOK,gBAAkB,SAAUP,EAAGF,EAAGG,GAC3CD,EAAEF,GAAKG,EAAEO,KACX,EACAC,EAAI,mBAAqBC,OAASA,OAAS,CAAC,EAC5CC,EAAIF,EAAEG,UAAY,aAClBC,EAAIJ,EAAEK,eAAiB,kBACvBC,EAAIN,EAAEO,aAAe,gBACvB,SAASC,EAAOjB,EAAGF,EAAGG,GACpB,OAAOC,OAAOK,eAAeP,EAAGF,EAAG,CACjCU,MAAOP,EACPiB,YAAY,EACZC,cAAc,EACdC,U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EAAAlG,KAAA,GAAAkG,EAAAsE,GAAAtE,EAAA,SAEXxC,IAAAA,6BAAkC,EAClCF,EAAE8C,SAAS,yBAAAJ,EAAA/F,OAAA,GAAA8F,EAAA,oBAIf8B,EAAAA,EAAAA,QAAO0C,IAAAA,UAAsB,kBAAkB,SAAUrH,GACnDM,IAAAA,4BACF/G,KAAKoI,SAAU,EAEnB,KAEAgD,EAAAA,EAAAA,QAAO2C,IAAAA,UAAuB,kBAAkB,SAAUtH,GACpDM,IAAAA,4BACF/G,KAAKoI,SAAU,EAEnB,KAEAgD,EAAAA,EAAAA,QAAO2C,IAAAA,UAAuB,UAAU,SAAU3G,GAYhD,OAVMpH,KAAK2G,MAAMqH,QAAYhO,KAAK2G,MAAMsH,UACtC7G,EAAME,IACJ,gBACAT,EAAA,WACEA,EAAA,SAAIE,IAAAA,WAAeC,MAAM,0CAE3B,IAIGI,CACT,KCrJAgE,EAAAA,EAAAA,QAAO8C,IAAAA,UAA4B,iBAAiB,SAAU9G,IACxDpH,KAAK4I,OAAS7B,IAAAA,QAAY6B,MAAS7B,IAAAA,MAAUkC,UAAU,sBAI3D7B,EAAME,IAAI,iBAAkBT,EAACgD,EAAc,CAACjB,KAAM5I,KAAK4I,OAAU,EACnE,GFHF","sources":["webpack://@fof/oauth/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/oauth/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/oauth/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/oauth/webpack/bootstrap","webpack://@fof/oauth/webpack/runtime/compat get default export","webpack://@fof/oauth/webpack/runtime/define property getters","webpack://@fof/oauth/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/oauth/webpack/runtime/make namespace object","webpack://@fof/oauth/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/oauth/external root \"flarum.core.compat['forum/components/UserSecurityPage']\"","webpack://@fof/oauth/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/oauth/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/oauth/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/oauth/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/components/FieldSet']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/components/LabelValue']\"","webpack://@fof/oauth/./src/forum/components/ProviderInfo.tsx","webpack://@fof/oauth/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/oauth/./src/forum/components/LinkStatus.tsx","webpack://@fof/oauth/./src/forum/components/LinkedAccounts.tsx","webpack://@fof/oauth/external root \"flarum.core.compat['forum/components/LogInButtons']\"","webpack://@fof/oauth/external root \"flarum.core.compat['forum/components/LogInButton']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/oauth/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/oauth/external root \"flarum.core.compat['forum/components/SignUpModal']\"","webpack://@fof/oauth/external root \"flarum.core.compat['forum/ForumApplication']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/oauth/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/oauth/./src/forum/models/LinkedAccount.ts","webpack://@fof/oauth/./src/forum/extend.ts","webpack://@fof/oauth/./src/forum/components/index.ts","webpack://@fof/oauth/./src/forum/index.ts","webpack://@fof/oauth/./src/forum/extenders/extendLoginSignup.js","webpack://@fof/oauth/./src/forum/extenders/addLinkedAccountsToUserSecurityPage.tsx"],"sourcesContent":["var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserSecurityPage'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/FieldSet'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LabelValue'];","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport type LinkedAccount from '../models/LinkedAccount';\nimport type Mithril from 'mithril';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LabelValue from 'flarum/common/components/LabelValue';\nimport ItemList from 'flarum/common/utils/ItemList';\n\ninterface IProviderInfoAttrs {\n provider: LinkedAccount;\n}\n\nexport default class ProviderInfo extends Component {\n view(vnode: Mithril.Vnode): Mithril.Children {\n const { provider } = this.attrs;\n\n if (provider.orphaned()) {\n return (\n
\n

{provider.name()}

\n

{app.translator.trans('fof-oauth.forum.user.settings.linked-account.orphaned-account')}

\n
{this.providerInfoItems(provider).toArray()}
\n
\n );\n }\n\n if (provider.linked()) {\n return (\n
\n

{app.translator.trans(`fof-oauth.forum.providers.${provider.name()}`)}

\n
{this.providerInfoItems(provider).toArray()}
\n
\n );\n }\n\n return (\n
\n

{app.translator.trans(`fof-oauth.forum.providers.${provider.name()}`)}

\n
\n );\n }\n\n providerInfoItems(provider: LinkedAccount): ItemList {\n const items = new ItemList();\n\n items.add(\n 'firstLogin',\n ,\n 100\n );\n\n items.add(\n 'lastLogin',\n ,\n 90\n );\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Button from 'flarum/common/components/Button';\nimport Link from 'flarum/common/components/Link';\nimport type Mithril from 'mithril';\nimport LinkedAccount from '../models/LinkedAccount';\nimport User from 'flarum/common/models/User';\nimport ProviderInfo from './ProviderInfo';\nimport extractText from 'flarum/common/utils/extractText';\n\ninterface IAttrs extends ComponentAttrs {\n provider: LinkedAccount;\n user: User;\n}\n\nexport default class LinkStatus extends Component {\n state = {\n loading: false,\n };\n\n onbeforeupdate(vnode: Mithril.Vnode) {\n super.onbeforeupdate(vnode);\n if (app.fof_oauth_linkingInProgress && app.fof_oauth_linkingProvider === this.attrs.provider.name()) {\n this.state.loading = true;\n } else if (app.fof_oauth_linkingInProgress === false && app.fof_oauth_linkingProvider === this.attrs.provider.name()) {\n this.state.loading = false;\n delete app.fof_oauth_linkingInProgress;\n delete app.fof_oauth_linkingProvider;\n }\n }\n\n view(vnode: Mithril.Vnode): Mithril.Children {\n return (\n
\n {this.iconView()}\n {this.statusView()}\n {this.actionView()}\n
\n );\n }\n\n iconView() {\n return (\n
\n {icon(this.attrs.provider.icon(), { className: `Provider-Icon Provider-Icon--${this.attrs.provider.name()}` })}\n
\n );\n }\n\n statusView() {\n const provider = this.attrs.provider;\n\n return ;\n }\n\n actionView() {\n const provider = this.attrs.provider;\n const user = this.attrs.user;\n\n if (provider.linked()) {\n return (\n
\n this.deleteProvider(provider)}\n loading={this.state.loading}\n >\n {app.translator.trans('fof-oauth.forum.unlink')}\n \n
\n );\n } else if (!provider.orphaned() && (user.id() === app.session.user?.id() || !app.forum.attribute('fofOauthModerate'))) {\n return (\n
\n \n {app.translator.trans(`fof-oauth.forum.log_in.with_${provider.name()}_button`, {\n provider: app.translator.trans(`fof-oauth.forum.providers.${provider.name()}`),\n })}\n \n
\n );\n }\n return null;\n }\n\n async deleteProvider(provider: LinkedAccount) {\n if (\n confirm(\n extractText(\n app.translator.trans('fof-oauth.forum.user.settings.linked-account.unlink-confirm', {\n provider: app.translator.trans(`fof-oauth.forum.providers.${provider.name()}`),\n })\n )\n )\n ) {\n this.state.loading = true;\n await provider.delete();\n await app.store.find('users/' + this.attrs.user.id() + '/linked-accounts', {});\n this.state.loading = false;\n m.redraw();\n }\n }\n}\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nimport type Mithril from 'mithril';\nimport type User from 'flarum/common/models/User';\n\nimport LinkedAccount from '../models/LinkedAccount';\nimport LinkStatus from './LinkStatus';\n\ninterface IAttrs {\n user: User;\n}\n\ninterface IState {\n loadingAdditional: boolean;\n errorLoadingAdditional: boolean;\n}\n\nexport default class LinkedAccounts extends Component {\n state: IState = {\n loadingAdditional: true,\n errorLoadingAdditional: false,\n };\n\n oncreate(vnode: Mithril.VnodeDOM): void {\n super.oncreate(vnode);\n this.loadLinkedAccounts();\n }\n\n view(vnode: Mithril.Vnode) {\n const linkedAccounts = app.store.all('linked-accounts');\n\n return (\n
\n

{app.translator.trans('fof-oauth.forum.user.settings.linked-account.help')}

\n\n {this.state.loadingAdditional ? (\n \n ) : (\n
    {listItems(this.linkedAccountsItems(linkedAccounts, this.attrs.user).toArray())}
\n )}\n
\n );\n }\n\n linkedAccountsItems(linkedAccounts: LinkedAccount[], user: User): ItemList {\n const items = new ItemList();\n\n linkedAccounts.forEach((linkedAccount) => {\n items.add(linkedAccount.name(), , linkedAccount.priority());\n });\n\n return items;\n }\n\n async loadLinkedAccounts() {\n await app.store.find('users/' + this.attrs.user.id() + '/linked-accounts', {});\n this.state.loadingAdditional = false;\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInButtons'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SignUpModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/ForumApplication'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class LinkedAccount extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n\n icon() {\n return Model.attribute('icon').call(this);\n }\n\n priority() {\n return Model.attribute('priority').call(this);\n }\n\n linked() {\n return Model.attribute('linked').call(this);\n }\n\n orphaned() {\n return Model.attribute('orphaned').call(this);\n }\n\n identifier() {\n return Model.attribute('identifier').call(this);\n }\n\n providerIdentifier() {\n return Model.attribute('providerIdentifier').call(this);\n }\n\n firstLogin() {\n return Model.attribute('firstLogin', Model.transformDate).call(this);\n }\n\n lastLogin() {\n return Model.attribute('lastLogin', Model.transformDate).call(this);\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nimport LinkedAccount from './models/LinkedAccount';\n\nexport default [\n new Extend.Model(User) //\n .attribute('loginProvider'),\n\n new Extend.Store() //\n .add('linked-accounts', LinkedAccount),\n];\n","import LinkStatus from './LinkStatus';\nimport LinkedAccounts from './LinkedAccounts';\nimport ProviderInfo from './ProviderInfo';\n\nexport const components = {\n ProviderInfo,\n LinkStatus,\n LinkedAccounts,\n};\n","import app from 'flarum/forum/app';\nimport addLinkedAccountsToUserSecurityPage from './extenders/addLinkedAccountsToUserSecurityPage';\nimport extendLoginSignup from './extenders/extendLoginSignup';\n\nexport { default as extend } from './extend';\n\nexport * from './components';\n\napp.initializers.add('fof/oauth', () => {\n extendLoginSignup();\n addLinkedAccountsToUserSecurityPage();\n});\n","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport LogInButtons from 'flarum/forum/components/LogInButtons';\nimport LogInButton from 'flarum/forum/components/LogInButton';\nimport extractText from 'flarum/common/utils/extractText';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport SignUpModal from 'flarum/forum/components/SignUpModal';\nimport ForumApplication from 'flarum/forum/ForumApplication';\n\nexport default function () {\n extend(LogInButton, 'initAttrs', function (returnedValue, attrs) {\n const fullscreen = app.forum.attribute('fof-oauth.fullscreenPopup');\n\n if (fullscreen) {\n attrs.onclick = function () {\n window.open(app.forum.attribute('baseUrl') + attrs.path, 'logInPopup', 'fullscreen=yes');\n };\n } else {\n // Default values\n const defaultWidth = 580;\n const defaultHeight = 400;\n\n const width = app.forum.attribute('fof-oauth.popupWidth') || defaultWidth;\n const height = app.forum.attribute('fof-oauth.popupHeight') || defaultHeight;\n\n const $window = $(window);\n\n attrs.onclick = function () {\n window.open(\n app.forum.attribute('baseUrl') + attrs.path,\n 'logInPopup',\n `width=${width},` +\n `height=${height},` +\n `top=${$window.height() / 2 - height / 2},` +\n `left=${$window.width() / 2 - width / 2},` +\n 'status=no,scrollbars=yes,resizable=no'\n );\n };\n }\n });\n\n extend(LogInButtons.prototype, 'items', function (items) {\n const onlyIcons = !!app.forum.attribute('fof-oauth.only_icons');\n const buttons = app.forum.attribute('fof-oauth').filter(Boolean);\n const googleButton = buttons.splice(buttons.indexOf(buttons.find((b) => b.name === 'google')), 1);\n\n buttons.concat(googleButton).forEach(({ name, icon, priority }) => {\n let className = `Button FoFLogInButton LogInButton--${name}`;\n\n // Google branding does not allow inline icon, so we'll keep the full button\n if (onlyIcons && name !== 'google') {\n className += ' Button--icon';\n }\n\n items.add(\n name,\n
\n \n {app.translator.trans(`fof-oauth.forum.log_in.with_${name}_button`, {\n provider: app.translator.trans(`fof-oauth.forum.providers.${name}`),\n })}\n \n
,\n priority\n );\n });\n });\n\n override(LogInButton.prototype, 'view', function (orig, vnode) {\n const onlyIcons = !!app.forum.attribute('fof-oauth.only_icons');\n if (!onlyIcons) return orig(vnode);\n\n const child = orig(vnode);\n\n return {child};\n });\n\n extend(LogInButtons.prototype, 'view', function (vdom) {\n const onlyIcons = !!app.forum.attribute('fof-oauth.only_icons');\n if (!onlyIcons) return;\n\n vdom.attrs.className += ' FoFLogInButtons--icons';\n });\n\n extend(ForumApplication.prototype, 'authenticationComplete', function (_, payload) {\n if (payload.loggedIn) {\n app.fof_oauth_loginInProgress = true;\n // This will automatically be reset, as authenticationComplete also triggers a window reload.\n\n m.redraw();\n }\n });\n\n ForumApplication.prototype.linkingComplete = async function () {\n try {\n app.fof_oauth_linkingInProgress = true;\n m.redraw();\n\n // Refresh the list of providers\n const newProviders = await this.store.find('linked-accounts');\n\n // The store will contain an old version of the login provider (unlinked) that has\n // another ID than the new one (linked). We need to delete that one from the store\n // so that the UI gets updated correctly.\n\n // Find the old provider (one that has the same name as one of the new providers & has providerIdentifier===null)\n const oldProvider = this.store\n .all('linked-accounts')\n // Find the providers that have not yet been linked (providerIdentifier is null)\n .filter((p) => p.providerIdentifier() === null)\n // Match it with one of the newly fetched providers by name\n .find((p) => newProviders.some((np) => np.name() === p.name()));\n\n if (oldProvider) {\n delete this.store.data['linked-accounts'][oldProvider.id()];\n } else {\n window.location.reload();\n return;\n }\n\n // Refresh the session user\n await this.store.find('users', app.session.user.id());\n\n app.fof_oauth_linkingInProgress = false;\n m.redraw();\n } catch (error) {\n app.fof_oauth_linkingInProgress = false;\n m.redraw();\n }\n };\n\n extend(LogInModal.prototype, 'onbeforeupdate', function (vnode) {\n if (app.fof_oauth_loginInProgress) {\n this.loading = true;\n }\n });\n\n extend(SignUpModal.prototype, 'onbeforeupdate', function (vnode) {\n if (app.fof_oauth_loginInProgress) {\n this.loading = true;\n }\n });\n\n extend(SignUpModal.prototype, 'fields', function (items) {\n // If a suggested username was not provided by the OAuth service, display some help text to the user.\n if (!!this.attrs.token && !!!this.attrs.username) {\n items.add(\n 'username-help',\n
\n

{app.translator.trans('fof-oauth.forum.signup.username_help')}

\n
,\n 35\n );\n }\n\n return items;\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport UserSecurityPage from 'flarum/forum/components/UserSecurityPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport LinkedAccounts from '../components/LinkedAccounts';\nimport type Mithril from 'mithril';\n\nexport default function addLinkedAccountsToUserSecurityPage() {\n extend(UserSecurityPage.prototype, 'settingsItems', function (items: ItemList) {\n if (this.user !== app.session.user && !app.forum.attribute('fofOauthModerate')) {\n return;\n }\n\n items.add('linkedAccounts', , 5);\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","asyncGeneratorStep","gen","reject","_next","_throw","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","ProviderInfo","_Component","_proto","view","vnode","provider","attrs","orphaned","m","className","app","trans","providerInfoItems","toArray","linked","items","ItemList","add","LabelValue","label","humanTime","firstLogin","lastLogin","Component","LinkStatus","_this","_len","Array","_key","concat","state","loading","onbeforeupdate","iconView","statusView","actionView","icon","_app$session$user","_this2","user","Button","onclick","deleteProvider","id","attribute","Link","href","external","_deleteProvider","_callee","_context","confirm","extractText","find","redraw","_x","LinkedAccounts","loadingAdditional","errorLoadingAdditional","oncreate","loadLinkedAccounts","linkedAccounts","all","FieldSet","LoadingIndicator","containerClassName","listItems","linkedAccountsItems","linkedAccount","priority","_loadLinkedAccounts","LinkedAccount","_Model","Model","identifier","providerIdentifier","Extend","User","components","extend","LogInButton","returnedValue","window","open","path","width","height","$window","$","LogInButtons","onlyIcons","buttons","filter","Boolean","googleButton","splice","indexOf","b","_ref","disabled","override","orig","child","Tooltip","text","children","vdom","ForumApplication","_","payload","loggedIn","linkingComplete","newProviders","oldProvider","store","some","np","data","location","reload","t0","LogInModal","SignUpModal","token","username","UserSecurityPage"],"sourceRoot":""} \ No newline at end of file