diff --git a/js/dist/admin.js b/js/dist/admin.js index 9d1e8e4..0398cbb 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{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={}})(); +(()=>{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 a=t[r]={exports:{}};return e[r](a,a.exports,o),a.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),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";o.r(r),o.d(r,{components:()=>y});const e=flarum.core.compat["admin/app"];var t=o.n(e);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}const a=flarum.core.compat["common/components/Alert"];var s=o.n(a);const i=flarum.core.compat["admin/components/ExtensionPage"];var p=o.n(i);const l=flarum.core.compat["common/helpers/humanTime"];var c=o.n(l);const f=flarum.core.compat["common/utils/extractText"];var g=o.n(f);const d=flarum.core.compat["common/utils/ItemList"];var u=o.n(d),v=o(175),b=o.n(v),h=function(e){var o,r;function a(){return e.apply(this,arguments)||this}r=e,(o=a).prototype=Object.create(r.prototype),o.prototype.constructor=o,n(o,r);var i=a.prototype;return i.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 m("div",{className:"GeoipSettingsPage"},m("div",{className:"container"},m("div",{className:"GeoipSettingsTabPage GeoipSettingsPage--settings"},m("div",{className:"Form"},r&&m(s(),{className:"Form-group",dismissable:!1},m("b",{style:{textTransform:"uppercase",marginRight:"5px"}},c()(new Date(o))),r),this.settingsItems().toArray(),m("div",{className:"Form-group"},this.submitButton())))))},i.settingsItems=function(){var e=new(u());return e.add("general",m("div",{className:"Section"},m("h3",null,t().translator.trans("fof-geoip.admin.settings.general.heading")),m("p",{className:"helpText"},t().translator.trans("fof-geoip.admin.settings.general.help")),this.generalItems().toArray())),e.add("providers",m("div",{className:"Section"},m("h3",null,t().translator.trans("fof-geoip.admin.settings.providers.heading")),m("p",{className:"helpText"},t().translator.trans("fof-geoip.admin.settings.providers.help")),this.providerItems().toArray())),e},i.generalItems=function(){var e=new(u());return e.add("show-flags",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")})),e},i.providerItems=function(){var e=new(u()),o=this.setting("fof-geoip.service")();return e.add("service",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]=g()(t().translator.trans("fof-geoip.admin.settings.service_"+o+"_label")),e}),{}),required:!0,help:o&&m.trust(b()(g()(t().translator.trans("fof-geoip.admin.settings.service_"+o+"_description"))))})),["ipdata","ipapi-pro","ipsevenex"].includes(o)&&e.add("api-key",this.buildSettingComponent({type:"string",setting:"fof-geoip.services."+o+".access_key",label:t().translator.trans("fof-geoip.admin.settings.access_key_label"),required:!0})),"ipdata"===o&&e.add("ipdata-quota",this.buildSettingComponent({type:"number",setting:"fof-geoip.services.ipdata.quota",label:t().translator.trans("fof-geoip.admin.settings.quota_label"),min:1500,placeholder:1500})),e},a}(p()),y={GeoipSettingsPage:h};t().initializers.add("fof/geoip",(function(){t().extensionData.for("fof-geoip").registerPage(h).registerPermission({icon:"fas fa-globe",permission:"fof-geoip.canSeeCountry",label:t().translator.trans("fof-geoip.admin.permissions.see_country")},"moderate",50)}))})(),module.exports=r})(); //# 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 85631f1..820e3bb 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,GA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/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 +{"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,EAAI,CAACK,EAAKC,IAAUL,OAA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AAE0B,MAAMC,IAAQH,IAAY3B,IAAAA,WAAekB,MAAM,oCAAoCvB,EAAO,sBAIjH,CAAC,SAAU,YAAa,aAAaoC,SAASpC,IAC5CoB,EAAME,IACJ,UACArB,KAAKyB,sBAAsB,CACzBC,KAAM,SACNzB,QAAS,sBAAsBF,EAAO,cACtC4B,MAAOvB,IAAAA,WAAekB,MAAM,6CAC5BU,UAAU,KAIJ,WAAZjC,GACEoB,EAAME,IACJ,eACArB,KAAKyB,sBAAsB,CACzBC,KAAM,SACNzB,QAAS,kCACT0B,MAAOvB,IAAAA,WAAekB,MAAM,wCAC5Bc,IAAK,KACLC,YAAa,QAIZlB,CACT,EAAC9B,CAAA,CA7GmC,CAASiD,KERlCC,EAAa,CACxBlD,kBAAAA,GCEFe,IAAAA,aAAiBiB,IAAI,aAAa,WAChCjB,IAAAA,cAAiB,IACV,aACJoC,aAAanD,GACboD,mBACC,CACEC,KAAM,eACNC,WAAY,0BACZhB,MAAOvB,IAAAA,WAAekB,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/webpack/runtime/make namespace object","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/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/geoip/./src/admin/components/GeoipSettingsPage.tsx","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/geoip/./src/admin/components/index.ts","webpack://@fof/geoip/./src/admin/index.ts"],"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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","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'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","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 Mithril from 'mithril';\nimport ItemList from 'flarum/common/utils/ItemList';\n// @ts-expect-error\nimport linkify from 'linkify-lite';\n\nexport default class GeoipSettingsPage extends ExtensionPage {\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 const error = app.data.settings[`fof-geoip.services.${service}.error`] as string | undefined;\n\n return (\n
\n
\n
\n
\n {error && (\n \n {humanTime(new Date(errorTime))}\n {error}\n \n )}\n {this.settingsItems().toArray()}\n
{this.submitButton()}
\n
\n
\n
\n
\n );\n }\n\n settingsItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'general',\n
\n

{app.translator.trans('fof-geoip.admin.settings.general.heading')}

\n

{app.translator.trans('fof-geoip.admin.settings.general.help')}

\n {this.generalItems().toArray()}\n
\n );\n\n items.add(\n 'providers',\n
\n

{app.translator.trans('fof-geoip.admin.settings.providers.heading')}

\n

{app.translator.trans('fof-geoip.admin.settings.providers.help')}

\n {this.providerItems().toArray()}\n
\n );\n\n return items;\n }\n\n generalItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'show-flags',\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 );\n\n return items;\n }\n\n providerItems(): ItemList {\n const items = new ItemList();\n const service = this.setting('fof-geoip.service')();\n\n items.add(\n 'service',\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'] as string[]).reduce((o: { [x: string]: string }, p: string) => {\n o[p] = extractText(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\n ['ipdata', 'ipapi-pro', 'ipsevenex'].includes(service) &&\n items.add(\n 'api-key',\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 items.add(\n 'ipdata-quota',\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\n return items;\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 GeoipSettingsPage from './GeoipSettingsPage';\n\nexport const components = {\n GeoipSettingsPage,\n};\n","import app from 'flarum/admin/app';\nimport GeoipSettingsPage from './components/GeoipSettingsPage';\n\nexport * from './components';\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","r","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","GeoipSettingsPage","_ExtensionPage","subClass","superClass","apply","arguments","create","constructor","_proto","content","service","this","setting","errorTime","Number","app","settings","error","m","className","Alert","dismissable","style","textTransform","marginRight","humanTime","Date","settingsItems","toArray","submitButton","items","ItemList","add","trans","generalItems","providerItems","buildSettingComponent","type","label","help","options","reduce","extractText","required","trust","linkify","includes","min","placeholder","ExtensionPage","components","registerPage","registerPermission","icon","permission"],"sourceRoot":""} \ No newline at end of file