framework/extensions/mentions/js/dist/forum.js.map
flarum-bot 6b8e9ce1db Bundled output for commit fbbece4bda
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-19 07:30:05 +00:00

1 line
83 KiB
Plaintext
Generated

{"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,wSCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,qC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,oC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,yB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,sC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,0B,aCAxD,MAAM,EAA+BF,OAAOC,KAA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IAGA8S,EAAAA,gBAAAA,gBAAAA,KAAqC,kBAGrCtF,EAAAA,EAAAA,QAAOrD,IAAAA,UAAgB,YAAY,WACjC7L,KAAKqF,EAAE,0BAA0BoI,MAAK,WACpCzN,KAAKyU,UAAUjK,IAAIkK,IAAkBC,iBAAiB3U,MAAM4U,iBAAiB,kBAC/E,GACF,GACF,IAQA7W,OAAO0B,OAAOZ,GAAAA,OAAQgW,G","sources":["webpack://@flarum/mentions/webpack/bootstrap","webpack://@flarum/mentions/webpack/runtime/compat get default export","webpack://@flarum/mentions/webpack/runtime/define property getters","webpack://@flarum/mentions/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/mentions/webpack/runtime/make namespace object","webpack://@flarum/mentions/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/utils/string']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/textContrastClass']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/Post']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/PostPreview']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/Link']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/punctuateSeries']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/mentions/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/mentions/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/mentions/../../../node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/mentions/../../../node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@flarum/mentions/external root \"flarum.core.compat['common/states/PaginatedListState']\"","webpack://@flarum/mentions/./src/forum/state/MentionedByModalState.ts","webpack://@flarum/mentions/./src/forum/components/MentionedByModal.tsx","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/EditPostComposer']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/mentions/./src/forum/utils/getCleanDisplayName.js","webpack://@flarum/mentions/./src/forum/utils/getMentionText.js","webpack://@flarum/mentions/./src/forum/utils/reply.js","webpack://@flarum/mentions/external root \"flarum.core.compat['common/Fragment']\"","webpack://@flarum/mentions/./src/forum/fragments/PostQuoteButton.js","webpack://@flarum/mentions/./src/forum/utils/selectedText.js","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/TextEditorButton']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/utils/KeyboardNavigatable']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/utils/throttleDebounce']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/models/Group']\"","webpack://@flarum/mentions/./src/forum/fragments/AutocompleteDropdown.js","webpack://@flarum/mentions/./src/forum/addComposerAutocomplete.js","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/Notification']\"","webpack://@flarum/mentions/./src/forum/components/PostMentionedNotification.js","webpack://@flarum/mentions/./src/forum/components/UserMentionedNotification.js","webpack://@flarum/mentions/./src/forum/components/GroupMentionedNotification.js","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/models/User']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['common/models/Post']\"","webpack://@flarum/mentions/external root \"flarum.core.compat['forum/components/PostsUserPage']\"","webpack://@flarum/mentions/./src/forum/components/MentionsUserPage.js","webpack://@flarum/mentions/./src/forum/extend.ts","webpack://@flarum/mentions/./src/forum/utils/textFormatter.js","webpack://@flarum/mentions/./src/forum/compat.js","webpack://@flarum/mentions/external assign \"flarum.core\"","webpack://@flarum/mentions/./src/forum/index.js","webpack://@flarum/mentions/./src/forum/addPostMentionPreviews.js","webpack://@flarum/mentions/./src/forum/addMentionedByList.js","webpack://@flarum/mentions/./src/forum/addPostReplyAction.js","webpack://@flarum/mentions/./src/forum/addPostQuoteButton.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/textContrastClass'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostPreview'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/punctuateSeries'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/PaginatedListState'];","import PaginatedListState, { PaginatedListParams } from 'flarum/common/states/PaginatedListState';\nimport Post from 'flarum/common/models/Post';\n\nexport interface MentionedByModalParams extends PaginatedListParams {\n filter: {\n mentionedPost: string;\n };\n sort?: string;\n page?: {\n offset?: number;\n limit: number;\n };\n}\n\nexport default class MentionedByModalState<P extends MentionedByModalParams = MentionedByModalParams> extends PaginatedListState<Post, P> {\n constructor(params: P, page: number = 1) {\n const limit = 10;\n\n params.page = { ...(params.page || {}), limit };\n\n super(params, page, limit);\n }\n\n get type(): string {\n return 'posts';\n }\n}\n","import app from 'flarum/forum/app';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport type Mithril from 'mithril';\nimport type Post from 'flarum/common/models/Post';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModalState from '../state/MentionedByModalState';\n\nexport interface IMentionedByModalAttrs extends IInternalModalAttrs {\n post: Post;\n}\n\nexport default class MentionedByModal<CustomAttrs extends IMentionedByModalAttrs = IMentionedByModalAttrs> extends Modal<\n CustomAttrs,\n MentionedByModalState\n> {\n oninit(vnode: Mithril.Vnode<CustomAttrs, this>) {\n super.oninit(vnode);\n\n this.state = new MentionedByModalState({\n filter: {\n mentionedPost: this.attrs.post.id()!,\n },\n sort: 'number',\n });\n\n this.state.refresh();\n }\n\n className(): string {\n return 'MentionedByModal';\n }\n\n title(): Mithril.Children {\n return app.translator.trans('flarum-mentions.forum.mentioned_by.title');\n }\n\n content(): Mithril.Children {\n return (\n <>\n <div className=\"Modal-body\">\n {this.state.isInitialLoading() ? (\n <LoadingIndicator />\n ) : (\n <>\n <ul className=\"MentionedByModal-list Dropdown-menu Dropdown-menu--inline Post-mentionedBy-preview\">\n {this.state.getPages().map((page) =>\n page.items.map((reply) => (\n <li data-number={reply.number()}>\n <PostPreview post={reply} onclick={() => app.modal.close()} />\n </li>\n ))\n )}\n </ul>\n </>\n )}\n </div>\n {this.state.hasNext() && (\n <div className=\"Modal-footer\">\n <div className=\"Form Form--centered\">\n <div className=\"Form-group\">\n <Button className=\"Button Button--block\" onclick={() => this.state.loadNext()} loading={this.state.isLoadingNext()}>\n {app.translator.trans('flarum-mentions.forum.mentioned_by.load_more_button')}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EditPostComposer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/forum/app';\nimport extractText from 'flarum/common/utils/extractText';\n\n/**\n * Whether to use the old mentions format.\n *\n * `'@username'` or `'@\"Display name\"'`\n */\nexport const shouldUseOldFormat = () => app.forum.attribute('allowUsernameMentionFormat') || false;\n\nconst getDeletedUserText = () => extractText(app.translator.trans('core.lib.username.deleted_text'));\n\n/**\n * Fetches a user's username or display name.\n *\n * Chooses based on the format option set in the admin settings page.\n *\n * @param user An instance of the User model to fetch the username for\n * @param useDisplayName If `true`, uses `user.displayName()`, otherwise, uses `user.username()`\n */\nexport default function getCleanDisplayName(user, useDisplayName = true) {\n if (!user) return getDeletedUserText().replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n\n const text = (useDisplayName ? user.displayName() : user.username()) || getDeletedUserText();\n\n return text.replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n}\n","import getCleanDisplayName, { shouldUseOldFormat } from './getCleanDisplayName';\n\n/**\n * Fetches the mention text for a specified user (and optionally a post ID for replies, or group).\n *\n * Automatically determines which mention syntax to be used based on the option in the\n * admin dashboard. Also performs display name clean-up automatically.\n *\n * @example <caption>New display name syntax</caption>\n * // '@\"User\"#1'\n * getMentionText(User) // User is ID 1, display name is 'User'\n *\n * @example <caption>Replying</caption>\n * // '@\"User\"#p13'\n * getMentionText(User, 13) // User display name is 'User', post ID is 13\n *\n * @example <caption>Using old syntax</caption>\n * // '@username'\n * getMentionText(User) // User's username is 'username'\n *\n * @example <caption>Group mention</caption>\n * // '@\"Mods\"#g4'\n * getMentionText(undefined, undefined, group) // Group display name is 'Mods', group ID is 4\n */\nexport default function getMentionText(user, postId, group) {\n if (user !== undefined && postId === undefined) {\n if (shouldUseOldFormat()) {\n // Plain @username\n const cleanText = getCleanDisplayName(user, false);\n return `@${cleanText}`;\n }\n // @\"Display name\"#UserID\n const cleanText = getCleanDisplayName(user);\n return `@\"${cleanText}\"#${user.id()}`;\n } else if (user !== undefined && postId !== undefined) {\n // @\"Display name\"#pPostID\n const cleanText = getCleanDisplayName(user);\n return `@\"${cleanText}\"#p${postId}`;\n } else if (group !== undefined) {\n // @\"Name Plural\"#gGroupID\n return `@\"${group.namePlural()}\"#g${group.id()}`;\n } else {\n throw 'No parameters were passed';\n }\n}\n","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport EditPostComposer from 'flarum/forum/components/EditPostComposer';\nimport getMentionText from './getMentionText';\n\nexport function insertMention(post, composer, quote) {\n return new Promise((resolve) => {\n const user = post.user();\n const mention = getMentionText(user, post.id()) + ' ';\n\n // If the composer is empty, then assume we're starting a new reply.\n // In which case we don't want the user to have to confirm if they\n // close the composer straight away.\n if (!composer.fields.content()) {\n composer.body.attrs.originalContent = mention;\n }\n\n const cursorPosition = composer.editor.getSelectionRange()[0];\n const preceding = composer.fields.content().slice(0, cursorPosition);\n const precedingNewlines = preceding.length == 0 ? 0 : 3 - preceding.match(/(\\n{0,2})$/)[0].length;\n\n composer.editor.insertAtCursor(\n Array(precedingNewlines).join('\\n') + // Insert up to two newlines, depending on preceding whitespace\n (quote ? '> ' + mention + quote.trim().replace(/\\n/g, '\\n> ') + '\\n\\n' : mention),\n false\n );\n return resolve(composer);\n });\n}\n\nexport default function reply(post, quote) {\n if (app.composer.bodyMatches(EditPostComposer) && app.composer.body.attrs.post.discussion() === post.discussion()) {\n // If we're already editing a post in the discussion of post we're quoting,\n // insert the mention directly.\n return insertMention(post, app.composer, quote);\n } else {\n // The default \"Reply\" action behavior will only open a new composer if\n // necessary, but it will always be a ReplyComposer, hence the exceptional\n // case above.\n return DiscussionControls.replyAction.call(post.discussion()).then((composer) => insertMention(post, composer, quote));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Fragment'];","import app from 'flarum/forum/app';\nimport Fragment from 'flarum/common/Fragment';\nimport icon from 'flarum/common/helpers/icon';\n\nimport reply from '../utils/reply';\n\nexport default class PostQuoteButton extends Fragment {\n constructor(post) {\n super();\n\n this.post = post;\n }\n\n view() {\n return (\n <button\n class=\"Button PostQuoteButton\"\n onclick={() => {\n reply(this.post, this.content);\n }}\n >\n {icon('fas fa-quote-left', { className: 'Button-icon' })}\n {app.translator.trans('flarum-mentions.forum.post.quote_button')}\n </button>\n );\n }\n\n show(left, top) {\n const $this = this.$().show();\n const parentOffset = $this.offsetParent().offset();\n\n $this.css('left', left - parentOffset.left).css('top', top - parentOffset.top);\n\n this.hideHandler = this.hide.bind(this);\n $(document).on('mouseup', this.hideHandler);\n }\n\n showStart(left, top) {\n const $this = this.$();\n\n this.show(left, $(window).scrollTop() + top - $this.outerHeight() - 5);\n }\n\n showEnd(right, bottom) {\n const $this = this.$();\n\n this.show(right - $this.outerWidth(), $(window).scrollTop() + bottom + 5);\n }\n\n hide() {\n this.$().hide();\n $(document).off('mouseup', this.hideHandler);\n }\n}\n","/**\n * Finds the selected text in the provided composer body.\n */\nexport default function selectedText(body) {\n const selection = window.getSelection();\n\n if (!selection.isCollapsed) {\n const range = selection.getRangeAt(0);\n const parent = range.commonAncestorContainer;\n\n if (body[0] === parent || $.contains(body[0], parent)) {\n const clone = $('<div>').append(range.cloneContents());\n\n // Replace emoji images with their shortcode (found in alt attribute)\n clone.find('img.emoji').replaceWith(function () {\n return this.alt;\n });\n\n // Replace all other images with a Markdown image\n clone.find('img').replaceWith(function () {\n return `![](${this.src})`;\n });\n\n // Replace all links with a Markdown link\n clone.find('a').replaceWith(function () {\n return `[${this.innerText}](${this.href})`;\n });\n\n return clone.text();\n }\n }\n return '';\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditor'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditorButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/ReplyComposer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/KeyboardNavigatable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/throttleDebounce'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","import Fragment from 'flarum/common/Fragment';\n\nexport default class AutocompleteDropdown extends Fragment {\n items = [];\n active = false;\n index = 0;\n keyWasJustPressed = false;\n\n view() {\n return (\n <ul className=\"Dropdown-menu MentionsDropdown\">\n {this.items.map((item) => (\n <li>{item}</li>\n ))}\n </ul>\n );\n }\n\n show(left, top) {\n this.$()\n .show()\n .css({\n left: left + 'px',\n top: top + 'px',\n });\n this.active = true;\n }\n\n hide() {\n this.$().hide();\n this.active = false;\n }\n\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => (this.keyWasJustPressed = false), 500);\n }\n\n complete() {\n this.$('li').eq(this.index).find('button').click();\n }\n\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n\n const $dropdown = this.$();\n const $items = $dropdown.find('li');\n let rangedIndex = index;\n\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n\n this.index = rangedIndex;\n\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n\n if (scrollToItem) {\n const dropdownScroll = $dropdown.scrollTop();\n const dropdownTop = $dropdown.offset().top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight();\n const itemTop = $item.offset().top;\n const itemBottom = itemTop + $item.outerHeight();\n\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({ scrollTop }, 100);\n }\n }\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport TextEditorButton from 'flarum/common/components/TextEditorButton';\nimport ReplyComposer from 'flarum/forum/components/ReplyComposer';\nimport EditPostComposer from 'flarum/forum/components/EditPostComposer';\nimport avatar from 'flarum/common/helpers/avatar';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport highlight from 'flarum/common/helpers/highlight';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport { truncate } from 'flarum/common/utils/string';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nimport Badge from 'flarum/common/components/Badge';\nimport Group from 'flarum/common/models/Group';\n\nimport AutocompleteDropdown from './fragments/AutocompleteDropdown';\nimport getMentionText from './utils/getMentionText';\n\nconst throttledSearch = throttle(\n 250, // 250ms timeout\n function (typed, searched, returnedUsers, returnedUserIds, dropdown, buildSuggestions) {\n const typedLower = typed.toLowerCase();\n if (!searched.includes(typedLower)) {\n app.store.find('users', { filter: { q: typed }, page: { limit: 5 } }).then((results) => {\n results.forEach((u) => {\n if (!returnedUserIds.has(u.id())) {\n returnedUserIds.add(u.id());\n returnedUsers.push(u);\n }\n });\n\n buildSuggestions();\n });\n\n searched.push(typedLower);\n }\n }\n);\n\nexport default function addComposerAutocomplete() {\n const $container = $('<div class=\"ComposerBody-mentionsDropdownContainer\"></div>');\n const dropdown = new AutocompleteDropdown();\n\n extend(TextEditor.prototype, 'oncreate', function () {\n const $editor = this.$('.TextEditor-editor').wrap('<div class=\"ComposerBody-mentionsWrapper\"></div>');\n\n this.navigator = new KeyboardNavigatable();\n this.navigator\n .when(() => dropdown.active)\n .onUp(() => dropdown.navigate(-1))\n .onDown(() => dropdown.navigate(1))\n .onSelect(dropdown.complete.bind(dropdown))\n .onCancel(dropdown.hide.bind(dropdown))\n .bindTo($editor);\n\n $editor.after($container);\n });\n\n extend(TextEditor.prototype, 'buildEditorParams', function (params) {\n const searched = [];\n let relMentionStart;\n let absMentionStart;\n let typed;\n let matchTyped;\n\n // We store users returned from an API here to preserve order in which they are returned\n // This prevents the user list jumping around while users are returned.\n // We also use a hashset for user IDs to provide O(1) lookup for the users already in the list.\n const returnedUsers = Array.from(app.store.all('users'));\n const returnedUserIds = new Set(returnedUsers.map((u) => u.id()));\n\n // Store groups, but exclude the two virtual groups - 'Guest' and 'Member'.\n const returnedGroups = Array.from(\n app.store.all('groups').filter((group) => {\n return group.id() != Group.GUEST_ID && group.id() != Group.MEMBER_ID;\n })\n );\n\n const applySuggestion = (replacement) => {\n this.attrs.composer.editor.replaceBeforeCursor(absMentionStart - 1, replacement + ' ');\n\n dropdown.hide();\n };\n\n params.inputListeners.push(() => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n\n const cursor = selection[0];\n\n if (selection[1] - cursor > 0) return;\n\n // Search backwards from the cursor for an '@' symbol. If we find one,\n // we will want to show the autocomplete dropdown!\n const lastChunk = this.attrs.composer.editor.getLastNChars(30);\n absMentionStart = 0;\n for (let i = lastChunk.length - 1; i >= 0; i--) {\n const character = lastChunk.substr(i, 1);\n if (character === '@' && (i == 0 || /\\s/.test(lastChunk.substr(i - 1, 1)))) {\n relMentionStart = i + 1;\n absMentionStart = cursor - lastChunk.length + i + 1;\n break;\n }\n }\n\n dropdown.hide();\n dropdown.active = false;\n\n if (absMentionStart) {\n typed = lastChunk.substring(relMentionStart).toLowerCase();\n matchTyped = typed.match(/^[\"|“]((?:(?!\"#).)+)$/);\n typed = (matchTyped && matchTyped[1]) || typed;\n\n const makeSuggestion = function (user, replacement, content, className = '') {\n const username = usernameHelper(user);\n\n if (typed) {\n username.children = [highlight(username.text, typed)];\n delete username.text;\n }\n\n return (\n <button\n className={'PostPreview ' + className}\n onclick={() => applySuggestion(replacement)}\n onmouseenter={function () {\n dropdown.setIndex($(this).parent().index());\n }}\n >\n <span className=\"PostPreview-content\">\n {avatar(user)}\n {username} {content}\n </span>\n </button>\n );\n };\n\n const makeGroupSuggestion = function (group, replacement, content, className = '') {\n let groupName = group.namePlural().toLowerCase();\n\n if (typed) {\n groupName = highlight(groupName, typed);\n }\n\n return (\n <button\n className={'PostPreview ' + className}\n onclick={() => applySuggestion(replacement)}\n onmouseenter={function () {\n dropdown.setIndex($(this).parent().index());\n }}\n >\n <span className=\"PostPreview-content\">\n <Badge class={`Avatar Badge Badge--group--${group.id()} Badge-icon `} color={group.color()} type=\"group\" icon={group.icon()} />\n <span className=\"username\">{groupName}</span>\n </span>\n </button>\n );\n };\n\n const userMatches = function (user) {\n const names = [user.username(), user.displayName()];\n\n return names.some((name) => name.toLowerCase().substr(0, typed.length) === typed);\n };\n\n const groupMatches = function (group) {\n const names = [group.nameSingular(), group.namePlural()];\n\n return names.some((name) => name.toLowerCase().substr(0, typed.length) === typed);\n };\n\n const buildSuggestions = () => {\n const suggestions = [];\n\n // If the user has started to type a username, then suggest users\n // matching that username.\n if (typed) {\n returnedUsers.forEach((user) => {\n if (!userMatches(user)) return;\n\n suggestions.push(makeSuggestion(user, getMentionText(user), '', 'MentionsDropdown-user'));\n });\n\n // ... or groups.\n if (app.session?.user?.canMentionGroups()) {\n returnedGroups.forEach((group) => {\n if (!groupMatches(group)) return;\n\n suggestions.push(makeGroupSuggestion(group, getMentionText(undefined, undefined, group), '', 'MentionsDropdown-group'));\n });\n }\n }\n\n // If the user is replying to a discussion, or if they are editing a\n // post, then we can suggest other posts in the discussion to mention.\n // We will add the 5 most recent comments in the discussion which\n // match any username characters that have been typed.\n if (this.attrs.composer.bodyMatches(ReplyComposer) || this.attrs.composer.bodyMatches(EditPostComposer)) {\n const composerAttrs = this.attrs.composer.body.attrs;\n const composerPost = composerAttrs.post;\n const discussion = (composerPost && composerPost.discussion()) || composerAttrs.discussion;\n\n if (discussion) {\n discussion\n .posts()\n // Filter to only comment posts, and replies before this message\n .filter((post) => post && post.contentType() === 'comment' && (!composerPost || post.number() < composerPost.number()))\n // Sort by new to old\n .sort((a, b) => b.createdAt() - a.createdAt())\n // Filter to where the user matches what is being typed\n .filter((post) => {\n const user = post.user();\n return user && userMatches(user);\n })\n // Get the first 5\n .splice(0, 5)\n // Make the suggestions\n .forEach((post) => {\n const user = post.user();\n suggestions.push(\n makeSuggestion(\n user,\n getMentionText(user, post.id()),\n [\n app.translator.trans('flarum-mentions.forum.composer.reply_to_post_text', { number: post.number() }),\n ' — ',\n truncate(post.contentPlain(), 200),\n ],\n 'MentionsDropdown-post'\n )\n );\n });\n }\n }\n\n if (suggestions.length) {\n dropdown.items = suggestions;\n m.render($container[0], dropdown.render());\n\n dropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(absMentionStart);\n const width = dropdown.$().outerWidth();\n const height = dropdown.$().outerHeight();\n const parent = dropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n\n dropdown.show(left, top);\n } else {\n dropdown.active = false;\n dropdown.hide();\n }\n };\n\n dropdown.active = true;\n\n buildSuggestions();\n\n dropdown.setIndex(0);\n dropdown.$().scrollTop(0);\n\n // Don't send API calls searching for users until at least 2 characters have been typed.\n // This focuses the mention results on users and posts in the discussion.\n if (typed.length > 1 && app.forum.attribute('canSearchUsers')) {\n throttledSearch(typed, searched, returnedUsers, returnedUserIds, dropdown, buildSuggestions);\n }\n }\n });\n });\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add(\n 'mention',\n <TextEditorButton onclick={() => this.attrs.composer.editor.insertAtCursor(' @')} icon=\"fas fa-at\">\n {app.translator.trans('flarum-mentions.forum.composer.mention_tooltip')}\n </TextEditorButton>\n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\n\nexport default class PostMentionedNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n\n href() {\n const notification = this.attrs.notification;\n const post = notification.subject();\n const content = notification.content();\n\n return app.route.discussion(post.discussion(), content && content.replyNumber);\n }\n\n content() {\n const notification = this.attrs.notification;\n const user = notification.fromUser();\n\n return app.translator.trans('flarum-mentions.forum.notifications.post_mentioned_text', { user, count: 1 });\n }\n\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain() || '', 200);\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\n\nexport default class UserMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n\n href() {\n const post = this.attrs.notification.subject();\n\n return app.route.discussion(post.discussion(), post.number());\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n\n return app.translator.trans('flarum-mentions.forum.notifications.user_mentioned_text', { user });\n }\n\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\n\nexport default class GroupMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n\n href() {\n const post = this.attrs.notification.subject();\n\n return app.route.discussion(post.discussion(), post.number());\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n\n return app.translator.trans('flarum-mentions.forum.notifications.group_mentioned_text', { user });\n }\n\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostsUserPage'];","import app from 'flarum/forum/app';\nimport PostsUserPage from 'flarum/forum/components/PostsUserPage';\n\n/**\n * The `MentionsUserPage` component shows post which user Mentioned at\n */\nexport default class MentionsUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param {Integer} [offset] The position to start getting results from.\n * @return {Promise}\n * @protected\n */\n loadResults(offset) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n mentioned: this.user.id(),\n },\n page: { offset, limit: this.loadLimit },\n sort: '-createdAt',\n });\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\nimport MentionsUserPage from './components/MentionsUserPage';\n\nexport default [\n new Extend.Routes() //\n .add('user.mentions', '/u/:username/mentions', MentionsUserPage),\n\n new Extend.Model(Post) //\n .hasMany<Post>('mentionedBy')\n .attribute<number>('mentionedByCount'),\n\n new Extend.Model(User) //\n .attribute<boolean>('canMentionGroups'),\n];\n","import app from 'flarum/forum/app';\nimport username from 'flarum/common/helpers/username';\nimport extractText from 'flarum/common/utils/extractText';\n\nexport function filterUserMentions(tag) {\n let user;\n\n if (app.forum.attribute('allowUsernameMentionFormat') && tag.hasAttribute('username'))\n user = app.store.getBy('users', 'username', tag.getAttribute('username'));\n else if (tag.hasAttribute('id')) user = app.store.getById('users', tag.getAttribute('id'));\n\n if (user) {\n tag.setAttribute('id', user.id());\n tag.setAttribute('slug', user.slug());\n tag.setAttribute('displayname', extractText(username(user)));\n\n return true;\n }\n\n tag.invalidate();\n}\n\nexport function filterPostMentions(tag) {\n const post = app.store.getById('posts', tag.getAttribute('id'));\n\n if (post) {\n tag.setAttribute('discussionid', post.discussion().id());\n tag.setAttribute('number', post.number());\n tag.setAttribute('displayname', extractText(username(post.user())));\n\n return true;\n }\n}\n\nexport function filterGroupMentions(tag) {\n if (app.session?.user?.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n\n if (group) {\n tag.setAttribute('groupname', extractText(group.namePlural()));\n tag.setAttribute('icon', group.icon());\n tag.setAttribute('color', group.color());\n\n return true;\n }\n }\n\n tag.invalidate();\n}\n","import GroupMentionedNotification from './components/GroupMentionedNotification';\nimport MentionsUserPage from './components/MentionsUserPage';\nimport PostMentionedNotification from './components/PostMentionedNotification';\nimport UserMentionedNotification from './components/UserMentionedNotification';\nimport AutocompleteDropdown from './fragments/AutocompleteDropdown';\nimport PostQuoteButton from './fragments/PostQuoteButton';\nimport getCleanDisplayName from './utils/getCleanDisplayName';\nimport getMentionText from './utils/getMentionText';\nimport * as reply from './utils/reply';\nimport selectedText from './utils/selectedText';\nimport * as textFormatter from './utils/textFormatter';\n\nexport default {\n 'mentions/components/MentionsUserPage': MentionsUserPage,\n 'mentions/components/PostMentionedNotification': PostMentionedNotification,\n 'mentions/components/UserMentionedNotification': UserMentionedNotification,\n 'mentions/components/GroupMentionedNotification': GroupMentionedNotification,\n 'mentions/fragments/AutocompleteDropdown': AutocompleteDropdown,\n 'mentions/fragments/PostQuoteButton': PostQuoteButton,\n 'mentions/utils/getCleanDisplayName': getCleanDisplayName,\n 'mentions/utils/getMentionText': getMentionText,\n 'mentions/utils/reply': reply,\n 'mentions/utils/selectedText': selectedText,\n 'mentions/utils/textFormatter': textFormatter,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport { getPlainContent } from 'flarum/common/utils/string';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport Post from 'flarum/forum/components/Post';\n\nimport addPostMentionPreviews from './addPostMentionPreviews';\nimport addMentionedByList from './addMentionedByList';\nimport addPostReplyAction from './addPostReplyAction';\nimport addPostQuoteButton from './addPostQuoteButton';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport PostMentionedNotification from './components/PostMentionedNotification';\nimport UserMentionedNotification from './components/UserMentionedNotification';\nimport GroupMentionedNotification from './components/GroupMentionedNotification';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport User from 'flarum/common/models/User';\nimport Model from 'flarum/common/Model';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('flarum-mentions', function () {\n // For every mention of a post inside a post's content, set up a hover handler\n // that shows a preview of the mentioned post.\n addPostMentionPreviews();\n\n // In the footer of each post, show information about who has replied (i.e.\n // who the post has been mentioned by).\n addMentionedByList();\n\n // Add a 'reply' control to the footer of each post. When clicked, it will\n // open up the composer and add a post mention to its contents.\n addPostReplyAction();\n\n // Show a Quote button when Post text is selected\n addPostQuoteButton();\n\n // After typing '@' in the composer, show a dropdown suggesting a bunch of\n // posts or users that the user could mention.\n addComposerAutocomplete();\n\n app.notificationComponents.postMentioned = PostMentionedNotification;\n app.notificationComponents.userMentioned = UserMentionedNotification;\n app.notificationComponents.groupMentioned = GroupMentionedNotification;\n\n // Add notification preferences.\n extend(NotificationGrid.prototype, 'notificationTypes', function (items) {\n items.add('postMentioned', {\n name: 'postMentioned',\n icon: 'fas fa-reply',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_post_mentioned_label'),\n });\n\n items.add('userMentioned', {\n name: 'userMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_user_mentioned_label'),\n });\n\n items.add('groupMentioned', {\n name: 'groupMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_group_mentioned_label'),\n });\n });\n\n // Add mentions tab in user profile\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n items.add(\n 'mentions',\n LinkButton.component(\n {\n href: app.route('user.mentions', { username: user.slug() }),\n name: 'mentions',\n icon: 'fas fa-at',\n },\n app.translator.trans('flarum-mentions.forum.user.mentions_link')\n ),\n 80\n );\n });\n\n // Remove post mentions when rendering post previews.\n getPlainContent.removeSelectors.push('a.PostMention');\n\n // Apply color contrast fix on group mentions.\n extend(Post.prototype, 'oncreate', function () {\n this.$('.GroupMention--colored').each(function () {\n this.classList.add(textContrastClass(getComputedStyle(this).getPropertyValue('--group-color')));\n });\n });\n});\n\nexport * from './utils/textFormatter';\n\n// Expose compat API\nimport mentionsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, mentionsCompat);\n","import { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nexport default function addPostMentionPreviews() {\n function addPreviews() {\n const contentHtml = this.attrs.post.contentHtml();\n\n if (contentHtml === this.oldPostContentHtml || this.isEditing()) return;\n\n this.oldPostContentHtml = contentHtml;\n\n const parentPost = this.attrs.post;\n const $parentPost = this.$();\n\n this.$().on('click', '.UserMention:not(.UserMention--deleted), .PostMention:not(.PostMention--deleted)', function (e) {\n m.route.set(this.getAttribute('href'));\n e.preventDefault();\n });\n\n this.$('.PostMention:not(.PostMention--deleted)').each(function () {\n const $this = $(this);\n const id = $this.data('id');\n let timeout;\n\n // Wrap the mention link in a wrapper element so that we can insert a\n // preview popup as its sibling and relatively position it.\n const $preview = $('<ul class=\"Dropdown-menu PostMention-preview fade\"/>');\n $parentPost.append($preview);\n\n const getPostElement = () => {\n return $(`.PostStream-item[data-id=\"${id}\"]`);\n };\n\n const showPreview = () => {\n // When the user hovers their mouse over the mention, look for the\n // post that it's referring to in the stream, and determine if it's\n // in the viewport. If it is, we will \"pulsate\" it.\n const $post = getPostElement();\n let visible = false;\n if ($post.length) {\n const top = $post.offset().top;\n const scrollTop = window.pageYOffset;\n if (top > scrollTop && top + $post.height() < scrollTop + $(window).height()) {\n $post.addClass('pulsate');\n visible = true;\n }\n }\n\n // Otherwise, we will show a popup preview of the post. If the post\n // hasn't yet been loaded, we will need to do that.\n if (!visible) {\n // Position the preview so that it appears above the mention.\n // (The offsetParent should be .Post-body.)\n const positionPreview = () => {\n const previewHeight = $preview.outerHeight(true);\n let offset = 0;\n\n // If the preview goes off the top of the viewport, reposition it to\n // be below the mention.\n if ($this.offset().top - previewHeight < $(window).scrollTop() + $('#header').outerHeight()) {\n offset += $this.outerHeight(true);\n } else {\n offset -= previewHeight;\n }\n\n $preview\n .show()\n .css('top', $this.offset().top - $parentPost.offset().top + offset)\n .css('left', $this.offsetParent().offset().left - $parentPost.offset().left)\n .css('max-width', $this.offsetParent().width());\n };\n\n const showPost = (post) => {\n const discussion = post.discussion();\n\n m.render($preview[0], [\n discussion !== parentPost.discussion() ? (\n <li>\n <span className=\"PostMention-preview-discussion\">{discussion.title()}</span>\n </li>\n ) : (\n ''\n ),\n <li>{PostPreview.component({ post })}</li>,\n ]);\n positionPreview();\n };\n\n const post = app.store.getById('posts', id);\n if (post && post.discussion()) {\n showPost(post);\n } else {\n m.render($preview[0], LoadingIndicator.component());\n app.store.find('posts', id).then(showPost);\n positionPreview();\n }\n\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n }\n };\n\n const hidePreview = () => {\n getPostElement().removeClass('pulsate');\n if ($preview.hasClass('in')) {\n $preview.removeClass('in').one('transitionend', () => $preview.hide());\n }\n };\n\n // On a touch (mobile) device we cannot hover the link to reveal the preview.\n // Instead we cancel the navigation so that a click reveals the preview.\n // Users can then click on the preview to go to the post if desired.\n $this.on('touchend', (e) => {\n if (e.cancelable) {\n e.preventDefault();\n }\n });\n\n $this\n .add($preview)\n .hover(\n () => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n },\n () => {\n clearTimeout(timeout);\n getPostElement().removeClass('pulsate');\n timeout = setTimeout(hidePreview, 250);\n }\n )\n .on('touchend', (e) => {\n showPreview();\n e.stopPropagation();\n });\n\n $(document).on('touchend', hidePreview);\n });\n }\n\n extend(CommentPost.prototype, 'oncreate', addPreviews);\n extend(CommentPost.prototype, 'onupdate', addPreviews);\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Link from 'flarum/common/components/Link';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\nimport icon from 'flarum/common/helpers/icon';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModal from './components/MentionedByModal';\n\nexport default function addMentionedByList() {\n function hidePreview() {\n this.$('.Post-mentionedBy-preview')\n .removeClass('in')\n .one('transitionend', function () {\n $(this).hide();\n });\n }\n\n extend(CommentPost.prototype, 'oncreate', function () {\n let timeout;\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n\n if (replies && replies.length) {\n const $preview = $('<ul class=\"Dropdown-menu Post-mentionedBy-preview fade\"/>');\n this.$().append($preview);\n\n const $parentPost = this.$();\n const $this = this.$('.Post-mentionedBy');\n\n const showPreview = () => {\n if (!$preview.hasClass('in') && $preview.is(':visible')) return;\n\n // When the user hovers their mouse over the list of people who have\n // replied to the post, render a list of reply previews into a\n // popup.\n m.render(\n $preview[0],\n <>\n {replies.map((reply) => (\n <li data-number={reply.number()}>\n {PostPreview.component({\n post: reply,\n onclick: hidePreview.bind(this),\n })}\n </li>\n ))}\n {replies.length < post.mentionedByCount() ? (\n <li className=\"Post-mentionedBy-preview-more\">\n <Button\n className=\"PostPreview Button\"\n onclick={() => {\n hidePreview.call(this);\n app.modal.show(MentionedByModal, { post });\n }}\n >\n <span className=\"PostPreview-content\">\n <span className=\"PostPreview-badge Avatar\">{icon('fas fa-reply-all')}</span>\n <span>\n {app.translator.trans('flarum-mentions.forum.post.mentioned_by_more_text', { count: post.mentionedByCount() - replies.length })}\n </span>\n </span>\n </Button>\n </li>\n ) : null}\n </>\n );\n\n $preview\n .show()\n .css('top', $this.offset().top - $parentPost.offset().top + $this.outerHeight(true))\n .css('left', $this.offsetParent().offset().left - $parentPost.offset().left)\n .css('max-width', $parentPost.width());\n\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n };\n\n $this.add($preview).hover(\n () => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n },\n () => {\n clearTimeout(timeout);\n timeout = setTimeout(hidePreview, 250);\n }\n );\n\n // Whenever the user hovers their mouse over a particular name in the\n // list of repliers, highlight the corresponding post in the preview\n // popup.\n this.$()\n .find('.Post-mentionedBy-summary a')\n .hover(\n function () {\n $preview.find('[data-number=\"' + $(this).data('number') + '\"]').addClass('active');\n },\n function () {\n $preview.find('[data-number]').removeClass('active');\n }\n );\n }\n });\n\n extend(CommentPost.prototype, 'footerItems', function (items) {\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n\n if (replies && replies.length) {\n const users = [];\n const repliers = replies\n .sort((reply) => (reply.user() === app.session.user ? -1 : 0))\n .filter((reply) => {\n const user = reply.user();\n if (users.indexOf(user) === -1) {\n users.push(user);\n return true;\n }\n });\n\n const limit = 4;\n const overLimit = repliers.length > limit;\n\n // Create a list of unique users who have replied. So even if a user has\n // replied twice, they will only be in this array once.\n const names = repliers.slice(0, overLimit ? limit - 1 : limit).map((reply) => {\n const user = reply.user();\n\n return (\n <Link href={app.route.post(reply)} onclick={hidePreview.bind(this)} data-number={reply.number()}>\n {app.session.user === user ? app.translator.trans('flarum-mentions.forum.post.you_text') : username(user)}\n </Link>\n );\n });\n\n // If there are more users that we've run out of room to display, add a \"x\n // others\" name to the end of the list. Clicking on it will display a modal\n // with a full list of names.\n if (overLimit) {\n const count = repliers.length - names.length;\n\n names.push(app.translator.trans('flarum-mentions.forum.post.others_text', { count }));\n }\n\n items.add(\n 'replies',\n <div className=\"Post-mentionedBy\">\n <span className=\"Post-mentionedBy-summary\">\n {icon('fas fa-reply')}\n {app.translator.trans('flarum-mentions.forum.post.mentioned_by' + (repliers[0].user() === app.session.user ? '_self' : '') + '_text', {\n count: names.length,\n users: punctuateSeries(names),\n })}\n </span>\n </div>\n );\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\n\nimport reply from './utils/reply';\n\nexport default function () {\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n\n if (post.isHidden() || (app.session.user && !post.discussion().canReply())) return;\n\n items.add(\n 'reply',\n <Button className=\"Button Button--link\" onclick={() => reply(post)}>\n {app.translator.trans('flarum-mentions.forum.post.reply_link')}\n </Button>\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\n\nimport PostQuoteButton from './fragments/PostQuoteButton';\nimport selectedText from './utils/selectedText';\n\nexport default function addPostQuoteButton() {\n extend(CommentPost.prototype, 'oncreate', function () {\n const post = this.attrs.post;\n\n if (post.isHidden() || (app.session.user && !post.discussion().canReply())) return;\n\n const $postBody = this.$('.Post-body');\n\n // Wrap the quote button in a wrapper element so that we can render\n // button into it.\n const $container = $('<div class=\"Post-quoteButtonContainer\"></div>');\n\n const button = new PostQuoteButton(post);\n\n const handler = function (e) {\n setTimeout(() => {\n const content = selectedText($postBody);\n if (content) {\n button.content = content;\n m.render($container[0], button.render());\n\n const rects = window.getSelection().getRangeAt(0).getClientRects();\n const firstRect = rects[0];\n\n if (e.clientY < firstRect.bottom && e.clientX - firstRect.right < firstRect.left - e.clientX) {\n button.showStart(firstRect.left, firstRect.top);\n } else {\n const lastRect = rects[rects.length - 1];\n button.showEnd(lastRect.right, lastRect.bottom);\n }\n }\n }, 1);\n };\n\n this.$().after($container).on('mouseup', handler);\n\n if ('ontouchstart' in window) {\n document.addEventListener('selectionchange', handler, false);\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","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","_extends","assign","target","i","arguments","length","source","apply","this","_defineProperties","props","descriptor","configurable","writable","MentionedByModalState","params","page","limit","Constructor","protoProps","PaginatedListState","MentionedByModal","oninit","vnode","state","filter","mentionedPost","attrs","post","id","sort","refresh","className","title","app","content","isInitialLoading","getPages","map","items","reply","number","onclick","hasNext","loadNext","loading","isLoadingNext","Modal","getDeletedUserText","extractText","getCleanDisplayName","user","useDisplayName","displayName","username","replace","getMentionText","postId","group","undefined","namePlural","insertMention","composer","quote","Promise","resolve","mention","fields","body","originalContent","cursorPosition","editor","getSelectionRange","preceding","slice","precedingNewlines","match","insertAtCursor","Array","join","trim","EditPostComposer","discussion","DiscussionControls","then","PostQuoteButton","view","class","icon","show","left","top","$this","$","parentOffset","offsetParent","offset","css","hideHandler","hide","document","on","showStart","window","scrollTop","outerHeight","showEnd","right","bottom","outerWidth","off","Fragment","selectedText","selection","getSelection","isCollapsed","range","getRangeAt","parent","commonAncestorContainer","contains","clone","append","cloneContents","find","replaceWith","alt","src","innerText","href","text","AutocompleteDropdown","active","index","keyWasJustPressed","item","navigate","delta","setIndex","clearTimeout","keyWasJustPressedTimeout","setTimeout","complete","eq","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","dropdownTop","dropdownBottom","itemTop","itemBottom","parseInt","stop","animate","throttledSearch","throttle","typed","searched","returnedUsers","returnedUserIds","dropdown","buildSuggestions","typedLower","toLowerCase","includes","q","results","forEach","u","has","add","push","PostMentionedNotification","notification","subject","replyNumber","fromUser","count","excerpt","truncate","contentPlain","Notification","UserMentionedNotification","GroupMentionedNotification","MentionsUserPage","loadResults","type","mentioned","loadLimit","PostsUserPage","Extend","Post","hasMany","attribute","User","filterUserMentions","tag","hasAttribute","getAttribute","setAttribute","slug","invalidate","filterPostMentions","filterGroupMentions","canMentionGroups","color","textFormatter","$container","addPreviews","contentHtml","oldPostContentHtml","isEditing","parentPost","$parentPost","e","m","route","set","preventDefault","each","timeout","data","$preview","getPostElement","showPreview","$post","visible","pageYOffset","height","positionPreview","previewHeight","width","showPost","render","PostPreview","store","getById","LoadingIndicator","hidePreview","hasClass","one","cancelable","hover","stopPropagation","extend","CommentPost","addPostMentionPreviews","replies","mentionedBy","is","mentionedByCount","users","repliers","indexOf","overLimit","names","punctuateSeries","addMentionedByList","isHidden","canReply","$postBody","button","handler","rects","getClientRects","firstRect","clientY","clientX","lastRect","after","addEventListener","TextEditor","$editor","wrap","navigator","KeyboardNavigatable","when","onUp","onDown","onSelect","onCancel","bindTo","relMentionStart","absMentionStart","matchTyped","from","Set","returnedGroups","Group","applySuggestion","replacement","replaceBeforeCursor","inputListeners","cursor","lastChunk","getLastNChars","substr","test","substring","makeSuggestion","usernameHelper","children","highlight","onmouseenter","avatar","userMatches","some","name","suggestions","nameSingular","groupMatches","groupName","makeGroupSuggestion","bodyMatches","ReplyComposer","composerAttrs","composerPost","posts","contentType","b","createdAt","splice","coordinates","getCaretCoordinates","Math","max","NotificationGrid","label","UserPage","LinkButton","getPlainContent","classList","textContrastClass","getComputedStyle","getPropertyValue","mentionsCompat"],"sourceRoot":""}