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-center/webpack/runtime/compat get default export","webpack://@foskym/flarum-oauth-center/webpack/runtime/define property getters","webpack://@foskym/flarum-oauth-center/webpack/runtime/hasOwnProperty shorthand","webpack://@foskym/flarum-oauth-center/webpack/runtime/make namespace object","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/extenders']\"","webpack://@foskym/flarum-oauth-center/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@foskym/flarum-oauth-center/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/Model']\"","webpack://@foskym/flarum-oauth-center/./src/common/models/Client.js","webpack://@foskym/flarum-oauth-center/./src/common/extend.js","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['admin/app']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/components/Button']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/components/Page']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/components/FieldSet']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['admin/utils/saveSettings']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/components/Select']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@foskym/flarum-oauth-center/./src/admin/pages/IndexPage.js","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['admin/components/AdminPage']\"","webpack://@foskym/flarum-oauth-center/./src/admin/pages/ClientsPage.js","webpack://@foskym/flarum-oauth-center/./src/admin/pages/ScopesPage.js","webpack://@foskym/flarum-oauth-center/./src/admin/components/SettingsPage.js","webpack://@foskym/flarum-oauth-center/./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['common/extenders'];","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 Client extends Model {\n client_id = Model.attribute('client_id');\n client_secret = Model.attribute('client_secret');\n redirect_uri = Model.attribute('redirect_uri');\n grant_types = Model.attribute('grant_types');\n scope = Model.attribute('scope');\n user_id = Model.attribute('user_id');\n client_name = Model.attribute('client_name');\n client_icon = Model.attribute('client_icon');\n client_desc = Model.attribute('client_desc');\n client_home = Model.attribute('client_home');\n}\n","import Extend from 'flarum/common/extenders';\nimport Client from \"./models/Client\";\n\nexport default [\n new Extend.Store()\n .add('oauth-clients', Client),\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/FieldSet'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","import app from 'flarum/admin/app';\nimport Page from 'flarum/common/components/Page';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport Stream from 'flarum/common/utils/Stream';\nimport Select from 'flarum/common/components/Select';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default class IndexPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.saving = false;\n\n this.fields = [\n 'foskym-oauth-center.access_lifetime',\n 'foskym-oauth-center.allow_implicit',\n 'foskym-oauth-center.enforce_state',\n 'foskym-oauth-center.require_exact_redirect_uri'\n ];\n this.values = {};\n\n const settings = app.data.settings;\n this.fields.forEach(key => this.values[key] = Stream(settings[key] || \"\"));\n\n for (let i = 1; i < this.fields.length; i++) {\n this.values[this.fields[i]] = settings[this.fields[i]] === '1';\n }\n }\n\n view() {\n return (\n <div>\n <form onsubmit={this.onsubmit.bind(this)} className=\"BasicsPage\">\n {FieldSet.component({}, [\n <div style=\"height: 5px;\"></div>,\n Switch.component({\n state: this.values['foskym-oauth-center.allow_implicit'],\n onchange: (value) => this.saveSingleSetting('foskym-oauth-center.allow_implicit', value),\n loading: this.saving,\n }, app.translator.trans('foskym-oauth-center.admin.settings.allow_implicit')),\n ])}\n\n {FieldSet.component({}, [\n <div style=\"height: 5px;\"></div>,\n Switch.component({\n state: this.values['foskym-oauth-center.enforce_state'],\n onchange: (value) => this.saveSingleSetting('foskym-oauth-center.enforce_state', value),\n loading: this.saving,\n }, app.translator.trans('foskym-oauth-center.admin.settings.enforce_state')),\n ])}\n\n {FieldSet.component({}, [\n <div style=\"height: 5px;\"></div>,\n Switch.component({\n state: this.values['foskym-oauth-center.require_exact_redirect_uri'],\n onchange: (value) => this.saveSingleSetting('foskym-oauth-center.require_exact_redirect_uri', value),\n loading: this.saving,\n }, app.translator.trans('foskym-oauth-center.admin.settings.require_exact_redirect_uri')),\n ])}\n <hr/>\n {FieldSet.component({}, [\n <input className=\"FormControl\" bidi={this.values['foskym-oauth-center.access_lifetime']}\n placeholder={app.translator.trans('foskym-oauth-center.admin.settings.access_lifetime')} required/>,\n <div className=\"helpText\">\n {app.translator.trans('foskym-oauth-center.admin.settings.access_lifetime')}\n </div>,\n Button.component({\n type: 'submit',\n className: 'Button Button--primary',\n loading: this.saving\n }, app.translator.trans('core.admin.settings.submit_button'))\n ])}\n\n </form>\n\n </div>\n );\n }\n\n saveSingleSetting(setting, value) {\n if (this.saving) return;\n\n this.saving = true;\n\n this.values[setting] = value;\n\n let data = {};\n data[setting] = value;\n\n saveSettings(data)\n .then(() => app.alerts.show({type: 'success'}, app.translator.trans('core.admin.settings.saved_message')))\n .catch(() => {\n })\n .then(() => {\n this.saving = false;\n m.redraw();\n });\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (this.saving) return;\n\n this.saving = true;\n app.alerts.dismiss(this.successAlert);\n\n const settings = {};\n\n settings['foskym-oauth-center.access_lifetime'] = this.values['foskym-oauth-center.access_lifetime']();\n\n // this.fields.forEach(key => {\n // settings[key] = this.values[key]()\n //\n // });\n\n if (settings['foskym-oauth-center.access_lifetime'] === \"\") {\n settings['foskym-oauth-center.access_lifetime'] = 3600;\n }\n\n saveSettings(settings)\n .then(() => app.alerts.show({type: 'success'}, app.translator.trans('core.admin.settings.saved_message')))\n .catch(() => {\n })\n .then(() => {\n this.saving = false;\n m.redraw();\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/AdminPage'];","import app from 'flarum/admin/app';\nimport Page from 'flarum/common/components/Page';\nimport AdminPage from 'flarum/admin/components/AdminPage';\nimport Button from 'flarum/common/components/Button';\nimport Client from \"../../common/models/Client\";\nexport default class ClientsPage extends Page {\n settingName = 'collapsible-posts.reasons';\n translationPrefix = 'foskym-oauth-center.admin.clients.';\n clients = [];\n oninit(vnode) {\n super.oninit(vnode);\n\n this.fields = [\n 'client_id',\n 'client_secret',\n 'redirect_uri',\n 'grant_types',\n 'scope',\n 'client_name',\n 'client_desc',\n 'client_icon',\n 'client_home'\n ];\n\n app.store.find('oauth-clients').then(r => {\n this.clients = r;\n this.fields.map(key => console.log(this.clients[0][key]))\n m.redraw();\n });\n }\n\n view() {\n return (\n <div class={\"OAuthCenter-clientsPage\"}>\n {\n m('.Form-group', [\n m('table', [\n m('thead', m('tr', [\n this.fields.map(key => m('th', app.translator.trans(this.translationPrefix + key))),\n m('th'),\n ])),\n m('tbody', [\n this.clients.map((client, index) => m('tr', [\n this.fields.map(key =>\n m('td', m('input.FormControl', {\n type: 'text',\n value: client[key]() || '',\n onchange: (event) => {\n this.saveClientInfo(index, key, event.target.value);\n },\n }))\n ),\n m('td', Button.component({\n className: 'Button Button--icon',\n icon: 'fas fa-times',\n onclick: () => {\n this.clients.splice(index, 1);\n\n // this.setting(settingName)(JSON.stringify(reasons));\n },\n })),\n ])),\n m('tr', m('td', {\n colspan: 9,\n }, Button.component({\n className: 'Button Button--block',\n onclick: () => {\n const client = app.store.createRecord('oauth-clients');\n const client_id = this.randomString(32);\n const client_secret = this.randomString(32);\n client.save({\n client_id: client_id,\n client_secret: client_secret,\n }).then(this.clients.push(client));\n\n // this.clients.push(Client.build({\n //\n // }));\n\n // this.setting(settingName)(JSON.stringify(reasons));\n },\n }, app.translator.trans(this.translationPrefix + 'add_button')))),\n ]),\n ]),\n ])\n }\n </div>\n );\n }\n\n randomString(len) {\n len = len || 32;\n let $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let maxPos = $chars.length;\n let pwd = '';\n for (let i = 0; i < len; i++) {\n //0~32的整数\n pwd += $chars.charAt(Math.floor(Math.random() * (maxPos + 1)));\n }\n return pwd;\n }\n\n saveClientInfo(index, key, value) {\n console.log(index, key, value);\n this.clients[index].save({\n [key]: value,\n });\n }\n}\n","import Page from 'flarum/common/components/Page';\n\nexport default class ScopesPage extends Page {\n view() {\n return (\n <div>\n <h2>Scopes Page</h2>\n </div>\n );\n }\n}\n","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport IndexPage from \"../pages/IndexPage\";\nimport ClientsPage from \"../pages/ClientsPage\";\nimport ScopesPage from \"../pages/ScopesPage\";\nexport default class SettingsPage extends ExtensionPage {\n content() {\n const page = m.route.param().page || 'index';\n\n return (\n <div className=\"ExtensionPage-settings OAuthCenter\">\n <div className={\"oauth-menu\"}>\n <div className={\"container\"}>\n {this.menuButtons(page)}\n </div>\n </div>\n\n <div className=\"container OAuthCenterPage-container\">\n {this.pageContent(page)}\n </div>\n </div>\n );\n }\n\n // Return button menus\n menuButtons(page) {\n return [\n Button.component({\n className: `Button ${page === 'index' ? 'item-selected' : ''}`,\n onclick: () => m.route.set(\n app.route('extension', {\n id: 'foskym-oauth-center'\n })\n ),\n icon: 'fas fa-home',\n }, app.translator.trans('foskym-oauth-center.admin.page.index')),\n Button.component({\n className: `Button ${page === 'clients' ? 'item-selected' : ''}`,\n onclick: () => m.route.set(\n app.route('extension', {\n id: 'foskym-oauth-center',\n page: 'clients'\n })\n ),\n icon: 'fas fa-network-wired',\n }, app.translator.trans('foskym-oauth-center.admin.page.clients')),\n Button.component({\n className: `Button ${page === 'scopes' ? 'item-selected' : ''}`,\n onclick: () => m.route.set(\n app.route('extension', {\n id: 'foskym-oauth-center',\n page: 'scopes'\n })\n ),\n icon: 'fas fa-user-lock',\n }, app.translator.trans('foskym-oauth-center.admin.page.scopes')),\n ];\n }\n\n\n pageContent(page) {\n if (page == 'clients') {\n return <ClientsPage />\n } else if (page == 'scopes') {\n return <ScopesPage />\n }\n return <IndexPage />\n }\n}\n","import app from 'flarum/admin/app';\nimport SettingsPage from './components/SettingsPage';\napp.initializers.add('foskym/flarum-oauth-center', () => {\n app.extensionData\n .for('foskym-oauth-center')\n .registerPage(SettingsPage);\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","Client","_Model","_this","_len","arguments","length","args","Array","_key","apply","concat","client_id","Model","client_secret","redirect_uri","grant_types","scope","user_id","client_name","client_icon","client_desc","client_home","Extend","add","IndexPage","_Page","_proto","oninit","vnode","this","saving","fields","values","settings","app","forEach","Stream","i","view","_this2","m","onsubmit","className","FieldSet","style","Switch","state","onchange","saveSingleSetting","loading","trans","bidi","placeholder","required","Button","type","setting","_this3","data","saveSettings","then","show","redraw","e","_this4","preventDefault","dismiss","successAlert","Page","ClientsPage","settingName","translationPrefix","clients","find","r","map","console","log","class","client","index","event","saveClientInfo","target","icon","onclick","splice","colspan","createRecord","randomString","save","push","len","pwd","charAt","Math","floor","random","_this$clients$index$s","ScopesPage","SettingsPage","_ExtensionPage","content","page","route","param","menuButtons","pageContent","set","id","ExtensionPage","registerPage"],"sourceRoot":""}