{"version":3,"file":"_id_-legacy.D9dbN5Ie.js","sources":["../../../../components/AutoHeightTextarea.vue","../../../../components/NewsLocation.vue","../../../../components/NewsCommunityEventVolunteerSummary.vue","../../../../components/NewsPreview.vue","../../../../components/NewsRefer.vue","../../../../components/NewsHighlight.vue","../../../../components/NewsUserInfo.vue","../../../../node_modules/vue-mention/dist/vue-mention.es.js","../../../../components/OurAtTa.vue","../../../../components/NewsPhotoModal.vue","../../../../components/NewsLovesUserInfo.vue","../../../../components/NewsLovesModal.vue","../../../../components/NewsEditModal.vue","../../../../components/NewsReply.vue","../../../../components/NewsReplies.vue","../../../../components/NewsReportModal.vue","../../../../components/NewsUserIntro.vue","../../../../components/NewsLoveComment.vue","../../../../components/NewsShareModal.vue","../../../../components/NewsBase.vue","../../../../components/NewsMessage.vue","../../../../components/NewsAboutMe.vue","../../../../components/NewsCommunityEvent.vue","../../../../components/NewsVolunteerOpportunity.vue","../../../../components/NewsStory.vue","../../../../components/NewsAlert.vue","../../../../components/NewsNoticeboard.vue","../../../../components/NewsThread.vue","../../../../pages/chitchat/[[id]].vue"],"sourcesContent":["\n\n","\n\n","\n\n","\n\n\n","\n\n\n\n","\n\n\n","\n\n","var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nimport { options, Dropdown } from \"floating-vue\";\nimport { defineComponent, ref, watch, computed, onMounted, onUpdated, onUnmounted, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, createVNode, mergeProps, withCtx, Fragment, renderList, createTextVNode, toDisplayString, createElementVNode, normalizeStyle } from \"vue\";\nvar textareaCaret = { exports: {} };\n(function(module) {\n (function() {\n var properties = [\n \"direction\",\n \"boxSizing\",\n \"width\",\n \"height\",\n \"overflowX\",\n \"overflowY\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderStyle\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"fontStyle\",\n \"fontVariant\",\n \"fontWeight\",\n \"fontStretch\",\n \"fontSize\",\n \"fontSizeAdjust\",\n \"lineHeight\",\n \"fontFamily\",\n \"textAlign\",\n \"textTransform\",\n \"textIndent\",\n \"textDecoration\",\n \"letterSpacing\",\n \"wordSpacing\",\n \"tabSize\",\n \"MozTabSize\"\n ];\n var isBrowser = typeof window !== \"undefined\";\n var isFirefox = isBrowser && window.mozInnerScreenX != null;\n function getCaretCoordinates(element, position, options2) {\n if (!isBrowser) {\n throw new Error(\"textarea-caret-position#getCaretCoordinates should only be called in a browser\");\n }\n var debug = options2 && options2.debug || false;\n if (debug) {\n var el = document.querySelector(\"#input-textarea-caret-position-mirror-div\");\n if (el)\n el.parentNode.removeChild(el);\n }\n var div = document.createElement(\"div\");\n div.id = \"input-textarea-caret-position-mirror-div\";\n document.body.appendChild(div);\n var style = div.style;\n var computed2 = window.getComputedStyle ? window.getComputedStyle(element) : element.currentStyle;\n var isInput = element.nodeName === \"INPUT\";\n style.whiteSpace = \"pre-wrap\";\n if (!isInput)\n style.wordWrap = \"break-word\";\n style.position = \"absolute\";\n if (!debug)\n style.visibility = \"hidden\";\n properties.forEach(function(prop) {\n if (isInput && prop === \"lineHeight\") {\n style.lineHeight = computed2.height;\n } else {\n style[prop] = computed2[prop];\n }\n });\n if (isFirefox) {\n if (element.scrollHeight > parseInt(computed2.height))\n style.overflowY = \"scroll\";\n } else {\n style.overflow = \"hidden\";\n }\n div.textContent = element.value.substring(0, position);\n if (isInput)\n div.textContent = div.textContent.replace(/\\s/g, \"\\xA0\");\n var span = document.createElement(\"span\");\n span.textContent = element.value.substring(position) || \".\";\n div.appendChild(span);\n var coordinates = {\n top: span.offsetTop + parseInt(computed2[\"borderTopWidth\"]),\n left: span.offsetLeft + parseInt(computed2[\"borderLeftWidth\"]),\n height: parseInt(computed2[\"lineHeight\"])\n };\n if (debug) {\n span.style.backgroundColor = \"#aaa\";\n } else {\n document.body.removeChild(div);\n }\n return coordinates;\n }\n {\n module.exports = getCaretCoordinates;\n }\n })();\n})(textareaCaret);\nvar getCaretPosition = textareaCaret.exports;\nvar _export_sfc = (sfc, props) => {\n const target = sfc.__vccOpts || sfc;\n for (const [key, val] of props) {\n target[key] = val;\n }\n return target;\n};\noptions.themes.mentionable = {\n $extend: \"dropdown\",\n placement: \"top-start\",\n arrowPadding: 6,\n arrowOverflow: false\n};\nconst _sfc_main = defineComponent({\n components: {\n VDropdown: Dropdown\n },\n inheritAttrs: false,\n props: {\n keys: {\n type: Array,\n required: true\n },\n items: {\n type: Array,\n default: () => []\n },\n omitKey: {\n type: Boolean,\n default: false\n },\n filteringDisabled: {\n type: Boolean,\n default: false\n },\n insertSpace: {\n type: Boolean,\n default: false\n },\n mapInsert: {\n type: Function,\n default: null\n },\n limit: {\n type: Number,\n default: 8\n },\n theme: {\n type: String,\n default: \"mentionable\"\n },\n caretHeight: {\n type: Number,\n default: 0\n }\n },\n emits: [\"search\", \"open\", \"close\", \"apply\"],\n setup(props, { emit }) {\n const currentKey = ref(null);\n let currentKeyIndex;\n const oldKey = ref(null);\n const searchText = ref(null);\n watch(searchText, (value, oldValue) => {\n if (value) {\n emit(\"search\", value, oldValue);\n }\n });\n const filteredItems = computed(() => {\n if (!searchText.value || props.filteringDisabled) {\n return props.items;\n }\n const finalSearchText = searchText.value.toLowerCase();\n return props.items.filter((item) => {\n let text;\n if (item.searchText) {\n text = item.searchText;\n } else if (item.label) {\n text = item.label;\n } else {\n text = \"\";\n for (const key in item) {\n text += item[key];\n }\n }\n return text.toLowerCase().includes(finalSearchText);\n });\n });\n const displayedItems = computed(() => filteredItems.value.slice(0, props.limit));\n const selectedIndex = ref(0);\n watch(displayedItems, () => {\n selectedIndex.value = 0;\n }, {\n deep: true\n });\n let input;\n const el = ref(null);\n function getInput() {\n var _a, _b;\n return (_b = (_a = el.value.querySelector(\"input\")) != null ? _a : el.value.querySelector(\"textarea\")) != null ? _b : el.value.querySelector('[contenteditable=\"true\"]');\n }\n onMounted(() => {\n input = getInput();\n attach();\n });\n onUpdated(() => {\n const newInput = getInput();\n if (newInput !== input) {\n detach();\n input = newInput;\n attach();\n }\n });\n onUnmounted(() => {\n detach();\n });\n function attach() {\n if (input) {\n input.addEventListener(\"input\", onInput);\n input.addEventListener(\"keydown\", onKeyDown);\n input.addEventListener(\"keyup\", onKeyUp);\n input.addEventListener(\"scroll\", onScroll);\n input.addEventListener(\"blur\", onBlur);\n }\n }\n function detach() {\n if (input) {\n input.removeEventListener(\"input\", onInput);\n input.removeEventListener(\"keydown\", onKeyDown);\n input.removeEventListener(\"keyup\", onKeyUp);\n input.removeEventListener(\"scroll\", onScroll);\n input.removeEventListener(\"blur\", onBlur);\n }\n }\n function onInput() {\n checkKey();\n }\n function onBlur() {\n closeMenu();\n }\n function onKeyDown(e) {\n if (currentKey.value) {\n if (e.key === \"ArrowDown\") {\n selectedIndex.value++;\n if (selectedIndex.value >= displayedItems.value.length) {\n selectedIndex.value = 0;\n }\n cancelEvent(e);\n }\n if (e.key === \"ArrowUp\") {\n selectedIndex.value--;\n if (selectedIndex.value < 0) {\n selectedIndex.value = displayedItems.value.length - 1;\n }\n cancelEvent(e);\n }\n if ((e.key === \"Enter\" || e.key === \"Tab\") && displayedItems.value.length > 0) {\n applyMention(selectedIndex.value);\n cancelEvent(e);\n }\n if (e.key === \"Escape\") {\n closeMenu();\n cancelEvent(e);\n }\n }\n }\n let cancelKeyUp = null;\n function onKeyUp(e) {\n if (cancelKeyUp && e.key === cancelKeyUp) {\n cancelEvent(e);\n }\n cancelKeyUp = null;\n }\n function cancelEvent(e) {\n e.preventDefault();\n e.stopPropagation();\n cancelKeyUp = e.key;\n }\n function onScroll() {\n updateCaretPosition();\n }\n function getSelectionStart() {\n return input.isContentEditable ? window.getSelection().anchorOffset : input.selectionStart;\n }\n function setCaretPosition(index) {\n nextTick(() => {\n input.selectionEnd = index;\n });\n }\n function getValue() {\n return input.isContentEditable ? window.getSelection().anchorNode.textContent : input.value;\n }\n function setValue(value) {\n input.value = value;\n emitInputEvent(\"input\");\n }\n function emitInputEvent(type) {\n input.dispatchEvent(new Event(type));\n }\n let lastSearchText = null;\n function checkKey() {\n const index = getSelectionStart();\n if (index >= 0) {\n const { key, keyIndex } = getLastKeyBeforeCaret(index);\n const text = lastSearchText = getLastSearchText(index, keyIndex);\n if (!(keyIndex < 1 || /\\s/.test(getValue()[keyIndex - 1]))) {\n return false;\n }\n if (text != null) {\n openMenu(key, keyIndex);\n searchText.value = text;\n return true;\n }\n }\n closeMenu();\n return false;\n }\n function getLastKeyBeforeCaret(caretIndex) {\n const [keyData] = props.keys.map((key) => ({\n key,\n keyIndex: getValue().lastIndexOf(key, caretIndex - 1)\n })).sort((a, b) => b.keyIndex - a.keyIndex);\n return keyData;\n }\n function getLastSearchText(caretIndex, keyIndex) {\n if (keyIndex !== -1) {\n const text = getValue().substring(keyIndex + 1, caretIndex);\n if (!/\\s/.test(text)) {\n return text;\n }\n }\n return null;\n }\n const caretPosition = ref(null);\n function updateCaretPosition() {\n if (currentKey.value) {\n if (input.isContentEditable) {\n const rect = window.getSelection().getRangeAt(0).getBoundingClientRect();\n const inputRect = input.getBoundingClientRect();\n caretPosition.value = {\n left: rect.left - inputRect.left,\n top: rect.top - inputRect.top,\n height: rect.height\n };\n } else {\n caretPosition.value = getCaretPosition(input, currentKeyIndex);\n }\n caretPosition.value.top -= input.scrollTop;\n if (props.caretHeight) {\n caretPosition.value.height = props.caretHeight;\n } else if (isNaN(caretPosition.value.height)) {\n caretPosition.value.height = 16;\n }\n }\n }\n function openMenu(key, keyIndex) {\n if (currentKey.value !== key) {\n currentKey.value = key;\n currentKeyIndex = keyIndex;\n updateCaretPosition();\n selectedIndex.value = 0;\n emit(\"open\", currentKey.value);\n }\n }\n function closeMenu() {\n if (currentKey.value != null) {\n oldKey.value = currentKey.value;\n currentKey.value = null;\n emit(\"close\", oldKey.value);\n }\n }\n function applyMention(itemIndex) {\n const item = displayedItems.value[itemIndex];\n const value = (props.omitKey ? \"\" : currentKey.value) + String(props.mapInsert ? props.mapInsert(item, currentKey.value) : item.value) + (props.insertSpace ? \" \" : \"\");\n if (input.isContentEditable) {\n const range = window.getSelection().getRangeAt(0);\n range.setStart(range.startContainer, range.startOffset - currentKey.value.length - (lastSearchText ? lastSearchText.length : 0));\n range.deleteContents();\n range.insertNode(document.createTextNode(value));\n range.setStart(range.endContainer, range.endOffset);\n emitInputEvent(\"input\");\n } else {\n setValue(replaceText(getValue(), searchText.value, value, currentKeyIndex));\n setCaretPosition(currentKeyIndex + value.length);\n }\n emit(\"apply\", item, currentKey.value, value);\n closeMenu();\n }\n function replaceText(text, searchString, newText, index) {\n return text.slice(0, index) + newText + text.slice(index + searchString.length + 1, text.length);\n }\n return {\n el,\n currentKey,\n oldKey,\n caretPosition,\n displayedItems,\n selectedIndex,\n applyMention\n };\n }\n});\nconst _hoisted_1 = { key: 0 };\nconst _hoisted_2 = /* @__PURE__ */ createTextVNode(\" No result \");\nconst _hoisted_3 = [\"onMouseover\", \"onMousedown\"];\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_VDropdown = resolveComponent(\"VDropdown\");\n return openBlock(), createElementBlock(\"div\", {\n ref: \"el\",\n class: normalizeClass([\"mentionable\", _ctx.$attrs.class]),\n style: { \"position\": \"relative\" }\n }, [\n renderSlot(_ctx.$slots, \"default\"),\n createVNode(_component_VDropdown, mergeProps({ ref: \"popper\" }, __spreadProps(__spreadValues({}, _ctx.$attrs), { class: void 0 }), {\n shown: !!_ctx.currentKey,\n triggers: [],\n \"auto-hide\": false,\n theme: _ctx.theme,\n class: \"popper\",\n style: [{ \"position\": \"absolute\" }, _ctx.caretPosition ? {\n top: `${_ctx.caretPosition.top}px`,\n left: `${_ctx.caretPosition.left}px`\n } : {}]\n }), {\n popper: withCtx(() => [\n !_ctx.displayedItems.length ? (openBlock(), createElementBlock(\"div\", _hoisted_1, [\n renderSlot(_ctx.$slots, \"no-result\", {}, () => [\n _hoisted_2\n ])\n ])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.displayedItems, (item, index) => {\n return openBlock(), createElementBlock(\"div\", {\n key: index,\n class: normalizeClass([\"mention-item\", {\n \"mention-selected\": _ctx.selectedIndex === index\n }]),\n onMouseover: ($event) => _ctx.selectedIndex = index,\n onMousedown: ($event) => _ctx.applyMention(index)\n }, [\n renderSlot(_ctx.$slots, `item-${_ctx.currentKey || _ctx.oldKey}`, {\n item,\n index\n }, () => [\n renderSlot(_ctx.$slots, \"item\", {\n item,\n index\n }, () => [\n createTextVNode(toDisplayString(item.label || item.value), 1)\n ])\n ])\n ], 42, _hoisted_3);\n }), 128))\n ]),\n default: withCtx(() => [\n createElementVNode(\"div\", {\n style: normalizeStyle(_ctx.caretPosition ? {\n height: `${_ctx.caretPosition.height}px`\n } : {})\n }, null, 4)\n ]),\n _: 3\n }, 16, [\"shown\", \"theme\", \"style\"])\n ], 2);\n}\nvar Mentionable = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"render\", _sfc_render]]);\nfunction registerComponents(app, prefix) {\n app.component(`${prefix}mentionable`, Mentionable);\n app.component(`${prefix}Mentionable`, Mentionable);\n}\nfunction install(app, options2) {\n const finalOptions = Object.assign({}, {\n installComponents: true,\n componentsPrefix: \"\"\n }, options2);\n if (finalOptions.installComponents) {\n registerComponents(app, finalOptions.componentsPrefix);\n }\n}\nconst plugin = {\n version: \"2.0.0-alpha.3\",\n install\n};\nexport { Mentionable, plugin as default, install };\n","\n\n","\n\n\n","\n\n","\n\n\n","\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n","\n\n\n","\n\n\n\n","\n\n","\n\n\n","\n\n","\n\n\n","\n\n\n","\n\n","\n\n\n\n","\n\n","