From d0f7ce1fac1801548e670eb1f83ff027afb558cd Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sun, 12 Nov 2023 10:35:09 +0000 Subject: [PATCH] Bundled output for commit 6582e1dc6b9625c1388034f124521a72e0e96b11 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js.map | 2 +- js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index d1f74be..87bb532 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAzC,SAASC,EAAgBhB,EAAGiB,GAMzC,OALAD,EAAkBf,OAAOiB,gBAAkB,SAAyBlB,EAAGiB,GAErE,OADAjB,EAAEmB,UAAYF,EACPjB,CACR,EAEMgB,EAAgBhB,EAAGiB,EAC3B,CCNc,SAASG,EAAeC,EAAUC,GAC/CD,EAASd,UAAYN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D,IAAAA,MAAAA,UAAoB,UAAY,uBAEtC2D,MAAK,SAACQ,GACLnE,IAAAA,MAAAA,YAAsBmE,GAEtB,EAAKP,gBACN,GACJ,E,EAKDrC,SAAA,WACE5S,KAAA,IAAWqR,IAAAA,MAAAA,aAAuB,mBAAoB,CACpDgE,WAAY,CACVlW,KAAM,GACNE,YAAa,GACbI,OAAQ,GACRC,KAAM,GACNF,UAAU,EACVM,QAAQ,EACRR,KAAM,KACNC,WAAY,KAGjB,E,EAODkV,WAAA,SAAWd,GACT,QAAIA,EAAMxU,MAKX,E,EAMDmV,eAAA,WACE,MAAO,CACLQ,IAAKzD,IAAAA,WAAAA,MAAqB,kCAC1BoE,MAAOpE,IAAAA,WAAAA,MAAqB,oCAC5BqE,QAASrE,IAAAA,WAAAA,MAAqB,sCAC9BsE,OAAQtE,IAAAA,WAAAA,MAAqB,qCAC7BuE,KAAMvE,IAAAA,WAAAA,MAAqB,uCAE9B,E,EAtXkBsB,CAAuBkD,KCV5CxE,IAAAA,aAAAA,IAAqB,kBAAkB,WACrCA,IAAAA,MAAAA,OAAAA,oBAAuCnS,EAEvCmS,IAAAA,cAAAA,IACO,kBACJyE,aAAanD,IACboD,mBACC,CACErW,KAAM,iBACNsW,MAAO3E,IAAAA,WAAAA,MAAqB,iDAC5B4E,WAAY,8BACZC,YAAY,GAEd,QAEDH,mBACC,CACErW,KAAM,iBACNsW,MAAO3E,IAAAA,WAAAA,MAAqB,iDAC5B4E,WAAY,+BAEd,SAEDF,mBACC,CACErW,KAAM,iBACNsW,MAAO3E,IAAAA,WAAAA,MAAqB,wDAC5B4E,WAAY,sCAEd,WAEL,G","sources":["webpack://@fof/masquerade/webpack/bootstrap","webpack://@fof/masquerade/webpack/runtime/compat get default export","webpack://@fof/masquerade/webpack/runtime/define property getters","webpack://@fof/masquerade/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/masquerade/webpack/runtime/make namespace object","webpack://@fof/masquerade/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/masquerade/./src/lib/models/Field.js","webpack://@fof/masquerade/./node_modules/html5sortable/dist/html5sortable.es.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['admin/utils/saveSettings']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/masquerade/./src/admin/components/SelectFieldOptionEditor.js","webpack://@fof/masquerade/./src/admin/components/MasqueradePage.js","webpack://@fof/masquerade/./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 || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\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 Field extends Model {\n name = Model.attribute('name');\n description = Model.attribute('description');\n type = Model.attribute('type');\n validation = Model.attribute('validation');\n required = Model.attribute('required');\n prefix = Model.attribute('prefix');\n icon = Model.attribute('icon');\n sort = Model.attribute('sort');\n deleted_at = Model.attribute('deleted_at', Model.transformDate);\n answer = Model.hasOne('answer');\n on_bio = Model.attribute('on_bio');\n\n apiEndpoint() {\n return '/masquerade/fields' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","/*\n * HTML5Sortable package\n * https://github.com/lukasoppermann/html5sortable\n *\n * Maintained by Lukas Oppermann \n *\n * Released under the MIT license.\n */\n/**\n * Get or set data on element\n * @param {HTMLElement} element\n * @param {string} key\n * @param {any} value\n * @return {*}\n */\nfunction addData(element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key];\n }\n else {\n element.h5s = element.h5s || {};\n element.h5s.data = element.h5s.data || {};\n element.h5s.data[key] = value;\n }\n}\n/**\n * Remove data from element\n * @param {HTMLElement} element\n */\nfunction removeData(element) {\n if (element.h5s) {\n delete element.h5s.data;\n }\n}\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {NodeList|HTMLCollection|Array} nodes\n * @param {String} selector\n * @returns {Array}\n */\nvar _filter = (function (nodes, selector) {\n if (!(nodes instanceof NodeList || nodes instanceof HTMLCollection || nodes instanceof Array)) {\n throw new Error('You must provide a nodeList/HTMLCollection/Array of elements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return Array.from(nodes);\n }\n return Array.from(nodes).filter(function (item) { return item.nodeType === 1 && item.matches(selector); });\n});\n\n/* eslint-env browser */\nvar stores = new Map();\n/**\n * Stores data & configurations per Sortable\n * @param {Object} config\n */\nvar Store = /** @class */ (function () {\n function Store() {\n this._config = new Map(); // eslint-disable-line no-undef\n this._placeholder = undefined; // eslint-disable-line no-undef\n this._data = new Map(); // eslint-disable-line no-undef\n }\n Object.defineProperty(Store.prototype, \"config\", {\n /**\n * get the configuration map of a class instance\n * @method config\n * @return {object}\n */\n get: function () {\n // transform Map to object\n var config = {};\n this._config.forEach(function (value, key) {\n config[key] = value;\n });\n // return object\n return config;\n },\n /**\n * set the configuration of a class instance\n * @method config\n * @param {object} config object of configurations\n */\n set: function (config) {\n if (typeof config !== 'object') {\n throw new Error('You must provide a valid configuration object to the config setter.');\n }\n // combine config with default\n var mergedConfig = Object.assign({}, config);\n // add config to map\n this._config = new Map(Object.entries(mergedConfig));\n },\n enumerable: false,\n configurable: true\n });\n /**\n * set individual configuration of a class instance\n * @method setConfig\n * @param key valid configuration key\n * @param value any value\n * @return void\n */\n Store.prototype.setConfig = function (key, value) {\n if (!this._config.has(key)) {\n throw new Error(\"Trying to set invalid configuration item: \" + key);\n }\n // set config\n this._config.set(key, value);\n };\n /**\n * get an individual configuration of a class instance\n * @method getConfig\n * @param key valid configuration key\n * @return any configuration value\n */\n Store.prototype.getConfig = function (key) {\n if (!this._config.has(key)) {\n throw new Error(\"Invalid configuration item requested: \" + key);\n }\n return this._config.get(key);\n };\n Object.defineProperty(Store.prototype, \"placeholder\", {\n /**\n * get the placeholder for a class instance\n * @method placeholder\n * @return {HTMLElement|null}\n */\n get: function () {\n return this._placeholder;\n },\n /**\n * set the placeholder for a class instance\n * @method placeholder\n * @param {HTMLElement} placeholder\n * @return {void}\n */\n set: function (placeholder) {\n if (!(placeholder instanceof HTMLElement) && placeholder !== null) {\n throw new Error('A placeholder must be an html element or null.');\n }\n this._placeholder = placeholder;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * set an data entry\n * @method setData\n * @param {string} key\n * @param {any} value\n * @return {void}\n */\n Store.prototype.setData = function (key, value) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n this._data.set(key, value);\n };\n /**\n * get an data entry\n * @method getData\n * @param {string} key an existing key\n * @return {any}\n */\n Store.prototype.getData = function (key) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n return this._data.get(key);\n };\n /**\n * delete an data entry\n * @method deleteData\n * @param {string} key an existing key\n * @return {boolean}\n */\n Store.prototype.deleteData = function (key) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n return this._data.delete(key);\n };\n return Store;\n}());\n/**\n * @param {HTMLElement} sortableElement\n * @returns {Class: Store}\n */\nvar store = (function (sortableElement) {\n // if sortableElement is wrong type\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('Please provide a sortable to the store function.');\n }\n // create new instance if not avilable\n if (!stores.has(sortableElement)) {\n stores.set(sortableElement, new Store());\n }\n // return instance\n return stores.get(sortableElement);\n});\n\n/**\n * @param {Array|HTMLElement} element\n * @param {Function} callback\n * @param {string} event\n */\nfunction addEventListener(element, eventName, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addEventListener(element[i], eventName, callback);\n }\n return;\n }\n element.addEventListener(eventName, callback);\n store(element).setData(\"event\" + eventName, callback);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} eventName\n */\nfunction removeEventListener(element, eventName) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeEventListener(element[i], eventName);\n }\n return;\n }\n element.removeEventListener(eventName, store(element).getData(\"event\" + eventName));\n store(element).deleteData(\"event\" + eventName);\n}\n\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction addAttribute(element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addAttribute(element[i], attribute, value);\n }\n return;\n }\n element.setAttribute(attribute, value);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n */\nfunction removeAttribute(element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeAttribute(element[i], attribute);\n }\n return;\n }\n element.removeAttribute(attribute);\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {Object}\n */\nvar _offset = (function (element) {\n if (!element.parentElement || element.getClientRects().length === 0) {\n throw new Error('target element must be part of the dom');\n }\n var rect = element.getClientRects()[0];\n return {\n left: rect.left + window.pageXOffset,\n right: rect.right + window.pageXOffset,\n top: rect.top + window.pageYOffset,\n bottom: rect.bottom + window.pageYOffset\n };\n});\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {Function} func to debounce\n * @param {number} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nvar _debounce = (function (func, wait) {\n if (wait === void 0) { wait = 0; }\n var timeout;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(void 0, args);\n }, wait);\n };\n});\n\n/* eslint-env browser */\n/**\n * Get position of the element relatively to its sibling elements\n * @param {HTMLElement} element\n * @returns {number}\n */\nvar _index = (function (element, elementList) {\n if (!(element instanceof HTMLElement) || !(elementList instanceof NodeList || elementList instanceof HTMLCollection || elementList instanceof Array)) {\n throw new Error('You must provide an element and a list of elements.');\n }\n return Array.from(elementList).indexOf(element);\n});\n\n/* eslint-env browser */\n/**\n * Test whether element is in DOM\n * @param {HTMLElement} element\n * @returns {boolean}\n */\nvar isInDom = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('Element is not a node element.');\n }\n return element.parentNode !== null;\n});\n\n/* eslint-env browser */\n/**\n * Insert node before or after target\n * @param {HTMLElement} referenceNode - reference element\n * @param {HTMLElement} newElement - element to be inserted\n * @param {String} position - insert before or after reference element\n */\nvar insertNode = function (referenceNode, newElement, position) {\n if (!(referenceNode instanceof HTMLElement) || !(referenceNode.parentElement instanceof HTMLElement)) {\n throw new Error('target and element must be a node');\n }\n referenceNode.parentElement.insertBefore(newElement, (position === 'before' ? referenceNode : referenceNode.nextElementSibling));\n};\n/**\n * Insert before target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertBefore = function (target, element) { return insertNode(target, element, 'before'); };\n/**\n * Insert after target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertAfter = function (target, element) { return insertNode(target, element, 'after'); };\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {HTMLElement} sortableContainer\n * @param {Function} customSerializer\n * @returns {Array}\n */\nvar _serialize = (function (sortableContainer, customItemSerializer, customContainerSerializer) {\n if (customItemSerializer === void 0) { customItemSerializer = function (serializedItem, sortableContainer) { return serializedItem; }; }\n if (customContainerSerializer === void 0) { customContainerSerializer = function (serializedContainer) { return serializedContainer; }; }\n // check for valid sortableContainer\n if (!(sortableContainer instanceof HTMLElement) || !sortableContainer.isSortable === true) {\n throw new Error('You need to provide a sortableContainer to be serialized.');\n }\n // check for valid serializers\n if (typeof customItemSerializer !== 'function' || typeof customContainerSerializer !== 'function') {\n throw new Error('You need to provide a valid serializer for items and the container.');\n }\n // get options\n var options = addData(sortableContainer, 'opts');\n var item = options.items;\n // serialize container\n var items = _filter(sortableContainer.children, item);\n var serializedItems = items.map(function (item) {\n return {\n parent: sortableContainer,\n node: item,\n html: item.outerHTML,\n index: _index(item, items)\n };\n });\n // serialize container\n var container = {\n node: sortableContainer,\n itemCount: serializedItems.length\n };\n return {\n container: customContainerSerializer(container),\n items: serializedItems.map(function (item) { return customItemSerializer(item, sortableContainer); })\n };\n});\n\n/* eslint-env browser */\n/**\n * create a placeholder element\n * @param {HTMLElement} sortableElement a single sortable\n * @param {string|undefined} placeholder a string representing an html element\n * @param {string} placeholderClasses a string representing the classes that should be added to the placeholder\n */\nvar _makePlaceholder = (function (sortableElement, placeholder, placeholderClass) {\n var _a;\n if (placeholderClass === void 0) { placeholderClass = 'sortable-placeholder'; }\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('You must provide a valid element as a sortable.');\n }\n // if placeholder is not an element\n if (!(placeholder instanceof HTMLElement) && placeholder !== undefined) {\n throw new Error('You must provide a valid element as a placeholder or set ot to undefined.');\n }\n // if no placeholder element is given\n if (placeholder === undefined) {\n if (['UL', 'OL'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('li');\n }\n else if (['TABLE', 'TBODY'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('tr');\n // set colspan to always all rows, otherwise the item can only be dropped in first column\n placeholder.innerHTML = '';\n }\n else {\n placeholder = document.createElement('div');\n }\n }\n // add classes to placeholder\n if (typeof placeholderClass === 'string') {\n (_a = placeholder.classList).add.apply(_a, placeholderClass.split(' '));\n }\n return placeholder;\n});\n\n/* eslint-env browser */\n/**\n * Get height of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementHeight = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // get only height if element has box-sizing: border-box specified\n if (style.getPropertyValue('box-sizing') === 'border-box') {\n return parseInt(style.getPropertyValue('height'), 10);\n }\n // pick applicable properties, convert to int and reduce by adding\n return ['height', 'padding-top', 'padding-bottom']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * Get width of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementWidth = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // pick applicable properties, convert to int and reduce by adding\n return ['width', 'padding-left', 'padding-right']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * get handle or return item\n * @param {Array} items\n * @param {string} selector\n */\nvar _getHandles = (function (items, selector) {\n if (!(items instanceof Array)) {\n throw new Error('You must provide a Array of HTMLElements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return items;\n }\n return items\n // remove items without handle from array\n .filter(function (item) {\n return item.querySelector(selector) instanceof HTMLElement ||\n (item.shadowRoot && item.shadowRoot.querySelector(selector) instanceof HTMLElement);\n })\n // replace item with handle in array\n .map(function (item) {\n return item.querySelector(selector) || (item.shadowRoot && item.shadowRoot.querySelector(selector));\n });\n});\n\n/**\n * @param {Event} event\n * @returns {HTMLElement}\n */\nvar getEventTarget = (function (event) {\n return (event.composedPath && event.composedPath()[0]) || event.target;\n});\n\n/* eslint-env browser */\n/**\n * defaultDragImage returns the current item as dragged image\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {object} elementOffset - an object with the offsets top, left, right & bottom\n * @param {Event} event - the original drag event object\n * @return {object} with element, posX and posY properties\n */\nvar defaultDragImage = function (draggedElement, elementOffset, event) {\n return {\n element: draggedElement,\n posX: event.pageX - elementOffset.left,\n posY: event.pageY - elementOffset.top\n };\n};\n/**\n * attaches an element as the drag image to an event\n * @param {Event} event - the original drag event object\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {Function} customDragImage - function to create a custom dragImage\n * @return void\n */\nvar setDragImage = (function (event, draggedElement, customDragImage) {\n // check if event is provided\n if (!(event instanceof Event)) {\n throw new Error('setDragImage requires a DragEvent as the first argument.');\n }\n // check if draggedElement is provided\n if (!(draggedElement instanceof HTMLElement)) {\n throw new Error('setDragImage requires the dragged element as the second argument.');\n }\n // set default function of none provided\n if (!customDragImage) {\n customDragImage = defaultDragImage;\n }\n // check if setDragImage method is available\n if (event.dataTransfer && event.dataTransfer.setDragImage) {\n // get the elements offset\n var elementOffset = _offset(draggedElement);\n // get the dragImage\n var dragImage = customDragImage(draggedElement, elementOffset, event);\n // check if custom function returns correct values\n if (!(dragImage.element instanceof HTMLElement) || typeof dragImage.posX !== 'number' || typeof dragImage.posY !== 'number') {\n throw new Error('The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].');\n }\n // needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'copyMove';\n // Firefox requires it to use the event target's id for the data\n event.dataTransfer.setData('text/plain', getEventTarget(event).id);\n // set the drag image on the event\n event.dataTransfer.setDragImage(dragImage.element, dragImage.posX, dragImage.posY);\n }\n});\n\n/**\n * Check if curList accepts items from destList\n * @param {sortable} destination the container an item is move to\n * @param {sortable} origin the container an item comes from\n */\nvar _listsConnected = (function (destination, origin) {\n // check if valid sortable\n if (destination.isSortable === true) {\n var acceptFrom = store(destination).getConfig('acceptFrom');\n // check if acceptFrom is valid\n if (acceptFrom !== null && acceptFrom !== false && typeof acceptFrom !== 'string') {\n throw new Error('HTML5Sortable: Wrong argument, \"acceptFrom\" must be \"null\", \"false\", or a valid selector string.');\n }\n if (acceptFrom !== null) {\n return acceptFrom !== false && acceptFrom.split(',').filter(function (sel) {\n return sel.length > 0 && origin.matches(sel);\n }).length > 0;\n }\n // drop in same list\n if (destination === origin) {\n return true;\n }\n // check if lists are connected with connectWith\n if (store(destination).getConfig('connectWith') !== undefined && store(destination).getConfig('connectWith') !== null) {\n return store(destination).getConfig('connectWith') === store(origin).getConfig('connectWith');\n }\n }\n return false;\n});\n\n/**\n * default configurations\n */\nvar defaultConfiguration = {\n items: null,\n // deprecated\n connectWith: null,\n // deprecated\n disableIEFix: null,\n acceptFrom: null,\n copy: false,\n placeholder: null,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n dropTargetContainerClass: false,\n debounce: 0,\n throttleTime: 100,\n maxItems: 0,\n itemSerializer: undefined,\n containerSerializer: undefined,\n customDragImage: null,\n orientation: 'vertical'\n};\n\n/**\n * make sure a function is only called once within the given amount of time\n * @param {Function} fn the function to throttle\n * @param {number} threshold time limit for throttling\n */\n// must use function to keep this context\nfunction _throttle (fn, threshold) {\n var _this = this;\n if (threshold === void 0) { threshold = 250; }\n // check function\n if (typeof fn !== 'function') {\n throw new Error('You must provide a function as the first argument for throttle.');\n }\n // check threshold\n if (typeof threshold !== 'number') {\n throw new Error('You must provide a number as the second argument for throttle.');\n }\n var lastEventTimestamp = null;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var now = Date.now();\n if (lastEventTimestamp === null || now - lastEventTimestamp >= threshold) {\n lastEventTimestamp = now;\n fn.apply(_this, args);\n }\n };\n}\n\n/* eslint-env browser */\n/**\n * enable or disable hoverClass on mouseenter/leave if container Items\n * @param {sortable} sortableContainer a valid sortableContainer\n * @param {boolean} enable enable or disable event\n */\n// export default (sortableContainer: sortable, enable: boolean) => {\nvar enableHoverClass = (function (sortableContainer, enable) {\n if (typeof store(sortableContainer).getConfig('hoverClass') === 'string') {\n var hoverClasses_1 = store(sortableContainer).getConfig('hoverClass').split(' ');\n // add class on hover\n if (enable === true) {\n addEventListener(sortableContainer, 'mousemove', _throttle(function (event) {\n // check of no mouse button was pressed when mousemove started == no drag\n if (event.buttons === 0) {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a, _b;\n if (item !== event.target) {\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n }\n else {\n (_b = item.classList).add.apply(_b, hoverClasses_1);\n }\n });\n }\n }, store(sortableContainer).getConfig('throttleTime')));\n // remove class on leave\n addEventListener(sortableContainer, 'mouseleave', function () {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a;\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n });\n });\n // remove events\n }\n else {\n removeEventListener(sortableContainer, 'mousemove');\n removeEventListener(sortableContainer, 'mouseleave');\n }\n }\n});\n\n/* eslint-env browser */\n/*\n * variables global to the plugin\n */\nvar dragging;\nvar draggingHeight;\nvar draggingWidth;\n/*\n * Keeps track of the initialy selected list, where 'dragstart' event was triggered\n * It allows us to move the data in between individual Sortable List instances\n */\n// Origin List - data from before any item was changed\nvar originContainer;\nvar originIndex;\nvar originElementIndex;\nvar originItemsBeforeUpdate;\n// Previous Sortable Container - we dispatch as sortenter event when a\n// dragged item enters a sortableContainer for the first time\nvar previousContainer;\n// Destination List - data from before any item was changed\nvar destinationItemsBeforeUpdate;\n/**\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n removeEventListener(items, 'dragstart');\n removeEventListener(items, 'dragend');\n removeEventListener(items, 'dragover');\n removeEventListener(items, 'dragenter');\n removeEventListener(items, 'drop');\n removeEventListener(items, 'mouseenter');\n removeEventListener(items, 'mouseleave');\n};\n// Remove container events\nvar _removeContainerEvents = function (originContainer, previousContainer) {\n if (originContainer) {\n removeEventListener(originContainer, 'dragleave');\n }\n if (previousContainer && (previousContainer !== originContainer)) {\n removeEventListener(previousContainer, 'dragleave');\n }\n};\n/**\n * _getDragging returns the current element to drag or\n * a copy of the element.\n * Is Copy Active for sortable\n * @param {HTMLElement} draggedItem - the item that the user drags\n * @param {HTMLElement} sortable a single sortable\n */\nvar _getDragging = function (draggedItem, sortable) {\n var ditem = draggedItem;\n if (store(sortable).getConfig('copy') === true) {\n ditem = draggedItem.cloneNode(true);\n addAttribute(ditem, 'aria-copied', 'true');\n draggedItem.parentElement.appendChild(ditem);\n ditem.style.display = 'none';\n ditem.oldDisplay = draggedItem.style.display;\n }\n return ditem;\n};\n/**\n * Remove data from sortable\n * @param {HTMLElement} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n removeData(sortable);\n removeAttribute(sortable, 'aria-dropeffect');\n};\n/**\n * Remove data from items\n * @param {Array|HTMLElement} items\n */\nvar _removeItemData = function (items) {\n removeAttribute(items, 'aria-grabbed');\n removeAttribute(items, 'aria-copied');\n removeAttribute(items, 'draggable');\n removeAttribute(items, 'role');\n};\n/**\n * find sortable from element. travels up parent element until found or null.\n * @param {HTMLElement} element a single sortable\n * @param {Event} event - the current event. We need to pass it to be able to\n * find Sortable whith shadowRoot (document fragment has no parent)\n */\nfunction findSortable(element, event) {\n if (event.composedPath) {\n return event.composedPath().find(function (el) { return el.isSortable; });\n }\n while (element.isSortable !== true) {\n element = element.parentElement;\n }\n return element;\n}\n/**\n * Dragging event is on the sortable element. finds the top child that\n * contains the element.\n * @param {HTMLElement} sortableElement a single sortable\n * @param {HTMLElement} element is that being dragged\n */\nfunction findDragElement(sortableElement, element) {\n var options = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, options.items);\n var itemlist = items.filter(function (ele) {\n return ele.contains(element) || (ele.shadowRoot && ele.shadowRoot.contains(element));\n });\n return itemlist.length > 0 ? itemlist[0] : element;\n}\n/**\n * Destroy the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts') || {};\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n // remove event handlers & data from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'dragstart');\n removeEventListener(sortableElement, 'dragend');\n removeEventListener(sortableElement, 'drop');\n // remove event data from sortable\n _removeSortableData(sortableElement);\n // remove event handlers & data from items\n removeEventListener(handles, 'mousedown');\n _removeItemEvents(items);\n _removeItemData(items);\n _removeContainerEvents(originContainer, previousContainer);\n // clear sortable flag\n sortableElement.isSortable = false;\n};\n/**\n * Enable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'move');\n addData(sortableElement, '_disabled', 'false');\n addAttribute(handles, 'draggable', 'true');\n // @todo: remove this fix\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n if (opts.disableIEFix === false) {\n var spanEl = (document || window.document).createElement('span');\n if (typeof spanEl.dragDrop === 'function') {\n addEventListener(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop();\n }\n else {\n var parent = this.parentElement;\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement;\n }\n parent.dragDrop();\n }\n });\n }\n }\n};\n/**\n * Disable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'none');\n addData(sortableElement, '_disabled', 'true');\n addAttribute(handles, 'draggable', 'false');\n removeEventListener(handles, 'mousedown');\n};\n/**\n * Reload the sortable\n * @param {HTMLElement} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addData(sortableElement, '_disabled', 'false');\n // remove event handlers from items\n _removeItemEvents(items);\n _removeContainerEvents(originContainer, previousContainer);\n removeEventListener(handles, 'mousedown');\n // remove event handlers from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'drop');\n};\n/**\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nfunction sortable(sortableElements, options) {\n // get method string to see if a method is called\n var method = String(options);\n options = options || {};\n // check if the user provided a selector instead of an element\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements);\n }\n // if the user provided an element, return it in an array to keep the return value consistant\n if (sortableElements instanceof HTMLElement) {\n sortableElements = [sortableElements];\n }\n sortableElements = Array.prototype.slice.call(sortableElements);\n if (/serialize/.test(method)) {\n return sortableElements.map(function (sortableContainer) {\n var opts = addData(sortableContainer, 'opts');\n return _serialize(sortableContainer, opts.itemSerializer, opts.containerSerializer);\n });\n }\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n return sortable[method](sortableElement);\n }\n // log deprecation\n ['connectWith', 'disableIEFix'].forEach(function (configKey) {\n if (Object.prototype.hasOwnProperty.call(options, configKey) && options[configKey] !== null) {\n console.warn(\"HTML5Sortable: You are using the deprecated configuration \\\"\" + configKey + \"\\\". This will be removed in an upcoming version, make sure to migrate to the new options when updating.\");\n }\n });\n // merge options with default options\n options = Object.assign({}, defaultConfiguration, store(sortableElement).config, options);\n // init data store for sortable\n store(sortableElement).config = options;\n // set options on sortable\n addData(sortableElement, 'opts', options);\n // property to define as sortable\n sortableElement.isSortable = true;\n // reset sortable\n _reloadSortable(sortableElement);\n // initialize\n var listItems = _filter(sortableElement.children, options.items);\n // create element if user defined a placeholder element as a string\n var customPlaceholder;\n if (options.placeholder !== null && options.placeholder !== undefined) {\n var tempContainer = document.createElement(sortableElement.tagName);\n if (options.placeholder instanceof HTMLElement) {\n tempContainer.appendChild(options.placeholder);\n }\n else {\n tempContainer.innerHTML = options.placeholder;\n }\n customPlaceholder = tempContainer.children[0];\n }\n // add placeholder\n store(sortableElement).placeholder = _makePlaceholder(sortableElement, customPlaceholder, options.placeholderClass);\n addData(sortableElement, 'items', options.items);\n if (options.acceptFrom) {\n addData(sortableElement, 'acceptFrom', options.acceptFrom);\n }\n else if (options.connectWith) {\n addData(sortableElement, 'connectWith', options.connectWith);\n }\n _enableSortable(sortableElement);\n addAttribute(listItems, 'role', 'option');\n addAttribute(listItems, 'aria-grabbed', 'false');\n // enable hover class\n enableHoverClass(sortableElement, true);\n /*\n Handle drag events on draggable items\n Handle is set at the sortableElement level as it will bubble up\n from the item\n */\n addEventListener(sortableElement, 'dragstart', function (e) {\n // ignore dragstart events\n var target = getEventTarget(e);\n if (target.isSortable === true) {\n return;\n }\n e.stopImmediatePropagation();\n if ((options.handle && !target.matches(options.handle)) || target.getAttribute('draggable') === 'false') {\n return;\n }\n var sortableContainer = findSortable(target, e);\n var dragItem = findDragElement(sortableContainer, target);\n // grab values\n originItemsBeforeUpdate = _filter(sortableContainer.children, options.items);\n originIndex = originItemsBeforeUpdate.indexOf(dragItem);\n originElementIndex = _index(dragItem, sortableContainer.children);\n originContainer = sortableContainer;\n // add transparent clone or other ghost to cursor\n setDragImage(e, dragItem, options.customDragImage);\n // cache selsection & add attr for dragging\n draggingHeight = _getElementHeight(dragItem);\n draggingWidth = _getElementWidth(dragItem);\n dragItem.classList.add(options.draggingClass);\n dragging = _getDragging(dragItem, sortableContainer);\n addAttribute(dragging, 'aria-grabbed', 'true');\n // dispatch sortstart event on each element in group\n sortableContainer.dispatchEvent(new CustomEvent('sortstart', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n });\n /*\n We are capturing targetSortable before modifications with 'dragenter' event\n */\n addEventListener(sortableElement, 'dragenter', function (e) {\n var target = getEventTarget(e);\n var sortableContainer = findSortable(target, e);\n if (sortableContainer && sortableContainer !== previousContainer) {\n destinationItemsBeforeUpdate = _filter(sortableContainer.children, addData(sortableContainer, 'items'))\n .filter(function (item) { return item !== store(sortableElement).placeholder; });\n if (options.dropTargetContainerClass) {\n sortableContainer.classList.add(options.dropTargetContainerClass);\n }\n sortableContainer.dispatchEvent(new CustomEvent('sortenter', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n destination: {\n container: sortableContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate\n },\n item: dragging,\n originalTarget: target\n }\n }));\n addEventListener(sortableContainer, 'dragleave', function (e) {\n // TODO: rename outTarget to be more self-explanatory\n // e.fromElement for very old browsers, similar to relatedTarget\n var outTarget = e.relatedTarget || e.fromElement;\n if (!e.currentTarget.contains(outTarget)) {\n if (options.dropTargetContainerClass) {\n sortableContainer.classList.remove(options.dropTargetContainerClass);\n }\n sortableContainer.dispatchEvent(new CustomEvent('sortleave', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: sortableContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n }\n });\n }\n previousContainer = sortableContainer;\n });\n /*\n * Dragend Event - https://developer.mozilla.org/en-US/docs/Web/Events/dragend\n * Fires each time dragEvent end, or ESC pressed\n * We are using it to clean up any draggable elements and placeholders\n */\n addEventListener(sortableElement, 'dragend', function (e) {\n if (!dragging) {\n return;\n }\n dragging.classList.remove(options.draggingClass);\n addAttribute(dragging, 'aria-grabbed', 'false');\n if (dragging.getAttribute('aria-copied') === 'true' && addData(dragging, 'dropped') !== 'true') {\n dragging.remove();\n }\n dragging.style.display = dragging.oldDisplay;\n delete dragging.oldDisplay;\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) { return data.placeholder; })\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n .filter(isInDom)[0];\n if (visiblePlaceholder) {\n visiblePlaceholder.remove();\n }\n // dispatch sortstart event on each element in group\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n previousContainer = null;\n dragging = null;\n draggingHeight = null;\n draggingWidth = null;\n });\n /*\n * Drop Event - https://developer.mozilla.org/en-US/docs/Web/Events/drop\n * Fires when valid drop target area is hit\n */\n addEventListener(sortableElement, 'drop', function (e) {\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n addData(dragging, 'dropped', 'true');\n // get the one placeholder that is currently visible\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) {\n return data.placeholder;\n })\n // filter only HTMLElements\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n // filter only elements in DOM\n .filter(isInDom)[0];\n // attach element after placeholder\n insertAfter(visiblePlaceholder, dragging);\n // remove placeholder from dom\n visiblePlaceholder.remove();\n /*\n * Fires Custom Event - 'sortstop'\n */\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n var placeholder = store(sortableElement).placeholder;\n var originItems = _filter(originContainer.children, options.items)\n .filter(function (item) { return item !== placeholder; });\n var destinationContainer = this.isSortable === true ? this : this.parentElement;\n var destinationItems = _filter(destinationContainer.children, addData(destinationContainer, 'items'))\n .filter(function (item) { return item !== placeholder; });\n var destinationElementIndex = _index(dragging, Array.from(dragging.parentElement.children)\n .filter(function (item) { return item !== placeholder; }));\n var destinationIndex = _index(dragging, destinationItems);\n if (options.dropTargetContainerClass) {\n destinationContainer.classList.remove(options.dropTargetContainerClass);\n }\n /*\n * When a list item changed container lists or index within a list\n * Fires Custom Event - 'sortupdate'\n */\n if (originElementIndex !== destinationElementIndex || originContainer !== destinationContainer) {\n sortableElement.dispatchEvent(new CustomEvent('sortupdate', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer,\n itemsBeforeUpdate: originItemsBeforeUpdate,\n items: originItems\n },\n destination: {\n index: destinationIndex,\n elementIndex: destinationElementIndex,\n container: destinationContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate,\n items: destinationItems\n },\n item: dragging\n }\n }));\n }\n });\n var debouncedDragOverEnter = _debounce(function (sortableElement, element, pageX, pageY) {\n if (!dragging) {\n return;\n }\n // set placeholder height if forcePlaceholderSize option is set\n if (options.forcePlaceholderSize) {\n store(sortableElement).placeholder.style.height = draggingHeight + 'px';\n store(sortableElement).placeholder.style.width = draggingWidth + 'px';\n }\n // if element the draggedItem is dragged onto is within the array of all elements in list\n // (not only items, but also disabled, etc.)\n if (Array.from(sortableElement.children).indexOf(element) > -1) {\n var thisHeight = _getElementHeight(element);\n var thisWidth = _getElementWidth(element);\n var placeholderIndex = _index(store(sortableElement).placeholder, element.parentElement.children);\n var thisIndex = _index(element, element.parentElement.children);\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight || thisWidth > draggingWidth) {\n // Dead zone?\n var deadZoneVertical = thisHeight - draggingHeight;\n var deadZoneHorizontal = thisWidth - draggingWidth;\n var offsetTop = _offset(element).top;\n var offsetLeft = _offset(element).left;\n if (placeholderIndex < thisIndex &&\n ((options.orientation === 'vertical' && pageY < offsetTop) ||\n (options.orientation === 'horizontal' && pageX < offsetLeft))) {\n return;\n }\n if (placeholderIndex > thisIndex &&\n ((options.orientation === 'vertical' && pageY > offsetTop + thisHeight - deadZoneVertical) ||\n (options.orientation === 'horizontal' && pageX > offsetLeft + thisWidth - deadZoneHorizontal))) {\n return;\n }\n }\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display;\n }\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none';\n }\n // To avoid flicker, determine where to position the placeholder\n // based on where the mouse pointer is relative to the elements\n // vertical center.\n var placeAfter = false;\n try {\n var elementMiddleVertical = _offset(element).top + element.offsetHeight / 2;\n var elementMiddleHorizontal = _offset(element).left + element.offsetWidth / 2;\n placeAfter = (options.orientation === 'vertical' && (pageY >= elementMiddleVertical)) ||\n (options.orientation === 'horizontal' && (pageX >= elementMiddleHorizontal));\n }\n catch (e) {\n placeAfter = placeholderIndex < thisIndex;\n }\n if (placeAfter) {\n insertAfter(element, store(sortableElement).placeholder);\n }\n else {\n insertBefore(element, store(sortableElement).placeholder);\n }\n // get placeholders from all stores & remove all but current one\n Array.from(stores.values())\n // remove empty values\n .filter(function (data) { return data.placeholder !== undefined; })\n // foreach placeholder in array if outside of current sorableContainer -> remove from DOM\n .forEach(function (data) {\n if (data.placeholder !== store(sortableElement).placeholder) {\n data.placeholder.remove();\n }\n });\n }\n else {\n // get all placeholders from store\n var placeholders = Array.from(stores.values())\n .filter(function (data) { return data.placeholder !== undefined; })\n .map(function (data) {\n return data.placeholder;\n });\n // check if element is not in placeholders\n if (placeholders.indexOf(element) === -1 && sortableElement === element && !_filter(element.children, options.items).length) {\n placeholders.forEach(function (element) { return element.remove(); });\n element.appendChild(store(sortableElement).placeholder);\n }\n }\n }, options.debounce);\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n var element = e.target;\n var sortableElement = element.isSortable === true ? element : findSortable(element, e);\n element = findDragElement(sortableElement, element);\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || addData(sortableElement, '_disabled') === 'true') {\n return;\n }\n var options = addData(sortableElement, 'opts');\n if (parseInt(options.maxItems) && _filter(sortableElement.children, addData(sortableElement, 'items')).length >= parseInt(options.maxItems) && dragging.parentElement !== sortableElement) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = store(sortableElement).getConfig('copy') === true ? 'copy' : 'move';\n debouncedDragOverEnter(sortableElement, element, e.pageX, e.pageY);\n };\n addEventListener(listItems.concat(sortableElement), 'dragover', onDragOverEnter);\n addEventListener(listItems.concat(sortableElement), 'dragenter', onDragOverEnter);\n });\n return sortableElements;\n}\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement);\n};\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement);\n};\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement);\n};\n/* START.TESTS_ONLY */\nsortable.__testing = {\n // add internal methods here for testing purposes\n _data: addData,\n _removeItemEvents: _removeItemEvents,\n _removeItemData: _removeItemData,\n _removeSortableData: _removeSortableData,\n _removeContainerEvents: _removeContainerEvents\n};\n\nexport default sortable;\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\n\n/* global m */\n\nexport default class SelectFieldOptionEditor extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.newOption = '';\n }\n\n view() {\n return m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.options')),\n m(\n 'table',\n m(\n 'tbody',\n this.options().map((option, optionIndex) =>\n m('tr', [\n m(\n 'td',\n m('input[type=text].FormControl', {\n oninput: (event) => {\n this.updateOption(optionIndex, event.target.value);\n },\n value: option,\n })\n ),\n m(\n 'td',\n m(\n 'button.Button',\n {\n onclick: () => {\n this.moveOption(optionIndex, -1);\n },\n },\n icon('fas fa-chevron-up')\n )\n ),\n m(\n 'td',\n m(\n 'button.Button',\n {\n onclick: () => {\n this.moveOption(optionIndex, 1);\n },\n },\n icon('fas fa-chevron-down')\n )\n ),\n m(\n 'td',\n m(\n 'button.Button.Button--danger',\n {\n onclick: () => {\n this.deleteOption(optionIndex);\n },\n },\n icon('fas fa-times')\n )\n ),\n ])\n )\n )\n ),\n m('.helpText', app.translator.trans('fof-masquerade.admin.fields.option-comma-warning')),\n m(\n 'table',\n m('tbody'),\n m('tr', [\n m(\n 'td',\n m('input[type=text].FormControl', {\n onchange: (event) => {\n this.newOption = event.target.value;\n },\n value: this.newOption,\n placeholder: app.translator.trans('fof-masquerade.admin.fields.option-new'),\n })\n ),\n m(\n 'td',\n m(\n 'button.Button.Button--primary',\n {\n onclick: () => {\n this.addOption();\n },\n },\n icon('fas fa-plus')\n )\n ),\n ])\n ),\n ]);\n }\n\n updateRules(options) {\n // We ignore other existing rules, they would probably be leftovers from another field type when changing types\n this.attrs.onchange('in:' + options.join(','));\n }\n\n options() {\n const rules = this.attrs.value.split('|');\n\n let options = [];\n\n rules.forEach((rule) => {\n const parts = rule.split(':', 2);\n\n if (parts[0] === 'in') {\n options = parts[1].split(',');\n }\n });\n\n return options;\n }\n\n updateOption(index, value) {\n let options = this.options();\n\n options[index] = value;\n\n this.updateRules(options);\n }\n\n moveOption(index, moveIndex) {\n let options = this.options();\n\n const newIndex = index + moveIndex;\n\n if (newIndex < 0 || newIndex > options.length - 1) {\n return;\n }\n\n const move = options.splice(index, 1);\n\n options.splice(newIndex, 0, move[0]);\n\n this.updateRules(options);\n }\n\n deleteOption(index) {\n let options = this.options();\n\n options.splice(index, 1);\n\n this.updateRules(options);\n }\n\n addOption() {\n if (this.newOption === '') {\n return;\n }\n\n let options = this.options();\n\n options.push(this.newOption);\n\n this.newOption = '';\n\n this.updateRules(options);\n }\n}\n","import sortable from 'html5sortable/dist/html5sortable.es.js';\n\nimport app from 'flarum/admin/app';\nimport icon from 'flarum/common/helpers/icon';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Select from 'flarum/common/components/Select';\nimport Switch from 'flarum/common/components/Switch';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport SelectFieldOptionEditor from './SelectFieldOptionEditor';\n\n/* global m, $ */\n\nexport default class MasqueradePage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.resetNew();\n this.loading = false;\n this.existing = [];\n this.loadExisting();\n this.enforceProfileCompletion = app.data.settings['masquerade.force-profile-completion'] === '1';\n }\n\n config() {\n sortable(this.element.querySelector('.js-sortable-fields'), {\n handle: 'legend',\n })[0].addEventListener('sortupdate', () => {\n const sorting = this.$('.js-sortable-fields > .Field')\n .map(function () {\n return $(this).data('id');\n })\n .get();\n\n this.updateSort(sorting);\n });\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.config();\n }\n\n onupdate() {\n this.config();\n }\n\n content() {\n return m(\n '.ExtensionPage-settings.ProfileConfigurePane',\n m('.container', [\n m('h2', app.translator.trans('fof-masquerade.admin.general-options')),\n m(\n '.Form-group',\n Switch.component(\n {\n state: this.enforceProfileCompletion,\n onchange: (value) => {\n const saveValue = value ? '1' : '0';\n saveSettings({\n 'masquerade.force-profile-completion': saveValue,\n });\n this.enforceProfileCompletion = saveValue;\n },\n },\n app.translator.trans('fof-masquerade.admin.fields.force-user-to-completion')\n )\n ),\n m('h2', app.translator.trans('fof-masquerade.admin.fields.title')),\n m(\n 'form.js-sortable-fields',\n this.existing.map((field) => {\n // Build array of fields to show.\n return this.addField(field);\n })\n ),\n this.addField(this.new),\n ])\n );\n }\n\n /**\n * Creates a field in the DOM.\n *\n * @param field\n * @returns {*}\n */\n addField(field) {\n let exists = field.id();\n\n return m(\n 'fieldset.Field',\n {\n 'data-id': field.id(),\n key: field.id(),\n },\n [\n m('legend', [\n exists\n ? [\n Button.component({\n className: 'Button Button--icon Button--danger',\n icon: 'fas fa-trash',\n onclick: this.deleteField.bind(this, field),\n }),\n ' ',\n ]\n : null,\n m(\n 'span.Field-toggle',\n {\n onclick: (e) => this.toggleField(e),\n },\n [\n app.translator.trans('fof-masquerade.admin.fields.' + (exists ? 'edit' : 'add'), {\n field: field.name(),\n }),\n ' ',\n icon('fas fa-caret-down'),\n ]\n ),\n ]),\n m('.Field-body', [\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.name')),\n m('input.FormControl', {\n value: field.name(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'name', field)),\n }),\n m('span.helpText', app.translator.trans('fof-masquerade.admin.fields.name-help')),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.description')),\n m('input.FormControl', {\n value: field.description(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'description', field)),\n }),\n m('span.helpText', app.translator.trans('fof-masquerade.admin.fields.description-help')),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.icon')),\n m('input.FormControl', {\n value: field.icon(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'icon', field)),\n }),\n m(\n 'span.helpText',\n app.translator.trans('fof-masquerade.admin.fields.icon-help', {\n a: ,\n })\n ),\n ]),\n m(\n '.Form-group',\n Switch.component(\n {\n state: field.on_bio(),\n onchange: this.updateExistingFieldInput.bind(this, 'on_bio', field),\n },\n app.translator.trans('fof-masquerade.admin.fields.on_bio')\n )\n ),\n m(\n '.Form-group',\n Switch.component(\n {\n state: field.required(),\n onchange: this.updateExistingFieldInput.bind(this, 'required', field),\n },\n app.translator.trans('fof-masquerade.admin.fields.required')\n )\n ),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.type')),\n Select.component({\n onchange: (value) => {\n if (value === 'null') {\n value = null;\n }\n\n this.updateExistingFieldInput('type', field, value);\n },\n options: this.availableTypes(),\n value: field.type(),\n }),\n ]),\n field.type() === 'select'\n ? SelectFieldOptionEditor.component({\n onchange: (value) => {\n this.updateExistingFieldInput('validation', field, value);\n },\n value: field.validation(),\n })\n : null,\n field.type() === null\n ? m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.validation')),\n m('input.FormControl', {\n value: field.validation(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'validation', field)),\n }),\n m(\n 'span.helpText',\n app.translator.trans('fof-masquerade.admin.fields.validation-help', {\n a: ,\n })\n ),\n ])\n : null,\n m(\n '.Form-group',\n m('.ButtonGroup', [\n Button.component(\n {\n className: 'Button Button--primary',\n loading: this.loading,\n disabled: !this.readyToAdd(field),\n onclick: exists ? this.updateExistingField.bind(this, field) : this.submitAddField.bind(this),\n },\n app.translator.trans('fof-masquerade.admin.buttons.' + (exists ? 'edit' : 'add') + '-field')\n ),\n exists\n ? Button.component(\n {\n className: 'Button Button--danger',\n loading: this.loading,\n onclick: this.deleteField.bind(this, field),\n },\n app.translator.trans('fof-masquerade.admin.buttons.delete-field')\n )\n : null,\n ])\n ),\n ]),\n ]\n );\n }\n\n updateExistingFieldInput(what, field, value) {\n field.pushAttributes({\n [what]: value,\n });\n }\n\n /**\n * Sorts the fields.\n *\n * @param {Array} sorting\n */\n updateSort(sorting) {\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/masquerade/fields/order',\n body: {\n sort: sorting,\n },\n })\n .then(this.requestSuccess.bind(this));\n }\n\n /**\n * Opens and closes field configuration sets.\n *\n * @param e\n */\n toggleField(e) {\n $(e.target).parents('.Field').toggleClass('active');\n }\n\n /**\n * Deletes a field configuration set.\n *\n * @param field\n */\n deleteField(field) {\n field.delete().then(this.requestSuccess.bind(this));\n }\n\n /**\n * Saves the settings to the database and redraw the page\n *\n * @param e\n */\n submitAddField(e) {\n e.preventDefault();\n\n this.new\n .save(this.new.data.attributes)\n .then(this.requestSuccess.bind(this))\n .then(() => {\n this.resetNew();\n });\n\n m.redraw();\n }\n\n /**\n * Updates the value of one field.\n *\n * @param field\n */\n updateExistingField(field) {\n if (!field.id()) return;\n\n field.save(field.data.attributes).then(this.requestSuccess.bind(this));\n }\n\n /**\n * Parses result to update DOM.\n */\n requestSuccess() {\n this.existing = app.store.all('masquerade-field');\n\n // Update order in case the store order doesn't reflect the true ordering\n this.existing.sort((a, b) => {\n if (a.sort() < b.sort()) return -1;\n if (a.sort() > b.sort()) return 1;\n return 0;\n });\n\n this.loading = false;\n m.redraw();\n }\n\n /**\n * Retrieves list of fields.\n */\n loadExisting() {\n this.loading = true;\n\n return app\n .request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/masquerade/fields',\n })\n .then((result) => {\n app.store.pushPayload(result);\n\n this.requestSuccess();\n });\n }\n\n /**\n * Resets the new field.\n */\n resetNew() {\n this.new = app.store.createRecord('masquerade-field', {\n attributes: {\n name: '',\n description: '',\n prefix: '',\n icon: '',\n required: false,\n on_bio: false,\n type: null,\n validation: '',\n },\n });\n }\n\n /**\n * Checks whether creation field is completed.\n *\n * @returns boolean\n */\n readyToAdd(field) {\n if (field.name()) {\n return true;\n }\n\n return false;\n }\n\n /**\n * List of field types availables\n * @returns {Array}\n */\n availableTypes() {\n return {\n url: app.translator.trans('fof-masquerade.admin.types.url'),\n email: app.translator.trans('fof-masquerade.admin.types.email'),\n boolean: app.translator.trans('fof-masquerade.admin.types.boolean'),\n select: app.translator.trans('fof-masquerade.admin.types.select'),\n null: app.translator.trans('fof-masquerade.admin.types.advanced'),\n };\n }\n}\n","import app from 'flarum/admin/app';\nimport Field from './../lib/models/Field';\nimport MasqueradePage from './components/MasqueradePage';\n\napp.initializers.add('fof-masquerade', () => {\n app.store.models['masquerade-field'] = Field;\n\n app.extensionData\n .for('fof-masquerade')\n .registerPage(MasqueradePage)\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.view-profile'),\n permission: 'fof.masquerade.view-profile',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.have-profile'),\n permission: 'fof.masquerade.have-profile',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.edit-others-profile'),\n permission: 'fof.masquerade.edit-others-profile',\n },\n 'moderate'\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","__proto__","_inheritsLoose","subClass","superClass","create","constructor","Field","name","Model","description","type","validation","required","prefix","icon","sort","deleted_at","answer","on_bio","apiEndpoint","this","exists","data","id","addData","element","undefined","h5s","_filter","nodes","selector","NodeList","HTMLCollection","Array","Error","from","filter","item","nodeType","matches","stores","Map","Store","_config","_placeholder","_data","config","forEach","set","mergedConfig","assign","entries","configurable","setConfig","has","getConfig","placeholder","HTMLElement","setData","getData","deleteData","store","sortableElement","addEventListener","eventName","callback","i","length","removeEventListener","addAttribute","attribute","setAttribute","removeAttribute","dragging","draggingHeight","draggingWidth","originContainer","originIndex","originElementIndex","originItemsBeforeUpdate","previousContainer","destinationItemsBeforeUpdate","_offset","parentElement","getClientRects","rect","left","window","pageXOffset","right","top","pageYOffset","bottom","_index","elementList","indexOf","isInDom","parentNode","insertNode","referenceNode","newElement","position","insertBefore","nextElementSibling","insertAfter","target","_getElementHeight","style","getComputedStyle","getPropertyValue","parseInt","map","int","isNaN","reduce","sum","_getElementWidth","_getHandles","items","querySelector","shadowRoot","getEventTarget","event","composedPath","defaultDragImage","draggedElement","elementOffset","posX","pageX","posY","pageY","_listsConnected","destination","origin","isSortable","acceptFrom","split","sel","defaultConfiguration","connectWith","disableIEFix","copy","placeholderClass","draggingClass","hoverClass","dropTargetContainerClass","debounce","throttleTime","maxItems","itemSerializer","containerSerializer","customDragImage","orientation","_removeItemEvents","_removeContainerEvents","_removeSortableData","sortable","_removeItemData","findSortable","find","el","findDragElement","options","itemlist","children","ele","contains","_enableSortable","opts","handles","handle","document","createElement","dragDrop","parent","sortableElements","method","String","querySelectorAll","slice","test","sortableContainer","customItemSerializer","customContainerSerializer","serializedItem","serializedContainer","serializedItems","node","html","outerHTML","index","container","itemCount","_serialize","configKey","console","warn","_reloadSortable","customPlaceholder","listItems","tempContainer","tagName","appendChild","innerHTML","_a","includes","classList","add","apply","_makePlaceholder","enable","hoverClasses_1","fn","threshold","_this","lastEventTimestamp","args","_i","arguments","now","Date","_throttle","buttons","_b","remove","enableHoverClass","e","stopImmediatePropagation","getAttribute","dragItem","Event","dataTransfer","setDragImage","dragImage","effectAllowed","draggedItem","ditem","cloneNode","display","oldDisplay","_getDragging","dispatchEvent","CustomEvent","detail","elementIndex","originalTarget","itemsBeforeUpdate","outTarget","relatedTarget","fromElement","currentTarget","visiblePlaceholder","values","preventDefault","stopPropagation","originItems","destinationContainer","destinationItems","destinationElementIndex","destinationIndex","func","wait","timeout","debouncedDragOverEnter","forcePlaceholderSize","height","width","thisHeight","thisWidth","placeholderIndex","thisIndex","deadZoneVertical","deadZoneHorizontal","offsetTop","offsetLeft","placeAfter","elementMiddleVertical","offsetHeight","elementMiddleHorizontal","offsetWidth","placeholders","clearTimeout","setTimeout","onDragOverEnter","dropEffect","concat","destroy","_destroySortable","disable","_disableSortable","__testing","SelectFieldOptionEditor","oninit","vnode","newOption","view","m","app","option","optionIndex","oninput","updateOption","onclick","moveOption","deleteOption","onchange","addOption","updateRules","attrs","join","rules","rule","parts","moveIndex","newIndex","move","splice","push","Component","MasqueradePage","resetNew","loading","existing","loadExisting","enforceProfileCompletion","sorting","$","updateSort","oncreate","onupdate","content","Switch","state","saveValue","saveSettings","field","addField","Button","className","deleteField","bind","toggleField","withAttr","updateExistingFieldInput","href","Select","availableTypes","component","disabled","readyToAdd","updateExistingField","submitAddField","what","pushAttributes","url","body","then","requestSuccess","parents","toggleClass","save","attributes","redraw","b","result","email","boolean","select","null","ExtensionPage","registerPage","registerPermission","label","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,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E,EAGAkC,aAAA,WAAe,IAAA+C,EAAA,KAGb,OAFA3V,KAAK0S,SAAU,EAER1B,IAAAA,QACI,CACPtH,OAAQ,MACRqL,IAAK/D,IAAAA,MAAUhO,UAAU,UAAY,uBAEtCiS,MAAK,SAACW,GACL5E,IAAAA,MAAU6E,YAAYD,GAEtBD,EAAKT,gBACP,GACJ,EAEAxE,EAGA+B,SAAA,WACEzS,KAAI,IAAOgR,IAAAA,MAAU8E,aAAa,mBAAoB,CACpDP,WAAY,CACVpW,KAAM,GACNE,YAAa,GACbI,OAAQ,GACRC,KAAM,GACNF,UAAU,EACVM,QAAQ,EACRR,KAAM,KACNC,WAAY,KAGlB,EAEAmR,EAKA+D,WAAA,SAAWf,GACT,QAAIA,EAAMvU,MAKZ,EAEAuR,EAIA4D,eAAA,WACE,MAAO,CACLS,IAAK/D,IAAAA,WAAeC,MAAM,kCAC1B8E,MAAO/E,IAAAA,WAAeC,MAAM,oCAC5B+E,QAAShF,IAAAA,WAAeC,MAAM,sCAC9BgF,OAAQjF,IAAAA,WAAeC,MAAM,qCAC7BiF,KAAMlF,IAAAA,WAAeC,MAAM,uCAE/B,EAACsB,CAAA,CAtXgC,CAAS4D,KCV5CnF,IAAAA,aAAiBvF,IAAI,kBAAkB,WACrCuF,IAAAA,MAAUoF,OAAO,oBAAsB5X,EAEvCwS,IAAAA,cAAiB,IACV,kBACJqF,aAAa9D,IACb+D,mBACC,CACE5W,KAAM,iBACN6W,MAAOvF,IAAAA,WAAeC,MAAM,iDAC5BuF,WAAY,8BACZC,YAAY,GAEd,QAEDH,mBACC,CACE5W,KAAM,iBACN6W,MAAOvF,IAAAA,WAAeC,MAAM,iDAC5BuF,WAAY,+BAEd,SAEDF,mBACC,CACE5W,KAAM,iBACN6W,MAAOvF,IAAAA,WAAeC,MAAM,wDAC5BuF,WAAY,sCAEd,WAEN,G","sources":["webpack://@fof/masquerade/webpack/bootstrap","webpack://@fof/masquerade/webpack/runtime/compat get default export","webpack://@fof/masquerade/webpack/runtime/define property getters","webpack://@fof/masquerade/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/masquerade/webpack/runtime/make namespace object","webpack://@fof/masquerade/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/masquerade/./src/lib/models/Field.js","webpack://@fof/masquerade/./node_modules/html5sortable/dist/html5sortable.es.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['admin/utils/saveSettings']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/masquerade/./src/admin/components/SelectFieldOptionEditor.js","webpack://@fof/masquerade/./src/admin/components/MasqueradePage.js","webpack://@fof/masquerade/./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 || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\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 Field extends Model {\n name = Model.attribute('name');\n description = Model.attribute('description');\n type = Model.attribute('type');\n validation = Model.attribute('validation');\n required = Model.attribute('required');\n prefix = Model.attribute('prefix');\n icon = Model.attribute('icon');\n sort = Model.attribute('sort');\n deleted_at = Model.attribute('deleted_at', Model.transformDate);\n answer = Model.hasOne('answer');\n on_bio = Model.attribute('on_bio');\n\n apiEndpoint() {\n return '/masquerade/fields' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","/*\n * HTML5Sortable package\n * https://github.com/lukasoppermann/html5sortable\n *\n * Maintained by Lukas Oppermann \n *\n * Released under the MIT license.\n */\n/**\n * Get or set data on element\n * @param {HTMLElement} element\n * @param {string} key\n * @param {any} value\n * @return {*}\n */\nfunction addData(element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key];\n }\n else {\n element.h5s = element.h5s || {};\n element.h5s.data = element.h5s.data || {};\n element.h5s.data[key] = value;\n }\n}\n/**\n * Remove data from element\n * @param {HTMLElement} element\n */\nfunction removeData(element) {\n if (element.h5s) {\n delete element.h5s.data;\n }\n}\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {NodeList|HTMLCollection|Array} nodes\n * @param {String} selector\n * @returns {Array}\n */\nvar _filter = (function (nodes, selector) {\n if (!(nodes instanceof NodeList || nodes instanceof HTMLCollection || nodes instanceof Array)) {\n throw new Error('You must provide a nodeList/HTMLCollection/Array of elements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return Array.from(nodes);\n }\n return Array.from(nodes).filter(function (item) { return item.nodeType === 1 && item.matches(selector); });\n});\n\n/* eslint-env browser */\nvar stores = new Map();\n/**\n * Stores data & configurations per Sortable\n * @param {Object} config\n */\nvar Store = /** @class */ (function () {\n function Store() {\n this._config = new Map(); // eslint-disable-line no-undef\n this._placeholder = undefined; // eslint-disable-line no-undef\n this._data = new Map(); // eslint-disable-line no-undef\n }\n Object.defineProperty(Store.prototype, \"config\", {\n /**\n * get the configuration map of a class instance\n * @method config\n * @return {object}\n */\n get: function () {\n // transform Map to object\n var config = {};\n this._config.forEach(function (value, key) {\n config[key] = value;\n });\n // return object\n return config;\n },\n /**\n * set the configuration of a class instance\n * @method config\n * @param {object} config object of configurations\n */\n set: function (config) {\n if (typeof config !== 'object') {\n throw new Error('You must provide a valid configuration object to the config setter.');\n }\n // combine config with default\n var mergedConfig = Object.assign({}, config);\n // add config to map\n this._config = new Map(Object.entries(mergedConfig));\n },\n enumerable: false,\n configurable: true\n });\n /**\n * set individual configuration of a class instance\n * @method setConfig\n * @param key valid configuration key\n * @param value any value\n * @return void\n */\n Store.prototype.setConfig = function (key, value) {\n if (!this._config.has(key)) {\n throw new Error(\"Trying to set invalid configuration item: \" + key);\n }\n // set config\n this._config.set(key, value);\n };\n /**\n * get an individual configuration of a class instance\n * @method getConfig\n * @param key valid configuration key\n * @return any configuration value\n */\n Store.prototype.getConfig = function (key) {\n if (!this._config.has(key)) {\n throw new Error(\"Invalid configuration item requested: \" + key);\n }\n return this._config.get(key);\n };\n Object.defineProperty(Store.prototype, \"placeholder\", {\n /**\n * get the placeholder for a class instance\n * @method placeholder\n * @return {HTMLElement|null}\n */\n get: function () {\n return this._placeholder;\n },\n /**\n * set the placeholder for a class instance\n * @method placeholder\n * @param {HTMLElement} placeholder\n * @return {void}\n */\n set: function (placeholder) {\n if (!(placeholder instanceof HTMLElement) && placeholder !== null) {\n throw new Error('A placeholder must be an html element or null.');\n }\n this._placeholder = placeholder;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * set an data entry\n * @method setData\n * @param {string} key\n * @param {any} value\n * @return {void}\n */\n Store.prototype.setData = function (key, value) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n this._data.set(key, value);\n };\n /**\n * get an data entry\n * @method getData\n * @param {string} key an existing key\n * @return {any}\n */\n Store.prototype.getData = function (key) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n return this._data.get(key);\n };\n /**\n * delete an data entry\n * @method deleteData\n * @param {string} key an existing key\n * @return {boolean}\n */\n Store.prototype.deleteData = function (key) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n return this._data.delete(key);\n };\n return Store;\n}());\n/**\n * @param {HTMLElement} sortableElement\n * @returns {Class: Store}\n */\nvar store = (function (sortableElement) {\n // if sortableElement is wrong type\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('Please provide a sortable to the store function.');\n }\n // create new instance if not avilable\n if (!stores.has(sortableElement)) {\n stores.set(sortableElement, new Store());\n }\n // return instance\n return stores.get(sortableElement);\n});\n\n/**\n * @param {Array|HTMLElement} element\n * @param {Function} callback\n * @param {string} event\n */\nfunction addEventListener(element, eventName, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addEventListener(element[i], eventName, callback);\n }\n return;\n }\n element.addEventListener(eventName, callback);\n store(element).setData(\"event\" + eventName, callback);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} eventName\n */\nfunction removeEventListener(element, eventName) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeEventListener(element[i], eventName);\n }\n return;\n }\n element.removeEventListener(eventName, store(element).getData(\"event\" + eventName));\n store(element).deleteData(\"event\" + eventName);\n}\n\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction addAttribute(element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addAttribute(element[i], attribute, value);\n }\n return;\n }\n element.setAttribute(attribute, value);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n */\nfunction removeAttribute(element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeAttribute(element[i], attribute);\n }\n return;\n }\n element.removeAttribute(attribute);\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {Object}\n */\nvar _offset = (function (element) {\n if (!element.parentElement || element.getClientRects().length === 0) {\n throw new Error('target element must be part of the dom');\n }\n var rect = element.getClientRects()[0];\n return {\n left: rect.left + window.pageXOffset,\n right: rect.right + window.pageXOffset,\n top: rect.top + window.pageYOffset,\n bottom: rect.bottom + window.pageYOffset\n };\n});\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {Function} func to debounce\n * @param {number} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nvar _debounce = (function (func, wait) {\n if (wait === void 0) { wait = 0; }\n var timeout;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(void 0, args);\n }, wait);\n };\n});\n\n/* eslint-env browser */\n/**\n * Get position of the element relatively to its sibling elements\n * @param {HTMLElement} element\n * @returns {number}\n */\nvar _index = (function (element, elementList) {\n if (!(element instanceof HTMLElement) || !(elementList instanceof NodeList || elementList instanceof HTMLCollection || elementList instanceof Array)) {\n throw new Error('You must provide an element and a list of elements.');\n }\n return Array.from(elementList).indexOf(element);\n});\n\n/* eslint-env browser */\n/**\n * Test whether element is in DOM\n * @param {HTMLElement} element\n * @returns {boolean}\n */\nvar isInDom = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('Element is not a node element.');\n }\n return element.parentNode !== null;\n});\n\n/* eslint-env browser */\n/**\n * Insert node before or after target\n * @param {HTMLElement} referenceNode - reference element\n * @param {HTMLElement} newElement - element to be inserted\n * @param {String} position - insert before or after reference element\n */\nvar insertNode = function (referenceNode, newElement, position) {\n if (!(referenceNode instanceof HTMLElement) || !(referenceNode.parentElement instanceof HTMLElement)) {\n throw new Error('target and element must be a node');\n }\n referenceNode.parentElement.insertBefore(newElement, (position === 'before' ? referenceNode : referenceNode.nextElementSibling));\n};\n/**\n * Insert before target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertBefore = function (target, element) { return insertNode(target, element, 'before'); };\n/**\n * Insert after target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertAfter = function (target, element) { return insertNode(target, element, 'after'); };\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {HTMLElement} sortableContainer\n * @param {Function} customSerializer\n * @returns {Array}\n */\nvar _serialize = (function (sortableContainer, customItemSerializer, customContainerSerializer) {\n if (customItemSerializer === void 0) { customItemSerializer = function (serializedItem, sortableContainer) { return serializedItem; }; }\n if (customContainerSerializer === void 0) { customContainerSerializer = function (serializedContainer) { return serializedContainer; }; }\n // check for valid sortableContainer\n if (!(sortableContainer instanceof HTMLElement) || !sortableContainer.isSortable === true) {\n throw new Error('You need to provide a sortableContainer to be serialized.');\n }\n // check for valid serializers\n if (typeof customItemSerializer !== 'function' || typeof customContainerSerializer !== 'function') {\n throw new Error('You need to provide a valid serializer for items and the container.');\n }\n // get options\n var options = addData(sortableContainer, 'opts');\n var item = options.items;\n // serialize container\n var items = _filter(sortableContainer.children, item);\n var serializedItems = items.map(function (item) {\n return {\n parent: sortableContainer,\n node: item,\n html: item.outerHTML,\n index: _index(item, items)\n };\n });\n // serialize container\n var container = {\n node: sortableContainer,\n itemCount: serializedItems.length\n };\n return {\n container: customContainerSerializer(container),\n items: serializedItems.map(function (item) { return customItemSerializer(item, sortableContainer); })\n };\n});\n\n/* eslint-env browser */\n/**\n * create a placeholder element\n * @param {HTMLElement} sortableElement a single sortable\n * @param {string|undefined} placeholder a string representing an html element\n * @param {string} placeholderClasses a string representing the classes that should be added to the placeholder\n */\nvar _makePlaceholder = (function (sortableElement, placeholder, placeholderClass) {\n var _a;\n if (placeholderClass === void 0) { placeholderClass = 'sortable-placeholder'; }\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('You must provide a valid element as a sortable.');\n }\n // if placeholder is not an element\n if (!(placeholder instanceof HTMLElement) && placeholder !== undefined) {\n throw new Error('You must provide a valid element as a placeholder or set ot to undefined.');\n }\n // if no placeholder element is given\n if (placeholder === undefined) {\n if (['UL', 'OL'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('li');\n }\n else if (['TABLE', 'TBODY'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('tr');\n // set colspan to always all rows, otherwise the item can only be dropped in first column\n placeholder.innerHTML = '';\n }\n else {\n placeholder = document.createElement('div');\n }\n }\n // add classes to placeholder\n if (typeof placeholderClass === 'string') {\n (_a = placeholder.classList).add.apply(_a, placeholderClass.split(' '));\n }\n return placeholder;\n});\n\n/* eslint-env browser */\n/**\n * Get height of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementHeight = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // get only height if element has box-sizing: border-box specified\n if (style.getPropertyValue('box-sizing') === 'border-box') {\n return parseInt(style.getPropertyValue('height'), 10);\n }\n // pick applicable properties, convert to int and reduce by adding\n return ['height', 'padding-top', 'padding-bottom']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * Get width of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementWidth = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // pick applicable properties, convert to int and reduce by adding\n return ['width', 'padding-left', 'padding-right']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * get handle or return item\n * @param {Array} items\n * @param {string} selector\n */\nvar _getHandles = (function (items, selector) {\n if (!(items instanceof Array)) {\n throw new Error('You must provide a Array of HTMLElements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return items;\n }\n return items\n // remove items without handle from array\n .filter(function (item) {\n return item.querySelector(selector) instanceof HTMLElement ||\n (item.shadowRoot && item.shadowRoot.querySelector(selector) instanceof HTMLElement);\n })\n // replace item with handle in array\n .map(function (item) {\n return item.querySelector(selector) || (item.shadowRoot && item.shadowRoot.querySelector(selector));\n });\n});\n\n/**\n * @param {Event} event\n * @returns {HTMLElement}\n */\nvar getEventTarget = (function (event) {\n return (event.composedPath && event.composedPath()[0]) || event.target;\n});\n\n/* eslint-env browser */\n/**\n * defaultDragImage returns the current item as dragged image\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {object} elementOffset - an object with the offsets top, left, right & bottom\n * @param {Event} event - the original drag event object\n * @return {object} with element, posX and posY properties\n */\nvar defaultDragImage = function (draggedElement, elementOffset, event) {\n return {\n element: draggedElement,\n posX: event.pageX - elementOffset.left,\n posY: event.pageY - elementOffset.top\n };\n};\n/**\n * attaches an element as the drag image to an event\n * @param {Event} event - the original drag event object\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {Function} customDragImage - function to create a custom dragImage\n * @return void\n */\nvar setDragImage = (function (event, draggedElement, customDragImage) {\n // check if event is provided\n if (!(event instanceof Event)) {\n throw new Error('setDragImage requires a DragEvent as the first argument.');\n }\n // check if draggedElement is provided\n if (!(draggedElement instanceof HTMLElement)) {\n throw new Error('setDragImage requires the dragged element as the second argument.');\n }\n // set default function of none provided\n if (!customDragImage) {\n customDragImage = defaultDragImage;\n }\n // check if setDragImage method is available\n if (event.dataTransfer && event.dataTransfer.setDragImage) {\n // get the elements offset\n var elementOffset = _offset(draggedElement);\n // get the dragImage\n var dragImage = customDragImage(draggedElement, elementOffset, event);\n // check if custom function returns correct values\n if (!(dragImage.element instanceof HTMLElement) || typeof dragImage.posX !== 'number' || typeof dragImage.posY !== 'number') {\n throw new Error('The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].');\n }\n // needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'copyMove';\n // Firefox requires it to use the event target's id for the data\n event.dataTransfer.setData('text/plain', getEventTarget(event).id);\n // set the drag image on the event\n event.dataTransfer.setDragImage(dragImage.element, dragImage.posX, dragImage.posY);\n }\n});\n\n/**\n * Check if curList accepts items from destList\n * @param {sortable} destination the container an item is move to\n * @param {sortable} origin the container an item comes from\n */\nvar _listsConnected = (function (destination, origin) {\n // check if valid sortable\n if (destination.isSortable === true) {\n var acceptFrom = store(destination).getConfig('acceptFrom');\n // check if acceptFrom is valid\n if (acceptFrom !== null && acceptFrom !== false && typeof acceptFrom !== 'string') {\n throw new Error('HTML5Sortable: Wrong argument, \"acceptFrom\" must be \"null\", \"false\", or a valid selector string.');\n }\n if (acceptFrom !== null) {\n return acceptFrom !== false && acceptFrom.split(',').filter(function (sel) {\n return sel.length > 0 && origin.matches(sel);\n }).length > 0;\n }\n // drop in same list\n if (destination === origin) {\n return true;\n }\n // check if lists are connected with connectWith\n if (store(destination).getConfig('connectWith') !== undefined && store(destination).getConfig('connectWith') !== null) {\n return store(destination).getConfig('connectWith') === store(origin).getConfig('connectWith');\n }\n }\n return false;\n});\n\n/**\n * default configurations\n */\nvar defaultConfiguration = {\n items: null,\n // deprecated\n connectWith: null,\n // deprecated\n disableIEFix: null,\n acceptFrom: null,\n copy: false,\n placeholder: null,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n dropTargetContainerClass: false,\n debounce: 0,\n throttleTime: 100,\n maxItems: 0,\n itemSerializer: undefined,\n containerSerializer: undefined,\n customDragImage: null,\n orientation: 'vertical'\n};\n\n/**\n * make sure a function is only called once within the given amount of time\n * @param {Function} fn the function to throttle\n * @param {number} threshold time limit for throttling\n */\n// must use function to keep this context\nfunction _throttle (fn, threshold) {\n var _this = this;\n if (threshold === void 0) { threshold = 250; }\n // check function\n if (typeof fn !== 'function') {\n throw new Error('You must provide a function as the first argument for throttle.');\n }\n // check threshold\n if (typeof threshold !== 'number') {\n throw new Error('You must provide a number as the second argument for throttle.');\n }\n var lastEventTimestamp = null;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var now = Date.now();\n if (lastEventTimestamp === null || now - lastEventTimestamp >= threshold) {\n lastEventTimestamp = now;\n fn.apply(_this, args);\n }\n };\n}\n\n/* eslint-env browser */\n/**\n * enable or disable hoverClass on mouseenter/leave if container Items\n * @param {sortable} sortableContainer a valid sortableContainer\n * @param {boolean} enable enable or disable event\n */\n// export default (sortableContainer: sortable, enable: boolean) => {\nvar enableHoverClass = (function (sortableContainer, enable) {\n if (typeof store(sortableContainer).getConfig('hoverClass') === 'string') {\n var hoverClasses_1 = store(sortableContainer).getConfig('hoverClass').split(' ');\n // add class on hover\n if (enable === true) {\n addEventListener(sortableContainer, 'mousemove', _throttle(function (event) {\n // check of no mouse button was pressed when mousemove started == no drag\n if (event.buttons === 0) {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a, _b;\n if (item !== event.target) {\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n }\n else {\n (_b = item.classList).add.apply(_b, hoverClasses_1);\n }\n });\n }\n }, store(sortableContainer).getConfig('throttleTime')));\n // remove class on leave\n addEventListener(sortableContainer, 'mouseleave', function () {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a;\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n });\n });\n // remove events\n }\n else {\n removeEventListener(sortableContainer, 'mousemove');\n removeEventListener(sortableContainer, 'mouseleave');\n }\n }\n});\n\n/* eslint-env browser */\n/*\n * variables global to the plugin\n */\nvar dragging;\nvar draggingHeight;\nvar draggingWidth;\n/*\n * Keeps track of the initialy selected list, where 'dragstart' event was triggered\n * It allows us to move the data in between individual Sortable List instances\n */\n// Origin List - data from before any item was changed\nvar originContainer;\nvar originIndex;\nvar originElementIndex;\nvar originItemsBeforeUpdate;\n// Previous Sortable Container - we dispatch as sortenter event when a\n// dragged item enters a sortableContainer for the first time\nvar previousContainer;\n// Destination List - data from before any item was changed\nvar destinationItemsBeforeUpdate;\n/**\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n removeEventListener(items, 'dragstart');\n removeEventListener(items, 'dragend');\n removeEventListener(items, 'dragover');\n removeEventListener(items, 'dragenter');\n removeEventListener(items, 'drop');\n removeEventListener(items, 'mouseenter');\n removeEventListener(items, 'mouseleave');\n};\n// Remove container events\nvar _removeContainerEvents = function (originContainer, previousContainer) {\n if (originContainer) {\n removeEventListener(originContainer, 'dragleave');\n }\n if (previousContainer && (previousContainer !== originContainer)) {\n removeEventListener(previousContainer, 'dragleave');\n }\n};\n/**\n * _getDragging returns the current element to drag or\n * a copy of the element.\n * Is Copy Active for sortable\n * @param {HTMLElement} draggedItem - the item that the user drags\n * @param {HTMLElement} sortable a single sortable\n */\nvar _getDragging = function (draggedItem, sortable) {\n var ditem = draggedItem;\n if (store(sortable).getConfig('copy') === true) {\n ditem = draggedItem.cloneNode(true);\n addAttribute(ditem, 'aria-copied', 'true');\n draggedItem.parentElement.appendChild(ditem);\n ditem.style.display = 'none';\n ditem.oldDisplay = draggedItem.style.display;\n }\n return ditem;\n};\n/**\n * Remove data from sortable\n * @param {HTMLElement} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n removeData(sortable);\n removeAttribute(sortable, 'aria-dropeffect');\n};\n/**\n * Remove data from items\n * @param {Array|HTMLElement} items\n */\nvar _removeItemData = function (items) {\n removeAttribute(items, 'aria-grabbed');\n removeAttribute(items, 'aria-copied');\n removeAttribute(items, 'draggable');\n removeAttribute(items, 'role');\n};\n/**\n * find sortable from element. travels up parent element until found or null.\n * @param {HTMLElement} element a single sortable\n * @param {Event} event - the current event. We need to pass it to be able to\n * find Sortable whith shadowRoot (document fragment has no parent)\n */\nfunction findSortable(element, event) {\n if (event.composedPath) {\n return event.composedPath().find(function (el) { return el.isSortable; });\n }\n while (element.isSortable !== true) {\n element = element.parentElement;\n }\n return element;\n}\n/**\n * Dragging event is on the sortable element. finds the top child that\n * contains the element.\n * @param {HTMLElement} sortableElement a single sortable\n * @param {HTMLElement} element is that being dragged\n */\nfunction findDragElement(sortableElement, element) {\n var options = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, options.items);\n var itemlist = items.filter(function (ele) {\n return ele.contains(element) || (ele.shadowRoot && ele.shadowRoot.contains(element));\n });\n return itemlist.length > 0 ? itemlist[0] : element;\n}\n/**\n * Destroy the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts') || {};\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n // remove event handlers & data from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'dragstart');\n removeEventListener(sortableElement, 'dragend');\n removeEventListener(sortableElement, 'drop');\n // remove event data from sortable\n _removeSortableData(sortableElement);\n // remove event handlers & data from items\n removeEventListener(handles, 'mousedown');\n _removeItemEvents(items);\n _removeItemData(items);\n _removeContainerEvents(originContainer, previousContainer);\n // clear sortable flag\n sortableElement.isSortable = false;\n};\n/**\n * Enable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'move');\n addData(sortableElement, '_disabled', 'false');\n addAttribute(handles, 'draggable', 'true');\n // @todo: remove this fix\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n if (opts.disableIEFix === false) {\n var spanEl = (document || window.document).createElement('span');\n if (typeof spanEl.dragDrop === 'function') {\n addEventListener(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop();\n }\n else {\n var parent = this.parentElement;\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement;\n }\n parent.dragDrop();\n }\n });\n }\n }\n};\n/**\n * Disable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'none');\n addData(sortableElement, '_disabled', 'true');\n addAttribute(handles, 'draggable', 'false');\n removeEventListener(handles, 'mousedown');\n};\n/**\n * Reload the sortable\n * @param {HTMLElement} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addData(sortableElement, '_disabled', 'false');\n // remove event handlers from items\n _removeItemEvents(items);\n _removeContainerEvents(originContainer, previousContainer);\n removeEventListener(handles, 'mousedown');\n // remove event handlers from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'drop');\n};\n/**\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nfunction sortable(sortableElements, options) {\n // get method string to see if a method is called\n var method = String(options);\n options = options || {};\n // check if the user provided a selector instead of an element\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements);\n }\n // if the user provided an element, return it in an array to keep the return value consistant\n if (sortableElements instanceof HTMLElement) {\n sortableElements = [sortableElements];\n }\n sortableElements = Array.prototype.slice.call(sortableElements);\n if (/serialize/.test(method)) {\n return sortableElements.map(function (sortableContainer) {\n var opts = addData(sortableContainer, 'opts');\n return _serialize(sortableContainer, opts.itemSerializer, opts.containerSerializer);\n });\n }\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n return sortable[method](sortableElement);\n }\n // log deprecation\n ['connectWith', 'disableIEFix'].forEach(function (configKey) {\n if (Object.prototype.hasOwnProperty.call(options, configKey) && options[configKey] !== null) {\n console.warn(\"HTML5Sortable: You are using the deprecated configuration \\\"\" + configKey + \"\\\". This will be removed in an upcoming version, make sure to migrate to the new options when updating.\");\n }\n });\n // merge options with default options\n options = Object.assign({}, defaultConfiguration, store(sortableElement).config, options);\n // init data store for sortable\n store(sortableElement).config = options;\n // set options on sortable\n addData(sortableElement, 'opts', options);\n // property to define as sortable\n sortableElement.isSortable = true;\n // reset sortable\n _reloadSortable(sortableElement);\n // initialize\n var listItems = _filter(sortableElement.children, options.items);\n // create element if user defined a placeholder element as a string\n var customPlaceholder;\n if (options.placeholder !== null && options.placeholder !== undefined) {\n var tempContainer = document.createElement(sortableElement.tagName);\n if (options.placeholder instanceof HTMLElement) {\n tempContainer.appendChild(options.placeholder);\n }\n else {\n tempContainer.innerHTML = options.placeholder;\n }\n customPlaceholder = tempContainer.children[0];\n }\n // add placeholder\n store(sortableElement).placeholder = _makePlaceholder(sortableElement, customPlaceholder, options.placeholderClass);\n addData(sortableElement, 'items', options.items);\n if (options.acceptFrom) {\n addData(sortableElement, 'acceptFrom', options.acceptFrom);\n }\n else if (options.connectWith) {\n addData(sortableElement, 'connectWith', options.connectWith);\n }\n _enableSortable(sortableElement);\n addAttribute(listItems, 'role', 'option');\n addAttribute(listItems, 'aria-grabbed', 'false');\n // enable hover class\n enableHoverClass(sortableElement, true);\n /*\n Handle drag events on draggable items\n Handle is set at the sortableElement level as it will bubble up\n from the item\n */\n addEventListener(sortableElement, 'dragstart', function (e) {\n // ignore dragstart events\n var target = getEventTarget(e);\n if (target.isSortable === true) {\n return;\n }\n e.stopImmediatePropagation();\n if ((options.handle && !target.matches(options.handle)) || target.getAttribute('draggable') === 'false') {\n return;\n }\n var sortableContainer = findSortable(target, e);\n var dragItem = findDragElement(sortableContainer, target);\n // grab values\n originItemsBeforeUpdate = _filter(sortableContainer.children, options.items);\n originIndex = originItemsBeforeUpdate.indexOf(dragItem);\n originElementIndex = _index(dragItem, sortableContainer.children);\n originContainer = sortableContainer;\n // add transparent clone or other ghost to cursor\n setDragImage(e, dragItem, options.customDragImage);\n // cache selsection & add attr for dragging\n draggingHeight = _getElementHeight(dragItem);\n draggingWidth = _getElementWidth(dragItem);\n dragItem.classList.add(options.draggingClass);\n dragging = _getDragging(dragItem, sortableContainer);\n addAttribute(dragging, 'aria-grabbed', 'true');\n // dispatch sortstart event on each element in group\n sortableContainer.dispatchEvent(new CustomEvent('sortstart', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n });\n /*\n We are capturing targetSortable before modifications with 'dragenter' event\n */\n addEventListener(sortableElement, 'dragenter', function (e) {\n var target = getEventTarget(e);\n var sortableContainer = findSortable(target, e);\n if (sortableContainer && sortableContainer !== previousContainer) {\n destinationItemsBeforeUpdate = _filter(sortableContainer.children, addData(sortableContainer, 'items'))\n .filter(function (item) { return item !== store(sortableElement).placeholder; });\n if (options.dropTargetContainerClass) {\n sortableContainer.classList.add(options.dropTargetContainerClass);\n }\n sortableContainer.dispatchEvent(new CustomEvent('sortenter', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n destination: {\n container: sortableContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate\n },\n item: dragging,\n originalTarget: target\n }\n }));\n addEventListener(sortableContainer, 'dragleave', function (e) {\n // TODO: rename outTarget to be more self-explanatory\n // e.fromElement for very old browsers, similar to relatedTarget\n var outTarget = e.relatedTarget || e.fromElement;\n if (!e.currentTarget.contains(outTarget)) {\n if (options.dropTargetContainerClass) {\n sortableContainer.classList.remove(options.dropTargetContainerClass);\n }\n sortableContainer.dispatchEvent(new CustomEvent('sortleave', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: sortableContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n }\n });\n }\n previousContainer = sortableContainer;\n });\n /*\n * Dragend Event - https://developer.mozilla.org/en-US/docs/Web/Events/dragend\n * Fires each time dragEvent end, or ESC pressed\n * We are using it to clean up any draggable elements and placeholders\n */\n addEventListener(sortableElement, 'dragend', function (e) {\n if (!dragging) {\n return;\n }\n dragging.classList.remove(options.draggingClass);\n addAttribute(dragging, 'aria-grabbed', 'false');\n if (dragging.getAttribute('aria-copied') === 'true' && addData(dragging, 'dropped') !== 'true') {\n dragging.remove();\n }\n dragging.style.display = dragging.oldDisplay;\n delete dragging.oldDisplay;\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) { return data.placeholder; })\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n .filter(isInDom)[0];\n if (visiblePlaceholder) {\n visiblePlaceholder.remove();\n }\n // dispatch sortstart event on each element in group\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n previousContainer = null;\n dragging = null;\n draggingHeight = null;\n draggingWidth = null;\n });\n /*\n * Drop Event - https://developer.mozilla.org/en-US/docs/Web/Events/drop\n * Fires when valid drop target area is hit\n */\n addEventListener(sortableElement, 'drop', function (e) {\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n addData(dragging, 'dropped', 'true');\n // get the one placeholder that is currently visible\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) {\n return data.placeholder;\n })\n // filter only HTMLElements\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n // filter only elements in DOM\n .filter(isInDom)[0];\n // attach element after placeholder\n insertAfter(visiblePlaceholder, dragging);\n // remove placeholder from dom\n visiblePlaceholder.remove();\n /*\n * Fires Custom Event - 'sortstop'\n */\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n var placeholder = store(sortableElement).placeholder;\n var originItems = _filter(originContainer.children, options.items)\n .filter(function (item) { return item !== placeholder; });\n var destinationContainer = this.isSortable === true ? this : this.parentElement;\n var destinationItems = _filter(destinationContainer.children, addData(destinationContainer, 'items'))\n .filter(function (item) { return item !== placeholder; });\n var destinationElementIndex = _index(dragging, Array.from(dragging.parentElement.children)\n .filter(function (item) { return item !== placeholder; }));\n var destinationIndex = _index(dragging, destinationItems);\n if (options.dropTargetContainerClass) {\n destinationContainer.classList.remove(options.dropTargetContainerClass);\n }\n /*\n * When a list item changed container lists or index within a list\n * Fires Custom Event - 'sortupdate'\n */\n if (originElementIndex !== destinationElementIndex || originContainer !== destinationContainer) {\n sortableElement.dispatchEvent(new CustomEvent('sortupdate', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer,\n itemsBeforeUpdate: originItemsBeforeUpdate,\n items: originItems\n },\n destination: {\n index: destinationIndex,\n elementIndex: destinationElementIndex,\n container: destinationContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate,\n items: destinationItems\n },\n item: dragging\n }\n }));\n }\n });\n var debouncedDragOverEnter = _debounce(function (sortableElement, element, pageX, pageY) {\n if (!dragging) {\n return;\n }\n // set placeholder height if forcePlaceholderSize option is set\n if (options.forcePlaceholderSize) {\n store(sortableElement).placeholder.style.height = draggingHeight + 'px';\n store(sortableElement).placeholder.style.width = draggingWidth + 'px';\n }\n // if element the draggedItem is dragged onto is within the array of all elements in list\n // (not only items, but also disabled, etc.)\n if (Array.from(sortableElement.children).indexOf(element) > -1) {\n var thisHeight = _getElementHeight(element);\n var thisWidth = _getElementWidth(element);\n var placeholderIndex = _index(store(sortableElement).placeholder, element.parentElement.children);\n var thisIndex = _index(element, element.parentElement.children);\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight || thisWidth > draggingWidth) {\n // Dead zone?\n var deadZoneVertical = thisHeight - draggingHeight;\n var deadZoneHorizontal = thisWidth - draggingWidth;\n var offsetTop = _offset(element).top;\n var offsetLeft = _offset(element).left;\n if (placeholderIndex < thisIndex &&\n ((options.orientation === 'vertical' && pageY < offsetTop) ||\n (options.orientation === 'horizontal' && pageX < offsetLeft))) {\n return;\n }\n if (placeholderIndex > thisIndex &&\n ((options.orientation === 'vertical' && pageY > offsetTop + thisHeight - deadZoneVertical) ||\n (options.orientation === 'horizontal' && pageX > offsetLeft + thisWidth - deadZoneHorizontal))) {\n return;\n }\n }\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display;\n }\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none';\n }\n // To avoid flicker, determine where to position the placeholder\n // based on where the mouse pointer is relative to the elements\n // vertical center.\n var placeAfter = false;\n try {\n var elementMiddleVertical = _offset(element).top + element.offsetHeight / 2;\n var elementMiddleHorizontal = _offset(element).left + element.offsetWidth / 2;\n placeAfter = (options.orientation === 'vertical' && (pageY >= elementMiddleVertical)) ||\n (options.orientation === 'horizontal' && (pageX >= elementMiddleHorizontal));\n }\n catch (e) {\n placeAfter = placeholderIndex < thisIndex;\n }\n if (placeAfter) {\n insertAfter(element, store(sortableElement).placeholder);\n }\n else {\n insertBefore(element, store(sortableElement).placeholder);\n }\n // get placeholders from all stores & remove all but current one\n Array.from(stores.values())\n // remove empty values\n .filter(function (data) { return data.placeholder !== undefined; })\n // foreach placeholder in array if outside of current sorableContainer -> remove from DOM\n .forEach(function (data) {\n if (data.placeholder !== store(sortableElement).placeholder) {\n data.placeholder.remove();\n }\n });\n }\n else {\n // get all placeholders from store\n var placeholders = Array.from(stores.values())\n .filter(function (data) { return data.placeholder !== undefined; })\n .map(function (data) {\n return data.placeholder;\n });\n // check if element is not in placeholders\n if (placeholders.indexOf(element) === -1 && sortableElement === element && !_filter(element.children, options.items).length) {\n placeholders.forEach(function (element) { return element.remove(); });\n element.appendChild(store(sortableElement).placeholder);\n }\n }\n }, options.debounce);\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n var element = e.target;\n var sortableElement = element.isSortable === true ? element : findSortable(element, e);\n element = findDragElement(sortableElement, element);\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || addData(sortableElement, '_disabled') === 'true') {\n return;\n }\n var options = addData(sortableElement, 'opts');\n if (parseInt(options.maxItems) && _filter(sortableElement.children, addData(sortableElement, 'items')).length >= parseInt(options.maxItems) && dragging.parentElement !== sortableElement) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = store(sortableElement).getConfig('copy') === true ? 'copy' : 'move';\n debouncedDragOverEnter(sortableElement, element, e.pageX, e.pageY);\n };\n addEventListener(listItems.concat(sortableElement), 'dragover', onDragOverEnter);\n addEventListener(listItems.concat(sortableElement), 'dragenter', onDragOverEnter);\n });\n return sortableElements;\n}\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement);\n};\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement);\n};\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement);\n};\n/* START.TESTS_ONLY */\nsortable.__testing = {\n // add internal methods here for testing purposes\n _data: addData,\n _removeItemEvents: _removeItemEvents,\n _removeItemData: _removeItemData,\n _removeSortableData: _removeSortableData,\n _removeContainerEvents: _removeContainerEvents\n};\n\nexport default sortable;\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\n\n/* global m */\n\nexport default class SelectFieldOptionEditor extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.newOption = '';\n }\n\n view() {\n return m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.options')),\n m(\n 'table',\n m(\n 'tbody',\n this.options().map((option, optionIndex) =>\n m('tr', [\n m(\n 'td',\n m('input[type=text].FormControl', {\n oninput: (event) => {\n this.updateOption(optionIndex, event.target.value);\n },\n value: option,\n })\n ),\n m(\n 'td',\n m(\n 'button.Button',\n {\n onclick: () => {\n this.moveOption(optionIndex, -1);\n },\n },\n icon('fas fa-chevron-up')\n )\n ),\n m(\n 'td',\n m(\n 'button.Button',\n {\n onclick: () => {\n this.moveOption(optionIndex, 1);\n },\n },\n icon('fas fa-chevron-down')\n )\n ),\n m(\n 'td',\n m(\n 'button.Button.Button--danger',\n {\n onclick: () => {\n this.deleteOption(optionIndex);\n },\n },\n icon('fas fa-times')\n )\n ),\n ])\n )\n )\n ),\n m('.helpText', app.translator.trans('fof-masquerade.admin.fields.option-comma-warning')),\n m(\n 'table',\n m('tbody'),\n m('tr', [\n m(\n 'td',\n m('input[type=text].FormControl', {\n onchange: (event) => {\n this.newOption = event.target.value;\n },\n value: this.newOption,\n placeholder: app.translator.trans('fof-masquerade.admin.fields.option-new'),\n })\n ),\n m(\n 'td',\n m(\n 'button.Button.Button--primary',\n {\n onclick: () => {\n this.addOption();\n },\n },\n icon('fas fa-plus')\n )\n ),\n ])\n ),\n ]);\n }\n\n updateRules(options) {\n // We ignore other existing rules, they would probably be leftovers from another field type when changing types\n this.attrs.onchange('in:' + options.join(','));\n }\n\n options() {\n const rules = this.attrs.value.split('|');\n\n let options = [];\n\n rules.forEach((rule) => {\n const parts = rule.split(':', 2);\n\n if (parts[0] === 'in') {\n options = parts[1].split(',');\n }\n });\n\n return options;\n }\n\n updateOption(index, value) {\n let options = this.options();\n\n options[index] = value;\n\n this.updateRules(options);\n }\n\n moveOption(index, moveIndex) {\n let options = this.options();\n\n const newIndex = index + moveIndex;\n\n if (newIndex < 0 || newIndex > options.length - 1) {\n return;\n }\n\n const move = options.splice(index, 1);\n\n options.splice(newIndex, 0, move[0]);\n\n this.updateRules(options);\n }\n\n deleteOption(index) {\n let options = this.options();\n\n options.splice(index, 1);\n\n this.updateRules(options);\n }\n\n addOption() {\n if (this.newOption === '') {\n return;\n }\n\n let options = this.options();\n\n options.push(this.newOption);\n\n this.newOption = '';\n\n this.updateRules(options);\n }\n}\n","import sortable from 'html5sortable/dist/html5sortable.es.js';\n\nimport app from 'flarum/admin/app';\nimport icon from 'flarum/common/helpers/icon';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Select from 'flarum/common/components/Select';\nimport Switch from 'flarum/common/components/Switch';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport SelectFieldOptionEditor from './SelectFieldOptionEditor';\n\n/* global m, $ */\n\nexport default class MasqueradePage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.resetNew();\n this.loading = false;\n this.existing = [];\n this.loadExisting();\n this.enforceProfileCompletion = app.data.settings['masquerade.force-profile-completion'] === '1';\n }\n\n config() {\n sortable(this.element.querySelector('.js-sortable-fields'), {\n handle: 'legend',\n })[0].addEventListener('sortupdate', () => {\n const sorting = this.$('.js-sortable-fields > .Field')\n .map(function () {\n return $(this).data('id');\n })\n .get();\n\n this.updateSort(sorting);\n });\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.config();\n }\n\n onupdate() {\n this.config();\n }\n\n content() {\n return m(\n '.ExtensionPage-settings.ProfileConfigurePane',\n m('.container', [\n m('h2', app.translator.trans('fof-masquerade.admin.general-options')),\n m(\n '.Form-group',\n Switch.component(\n {\n state: this.enforceProfileCompletion,\n onchange: (value) => {\n const saveValue = value ? '1' : '0';\n saveSettings({\n 'masquerade.force-profile-completion': saveValue,\n });\n this.enforceProfileCompletion = saveValue;\n },\n },\n app.translator.trans('fof-masquerade.admin.fields.force-user-to-completion')\n )\n ),\n m('h2', app.translator.trans('fof-masquerade.admin.fields.title')),\n m(\n 'form.js-sortable-fields',\n this.existing.map((field) => {\n // Build array of fields to show.\n return this.addField(field);\n })\n ),\n this.addField(this.new),\n ])\n );\n }\n\n /**\n * Creates a field in the DOM.\n *\n * @param field\n * @returns {*}\n */\n addField(field) {\n let exists = field.id();\n\n return m(\n 'fieldset.Field',\n {\n 'data-id': field.id(),\n key: field.id(),\n },\n [\n m('legend', [\n exists\n ? [\n Button.component({\n className: 'Button Button--icon Button--danger',\n icon: 'fas fa-trash',\n onclick: this.deleteField.bind(this, field),\n }),\n ' ',\n ]\n : null,\n m(\n 'span.Field-toggle',\n {\n onclick: (e) => this.toggleField(e),\n },\n [\n app.translator.trans('fof-masquerade.admin.fields.' + (exists ? 'edit' : 'add'), {\n field: field.name(),\n }),\n ' ',\n icon('fas fa-caret-down'),\n ]\n ),\n ]),\n m('.Field-body', [\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.name')),\n m('input.FormControl', {\n value: field.name(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'name', field)),\n }),\n m('span.helpText', app.translator.trans('fof-masquerade.admin.fields.name-help')),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.description')),\n m('input.FormControl', {\n value: field.description(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'description', field)),\n }),\n m('span.helpText', app.translator.trans('fof-masquerade.admin.fields.description-help')),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.icon')),\n m('input.FormControl', {\n value: field.icon(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'icon', field)),\n }),\n m(\n 'span.helpText',\n app.translator.trans('fof-masquerade.admin.fields.icon-help', {\n a: ,\n })\n ),\n ]),\n m(\n '.Form-group',\n Switch.component(\n {\n state: field.on_bio(),\n onchange: this.updateExistingFieldInput.bind(this, 'on_bio', field),\n },\n app.translator.trans('fof-masquerade.admin.fields.on_bio')\n )\n ),\n m(\n '.Form-group',\n Switch.component(\n {\n state: field.required(),\n onchange: this.updateExistingFieldInput.bind(this, 'required', field),\n },\n app.translator.trans('fof-masquerade.admin.fields.required')\n )\n ),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.type')),\n Select.component({\n onchange: (value) => {\n if (value === 'null') {\n value = null;\n }\n\n this.updateExistingFieldInput('type', field, value);\n },\n options: this.availableTypes(),\n value: field.type(),\n }),\n ]),\n field.type() === 'select'\n ? SelectFieldOptionEditor.component({\n onchange: (value) => {\n this.updateExistingFieldInput('validation', field, value);\n },\n value: field.validation(),\n })\n : null,\n field.type() === null\n ? m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.validation')),\n m('input.FormControl', {\n value: field.validation(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'validation', field)),\n }),\n m(\n 'span.helpText',\n app.translator.trans('fof-masquerade.admin.fields.validation-help', {\n a: ,\n })\n ),\n ])\n : null,\n m(\n '.Form-group',\n m('.ButtonGroup', [\n Button.component(\n {\n className: 'Button Button--primary',\n loading: this.loading,\n disabled: !this.readyToAdd(field),\n onclick: exists ? this.updateExistingField.bind(this, field) : this.submitAddField.bind(this),\n },\n app.translator.trans('fof-masquerade.admin.buttons.' + (exists ? 'edit' : 'add') + '-field')\n ),\n exists\n ? Button.component(\n {\n className: 'Button Button--danger',\n loading: this.loading,\n onclick: this.deleteField.bind(this, field),\n },\n app.translator.trans('fof-masquerade.admin.buttons.delete-field')\n )\n : null,\n ])\n ),\n ]),\n ]\n );\n }\n\n updateExistingFieldInput(what, field, value) {\n field.pushAttributes({\n [what]: value,\n });\n }\n\n /**\n * Sorts the fields.\n *\n * @param {Array} sorting\n */\n updateSort(sorting) {\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/masquerade/fields/order',\n body: {\n sort: sorting,\n },\n })\n .then(this.requestSuccess.bind(this));\n }\n\n /**\n * Opens and closes field configuration sets.\n *\n * @param e\n */\n toggleField(e) {\n $(e.target).parents('.Field').toggleClass('active');\n }\n\n /**\n * Deletes a field configuration set.\n *\n * @param field\n */\n deleteField(field) {\n field.delete().then(this.requestSuccess.bind(this));\n }\n\n /**\n * Saves the settings to the database and redraw the page\n *\n * @param e\n */\n submitAddField(e) {\n e.preventDefault();\n\n this.new\n .save(this.new.data.attributes)\n .then(this.requestSuccess.bind(this))\n .then(() => {\n this.resetNew();\n });\n\n m.redraw();\n }\n\n /**\n * Updates the value of one field.\n *\n * @param field\n */\n updateExistingField(field) {\n if (!field.id()) return;\n\n field.save(field.data.attributes).then(this.requestSuccess.bind(this));\n }\n\n /**\n * Parses result to update DOM.\n */\n requestSuccess() {\n this.existing = app.store.all('masquerade-field');\n\n // Update order in case the store order doesn't reflect the true ordering\n this.existing.sort((a, b) => {\n if (a.sort() < b.sort()) return -1;\n if (a.sort() > b.sort()) return 1;\n return 0;\n });\n\n this.loading = false;\n m.redraw();\n }\n\n /**\n * Retrieves list of fields.\n */\n loadExisting() {\n this.loading = true;\n\n return app\n .request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/masquerade/fields',\n })\n .then((result) => {\n app.store.pushPayload(result);\n\n this.requestSuccess();\n });\n }\n\n /**\n * Resets the new field.\n */\n resetNew() {\n this.new = app.store.createRecord('masquerade-field', {\n attributes: {\n name: '',\n description: '',\n prefix: '',\n icon: '',\n required: false,\n on_bio: false,\n type: null,\n validation: '',\n },\n });\n }\n\n /**\n * Checks whether creation field is completed.\n *\n * @returns boolean\n */\n readyToAdd(field) {\n if (field.name()) {\n return true;\n }\n\n return false;\n }\n\n /**\n * List of field types availables\n * @returns {Array}\n */\n availableTypes() {\n return {\n url: app.translator.trans('fof-masquerade.admin.types.url'),\n email: app.translator.trans('fof-masquerade.admin.types.email'),\n boolean: app.translator.trans('fof-masquerade.admin.types.boolean'),\n select: app.translator.trans('fof-masquerade.admin.types.select'),\n null: app.translator.trans('fof-masquerade.admin.types.advanced'),\n };\n }\n}\n","import app from 'flarum/admin/app';\nimport Field from './../lib/models/Field';\nimport MasqueradePage from './components/MasqueradePage';\n\napp.initializers.add('fof-masquerade', () => {\n app.store.models['masquerade-field'] = Field;\n\n app.extensionData\n .for('fof-masquerade')\n .registerPage(MasqueradePage)\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.view-profile'),\n permission: 'fof.masquerade.view-profile',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.have-profile'),\n permission: 'fof.masquerade.have-profile',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.edit-others-profile'),\n permission: 'fof.masquerade.edit-others-profile',\n },\n 'moderate'\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","__proto__","_inheritsLoose","subClass","superClass","create","constructor","Field","_Model","_this","_len","arguments","length","args","Array","_key","apply","concat","name","Model","description","type","validation","required","prefix","icon","sort","deleted_at","answer","on_bio","apiEndpoint","this","exists","data","id","addData","element","undefined","h5s","_filter","nodes","selector","NodeList","HTMLCollection","Error","from","filter","item","nodeType","matches","stores","Map","Store","_config","_placeholder","_data","config","forEach","set","mergedConfig","assign","entries","configurable","setConfig","has","getConfig","placeholder","HTMLElement","setData","getData","deleteData","store","sortableElement","addEventListener","eventName","callback","i","removeEventListener","addAttribute","attribute","setAttribute","removeAttribute","dragging","draggingHeight","draggingWidth","originContainer","originIndex","originElementIndex","originItemsBeforeUpdate","previousContainer","destinationItemsBeforeUpdate","_offset","parentElement","getClientRects","rect","left","window","pageXOffset","right","top","pageYOffset","bottom","_index","elementList","indexOf","isInDom","parentNode","insertNode","referenceNode","newElement","position","insertBefore","nextElementSibling","insertAfter","target","_getElementHeight","style","getComputedStyle","getPropertyValue","parseInt","map","int","isNaN","reduce","sum","_getElementWidth","_getHandles","items","querySelector","shadowRoot","getEventTarget","event","composedPath","defaultDragImage","draggedElement","elementOffset","posX","pageX","posY","pageY","_listsConnected","destination","origin","isSortable","acceptFrom","split","sel","defaultConfiguration","connectWith","disableIEFix","copy","placeholderClass","draggingClass","hoverClass","dropTargetContainerClass","debounce","throttleTime","maxItems","itemSerializer","containerSerializer","customDragImage","orientation","_removeItemEvents","_removeContainerEvents","_removeSortableData","sortable","_removeItemData","findSortable","find","el","findDragElement","options","itemlist","children","ele","contains","_enableSortable","opts","handles","handle","document","createElement","dragDrop","parent","sortableElements","method","String","querySelectorAll","slice","test","sortableContainer","customItemSerializer","customContainerSerializer","serializedItem","serializedContainer","serializedItems","node","html","outerHTML","index","container","itemCount","_serialize","configKey","console","warn","_reloadSortable","customPlaceholder","listItems","tempContainer","tagName","appendChild","innerHTML","_a","includes","classList","add","_makePlaceholder","enable","hoverClasses_1","fn","threshold","lastEventTimestamp","_i","now","Date","_throttle","buttons","_b","remove","enableHoverClass","e","stopImmediatePropagation","getAttribute","dragItem","Event","dataTransfer","setDragImage","dragImage","effectAllowed","draggedItem","ditem","cloneNode","display","oldDisplay","_getDragging","dispatchEvent","CustomEvent","detail","elementIndex","originalTarget","itemsBeforeUpdate","outTarget","relatedTarget","fromElement","currentTarget","visiblePlaceholder","values","preventDefault","stopPropagation","originItems","destinationContainer","destinationItems","destinationElementIndex","destinationIndex","func","wait","timeout","debouncedDragOverEnter","forcePlaceholderSize","height","width","thisHeight","thisWidth","placeholderIndex","thisIndex","deadZoneVertical","deadZoneHorizontal","offsetTop","offsetLeft","placeAfter","elementMiddleVertical","offsetHeight","elementMiddleHorizontal","offsetWidth","placeholders","clearTimeout","setTimeout","onDragOverEnter","dropEffect","destroy","_destroySortable","disable","_disableSortable","__testing","SelectFieldOptionEditor","_Component","_proto","oninit","vnode","newOption","view","m","app","trans","option","optionIndex","oninput","updateOption","onclick","moveOption","deleteOption","onchange","addOption","updateRules","attrs","join","rules","rule","parts","moveIndex","newIndex","move","splice","push","Component","MasqueradePage","_ExtensionPage","resetNew","loading","existing","loadExisting","enforceProfileCompletion","settings","sorting","$","updateSort","oncreate","onupdate","content","_this2","Switch","state","saveValue","saveSettings","field","addField","_this3","Button","className","deleteField","bind","toggleField","withAttr","updateExistingFieldInput","href","Select","availableTypes","component","disabled","readyToAdd","updateExistingField","submitAddField","what","_field$pushAttributes","pushAttributes","url","body","then","requestSuccess","parents","toggleClass","_this4","save","attributes","redraw","all","b","_this5","result","pushPayload","createRecord","email","boolean","select","null","ExtensionPage","models","registerPage","registerPermission","label","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 84d7ece..e396cef 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QAC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/C,GAAI3H,IAAAA,MAAAA,UAAoB,sBAAwBT,KAAKoF,KAAKqC,2BAA4B,CACpF,IAAMY,EAAOrI,KAAKoF,KAAKqC,2BAEvBW,EAAME,IACJ,aACAC,IAAAA,UACE,CACE5B,KAAMlG,IAAAA,MAAU,iBAAkB,CAAE+H,SAAUxI,KAAKoF,KAAKqD,SACxD/I,KAAM,iBACN,mBAAoB2I,GAEtB5H,IAAAA,WAAAA,MAAA,iCAAqD4H,EAAO,OAAS,QAArE,aAEF,IAEH,CACF,KC9BDF,EAAAA,EAAAA,QAAOO,IAAAA,UAAoB,aAAa,SAAUN,GAChD,IAAMjD,EAAU1E,IAAAA,MAAAA,UAAoB,sBAAuBT,KAAKoD,MAAMgC,KAAKuD,aAAoB,GAE/FP,EAAME,IACJ,iBACA,aACGnD,EAAQ1C,KAAI,SAAC5C,GACZ,IAAMU,EAAQV,EAAOkB,UAAU,SAM/B,OALauD,EAAYC,aAAa,CACpChE,MAAAA,EACAlC,MAAOwB,EAAOQ,YAGJ2B,aACb,KAGN,GFQF,IAED,IAAM4G,EAAa,CACjB3C,qBAAAA,EACAf,YAAAA,EACAkC,mBAAAA,GAGI1C,EAAQ,CACZ/D,UAAAA,EACA4B,aAAAA,EACAY,WAAAA,EACAY,YAAAA,EACAO,YAAAA,EACAH,SAAAA,E","sources":["webpack://@fof/masquerade/webpack/bootstrap","webpack://@fof/masquerade/webpack/runtime/compat get default export","webpack://@fof/masquerade/webpack/runtime/define property getters","webpack://@fof/masquerade/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/masquerade/webpack/runtime/make namespace object","webpack://@fof/masquerade/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/masquerade/./src/lib/models/Field.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/app']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/masquerade/./src/lib/models/Answer.ts","webpack://@fof/masquerade/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/masquerade/./src/forum/types/BaseField.js","webpack://@fof/masquerade/./src/forum/types/BooleanField.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/masquerade/./src/forum/types/EmailField.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/masquerade/./src/forum/types/SelectField.js","webpack://@fof/masquerade/./src/forum/types/UrlField.js","webpack://@fof/masquerade/./src/forum/types/TypeFactory.js","webpack://@fof/masquerade/./src/forum/panes/ProfilePane.tsx","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/masquerade/./src/forum/panes/ProfileConfigurePane.js","webpack://@fof/masquerade/./src/forum/panes/RootMasqueradePane.tsx","webpack://@fof/masquerade/external root \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/masquerade/./src/forum/index.js","webpack://@fof/masquerade/./src/forum/addProfilePane.js","webpack://@fof/masquerade/./src/forum/mutateUserHero.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['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\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 Field extends Model {\n name = Model.attribute('name');\n description = Model.attribute('description');\n type = Model.attribute('type');\n validation = Model.attribute('validation');\n required = Model.attribute('required');\n prefix = Model.attribute('prefix');\n icon = Model.attribute('icon');\n sort = Model.attribute('sort');\n deleted_at = Model.attribute('deleted_at', Model.transformDate);\n answer = Model.hasOne('answer');\n on_bio = Model.attribute('on_bio');\n\n apiEndpoint() {\n return '/masquerade/fields' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","import app from 'flarum/common/app';\nimport Model from 'flarum/common/Model';\nimport computed from 'flarum/common/utils/computed';\n\nimport type Field from './Field';\n\nexport default class Answer extends Model {\n content = Model.attribute('content');\n fieldId = Model.attribute('fieldId');\n field = computed('fieldId', (fieldId: string) => {\n return app.store.getById('masquerade-field', fieldId);\n });\n userId = Model.attribute('user_id');\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import icon from 'flarum/common/helpers/icon';\n\n/* global m */\n\nexport default class BaseField {\n constructor({ field, set, value }) {\n this.field = field;\n this.set = set;\n this.value = value;\n }\n\n readAttribute(object, attribute) {\n if (typeof object[attribute] === 'function') {\n return object[attribute]();\n }\n\n return object[attribute];\n }\n\n /**\n * Gets all Laravel validation rules split by rule\n * @returns {Array}\n */\n validationRules() {\n return this.readAttribute(this.field, 'validation').split('|');\n }\n\n /**\n * Gets a Laravel validation rule by name\n * @param {string} ruleName\n * @returns {string|null}\n */\n validationRule(ruleName) {\n let ruleContent = null;\n\n this.validationRules().forEach((rule) => {\n const split = rule.split(':', 2);\n\n if (split[0] === ruleName) {\n ruleContent = split[1];\n }\n });\n\n return ruleContent;\n }\n\n editorField() {\n return (\n
\n \n\n
\n {this.field.prefix() ? m('.prefix', this.field.prefix()) : null}\n {this.editorInput()}\n {this.field.description() ?
{this.field.description()}
: null}\n
\n
\n );\n }\n\n editorInput() {\n return ;\n }\n\n editorInputAttrs() {\n return {\n className: 'FormControl',\n oninput: (event) => {\n this.set(event.target.value);\n },\n value: this.value,\n required: this.field.required(),\n };\n }\n\n answerField() {\n const iconName = this.readAttribute(this.field, 'icon');\n\n return (\n
\n \n {iconName && <>{icon(iconName)} }\n {this.readAttribute(this.field, 'name')}:{' '}\n \n {this.answerContent()}\n
\n );\n }\n\n answerContent() {\n return this.value;\n }\n\n hasAnswer() {\n const answerContent = this.answerContent();\n\n if (answerContent === null) {\n return false;\n }\n\n if (typeof answerContent === 'object') {\n return !!Object.keys(answerContent).length;\n }\n\n return !!answerContent?.length;\n }\n\n static isNoOptionSelectedValue(value) {\n // The value can be null when coming from the API\n // The value can be '' when the field does not exist on the user (the empty string is set in ProfileConfigurePane)\n return value === null || value === '';\n }\n}\n","import icon from 'flarum/common/helpers/icon';\nimport BaseField from './BaseField';\n\nexport default class BooleanField extends BaseField {\n editorInput() {\n return this.options().map((option) =>\n m(\n 'div',\n m('label', [\n m('input[type=radio]', {\n checked: option.selected(this.value),\n onclick: () => {\n this.set(option.key);\n },\n }),\n ' ' + option.label,\n ])\n )\n );\n }\n\n options() {\n let options = [];\n\n if (!this.readAttribute(this.field, 'required')) {\n options.push({\n selected: (value) => BaseField.isNoOptionSelectedValue(value),\n key: null,\n label: app.translator.trans('fof-masquerade.forum.fields.select.none-optional'),\n });\n }\n\n options.push({\n selected: (value) => ['true', '1', 1, true, 'yes'].indexOf(value) !== -1,\n key: 'true',\n label: app.translator.trans('fof-masquerade.forum.fields.boolean.yes'),\n });\n\n options.push({\n selected: (value) => ['false', '0', 0, false, 'no'].indexOf(value) !== -1,\n key: 'false',\n label: app.translator.trans('fof-masquerade.forum.fields.boolean.no'),\n });\n\n // This is probably overkill because it looks like the backend casts the value anyway\n if (!BaseField.isNoOptionSelectedValue(this.value) && ['true', '1', 1, true, 'yes', 'false', '0', 0, false, 'no'].indexOf(this.value) === -1) {\n options.push({\n selected: () => true,\n key: this.value,\n label: '(invalid) ' + this.value,\n });\n }\n\n return options;\n }\n\n answerContent() {\n if (BaseField.isNoOptionSelectedValue(this.value)) {\n return '';\n }\n\n return [1, '1', true, 'true', 'yes'].indexOf(this.value) !== -1\n ? [icon('far fa-check-square'), ' ', app.translator.trans('fof-masquerade.forum.fields.boolean.yes')]\n : [icon('far fa-square'), ' ', app.translator.trans('fof-masquerade.forum.fields.boolean.no')];\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","import Button from 'flarum/common/components/Button';\nimport BaseField from './BaseField';\n\nexport default class EmailField extends BaseField {\n editorInputAttrs() {\n let attrs = super.editorInputAttrs();\n\n attrs.type = 'email';\n attrs.placeholder = 'you@example.com';\n\n return attrs;\n }\n\n answerContent() {\n const value = this.value;\n\n if (!value) {\n return null;\n }\n\n const email = value\n .split(/@|\\./)\n .map((segment) => {\n return segment.replace(/(.{2})./g, '$1*');\n })\n .join('*');\n\n return Button.component(\n {\n onclick: () => this.mailTo(),\n className: 'Button Button--text',\n icon: 'far fa-envelope',\n },\n email\n );\n }\n\n mailTo() {\n window.location = 'mailto:' + this.value;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","import app from 'flarum/forum/app';\nimport Select from 'flarum/common/components/Select';\nimport BaseField from './BaseField';\n\nconst NO_OPTION_SELECTED_KEY = 'fof_masquerade_no_option_selected';\n\nexport default class SelectField extends BaseField {\n editorInput() {\n return Select.component({\n onchange: (value) => {\n if (value === NO_OPTION_SELECTED_KEY) {\n value = '';\n }\n\n this.set(value);\n },\n value: BaseField.isNoOptionSelectedValue(this.value) ? NO_OPTION_SELECTED_KEY : this.value,\n options: this.options(),\n });\n }\n\n options() {\n let options = {};\n\n if (!this.readAttribute(this.field, 'required')) {\n options[NO_OPTION_SELECTED_KEY] = app.translator.trans('fof-masquerade.forum.fields.select.none-optional');\n } else if (BaseField.isNoOptionSelectedValue(this.value)) {\n options[NO_OPTION_SELECTED_KEY] = app.translator.trans('fof-masquerade.forum.fields.select.none-required');\n }\n\n const validationIn = this.validationRule('in');\n\n if (validationIn) {\n validationIn.split(',').forEach((value) => {\n options[value] = value;\n });\n }\n\n if (!BaseField.isNoOptionSelectedValue(this.value) && typeof options[this.value] === 'undefined') {\n options[this.value] = '(invalid) ' + this.value;\n }\n\n return options;\n }\n}\n","import Button from 'flarum/common/components/Button';\nimport BaseField from './BaseField';\n\nexport default class UrlField extends BaseField {\n editorInputAttrs() {\n let attrs = super.editorInputAttrs();\n\n attrs.type = 'url';\n attrs.placeholder = 'https://example.com';\n\n return attrs;\n }\n\n answerContent() {\n const value = this.value;\n\n if (!value) {\n return null;\n }\n\n return Button.component(\n {\n onclick: () => this.to(),\n className: 'Button Button--text',\n icon: 'fas fa-link',\n },\n value.replace(/^https?:\\/\\//, '')\n );\n }\n\n to() {\n const popup = window.open();\n popup.location = this.value;\n }\n}\n","import BaseField from './BaseField';\nimport BooleanField from './BooleanField';\nimport EmailField from './EmailField';\nimport SelectField from './SelectField';\nimport UrlField from './UrlField';\n\nexport default class TypeFactory {\n static typeForField({ field, set = undefined, value }) {\n let className = BaseField;\n\n const type = this.identify(field);\n\n if (type) {\n className = this.types()[type];\n }\n\n return new className({\n field,\n set,\n value,\n });\n }\n\n static fieldAttribute(field, attribute) {\n if (typeof field[attribute] === 'function') {\n return field[attribute]();\n }\n\n return field[attribute];\n }\n\n static types() {\n return {\n boolean: BooleanField,\n email: EmailField,\n select: SelectField,\n url: UrlField,\n };\n }\n\n /**\n * Identifies how to parse the field answer.\n * @returns {null|string}\n */\n static identify(field) {\n const validation = (this.fieldAttribute(field, 'validation') || '').split(',');\n let identified = null;\n\n // If the field has a type we use it\n const fieldType = this.fieldAttribute(field, 'type');\n if (typeof this.types()[fieldType] !== 'undefined') {\n return fieldType;\n }\n\n // If it's an advanced field with no type we then guess the best type\n validation.forEach((rule) => {\n rule = rule.trim();\n\n if (typeof this.types()[rule] !== 'undefined') {\n identified = rule;\n }\n });\n\n return identified;\n }\n}\n","import app from 'flarum/forum/app';\n\nimport Component from 'flarum/common/Component';\nimport TypeFactory from '../types/TypeFactory';\nimport type Answer from '../../lib/models/Answer';\nimport type Field from 'src/lib/models/Field';\nimport type User from 'flarum/common/models/User';\n\nexport default class ProfilePane extends Component {\n answers!: Answer[];\n user!: User;\n\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n\n this.answers = [];\n this.user = this.attrs.user;\n\n this.load(this.user);\n }\n\n view() {\n return (\n
\n
\n {app.store\n .all('masquerade-field')\n .sort((a, b) => a.sort() - b.sort())\n .map((field) => {\n const answer = this.answers.find((a) => a.field()?.id() === field.id());\n\n return this.field(field, answer?.content() || '');\n })}\n
\n
\n );\n }\n\n field(field: Field, content) {\n const type = TypeFactory.typeForField({\n field,\n value: content,\n });\n\n return type.answerField();\n }\n\n load() {\n this.answers = this.user.masqueradeAnswers();\n\n if (this.answers === false) {\n this.answers = [];\n app.store.find('users', this.user.id(), { include: 'masqueradeAnswers' }).then(() => {\n this.answers = this.user.masqueradeAnswers();\n m.redraw();\n });\n }\n\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","import app from 'flarum/forum/app';\n\nimport Button from 'flarum/common/components/Button';\nimport Link from 'flarum/common/components/Link';\nimport TypeFactory from '../types/TypeFactory';\nimport Component from 'flarum/common/Component';\n\nexport default class ProfileConfigurePane extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n\n this.enforceProfileCompletion = app.forum.attribute('masquerade.force-profile-completion') || false;\n this.profileCompleted = app.forum.attribute('masquerade.profile-completed') || false;\n this.profileNowCompleted = false; // Show \"after required\" text\n this.answers = [];\n this.answerValues = {};\n this.user = this.attrs.user;\n this.load();\n\n // Show disabled state if everything is saved\n // Unless the profile isn't complete, in which case show enabled button so it's obvious you will need to save\n this.dirty = !this.profileCompleted;\n }\n\n view() {\n return (\n
\n {!!(this.enforceProfileCompletion && !this.profileCompleted) && (\n
{app.translator.trans('fof-masquerade.forum.alerts.profile-completion-required')}
\n )}\n\n
\n {app.store\n .all('masquerade-field')\n .sort((a, b) => a.sort() - b.sort())\n .map((field) => {\n return this.field(field);\n })}\n
\n\n \n\n {!!this.profileNowCompleted && (\n \n {app.translator.trans('fof-masquerade.forum.alerts.profile-completed', {\n a: ,\n })}\n \n )}\n
\n );\n }\n\n field(field) {\n const type = TypeFactory.typeForField({\n field,\n set: this.set.bind(this, field),\n value: this.answerValues[field.id()],\n });\n\n return type.editorField();\n }\n\n load() {\n this.answers = this.user.masqueradeAnswers();\n\n if (this.answers === false) {\n this.answers = [];\n app.store.find('users', this.user.id(), { include: 'masqueradeAnswers' }).then(() => {\n this.answers = this.user.masqueradeAnswers();\n this.answerValues = {};\n\n app.store.all('masquerade-field').forEach((field) => {\n const answer = this.answers.find((a) => a.field()?.id() === field.id());\n\n this.answerValues[field.id()] = answer ? answer.content() : '';\n });\n\n this.loading = false;\n m.redraw();\n });\n } else {\n this.loading = false;\n\n app.store.all('masquerade-field').forEach((field) => {\n const answer = this.answers.find((a) => a.field()?.id() === field.id());\n\n this.answerValues[field.id()] = answer ? answer.content() : '';\n });\n }\n\n m.redraw();\n }\n\n set(field, value) {\n this.answerValues[field.id()] = value;\n this.dirty = true;\n }\n\n update(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/masquerade/configure/' + this.user.id(),\n body: this.answerValues,\n })\n .then((response) => {\n this.dirty = false;\n\n if (!this.profileCompleted) {\n this.profileCompleted = true;\n this.profileNowCompleted = true;\n }\n\n this.parseResponse(response);\n })\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n\n parseResponse(response) {\n console.log(response);\n this.answers = app.store.pushPayload(response);\n this.loading = false;\n m.redraw();\n }\n}\n","import UserPage from 'flarum/forum/components/UserPage';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ProfilePane from './ProfilePane';\nimport ProfileConfigurePane from './ProfileConfigurePane';\n\nexport default class RootMasqueradePane extends UserPage {\n loading = true;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadUser(m.route.param('username'));\n }\n\n pageContentComponent() {\n if (!this.user) return null;\n\n if (this.user.canEditMasqueradeProfile()) return ;\n else return ;\n }\n\n show(user) {\n super.show(user);\n\n this.loading = false;\n m.redraw();\n }\n\n content() {\n return (\n
\n {this.loading && }\n {this.pageContentComponent()}\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","import app from 'flarum/forum/app';\nimport User from 'flarum/common/models/User';\nimport Field from './../lib/models/Field';\nimport Answer from './../lib/models/Answer';\nimport Model from 'flarum/common/Model';\n\nimport addProfilePane from './addProfilePane';\nimport mutateUserHero from './mutateUserHero';\n\n// Exports\nimport ProfileConfigurePane from './panes/ProfileConfigurePane';\nimport ProfilePane from './panes/ProfilePane';\nimport RootMasqueradePane from './panes/RootMasqueradePane';\nimport BaseField from './types/BaseField';\nimport BooleanField from './types/BooleanField';\nimport EmailField from './types/EmailField';\nimport SelectField from './types/SelectField';\nimport TypeFactory from './types/TypeFactory';\nimport UrlField from './types/UrlField';\n\napp.initializers.add('fof-masquerade', (app) => {\n app.store.models['masquerade-field'] = Field;\n app.store.models['masquerade-answer'] = Answer;\n\n User.prototype.bioFields = Model.hasMany('bioFields');\n User.prototype.masqueradeAnswers = Model.hasMany('masqueradeAnswers');\n User.prototype.canEditMasqueradeProfile = Model.attribute('canEditMasqueradeProfile');\n\n addProfilePane();\n\n mutateUserHero();\n});\n\nconst components = {\n ProfileConfigurePane,\n ProfilePane,\n RootMasqueradePane,\n};\n\nconst types = {\n BaseField,\n BooleanField,\n EmailField,\n SelectField,\n TypeFactory,\n UrlField,\n};\n\nexport { components, types };\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport RootMasqueradePane from './panes/RootMasqueradePane';\n\nexport default function addProfilePane() {\n app.routes['fof-masquerade'] = {\n path: '/u/:username/masquerade',\n resolver: {\n onmatch() {\n if (!app.forum.attribute('canViewMasquerade')) throw new Error();\n\n return RootMasqueradePane;\n },\n },\n };\n\n extend(UserPage.prototype, 'navItems', function (items) {\n if (app.forum.attribute('canViewMasquerade') || this.user.canEditMasqueradeProfile()) {\n const edit = this.user.canEditMasqueradeProfile();\n\n items.add(\n 'masquerade',\n LinkButton.component(\n {\n href: app.route('fof-masquerade', { username: this.user.slug() }),\n icon: 'far fa-id-card',\n 'data-editProfile': edit,\n },\n app.translator.trans(`fof-masquerade.forum.buttons.${edit ? 'edit' : 'view'}-profile`)\n ),\n 200\n );\n }\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport TypeFactory from './types/TypeFactory';\n\nexport default function mutateUserHero() {\n extend(UserCard.prototype, 'infoItems', function (items) {\n const answers = app.forum.attribute('canViewMasquerade') ? this.attrs.user.bioFields() || [] : [];\n\n items.add(\n 'masquerade-bio',\n
\n {answers.map((answer) => {\n const field = answer.attribute('field');\n const type = TypeFactory.typeForField({\n field,\n value: answer.content(),\n });\n\n return type.answerField();\n })}\n
\n );\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","Field","name","Model","description","type","validation","required","prefix","icon","sort","deleted_at","answer","on_bio","apiEndpoint","this","exists","data","id","Answer","content","fieldId","field","computed","app","userId","BaseField","set","readAttribute","object","attribute","validationRules","split","validationRule","ruleName","ruleContent","forEach","rule","editorField","class","m","editorInput","editorInputAttrs","className","oninput","event","target","answerField","iconName","hasAnswer","answerContent","keys","length","isNoOptionSelectedValue","BooleanField","options","map","option","checked","selected","onclick","label","push","translator","trans","indexOf","EmailField","attrs","placeholder","email","segment","replace","join","Button","mailTo","window","location","NO_OPTION_SELECTED_KEY","SelectField","Select","onchange","validationIn","UrlField","to","open","TypeFactory","typeForField","undefined","identify","types","fieldAttribute","boolean","select","url","identified","fieldType","trim","ProfilePane","answers","user","oninit","vnode","loading","load","view","b","find","masqueradeAnswers","include","then","redraw","Component","ProfileConfigurePane","enforceProfileCompletion","profileCompleted","profileNowCompleted","answerValues","dirty","onsubmit","update","bind","disabled","href","e","preventDefault","method","body","response","parseResponse","console","log","RootMasqueradePane","loadUser","route","param","pageContentComponent","canEditMasqueradeProfile","show","UserPage","store","models","User","path","resolver","onmatch","Error","extend","items","edit","add","LinkButton","username","slug","UserCard","bioFields","components"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,qECL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,sB,aCAzC,SAASC,EAAgBhB,EAAGiB,GAMzC,OALAD,EAAkBf,OAAOiB,gBAAkB,SAAyBlB,EAAGiB,GAErE,OADAjB,EAAEmB,UAAYF,EACPjB,CACT,EAEOgB,EAAgBhB,EAAGiB,EAC5B,CCNe,SAASG,EAAeC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AAMkC,KAAKqD,aAAoB,GAE/FM,EAAMV,IACJ,iBACAhH,EAAA,WACG8D,EAAQ5C,KAAI,SAAChD,GACZ,IAAMU,EAAQV,EAAOqB,UAAU,SAM/B,OALawD,EAAYC,aAAa,CACpCpE,MAAAA,EACA5C,MAAOkC,EAAOQ,YAGJ8B,aACd,KAGN,GFQF,IAEA,IAAMwH,EAAa,CACjBhD,qBAAAA,EACApB,YAAAA,EACA0C,mBAAAA,GAGIlD,EAAQ,CACZnE,UAAAA,EACA8B,aAAAA,EACAa,WAAAA,EACAY,YAAAA,EACAO,YAAAA,EACAH,SAAAA,E","sources":["webpack://@fof/masquerade/webpack/bootstrap","webpack://@fof/masquerade/webpack/runtime/compat get default export","webpack://@fof/masquerade/webpack/runtime/define property getters","webpack://@fof/masquerade/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/masquerade/webpack/runtime/make namespace object","webpack://@fof/masquerade/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/masquerade/./src/lib/models/Field.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/app']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/masquerade/./src/lib/models/Answer.ts","webpack://@fof/masquerade/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/masquerade/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/masquerade/./src/forum/types/BaseField.js","webpack://@fof/masquerade/./src/forum/types/BooleanField.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/masquerade/./src/forum/types/EmailField.js","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/masquerade/./src/forum/types/SelectField.js","webpack://@fof/masquerade/./src/forum/types/UrlField.js","webpack://@fof/masquerade/./src/forum/types/TypeFactory.js","webpack://@fof/masquerade/./src/forum/panes/ProfilePane.tsx","webpack://@fof/masquerade/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/masquerade/./src/forum/panes/ProfileConfigurePane.js","webpack://@fof/masquerade/./src/forum/panes/RootMasqueradePane.tsx","webpack://@fof/masquerade/external root \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/masquerade/./src/forum/index.js","webpack://@fof/masquerade/./src/forum/addProfilePane.js","webpack://@fof/masquerade/./src/forum/mutateUserHero.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['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\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 Field extends Model {\n name = Model.attribute('name');\n description = Model.attribute('description');\n type = Model.attribute('type');\n validation = Model.attribute('validation');\n required = Model.attribute('required');\n prefix = Model.attribute('prefix');\n icon = Model.attribute('icon');\n sort = Model.attribute('sort');\n deleted_at = Model.attribute('deleted_at', Model.transformDate);\n answer = Model.hasOne('answer');\n on_bio = Model.attribute('on_bio');\n\n apiEndpoint() {\n return '/masquerade/fields' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","import app from 'flarum/common/app';\nimport Model from 'flarum/common/Model';\nimport computed from 'flarum/common/utils/computed';\n\nimport type Field from './Field';\n\nexport default class Answer extends Model {\n content = Model.attribute('content');\n fieldId = Model.attribute('fieldId');\n field = computed('fieldId', (fieldId: string) => {\n return app.store.getById('masquerade-field', fieldId);\n });\n userId = Model.attribute('user_id');\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import icon from 'flarum/common/helpers/icon';\n\n/* global m */\n\nexport default class BaseField {\n constructor({ field, set, value }) {\n this.field = field;\n this.set = set;\n this.value = value;\n }\n\n readAttribute(object, attribute) {\n if (typeof object[attribute] === 'function') {\n return object[attribute]();\n }\n\n return object[attribute];\n }\n\n /**\n * Gets all Laravel validation rules split by rule\n * @returns {Array}\n */\n validationRules() {\n return this.readAttribute(this.field, 'validation').split('|');\n }\n\n /**\n * Gets a Laravel validation rule by name\n * @param {string} ruleName\n * @returns {string|null}\n */\n validationRule(ruleName) {\n let ruleContent = null;\n\n this.validationRules().forEach((rule) => {\n const split = rule.split(':', 2);\n\n if (split[0] === ruleName) {\n ruleContent = split[1];\n }\n });\n\n return ruleContent;\n }\n\n editorField() {\n return (\n
\n \n\n
\n {this.field.prefix() ? m('.prefix', this.field.prefix()) : null}\n {this.editorInput()}\n {this.field.description() ?
{this.field.description()}
: null}\n
\n
\n );\n }\n\n editorInput() {\n return ;\n }\n\n editorInputAttrs() {\n return {\n className: 'FormControl',\n oninput: (event) => {\n this.set(event.target.value);\n },\n value: this.value,\n required: this.field.required(),\n };\n }\n\n answerField() {\n const iconName = this.readAttribute(this.field, 'icon');\n\n return (\n
\n \n {iconName && <>{icon(iconName)} }\n {this.readAttribute(this.field, 'name')}:{' '}\n \n {this.answerContent()}\n
\n );\n }\n\n answerContent() {\n return this.value;\n }\n\n hasAnswer() {\n const answerContent = this.answerContent();\n\n if (answerContent === null) {\n return false;\n }\n\n if (typeof answerContent === 'object') {\n return !!Object.keys(answerContent).length;\n }\n\n return !!answerContent?.length;\n }\n\n static isNoOptionSelectedValue(value) {\n // The value can be null when coming from the API\n // The value can be '' when the field does not exist on the user (the empty string is set in ProfileConfigurePane)\n return value === null || value === '';\n }\n}\n","import icon from 'flarum/common/helpers/icon';\nimport BaseField from './BaseField';\n\nexport default class BooleanField extends BaseField {\n editorInput() {\n return this.options().map((option) =>\n m(\n 'div',\n m('label', [\n m('input[type=radio]', {\n checked: option.selected(this.value),\n onclick: () => {\n this.set(option.key);\n },\n }),\n ' ' + option.label,\n ])\n )\n );\n }\n\n options() {\n let options = [];\n\n if (!this.readAttribute(this.field, 'required')) {\n options.push({\n selected: (value) => BaseField.isNoOptionSelectedValue(value),\n key: null,\n label: app.translator.trans('fof-masquerade.forum.fields.select.none-optional'),\n });\n }\n\n options.push({\n selected: (value) => ['true', '1', 1, true, 'yes'].indexOf(value) !== -1,\n key: 'true',\n label: app.translator.trans('fof-masquerade.forum.fields.boolean.yes'),\n });\n\n options.push({\n selected: (value) => ['false', '0', 0, false, 'no'].indexOf(value) !== -1,\n key: 'false',\n label: app.translator.trans('fof-masquerade.forum.fields.boolean.no'),\n });\n\n // This is probably overkill because it looks like the backend casts the value anyway\n if (!BaseField.isNoOptionSelectedValue(this.value) && ['true', '1', 1, true, 'yes', 'false', '0', 0, false, 'no'].indexOf(this.value) === -1) {\n options.push({\n selected: () => true,\n key: this.value,\n label: '(invalid) ' + this.value,\n });\n }\n\n return options;\n }\n\n answerContent() {\n if (BaseField.isNoOptionSelectedValue(this.value)) {\n return '';\n }\n\n return [1, '1', true, 'true', 'yes'].indexOf(this.value) !== -1\n ? [icon('far fa-check-square'), ' ', app.translator.trans('fof-masquerade.forum.fields.boolean.yes')]\n : [icon('far fa-square'), ' ', app.translator.trans('fof-masquerade.forum.fields.boolean.no')];\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","import Button from 'flarum/common/components/Button';\nimport BaseField from './BaseField';\n\nexport default class EmailField extends BaseField {\n editorInputAttrs() {\n let attrs = super.editorInputAttrs();\n\n attrs.type = 'email';\n attrs.placeholder = 'you@example.com';\n\n return attrs;\n }\n\n answerContent() {\n const value = this.value;\n\n if (!value) {\n return null;\n }\n\n const email = value\n .split(/@|\\./)\n .map((segment) => {\n return segment.replace(/(.{2})./g, '$1*');\n })\n .join('*');\n\n return Button.component(\n {\n onclick: () => this.mailTo(),\n className: 'Button Button--text',\n icon: 'far fa-envelope',\n },\n email\n );\n }\n\n mailTo() {\n window.location = 'mailto:' + this.value;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","import app from 'flarum/forum/app';\nimport Select from 'flarum/common/components/Select';\nimport BaseField from './BaseField';\n\nconst NO_OPTION_SELECTED_KEY = 'fof_masquerade_no_option_selected';\n\nexport default class SelectField extends BaseField {\n editorInput() {\n return Select.component({\n onchange: (value) => {\n if (value === NO_OPTION_SELECTED_KEY) {\n value = '';\n }\n\n this.set(value);\n },\n value: BaseField.isNoOptionSelectedValue(this.value) ? NO_OPTION_SELECTED_KEY : this.value,\n options: this.options(),\n });\n }\n\n options() {\n let options = {};\n\n if (!this.readAttribute(this.field, 'required')) {\n options[NO_OPTION_SELECTED_KEY] = app.translator.trans('fof-masquerade.forum.fields.select.none-optional');\n } else if (BaseField.isNoOptionSelectedValue(this.value)) {\n options[NO_OPTION_SELECTED_KEY] = app.translator.trans('fof-masquerade.forum.fields.select.none-required');\n }\n\n const validationIn = this.validationRule('in');\n\n if (validationIn) {\n validationIn.split(',').forEach((value) => {\n options[value] = value;\n });\n }\n\n if (!BaseField.isNoOptionSelectedValue(this.value) && typeof options[this.value] === 'undefined') {\n options[this.value] = '(invalid) ' + this.value;\n }\n\n return options;\n }\n}\n","import Button from 'flarum/common/components/Button';\nimport BaseField from './BaseField';\n\nexport default class UrlField extends BaseField {\n editorInputAttrs() {\n let attrs = super.editorInputAttrs();\n\n attrs.type = 'url';\n attrs.placeholder = 'https://example.com';\n\n return attrs;\n }\n\n answerContent() {\n const value = this.value;\n\n if (!value) {\n return null;\n }\n\n return Button.component(\n {\n onclick: () => this.to(),\n className: 'Button Button--text',\n icon: 'fas fa-link',\n },\n value.replace(/^https?:\\/\\//, '')\n );\n }\n\n to() {\n const popup = window.open();\n popup.location = this.value;\n }\n}\n","import BaseField from './BaseField';\nimport BooleanField from './BooleanField';\nimport EmailField from './EmailField';\nimport SelectField from './SelectField';\nimport UrlField from './UrlField';\n\nexport default class TypeFactory {\n static typeForField({ field, set = undefined, value }) {\n let className = BaseField;\n\n const type = this.identify(field);\n\n if (type) {\n className = this.types()[type];\n }\n\n return new className({\n field,\n set,\n value,\n });\n }\n\n static fieldAttribute(field, attribute) {\n if (typeof field[attribute] === 'function') {\n return field[attribute]();\n }\n\n return field[attribute];\n }\n\n static types() {\n return {\n boolean: BooleanField,\n email: EmailField,\n select: SelectField,\n url: UrlField,\n };\n }\n\n /**\n * Identifies how to parse the field answer.\n * @returns {null|string}\n */\n static identify(field) {\n const validation = (this.fieldAttribute(field, 'validation') || '').split(',');\n let identified = null;\n\n // If the field has a type we use it\n const fieldType = this.fieldAttribute(field, 'type');\n if (typeof this.types()[fieldType] !== 'undefined') {\n return fieldType;\n }\n\n // If it's an advanced field with no type we then guess the best type\n validation.forEach((rule) => {\n rule = rule.trim();\n\n if (typeof this.types()[rule] !== 'undefined') {\n identified = rule;\n }\n });\n\n return identified;\n }\n}\n","import app from 'flarum/forum/app';\n\nimport Component from 'flarum/common/Component';\nimport TypeFactory from '../types/TypeFactory';\nimport type Answer from '../../lib/models/Answer';\nimport type Field from 'src/lib/models/Field';\nimport type User from 'flarum/common/models/User';\n\nexport default class ProfilePane extends Component {\n answers!: Answer[];\n user!: User;\n\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n\n this.answers = [];\n this.user = this.attrs.user;\n\n this.load(this.user);\n }\n\n view() {\n return (\n
\n
\n {app.store\n .all('masquerade-field')\n .sort((a, b) => a.sort() - b.sort())\n .map((field) => {\n const answer = this.answers.find((a) => a.field()?.id() === field.id());\n\n return this.field(field, answer?.content() || '');\n })}\n
\n
\n );\n }\n\n field(field: Field, content) {\n const type = TypeFactory.typeForField({\n field,\n value: content,\n });\n\n return type.answerField();\n }\n\n load() {\n this.answers = this.user.masqueradeAnswers();\n\n if (this.answers === false) {\n this.answers = [];\n app.store.find('users', this.user.id(), { include: 'masqueradeAnswers' }).then(() => {\n this.answers = this.user.masqueradeAnswers();\n m.redraw();\n });\n }\n\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","import app from 'flarum/forum/app';\n\nimport Button from 'flarum/common/components/Button';\nimport Link from 'flarum/common/components/Link';\nimport TypeFactory from '../types/TypeFactory';\nimport Component from 'flarum/common/Component';\n\nexport default class ProfileConfigurePane extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n\n this.enforceProfileCompletion = app.forum.attribute('masquerade.force-profile-completion') || false;\n this.profileCompleted = app.forum.attribute('masquerade.profile-completed') || false;\n this.profileNowCompleted = false; // Show \"after required\" text\n this.answers = [];\n this.answerValues = {};\n this.user = this.attrs.user;\n this.load();\n\n // Show disabled state if everything is saved\n // Unless the profile isn't complete, in which case show enabled button so it's obvious you will need to save\n this.dirty = !this.profileCompleted;\n }\n\n view() {\n return (\n
\n {!!(this.enforceProfileCompletion && !this.profileCompleted) && (\n
{app.translator.trans('fof-masquerade.forum.alerts.profile-completion-required')}
\n )}\n\n
\n {app.store\n .all('masquerade-field')\n .sort((a, b) => a.sort() - b.sort())\n .map((field) => {\n return this.field(field);\n })}\n
\n\n \n\n {!!this.profileNowCompleted && (\n \n {app.translator.trans('fof-masquerade.forum.alerts.profile-completed', {\n a: ,\n })}\n \n )}\n
\n );\n }\n\n field(field) {\n const type = TypeFactory.typeForField({\n field,\n set: this.set.bind(this, field),\n value: this.answerValues[field.id()],\n });\n\n return type.editorField();\n }\n\n load() {\n this.answers = this.user.masqueradeAnswers();\n\n if (this.answers === false) {\n this.answers = [];\n app.store.find('users', this.user.id(), { include: 'masqueradeAnswers' }).then(() => {\n this.answers = this.user.masqueradeAnswers();\n this.answerValues = {};\n\n app.store.all('masquerade-field').forEach((field) => {\n const answer = this.answers.find((a) => a.field()?.id() === field.id());\n\n this.answerValues[field.id()] = answer ? answer.content() : '';\n });\n\n this.loading = false;\n m.redraw();\n });\n } else {\n this.loading = false;\n\n app.store.all('masquerade-field').forEach((field) => {\n const answer = this.answers.find((a) => a.field()?.id() === field.id());\n\n this.answerValues[field.id()] = answer ? answer.content() : '';\n });\n }\n\n m.redraw();\n }\n\n set(field, value) {\n this.answerValues[field.id()] = value;\n this.dirty = true;\n }\n\n update(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/masquerade/configure/' + this.user.id(),\n body: this.answerValues,\n })\n .then((response) => {\n this.dirty = false;\n\n if (!this.profileCompleted) {\n this.profileCompleted = true;\n this.profileNowCompleted = true;\n }\n\n this.parseResponse(response);\n })\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n\n parseResponse(response) {\n console.log(response);\n this.answers = app.store.pushPayload(response);\n this.loading = false;\n m.redraw();\n }\n}\n","import UserPage from 'flarum/forum/components/UserPage';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ProfilePane from './ProfilePane';\nimport ProfileConfigurePane from './ProfileConfigurePane';\n\nexport default class RootMasqueradePane extends UserPage {\n loading = true;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadUser(m.route.param('username'));\n }\n\n pageContentComponent() {\n if (!this.user) return null;\n\n if (this.user.canEditMasqueradeProfile()) return ;\n else return ;\n }\n\n show(user) {\n super.show(user);\n\n this.loading = false;\n m.redraw();\n }\n\n content() {\n return (\n
\n {this.loading && }\n {this.pageContentComponent()}\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","import app from 'flarum/forum/app';\nimport User from 'flarum/common/models/User';\nimport Field from './../lib/models/Field';\nimport Answer from './../lib/models/Answer';\nimport Model from 'flarum/common/Model';\n\nimport addProfilePane from './addProfilePane';\nimport mutateUserHero from './mutateUserHero';\n\n// Exports\nimport ProfileConfigurePane from './panes/ProfileConfigurePane';\nimport ProfilePane from './panes/ProfilePane';\nimport RootMasqueradePane from './panes/RootMasqueradePane';\nimport BaseField from './types/BaseField';\nimport BooleanField from './types/BooleanField';\nimport EmailField from './types/EmailField';\nimport SelectField from './types/SelectField';\nimport TypeFactory from './types/TypeFactory';\nimport UrlField from './types/UrlField';\n\napp.initializers.add('fof-masquerade', (app) => {\n app.store.models['masquerade-field'] = Field;\n app.store.models['masquerade-answer'] = Answer;\n\n User.prototype.bioFields = Model.hasMany('bioFields');\n User.prototype.masqueradeAnswers = Model.hasMany('masqueradeAnswers');\n User.prototype.canEditMasqueradeProfile = Model.attribute('canEditMasqueradeProfile');\n\n addProfilePane();\n\n mutateUserHero();\n});\n\nconst components = {\n ProfileConfigurePane,\n ProfilePane,\n RootMasqueradePane,\n};\n\nconst types = {\n BaseField,\n BooleanField,\n EmailField,\n SelectField,\n TypeFactory,\n UrlField,\n};\n\nexport { components, types };\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport RootMasqueradePane from './panes/RootMasqueradePane';\n\nexport default function addProfilePane() {\n app.routes['fof-masquerade'] = {\n path: '/u/:username/masquerade',\n resolver: {\n onmatch() {\n if (!app.forum.attribute('canViewMasquerade')) throw new Error();\n\n return RootMasqueradePane;\n },\n },\n };\n\n extend(UserPage.prototype, 'navItems', function (items) {\n if (app.forum.attribute('canViewMasquerade') || this.user.canEditMasqueradeProfile()) {\n const edit = this.user.canEditMasqueradeProfile();\n\n items.add(\n 'masquerade',\n LinkButton.component(\n {\n href: app.route('fof-masquerade', { username: this.user.slug() }),\n icon: 'far fa-id-card',\n 'data-editProfile': edit,\n },\n app.translator.trans(`fof-masquerade.forum.buttons.${edit ? 'edit' : 'view'}-profile`)\n ),\n 200\n );\n }\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport TypeFactory from './types/TypeFactory';\n\nexport default function mutateUserHero() {\n extend(UserCard.prototype, 'infoItems', function (items) {\n const answers = app.forum.attribute('canViewMasquerade') ? this.attrs.user.bioFields() || [] : [];\n\n items.add(\n 'masquerade-bio',\n
\n {answers.map((answer) => {\n const field = answer.attribute('field');\n const type = TypeFactory.typeForField({\n field,\n value: answer.content(),\n });\n\n return type.answerField();\n })}\n
\n );\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","Field","_Model","_this","_len","arguments","length","args","Array","_key","apply","concat","name","Model","description","type","validation","required","prefix","icon","sort","deleted_at","answer","on_bio","apiEndpoint","this","exists","data","id","Answer","content","fieldId","field","computed","app","getById","userId","BaseField","_ref","set","_proto","readAttribute","object","attribute","validationRules","split","validationRule","ruleName","ruleContent","forEach","rule","editorField","m","class","editorInput","editorInputAttrs","className","oninput","event","target","answerField","iconName","hasAnswer","'['","answerContent","keys","isNoOptionSelectedValue","BooleanField","_BaseField","options","map","option","checked","selected","onclick","label","push","translator","trans","indexOf","EmailField","attrs","placeholder","email","segment","replace","join","Button","mailTo","window","location","NO_OPTION_SELECTED_KEY","SelectField","Select","onchange","validationIn","UrlField","to","open","TypeFactory","typeForField","_ref$set","undefined","identify","types","fieldAttribute","boolean","select","url","identified","fieldType","trim","ProfilePane","_Component","answers","user","oninit","vnode","loading","load","view","_this2","all","b","find","_a$field","_this3","masqueradeAnswers","include","then","redraw","Component","ProfileConfigurePane","enforceProfileCompletion","profileCompleted","profileNowCompleted","answerValues","dirty","onsubmit","update","bind","disabled","Link","href","_a$field2","e","preventDefault","method","body","response","parseResponse","console","log","pushPayload","RootMasqueradePane","_UserPage","loadUser","route","param","pageContentComponent","canEditMasqueradeProfile","show","LoadingIndicator","UserPage","add","store","models","User","bioFields","path","resolver","onmatch","Error","extend","items","edit","LinkButton","username","slug","UserCard","components"],"sourceRoot":""} \ No newline at end of file