From 308dae10345766122bb69296eb1dc516e6b1d7b4 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Fri, 22 Sep 2023 07:23:40 +0000 Subject: [PATCH] Bundled output for commit bf0109f2563c6b9926e0e591df2c7e5bd8fee9f6 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js.map | 2 +- js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 0e03cd8..b382db9 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,uBAAuB,WAC1CA,IAAAA,cAAAA,IACO,uBACJC,gBAAgB,CACfC,MAAOF,IAAAA,WAAAA,MAAqB,8CAC5BG,QAAS,uCACTC,KAAM,YAEPH,gBAAgB,CACfC,MAAOF,IAAAA,WAAAA,MAAqB,+CAC5BG,QAAS,wCACTC,KAAM,WAEX,G","sources":["webpack://@fof/pwned-passwords/webpack/bootstrap","webpack://@fof/pwned-passwords/webpack/runtime/compat get default export","webpack://@fof/pwned-passwords/webpack/runtime/define property getters","webpack://@fof/pwned-passwords/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/pwned-passwords/webpack/runtime/make namespace object","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/pwned-passwords/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\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['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('fof/pwned-passwords', () => {\n app.extensionData\n .for('fof-pwned-passwords')\n .registerSetting({\n label: app.translator.trans('fof-pwned-passwords.admin.enableLoginCheck'),\n setting: 'fof-pwned-passwords.enableLoginCheck',\n type: 'boolean',\n })\n .registerSetting({\n label: app.translator.trans('fof-pwned-passwords.admin.enableAdminRevoke'),\n setting: 'fof-pwned-passwords.revokeAdminAccess',\n type: 'boolean',\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","label","setting","type"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAiBC,IAAI,uBAAuB,WAC1CD,IAAAA,cAAA,IACO,uBACJE,gBAAgB,CACfC,MAAOH,IAAAA,WAAeI,MAAM,8CAC5BC,QAAS,uCACTC,KAAM,YAEPJ,gBAAgB,CACfC,MAAOH,IAAAA,WAAeI,MAAM,+CAC5BC,QAAS,wCACTC,KAAM,WAEX,G","sources":["webpack://@fof/pwned-passwords/webpack/bootstrap","webpack://@fof/pwned-passwords/webpack/runtime/compat get default export","webpack://@fof/pwned-passwords/webpack/runtime/define property getters","webpack://@fof/pwned-passwords/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/pwned-passwords/webpack/runtime/make namespace object","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/pwned-passwords/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\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['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('fof/pwned-passwords', () => {\n app.extensionData\n .for('fof-pwned-passwords')\n .registerSetting({\n label: app.translator.trans('fof-pwned-passwords.admin.enableLoginCheck'),\n setting: 'fof-pwned-passwords.enableLoginCheck',\n type: 'boolean',\n })\n .registerSetting({\n label: app.translator.trans('fof-pwned-passwords.admin.enableAdminRevoke'),\n setting: 'fof-pwned-passwords.revokeAdminAccess',\n type: 'boolean',\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","add","registerSetting","label","trans","setting","type"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index cb10110..26a059f 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@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H,OAWS,WACL,EAAKR,SAAU,EACfO,EAAEC,QACH,GACJ,EA1CwC,GAShBM,KAoCrBC,EA7CqC,wFA8CzCb,KAAA,SAAKc,GACH,IAAMC,EAAO,EAAH,UAASf,KAAT,UAAcc,GACxB,OAAO,KAAKC,EAAZ,CAAkBC,SAAU,CAAC,SAAKC,UAAU,aAAaF,EAAKC,YAC/D,EAjDwC,GA6CdE,KAO7Bb,EAAEc,MAAMC,EAAE,UAAUC,aAAa,YAAY,GAAI,CAC/CrB,KAAM,kBACJ,EAACa,EAAD,CAAgBS,aAAa,EAAOC,SAAU,CAAC,EAAC1B,EAAD,QAC5CR,IAAAA,WAAAA,MAAqB,2CAFpB,GA9C4B,CAoDrC,CDxDGmC,EACD,GACF,G","sources":["webpack://@fof/pwned-passwords/webpack/bootstrap","webpack://@fof/pwned-passwords/webpack/runtime/compat get default export","webpack://@fof/pwned-passwords/webpack/runtime/define property getters","webpack://@fof/pwned-passwords/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/pwned-passwords/webpack/runtime/make namespace object","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['forum/ForumApplication']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/pwned-passwords/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/pwned-passwords/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/pwned-passwords/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/pwned-passwords/./src/forum/index.ts","webpack://@fof/pwned-passwords/./src/forum/alertPwnedPassword.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\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/ForumApplication'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\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/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ForumApplication from 'flarum/forum/ForumApplication';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport alertPwnedPassword from './alertPwnedPassword';\n\napp.initializers.add('fof/pwned-passwords', () => {\n User.prototype.hasPwnedPassword = Model.attribute('hasPwnedPassword');\n\n extend(ForumApplication.prototype, 'mount', function () {\n alertPwnedPassword();\n });\n});\n","import { VnodeDOM } from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Button from 'flarum/common/components/Button';\nimport icon from 'flarum/common/helpers/icon';\n\n// Based on Flarum's forum/util/alertEmailConfirmation\nexport default function alertPwnedPassword() {\n const user = app.session.user;\n\n if (!user || !user.hasPwnedPassword()) return;\n\n // Don't show if email is unconfirmed, as it would cause multiple similar alerts\n // Also, it's not supposed to be possible once the extension is enabled\n if (!user.isEmailConfirmed()) return;\n\n class ResendButton extends Component {\n loading: boolean = false;\n sent: boolean = false;\n\n view() {\n return (\n \n );\n }\n\n onclick() {\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/forgot',\n body: { email: user!.email() },\n })\n .then(() => {\n this.loading = false;\n this.sent = true;\n m.redraw();\n })\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n }\n\n class ContainedAlert extends Alert {\n view(vnode: VnodeDOM) {\n const vdom = super.view(vnode);\n return { ...vdom, children: [
{vdom.children}
] };\n }\n }\n\n m.mount($('
').insertBefore('#content')[0], {\n view: () => (\n ]}>\n {app.translator.trans('fof-pwned-passwords.forum.alert.warning')}\n \n ),\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_extends","assign","bind","target","i","arguments","length","source","apply","this","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","app","User","Model","extend","ForumApplication","user","hasPwnedPassword","isEmailConfirmed","ResendButton","loading","sent","view","class","onclick","disabled","icon","m","redraw","method","url","body","email","then","Component","ContainedAlert","vnode","vdom","children","className","Alert","mount","$","insertBefore","dismissible","controls","alertPwnedPassword"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,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AKC,mBAAV,CAP2C,IASrCC,EATqC,oJAUzCC,SAAmB,EAVsB,EAWzCC,MAAgB,EAXyB,oCAazCC,KAAA,WACE,OACE,EAAC,IAAD,CAAQC,MAAM,sBAAsBC,QAASxB,KAAKwB,QAAQ/B,KAAKO,MAAOoB,QAASpB,KAAKoB,QAASK,SAAUzB,KAAKqB,MACzGrB,KAAKqB,KACF,CAACK,IAAK,gBAAiB,IAAKhB,IAAAA,WAAeiB,MAAM,iDACjDjB,IAAAA,WAAeiB,MAAM,iDAG9B,EArBwC,EAuBzCH,QAAA,WAAU,WACRxB,KAAKoB,SAAU,EACfQ,EAAEC,SAEFnB,IAAAA,QACW,CACPoB,OAAQ,OACRC,IAAKrB,IAAAA,MAAUsB,UAAU,UAAY,UACrCC,KAAM,CAAEC,MAAOjB,EAAMiB,WAEtBC,MAAK,WACJ,EAAKf,SAAU,EACf,EAAKC,MAAO,EACZO,EAAEC,QACH,IAVH,OAWS,WACL,EAAKT,SAAU,EACfQ,EAAEC,QACH,GACJ,EA1CwC,GAShBO,KAoCrBC,EA7CqC,wFA8CzCf,KAAA,SAAKgB,GACH,IAAMC,EAAO,EAAH,UAASjB,KAAT,UAAcgB,GACxB,OAAO,KAAKC,EAAZ,CAAkBC,SAAU,CAAC,SAAKC,UAAU,aAAaF,EAAKC,YAC/D,EAjDwC,GA6CdE,KAO7Bd,EAAEe,MAAMC,EAAE,UAAUC,aAAa,YAAY,GAAI,CAC/CvB,KAAM,kBACJ,EAACe,EAAD,CAAgBS,aAAa,EAAOC,SAAU,CAAC,EAAC5B,EAAD,QAC5CT,IAAAA,WAAeiB,MAAM,2CAFpB,GA9C4B,CAoDrC,CDxDGqB,EACD,GACF,G","sources":["webpack://@fof/pwned-passwords/webpack/bootstrap","webpack://@fof/pwned-passwords/webpack/runtime/compat get default export","webpack://@fof/pwned-passwords/webpack/runtime/define property getters","webpack://@fof/pwned-passwords/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/pwned-passwords/webpack/runtime/make namespace object","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['forum/ForumApplication']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/pwned-passwords/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/pwned-passwords/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/pwned-passwords/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/pwned-passwords/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/pwned-passwords/./src/forum/index.ts","webpack://@fof/pwned-passwords/./src/forum/alertPwnedPassword.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\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/ForumApplication'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\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/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ForumApplication from 'flarum/forum/ForumApplication';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport alertPwnedPassword from './alertPwnedPassword';\n\napp.initializers.add('fof/pwned-passwords', () => {\n User.prototype.hasPwnedPassword = Model.attribute('hasPwnedPassword');\n\n extend(ForumApplication.prototype, 'mount', function () {\n alertPwnedPassword();\n });\n});\n","import { VnodeDOM } from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Button from 'flarum/common/components/Button';\nimport icon from 'flarum/common/helpers/icon';\n\n// Based on Flarum's forum/util/alertEmailConfirmation\nexport default function alertPwnedPassword() {\n const user = app.session.user;\n\n if (!user || !user.hasPwnedPassword()) return;\n\n // Don't show if email is unconfirmed, as it would cause multiple similar alerts\n // Also, it's not supposed to be possible once the extension is enabled\n if (!user.isEmailConfirmed()) return;\n\n class ResendButton extends Component {\n loading: boolean = false;\n sent: boolean = false;\n\n view() {\n return (\n \n );\n }\n\n onclick() {\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/forgot',\n body: { email: user!.email() },\n })\n .then(() => {\n this.loading = false;\n this.sent = true;\n m.redraw();\n })\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n }\n\n class ContainedAlert extends Alert {\n view(vnode: VnodeDOM) {\n const vdom = super.view(vnode);\n return { ...vdom, children: [
{vdom.children}
] };\n }\n }\n\n m.mount($('
').insertBefore('#content')[0], {\n view: () => (\n ]}>\n {app.translator.trans('fof-pwned-passwords.forum.alert.warning')}\n \n ),\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_extends","assign","bind","target","i","arguments","length","source","apply","this","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","app","add","User","hasPwnedPassword","Model","extend","ForumApplication","user","isEmailConfirmed","ResendButton","loading","sent","view","class","onclick","disabled","icon","trans","m","redraw","method","url","attribute","body","email","then","Component","ContainedAlert","vnode","vdom","children","className","Alert","mount","$","insertBefore","dismissible","controls","alertPwnedPassword"],"sourceRoot":""} \ No newline at end of file