From 0c1e8bbc22f32fd4951fbb826583cb097d5f8f8c Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Mon, 14 Oct 2024 16:37:56 +0000 Subject: [PATCH] Bundled output for commit 28145c26a43f8cd99bb00e4ed371b9a39363ea77 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js | 2 +- js/dist/admin.js.map | 2 +- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index 52a4e50..9d1e8e4 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={175:t=>{"use strict";var e=/(?:https?:)?\/\/(?:(?:[\w-]+\.)+[\w/#@~.-]*)(?:\?(?:[\w&=.!,;$#%-]+)?)?/gi;t.exports=function(t){return(t||"").replace(e,(function(t){return''+t+""}))}}},e={};function o(r){var n=e[r];if(void 0!==n)return n.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=flarum.core.compat["admin/app"];var e=o.n(t);function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}const n=flarum.core.compat["common/components/Alert"];var i=o.n(n);const s=flarum.core.compat["admin/components/ExtensionPage"];var a=o.n(s);const p=flarum.core.compat["common/helpers/humanTime"];var c=o.n(p);const l=flarum.core.compat["common/utils/extractText"];var f=o.n(l),u=o(175),g=o.n(u),d=function(t){var o,n;function s(){return t.apply(this,arguments)||this}n=t,(o=s).prototype=Object.create(n.prototype),o.prototype.constructor=o,r(o,n);var a=s.prototype;return a.oninit=function(e){t.prototype.oninit.call(this,e)},a.content=function(){var t=this.setting("fof-geoip.service")(),o=1e3*Number(e().data.settings["fof-geoip.services."+t+".last_error_time"]),r=e().data.settings["fof-geoip.services."+t+".error"];return r&&(r=g()(r)),[m("div",{className:"container"},m("div",{className:"geopage"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"select",setting:"fof-geoip.service",label:e().translator.trans("fof-geoip.admin.settings.service_label"),options:e().data["fof-geoip.services"].reduce((function(t,o){return t[o]=e().translator.trans("fof-geoip.admin.settings.service_"+o+"_label"),t}),{}),required:!0,help:t&&m.trust(g()(f()(e().translator.trans("fof-geoip.admin.settings.service_"+t+"_description"))))})),r?i().component({className:"Form-group",dismissible:!1},[m("b",{style:{textTransform:"uppercase",marginRight:"5px"}},c()(o)),m.trust(r)]):"",["ipdata","ipapi-pro","ipsevenex"].includes(t)?[this.buildSettingComponent({type:"string",setting:"fof-geoip.services."+t+".access_key",label:e().translator.trans("fof-geoip.admin.settings.access_key_label"),required:!0})]:[],"ipdata"===t?this.buildSettingComponent({type:"number",setting:"fof-geoip.services.ipdata.quota",label:e().translator.trans("fof-geoip.admin.settings.quota_label"),min:1500,placeholder:1500}):[],this.buildSettingComponent({setting:"fof-geoip.showFlag",type:"boolean",label:e().translator.trans("fof-geoip.admin.settings.show_flag_label"),help:e().translator.trans("fof-geoip.admin.settings.show_flag_help")}),this.submitButton()))]},s}(a());e().initializers.add("fof/geoip",(function(){e().extensionData.for("fof-geoip").registerPage(d)}))})(),module.exports={}})(); +(()=>{var e={175:e=>{"use strict";var t=/(?:https?:)?\/\/(?:(?:[\w-]+\.)+[\w/#@~.-]*)(?:\?(?:[\w&=.!,;$#%-]+)?)?/gi;e.exports=function(e){return(e||"").replace(t,(function(e){return''+e+""}))}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=flarum.core.compat["admin/app"];var t=o.n(e);function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}const n=flarum.core.compat["common/components/Alert"];var i=o.n(n);const s=flarum.core.compat["admin/components/ExtensionPage"];var a=o.n(s);const p=flarum.core.compat["common/helpers/humanTime"];var c=o.n(p);const l=flarum.core.compat["common/utils/extractText"];var f=o.n(l),u=o(175),g=o.n(u),d=function(e){var o,n;function s(){return e.apply(this,arguments)||this}n=e,(o=s).prototype=Object.create(n.prototype),o.prototype.constructor=o,r(o,n);var a=s.prototype;return a.oninit=function(t){e.prototype.oninit.call(this,t)},a.content=function(){var e=this.setting("fof-geoip.service")(),o=1e3*Number(t().data.settings["fof-geoip.services."+e+".last_error_time"]),r=t().data.settings["fof-geoip.services."+e+".error"];return r&&(r=g()(r)),[m("div",{className:"container"},m("div",{className:"geopage"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"select",setting:"fof-geoip.service",label:t().translator.trans("fof-geoip.admin.settings.service_label"),options:t().data["fof-geoip.services"].reduce((function(e,o){return e[o]=t().translator.trans("fof-geoip.admin.settings.service_"+o+"_label"),e}),{}),required:!0,help:e&&m.trust(g()(f()(t().translator.trans("fof-geoip.admin.settings.service_"+e+"_description"))))})),r?i().component({className:"Form-group",dismissible:!1},[m("b",{style:{textTransform:"uppercase",marginRight:"5px"}},c()(o)),m.trust(r)]):"",["ipdata","ipapi-pro","ipsevenex"].includes(e)?[this.buildSettingComponent({type:"string",setting:"fof-geoip.services."+e+".access_key",label:t().translator.trans("fof-geoip.admin.settings.access_key_label"),required:!0})]:[],"ipdata"===e?this.buildSettingComponent({type:"number",setting:"fof-geoip.services.ipdata.quota",label:t().translator.trans("fof-geoip.admin.settings.quota_label"),min:1500,placeholder:1500}):[],this.buildSettingComponent({setting:"fof-geoip.showFlag",type:"boolean",label:t().translator.trans("fof-geoip.admin.settings.show_flag_label"),help:t().translator.trans("fof-geoip.admin.settings.show_flag_help")}),this.submitButton()))]},s}(a());t().initializers.add("fof/geoip",(function(){t().extensionData.for("fof-geoip").registerPage(d).registerPermission({icon:"fas fa-globe",permission:"fof-geoip.canSeeCountry",label:t().translator.trans("fof-geoip.admin.permissions.see_country")},"moderate",50)}))})(),module.exports={}})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index e6b37fa..85631f1 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"kCAEA,IAAIA,EAAa,4EAEjBC,EAAOC,QAAU,SAASC,GACtB,OAAQA,GAAQ,IAAIC,QAAQJ,GAAY,SAASK,GAC7C,MAAO,YAAcA,EAAM,KAAOA,EAAM,MAC5C,GACJ,C,GCPIC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaP,QAGrB,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,CAAC,GAOX,OAHAS,EAAoBH,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,OACf,CCrBAK,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACb,EAASe,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEjB,EAASgB,IAC5EE,OAAOC,eAAenB,EAASgB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAA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C,EAAGc,GAEjD,OADAd,EAAEc,GAAKqB,IAAAA,WAAeS,MAAM,oCAAoC9B,EAAC,UAC1Dd,CACT,GAAG,CAAC,GACJ+C,UAAU,EACVC,KAAMlB,GAAWS,EAAEU,MAAMX,IAAQY,IAAYf,IAAAA,WAAeS,MAAM,oCAAoCd,EAAO,sBAGhHO,EACGc,IAAAA,UACE,CACEX,UAAW,aACXY,aAAa,GAEf,CAACb,EAAA,KAAGc,MAAO,CAAEC,cAAe,YAAaC,YAAa,QAAUC,IAAUvB,IAAiBM,EAAEU,MAAMZ,KAErG,GAEH,CAAC,SAAU,YAAa,aAAaoB,SAAS3B,GAC3C,CACEC,KAAKU,sBAAsB,CACzBC,KAAM,SACNV,QAAS,sBAAsBF,EAAO,cACtCa,MAAOR,IAAAA,WAAeS,MAAM,6CAC5BG,UAAU,KAGd,GACS,WAAZjB,EACGC,KAAKU,sBAAsB,CACzBC,KAAM,SACNV,QAAS,kCACTW,MAAOR,IAAAA,WAAeS,MAAM,wCAC5Bc,IAAK,KACLC,YAAa,OAEf,GACH5B,KAAKU,sBAAsB,CAC1BT,QAAS,qBACTU,KAAM,UACNC,MAAOR,IAAAA,WAAeS,MAAM,4CAC5BI,KAAMb,IAAAA,WAAeS,MAAM,6CAE5Bb,KAAK6B,iBAId,EAAC1C,CAAA,CAnEmC,CAAS2C,KEJ/C1B,IAAAA,aAAiB2B,IAAI,aAAa,WAChC3B,IAAAA,cAAiB,IAAK,aAAa4B,aAAa7C,EAClD,G","sources":["webpack://@fof/geoip/./node_modules/linkify-lite/index.js","webpack://@fof/geoip/webpack/bootstrap","webpack://@fof/geoip/webpack/runtime/compat get default export","webpack://@fof/geoip/webpack/runtime/define property getters","webpack://@fof/geoip/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/geoip/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/geoip/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/geoip/./src/admin/components/ExtensionSettingsPage.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/geoip/./src/admin/index.js"],"sourcesContent":["'use strict';\n\nvar urlPattern = /(?:https?:)?\\/\\/(?:(?:[\\w-]+\\.)+[\\w/#@~.-]*)(?:\\?(?:[\\w&=.!,;$#%-]+)?)?/gi;\n\nmodule.exports = function(text) {\n return (text || '').replace(urlPattern, function(url) {\n return '' + url + '';\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))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/admin/app';\nimport Alert from 'flarum/common/components/Alert';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport extractText from 'flarum/common/utils/extractText';\nimport linkify from 'linkify-lite';\n\nexport default class GeoipSettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n }\n\n content() {\n const service = this.setting('fof-geoip.service')();\n const errorTime = Number(app.data.settings[`fof-geoip.services.${service}.last_error_time`]) * 1000;\n let error = app.data.settings[`fof-geoip.services.${service}.error`];\n\n if (error) error = linkify(error);\n\n return [\n
\n
\n
\n {this.buildSettingComponent({\n type: 'select',\n setting: 'fof-geoip.service',\n label: app.translator.trans('fof-geoip.admin.settings.service_label'),\n options: app.data['fof-geoip.services'].reduce((o, p) => {\n o[p] = app.translator.trans(`fof-geoip.admin.settings.service_${p}_label`);\n return o;\n }, {}),\n required: true,\n help: service && m.trust(linkify(extractText(app.translator.trans(`fof-geoip.admin.settings.service_${service}_description`)))),\n })}\n
\n {error\n ? Alert.component(\n {\n className: 'Form-group',\n dismissible: false,\n },\n [{humanTime(errorTime)}, m.trust(error)]\n )\n : ''}\n\n {['ipdata', 'ipapi-pro', 'ipsevenex'].includes(service)\n ? [\n this.buildSettingComponent({\n type: 'string',\n setting: `fof-geoip.services.${service}.access_key`,\n label: app.translator.trans('fof-geoip.admin.settings.access_key_label'),\n required: true,\n }),\n ]\n : []}\n {service === 'ipdata'\n ? this.buildSettingComponent({\n type: 'number',\n setting: 'fof-geoip.services.ipdata.quota',\n label: app.translator.trans('fof-geoip.admin.settings.quota_label'),\n min: 1500,\n placeholder: 1500,\n })\n : []}\n {this.buildSettingComponent({\n setting: 'fof-geoip.showFlag',\n type: 'boolean',\n label: app.translator.trans('fof-geoip.admin.settings.show_flag_label'),\n help: app.translator.trans('fof-geoip.admin.settings.show_flag_help'),\n })}\n {this.submitButton()}\n
\n
,\n ];\n }\n}\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}","import app from 'flarum/admin/app';\nimport GeoipSettingsPage from './components/ExtensionSettingsPage';\n\napp.initializers.add('fof/geoip', () => {\n app.extensionData.for('fof-geoip').registerPage(GeoipSettingsPage);\n});\n"],"names":["urlPattern","module","exports","text","replace","url","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","GeoipSettingsPage","_ExtensionPage","subClass","superClass","apply","arguments","create","constructor","_proto","oninit","vnode","content","service","this","setting","errorTime","Number","app","settings","error","linkify","m","className","buildSettingComponent","type","label","trans","options","reduce","required","help","trust","extractText","Alert","dismissible","style","textTransform","marginRight","humanTime","includes","min","placeholder","submitButton","ExtensionPage","add","registerPage"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"kCAEA,IAAIA,EAAa,4EAEjBC,EAAOC,QAAU,SAASC,GACtB,OAAQA,GAAQ,IAAIC,QAAQJ,GAAY,SAASK,GAC7C,MAAO,YAAcA,EAAM,KAAOA,EAAM,MAC5C,GACJ,C,GCPIC,EAA2B,CAAC,EAGhC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YAAa,OAEf,GACH5B,KAAKU,sBAAsB,CAC1BT,QAAS,qBACTU,KAAM,UACNC,MAAOR,IAAAA,WAAeS,MAAM,4CAC5BI,KAAMb,IAAAA,WAAeS,MAAM,6CAE5Bb,KAAK6B,iBAId,EAAC1C,CAAA,CAnEmC,CAAS2C,KEJ/C1B,IAAAA,aAAiB2B,IAAI,aAAa,WAChC3B,IAAAA,cAAiB,IACV,aACJ4B,aAAa7C,GACb8C,mBACC,CACEC,KAAM,eACNC,WAAY,0BACZvB,MAAOR,IAAAA,WAAeS,MAAM,4CAE9B,WACA,GAEN,G","sources":["webpack://@fof/geoip/./node_modules/linkify-lite/index.js","webpack://@fof/geoip/webpack/bootstrap","webpack://@fof/geoip/webpack/runtime/compat get default export","webpack://@fof/geoip/webpack/runtime/define property getters","webpack://@fof/geoip/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/geoip/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/geoip/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/geoip/./src/admin/components/ExtensionSettingsPage.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/geoip/./src/admin/index.js"],"sourcesContent":["'use strict';\n\nvar urlPattern = /(?:https?:)?\\/\\/(?:(?:[\\w-]+\\.)+[\\w/#@~.-]*)(?:\\?(?:[\\w&=.!,;$#%-]+)?)?/gi;\n\nmodule.exports = function(text) {\n return (text || '').replace(urlPattern, function(url) {\n return '' + url + '';\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))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/admin/app';\nimport Alert from 'flarum/common/components/Alert';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport extractText from 'flarum/common/utils/extractText';\nimport linkify from 'linkify-lite';\n\nexport default class GeoipSettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n }\n\n content() {\n const service = this.setting('fof-geoip.service')();\n const errorTime = Number(app.data.settings[`fof-geoip.services.${service}.last_error_time`]) * 1000;\n let error = app.data.settings[`fof-geoip.services.${service}.error`];\n\n if (error) error = linkify(error);\n\n return [\n
\n
\n
\n {this.buildSettingComponent({\n type: 'select',\n setting: 'fof-geoip.service',\n label: app.translator.trans('fof-geoip.admin.settings.service_label'),\n options: app.data['fof-geoip.services'].reduce((o, p) => {\n o[p] = app.translator.trans(`fof-geoip.admin.settings.service_${p}_label`);\n return o;\n }, {}),\n required: true,\n help: service && m.trust(linkify(extractText(app.translator.trans(`fof-geoip.admin.settings.service_${service}_description`)))),\n })}\n
\n {error\n ? Alert.component(\n {\n className: 'Form-group',\n dismissible: false,\n },\n [{humanTime(errorTime)}, m.trust(error)]\n )\n : ''}\n\n {['ipdata', 'ipapi-pro', 'ipsevenex'].includes(service)\n ? [\n this.buildSettingComponent({\n type: 'string',\n setting: `fof-geoip.services.${service}.access_key`,\n label: app.translator.trans('fof-geoip.admin.settings.access_key_label'),\n required: true,\n }),\n ]\n : []}\n {service === 'ipdata'\n ? this.buildSettingComponent({\n type: 'number',\n setting: 'fof-geoip.services.ipdata.quota',\n label: app.translator.trans('fof-geoip.admin.settings.quota_label'),\n min: 1500,\n placeholder: 1500,\n })\n : []}\n {this.buildSettingComponent({\n setting: 'fof-geoip.showFlag',\n type: 'boolean',\n label: app.translator.trans('fof-geoip.admin.settings.show_flag_label'),\n help: app.translator.trans('fof-geoip.admin.settings.show_flag_help'),\n })}\n {this.submitButton()}\n
\n
,\n ];\n }\n}\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}","import app from 'flarum/admin/app';\nimport GeoipSettingsPage from './components/ExtensionSettingsPage';\n\napp.initializers.add('fof/geoip', () => {\n app.extensionData\n .for('fof-geoip')\n .registerPage(GeoipSettingsPage)\n .registerPermission(\n {\n icon: 'fas fa-globe',\n permission: 'fof-geoip.canSeeCountry',\n label: app.translator.trans('fof-geoip.admin.permissions.see_country'),\n },\n 'moderate',\n 50\n );\n});\n"],"names":["urlPattern","module","exports","text","replace","url","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","GeoipSettingsPage","_ExtensionPage","subClass","superClass","apply","arguments","create","constructor","_proto","oninit","vnode","content","service","this","setting","errorTime","Number","app","settings","error","linkify","m","className","buildSettingComponent","type","label","trans","options","reduce","required","help","trust","extractText","Alert","dismissible","style","textTransform","marginRight","humanTime","includes","min","placeholder","submitButton","ExtensionPage","add","registerPage","registerPermission","icon","permission"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 1fe0199..c98f27e 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={301:function(t){t.exports=function(){"use strict";function t(r){return(t="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})(r)}function r(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r{t.exports=function(t){for(var r=[],e=0,n=0,o=0,a=t.length;o{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={},a=Object.prototype,i=a.hasOwnProperty,c=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},s=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,a=Object.create(o.prototype),i=new T(n||[]);return c(a,"_invoke",{value:A(t,e,i)}),a}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",y="suspendedYield",v="executing",g="completed",b={};function w(){}function x(){}function _(){}var L={};p(L,s,(function(){return this}));var I=Object.getPrototypeOf,C=I&&I(I(N([])));C&&C!==a&&i.call(C,s)&&(L=C);var S=_.prototype=w.prototype=Object.create(L);function j(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function P(t,r){function e(o,a,c,u){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return e("throw",t,c,u)}))}u(s.arg)}var o;c(this,"_invoke",{value:function(t,n){function a(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(a,a):a()}})}function A(t,e,n){var o=h;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=O(c,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=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=d(t,e,n);if("normal"===s.type){if(o=n.done?g:y,s.arg===b)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function O(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,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=d(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,b;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,b):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function E(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 k(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function N(t){if(t||""===t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),k(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;k(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(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 a=r[n]={exports:{}};return t[n].call(a.exports,a,a.exports,e),a.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,{extend:()=>ot});const t=flarum.core.compat["forum/app"];var r=e.n(t);const o=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/PostMeta"];var i=e.n(a);const c=flarum.core.compat["common/components/Tooltip"];var u=e.n(c),s=e(301),l=e.n(s),f=e(880),p=e.n(f),d=function(t){if(t&&t.countryCode()&&t.countryCode().length>1){var e=function(t){var r=l()(t);if(!r)return null;var e=p()(r);return e?"https://cdn.jsdelivr.net/gh/twitter/twemoji@14/assets/72x72/"+e+".png":null}(t.countryCode()),n=r().translator.getLocale(),o=new Intl.DisplayNames([n],{type:"region"}).of(t.countryCode());if(e)return m(u(),{text:o},m("img",{src:e,alt:o,height:"16",loading:"lazy"}))}return null},h=function(t){var r=function(t){return t.organization()||t.isp()||t.error()||""}(t),e=function(t){return t.threatTypes()&&t.threatTypes().join(", ")}(t);return{description:r,threat:e,image:d(t),zip:t.zipCode(),country:t.countryCode()}},y=function(t){return function(){!function(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then((function(){}));else{var r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);var e=document.getSelection(),n=e&&e.rangeCount>0?e.getRangeAt(0):null;r.select(),document.execCommand("copy"),document.body.removeChild(r),n&&e&&(e.removeAllRanges(),e.addRange(n))}}(t),r().alerts.show({type:"success"},r().translator.trans("fof-geoip.forum.alerts.ip_copied"))}};const v=flarum.core.compat["common/utils/ItemList"];var g=e.n(v);const b=flarum.core.compat["common/components/Button"];var w=e.n(b);function x(t,r){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},x(t,r)}function _(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,x(t,r)}const I=flarum.core.compat["common/components/Modal"];var C=e.n(I);function S(t,r,e,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var j=e(183),P=e.n(j);const A=flarum.core.compat["common/Component"];var O=e.n(A);const E=flarum.core.compat["common/components/LoadingIndicator"];var k=e.n(E);const T=function(){function t(t){return function(r){return new Promise((function(e,n){var o=document.createElement(t),a="body",i="src";switch(o.onload=function(){e(r)},o.onerror=function(){n(r)},t){case"script":o.async=!0;break;case"link":o.type="text/css",o.rel="stylesheet",i="href",a="head"}o[i]=r,document[a].appendChild(o)}))}}return{css:t("link"),js:t("script"),img:t("img")}}();var N=!1,z=function(){var t,r=(t=P().mark((function t(){return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!N){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,T.css("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css");case 4:return t.next=6,T.js("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js");case 6:N=!0;case 7:case"end":return t.stop()}}),t)})),function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function i(t){S(a,n,o,i,c,"next",t)}function c(t){S(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}(),M=function(t){function e(){return t.apply(this,arguments)||this}_(e,t);var n=e.prototype;return n.oninit=function(r){t.prototype.oninit.call(this,r),this.ipInfo=this.attrs.ipInfo,this.data=null,this.ipInfo.latitude()&&this.ipInfo.longitude()?this.searchLatLon():this.ipInfo.zipCode()?this.searchZip():this.data={unknown:!0}},n.view=function(){return this.loading?m(k(),{size:"medium"}):this.data&&this.data.unknown?m("div",{className:"helpText"},r().translator.trans("fof-geoip.forum.map_modal.not_enough_data")):this.data?m("div",{id:"geoip-map",oncreate:this.configMap.bind(this)}):m("div",null)},n.searchLatLon=function(){var t=this;if(!this.loading)return this.loading=!0,z().then(r().request({url:"https://nominatim.openstreetmap.org/reverse",method:"GET",params:{lat:this.ipInfo.latitude(),lon:this.ipInfo.longitude(),format:"json"}}).then((function(r){t.data=r,t.loading=!1,m.redraw()})))},n.searchZip=function(){var t=this;if(!this.loading)return this.loading=!0,z().then(r().request({url:"https://nominatim.openstreetmap.org/search",method:"GET",params:{q:this.ipInfo.zipCode(),countrycodes:this.ipInfo.countryCode(),limit:1,format:"json"}}).then((function(r){t.data=r[0],t.loading=!1,m.redraw()})))},n.configMap=function(t){if(this.data){var r=this.data,e=r.boundingbox,n=r.display_name,o=(parseFloat(e[0])+parseFloat(e[1]))/2,a=(parseFloat(e[2])+parseFloat(e[3]))/2;this.map=L.map(t.dom).setView([o,a],5),L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© OpenStreetMap contributors'}).addTo(this.map),L.marker([o,a]).addTo(this.map).bindPopup(n).openPopup()}},e}(O());const F=flarum.core.compat["common/components/LabelValue"];var G=e.n(F),B=function(t){function e(){for(var r,e=arguments.length,n=new Array(e),o=0;o0&&m(G(),{label:r().translator.trans("fof-geoip.forum.map_modal.threat_types"),value:t.threatTypes().join(", ")}),t.error()&&m(G(),{label:r().translator.trans("fof-geoip.forum.map_modal.error"),value:t.error()})),m("hr",null),m("div",{id:"mapContainer"},m(M,{ipInfo:t}))):m("div",{className:"Modal-body"},m(k(),null))},e}(C());function R(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.children);!(n=o()).done;){var a=n.value.children.find((function(t){return"label"===(null==t?void 0:t.tag)})),i=a&&a.children.find((function(t){return"code"===(null==t?void 0:t.tag)})),c=i&&a.children.indexOf(i);if(i){var s=h(r),l=s.description,f=s.threat,p=s.image;i.attrs||(i.attrs={}),i.attrs["data-threat-level"]=r.threatLevel(),i.children[1]=m(u(),{text:l+(f?" ("+f+")":"")},m("span",null,i.children[1])),p&&a.children.splice(c,0,p)}}r.zipCode()&&r.countryCode()&&t.children.splice(2,0,m("div",{className:"Form-group"},m(M,{zip:r.zipCode(),country:r.countryCode()})))}}})),(0,o.extend)(U().prototype,"tokenActionItems",(function(t,e){var n=e.lastIpAddress();n&&t.add("geoip-info",m(w(),{className:"Button",onclick:function(){return r().modal.show(B,{ipAddr:n})},"aria-label":r().translator.trans("fof-geoip.forum.map_button_label")},r().translator.trans("fof-geoip.forum.map_button_label")),10)})),(0,o.extend)(V().prototype,"headerItems",(function(t){if(r().forum.attribute("fof-geoip.showFlag")){var e,n,o=null==(e=(n=this.attrs.post).ip_info)?void 0:e.call(n),a=this.attrs.post.user();if(a&&a.showIPCountry()&&o){var i=h(o).image;i&&t.add("country",i,100)}}})),(0,o.extend)(Z().prototype,"privacyItems",(function(t){var e=this;r().forum.attribute("fof-geoip.showFlag")&&t.add("ip-country",J().component({state:this.user.preferences().showIPCountry,onchange:function(t){e.showIPCountryLoading=!0,e.user.savePreferences({showIPCountry:t}).then((function(){e.showIPCountryLoading=!1,m.redraw()}))},loading:this.showIPCountryLoading},r().translator.trans("fof-geoip.forum.user.settings.ip_country")))}))}))})(),module.exports=n})(); +(()=>{var t={301:function(t){t.exports=function(){"use strict";function t(r){return(t="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})(r)}function r(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r{t.exports=function(t){for(var r=[],e=0,n=0,o=0,a=t.length;o{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={},a=Object.prototype,i=a.hasOwnProperty,u=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.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,a=Object.create(o.prototype),i=new T(n||[]);return u(a,"_invoke",{value:A(t,e,i)}),a}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",y="suspendedYield",v="executing",g="completed",b={};function w(){}function x(){}function _(){}var L={};p(L,s,(function(){return this}));var I=Object.getPrototypeOf,C=I&&I(I(N([])));C&&C!==a&&i.call(C,s)&&(L=C);var S=_.prototype=w.prototype=Object.create(L);function j(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function P(t,r){function e(o,a,u,c){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,u,c)}),(function(t){e("throw",t,u,c)})):r.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return e("throw",t,u,c)}))}c(s.arg)}var o;u(this,"_invoke",{value:function(t,n){function a(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(a,a):a()}})}function A(t,e,n){var o=h;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=O(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=d(t,e,n);if("normal"===s.type){if(o=n.done?g:y,s.arg===b)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function O(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,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=d(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,b;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,b):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function E(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 k(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function N(t){if(t||""===t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),k(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;k(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(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 a=r[n]={exports:{}};return t[n].call(a.exports,a,a.exports,e),a.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,{extend:()=>ot});const t=flarum.core.compat["forum/app"];var r=e.n(t);const o=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/PostMeta"];var i=e.n(a);const u=flarum.core.compat["common/components/Tooltip"];var c=e.n(u),s=e(301),l=e.n(s),f=e(880),p=e.n(f),d=function(t){if(t&&t.countryCode()&&t.countryCode().length>1){var e=function(t){var r=l()(t);if(!r)return null;var e=p()(r);return e?"https://cdn.jsdelivr.net/gh/twitter/twemoji@14/assets/72x72/"+e+".png":null}(t.countryCode()),n=r().translator.getLocale(),o=new Intl.DisplayNames([n],{type:"region"}).of(t.countryCode());if(e)return m(c(),{text:o},m("img",{src:e,alt:o,height:"16",loading:"lazy"}))}return null},h=function(t){var r=function(t){return t.organization()||t.isp()||t.error()||""}(t),e=function(t){return t.threatTypes()&&t.threatTypes().join(", ")}(t);return{description:r,threat:e,image:d(t),zip:t.zipCode(),country:t.countryCode()}},y=function(t){return function(){!function(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then((function(){}));else{var r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);var e=document.getSelection(),n=e&&e.rangeCount>0?e.getRangeAt(0):null;r.select(),document.execCommand("copy"),document.body.removeChild(r),n&&e&&(e.removeAllRanges(),e.addRange(n))}}(t),r().alerts.show({type:"success"},r().translator.trans("fof-geoip.forum.alerts.ip_copied"))}};const v=flarum.core.compat["common/utils/ItemList"];var g=e.n(v);const b=flarum.core.compat["common/components/Button"];var w=e.n(b);function x(t,r){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},x(t,r)}function _(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,x(t,r)}const I=flarum.core.compat["common/components/Modal"];var C=e.n(I);function S(t,r,e,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}var j=e(183),P=e.n(j);const A=flarum.core.compat["common/Component"];var O=e.n(A);const E=flarum.core.compat["common/components/LoadingIndicator"];var k=e.n(E);const T=function(){function t(t){return function(r){return new Promise((function(e,n){var o=document.createElement(t),a="body",i="src";switch(o.onload=function(){e(r)},o.onerror=function(){n(r)},t){case"script":o.async=!0;break;case"link":o.type="text/css",o.rel="stylesheet",i="href",a="head"}o[i]=r,document[a].appendChild(o)}))}}return{css:t("link"),js:t("script"),img:t("img")}}();var N=!1,z=function(){var t,r=(t=P().mark((function t(){return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!N){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,T.css("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css");case 4:return t.next=6,T.js("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js");case 6:N=!0;case 7:case"end":return t.stop()}}),t)})),function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function i(t){S(a,n,o,i,u,"next",t)}function u(t){S(a,n,o,i,u,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}(),M=function(t){function e(){return t.apply(this,arguments)||this}_(e,t);var n=e.prototype;return n.oninit=function(r){t.prototype.oninit.call(this,r),this.ipInfo=this.attrs.ipInfo,this.data=null,this.ipInfo.latitude()&&this.ipInfo.longitude()?this.searchLatLon():this.ipInfo.zipCode()?this.searchZip():this.data={unknown:!0}},n.view=function(){return this.loading?m(k(),{size:"medium"}):this.data&&this.data.unknown?m("div",{className:"helpText"},r().translator.trans("fof-geoip.forum.map_modal.not_enough_data")):this.data?m("div",{id:"geoip-map",oncreate:this.configMap.bind(this)}):m("div",null)},n.searchLatLon=function(){var t=this;if(!this.loading)return this.loading=!0,z().then(r().request({url:"https://nominatim.openstreetmap.org/reverse",method:"GET",params:{lat:this.ipInfo.latitude(),lon:this.ipInfo.longitude(),format:"json"}}).then((function(r){t.data=r,t.loading=!1,m.redraw()})))},n.searchZip=function(){var t=this;if(!this.loading)return this.loading=!0,z().then(r().request({url:"https://nominatim.openstreetmap.org/search",method:"GET",params:{q:this.ipInfo.zipCode(),countrycodes:this.ipInfo.countryCode(),limit:1,format:"json"}}).then((function(r){t.data=r[0],t.loading=!1,m.redraw()})))},n.configMap=function(t){if(this.data){var r=this.data,e=r.boundingbox,n=r.display_name,o=(parseFloat(e[0])+parseFloat(e[1]))/2,a=(parseFloat(e[2])+parseFloat(e[3]))/2;this.map=L.map(t.dom).setView([o,a],5),L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© OpenStreetMap contributors'}).addTo(this.map),L.marker([o,a]).addTo(this.map).bindPopup(n).openPopup()}},e}(O());const F=flarum.core.compat["common/components/LabelValue"];var G=e.n(F),B=function(t){function e(){for(var r,e=arguments.length,n=new Array(e),o=0;o0&&m(G(),{label:r().translator.trans("fof-geoip.forum.map_modal.threat_types"),value:t.threatTypes().join(", ")}),t.error()&&m(G(),{label:r().translator.trans("fof-geoip.forum.map_modal.error"),value:t.error()})),m("hr",null),m("div",{id:"mapContainer"},m(M,{ipInfo:t}))):m("div",{className:"Modal-body"},m(k(),null))},e}(C());function R(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.children);!(n=o()).done;){var a=n.value.children.find((function(t){return"label"===(null==t?void 0:t.tag)})),i=a&&a.children.find((function(t){return"code"===(null==t?void 0:t.tag)})),u=i&&a.children.indexOf(i);if(i){var s=h(r),l=s.description,f=s.threat,p=s.image;i.attrs||(i.attrs={}),i.attrs["data-threat-level"]=r.threatLevel(),i.children[1]=m(c(),{text:l+(f?" ("+f+")":"")},m("span",null,i.children[1])),p&&a.children.splice(u,0,p)}}r.zipCode()&&r.countryCode()&&t.children.splice(2,0,m("div",{className:"Form-group"},m(M,{zip:r.zipCode(),country:r.countryCode()})))}}})),(0,o.extend)(U().prototype,"tokenActionItems",(function(t,e){var n=e.lastIpAddress();n&&t.add("geoip-info",m(w(),{className:"Button",onclick:function(){return r().modal.show(B,{ipAddr:n})},"aria-label":r().translator.trans("fof-geoip.forum.map_button_label")},r().translator.trans("fof-geoip.forum.map_button_label")),10)})),(0,o.extend)(V().prototype,"headerItems",(function(t){if(r().forum.attribute("fof-geoip.showFlag")){var e,n,o,a=null==(e=(n=this.attrs.post).ip_info)?void 0:e.call(n),i=this.attrs.post.user();if(a&&i&&i.showIPCountry()||null!=(o=r().session.user)&&null!=o.canSeeCountry&&o.canSeeCountry()){var u=h(a).image;u&&t.add("country",u,100)}}})),(0,o.extend)(Z().prototype,"privacyItems",(function(t){var e=this;r().forum.attribute("fof-geoip.showFlag")&&t.add("ip-country",J().component({state:this.user.preferences().showIPCountry,onchange:function(t){e.showIPCountryLoading=!0,e.user.savePreferences({showIPCountry:t}).then((function(){e.showIPCountryLoading=!1,m.redraw()}))},loading:this.showIPCountryLoading},r().translator.trans("fof-geoip.forum.user.settings.ip_country")))}))}))})(),module.exports=n})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index d5ab93c..17ce467 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";ynBACA,IAAMA,EAAW,cAGF,OAOA,SAA0BC,GAAA,IAClCD,EAASE,KAAKD,GAAK,KAChBE,EAAAC,EAAcH,GAAA,MACd,IAAII,UAAA,8DAAAC,OAEG,WAATH,EAAoBF,EAAKE,EAAA,mBAKzBI,EAAQC,EAAIP,EAAGQ,eAAeC,KAAI,SAAAV,GAAA,OAAKA,EAAEW,aAjBlC,MAiBiD,WACvDC,OAAOC,cAAAC,MAAPF,OAAAJ,EAAwBD,GAAA,cCnBjCQ,EAAOC,QAAU,SAAUC,GAOzB,IANA,IAAIC,EAAI,GACJC,EAAI,EACJC,EAAI,EACJC,EAAI,EACJC,EAAIL,EAAIM,OAELF,EAAIC,GACTH,EAAIF,EAAIN,WAAWU,KACfD,GACFF,EAAEM,MAAM,OAAYJ,EAAI,OAAW,KAAOD,EAAI,QAASM,SAAS,KAChEL,EAAI,GACK,OAAUD,GAAKA,GAAK,MAC7BC,EAAID,EAEJD,EAAEM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zB,GAAO,IAAA3E,EAAA,KAC1DzG,IAAAA,MAAUqK,UAAmB,uBAC/Be,EAAMnB,IACJ,aACA6C,IAAAA,UACE,CACEC,MAAOxS,KAAKoS,KAAKK,cAAcJ,cAC/BK,SAAU,SAACpU,GACT4N,EAAKyG,sBAAuB,EAE5BzG,EAAKkG,KAAKQ,gBAAgB,CAAEP,cAAe/T,IAASuC,MAAK,WACvDqL,EAAKyG,sBAAuB,EAC5B5M,EAAEwG,QACJ,GACF,EACAlG,QAASrG,KAAK2S,sBAEhBlN,IAAAA,WAAeoD,MAAM,6CAI7B,GLZF","sources":["webpack://@fof/geoip/../src/index.js","webpack://@fof/geoip/./node_modules/twemoji-basename/index.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/geoip/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/geoip/webpack/bootstrap","webpack://@fof/geoip/webpack/runtime/compat get default export","webpack://@fof/geoip/webpack/runtime/define property getters","webpack://@fof/geoip/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/geoip/webpack/runtime/make namespace object","webpack://@fof/geoip/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/PostMeta']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/geoip/./src/forum/helpers/IPDataHelper.tsx","webpack://@fof/geoip/./src/forum/util/getFlagEmojiUrl.js","webpack://@fof/geoip/./src/forum/helpers/ClipboardHelper.ts","webpack://@fof/geoip/./src/forum/util/copyToClipboard.ts","webpack://@fof/geoip/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/geoip/./node_modules/external-load/index.js","webpack://@fof/geoip/./src/forum/components/ZipCodeMap.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/LabelValue']\"","webpack://@fof/geoip/./src/forum/components/MapModal.tsx","webpack://@fof/geoip/external root \"flarum.core.compat['forum/components/AccessTokensList']\"","webpack://@fof/geoip/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/geoip/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/geoip/./src/forum/models/IPInfo.ts","webpack://@fof/geoip/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/geoip/./src/forum/extend.ts","webpack://@fof/geoip/./src/forum/index.ts","webpack://@fof/geoip/./src/forum/extenders/extendBanIPModal.js","webpack://@fof/geoip/./src/forum/extenders/extendPostMeta.js","webpack://@fof/geoip/./src/forum/extenders/extendAccessTokensList.tsx","webpack://@fof/geoip/./src/forum/extenders/extendCommentPost.tsx","webpack://@fof/geoip/./src/forum/extenders/extendUserPreferences.tsx"],"sourcesContent":["// country code regex\nconst CC_REGEX = /^[a-z]{2}$/i;\n\n// offset between uppercase ascii and regional indicator symbols\nconst OFFSET = 127397;\n\n/**\n * convert country code to corresponding emoji flag\n * @param {string} cc - country code string\n * @returns {string} country code emoji\n */\nexport default function countryCodeEmoji(cc) {\n if (!CC_REGEX.test(cc)) {\n const type = typeof cc;\n throw new TypeError(\n `cc argument must be an ISO 3166-1 alpha-2 string, but got '${\n type === 'string' ? cc : type\n }' instead.`,\n );\n }\n\n const chars = [...cc.toUpperCase()].map(c => c.charCodeAt() + OFFSET);\n return String.fromCodePoint(...chars);\n}\n","/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\n/* https://github.com/twitter/twemoji/blob/gh-pages/LICENSE */\n\nmodule.exports = function (str) {\n var r = []\n var c = 0\n var p = 0\n var i = 0\n var l = str.length\n\n while (i < l) {\n c = str.charCodeAt(i++)\n if (p) {\n r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16))\n p = 0\n } else if (0xD800 <= c && c <= 0xDBFF) {\n p = c\n } else {\n r.push(c.toString(16))\n }\n }\n\n return r.join('-')\n}\n","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].call(module.exports, 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['common/components/PostMeta'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport IPInfo from '../models/IPInfo';\nimport getFlagEmojiUrl from '../util/getFlagEmojiUrl';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport const getDescription = (ipInfo: IPInfo) => {\n return ipInfo.organization() || ipInfo.isp() || ipInfo.error() || '';\n};\n\nexport const getThreat = (ipInfo: IPInfo) => {\n return ipInfo.threatTypes() && ipInfo.threatTypes().join(', ');\n};\n\nexport const getFlagImage = (ipInfo: IPInfo) => {\n if (ipInfo && ipInfo.countryCode() && ipInfo.countryCode().length > 1) {\n const url = getFlagEmojiUrl(ipInfo.countryCode());\n\n const currentLocale = app.translator.getLocale() as string;\n\n // Create an instance of Intl.DisplayNames for displaying full country names\n const displayNames = new Intl.DisplayNames([currentLocale], { type: 'region' });\n\n // Get the full country name using the country code\n const countryName = displayNames.of(ipInfo.countryCode());\n\n if (url) {\n return (\n \n {countryName}\n \n );\n }\n }\n return null;\n};\n\nexport const getIPData = (ipInfo: IPInfo) => {\n const description = getDescription(ipInfo);\n const threat = getThreat(ipInfo);\n const image = getFlagImage(ipInfo);\n\n // Extracting zip and country from ipInfo\n const zip = ipInfo.zipCode();\n const country = ipInfo.countryCode(); // Assuming the country code is used as 'country'\n\n return { description, threat, image, zip, country };\n};\n","import flag from 'country-code-emoji';\nimport convert from 'twemoji-basename';\n\nexport default (countryCode) => {\n const codepoint = flag(countryCode);\n if (!codepoint) return null;\n\n const basename = convert(codepoint);\n return basename ? `https://cdn.jsdelivr.net/gh/twitter/twemoji@14/assets/72x72/${basename}.png` : null;\n};\n","import app from 'flarum/forum/app';\nimport copyToClipboard from '../util/copyToClipboard';\n\nexport const handleCopyIP = (ip: string) => {\n return () => {\n copyToClipboard(ip);\n app.alerts.show({ type: 'success' }, app.translator.trans('fof-geoip.forum.alerts.ip_copied'));\n };\n};\n","export default (str: string): void => {\n if (navigator.clipboard) {\n navigator.clipboard.writeText(str).then(() => {});\n return;\n }\n\n // Fallback method:\n const el: HTMLTextAreaElement = document.createElement('textarea');\n el.value = str;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n\n const selection = document.getSelection();\n const selected: Range | null = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n\n if (selected && selection) {\n selection.removeAllRanges();\n selection.addRange(selected);\n }\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","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/components/Modal'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","/**\n * Simple resource loader based on David Walsh's tutorial\n * https://davidwalsh.name/javascript-loader\n * https://davidwalsh.name/javascript-functions\n */\nexport default (function() {\n // Function which returns a function\n function _load(tag) {\n return function(url) {\n // This promise will be used by Promise.all to determine success or failure\n return new Promise(function(resolve, reject) {\n var element = document.createElement(tag);\n var parent = \"body\";\n var attr = \"src\";\n\n // Important success and error for the promise\n element.onload = function() {\n resolve(url);\n };\n element.onerror = function() {\n reject(url);\n };\n\n // Need to set different attributes depending on tag type\n switch (tag) {\n case \"script\":\n element.async = true;\n break;\n case \"link\":\n element.type = \"text/css\";\n element.rel = \"stylesheet\";\n attr = \"href\";\n parent = \"head\";\n }\n\n // Inject into document to kick off loading\n element[attr] = url;\n document[parent].appendChild(element);\n });\n };\n }\n\n return {\n css: _load(\"link\"),\n js: _load(\"script\"),\n img: _load(\"img\")\n };\n})();\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport load from 'external-load';\n\nlet addedResources = false;\nconst addResources = async () => {\n if (addedResources) return;\n\n await load.css('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');\n await load.js('https://unpkg.com/leaflet@1.9.4/dist/leaflet.js');\n\n addedResources = true;\n};\n\nexport default class ZipCodeMap extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.ipInfo = this.attrs.ipInfo;\n\n this.data = null;\n\n if (this.ipInfo.latitude() && this.ipInfo.longitude()) {\n this.searchLatLon();\n } else if (this.ipInfo.zipCode()) {\n this.searchZip();\n } else {\n this.data = { unknown: true };\n }\n }\n\n view() {\n if (this.loading) {\n return ;\n } else if (this.data && this.data.unknown) {\n return
{app.translator.trans('fof-geoip.forum.map_modal.not_enough_data')}
;\n } else if (!this.data) {\n return
;\n }\n\n return
;\n }\n\n searchLatLon() {\n if (this.loading) return;\n\n this.loading = true;\n\n return addResources().then(\n app\n .request({\n url: `https://nominatim.openstreetmap.org/reverse`,\n method: 'GET',\n params: {\n lat: this.ipInfo.latitude(),\n lon: this.ipInfo.longitude(),\n format: 'json',\n },\n })\n .then((data) => {\n this.data = data;\n this.loading = false;\n\n m.redraw();\n })\n );\n }\n\n searchZip() {\n if (this.loading) return;\n\n this.loading = true;\n\n return addResources().then(\n app\n .request({\n url: `https://nominatim.openstreetmap.org/search`,\n method: 'GET',\n params: {\n q: this.ipInfo.zipCode(),\n countrycodes: this.ipInfo.countryCode(),\n limit: 1,\n format: 'json',\n },\n })\n .then((data) => {\n this.data = data[0];\n this.loading = false;\n\n m.redraw();\n })\n );\n }\n\n configMap(vnode) {\n if (!this.data) return;\n\n const { boundingbox: bounding, display_name: displayName } = this.data;\n\n // Extract the latitude and longitude from the bounding box\n const lat1 = parseFloat(bounding[0]); // South bound latitude\n const lat2 = parseFloat(bounding[1]); // North bound latitude\n const lon1 = parseFloat(bounding[2]); // West bound longitude\n const lon2 = parseFloat(bounding[3]); // East bound longitude\n\n // Calculate the center of the bounding box\n const centerLat = (lat1 + lat2) / 2;\n const centerLon = (lon1 + lon2) / 2;\n\n const zoomLevel = 5; // Set your preferred zoom level here\n\n this.map = L.map(vnode.dom).setView([centerLat, centerLon], zoomLevel);\n\n L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '© OpenStreetMap contributors',\n }).addTo(this.map);\n\n // Set a marker at the center of the bounding box\n L.marker([centerLat, centerLon]).addTo(this.map).bindPopup(displayName).openPopup();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LabelValue'];","import app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport ZipCodeMap from './ZipCodeMap';\nimport IPInfo from '../models/IPInfo';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\nimport LabelValue from 'flarum/common/components/LabelValue';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\ninterface MapModalAttrs extends IInternalModalAttrs {\n ipInfo?: IPInfo;\n ipAddr: string;\n}\n\nexport default class MapModal extends Modal {\n ipInfo: IPInfo | undefined;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.ipInfo = this.attrs.ipInfo;\n if (this.ipInfo === undefined) {\n this.loadIpInfo();\n }\n }\n\n className() {\n return 'MapModal Modal--medium';\n }\n\n loadIpInfo() {\n app.store\n .find('ip_info', encodeURIComponent(this.attrs.ipAddr))\n .then((ipInfo) => {\n this.ipInfo = ipInfo;\n m.redraw();\n })\n .catch((error) => {\n console.error('Failed to load IP information from the store', error);\n });\n }\n\n title() {\n return app.translator.trans('fof-geoip.forum.map_modal.title');\n }\n\n content() {\n const ipInfo = this.ipInfo;\n\n if (!ipInfo) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
\n \n {this.attrs.ipAddr}\n \n }\n />\n {ipInfo.countryCode() && }\n {ipInfo.zipCode() && }\n {ipInfo.isp() && }\n {ipInfo.organization() && (\n \n )}\n {ipInfo.as() && }\n {}\n {ipInfo.threatLevel() && }\n {ipInfo.threatTypes().length > 0 && (\n \n )}\n {ipInfo.error() && }\n
\n
\n
\n \n
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/AccessTokensList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class IPInfo extends Model {\n id() {\n return Model.attribute('id').call(this);\n }\n\n countryCode() {\n return Model.attribute('countryCode').call(this);\n }\n\n zipCode() {\n return Model.attribute('zipCode').call(this);\n }\n\n latitude() {\n return Model.attribute('latitude').call(this);\n }\n\n longitude() {\n return Model.attribute('longitude').call(this);\n }\n\n isp() {\n return Model.attribute('isp').call(this);\n }\n\n organization() {\n return Model.attribute('organization').call(this);\n }\n\n as() {\n return Model.attribute('as').call(this);\n }\n\n mobile() {\n return Model.attribute('mobile').call(this);\n }\n\n threatLevel() {\n return Model.attribute('threatLevel').call(this);\n }\n\n threatTypes() {\n const raw = Model.attribute('threatTypes').call(this);\n if (!raw) {\n return [];\n }\n try {\n return JSON.parse(raw);\n } catch (error) {\n return [];\n }\n }\n\n error() {\n return Model.attribute('error').call(this);\n }\n\n dataProvider() {\n return Model.attribute('dataProvider').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n updatedAt() {\n return Model.attribute('updatedAt', Model.transformDate).call(this);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","import Extend from 'flarum/common/extenders';\nimport IPInfo from './models/IPInfo';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\n\nexport default [\n new Extend.Store() //\n .add('ip_info', IPInfo),\n\n new Extend.Model(Post) //\n .hasOne('ip_info'),\n\n new Extend.Model(User) //\n .attribute('showIPCountry'),\n];\n","import app from 'flarum/forum/app';\nimport extendPostMeta from './extenders/extendPostMeta';\nimport extendBanIPModal from './extenders/extendBanIPModal';\nimport extendAccessTokensList from './extenders/extendAccessTokensList';\nimport extendCommentPost from './extenders/extendCommentPost';\nimport extendUserPreferences from './extenders/extendUserPreferences';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof/geoip', () => {\n extendPostMeta();\n extendBanIPModal();\n extendAccessTokensList();\n extendCommentPost();\n extendUserPreferences();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ZipCodeMap from '../components/ZipCodeMap';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { getIPData } from '../helpers/IPDataHelper';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\n\nexport default function extendBanIPModal() {\n const BanIPModal = flarum.core.compat['fof/ban-ips/components/BanIPModal'];\n\n if (BanIPModal) {\n extend(BanIPModal.prototype, 'content', function (vdom) {\n if (!this.post || !this.post.ipAddress()) return;\n\n const ipInfo = this.post.ip_info();\n const formGroup = vdom.children.find((e) => e?.attrs?.className?.includes('Form-group') && e.children?.find?.((e) => e.tag === 'div'));\n\n if (!ipInfo || !formGroup) return;\n\n for (const child of formGroup.children) {\n const label = child.children.find((e) => e?.tag === 'label');\n const code = label && label.children.find((e) => e?.tag === 'code');\n\n const codeIndex = code && label.children.indexOf(code);\n if (!code) continue;\n\n const { description, threat, image } = getIPData(ipInfo);\n\n if (!code.attrs) code.attrs = {};\n code.attrs['data-threat-level'] = ipInfo.threatLevel();\n\n code.children[1] = (\n \n {code.children[1]}\n \n );\n\n if (image) {\n label.children.splice(codeIndex, 0, image);\n }\n }\n\n if (ipInfo.zipCode() && ipInfo.countryCode()) {\n vdom.children.splice(\n 2,\n 0,\n
\n \n
\n );\n }\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport PostMeta from 'flarum/common/components/PostMeta';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { getIPData } from '../helpers/IPDataHelper';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Button from 'flarum/common/components/Button';\nimport MapModal from '../components/MapModal';\n\nexport default function extendPostMeta() {\n extend(PostMeta.prototype, 'view', function (vdom) {\n const post = this.attrs.post;\n\n // Exit early if there's no post\n if (!post) return;\n\n const ipInformation = post.ip_info();\n\n // Exit early if there's no IP information for the post\n if (!ipInformation) return;\n\n // Extract dropdown from the VDOM\n const menuDropdown = vdom.children.find((e) => e.attrs?.className?.includes('dropdown-menu'));\n\n // Extract IP element for modification\n const ipElement = menuDropdown.children.find((e) => e.tag === 'span' && e.attrs?.className === 'PostMeta-ip');\n\n // Clear any default text from the IP element\n delete ipElement.text;\n\n // Construct the IP element with the tooltip and interactive behavior\n ipElement.children = [
{this.ipItems().toArray()}
];\n\n // If there's a threat level, add it as a data attribute for potential styling\n // TODO: move this to an Item?\n if (ipInformation.threatLevel) {\n ipElement.attrs['data-threat-level'] = ipInformation.threatLevel();\n }\n });\n\n PostMeta.prototype.ipItems = function () {\n const items = new ItemList();\n const post = this.attrs.post;\n const ipInformation = post.ip_info();\n const ipAddr = post.data.attributes.ipAddress;\n\n if (ipInformation && ipAddr) {\n const { description, threat, image } = getIPData(ipInformation);\n\n items.add(\n 'ipInfo',\n
\n {image}\n \n {ipAddr}\n \n
,\n 100\n );\n\n items.add(\n 'mapButton',\n \n app.modal.show(MapModal, { ipInfo: ipInformation, ipAddr: ipAddr })}\n aria-label={app.translator.trans('fof-geoip.forum.map_button_label')}\n />\n ,\n 90\n );\n }\n\n return items;\n };\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport AccessTokensList from 'flarum/forum/components/AccessTokensList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport MapModal from '../components/MapModal';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport AccessToken from 'flarum/common/models/AccessToken';\n\nexport default function extendAccessTokensList() {\n extend(AccessTokensList.prototype, 'tokenActionItems', function (items: ItemList, token: AccessToken) {\n const ipAddr = token.lastIpAddress();\n\n if (ipAddr) {\n items.add(\n 'geoip-info',\n app.modal.show(MapModal, { ipAddr: ipAddr })}\n aria-label={app.translator.trans('fof-geoip.forum.map_button_label')}\n >\n {app.translator.trans('fof-geoip.forum.map_button_label')}\n ,\n 10\n );\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport type Mithril from 'mithril';\nimport { getIPData } from '../helpers/IPDataHelper';\n\nexport default function extendCommentPost() {\n extend(CommentPost.prototype, 'headerItems', function (items: ItemList) {\n if (app.forum.attribute('fof-geoip.showFlag')) {\n const ipInfo = this.attrs.post.ip_info?.();\n const postUser = this.attrs.post.user();\n if (postUser && postUser.showIPCountry() && ipInfo) {\n const { image } = getIPData(ipInfo);\n if (image) {\n items.add('country', image, 100);\n }\n }\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default function extendUserPreferences() {\n extend(SettingsPage.prototype, 'privacyItems', function (items) {\n if (app.forum.attribute('fof-geoip.showFlag')) {\n items.add(\n 'ip-country',\n Switch.component(\n {\n state: this.user.preferences().showIPCountry,\n onchange: (value) => {\n this.showIPCountryLoading = true;\n\n this.user.savePreferences({ showIPCountry: value }).then(() => {\n this.showIPCountryLoading = false;\n m.redraw();\n });\n },\n loading: this.showIPCountryLoading,\n },\n app.translator.trans('fof-geoip.forum.user.settings.ip_country')\n )\n );\n }\n });\n}\n"],"names":["t","o","test","e","_typeof","TypeError","concat","n","_toConsumableArray","toUpperCase","map","charCodeAt","String","fromCodePoint","apply","module","exports","str","r","c","p","i","l","length","push","toString","join","require","_regeneratorRuntime","__esModule","Object","prototype","hasOwnProperty","defineProperty","value","Symbol","a","iterator","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","isNaN","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","getFlagImage","ipInfo","countryCode","url","codepoint","flag","basename","convert","getFlagEmojiUrl","currentLocale","app","getLocale","countryName","Intl","DisplayNames","of","m","Tooltip","text","src","alt","height","loading","getIPData","description","organization","isp","error","getDescription","threat","threatTypes","getThreat","image","zip","zipCode","country","handleCopyIP","ip","navigator","clipboard","writeText","el","document","createElement","setAttribute","style","position","left","body","appendChild","selection","getSelection","selected","rangeCount","getRangeAt","select","execCommand","removeChild","removeAllRanges","addRange","copyToClipboard","show","trans","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","asyncGeneratorStep","gen","reject","_next","_throw","info","_load","tag","element","parent","attr","onload","onerror","rel","css","js","img","addedResources","addResources","fn","_ref","_callee","_context","load","self","args","arguments","err","ZipCodeMap","_Component","_proto","oninit","vnode","attrs","data","latitude","longitude","searchLatLon","searchZip","unknown","view","LoadingIndicator","size","className","id","oncreate","configMap","_this","params","lat","lon","format","redraw","_this2","q","countrycodes","limit","_this$data","bounding","boundingbox","display_name","centerLat","parseFloat","centerLon","L","dom","setView","tileLayer","attribution","addTo","marker","bindPopup","openPopup","Component","MapModal","_Modal","_len","Array","_key","loadIpInfo","find","encodeURIComponent","ipAddr","console","title","content","LabelValue","label","onclick","as","mobile","threatLevel","Modal","IPInfo","_Model","Model","raw","JSON","parse","dataProvider","createdAt","updatedAt","Extend","add","Post","hasOne","User","attribute","BanIPModal","extend","PostMeta","vdom","post","ipInformation","ip_info","ipElement","children","_e$attrs","includes","_e$attrs2","ipItems","toArray","items","ItemList","attributes","ipAddress","_getIPData","Button","icon","formGroup","_e$children","_step","_iterator","_createForOfIteratorHelperLoose","code","codeIndex","indexOf","splice","AccessTokensList","token","lastIpAddress","CommentPost","_this$attrs$post$ip_i","_this$attrs$post","postUser","user","showIPCountry","SettingsPage","Switch","state","preferences","onchange","showIPCountryLoading","savePreferences"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";ynBACA,IAAMA,EAAW,cAGF,OAOA,SAA0BC,GAAA,IAClCD,EAASE,KAAKD,GAAK,KAChBE,EAAAC,EAAcH,GAAA,MACd,IAAII,UAAA,8DAAAC,OAEG,WAATH,EAAoBF,EAAKE,EAAA,mBAKzBI,EAAQC,EAAIP,EAAGQ,eAAeC,KAAI,SAAAV,GAAA,OAAKA,EAAEW,aAjBlC,MAiBiD,WACvDC,OAAOC,cAAAC,MAAPF,OAAAJ,EAAwBD,GAAA,cCnBjCQ,EAAOC,QAAU,SAAUC,GAOzB,IANA,IAAIC,EAAI,GACJC,EAAI,EACJC,EAAI,EACJC,EAAI,EACJC,EAAIL,EAAIM,OAELF,EAAIC,GACTH,EAAIF,EAAIN,WAAWU,KACfD,GACFF,EAAEM,MAA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QAAY4M,OAAmB,MAA/BF,EAAkBI,eAAlBJ,EAAkBI,gBAAmB,CAC3F,IAAQxL,EAAUT,EAAUtB,GAApB+B,MACJA,GACF8J,EAAMnB,IAAI,UAAW3I,EAAO,IAEhC,CACF,CACF,KCbAiJ,EAAAA,EAAAA,QAAOwC,IAAAA,UAAwB,gBAAgB,SAAU3B,GAAO,IAAA3E,EAAA,KAC1DzG,IAAAA,MAAUqK,UAAmB,uBAC/Be,EAAMnB,IACJ,aACA+C,IAAAA,UACE,CACEC,MAAO1S,KAAKqS,KAAKM,cAAcL,cAC/BM,SAAU,SAACtU,GACT4N,EAAK2G,sBAAuB,EAE5B3G,EAAKmG,KAAKS,gBAAgB,CAAER,cAAehU,IAASuC,MAAK,WACvDqL,EAAK2G,sBAAuB,EAC5B9M,EAAEwG,QACJ,GACF,EACAlG,QAASrG,KAAK6S,sBAEhBpN,IAAAA,WAAeoD,MAAM,6CAI7B,GLZF","sources":["webpack://@fof/geoip/../src/index.js","webpack://@fof/geoip/./node_modules/twemoji-basename/index.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/geoip/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/geoip/webpack/bootstrap","webpack://@fof/geoip/webpack/runtime/compat get default export","webpack://@fof/geoip/webpack/runtime/define property getters","webpack://@fof/geoip/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/geoip/webpack/runtime/make namespace object","webpack://@fof/geoip/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/PostMeta']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/geoip/./src/forum/helpers/IPDataHelper.tsx","webpack://@fof/geoip/./src/forum/util/getFlagEmojiUrl.js","webpack://@fof/geoip/./src/forum/helpers/ClipboardHelper.ts","webpack://@fof/geoip/./src/forum/util/copyToClipboard.ts","webpack://@fof/geoip/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/geoip/./node_modules/external-load/index.js","webpack://@fof/geoip/./src/forum/components/ZipCodeMap.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/LabelValue']\"","webpack://@fof/geoip/./src/forum/components/MapModal.tsx","webpack://@fof/geoip/external root \"flarum.core.compat['forum/components/AccessTokensList']\"","webpack://@fof/geoip/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/geoip/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/geoip/./src/forum/models/IPInfo.ts","webpack://@fof/geoip/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/geoip/./src/forum/extend.ts","webpack://@fof/geoip/./src/forum/index.ts","webpack://@fof/geoip/./src/forum/extenders/extendBanIPModal.js","webpack://@fof/geoip/./src/forum/extenders/extendPostMeta.js","webpack://@fof/geoip/./src/forum/extenders/extendAccessTokensList.tsx","webpack://@fof/geoip/./src/forum/extenders/extendCommentPost.tsx","webpack://@fof/geoip/./src/forum/extenders/extendUserPreferences.tsx"],"sourcesContent":["// country code regex\nconst CC_REGEX = /^[a-z]{2}$/i;\n\n// offset between uppercase ascii and regional indicator symbols\nconst OFFSET = 127397;\n\n/**\n * convert country code to corresponding emoji flag\n * @param {string} cc - country code string\n * @returns {string} country code emoji\n */\nexport default function countryCodeEmoji(cc) {\n if (!CC_REGEX.test(cc)) {\n const type = typeof cc;\n throw new TypeError(\n `cc argument must be an ISO 3166-1 alpha-2 string, but got '${\n type === 'string' ? cc : type\n }' instead.`,\n );\n }\n\n const chars = [...cc.toUpperCase()].map(c => c.charCodeAt() + OFFSET);\n return String.fromCodePoint(...chars);\n}\n","/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\n/* https://github.com/twitter/twemoji/blob/gh-pages/LICENSE */\n\nmodule.exports = function (str) {\n var r = []\n var c = 0\n var p = 0\n var i = 0\n var l = str.length\n\n while (i < l) {\n c = str.charCodeAt(i++)\n if (p) {\n r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16))\n p = 0\n } else if (0xD800 <= c && c <= 0xDBFF) {\n p = c\n } else {\n r.push(c.toString(16))\n }\n }\n\n return r.join('-')\n}\n","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].call(module.exports, 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['common/components/PostMeta'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport IPInfo from '../models/IPInfo';\nimport getFlagEmojiUrl from '../util/getFlagEmojiUrl';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport const getDescription = (ipInfo: IPInfo) => {\n return ipInfo.organization() || ipInfo.isp() || ipInfo.error() || '';\n};\n\nexport const getThreat = (ipInfo: IPInfo) => {\n return ipInfo.threatTypes() && ipInfo.threatTypes().join(', ');\n};\n\nexport const getFlagImage = (ipInfo: IPInfo) => {\n if (ipInfo && ipInfo.countryCode() && ipInfo.countryCode().length > 1) {\n const url = getFlagEmojiUrl(ipInfo.countryCode());\n\n const currentLocale = app.translator.getLocale() as string;\n\n // Create an instance of Intl.DisplayNames for displaying full country names\n const displayNames = new Intl.DisplayNames([currentLocale], { type: 'region' });\n\n // Get the full country name using the country code\n const countryName = displayNames.of(ipInfo.countryCode());\n\n if (url) {\n return (\n \n {countryName}\n \n );\n }\n }\n return null;\n};\n\nexport const getIPData = (ipInfo: IPInfo) => {\n const description = getDescription(ipInfo);\n const threat = getThreat(ipInfo);\n const image = getFlagImage(ipInfo);\n\n // Extracting zip and country from ipInfo\n const zip = ipInfo.zipCode();\n const country = ipInfo.countryCode(); // Assuming the country code is used as 'country'\n\n return { description, threat, image, zip, country };\n};\n","import flag from 'country-code-emoji';\nimport convert from 'twemoji-basename';\n\nexport default (countryCode) => {\n const codepoint = flag(countryCode);\n if (!codepoint) return null;\n\n const basename = convert(codepoint);\n return basename ? `https://cdn.jsdelivr.net/gh/twitter/twemoji@14/assets/72x72/${basename}.png` : null;\n};\n","import app from 'flarum/forum/app';\nimport copyToClipboard from '../util/copyToClipboard';\n\nexport const handleCopyIP = (ip: string) => {\n return () => {\n copyToClipboard(ip);\n app.alerts.show({ type: 'success' }, app.translator.trans('fof-geoip.forum.alerts.ip_copied'));\n };\n};\n","export default (str: string): void => {\n if (navigator.clipboard) {\n navigator.clipboard.writeText(str).then(() => {});\n return;\n }\n\n // Fallback method:\n const el: HTMLTextAreaElement = document.createElement('textarea');\n el.value = str;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n\n const selection = document.getSelection();\n const selected: Range | null = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n\n if (selected && selection) {\n selection.removeAllRanges();\n selection.addRange(selected);\n }\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","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/components/Modal'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","/**\n * Simple resource loader based on David Walsh's tutorial\n * https://davidwalsh.name/javascript-loader\n * https://davidwalsh.name/javascript-functions\n */\nexport default (function() {\n // Function which returns a function\n function _load(tag) {\n return function(url) {\n // This promise will be used by Promise.all to determine success or failure\n return new Promise(function(resolve, reject) {\n var element = document.createElement(tag);\n var parent = \"body\";\n var attr = \"src\";\n\n // Important success and error for the promise\n element.onload = function() {\n resolve(url);\n };\n element.onerror = function() {\n reject(url);\n };\n\n // Need to set different attributes depending on tag type\n switch (tag) {\n case \"script\":\n element.async = true;\n break;\n case \"link\":\n element.type = \"text/css\";\n element.rel = \"stylesheet\";\n attr = \"href\";\n parent = \"head\";\n }\n\n // Inject into document to kick off loading\n element[attr] = url;\n document[parent].appendChild(element);\n });\n };\n }\n\n return {\n css: _load(\"link\"),\n js: _load(\"script\"),\n img: _load(\"img\")\n };\n})();\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport load from 'external-load';\n\nlet addedResources = false;\nconst addResources = async () => {\n if (addedResources) return;\n\n await load.css('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');\n await load.js('https://unpkg.com/leaflet@1.9.4/dist/leaflet.js');\n\n addedResources = true;\n};\n\nexport default class ZipCodeMap extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.ipInfo = this.attrs.ipInfo;\n\n this.data = null;\n\n if (this.ipInfo.latitude() && this.ipInfo.longitude()) {\n this.searchLatLon();\n } else if (this.ipInfo.zipCode()) {\n this.searchZip();\n } else {\n this.data = { unknown: true };\n }\n }\n\n view() {\n if (this.loading) {\n return ;\n } else if (this.data && this.data.unknown) {\n return
{app.translator.trans('fof-geoip.forum.map_modal.not_enough_data')}
;\n } else if (!this.data) {\n return
;\n }\n\n return
;\n }\n\n searchLatLon() {\n if (this.loading) return;\n\n this.loading = true;\n\n return addResources().then(\n app\n .request({\n url: `https://nominatim.openstreetmap.org/reverse`,\n method: 'GET',\n params: {\n lat: this.ipInfo.latitude(),\n lon: this.ipInfo.longitude(),\n format: 'json',\n },\n })\n .then((data) => {\n this.data = data;\n this.loading = false;\n\n m.redraw();\n })\n );\n }\n\n searchZip() {\n if (this.loading) return;\n\n this.loading = true;\n\n return addResources().then(\n app\n .request({\n url: `https://nominatim.openstreetmap.org/search`,\n method: 'GET',\n params: {\n q: this.ipInfo.zipCode(),\n countrycodes: this.ipInfo.countryCode(),\n limit: 1,\n format: 'json',\n },\n })\n .then((data) => {\n this.data = data[0];\n this.loading = false;\n\n m.redraw();\n })\n );\n }\n\n configMap(vnode) {\n if (!this.data) return;\n\n const { boundingbox: bounding, display_name: displayName } = this.data;\n\n // Extract the latitude and longitude from the bounding box\n const lat1 = parseFloat(bounding[0]); // South bound latitude\n const lat2 = parseFloat(bounding[1]); // North bound latitude\n const lon1 = parseFloat(bounding[2]); // West bound longitude\n const lon2 = parseFloat(bounding[3]); // East bound longitude\n\n // Calculate the center of the bounding box\n const centerLat = (lat1 + lat2) / 2;\n const centerLon = (lon1 + lon2) / 2;\n\n const zoomLevel = 5; // Set your preferred zoom level here\n\n this.map = L.map(vnode.dom).setView([centerLat, centerLon], zoomLevel);\n\n L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '© OpenStreetMap contributors',\n }).addTo(this.map);\n\n // Set a marker at the center of the bounding box\n L.marker([centerLat, centerLon]).addTo(this.map).bindPopup(displayName).openPopup();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LabelValue'];","import app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport ZipCodeMap from './ZipCodeMap';\nimport IPInfo from '../models/IPInfo';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\nimport LabelValue from 'flarum/common/components/LabelValue';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\ninterface MapModalAttrs extends IInternalModalAttrs {\n ipInfo?: IPInfo;\n ipAddr: string;\n}\n\nexport default class MapModal extends Modal {\n ipInfo: IPInfo | undefined;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.ipInfo = this.attrs.ipInfo;\n if (this.ipInfo === undefined) {\n this.loadIpInfo();\n }\n }\n\n className() {\n return 'MapModal Modal--medium';\n }\n\n loadIpInfo() {\n app.store\n .find('ip_info', encodeURIComponent(this.attrs.ipAddr))\n .then((ipInfo) => {\n this.ipInfo = ipInfo;\n m.redraw();\n })\n .catch((error) => {\n console.error('Failed to load IP information from the store', error);\n });\n }\n\n title() {\n return app.translator.trans('fof-geoip.forum.map_modal.title');\n }\n\n content() {\n const ipInfo = this.ipInfo;\n\n if (!ipInfo) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
\n \n {this.attrs.ipAddr}\n \n }\n />\n {ipInfo.countryCode() && }\n {ipInfo.zipCode() && }\n {ipInfo.isp() && }\n {ipInfo.organization() && (\n \n )}\n {ipInfo.as() && }\n {}\n {ipInfo.threatLevel() && }\n {ipInfo.threatTypes().length > 0 && (\n \n )}\n {ipInfo.error() && }\n
\n
\n
\n \n
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/AccessTokensList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class IPInfo extends Model {\n id() {\n return Model.attribute('id').call(this);\n }\n\n countryCode() {\n return Model.attribute('countryCode').call(this);\n }\n\n zipCode() {\n return Model.attribute('zipCode').call(this);\n }\n\n latitude() {\n return Model.attribute('latitude').call(this);\n }\n\n longitude() {\n return Model.attribute('longitude').call(this);\n }\n\n isp() {\n return Model.attribute('isp').call(this);\n }\n\n organization() {\n return Model.attribute('organization').call(this);\n }\n\n as() {\n return Model.attribute('as').call(this);\n }\n\n mobile() {\n return Model.attribute('mobile').call(this);\n }\n\n threatLevel() {\n return Model.attribute('threatLevel').call(this);\n }\n\n threatTypes() {\n const raw = Model.attribute('threatTypes').call(this);\n if (!raw) {\n return [];\n }\n try {\n return JSON.parse(raw);\n } catch (error) {\n return [];\n }\n }\n\n error() {\n return Model.attribute('error').call(this);\n }\n\n dataProvider() {\n return Model.attribute('dataProvider').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n updatedAt() {\n return Model.attribute('updatedAt', Model.transformDate).call(this);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","import Extend from 'flarum/common/extenders';\nimport IPInfo from './models/IPInfo';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\n\nexport default [\n new Extend.Store() //\n .add('ip_info', IPInfo),\n\n new Extend.Model(Post) //\n .hasOne('ip_info'),\n\n new Extend.Model(User) //\n .attribute('showIPCountry')\n .attribute('canSeeCountry'),\n];\n","import app from 'flarum/forum/app';\nimport extendPostMeta from './extenders/extendPostMeta';\nimport extendBanIPModal from './extenders/extendBanIPModal';\nimport extendAccessTokensList from './extenders/extendAccessTokensList';\nimport extendCommentPost from './extenders/extendCommentPost';\nimport extendUserPreferences from './extenders/extendUserPreferences';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof/geoip', () => {\n extendPostMeta();\n extendBanIPModal();\n extendAccessTokensList();\n extendCommentPost();\n extendUserPreferences();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ZipCodeMap from '../components/ZipCodeMap';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { getIPData } from '../helpers/IPDataHelper';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\n\nexport default function extendBanIPModal() {\n const BanIPModal = flarum.core.compat['fof/ban-ips/components/BanIPModal'];\n\n if (BanIPModal) {\n extend(BanIPModal.prototype, 'content', function (vdom) {\n if (!this.post || !this.post.ipAddress()) return;\n\n const ipInfo = this.post.ip_info();\n const formGroup = vdom.children.find((e) => e?.attrs?.className?.includes('Form-group') && e.children?.find?.((e) => e.tag === 'div'));\n\n if (!ipInfo || !formGroup) return;\n\n for (const child of formGroup.children) {\n const label = child.children.find((e) => e?.tag === 'label');\n const code = label && label.children.find((e) => e?.tag === 'code');\n\n const codeIndex = code && label.children.indexOf(code);\n if (!code) continue;\n\n const { description, threat, image } = getIPData(ipInfo);\n\n if (!code.attrs) code.attrs = {};\n code.attrs['data-threat-level'] = ipInfo.threatLevel();\n\n code.children[1] = (\n \n {code.children[1]}\n \n );\n\n if (image) {\n label.children.splice(codeIndex, 0, image);\n }\n }\n\n if (ipInfo.zipCode() && ipInfo.countryCode()) {\n vdom.children.splice(\n 2,\n 0,\n
\n \n
\n );\n }\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport PostMeta from 'flarum/common/components/PostMeta';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { getIPData } from '../helpers/IPDataHelper';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Button from 'flarum/common/components/Button';\nimport MapModal from '../components/MapModal';\n\nexport default function extendPostMeta() {\n extend(PostMeta.prototype, 'view', function (vdom) {\n const post = this.attrs.post;\n\n // Exit early if there's no post\n if (!post) return;\n\n const ipInformation = post.ip_info();\n\n // Exit early if there's no IP information for the post\n if (!ipInformation) return;\n\n // Extract dropdown from the VDOM\n const menuDropdown = vdom.children.find((e) => e.attrs?.className?.includes('dropdown-menu'));\n\n // Extract IP element for modification\n const ipElement = menuDropdown.children.find((e) => e.tag === 'span' && e.attrs?.className === 'PostMeta-ip');\n\n // Clear any default text from the IP element\n delete ipElement.text;\n\n // Construct the IP element with the tooltip and interactive behavior\n ipElement.children = [
{this.ipItems().toArray()}
];\n\n // If there's a threat level, add it as a data attribute for potential styling\n // TODO: move this to an Item?\n if (ipInformation.threatLevel) {\n ipElement.attrs['data-threat-level'] = ipInformation.threatLevel();\n }\n });\n\n PostMeta.prototype.ipItems = function () {\n const items = new ItemList();\n const post = this.attrs.post;\n const ipInformation = post.ip_info();\n const ipAddr = post.data.attributes.ipAddress;\n\n if (ipInformation && ipAddr) {\n const { description, threat, image } = getIPData(ipInformation);\n\n items.add(\n 'ipInfo',\n
\n {image}\n \n {ipAddr}\n \n
,\n 100\n );\n\n items.add(\n 'mapButton',\n \n app.modal.show(MapModal, { ipInfo: ipInformation, ipAddr: ipAddr })}\n aria-label={app.translator.trans('fof-geoip.forum.map_button_label')}\n />\n ,\n 90\n );\n }\n\n return items;\n };\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport AccessTokensList from 'flarum/forum/components/AccessTokensList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport MapModal from '../components/MapModal';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport AccessToken from 'flarum/common/models/AccessToken';\n\nexport default function extendAccessTokensList() {\n extend(AccessTokensList.prototype, 'tokenActionItems', function (items: ItemList, token: AccessToken) {\n const ipAddr = token.lastIpAddress();\n\n if (ipAddr) {\n items.add(\n 'geoip-info',\n app.modal.show(MapModal, { ipAddr: ipAddr })}\n aria-label={app.translator.trans('fof-geoip.forum.map_button_label')}\n >\n {app.translator.trans('fof-geoip.forum.map_button_label')}\n ,\n 10\n );\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport type Mithril from 'mithril';\nimport { getIPData } from '../helpers/IPDataHelper';\n\nexport default function extendCommentPost() {\n extend(CommentPost.prototype, 'headerItems', function (items: ItemList) {\n if (app.forum.attribute('fof-geoip.showFlag')) {\n const ipInfo = this.attrs.post.ip_info?.();\n const postUser = this.attrs.post.user();\n if ((ipInfo && postUser && postUser.showIPCountry()) || app.session.user?.canSeeCountry?.()) {\n const { image } = getIPData(ipInfo);\n if (image) {\n items.add('country', image, 100);\n }\n }\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default function extendUserPreferences() {\n extend(SettingsPage.prototype, 'privacyItems', function (items) {\n if (app.forum.attribute('fof-geoip.showFlag')) {\n items.add(\n 'ip-country',\n Switch.component(\n {\n state: this.user.preferences().showIPCountry,\n onchange: (value) => {\n this.showIPCountryLoading = true;\n\n this.user.savePreferences({ showIPCountry: value }).then(() => {\n this.showIPCountryLoading = false;\n m.redraw();\n });\n },\n loading: this.showIPCountryLoading,\n },\n app.translator.trans('fof-geoip.forum.user.settings.ip_country')\n )\n );\n }\n });\n}\n"],"names":["t","o","test","e","_typeof","TypeError","concat","n","_toConsumableArray","toUpperCase","map","charCodeAt","String","fromCodePoint","apply","module","exports","str","r","c","p","i","l","length","push","toString","join","require","_regeneratorRuntime","__esModule","Object","prototype","hasOwnProperty","defineProperty","value","Symbol","a","iterator","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","isNaN","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","getFlagImage","ipInfo","countryCode","url","codepoint","flag","basename","convert","getFlagEmojiUrl","currentLocale","app","getLocale","countryName","Intl","DisplayNames","of","m","Tooltip","text","src","alt","height","loading","getIPData","description","organization","isp","error","getDescription","threat","threatTypes","getThreat","image","zip","zipCode","country","handleCopyIP","ip","navigator","clipboard","writeText","el","document","createElement","setAttribute","style","position","left","body","appendChild","selection","getSelection","selected","rangeCount","getRangeAt","select","execCommand","removeChild","removeAllRanges","addRange","copyToClipboard","show","trans","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","asyncGeneratorStep","gen","reject","_next","_throw","info","_load","tag","element","parent","attr","onload","onerror","rel","css","js","img","addedResources","addResources","fn","_ref","_callee","_context","load","self","args","arguments","err","ZipCodeMap","_Component","_proto","oninit","vnode","attrs","data","latitude","longitude","searchLatLon","searchZip","unknown","view","LoadingIndicator","size","className","id","oncreate","configMap","_this","params","lat","lon","format","redraw","_this2","q","countrycodes","limit","_this$data","bounding","boundingbox","display_name","centerLat","parseFloat","centerLon","L","dom","setView","tileLayer","attribution","addTo","marker","bindPopup","openPopup","Component","MapModal","_Modal","_len","Array","_key","loadIpInfo","find","encodeURIComponent","ipAddr","console","title","content","LabelValue","label","onclick","as","mobile","threatLevel","Modal","IPInfo","_Model","Model","raw","JSON","parse","dataProvider","createdAt","updatedAt","Extend","add","Post","hasOne","User","attribute","BanIPModal","extend","PostMeta","vdom","post","ipInformation","ip_info","ipElement","children","_e$attrs","includes","_e$attrs2","ipItems","toArray","items","ItemList","attributes","ipAddress","_getIPData","Button","icon","formGroup","_e$children","_step","_iterator","_createForOfIteratorHelperLoose","code","codeIndex","indexOf","splice","AccessTokensList","token","lastIpAddress","CommentPost","_this$attrs$post$ip_i","_this$attrs$post","_app$session$user","postUser","user","showIPCountry","canSeeCountry","SettingsPage","Switch","state","preferences","onchange","showIPCountryLoading","savePreferences"],"sourceRoot":""} \ No newline at end of file