From f8ad36746aba0038fe12e605322427e75b8c7fa7 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sun, 12 Nov 2023 12:32:49 +0000 Subject: [PATCH] Bundled output for commit 6e13bcd3f7d9a7b43ad8e89ac7d37920fca33517 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 5b1efa7..95bc328 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,8FCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAzC,SAASC,EAAgBhB,EAAGiB,GAKzC,OAJAD,EAAkBf,OAAOiB,eAAiBjB,OAAOiB,eAAeC,OAAS,SAAyBnB,EAAGiB,GAEnG,OADAjB,EAAEoB,UAAYH,EACPjB,CACT,EACOgB,EAAgBhB,EAAGiB,EAC5B,CCLe,SAASI,EAAeC,EAAUC,GAC/CD,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C,EAzJ4B,CAASmB,KCP7BC,EAAa,CACtB7M,UAAAA,EACA2B,aAAAA,GCFSmL,EAAS,CAClB9M,UAAAA,EACAG,WAAAA,GCCS4M,EAAQ,CACjBlE,aAAAA,EACAqB,WAAAA,EACAuB,WAAAA,EACAQ,aAAAA,EACArH,YAAAA,GCLSoI,EAAQ,CACjB5E,aAAAA,EACA9B,cAAAA,EACAnD,iBAAAA,EACAkB,eAAAA,EACA+B,eAAAA,GCDJzF,IAAAA,aAAAA,IAAqB,gBAAgB,SAAAA,GACjCA,EAAIsM,MAAMH,OAAO,2BAA6B9M,EAC9CW,EAAIsM,MAAMH,OAAO,uBAAyB3M,EAE1CQ,EAAIuM,cAAa,IACR,gBACJC,aAAalB,GACbmB,mBACG,CACIvH,KAAM,gBACNG,MAAOrF,EAAI0M,WAAWC,MAClB,mDAEJC,WAAY,iBACZC,YAAY,GAEhB,OAEZ,G","sources":["webpack://@fof/linguist/webpack/bootstrap","webpack://@fof/linguist/webpack/runtime/compat get default export","webpack://@fof/linguist/webpack/runtime/define property getters","webpack://@fof/linguist/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/linguist/webpack/runtime/make namespace object","webpack://@fof/linguist/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/linguist/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/linguist/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/linguist/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/linguist/./src/admin/models/StringKey.js","webpack://@fof/linguist/./src/admin/models/TextString.js","webpack://@fof/linguist/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/linguist/external root \"flarum.core.compat['admin/components/LoadingModal']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/linguist/./src/admin/utils/localesAsArray.js","webpack://@fof/linguist/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/linguist/./src/admin/utils/highlightMithril.js","webpack://@fof/linguist/./src/admin/components/StringLocale.js","webpack://@fof/linguist/./src/admin/components/StringKey.js","webpack://@fof/linguist/./src/admin/utils/namespaceLabel.js","webpack://@fof/linguist/./src/admin/utils/frontendLabel.js","webpack://@fof/linguist/./src/admin/utils/booleanCheck.js","webpack://@fof/linguist/./src/admin/pages/StringsPage.js","webpack://@fof/linguist/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/linguist/./src/admin/pages/CoveragePage.js","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/linguist/./src/admin/pages/ExportPage.js","webpack://@fof/linguist/./src/admin/pages/ImportPage.js","webpack://@fof/linguist/./src/admin/pages/LinguistPage.js","webpack://@fof/linguist/./src/admin/components/index.js","webpack://@fof/linguist/./src/admin/models/index.js","webpack://@fof/linguist/./src/admin/pages/index.js","webpack://@fof/linguist/./src/admin/utils/index.js","webpack://@fof/linguist/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","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/Model'];","import Model from 'flarum/common/Model';\n\nexport default class StringKey extends Model {\n key = Model.attribute('key');\n locales = Model.attribute('locales');\n}\n","import Model from 'flarum/common/Model';\n\nexport default class TextString extends Model {\n key = Model.attribute('key');\n locale = Model.attribute('locale');\n value = Model.attribute('value');\n\n apiEndpoint() {\n return '/fof/linguist/strings' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/LoadingModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/admin/app';\n\nexport default function () {\n let locales = [];\n\n let englishFound = false;\n\n for (let key in app.data.locales) {\n if (!app.data.locales.hasOwnProperty(key)) {\n continue;\n }\n\n if (key === 'en') {\n englishFound = true;\n }\n\n locales.push({\n key,\n name: app.data.locales[key],\n });\n }\n\n // Always show English for the following reasons:\n // It's the fallback locale, so the translations are always active\n // It's the bundled locale for most extensions, so it makes sense to have access to it as reference\n if (!englishFound) {\n locales.unshift({\n key: 'en',\n // Hard-coded to the same value as in flarum/lang-english composer.json\n // Since other locale names won't be translated to the current language either it doesn't make sense to use a translation\n name: 'English',\n });\n }\n\n return locales;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","/* global m */\n\nconst HIGHLIGHT_DELIMITER = '';\n\n// Takes a string and highlight a keyword with a span with mithril template\n// The output will be an array if a keyword is given\nexport default function (string, highlight) {\n if (!highlight) {\n return string;\n }\n\n const lowercaseHighliht = highlight.toLowerCase();\n\n // Regex to match the highlighted work in a case-insensitive manner\n const regex = new RegExp(lowercaseHighliht.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'i');\n\n return string\n .replace(regex, HIGHLIGHT_DELIMITER + '$&' + HIGHLIGHT_DELIMITER)\n .split(HIGHLIGHT_DELIMITER)\n .map(text => {\n if (text.toLowerCase() === lowercaseHighliht) {\n return m('span.FoF-Linguist-Highlight', text);\n }\n\n return text;\n });\n}\n","import app from 'flarum/admin/app';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Button from 'flarum/common/components/Button';\nimport highlightMithril from '../utils/highlightMithril';\n\n/* global m */\n\nexport default class StringLocale {\n oninit(vnode) {\n this.stringKey = vnode.attrs.stringKey;\n this.locale = vnode.attrs.locale;\n this.localeKey = this.locale ? this.locale.key : null;\n this.originalString = this.localeKey && this.stringKey.locales().hasOwnProperty(this.localeKey) ? this.stringKey.locales()[this.localeKey] : null;\n\n this.string = app.store.all('fof-linguist-string').find(\n string => string.key() === this.stringKey.key() && string.locale() === this.localeKey\n );\n\n this.value = this.string ? this.string.value() : '';\n this.dirty = false;\n this.processing = false;\n\n // We check whether any original translation in any language has a newline\n // By not hard-coding to English, this should work pretty well even if the fallback locale is modified,\n // or if a text happens to not be available in the fallback language\n const originalHasNewLine = Object.keys(this.stringKey.locales()).some(key => this.stringKey.locales()[key].indexOf('\\n') !== -1);\n\n this.inputType = 'input';\n\n // We will enable multi-line editing if the original has a newline, or if the current custom value already has one\n if (originalHasNewLine || this.value.indexOf('\\n') !== -1) {\n this.inputType = 'textarea';\n }\n }\n\n view(vnode) {\n const placeholderText = this.originalString ? this.originalString : '(' + app.translator.trans('fof-linguist.admin.placeholder.' + (this.localeKey ? 'not-translated' : 'all-locales')) + ')';\n\n return m('.FoF-Linguist-Locale', [\n m('label.FoF-Linguist-Label', this.localeName()),\n m('.FoF-Linguist-Field', {\n className: (this.value ? 'FoF-Linguist-Field--with-value' : '') + (this.originalString ? ' FoF-Linguist-Field--with-original-string' : ''),\n title: placeholderText,\n }, [\n m('.FoF-Linguist-Field-Wrap', [\n m(this.inputType, {\n className: 'FormControl FoF-Linguist-Input',\n value: this.value,\n oninput: event => {\n this.value = event.target.value;\n this.dirty = true;\n\n // Remove dirty state if the user erased his text without saving\n if (!this.value && !this.string) {\n this.dirty = false;\n }\n },\n disabled: this.processing,\n }),\n m('.FoF-Linguist-Placeholder', [\n m('span.FoF-Linguist-Placeholder-Hint', app.translator.trans('fof-linguist.admin.placeholder.hint')),\n ' ',\n m('span', this.originalString ? highlightMithril(placeholderText, vnode.attrs.highlight) : placeholderText),\n ]),\n ]),\n ]),\n m('.FoF-Linguist-Controls', this.actions(vnode.attrs.onchange).toArray()),\n ]);\n }\n\n localeName() {\n if (this.locale) {\n return [this.locale.name + ' (', m('code', this.locale.key), ')'];\n } else {\n return app.translator.trans('fof-linguist.admin.locales.all');\n }\n }\n\n actions(onchange) {\n const items = new ItemList();\n\n items.add('apply', Button.component({\n type: 'button',\n className: 'Button Button--primary',\n loading: this.processing,\n disabled: !this.dirty,\n onclick: () => {\n this.saveString(onchange);\n },\n }, app.translator.trans('fof-linguist.admin.buttons.apply')));\n\n items.add('reset', Button.component({\n type: 'button',\n className: 'Button',\n loading: this.processing,\n disabled: !this.dirty && !this.string,\n onclick: () => {\n this.deleteString(onchange);\n },\n }, app.translator.trans('fof-linguist.admin.buttons.reset')));\n\n if (this.originalString) {\n items.add('copy-original', Button.component({\n type: 'button',\n className: 'Button',\n loading: this.processing,\n onclick: () => {\n this.value = this.originalString;\n this.dirty = true;\n },\n }, app.translator.trans('fof-linguist.admin.buttons.copy-original')));\n }\n\n return items;\n }\n\n saveString(onchange) {\n if (!this.value) {\n this.deleteString(onchange);\n\n return;\n }\n\n if (!this.string) {\n this.string = app.store.createRecord('fof-linguist-string', {\n attributes: {\n key: this.stringKey.key(),\n locale: this.localeKey,\n value: '',\n },\n });\n }\n\n this.string.data.attributes.value = this.value;\n\n if (!this.string.locale()) delete this.string.data.attributes.locale;\n\n this.processing = true;\n\n this.string.save(this.string.data.attributes).then(() => {\n this.processing = false;\n this.dirty = false;\n\n onchange();\n\n m.redraw();\n }).catch(err => {\n this.processing = false;\n\n throw err;\n });\n }\n\n deleteString(onchange) {\n if (this.string) {\n this.processing = true;\n\n this.string.delete().then(() => {\n this.processing = false;\n this.dirty = false;\n\n this.string = null;\n this.value = '';\n\n onchange();\n\n m.redraw();\n }).catch(err => {\n this.processing = false;\n\n throw err;\n });\n } else {\n this.value = '';\n this.dirty = false;\n }\n }\n}\n","import StringLocale from '../components/StringLocale';\nimport localesAsArray from '../utils/localesAsArray';\nimport highlightMithril from '../utils/highlightMithril';\n\n/* global m */\n\nexport default class StringKey {\n view(vnode) {\n const {\n stringKey,\n highlight,\n onchange,\n } = vnode.attrs;\n\n return m('.FoF-Linguist-Key', [\n m('.FoF-Linguist-Key-Code', m('code', highlightMithril(stringKey.key(), highlight))),\n m('.FoF-Linguist-Locales', [\n ...localesAsArray().map(locale => m(StringLocale, {\n key: locale.key,\n locale,\n stringKey,\n highlight,\n onchange,\n })),\n m(StringLocale, {\n key: 'all',\n locale: null,\n stringKey,\n highlight,\n onchange,\n }),\n ]),\n ]);\n }\n}\n","import app from 'flarum/admin/app';\n\nexport default function (namespace) {\n const translation = app.translator.translations['fof-linguist.admin.known-namespace.' + namespace];\n\n if (translation) {\n return translation;\n }\n\n return namespace;\n}\n","import app from 'flarum/admin/app';\n\nexport default function (frontend) {\n const translation = app.translator.translations['fof-linguist.admin.known-frontend.' + frontend];\n\n if (translation) {\n return translation;\n }\n\n return frontend;\n}\n","export default function (operation, booleans) {\n return booleans.reduce((a, b) => {\n if (a === 'start') {\n return b;\n }\n\n if (operation === 'or') {\n return a || b;\n }\n\n return a && b;\n }, 'start');\n}\n","import app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Select from 'flarum/common/components/Select';\nimport Alert from 'flarum/common/components/Alert';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport extractText from 'flarum/common/utils/extractText';\nimport localesAsArray from '../utils/localesAsArray';\nimport StringKey from '../components/StringKey';\nimport namespaceLabel from '../utils/namespaceLabel';\nimport frontendLabel from '../utils/frontendLabel';\nimport booleanCheck from '../utils/booleanCheck';\n\n/* global m */\n\nconst RESULTS_PER_PAGE = 20;\n\nexport default class StringsPage {\n oninit(vnode) {\n this.numberOfResultsToShow = RESULTS_PER_PAGE;\n\n this.filters = Object.assign({\n search: '',\n withOwnTranslations: false,\n missingTranslationsNegation: 'without',\n missingTranslationsType: 'any',\n missingTranslationsOperation: 'or',\n missingTranslationsInLocales: [],\n forExtension: null,\n frontend: null,\n }, vnode.attrs.initialBrowseFilters || {});\n\n this.results = [];\n\n this.applyFilters();\n }\n\n view(vnode) {\n const keys = this.results.slice(0, this.numberOfResultsToShow);\n\n return [\n // Additional divs are used to reduce Mithril redraws as much as possible when the conditional components appear\n m('div', this.cacheClearInstructions()),\n m('.FoF-Linguist-Filters', [\n m('input.FormControl', {\n value: this.filters.search,\n oninput: event => {\n this.filters.search = event.target.value;\n this.applyFilters();\n },\n placeholder: app.translator.trans('fof-linguist.admin.filters.search'),\n }),\n Button.component({\n className: 'Button' + (this.filters.withOwnTranslations ? ' FoF-Linguist-Filter--Selected' : ''),\n icon: `far fa-${this.filters.withOwnTranslations ? 'check-square' : 'square'}`,\n onclick: () => {\n this.filters.withOwnTranslations = !this.filters.withOwnTranslations;\n this.applyFilters();\n },\n }, app.translator.trans('fof-linguist.admin.filters.with-own-translations')),\n Dropdown.component({\n buttonClassName: 'Button' + (this.filters.forExtension ? ' FoF-Linguist-Filter--Selected' : ''),\n label: app.translator.trans('fof-linguist.admin.filters.for-extension'),\n }, vnode.attrs.namespaces.map(\n namespace => Button.component({\n className: 'Button',\n icon: `far fa-${this.filters.forExtension === namespace.namespace ? 'dot-circle' : 'circle'}`,\n onclick: () => {\n if (this.filters.forExtension === namespace.namespace) {\n this.filters.forExtension = null;\n } else {\n this.filters.forExtension = namespace.namespace;\n }\n\n this.applyFilters();\n },\n }, namespace.extension ? namespace.extension.extra['flarum-extension'].title : namespaceLabel(namespace.namespace))\n )),\n Dropdown.component({\n buttonClassName: 'Button' + (this.filters.frontend ? ' FoF-Linguist-Filter--Selected' : ''),\n label: app.translator.trans('fof-linguist.admin.filters.frontend'),\n }, [\n '_all_except_admin',\n ...vnode.attrs.frontends,\n ].map(\n frontend => Button.component({\n className: 'Button',\n icon: `far fa-${this.filters.frontend === frontend ? 'dot-circle' : 'circle'}`,\n onclick: () => {\n if (this.filters.frontend === frontend) {\n this.filters.frontend = null;\n } else {\n this.filters.frontend = frontend;\n }\n\n this.applyFilters();\n },\n }, frontend === '_all_except_admin' ? app.translator.trans('fof-linguist.admin.filters.frontend-all-except-admin') : frontendLabel(frontend))\n )),\n Dropdown.component({\n buttonClassName: 'Button' + (this.filters.missingTranslationsInLocales.length ? ' FoF-Linguist-Filter--Selected' : ''),\n label: app.translator.trans('fof-linguist.admin.filters.missing'),\n }, [\n m('.FoF-Linguist-Missing-Filter', {\n onclick(event) {\n // Prevent closing the dropdown\n event.stopPropagation();\n },\n }, [\n Select.component({\n value: this.filters.missingTranslationsNegation,\n onchange: value => {\n this.filters.missingTranslationsNegation = value;\n\n if (this.filters.missingTranslationsInLocales.length) {\n this.applyFilters();\n }\n },\n options: {\n without: app.translator.trans('fof-linguist.admin.filters.negation-options.without'),\n with: app.translator.trans('fof-linguist.admin.filters.negation-options.with'),\n },\n }),\n Select.component({\n value: this.filters.missingTranslationsType,\n onchange: value => {\n this.filters.missingTranslationsType = value;\n\n if (this.filters.missingTranslationsInLocales.length) {\n this.applyFilters();\n }\n },\n options: {\n any: app.translator.trans('fof-linguist.admin.filters.type-options.any'),\n original: app.translator.trans('fof-linguist.admin.filters.type-options.original'),\n own: app.translator.trans('fof-linguist.admin.filters.type-options.own'),\n },\n }),\n m('p', app.translator.trans('fof-linguist.admin.filters.missing-middle-label')),\n Select.component({\n value: this.filters.missingTranslationsOperation,\n onchange: value => {\n this.filters.missingTranslationsOperation = value;\n\n if (this.filters.missingTranslationsInLocales.length) {\n this.applyFilters();\n }\n },\n options: {\n or: app.translator.trans('fof-linguist.admin.filters.operation-options.or'),\n and: app.translator.trans('fof-linguist.admin.filters.operation-options.and'),\n },\n }),\n ]),\n ...localesAsArray().map(\n locale => Button.component({\n className: 'Button',\n icon: `far fa-${this.filters.missingTranslationsInLocales.indexOf(locale.key) !== -1 ? 'check-square' : 'square'}`,\n onclick: () => {\n if (this.filters.missingTranslationsInLocales.indexOf(locale.key) !== -1) {\n this.filters.missingTranslationsInLocales = this.filters.missingTranslationsInLocales.filter(key => key !== locale.key);\n } else {\n this.filters.missingTranslationsInLocales.push(locale.key);\n }\n\n this.applyFilters();\n },\n }, locale.name + ' (' + locale.key + ')')\n ),\n ]),\n Dropdown.component({\n buttonClassName: 'Button',\n label: app.translator.trans('fof-linguist.admin.filters.mass-edit'),\n }, [\n Button.component({\n icon: 'far fa-clone',\n className: 'Button',\n onclick: () => {\n const strings = app.store.all('fof-linguist-string').filter(string => {\n const key = app.store.getById('fof-linguist-string-key', string.key());\n\n return key && key.locales()[string.locale()] === string.value();\n });\n\n if (confirm(extractText(app.translator.trans('fof-linguist.admin.buttons.delete-redundant-confirm', {\n count: strings.length + '',\n })))) {\n if (strings.length === 0) {\n return;\n }\n\n app.modal.show(LoadingModal);\n\n Promise.all(strings.map(string => string.delete())).then(() => {\n window.location.reload();\n });\n }\n },\n }, app.translator.trans('fof-linguist.admin.buttons.delete-redundant')),\n Button.component({\n icon: 'fas fa-trash',\n className: 'Button',\n onclick: () => {\n const strings = app.store.all('fof-linguist-string');\n\n if (confirm(extractText(app.translator.trans('fof-linguist.admin.buttons.delete-all-confirm', {\n count: strings.length + '',\n })))) {\n if (strings.length === 0) {\n return;\n }\n\n app.modal.show(LoadingModal);\n\n Promise.all(strings.map(string => string.delete())).then(() => {\n window.location.reload();\n });\n }\n },\n }, app.translator.trans('fof-linguist.admin.buttons.delete-all')),\n ]),\n ]),\n m('div', keys.map(stringKey => m(StringKey, {\n key: stringKey.id(),\n stringKey,\n highlight: this.filters.search,\n onchange: () => {\n // We use the setting and not a local variable because we need to preserve state\n // if we navigate away and back to the Linguist page without refreshing the admin panel\n app.data.settings['fof.linguist.should-clear-cache'] = '1';\n },\n }))),\n m('.FoF-Linguist-Results', [\n app.translator.trans('fof-linguist.admin.filters.results', {\n shown: keys.length + '', // cast to string otherwise number isn't displayed\n total: this.results.length + '',\n }),\n ' ',\n (this.results.length > keys.length ? Button.component({\n className: 'Button',\n onclick: () => {\n this.numberOfResultsToShow += RESULTS_PER_PAGE;\n },\n }, app.translator.trans('fof-linguist.admin.buttons.load-more')) : null),\n ]),\n ];\n }\n\n applyFilters() {\n this.numberOfResultsToShow = RESULTS_PER_PAGE;\n\n const keysWithCustomTranslations = app.store.all('fof-linguist-string').map(string => string.key());\n\n const keysWithCustomTranslationsIn = {};\n localesAsArray().forEach(locale => {\n keysWithCustomTranslationsIn[locale.key] = app.store.all('fof-linguist-string')\n .filter(string => string.locale() === locale.key)\n .map(string => string.key());\n });\n\n let lowercaseSearch = '';\n\n if (this.filters.search) {\n lowercaseSearch = this.filters.search.toLowerCase();\n }\n\n this.results = app.store.all('fof-linguist-string-key').filter(key => {\n if (this.filters.withOwnTranslations && keysWithCustomTranslations.indexOf(key.key()) === -1) {\n return false;\n }\n\n if (this.filters.missingTranslationsInLocales.length) {\n let operation = this.filters.missingTranslationsOperation;\n\n // Because the whole operation is reversed at the end based on with or without,\n // we actually need to make the opposite boolean computation on the \"has\" variables\n if (this.filters.missingTranslationsNegation === 'without') {\n operation = operation === 'or' ? 'and' : 'or';\n }\n\n const hasOriginalTranslation = booleanCheck(operation, this.filters.missingTranslationsInLocales.map(locale => {\n return key.locales().hasOwnProperty(locale);\n }));\n const hasOwnTranslation = booleanCheck(operation, this.filters.missingTranslationsInLocales.map(locale => {\n return keysWithCustomTranslationsIn[locale].indexOf(key.key()) !== -1;\n }));\n\n let matchesType = false;\n\n switch (this.filters.missingTranslationsType) {\n case 'any':\n matchesType = hasOriginalTranslation || hasOwnTranslation;\n break;\n case 'original':\n matchesType = hasOriginalTranslation;\n break;\n case 'own':\n matchesType = hasOwnTranslation;\n break;\n }\n\n if (this.filters.missingTranslationsNegation === 'without') {\n matchesType = !matchesType;\n }\n\n if (!matchesType) {\n return false;\n }\n }\n\n if (this.filters.forExtension) {\n if (key.key().indexOf(this.filters.forExtension + '.') !== 0) {\n return false;\n }\n }\n\n if (this.filters.frontend) {\n const parts = key.key().split('.');\n\n if (this.filters.frontend === '_all_except_admin') {\n // We will keep everything that isn't admin, including if it's a single level deep\n if (parts.length >= 2 && parts[1] === 'admin') {\n return false;\n }\n } else {\n // Keep only parts with 2 levels or more where second level matches frontend\n if (parts.length < 2 || parts[1] !== this.filters.frontend) {\n return false;\n }\n }\n }\n\n if (lowercaseSearch) {\n if (key.key().toLowerCase().indexOf(lowercaseSearch) !== -1) {\n return true;\n }\n\n const locales = key.locales();\n\n for (let locale in locales) {\n if (locales.hasOwnProperty(locale) && locales[locale].toLowerCase().indexOf(lowercaseSearch) !== -1) {\n return true;\n }\n }\n\n return false;\n }\n\n return true;\n });\n\n m.redraw();\n }\n\n cacheClearInstructions() {\n // If debug is enabled, we hide the message here because even if we stop setting the flag,\n // an older flag might still be present from before debug mode was enabled\n if (app.data.debugEnabled) {\n return null;\n }\n\n // Check for flag that says cache should be cleared\n // This value is set both server-side and client-side in the onchange code above for immediate effect\n if (app.data.settings['fof.linguist.should-clear-cache'] !== '1') {\n return null;\n }\n\n return Alert.component({\n dismissible: false,\n controls: [Button.component({\n className: 'Button Button--link',\n onclick() {\n // Same logic as in core StatusWidget\n app.modal.show(LoadingModal);\n\n app.request({\n method: 'DELETE',\n url: app.forum.attribute('apiUrl') + '/cache',\n }).then(() => window.location.reload());\n },\n }, app.translator.trans('fof-linguist.admin.clear-cache.button'))],\n }, app.translator.trans('fof-linguist.admin.clear-cache.text'));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport icon from 'flarum/common/helpers/icon';\nimport localesAsArray from '../utils/localesAsArray';\nimport namespaceLabel from '../utils/namespaceLabel';\nimport frontendLabel from '../utils/frontendLabel';\n\n/* global m */\n\nexport default class CoveragePage {\n oninit() {\n this.columns = 'locale';\n this.showAllFrontends = false;\n this.totalPercent = true;\n this.locale = [];\n\n const firstNonEnglishLocale = localesAsArray().find(locale => locale.key !== 'en');\n\n if (firstNonEnglishLocale) {\n this.locale = firstNonEnglishLocale.key;\n }\n }\n\n view(vnode) {\n let visibleFrontends = vnode.attrs.frontends.slice(0, 2);\n\n if (this.showAllFrontends) {\n visibleFrontends = vnode.attrs.frontends;\n }\n\n const {browseWithFilters} = vnode.attrs;\n\n return [\n m('.FoF-Linguist-Filters', [\n m('.ButtonGroup', [\n Button.component({\n className: 'Button' + (this.totalPercent ? ' active' : ''),\n onclick: () => {\n this.totalPercent = true;\n },\n }, app.translator.trans('fof-linguist.admin.coverage.total-options.percent')),\n Button.component({\n className: 'Button' + (this.totalPercent ? ' ' : ' active'),\n onclick: () => {\n this.totalPercent = false;\n },\n }, app.translator.trans('fof-linguist.admin.coverage.total-options.count')),\n ]),\n m('.ButtonGroup', [\n Button.component({\n className: 'Button' + (this.columns === 'locale' ? ' active' : ''),\n onclick: () => {\n this.columns = 'locale';\n },\n }, app.translator.trans('fof-linguist.admin.coverage.column-options.locale')),\n Button.component({\n className: 'Button' + (this.columns === 'namespace' ? ' active' : ''),\n onclick: () => {\n this.columns = 'namespace';\n this.showAllFrontends = false;\n },\n }, app.translator.trans('fof-linguist.admin.coverage.column-options.namespace')),\n ]),\n this.columns === 'namespace' ? m('.ButtonGroup', localesAsArray().map(\n locale => Button.component({\n className: 'Button' + (this.locale === locale.key ? ' active' : ''),\n onclick: () => {\n if (this.locale !== locale.key) {\n this.locale = locale.key;\n }\n },\n }, locale.name + ' (' + locale.key + ')')\n )) : null,\n ]),\n m('table.FoF-Linguist-Coverage', [\n m('thead', m('tr', [\n m('th', app.translator.trans('fof-linguist.admin.coverage.columns.namespace')),\n this.columns === 'locale' ? localesAsArray().map(locale => m('th', locale.name + ' (' + locale.key + ')')) : [\n this.showAllFrontends ? visibleFrontends.map(frontend => m('th', frontendLabel(frontend))) : [\n m('th', app.translator.trans('fof-linguist.admin.coverage.columns.all-except-admin')),\n m('th', frontendLabel('admin')),\n m('th', Button.component({\n className: 'Button',\n onclick: () => {\n this.showAllFrontends = true;\n },\n }, app.translator.trans('fof-linguist.admin.coverage.columns.all-frontends'))),\n ],\n ],\n ])),\n m('tbody', [\n this.columns === 'locale' ? m('tr', [\n m('td', [\n m('span.FoF-Linguist-Coverage-Extension-Icon.FoF-Linguist-Coverage-Namespace-Icon'),\n m('span.FoF-Linguist-Coverage-Extension-Title', app.translator.trans('fof-linguist.admin.coverage.all-namespaces')),\n ]),\n localesAsArray().map(locale => m('td', this.localeCoverage(browseWithFilters, locale.key))),\n ]) : null,\n vnode.attrs.namespaces.map(namespace => {\n return m('tr', [\n m('td', namespace.extension ? [\n m('span.FoF-Linguist-Coverage-Extension-Icon', {\n style: namespace.extension.icon,\n }, namespace.extension.icon ? icon(namespace.extension.icon.name) : ''),\n m('span.FoF-Linguist-Coverage-Extension-Title', namespace.extension.extra['flarum-extension'].title),\n ] : [\n m('span.FoF-Linguist-Coverage-Extension-Icon.FoF-Linguist-Coverage-Namespace-Icon'),\n m('span.FoF-Linguist-Coverage-Extension-Title', namespaceLabel(namespace.namespace)),\n ]),\n this.columns === 'locale' ? localesAsArray().map(locale => m('td', this.localeCoverage(browseWithFilters, locale.key, namespace.namespace))) : [\n this.showAllFrontends ?\n visibleFrontends.map(frontend => m('td', this.prefixCoverage(browseWithFilters, namespace.namespace, frontend))) : [\n m('td', this.prefixCoverage(browseWithFilters, namespace.namespace, '_all_except_admin')),\n m('td', this.prefixCoverage(browseWithFilters, namespace.namespace, 'admin')),\n ],\n ],\n ]);\n }),\n ]),\n ]),\n ];\n }\n\n prefixCoverage(browseWithFilters, namespace, frontend) {\n if (!this.locale) {\n return null;\n }\n\n return this.localeCoverage(browseWithFilters, this.locale, namespace, frontend);\n }\n\n localeCoverage(browseWithFilters, locale, namespace, frontend) {\n const stringKeys = app.store.all('fof-linguist-string-key').filter(key => {\n if (!namespace) {\n return true;\n }\n\n const parts = key.key().split('.');\n\n if (parts[0] !== namespace) {\n return false;\n }\n\n if (frontend === '_all_except_admin') {\n if (parts.length >= 2 && parts[1] === 'admin') {\n return false;\n }\n } else if (frontend && (parts.length < 2 || parts[1] !== frontend)) {\n return false;\n }\n\n return true;\n });\n\n if (stringKeys.length === 0) {\n return '-';\n }\n\n let customCount = 0;\n let originalCount = 0;\n\n stringKeys.forEach(stringKey => {\n const customString = app.store.all('fof-linguist-string').find(\n string => string.key() === stringKey.key() && string.locale() === locale\n );\n\n if (customString) {\n customCount++;\n } else if (stringKey.locales().hasOwnProperty(locale)) {\n originalCount++;\n }\n });\n\n const percent = Math.round(((customCount + originalCount) / stringKeys.length) * 100);\n\n let specialStyle;\n\n if (percent === 100) {\n specialStyle = 'full';\n } else if (percent < 5) {\n specialStyle = 'low';\n }\n\n let label;\n\n if (this.totalPercent) {\n label = app.translator.trans('fof-linguist.admin.coverage.count.percent', {\n percent: percent + '', // Keeps zero as string\n });\n } else {\n label = app.translator.trans('fof-linguist.admin.coverage.count.total', {\n translated: (customCount + originalCount) + '', // Keeps zero as string\n total: stringKeys.length,\n });\n }\n\n return m('.FoF-Linguist-Coverage-Progress-Wrap', [\n m('.FoF-Linguist-Progress', {\n className: specialStyle ? 'FoF-Linguist-Progress--' + specialStyle : '',\n }, [\n m('.FoF-Linguist-Progress-Bar', {\n style: {\n width: Math.max(percent, 5) + '%', // Always show the progress bar even if very close to 0\n },\n }),\n m('.FoF-Linguist-Progress-Label', label),\n m('.FoF-Linguist-Progress-More', app.translator.trans('fof-linguist.admin.coverage.count.details', {\n total: stringKeys.length,\n original: originalCount + '', // Cast to string to preserve zero\n custom: customCount + '',\n })),\n ]),\n Button.component({\n icon: 'fas fa-filter',\n className: 'Button Button--icon',\n onclick: () => {\n const options = {\n missingTranslationsInLocales: [locale],\n };\n\n if (namespace) {\n options.forExtension = namespace;\n }\n\n if (frontend) {\n options.frontend = frontend;\n }\n\n browseWithFilters(options);\n },\n title: app.translator.trans('fof-linguist.admin.coverage.apply-missing-filter'),\n }),\n ]);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","import app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Switch from 'flarum/common/components/Switch';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport localesAsArray from '../utils/localesAsArray';\nimport namespaceLabel from '../utils/namespaceLabel';\n\n/* global m */\n\nexport default class ExportPage {\n oninit() {\n this.locale = 'en';\n this.namespace = null;\n this.includeOriginals = false;\n this.includeAll = false;\n this.loading = false;\n this.output = '';\n\n this.fetchOutput();\n }\n\n view(vnode) {\n const localeOptions = {};\n\n localesAsArray().forEach(locale => {\n localeOptions[locale.key] = locale.name + ' (' + locale.key + ')';\n });\n\n localeOptions.all = app.translator.trans('fof-linguist.admin.export.locale-all')\n\n const namespaceOptions = {\n _all: app.translator.trans('fof-linguist.admin.export.namespace-all'),\n };\n\n vnode.attrs.namespaces.forEach(namespace => {\n if (namespace.extension) {\n namespaceOptions[namespace.namespace] = namespace.extension.extra['flarum-extension'].title;\n } else {\n namespaceOptions[namespace.namespace] = namespaceLabel(namespace.namespace);\n\n }\n });\n\n return [\n m('h2', app.translator.trans('fof-linguist.admin.export.title')),\n m('.Form-group', m('.Alert', app.translator.trans('fof-linguist.admin.export.warning'))),\n m('.Form-group', [\n m('label', app.translator.trans('fof-linguist.admin.export.locale')),\n Select.component({\n options: localeOptions,\n value: this.locale,\n onchange: value => {\n this.locale = value;\n\n this.fetchOutput();\n },\n }),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-linguist.admin.export.namespace')),\n Select.component({\n options: namespaceOptions,\n value: this.namespace === null ? '_all' : this.namespace,\n onchange: value => {\n this.namespace = value === '_all' ? null : value;\n\n this.fetchOutput();\n },\n }),\n ]),\n m('.Form-group', [\n Switch.component({\n state: this.includeOriginals,\n onchange: value => {\n this.includeOriginals = value;\n\n this.fetchOutput();\n }\n }, app.translator.trans('fof-linguist.admin.export.include-originals')),\n ]),\n m('.Form-group', [\n Switch.component({\n state: this.includeAll,\n onchange: value => {\n this.includeAll = value;\n\n this.fetchOutput();\n }\n }, app.translator.trans('fof-linguist.admin.export.include-all')),\n ]),\n m('.Form-group', [\n m('label', [\n app.translator.trans('fof-linguist.admin.export.output'),\n ' ',\n LinkButton.component({\n className: 'Button Button--primary',\n href: this.exportUrl(),\n external: true,\n // If a namespace is selected, we use it as filename (language pack convention)\n // otherwise we use the locale as filename (extension convention)\n download: (this.namespace || this.locale) + '.yml',\n }, app.translator.trans('fof-linguist.admin.export.download')),\n ]),\n m('textarea.FormControl.FoF-Export-Textarea', {\n readonly: true,\n value: this.output,\n rows: 10,\n placeholder: this.loading ? app.translator.trans('fof-linguist.admin.export.output-loading') : app.translator.trans('fof-linguist.admin.export.output-empty'),\n }),\n ]),\n ];\n }\n\n exportUrl() {\n return app.forum.attribute('apiUrl') + '/fof/linguist/export?' + m.buildQueryString({\n locale: this.locale,\n namespace: this.namespace,\n includeOriginals: this.includeOriginals ? '1' : '0',\n includeAll: this.includeAll ? '1' : '0',\n });\n }\n\n fetchOutput() {\n this.loading = true;\n this.output = '';\n\n app.request({\n method: 'GET',\n url: this.exportUrl(),\n // Flarum doesn't support a raw to have the raw text response\n // So we'll encode the response with JSON so Flarum can parse if afterwards\n extract: raw => JSON.stringify(raw),\n }).then(output => {\n this.loading = false;\n this.output = output;\n m.redraw();\n }).catch(error => {\n this.loading = false;\n m.redraw();\n throw error;\n });\n }\n}\n","import app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport Select from 'flarum/common/components/Select';\nimport Switch from 'flarum/common/components/Switch';\nimport extractText from 'flarum/common/utils/extractText';\nimport localesAsArray from '../utils/localesAsArray';\n\n/* global m */\n\nexport default class ImportPage {\n oninit() {\n this.locale = 'en';\n this.overrideExisting = true;\n this.input = '';\n this.loading = false;\n }\n\n view() {\n const localeOptions = {};\n\n localesAsArray().forEach(locale => {\n localeOptions[locale.key] = locale.name + ' (' + locale.key + ')';\n });\n\n localeOptions.all = app.translator.trans('fof-linguist.admin.import.locale-all')\n\n return [\n m('h2', app.translator.trans('fof-linguist.admin.import.title')),\n m('.Form-group', [\n m('label', app.translator.trans('fof-linguist.admin.import.input')),\n m('textarea.FormControl', {\n value: this.input,\n oninput: event => {\n this.input = event.target.value;\n },\n rows: 10,\n placeholder: app.translator.trans('fof-linguist.admin.import.input-placeholder'),\n }),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-linguist.admin.import.locale')),\n Select.component({\n options: localeOptions,\n value: this.locale,\n onchange: value => {\n this.locale = value;\n\n this.fetchOutput();\n },\n }),\n ]),\n m('.Form-group', [\n Switch.component({\n state: this.overrideExisting,\n onchange: value => {\n this.overrideExisting = value;\n }\n }, app.translator.trans('fof-linguist.admin.import.override-existing')),\n ]),\n m('.Form-group', Button.component({\n className: 'Button Button--primary',\n onclick: () => {\n this.loading = true;\n\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/linguist/import',\n body: {\n input: this.input,\n locale: this.locale,\n ignoreExisting: !this.overrideExisting,\n },\n }).then(data => {\n this.loading = false;\n m.redraw();\n\n if (confirm(extractText(app.translator.trans(this.overrideExisting ? 'fof-linguist.admin.import.results' : 'fof-linguist.admin.import.results-with-ignore', {\n imported: data.imported + '', // Cast to string to preserve zeros\n ignored: data.ignored + '',\n identical: data.identical + '',\n })))) {\n window.location.reload();\n }\n }).catch(error => {\n this.loading = false;\n m.redraw();\n throw error;\n });\n },\n disabled: this.loading || !this.input,\n loading: this.loading,\n }, app.translator.trans('fof-linguist.admin.import.submit'))),\n ];\n }\n}\n","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport StringsPage from './StringsPage';\nimport CoveragePage from './CoveragePage';\nimport ExportPage from './ExportPage';\nimport ImportPage from './ImportPage';\n\n/* global m */\n\nexport default class LinguistPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tab = 'strings';\n this.ready = false;\n this.namespaces = []; // First level of translation keys. Usually an extension ID, but also core and validation\n this.frontends = [\n 'forum',\n 'admin',\n 'lib',\n 'ref',\n 'api',\n ]; // Second level of translation keys: forum, admin, ...\n this.initialBrowseFilters = {};\n\n Promise.all([\n app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/fof/linguist/strings',\n }).then(result => {\n app.store.pushPayload(result);\n }),\n app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/fof/linguist/string-keys',\n }).then(result => {\n const keys = app.store.pushPayload(result);\n\n const namespaces = [];\n\n keys.forEach(key => {\n const parts = key.key().split('.');\n\n const namespace = parts[0];\n\n if (['core', 'validation'].indexOf(namespace) === -1 && namespaces.indexOf(namespace) === -1) {\n namespaces.push(namespace);\n }\n\n if (parts.length > 1 && namespace !== 'validation') {\n const frontend = parts[1];\n\n if (this.frontends.indexOf(frontend) === -1) {\n this.frontends.push(frontend);\n }\n }\n });\n\n namespaces.sort();\n\n this.namespaces = [\n {\n namespace: 'core',\n },\n {\n namespace: 'validation',\n },\n ...namespaces.map(namespace => {\n // First we look if the namespace matches an extension ID, that's the most common naming\n let extension = app.data.extensions[namespace];\n\n // If that's unsuccessful, we'll look if the full package name was used as namespace\n if (!extension) {\n extension = Object.values(app.data.extensions).find(extension => {\n const packageNameWithDash = extension.name.replace('/', '-');\n\n return namespace === packageNameWithDash;\n });\n }\n\n return {\n namespace,\n extension,\n };\n }),\n ];\n }),\n ]).then(() => {\n this.ready = true;\n m.redraw();\n });\n }\n\n content() {\n return m('.ExtensionPage-settings', m('.container', [\n this.contentTab(),\n ]));\n }\n\n infoItems() {\n const items = super.infoItems();\n\n items.add('linguist-tabs', m('ul.FoF-Linguist-Tabs', [\n m('li', m('a', {\n className: this.tab === 'strings' ? 'active' : '',\n onclick: () => {\n this.tab = 'strings';\n },\n }, app.translator.trans('fof-linguist.admin.tabs.strings'))),\n m('li', m('a', {\n className: this.tab === 'coverage' ? 'active' : '',\n onclick: () => {\n this.tab = 'coverage';\n },\n }, app.translator.trans('fof-linguist.admin.tabs.coverage'))),\n m('li', m('a', {\n className: this.tab === 'export' ? 'active' : '',\n onclick: () => {\n this.tab = 'export';\n },\n }, app.translator.trans('fof-linguist.admin.tabs.export'))),\n m('li', m('a', {\n className: this.tab === 'import' ? 'active' : '',\n onclick: () => {\n this.tab = 'import';\n },\n }, app.translator.trans('fof-linguist.admin.tabs.import'))),\n ]), 100);\n\n return items;\n }\n\n contentTab() {\n if (!this.ready) {\n return LoadingIndicator.component();\n }\n\n switch (this.tab) {\n case 'strings':\n return m(StringsPage, {\n namespaces: this.namespaces,\n frontends: this.frontends,\n initialBrowseFilters: this.initialBrowseFilters,\n });\n case 'coverage':\n return m(CoveragePage, {\n namespaces: this.namespaces,\n frontends: this.frontends,\n browseWithFilters: filters => {\n this.initialBrowseFilters = filters;\n this.tab = 'strings';\n },\n });\n case 'export':\n return m(ExportPage, {\n namespaces: this.namespaces,\n });\n case 'import':\n return m(ImportPage);\n }\n\n return null;\n }\n}\n","import StringKey from './StringKey';\nimport StringLocale from './StringLocale';\n\nexport const components = {\n StringKey,\n StringLocale,\n};\n","import StringKey from './StringKey';\nimport TextString from './TextString';\n\nexport const models = {\n StringKey,\n TextString,\n};\n","import CoveragePage from './CoveragePage';\nimport ExportPage from './ExportPage';\nimport ImportPage from './ImportPage';\nimport LinguistPage from './LinguistPage';\nimport StringsPage from './StringsPage';\n\nexport const pages = {\n CoveragePage,\n ExportPage,\n ImportPage,\n LinguistPage,\n StringsPage,\n};\n","import booleanCheck from './booleanCheck';\nimport frontendLabel from './frontendLabel';\nimport highlightMithril from './highlightMithril';\nimport localesAsArray from './localesAsArray';\nimport namespaceLabel from './namespaceLabel';\n\nexport const utils = {\n booleanCheck,\n frontendLabel,\n highlightMithril,\n localesAsArray,\n namespaceLabel,\n};\n","import app from 'flarum/admin/app';\nimport StringKey from './models/StringKey';\nimport TextString from './models/TextString';\nimport LinguistPage from './pages/LinguistPage';\n\nexport * from './components';\nexport * from './models';\nexport * from './pages';\nexport * from './utils';\n\napp.initializers.add('fof-linguist', app => {\n app.store.models['fof-linguist-string-key'] = StringKey;\n app.store.models['fof-linguist-string'] = TextString;\n\n app.extensionData\n .for('fof-linguist')\n .registerPage(LinguistPage)\n .registerPermission(\n {\n icon: 'fas fa-italic',\n label: app.translator.trans(\n 'fof-linguist.admin.permissions.view_string_keys'\n ),\n permission: 'viewStringKeys',\n allowGuest: true,\n },\n 'view'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","StringKey","Model","locales","TextString","locale","apiEndpoint","this","exists","data","id","englishFound","app","push","name","unshift","HIGHLIGHT_DELIMITER","string","highlight","lowercaseHighliht","toLowerCase","regex","RegExp","replace","split","map","text","m","StringLocale","oninit","vnode","stringKey","attrs","localeKey","originalString","find","dirty","processing","originalHasNewLine","keys","some","indexOf","inputType","view","placeholderText","localeName","className","title","oninput","event","target","disabled","highlightMithril","actions","onchange","toArray","items","ItemList","add","Button","type","loading","onclick","saveString","deleteString","attributes","save","then","redraw","err","localesAsArray","namespace","frontend","operation","booleans","reduce","b","StringsPage","numberOfResultsToShow","filters","assign","search","withOwnTranslations","missingTranslationsNegation","missingTranslationsType","missingTranslationsOperation","missingTranslationsInLocales","forExtension","initialBrowseFilters","results","applyFilters","slice","cacheClearInstructions","placeholder","icon","Dropdown","buttonClassName","label","namespaces","extension","extra","namespaceLabel","frontends","frontendLabel","length","stopPropagation","Select","options","without","with","any","original","own","or","and","filter","strings","confirm","extractText","count","LoadingModal","Promise","all","window","location","reload","shown","total","keysWithCustomTranslations","keysWithCustomTranslationsIn","forEach","lowercaseSearch","hasOriginalTranslation","booleanCheck","hasOwnTranslation","matchesType","parts","Alert","dismissible","controls","method","url","CoveragePage","columns","showAllFrontends","totalPercent","firstNonEnglishLocale","visibleFrontends","browseWithFilters","localeCoverage","style","prefixCoverage","stringKeys","customCount","originalCount","specialStyle","percent","Math","round","translated","width","max","custom","ExportPage","includeOriginals","includeAll","output","fetchOutput","localeOptions","namespaceOptions","_all","Switch","state","LinkButton","href","exportUrl","external","download","readonly","rows","buildQueryString","extract","raw","JSON","stringify","error","ImportPage","overrideExisting","input","body","ignoreExisting","imported","ignored","identical","LinguistPage","tab","ready","result","sort","values","packageNameWithDash","content","contentTab","infoItems","LoadingIndicator","ExtensionPage","components","models","pages","utils","store","extensionData","registerPage","registerPermission","translator","trans","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,8FCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAzC,SAASC,EAAgBhB,EAAGiB,GAKzC,OAJAD,EAAkBf,OAAOiB,eAAiBjB,OAAOiB,eAAeC,OAAS,SAAyBnB,EAAGiB,GAEnG,OADAjB,EAAEoB,UAAYH,EACPjB,CACT,EACOgB,EAAgBhB,EAAGiB,EAC5B,CCLe,SAASI,EAAeC,EAAUC,GAC/CD,EAASf,UAAYN,OAAOuB,OAAOD,EAAWhB,WAC9Ce,EAASf,UAAUkB,YAAcH,EACjCJ,EAAeI,EAAUC,EAC3B,CCLA,MAAM,EAA+BV,OAAOC,KAAKC,OAAO,gB,aCEnCW,EAAS,SAAAC,GAAA,SA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,gBACNG,MAAO/F,EAAI0N,WAAWtL,MAClB,mDAEJuL,WAAY,iBACZC,YAAY,GAEhB,OAEZ,G","sources":["webpack://@fof/linguist/webpack/bootstrap","webpack://@fof/linguist/webpack/runtime/compat get default export","webpack://@fof/linguist/webpack/runtime/define property getters","webpack://@fof/linguist/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/linguist/webpack/runtime/make namespace object","webpack://@fof/linguist/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/linguist/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/linguist/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/linguist/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/linguist/./src/admin/models/StringKey.js","webpack://@fof/linguist/./src/admin/models/TextString.js","webpack://@fof/linguist/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/linguist/external root \"flarum.core.compat['admin/components/LoadingModal']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/linguist/./src/admin/utils/localesAsArray.js","webpack://@fof/linguist/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/linguist/./src/admin/utils/highlightMithril.js","webpack://@fof/linguist/./src/admin/components/StringLocale.js","webpack://@fof/linguist/./src/admin/components/StringKey.js","webpack://@fof/linguist/./src/admin/utils/namespaceLabel.js","webpack://@fof/linguist/./src/admin/utils/frontendLabel.js","webpack://@fof/linguist/./src/admin/utils/booleanCheck.js","webpack://@fof/linguist/./src/admin/pages/StringsPage.js","webpack://@fof/linguist/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/linguist/./src/admin/pages/CoveragePage.js","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/linguist/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/linguist/./src/admin/pages/ExportPage.js","webpack://@fof/linguist/./src/admin/pages/ImportPage.js","webpack://@fof/linguist/./src/admin/pages/LinguistPage.js","webpack://@fof/linguist/./src/admin/components/index.js","webpack://@fof/linguist/./src/admin/models/index.js","webpack://@fof/linguist/./src/admin/pages/index.js","webpack://@fof/linguist/./src/admin/utils/index.js","webpack://@fof/linguist/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","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/Model'];","import Model from \"flarum/common/Model\";\n\nexport default class StringKey extends Model {\n key = Model.attribute(\"key\");\n locales = Model.attribute(\"locales\");\n}\n","import Model from \"flarum/common/Model\";\n\nexport default class TextString extends Model {\n key = Model.attribute(\"key\");\n locale = Model.attribute(\"locale\");\n value = Model.attribute(\"value\");\n\n apiEndpoint() {\n return (\n \"/fof/linguist/strings\" + (this.exists ? \"/\" + this.data.id : \"\")\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/LoadingModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from \"flarum/admin/app\";\n\nexport default function () {\n let locales = [];\n\n let englishFound = false;\n\n for (let key in app.data.locales) {\n if (!app.data.locales.hasOwnProperty(key)) {\n continue;\n }\n\n if (key === \"en\") {\n englishFound = true;\n }\n\n locales.push({\n key,\n name: app.data.locales[key],\n });\n }\n\n // Always show English for the following reasons:\n // It's the fallback locale, so the translations are always active\n // It's the bundled locale for most extensions, so it makes sense to have access to it as reference\n if (!englishFound) {\n locales.unshift({\n key: \"en\",\n // Hard-coded to the same value as in flarum/lang-english composer.json\n // Since other locale names won't be translated to the current language either it doesn't make sense to use a translation\n name: \"English\",\n });\n }\n\n return locales;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","/* global m */\n\nconst HIGHLIGHT_DELIMITER = \"\";\n\n// Takes a string and highlight a keyword with a span with mithril template\n// The output will be an array if a keyword is given\nexport default function (string, highlight) {\n if (!highlight) {\n return string;\n }\n\n const lowercaseHighliht = highlight.toLowerCase();\n\n // Regex to match the highlighted work in a case-insensitive manner\n const regex = new RegExp(\n lowercaseHighliht.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"),\n \"i\",\n );\n\n return string\n .replace(regex, HIGHLIGHT_DELIMITER + \"$&\" + HIGHLIGHT_DELIMITER)\n .split(HIGHLIGHT_DELIMITER)\n .map((text) => {\n if (text.toLowerCase() === lowercaseHighliht) {\n return m(\"span.FoF-Linguist-Highlight\", text);\n }\n\n return text;\n });\n}\n","import app from \"flarum/admin/app\";\nimport ItemList from \"flarum/common/utils/ItemList\";\nimport Button from \"flarum/common/components/Button\";\nimport highlightMithril from \"../utils/highlightMithril\";\n\n/* global m */\n\nexport default class StringLocale {\n oninit(vnode) {\n this.stringKey = vnode.attrs.stringKey;\n this.locale = vnode.attrs.locale;\n this.localeKey = this.locale ? this.locale.key : null;\n this.originalString =\n this.localeKey &&\n this.stringKey.locales().hasOwnProperty(this.localeKey)\n ? this.stringKey.locales()[this.localeKey]\n : null;\n\n this.string = app.store\n .all(\"fof-linguist-string\")\n .find(\n (string) =>\n string.key() === this.stringKey.key() &&\n string.locale() === this.localeKey,\n );\n\n this.value = this.string ? this.string.value() : \"\";\n this.dirty = false;\n this.processing = false;\n\n // We check whether any original translation in any language has a newline\n // By not hard-coding to English, this should work pretty well even if the fallback locale is modified,\n // or if a text happens to not be available in the fallback language\n const originalHasNewLine = Object.keys(this.stringKey.locales()).some(\n (key) => this.stringKey.locales()[key].indexOf(\"\\n\") !== -1,\n );\n\n this.inputType = \"input\";\n\n // We will enable multi-line editing if the original has a newline, or if the current custom value already has one\n if (originalHasNewLine || this.value.indexOf(\"\\n\") !== -1) {\n this.inputType = \"textarea\";\n }\n }\n\n view(vnode) {\n const placeholderText = this.originalString\n ? this.originalString\n : \"(\" +\n app.translator.trans(\n \"fof-linguist.admin.placeholder.\" +\n (this.localeKey ? \"not-translated\" : \"all-locales\"),\n ) +\n \")\";\n\n return m(\".FoF-Linguist-Locale\", [\n m(\"label.FoF-Linguist-Label\", this.localeName()),\n m(\n \".FoF-Linguist-Field\",\n {\n className:\n (this.value ? \"FoF-Linguist-Field--with-value\" : \"\") +\n (this.originalString\n ? \" FoF-Linguist-Field--with-original-string\"\n : \"\"),\n title: placeholderText,\n },\n [\n m(\".FoF-Linguist-Field-Wrap\", [\n m(this.inputType, {\n className: \"FormControl FoF-Linguist-Input\",\n value: this.value,\n oninput: (event) => {\n this.value = event.target.value;\n this.dirty = true;\n\n // Remove dirty state if the user erased his text without saving\n if (!this.value && !this.string) {\n this.dirty = false;\n }\n },\n disabled: this.processing,\n }),\n m(\".FoF-Linguist-Placeholder\", [\n m(\n \"span.FoF-Linguist-Placeholder-Hint\",\n app.translator.trans(\n \"fof-linguist.admin.placeholder.hint\",\n ),\n ),\n \" \",\n m(\n \"span\",\n this.originalString\n ? highlightMithril(\n placeholderText,\n vnode.attrs.highlight,\n )\n : placeholderText,\n ),\n ]),\n ]),\n ],\n ),\n m(\n \".FoF-Linguist-Controls\",\n this.actions(vnode.attrs.onchange).toArray(),\n ),\n ]);\n }\n\n localeName() {\n if (this.locale) {\n return [this.locale.name + \" (\", m(\"code\", this.locale.key), \")\"];\n } else {\n return app.translator.trans(\"fof-linguist.admin.locales.all\");\n }\n }\n\n actions(onchange) {\n const items = new ItemList();\n\n items.add(\n \"apply\",\n Button.component(\n {\n type: \"button\",\n className: \"Button Button--primary\",\n loading: this.processing,\n disabled: !this.dirty,\n onclick: () => {\n this.saveString(onchange);\n },\n },\n app.translator.trans(\"fof-linguist.admin.buttons.apply\"),\n ),\n );\n\n items.add(\n \"reset\",\n Button.component(\n {\n type: \"button\",\n className: \"Button\",\n loading: this.processing,\n disabled: !this.dirty && !this.string,\n onclick: () => {\n this.deleteString(onchange);\n },\n },\n app.translator.trans(\"fof-linguist.admin.buttons.reset\"),\n ),\n );\n\n if (this.originalString) {\n items.add(\n \"copy-original\",\n Button.component(\n {\n type: \"button\",\n className: \"Button\",\n loading: this.processing,\n onclick: () => {\n this.value = this.originalString;\n this.dirty = true;\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.buttons.copy-original\",\n ),\n ),\n );\n }\n\n return items;\n }\n\n saveString(onchange) {\n if (!this.value) {\n this.deleteString(onchange);\n\n return;\n }\n\n if (!this.string) {\n this.string = app.store.createRecord(\"fof-linguist-string\", {\n attributes: {\n key: this.stringKey.key(),\n locale: this.localeKey,\n value: \"\",\n },\n });\n }\n\n this.string.data.attributes.value = this.value;\n\n if (!this.string.locale()) delete this.string.data.attributes.locale;\n\n this.processing = true;\n\n this.string\n .save(this.string.data.attributes)\n .then(() => {\n this.processing = false;\n this.dirty = false;\n\n onchange();\n\n m.redraw();\n })\n .catch((err) => {\n this.processing = false;\n\n throw err;\n });\n }\n\n deleteString(onchange) {\n if (this.string) {\n this.processing = true;\n\n this.string\n .delete()\n .then(() => {\n this.processing = false;\n this.dirty = false;\n\n this.string = null;\n this.value = \"\";\n\n onchange();\n\n m.redraw();\n })\n .catch((err) => {\n this.processing = false;\n\n throw err;\n });\n } else {\n this.value = \"\";\n this.dirty = false;\n }\n }\n}\n","import StringLocale from \"../components/StringLocale\";\nimport localesAsArray from \"../utils/localesAsArray\";\nimport highlightMithril from \"../utils/highlightMithril\";\n\n/* global m */\n\nexport default class StringKey {\n view(vnode) {\n const { stringKey, highlight, onchange } = vnode.attrs;\n\n return m(\".FoF-Linguist-Key\", [\n m(\n \".FoF-Linguist-Key-Code\",\n m(\"code\", highlightMithril(stringKey.key(), highlight)),\n ),\n m(\".FoF-Linguist-Locales\", [\n ...localesAsArray().map((locale) =>\n m(StringLocale, {\n key: locale.key,\n locale,\n stringKey,\n highlight,\n onchange,\n }),\n ),\n m(StringLocale, {\n key: \"all\",\n locale: null,\n stringKey,\n highlight,\n onchange,\n }),\n ]),\n ]);\n }\n}\n","import app from \"flarum/admin/app\";\n\nexport default function (namespace) {\n const translation =\n app.translator.translations[\n \"fof-linguist.admin.known-namespace.\" + namespace\n ];\n\n if (translation) {\n return translation;\n }\n\n return namespace;\n}\n","import app from \"flarum/admin/app\";\n\nexport default function (frontend) {\n const translation =\n app.translator.translations[\n \"fof-linguist.admin.known-frontend.\" + frontend\n ];\n\n if (translation) {\n return translation;\n }\n\n return frontend;\n}\n","export default function (operation, booleans) {\n return booleans.reduce((a, b) => {\n if (a === \"start\") {\n return b;\n }\n\n if (operation === \"or\") {\n return a || b;\n }\n\n return a && b;\n }, \"start\");\n}\n","import app from \"flarum/admin/app\";\nimport Button from \"flarum/common/components/Button\";\nimport Dropdown from \"flarum/common/components/Dropdown\";\nimport Select from \"flarum/common/components/Select\";\nimport Alert from \"flarum/common/components/Alert\";\nimport LoadingModal from \"flarum/admin/components/LoadingModal\";\nimport extractText from \"flarum/common/utils/extractText\";\nimport localesAsArray from \"../utils/localesAsArray\";\nimport StringKey from \"../components/StringKey\";\nimport namespaceLabel from \"../utils/namespaceLabel\";\nimport frontendLabel from \"../utils/frontendLabel\";\nimport booleanCheck from \"../utils/booleanCheck\";\n\n/* global m */\n\nconst RESULTS_PER_PAGE = 20;\n\nexport default class StringsPage {\n oninit(vnode) {\n this.numberOfResultsToShow = RESULTS_PER_PAGE;\n\n this.filters = Object.assign(\n {\n search: \"\",\n withOwnTranslations: false,\n missingTranslationsNegation: \"without\",\n missingTranslationsType: \"any\",\n missingTranslationsOperation: \"or\",\n missingTranslationsInLocales: [],\n forExtension: null,\n frontend: null,\n },\n vnode.attrs.initialBrowseFilters || {},\n );\n\n this.results = [];\n\n this.applyFilters();\n }\n\n view(vnode) {\n const keys = this.results.slice(0, this.numberOfResultsToShow);\n\n return [\n // Additional divs are used to reduce Mithril redraws as much as possible when the conditional components appear\n m(\"div\", this.cacheClearInstructions()),\n m(\".FoF-Linguist-Filters\", [\n m(\"input.FormControl\", {\n value: this.filters.search,\n oninput: (event) => {\n this.filters.search = event.target.value;\n this.applyFilters();\n },\n placeholder: app.translator.trans(\n \"fof-linguist.admin.filters.search\",\n ),\n }),\n Button.component(\n {\n className:\n \"Button\" +\n (this.filters.withOwnTranslations\n ? \" FoF-Linguist-Filter--Selected\"\n : \"\"),\n icon: `far fa-${\n this.filters.withOwnTranslations\n ? \"check-square\"\n : \"square\"\n }`,\n onclick: () => {\n this.filters.withOwnTranslations =\n !this.filters.withOwnTranslations;\n this.applyFilters();\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.filters.with-own-translations\",\n ),\n ),\n Dropdown.component(\n {\n buttonClassName:\n \"Button\" +\n (this.filters.forExtension\n ? \" FoF-Linguist-Filter--Selected\"\n : \"\"),\n label: app.translator.trans(\n \"fof-linguist.admin.filters.for-extension\",\n ),\n },\n vnode.attrs.namespaces.map((namespace) =>\n Button.component(\n {\n className: \"Button\",\n icon: `far fa-${\n this.filters.forExtension ===\n namespace.namespace\n ? \"dot-circle\"\n : \"circle\"\n }`,\n onclick: () => {\n if (\n this.filters.forExtension ===\n namespace.namespace\n ) {\n this.filters.forExtension = null;\n } else {\n this.filters.forExtension =\n namespace.namespace;\n }\n\n this.applyFilters();\n },\n },\n namespace.extension\n ? namespace.extension.extra[\"flarum-extension\"]\n .title\n : namespaceLabel(namespace.namespace),\n ),\n ),\n ),\n Dropdown.component(\n {\n buttonClassName:\n \"Button\" +\n (this.filters.frontend\n ? \" FoF-Linguist-Filter--Selected\"\n : \"\"),\n label: app.translator.trans(\n \"fof-linguist.admin.filters.frontend\",\n ),\n },\n [\"_all_except_admin\", ...vnode.attrs.frontends].map(\n (frontend) =>\n Button.component(\n {\n className: \"Button\",\n icon: `far fa-${\n this.filters.frontend === frontend\n ? \"dot-circle\"\n : \"circle\"\n }`,\n onclick: () => {\n if (\n this.filters.frontend === frontend\n ) {\n this.filters.frontend = null;\n } else {\n this.filters.frontend = frontend;\n }\n\n this.applyFilters();\n },\n },\n frontend === \"_all_except_admin\"\n ? app.translator.trans(\n \"fof-linguist.admin.filters.frontend-all-except-admin\",\n )\n : frontendLabel(frontend),\n ),\n ),\n ),\n Dropdown.component(\n {\n buttonClassName:\n \"Button\" +\n (this.filters.missingTranslationsInLocales.length\n ? \" FoF-Linguist-Filter--Selected\"\n : \"\"),\n label: app.translator.trans(\n \"fof-linguist.admin.filters.missing\",\n ),\n },\n [\n m(\n \".FoF-Linguist-Missing-Filter\",\n {\n onclick(event) {\n // Prevent closing the dropdown\n event.stopPropagation();\n },\n },\n [\n Select.component({\n value: this.filters\n .missingTranslationsNegation,\n onchange: (value) => {\n this.filters.missingTranslationsNegation =\n value;\n\n if (\n this.filters\n .missingTranslationsInLocales\n .length\n ) {\n this.applyFilters();\n }\n },\n options: {\n without: app.translator.trans(\n \"fof-linguist.admin.filters.negation-options.without\",\n ),\n with: app.translator.trans(\n \"fof-linguist.admin.filters.negation-options.with\",\n ),\n },\n }),\n Select.component({\n value: this.filters.missingTranslationsType,\n onchange: (value) => {\n this.filters.missingTranslationsType =\n value;\n\n if (\n this.filters\n .missingTranslationsInLocales\n .length\n ) {\n this.applyFilters();\n }\n },\n options: {\n any: app.translator.trans(\n \"fof-linguist.admin.filters.type-options.any\",\n ),\n original: app.translator.trans(\n \"fof-linguist.admin.filters.type-options.original\",\n ),\n own: app.translator.trans(\n \"fof-linguist.admin.filters.type-options.own\",\n ),\n },\n }),\n m(\n \"p\",\n app.translator.trans(\n \"fof-linguist.admin.filters.missing-middle-label\",\n ),\n ),\n Select.component({\n value: this.filters\n .missingTranslationsOperation,\n onchange: (value) => {\n this.filters.missingTranslationsOperation =\n value;\n\n if (\n this.filters\n .missingTranslationsInLocales\n .length\n ) {\n this.applyFilters();\n }\n },\n options: {\n or: app.translator.trans(\n \"fof-linguist.admin.filters.operation-options.or\",\n ),\n and: app.translator.trans(\n \"fof-linguist.admin.filters.operation-options.and\",\n ),\n },\n }),\n ],\n ),\n ...localesAsArray().map((locale) =>\n Button.component(\n {\n className: \"Button\",\n icon: `far fa-${\n this.filters.missingTranslationsInLocales.indexOf(\n locale.key,\n ) !== -1\n ? \"check-square\"\n : \"square\"\n }`,\n onclick: () => {\n if (\n this.filters.missingTranslationsInLocales.indexOf(\n locale.key,\n ) !== -1\n ) {\n this.filters.missingTranslationsInLocales =\n this.filters.missingTranslationsInLocales.filter(\n (key) => key !== locale.key,\n );\n } else {\n this.filters.missingTranslationsInLocales.push(\n locale.key,\n );\n }\n\n this.applyFilters();\n },\n },\n locale.name + \" (\" + locale.key + \")\",\n ),\n ),\n ],\n ),\n Dropdown.component(\n {\n buttonClassName: \"Button\",\n label: app.translator.trans(\n \"fof-linguist.admin.filters.mass-edit\",\n ),\n },\n [\n Button.component(\n {\n icon: \"far fa-clone\",\n className: \"Button\",\n onclick: () => {\n const strings = app.store\n .all(\"fof-linguist-string\")\n .filter((string) => {\n const key = app.store.getById(\n \"fof-linguist-string-key\",\n string.key(),\n );\n\n return (\n key &&\n key.locales()[\n string.locale()\n ] === string.value()\n );\n });\n\n if (\n confirm(\n extractText(\n app.translator.trans(\n \"fof-linguist.admin.buttons.delete-redundant-confirm\",\n {\n count:\n strings.length + \"\",\n },\n ),\n ),\n )\n ) {\n if (strings.length === 0) {\n return;\n }\n\n app.modal.show(LoadingModal);\n\n Promise.all(\n strings.map((string) =>\n string.delete(),\n ),\n ).then(() => {\n window.location.reload();\n });\n }\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.buttons.delete-redundant\",\n ),\n ),\n Button.component(\n {\n icon: \"fas fa-trash\",\n className: \"Button\",\n onclick: () => {\n const strings = app.store.all(\n \"fof-linguist-string\",\n );\n\n if (\n confirm(\n extractText(\n app.translator.trans(\n \"fof-linguist.admin.buttons.delete-all-confirm\",\n {\n count:\n strings.length + \"\",\n },\n ),\n ),\n )\n ) {\n if (strings.length === 0) {\n return;\n }\n\n app.modal.show(LoadingModal);\n\n Promise.all(\n strings.map((string) =>\n string.delete(),\n ),\n ).then(() => {\n window.location.reload();\n });\n }\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.buttons.delete-all\",\n ),\n ),\n ],\n ),\n ]),\n m(\n \"div\",\n keys.map((stringKey) =>\n m(StringKey, {\n key: stringKey.id(),\n stringKey,\n highlight: this.filters.search,\n onchange: () => {\n // We use the setting and not a local variable because we need to preserve state\n // if we navigate away and back to the Linguist page without refreshing the admin panel\n app.data.settings[\n \"fof.linguist.should-clear-cache\"\n ] = \"1\";\n },\n }),\n ),\n ),\n m(\".FoF-Linguist-Results\", [\n app.translator.trans(\"fof-linguist.admin.filters.results\", {\n shown: keys.length + \"\", // cast to string otherwise number isn't displayed\n total: this.results.length + \"\",\n }),\n \" \",\n this.results.length > keys.length\n ? Button.component(\n {\n className: \"Button\",\n onclick: () => {\n this.numberOfResultsToShow +=\n RESULTS_PER_PAGE;\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.buttons.load-more\",\n ),\n )\n : null,\n ]),\n ];\n }\n\n applyFilters() {\n this.numberOfResultsToShow = RESULTS_PER_PAGE;\n\n const keysWithCustomTranslations = app.store\n .all(\"fof-linguist-string\")\n .map((string) => string.key());\n\n const keysWithCustomTranslationsIn = {};\n localesAsArray().forEach((locale) => {\n keysWithCustomTranslationsIn[locale.key] = app.store\n .all(\"fof-linguist-string\")\n .filter((string) => string.locale() === locale.key)\n .map((string) => string.key());\n });\n\n let lowercaseSearch = \"\";\n\n if (this.filters.search) {\n lowercaseSearch = this.filters.search.toLowerCase();\n }\n\n this.results = app.store\n .all(\"fof-linguist-string-key\")\n .filter((key) => {\n if (\n this.filters.withOwnTranslations &&\n keysWithCustomTranslations.indexOf(key.key()) === -1\n ) {\n return false;\n }\n\n if (this.filters.missingTranslationsInLocales.length) {\n let operation = this.filters.missingTranslationsOperation;\n\n // Because the whole operation is reversed at the end based on with or without,\n // we actually need to make the opposite boolean computation on the \"has\" variables\n if (\n this.filters.missingTranslationsNegation === \"without\"\n ) {\n operation = operation === \"or\" ? \"and\" : \"or\";\n }\n\n const hasOriginalTranslation = booleanCheck(\n operation,\n this.filters.missingTranslationsInLocales.map(\n (locale) => {\n return key.locales().hasOwnProperty(locale);\n },\n ),\n );\n const hasOwnTranslation = booleanCheck(\n operation,\n this.filters.missingTranslationsInLocales.map(\n (locale) => {\n return (\n keysWithCustomTranslationsIn[\n locale\n ].indexOf(key.key()) !== -1\n );\n },\n ),\n );\n\n let matchesType = false;\n\n switch (this.filters.missingTranslationsType) {\n case \"any\":\n matchesType =\n hasOriginalTranslation || hasOwnTranslation;\n break;\n case \"original\":\n matchesType = hasOriginalTranslation;\n break;\n case \"own\":\n matchesType = hasOwnTranslation;\n break;\n }\n\n if (\n this.filters.missingTranslationsNegation === \"without\"\n ) {\n matchesType = !matchesType;\n }\n\n if (!matchesType) {\n return false;\n }\n }\n\n if (this.filters.forExtension) {\n if (\n key.key().indexOf(this.filters.forExtension + \".\") !== 0\n ) {\n return false;\n }\n }\n\n if (this.filters.frontend) {\n const parts = key.key().split(\".\");\n\n if (this.filters.frontend === \"_all_except_admin\") {\n // We will keep everything that isn't admin, including if it's a single level deep\n if (parts.length >= 2 && parts[1] === \"admin\") {\n return false;\n }\n } else {\n // Keep only parts with 2 levels or more where second level matches frontend\n if (\n parts.length < 2 ||\n parts[1] !== this.filters.frontend\n ) {\n return false;\n }\n }\n }\n\n if (lowercaseSearch) {\n if (\n key.key().toLowerCase().indexOf(lowercaseSearch) !== -1\n ) {\n return true;\n }\n\n const locales = key.locales();\n\n for (let locale in locales) {\n if (\n locales.hasOwnProperty(locale) &&\n locales[locale]\n .toLowerCase()\n .indexOf(lowercaseSearch) !== -1\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n return true;\n });\n\n m.redraw();\n }\n\n cacheClearInstructions() {\n // If debug is enabled, we hide the message here because even if we stop setting the flag,\n // an older flag might still be present from before debug mode was enabled\n if (app.data.debugEnabled) {\n return null;\n }\n\n // Check for flag that says cache should be cleared\n // This value is set both server-side and client-side in the onchange code above for immediate effect\n if (app.data.settings[\"fof.linguist.should-clear-cache\"] !== \"1\") {\n return null;\n }\n\n return Alert.component(\n {\n dismissible: false,\n controls: [\n Button.component(\n {\n className: \"Button Button--link\",\n onclick() {\n // Same logic as in core StatusWidget\n app.modal.show(LoadingModal);\n\n app.request({\n method: \"DELETE\",\n url:\n app.forum.attribute(\"apiUrl\") +\n \"/cache\",\n }).then(() => window.location.reload());\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.clear-cache.button\",\n ),\n ),\n ],\n },\n app.translator.trans(\"fof-linguist.admin.clear-cache.text\"),\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from \"flarum/admin/app\";\nimport Button from \"flarum/common/components/Button\";\nimport icon from \"flarum/common/helpers/icon\";\nimport localesAsArray from \"../utils/localesAsArray\";\nimport namespaceLabel from \"../utils/namespaceLabel\";\nimport frontendLabel from \"../utils/frontendLabel\";\n\n/* global m */\n\nexport default class CoveragePage {\n oninit() {\n this.columns = \"locale\";\n this.showAllFrontends = false;\n this.totalPercent = true;\n this.locale = [];\n\n const firstNonEnglishLocale = localesAsArray().find(\n (locale) => locale.key !== \"en\",\n );\n\n if (firstNonEnglishLocale) {\n this.locale = firstNonEnglishLocale.key;\n }\n }\n\n view(vnode) {\n let visibleFrontends = vnode.attrs.frontends.slice(0, 2);\n\n if (this.showAllFrontends) {\n visibleFrontends = vnode.attrs.frontends;\n }\n\n const { browseWithFilters } = vnode.attrs;\n\n return [\n m(\".FoF-Linguist-Filters\", [\n m(\".ButtonGroup\", [\n Button.component(\n {\n className:\n \"Button\" + (this.totalPercent ? \" active\" : \"\"),\n onclick: () => {\n this.totalPercent = true;\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.coverage.total-options.percent\",\n ),\n ),\n Button.component(\n {\n className:\n \"Button\" +\n (this.totalPercent ? \" \" : \" active\"),\n onclick: () => {\n this.totalPercent = false;\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.coverage.total-options.count\",\n ),\n ),\n ]),\n m(\".ButtonGroup\", [\n Button.component(\n {\n className:\n \"Button\" +\n (this.columns === \"locale\" ? \" active\" : \"\"),\n onclick: () => {\n this.columns = \"locale\";\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.coverage.column-options.locale\",\n ),\n ),\n Button.component(\n {\n className:\n \"Button\" +\n (this.columns === \"namespace\" ? \" active\" : \"\"),\n onclick: () => {\n this.columns = \"namespace\";\n this.showAllFrontends = false;\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.coverage.column-options.namespace\",\n ),\n ),\n ]),\n this.columns === \"namespace\"\n ? m(\n \".ButtonGroup\",\n localesAsArray().map((locale) =>\n Button.component(\n {\n className:\n \"Button\" +\n (this.locale === locale.key\n ? \" active\"\n : \"\"),\n onclick: () => {\n if (this.locale !== locale.key) {\n this.locale = locale.key;\n }\n },\n },\n locale.name + \" (\" + locale.key + \")\",\n ),\n ),\n )\n : null,\n ]),\n m(\"table.FoF-Linguist-Coverage\", [\n m(\n \"thead\",\n m(\"tr\", [\n m(\n \"th\",\n app.translator.trans(\n \"fof-linguist.admin.coverage.columns.namespace\",\n ),\n ),\n this.columns === \"locale\"\n ? localesAsArray().map((locale) =>\n m(\n \"th\",\n locale.name + \" (\" + locale.key + \")\",\n ),\n )\n : [\n this.showAllFrontends\n ? visibleFrontends.map((frontend) =>\n m(\"th\", frontendLabel(frontend)),\n )\n : [\n m(\n \"th\",\n app.translator.trans(\n \"fof-linguist.admin.coverage.columns.all-except-admin\",\n ),\n ),\n m(\"th\", frontendLabel(\"admin\")),\n m(\n \"th\",\n Button.component(\n {\n className: \"Button\",\n onclick: () => {\n this.showAllFrontends = true;\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.coverage.columns.all-frontends\",\n ),\n ),\n ),\n ],\n ],\n ]),\n ),\n m(\"tbody\", [\n this.columns === \"locale\"\n ? m(\"tr\", [\n m(\"td\", [\n m(\n \"span.FoF-Linguist-Coverage-Extension-Icon.FoF-Linguist-Coverage-Namespace-Icon\",\n ),\n m(\n \"span.FoF-Linguist-Coverage-Extension-Title\",\n app.translator.trans(\n \"fof-linguist.admin.coverage.all-namespaces\",\n ),\n ),\n ]),\n localesAsArray().map((locale) =>\n m(\n \"td\",\n this.localeCoverage(\n browseWithFilters,\n locale.key,\n ),\n ),\n ),\n ])\n : null,\n vnode.attrs.namespaces.map((namespace) => {\n return m(\"tr\", [\n m(\n \"td\",\n namespace.extension\n ? [\n m(\n \"span.FoF-Linguist-Coverage-Extension-Icon\",\n {\n style: namespace.extension\n .icon,\n },\n namespace.extension.icon\n ? icon(\n namespace.extension.icon\n .name,\n )\n : \"\",\n ),\n m(\n \"span.FoF-Linguist-Coverage-Extension-Title\",\n namespace.extension.extra[\n \"flarum-extension\"\n ].title,\n ),\n ]\n : [\n m(\n \"span.FoF-Linguist-Coverage-Extension-Icon.FoF-Linguist-Coverage-Namespace-Icon\",\n ),\n m(\n \"span.FoF-Linguist-Coverage-Extension-Title\",\n namespaceLabel(\n namespace.namespace,\n ),\n ),\n ],\n ),\n this.columns === \"locale\"\n ? localesAsArray().map((locale) =>\n m(\n \"td\",\n this.localeCoverage(\n browseWithFilters,\n locale.key,\n namespace.namespace,\n ),\n ),\n )\n : [\n this.showAllFrontends\n ? visibleFrontends.map((frontend) =>\n m(\n \"td\",\n this.prefixCoverage(\n browseWithFilters,\n namespace.namespace,\n frontend,\n ),\n ),\n )\n : [\n m(\n \"td\",\n this.prefixCoverage(\n browseWithFilters,\n namespace.namespace,\n \"_all_except_admin\",\n ),\n ),\n m(\n \"td\",\n this.prefixCoverage(\n browseWithFilters,\n namespace.namespace,\n \"admin\",\n ),\n ),\n ],\n ],\n ]);\n }),\n ]),\n ]),\n ];\n }\n\n prefixCoverage(browseWithFilters, namespace, frontend) {\n if (!this.locale) {\n return null;\n }\n\n return this.localeCoverage(\n browseWithFilters,\n this.locale,\n namespace,\n frontend,\n );\n }\n\n localeCoverage(browseWithFilters, locale, namespace, frontend) {\n const stringKeys = app.store\n .all(\"fof-linguist-string-key\")\n .filter((key) => {\n if (!namespace) {\n return true;\n }\n\n const parts = key.key().split(\".\");\n\n if (parts[0] !== namespace) {\n return false;\n }\n\n if (frontend === \"_all_except_admin\") {\n if (parts.length >= 2 && parts[1] === \"admin\") {\n return false;\n }\n } else if (\n frontend &&\n (parts.length < 2 || parts[1] !== frontend)\n ) {\n return false;\n }\n\n return true;\n });\n\n if (stringKeys.length === 0) {\n return \"-\";\n }\n\n let customCount = 0;\n let originalCount = 0;\n\n stringKeys.forEach((stringKey) => {\n const customString = app.store\n .all(\"fof-linguist-string\")\n .find(\n (string) =>\n string.key() === stringKey.key() &&\n string.locale() === locale,\n );\n\n if (customString) {\n customCount++;\n } else if (stringKey.locales().hasOwnProperty(locale)) {\n originalCount++;\n }\n });\n\n const percent = Math.round(\n ((customCount + originalCount) / stringKeys.length) * 100,\n );\n\n let specialStyle;\n\n if (percent === 100) {\n specialStyle = \"full\";\n } else if (percent < 5) {\n specialStyle = \"low\";\n }\n\n let label;\n\n if (this.totalPercent) {\n label = app.translator.trans(\n \"fof-linguist.admin.coverage.count.percent\",\n {\n percent: percent + \"\", // Keeps zero as string\n },\n );\n } else {\n label = app.translator.trans(\n \"fof-linguist.admin.coverage.count.total\",\n {\n translated: customCount + originalCount + \"\", // Keeps zero as string\n total: stringKeys.length,\n },\n );\n }\n\n return m(\".FoF-Linguist-Coverage-Progress-Wrap\", [\n m(\n \".FoF-Linguist-Progress\",\n {\n className: specialStyle\n ? \"FoF-Linguist-Progress--\" + specialStyle\n : \"\",\n },\n [\n m(\".FoF-Linguist-Progress-Bar\", {\n style: {\n width: Math.max(percent, 5) + \"%\", // Always show the progress bar even if very close to 0\n },\n }),\n m(\".FoF-Linguist-Progress-Label\", label),\n m(\n \".FoF-Linguist-Progress-More\",\n app.translator.trans(\n \"fof-linguist.admin.coverage.count.details\",\n {\n total: stringKeys.length,\n original: originalCount + \"\", // Cast to string to preserve zero\n custom: customCount + \"\",\n },\n ),\n ),\n ],\n ),\n Button.component({\n icon: \"fas fa-filter\",\n className: \"Button Button--icon\",\n onclick: () => {\n const options = {\n missingTranslationsInLocales: [locale],\n };\n\n if (namespace) {\n options.forExtension = namespace;\n }\n\n if (frontend) {\n options.frontend = frontend;\n }\n\n browseWithFilters(options);\n },\n title: app.translator.trans(\n \"fof-linguist.admin.coverage.apply-missing-filter\",\n ),\n }),\n ]);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","import app from \"flarum/admin/app\";\nimport Select from \"flarum/common/components/Select\";\nimport Switch from \"flarum/common/components/Switch\";\nimport LinkButton from \"flarum/common/components/LinkButton\";\nimport localesAsArray from \"../utils/localesAsArray\";\nimport namespaceLabel from \"../utils/namespaceLabel\";\n\n/* global m */\n\nexport default class ExportPage {\n oninit() {\n this.locale = \"en\";\n this.namespace = null;\n this.includeOriginals = false;\n this.includeAll = false;\n this.loading = false;\n this.output = \"\";\n\n this.fetchOutput();\n }\n\n view(vnode) {\n const localeOptions = {};\n\n localesAsArray().forEach((locale) => {\n localeOptions[locale.key] = locale.name + \" (\" + locale.key + \")\";\n });\n\n localeOptions.all = app.translator.trans(\n \"fof-linguist.admin.export.locale-all\",\n );\n\n const namespaceOptions = {\n _all: app.translator.trans(\n \"fof-linguist.admin.export.namespace-all\",\n ),\n };\n\n vnode.attrs.namespaces.forEach((namespace) => {\n if (namespace.extension) {\n namespaceOptions[namespace.namespace] =\n namespace.extension.extra[\"flarum-extension\"].title;\n } else {\n namespaceOptions[namespace.namespace] = namespaceLabel(\n namespace.namespace,\n );\n }\n });\n\n return [\n m(\"h2\", app.translator.trans(\"fof-linguist.admin.export.title\")),\n m(\n \".Form-group\",\n m(\n \".Alert\",\n app.translator.trans(\"fof-linguist.admin.export.warning\"),\n ),\n ),\n m(\".Form-group\", [\n m(\n \"label\",\n app.translator.trans(\"fof-linguist.admin.export.locale\"),\n ),\n Select.component({\n options: localeOptions,\n value: this.locale,\n onchange: (value) => {\n this.locale = value;\n\n this.fetchOutput();\n },\n }),\n ]),\n m(\".Form-group\", [\n m(\n \"label\",\n app.translator.trans(\"fof-linguist.admin.export.namespace\"),\n ),\n Select.component({\n options: namespaceOptions,\n value: this.namespace === null ? \"_all\" : this.namespace,\n onchange: (value) => {\n this.namespace = value === \"_all\" ? null : value;\n\n this.fetchOutput();\n },\n }),\n ]),\n m(\".Form-group\", [\n Switch.component(\n {\n state: this.includeOriginals,\n onchange: (value) => {\n this.includeOriginals = value;\n\n this.fetchOutput();\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.export.include-originals\",\n ),\n ),\n ]),\n m(\".Form-group\", [\n Switch.component(\n {\n state: this.includeAll,\n onchange: (value) => {\n this.includeAll = value;\n\n this.fetchOutput();\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.export.include-all\",\n ),\n ),\n ]),\n m(\".Form-group\", [\n m(\"label\", [\n app.translator.trans(\"fof-linguist.admin.export.output\"),\n \" \",\n LinkButton.component(\n {\n className: \"Button Button--primary\",\n href: this.exportUrl(),\n external: true,\n // If a namespace is selected, we use it as filename (language pack convention)\n // otherwise we use the locale as filename (extension convention)\n download: (this.namespace || this.locale) + \".yml\",\n },\n app.translator.trans(\n \"fof-linguist.admin.export.download\",\n ),\n ),\n ]),\n m(\"textarea.FormControl.FoF-Export-Textarea\", {\n readonly: true,\n value: this.output,\n rows: 10,\n placeholder: this.loading\n ? app.translator.trans(\n \"fof-linguist.admin.export.output-loading\",\n )\n : app.translator.trans(\n \"fof-linguist.admin.export.output-empty\",\n ),\n }),\n ]),\n ];\n }\n\n exportUrl() {\n return (\n app.forum.attribute(\"apiUrl\") +\n \"/fof/linguist/export?\" +\n m.buildQueryString({\n locale: this.locale,\n namespace: this.namespace,\n includeOriginals: this.includeOriginals ? \"1\" : \"0\",\n includeAll: this.includeAll ? \"1\" : \"0\",\n })\n );\n }\n\n fetchOutput() {\n this.loading = true;\n this.output = \"\";\n\n app.request({\n method: \"GET\",\n url: this.exportUrl(),\n // Flarum doesn't support a raw to have the raw text response\n // So we'll encode the response with JSON so Flarum can parse if afterwards\n extract: (raw) => JSON.stringify(raw),\n })\n .then((output) => {\n this.loading = false;\n this.output = output;\n m.redraw();\n })\n .catch((error) => {\n this.loading = false;\n m.redraw();\n throw error;\n });\n }\n}\n","import app from \"flarum/admin/app\";\nimport Button from \"flarum/common/components/Button\";\nimport Select from \"flarum/common/components/Select\";\nimport Switch from \"flarum/common/components/Switch\";\nimport extractText from \"flarum/common/utils/extractText\";\nimport localesAsArray from \"../utils/localesAsArray\";\n\n/* global m */\n\nexport default class ImportPage {\n oninit() {\n this.locale = \"en\";\n this.overrideExisting = true;\n this.input = \"\";\n this.loading = false;\n }\n\n view() {\n const localeOptions = {};\n\n localesAsArray().forEach((locale) => {\n localeOptions[locale.key] = locale.name + \" (\" + locale.key + \")\";\n });\n\n localeOptions.all = app.translator.trans(\n \"fof-linguist.admin.import.locale-all\",\n );\n\n return [\n m(\"h2\", app.translator.trans(\"fof-linguist.admin.import.title\")),\n m(\".Form-group\", [\n m(\n \"label\",\n app.translator.trans(\"fof-linguist.admin.import.input\"),\n ),\n m(\"textarea.FormControl\", {\n value: this.input,\n oninput: (event) => {\n this.input = event.target.value;\n },\n rows: 10,\n placeholder: app.translator.trans(\n \"fof-linguist.admin.import.input-placeholder\",\n ),\n }),\n ]),\n m(\".Form-group\", [\n m(\n \"label\",\n app.translator.trans(\"fof-linguist.admin.import.locale\"),\n ),\n Select.component({\n options: localeOptions,\n value: this.locale,\n onchange: (value) => {\n this.locale = value;\n\n this.fetchOutput();\n },\n }),\n ]),\n m(\".Form-group\", [\n Switch.component(\n {\n state: this.overrideExisting,\n onchange: (value) => {\n this.overrideExisting = value;\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.import.override-existing\",\n ),\n ),\n ]),\n m(\n \".Form-group\",\n Button.component(\n {\n className: \"Button Button--primary\",\n onclick: () => {\n this.loading = true;\n\n app.request({\n method: \"POST\",\n url:\n app.forum.attribute(\"apiUrl\") +\n \"/fof/linguist/import\",\n body: {\n input: this.input,\n locale: this.locale,\n ignoreExisting: !this.overrideExisting,\n },\n })\n .then((data) => {\n this.loading = false;\n m.redraw();\n\n if (\n confirm(\n extractText(\n app.translator.trans(\n this.overrideExisting\n ? \"fof-linguist.admin.import.results\"\n : \"fof-linguist.admin.import.results-with-ignore\",\n {\n imported:\n data.imported + \"\", // Cast to string to preserve zeros\n ignored:\n data.ignored + \"\",\n identical:\n data.identical + \"\",\n },\n ),\n ),\n )\n ) {\n window.location.reload();\n }\n })\n .catch((error) => {\n this.loading = false;\n m.redraw();\n throw error;\n });\n },\n disabled: this.loading || !this.input,\n loading: this.loading,\n },\n app.translator.trans(\"fof-linguist.admin.import.submit\"),\n ),\n ),\n ];\n }\n}\n","import app from \"flarum/admin/app\";\nimport ExtensionPage from \"flarum/admin/components/ExtensionPage\";\nimport LoadingIndicator from \"flarum/common/components/LoadingIndicator\";\nimport StringsPage from \"./StringsPage\";\nimport CoveragePage from \"./CoveragePage\";\nimport ExportPage from \"./ExportPage\";\nimport ImportPage from \"./ImportPage\";\n\n/* global m */\n\nexport default class LinguistPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tab = \"strings\";\n this.ready = false;\n this.namespaces = []; // First level of translation keys. Usually an extension ID, but also core and validation\n this.frontends = [\"forum\", \"admin\", \"lib\", \"ref\", \"api\"]; // Second level of translation keys: forum, admin, ...\n this.initialBrowseFilters = {};\n\n Promise.all([\n app\n .request({\n method: \"GET\",\n url:\n app.forum.attribute(\"apiUrl\") + \"/fof/linguist/strings\",\n })\n .then((result) => {\n app.store.pushPayload(result);\n }),\n app\n .request({\n method: \"GET\",\n url:\n app.forum.attribute(\"apiUrl\") +\n \"/fof/linguist/string-keys\",\n })\n .then((result) => {\n const keys = app.store.pushPayload(result);\n\n const namespaces = [];\n\n keys.forEach((key) => {\n const parts = key.key().split(\".\");\n\n const namespace = parts[0];\n\n if (\n [\"core\", \"validation\"].indexOf(namespace) === -1 &&\n namespaces.indexOf(namespace) === -1\n ) {\n namespaces.push(namespace);\n }\n\n if (parts.length > 1 && namespace !== \"validation\") {\n const frontend = parts[1];\n\n if (this.frontends.indexOf(frontend) === -1) {\n this.frontends.push(frontend);\n }\n }\n });\n\n namespaces.sort();\n\n this.namespaces = [\n {\n namespace: \"core\",\n },\n {\n namespace: \"validation\",\n },\n ...namespaces.map((namespace) => {\n // First we look if the namespace matches an extension ID, that's the most common naming\n let extension = app.data.extensions[namespace];\n\n // If that's unsuccessful, we'll look if the full package name was used as namespace\n if (!extension) {\n extension = Object.values(\n app.data.extensions,\n ).find((extension) => {\n const packageNameWithDash =\n extension.name.replace(\"/\", \"-\");\n\n return namespace === packageNameWithDash;\n });\n }\n\n return {\n namespace,\n extension,\n };\n }),\n ];\n }),\n ]).then(() => {\n this.ready = true;\n m.redraw();\n });\n }\n\n content() {\n return m(\n \".ExtensionPage-settings\",\n m(\".container\", [this.contentTab()]),\n );\n }\n\n infoItems() {\n const items = super.infoItems();\n\n items.add(\n \"linguist-tabs\",\n m(\"ul.FoF-Linguist-Tabs\", [\n m(\n \"li\",\n m(\n \"a\",\n {\n className: this.tab === \"strings\" ? \"active\" : \"\",\n onclick: () => {\n this.tab = \"strings\";\n },\n },\n app.translator.trans(\"fof-linguist.admin.tabs.strings\"),\n ),\n ),\n m(\n \"li\",\n m(\n \"a\",\n {\n className: this.tab === \"coverage\" ? \"active\" : \"\",\n onclick: () => {\n this.tab = \"coverage\";\n },\n },\n app.translator.trans(\n \"fof-linguist.admin.tabs.coverage\",\n ),\n ),\n ),\n m(\n \"li\",\n m(\n \"a\",\n {\n className: this.tab === \"export\" ? \"active\" : \"\",\n onclick: () => {\n this.tab = \"export\";\n },\n },\n app.translator.trans(\"fof-linguist.admin.tabs.export\"),\n ),\n ),\n m(\n \"li\",\n m(\n \"a\",\n {\n className: this.tab === \"import\" ? \"active\" : \"\",\n onclick: () => {\n this.tab = \"import\";\n },\n },\n app.translator.trans(\"fof-linguist.admin.tabs.import\"),\n ),\n ),\n ]),\n 100,\n );\n\n return items;\n }\n\n contentTab() {\n if (!this.ready) {\n return LoadingIndicator.component();\n }\n\n switch (this.tab) {\n case \"strings\":\n return m(StringsPage, {\n namespaces: this.namespaces,\n frontends: this.frontends,\n initialBrowseFilters: this.initialBrowseFilters,\n });\n case \"coverage\":\n return m(CoveragePage, {\n namespaces: this.namespaces,\n frontends: this.frontends,\n browseWithFilters: (filters) => {\n this.initialBrowseFilters = filters;\n this.tab = \"strings\";\n },\n });\n case \"export\":\n return m(ExportPage, {\n namespaces: this.namespaces,\n });\n case \"import\":\n return m(ImportPage);\n }\n\n return null;\n }\n}\n","import StringKey from \"./StringKey\";\nimport StringLocale from \"./StringLocale\";\n\nexport const components = {\n StringKey,\n StringLocale,\n};\n","import StringKey from \"./StringKey\";\nimport TextString from \"./TextString\";\n\nexport const models = {\n StringKey,\n TextString,\n};\n","import CoveragePage from \"./CoveragePage\";\nimport ExportPage from \"./ExportPage\";\nimport ImportPage from \"./ImportPage\";\nimport LinguistPage from \"./LinguistPage\";\nimport StringsPage from \"./StringsPage\";\n\nexport const pages = {\n CoveragePage,\n ExportPage,\n ImportPage,\n LinguistPage,\n StringsPage,\n};\n","import booleanCheck from \"./booleanCheck\";\nimport frontendLabel from \"./frontendLabel\";\nimport highlightMithril from \"./highlightMithril\";\nimport localesAsArray from \"./localesAsArray\";\nimport namespaceLabel from \"./namespaceLabel\";\n\nexport const utils = {\n booleanCheck,\n frontendLabel,\n highlightMithril,\n localesAsArray,\n namespaceLabel,\n};\n","import app from \"flarum/admin/app\";\nimport StringKey from \"./models/StringKey\";\nimport TextString from \"./models/TextString\";\nimport LinguistPage from \"./pages/LinguistPage\";\n\nexport * from \"./components\";\nexport * from \"./models\";\nexport * from \"./pages\";\nexport * from \"./utils\";\n\napp.initializers.add(\"fof-linguist\", (app) => {\n app.store.models[\"fof-linguist-string-key\"] = StringKey;\n app.store.models[\"fof-linguist-string\"] = TextString;\n\n app.extensionData\n .for(\"fof-linguist\")\n .registerPage(LinguistPage)\n .registerPermission(\n {\n icon: \"fas fa-italic\",\n label: app.translator.trans(\n \"fof-linguist.admin.permissions.view_string_keys\",\n ),\n permission: \"viewStringKeys\",\n allowGuest: true,\n },\n \"view\",\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","StringKey","_Model","_this","_len","arguments","length","args","Array","_key","apply","concat","Model","locales","TextString","locale","apiEndpoint","this","exists","data","id","englishFound","app","push","name","unshift","HIGHLIGHT_DELIMITER","string","highlight","lowercaseHighliht","toLowerCase","regex","RegExp","replace","split","map","text","m","StringLocale","_proto","oninit","vnode","stringKey","attrs","localeKey","originalString","all","find","dirty","processing","originalHasNewLine","keys","some","indexOf","inputType","view","_this2","placeholderText","trans","localeName","className","title","oninput","event","target","disabled","highlightMithril","actions","onchange","toArray","_this3","items","ItemList","add","Button","type","loading","onclick","saveString","deleteString","_this4","createRecord","attributes","save","then","redraw","err","_this5","_vnode$attrs","localesAsArray","namespace","translations","frontend","operation","booleans","reduce","b","StringsPage","numberOfResultsToShow","filters","assign","search","withOwnTranslations","missingTranslationsNegation","missingTranslationsType","missingTranslationsOperation","missingTranslationsInLocales","forExtension","initialBrowseFilters","results","applyFilters","slice","cacheClearInstructions","placeholder","icon","Dropdown","buttonClassName","label","namespaces","extension","extra","namespaceLabel","frontends","frontendLabel","stopPropagation","Select","options","without","with","any","original","own","or","and","filter","strings","getById","confirm","extractText","count","show","LoadingModal","Promise","window","location","reload","settings","shown","total","keysWithCustomTranslations","keysWithCustomTranslationsIn","forEach","lowercaseSearch","hasOriginalTranslation","booleanCheck","hasOwnTranslation","matchesType","parts","debugEnabled","Alert","dismissible","controls","method","url","attribute","CoveragePage","columns","showAllFrontends","totalPercent","firstNonEnglishLocale","visibleFrontends","browseWithFilters","localeCoverage","style","prefixCoverage","stringKeys","customCount","originalCount","specialStyle","percent","Math","round","translated","width","max","custom","ExportPage","includeOriginals","includeAll","output","fetchOutput","localeOptions","namespaceOptions","_all","Switch","state","LinkButton","href","exportUrl","external","download","readonly","rows","buildQueryString","extract","raw","JSON","stringify","error","ImportPage","overrideExisting","input","body","ignoreExisting","imported","ignored","identical","LinguistPage","_ExtensionPage","tab","ready","result","pushPayload","sort","extensions","values","packageNameWithDash","content","contentTab","infoItems","LoadingIndicator","ExtensionPage","components","models","pages","utils","store","extensionData","registerPage","registerPermission","translator","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file