diff --git a/framework/core/js/dist-typings/admin/components/GeneralSearchSource.d.ts b/framework/core/js/dist-typings/admin/components/GeneralSearchSource.d.ts index 063e23e81f..2224ebc08b 100644 --- a/framework/core/js/dist-typings/admin/components/GeneralSearchSource.d.ts +++ b/framework/core/js/dist-typings/admin/components/GeneralSearchSource.d.ts @@ -1,5 +1,5 @@ import type Mithril from 'mithril'; -import type { SearchSource } from './Search'; +import type { GlobalSearchSource } from './GlobalSearch'; import { GeneralIndexData } from '../states/GeneralSearchIndex'; import { ExtensionConfig } from '../utils/AdminRegistry'; export declare class GeneralSearchResult { @@ -20,7 +20,7 @@ export declare class GeneralSearchResult { /** * Finds and displays settings, permissions and installed extensions (i.e. general search results) in the search dropdown. */ -export default class GeneralSearchSource implements SearchSource { +export default class GeneralSearchSource implements GlobalSearchSource { protected results: Map; resource: string; title(): string; diff --git a/framework/core/js/dist-typings/admin/components/GlobalSearch.d.ts b/framework/core/js/dist-typings/admin/components/GlobalSearch.d.ts new file mode 100644 index 0000000000..93daac0792 --- /dev/null +++ b/framework/core/js/dist-typings/admin/components/GlobalSearch.d.ts @@ -0,0 +1,8 @@ +import ItemList from '../../common/utils/ItemList'; +import AbstractGlobalSearch, { type SearchAttrs, type GlobalSearchSource as BaseGlobalSearchSource } from '../../common/components/AbstractGlobalSearch'; +export interface GlobalSearchSource extends BaseGlobalSearchSource { +} +export default class GlobalSearch extends AbstractGlobalSearch { + static initAttrs(attrs: SearchAttrs): void; + sourceItems(): ItemList; +} diff --git a/framework/core/js/dist-typings/admin/components/Search.d.ts b/framework/core/js/dist-typings/admin/components/Search.d.ts deleted file mode 100644 index be05b7aa43..0000000000 --- a/framework/core/js/dist-typings/admin/components/Search.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import ItemList from '../../common/utils/ItemList'; -import AbstractSearch, { type SearchAttrs, type SearchSource as BaseSearchSource } from '../../common/components/AbstractSearch'; -export interface SearchSource extends BaseSearchSource { -} -export default class Search extends AbstractSearch { - static initAttrs(attrs: SearchAttrs): void; - sourceItems(): ItemList; -} diff --git a/framework/core/js/dist-typings/common/components/AbstractSearch.d.ts b/framework/core/js/dist-typings/common/components/AbstractGlobalSearch.d.ts similarity index 82% rename from framework/core/js/dist-typings/common/components/AbstractSearch.d.ts rename to framework/core/js/dist-typings/common/components/AbstractGlobalSearch.d.ts index 4f78172280..e2cb1a5380 100644 --- a/framework/core/js/dist-typings/common/components/AbstractSearch.d.ts +++ b/framework/core/js/dist-typings/common/components/AbstractGlobalSearch.d.ts @@ -9,16 +9,16 @@ export interface SearchAttrs extends ComponentAttrs { a11yRoleLabel: string; } /** - * The `SearchSource` interface defines a section of search results in the - * search dropdown. + * The `SearchSource` interface defines a tab of search results in the + * search modal. * - * Search sources should be registered with the `Search` component class + * Search sources should be registered with the `GlobalSearch` component class * by extending the `sourceItems` method. When the user types a * query, each search source will be prompted to load search results via the - * `search` method. When the dropdown is redrawn, it will be constructed by + * `search` method. When the search modal's dropdown is redrawn, it will be constructed by * putting together the output from the `view` method of each source. */ -export interface SearchSource { +export interface GlobalSearchSource { /** * The resource type that this search source is responsible for. */ @@ -61,7 +61,7 @@ export interface SearchSource { * * Must be extended and the abstract methods implemented per-frontend. */ -export default abstract class AbstractSearch extends Component { +export default abstract class AbstractGlobalSearch extends Component { /** * The instance of `SearchState` for this component. */ @@ -71,5 +71,5 @@ export default abstract class AbstractSearch; + abstract sourceItems(): ItemList; } diff --git a/framework/core/js/dist-typings/common/components/SearchModal.d.ts b/framework/core/js/dist-typings/common/components/SearchModal.d.ts index cc50356669..7decb47e7c 100644 --- a/framework/core/js/dist-typings/common/components/SearchModal.d.ts +++ b/framework/core/js/dist-typings/common/components/SearchModal.d.ts @@ -6,11 +6,11 @@ import KeyboardNavigatable from '../utils/KeyboardNavigatable'; import Stream from '../utils/Stream'; import ItemList from '../utils/ItemList'; import GambitsAutocomplete from '../utils/GambitsAutocomplete'; -import type { SearchSource } from './AbstractSearch'; +import type { GlobalSearchSource } from './AbstractGlobalSearch'; export interface ISearchModalAttrs extends IFormModalAttrs { onchange: (value: string) => void; searchState: SearchState; - sources: SearchSource[]; + sources: GlobalSearchSource[]; } export default class SearchModal extends FormModal { static LIMIT: number; @@ -19,11 +19,11 @@ export default class SearchModal; + protected activeSource: Stream; /** * The sources that are still loading results. */ @@ -46,7 +46,7 @@ export default class SearchModal; activeTabItems(): ItemList; - switchSource(source: SearchSource): void; + switchSource(source: GlobalSearchSource): void; gambits(): JSX.Element[]; /** * Transforms a simple search text to wrap valid gambits in a mark tag. diff --git a/framework/core/js/dist-typings/forum/components/DiscussionsSearchItem.d.ts b/framework/core/js/dist-typings/forum/components/DiscussionsSearchItem.d.ts new file mode 100644 index 0000000000..2b2b1af2e0 --- /dev/null +++ b/framework/core/js/dist-typings/forum/components/DiscussionsSearchItem.d.ts @@ -0,0 +1,20 @@ +import Component, { ComponentAttrs } from '../../common/Component'; +import Discussion from '../../common/models/Discussion'; +import Post from '../../common/models/Post'; +import type Mithril from 'mithril'; +import ItemList from '../../common/utils/ItemList'; +export interface DiscussionsSearchItemAttrs extends ComponentAttrs { + query: string; + discussion: Discussion; + mostRelevantPost: Post; +} +export default class DiscussionsSearchItem extends Component { + query: string; + discussion: Discussion; + mostRelevantPost: Post | null | undefined; + oninit(vnode: Mithril.Vnode): void; + view(): JSX.Element; + discussionTitle(): string; + mostRelevantPostContent(): string | null | undefined; + viewItems(): ItemList; +} diff --git a/framework/core/js/dist-typings/forum/components/DiscussionsSearchSource.d.ts b/framework/core/js/dist-typings/forum/components/DiscussionsSearchSource.d.ts index 48575b359d..7d28d29e8b 100644 --- a/framework/core/js/dist-typings/forum/components/DiscussionsSearchSource.d.ts +++ b/framework/core/js/dist-typings/forum/components/DiscussionsSearchSource.d.ts @@ -1,18 +1,17 @@ +import { SearchSource } from './Search'; import type Mithril from 'mithril'; -import type Discussion from '../../common/models/Discussion'; -import type { SearchSource } from './Search'; +import Discussion from '../../common/models/Discussion'; /** * The `DiscussionsSearchSource` finds and displays discussion search results in * the search dropdown. */ export default class DiscussionsSearchSource implements SearchSource { protected results: Map; - resource: string; - title(): string; - isCached(query: string): boolean; - search(query: string, limit: number): Promise; + queryString: string | null; + search(query: string): Promise; view(query: string): Array; - customGrouping(): boolean; - fullPage(query: string): Mithril.Vnode; - gotoItem(id: string): string | null; + includes(): string[]; + limit(): number; + queryMutators(): string[]; + setQueryString(query: string): void; } diff --git a/framework/core/js/dist-typings/forum/components/GlobalDiscussionsSearchSource.d.ts b/framework/core/js/dist-typings/forum/components/GlobalDiscussionsSearchSource.d.ts new file mode 100644 index 0000000000..a79078adef --- /dev/null +++ b/framework/core/js/dist-typings/forum/components/GlobalDiscussionsSearchSource.d.ts @@ -0,0 +1,18 @@ +import type Mithril from 'mithril'; +import type Discussion from '../../common/models/Discussion'; +import type { GlobalSearchSource } from './GlobalSearch'; +/** + * The `DiscussionsSearchSource` finds and displays discussion search results in + * the search dropdown. + */ +export default class GlobalDiscussionsSearchSource implements GlobalSearchSource { + protected results: Map; + resource: string; + title(): string; + isCached(query: string): boolean; + search(query: string, limit: number): Promise; + view(query: string): Array; + customGrouping(): boolean; + fullPage(query: string): Mithril.Vnode; + gotoItem(id: string): string | null; +} diff --git a/framework/core/js/dist-typings/forum/components/PostsSearchSource.d.ts b/framework/core/js/dist-typings/forum/components/GlobalPostsSearchSource.d.ts similarity index 79% rename from framework/core/js/dist-typings/forum/components/PostsSearchSource.d.ts rename to framework/core/js/dist-typings/forum/components/GlobalPostsSearchSource.d.ts index d7d456563b..14c5c470ab 100644 --- a/framework/core/js/dist-typings/forum/components/PostsSearchSource.d.ts +++ b/framework/core/js/dist-typings/forum/components/GlobalPostsSearchSource.d.ts @@ -1,11 +1,11 @@ import type Mithril from 'mithril'; import type Post from '../../common/models/Post'; -import type { SearchSource } from './Search'; +import type { GlobalSearchSource } from './GlobalSearch'; /** * The `PostsSearchSource` finds and displays post search results in * the search dropdown. */ -export default class PostsSearchSource implements SearchSource { +export default class GlobalPostsSearchSource implements GlobalSearchSource { protected results: Map; resource: string; title(): string; diff --git a/framework/core/js/dist-typings/forum/components/GlobalSearch.d.ts b/framework/core/js/dist-typings/forum/components/GlobalSearch.d.ts new file mode 100644 index 0000000000..e911440ada --- /dev/null +++ b/framework/core/js/dist-typings/forum/components/GlobalSearch.d.ts @@ -0,0 +1,10 @@ +import ItemList from '../../common/utils/ItemList'; +import AbstractGlobalSearch, { type SearchAttrs as BaseSearchAttrs, type GlobalSearchSource as BaseGlobalSearchSource } from '../../common/components/AbstractGlobalSearch'; +export interface GlobalSearchSource extends BaseGlobalSearchSource { +} +export interface SearchAttrs extends BaseSearchAttrs { +} +export default class GlobalSearch extends AbstractGlobalSearch { + static initAttrs(attrs: SearchAttrs): void; + sourceItems(): ItemList; +} diff --git a/framework/core/js/dist-typings/forum/components/GlobalUsersSearchSource.d.ts b/framework/core/js/dist-typings/forum/components/GlobalUsersSearchSource.d.ts new file mode 100644 index 0000000000..47ed7a2b5e --- /dev/null +++ b/framework/core/js/dist-typings/forum/components/GlobalUsersSearchSource.d.ts @@ -0,0 +1,18 @@ +import type Mithril from 'mithril'; +import type User from '../../common/models/User'; +import type { GlobalSearchSource } from './GlobalSearch'; +/** + * The `UsersSearchSource` finds and displays user search results in the search + * dropdown. + */ +export default class GlobalUsersSearchSource implements GlobalSearchSource { + protected results: Map; + resource: string; + title(): string; + isCached(query: string): boolean; + search(query: string, limit: number): Promise; + view(query: string): Array; + customGrouping(): boolean; + fullPage(query: string): null; + gotoItem(id: string): string | null; +} diff --git a/framework/core/js/dist-typings/forum/components/Search.d.ts b/framework/core/js/dist-typings/forum/components/Search.d.ts index be05b7aa43..267d7dc7cc 100644 --- a/framework/core/js/dist-typings/forum/components/Search.d.ts +++ b/framework/core/js/dist-typings/forum/components/Search.d.ts @@ -1,8 +1,115 @@ +import Component, { ComponentAttrs } from '../../common/Component'; import ItemList from '../../common/utils/ItemList'; -import AbstractSearch, { type SearchAttrs, type SearchSource as BaseSearchSource } from '../../common/components/AbstractSearch'; -export interface SearchSource extends BaseSearchSource { +import KeyboardNavigatable from '../../common/utils/KeyboardNavigatable'; +import SearchState from '../../common/states/SearchState'; +import type Mithril from 'mithril'; +/** + * The `SearchSource` interface defines a section of search results in the + * search dropdown. + * + * Search sources should be registered with the `Search` component class + * by extending the `sourceItems` method. When the user types a + * query, each search source will be prompted to load search results via the + * `search` method. When the dropdown is redrawn, it will be constructed by + * putting together the output from the `view` method of each source. + */ +export interface SearchSource { + /** + * Make a request to get results for the given query. + * The results will be updated internally in the search source, not exposed. + */ + search(query: string): Promise; + /** + * Get an array of virtual
  • s that list the search results for the given + * query. + */ + view(query: string): Array; } -export default class Search extends AbstractSearch { - static initAttrs(attrs: SearchAttrs): void; +export interface SearchAttrs extends ComponentAttrs { + /** The type of alert this is. Will be used to give the alert a class name of `Alert--{type}`. */ + state: SearchState; +} +/** + * @todo: 2.0 refactored the global search UI and no longer uses this component, now we use the GlobalSearch component. + * The component was kept to support extension usage of it on a local scope. + * We need to extract this component into a separate UI package instead as it is no longer needed by core. + * + * The `Search` component displays a menu of as-you-type results from a variety + * of sources. + * + * The search box will be 'activated' if the app's search state's + * getInitialSearch() value is a truthy value. If this is the case, an 'x' + * button will be shown next to the search field, and clicking it will clear the search. + * + * ATTRS: + * + * - state: SearchState instance. + */ +export default class Search extends Component { + /** + * The minimum query length before sources are searched. + */ + protected static MIN_SEARCH_LEN: number; + /** + * The instance of `SearchState` for this component. + */ + protected searchState: SearchState; + /** + * Whether or not the search input has focus. + */ + protected hasFocus: boolean; + /** + * An array of SearchSources. + */ + protected sources?: SearchSource[]; + /** + * The number of sources that are still loading results. + */ + protected loadingSources: number; + /** + * The index of the currently-selected
  • in the results list. This can be + * a unique string (to account for the fact that an item's position may jump + * around as new results load), but otherwise it will be numeric (the + * sequential position within the list). + */ + protected index: number; + protected navigator: KeyboardNavigatable; + protected searchTimeout?: number; + private updateMaxHeightHandler?; + oninit(vnode: Mithril.Vnode): void; + view(): JSX.Element; + updateMaxHeight(): void; + onupdate(vnode: Mithril.VnodeDOM): void; + oncreate(vnode: Mithril.VnodeDOM): void; + onremove(vnode: Mithril.VnodeDOM): void; + /** + * Navigate to the currently selected search result and close the list. + */ + selectResult(): void; + /** + * Clear the search + */ + clear(): void; + /** + * Build an item list of SearchSources. + */ sourceItems(): ItemList; + /** + * Get all of the search result items that are selectable. + */ + selectableItems(): JQuery; + /** + * Get the position of the currently selected search result item. + * Returns zero if not found. + */ + getCurrentNumericIndex(): number; + /** + * Get the
  • in the search results with the given index (numeric or named). + */ + getItem(index: number): JQuery; + /** + * Set the currently-selected search result item to the one with the given + * index. + */ + setIndex(index: number, scrollToItem?: boolean): void; } diff --git a/framework/core/js/dist-typings/forum/components/UsersSearchSource.d.ts b/framework/core/js/dist-typings/forum/components/UsersSearchSource.d.ts index 1e3c52a34a..2e6965f5ad 100644 --- a/framework/core/js/dist-typings/forum/components/UsersSearchSource.d.ts +++ b/framework/core/js/dist-typings/forum/components/UsersSearchSource.d.ts @@ -1,18 +1,12 @@ import type Mithril from 'mithril'; -import type User from '../../common/models/User'; -import type { SearchSource } from './Search'; +import { SearchSource } from './Search'; +import User from '../../common/models/User'; /** * The `UsersSearchSource` finds and displays user search results in the search * dropdown. */ -export default class UsersSearchSource implements SearchSource { +export default class UsersSearchResults implements SearchSource { protected results: Map; - resource: string; - title(): string; - isCached(query: string): boolean; - search(query: string, limit: number): Promise; + search(query: string): Promise; view(query: string): Array; - customGrouping(): boolean; - fullPage(query: string): null; - gotoItem(id: string): string | null; } diff --git a/framework/core/js/dist-typings/forum/forum.d.ts b/framework/core/js/dist-typings/forum/forum.d.ts index a6ac0ddbde..5a91b10d25 100644 --- a/framework/core/js/dist-typings/forum/forum.d.ts +++ b/framework/core/js/dist-typings/forum/forum.d.ts @@ -21,7 +21,7 @@ import './components/HeaderPrimary'; import './components/PostEdited'; import './components/IndexPage'; import './components/DiscussionRenamedNotification'; -import './components/DiscussionsSearchSource'; +import './components/GlobalDiscussionsSearchSource'; import './components/HeaderSecondary'; import './components/DiscussionList'; import './components/AvatarEditor'; @@ -32,7 +32,7 @@ import './components/NotificationsDropdown'; import './components/UserPage'; import './components/PostUser'; import './components/UserCard'; -import './components/UsersSearchSource'; +import './components/GlobalUsersSearchSource'; import './components/PostPreview'; import './components/EventPost'; import './components/DiscussionHero'; @@ -44,6 +44,7 @@ import './components/WelcomeHero'; import './components/CommentPost'; import './components/ComposerPostPreview'; import './components/RenameDiscussionModal'; +import './components/GlobalSearch'; import './components/Search'; import './components/DiscussionListItem'; import './components/PostsUserPage'; diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index 22aea315e1..144f8a28f5 100644 --- a/framework/core/js/dist/admin.js +++ b/framework/core/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={5710:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(){(0,r.A)(this,"element",void 0),(0,r.A)(this,"attrs",void 0),(0,r.A)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error(`[${this.constructor.name}] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute`);if("tag"in t)throw new Error(`[${this.constructor.name}] You cannot use the "tag" attribute name with Mithril 2.`)}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",s)},5420:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=n(5114);class a{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=s.A.store),(0,r.A)(this,"data",{}),(0,r.A)(this,"freshness",new Date),(0,r.A)(this,"exists",!1),(0,r.A)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){return this.data?.attributes?.[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){this.data.attributes||={};for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof a&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){const e=this.data.relationships??{};for(const n in t.relationships){const r=t.relationships[n];if(null===r){delete e[n],delete t.relationships[n];continue}let s;s=r instanceof a?{data:a.getIdentifier(r)}:r instanceof Array?{data:r.map(a.getIdentifier)}:r,t.relationships[n]=s,e[n]=s}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships&&!("relationships"in this)){n.relationships={};for(const e in t.relationships){const r=t.relationships[e];null!==r&&(n.relationships[e]={data:r instanceof Array?r.map(a.getIdentifier):a.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const i={data:n,meta:e.meta||void 0};return s.A.request({method:this.exists?"PATCH":"POST",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:i,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(r),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?s.A.request({method:"DELETE",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){return this.data.relationships?.[t]?.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){const e=this.data.relationships?.[t]?.data;if(e&&e instanceof Array)throw new Error(`Relationship ${t} on model ${this.data.type} is plural, so the hasOne method cannot be used to access it.`);return!!e&&this.store.getById(e.type,e.id)}}static hasMany(t){return function(){const e=this.data.relationships?.[t]?.data;if(e&&!(e instanceof Array))throw new Error(`Relationship ${t} on model ${this.data.type} is singular, so the hasMany method cannot be used to access it.`);return!!e&&e.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&t.data&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",a)},3920:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(8805),s=n(5114),a=n(8631);class i extends a.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",i);class o extends a.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.created.hint",{},!0)}valuePattern(){return"(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)"}filterKey(){return"created"}}flarum.reg.add("core","common/query/discussions/CreatedGambit",o);class l extends a.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends a.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends a.px{key(){return s.A.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!s.A.session.user||!s.A.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends a.px{key(){return s.A.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class m extends a.px{key(){return s.A.translator.trans("core.lib.gambits.posts.discussion.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.posts.discussion.hint",{},!0)}filterKey(){return"discussion"}}flarum.reg.add("core","common/query/discussions/DiscussionGambit",m);class h{constructor(){(0,r.A)(this,"gambits",{discussions:[i,o,l,c],posts:[i,m],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,n,r)=>{const s=t.toFilter(n,r);Object.keys(s).forEach((n=>{n in e&&t.predicates&&Array.isArray(s[n])?e[n]=e[n].concat(s[n]):e[n]=s[n]}))})),e}match(t,e,n){const r=this.for(t).filter((t=>t.enabled()));if(0===r.length)return e;const s=e.split(" ");for(const t of r)for(const r of s){const s=new RegExp(`^(-?)${t.pattern()}$`,"i");let a=r.match(s);if(a){const s="-"===a[1];a.splice(1,1),n(t,a,s,r),e=e.replace(r,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,n){const r=this.for(t);return 0===r.length||Object.keys(n).forEach((t=>{for(const s of r){const r="-"===t[0];r&&(t=t.substring(1)),s.filterKey()===t&&(e+=` ${s.fromFilter(n[t],r)}`)}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",h);class p{constructor(t){(0,r.A)(this,"state",void 0),(0,r.A)(this,"gambits",new h),this.state=t}}(0,r.A)(p,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",p)},5114:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});const r=window,s=new Proxy({},{get:(t,e)=>Reflect.get(r.app,e,r.app),set:(t,e,n)=>Reflect.set(r.app,e,n,r.app)}),a=s;flarum.reg.add("core","common/app",s)},9924:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5710),s=n(3092),a=n(5673),i=n(4586),o=n(4268),l=n(5114),c=n(7479);class u extends r.A{view(t){const e=Object.assign({},this.attrs),n=(0,i.A)(e,"type");e.className=(0,o.A)("Alert",`Alert--${n}`,e.className);const r=(0,i.A)(e,"title"),u=(0,i.A)(e,"icon"),d=(0,i.A)(e,"content")||t.children,h=(0,i.A)(e,"controls")||[],p=(0,i.A)(e,"dismissible"),f=(0,i.A)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(s.A,{"aria-label":l.A.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,o.A)("Alert-container",e.containerClassName)},m("div",{className:"Alert-content"},!!r&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.A,{name:u})),m("span",{className:"Alert-title-text"},r)),m("span",{className:"Alert-body"},d)),m("ul",{className:"Alert-controls"},(0,a.A)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},367:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(4391),s=n(5710),a=n(4268),i=n(3288),o=n(7479);class l extends s.A{view(){const{type:t,icon:e,label:n,color:s,style:l={},...c}=this.attrs,u=(0,a.A)("Badge",[t&&`Badge--${t}`],c.className,(0,i.A)(s)),d=e?m(o.A,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l};window.testing||(h["--badge-bg"]=s);const p={...c,className:u,style:h},f=m("div",p,d);return n?m(r.A,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},3092:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5710),s=n(4434),a=n(4268),i=n(117),o=n(43),l=n(7479);class c extends r.A{view(t){let{type:e,"aria-label":n,icon:r,disabled:s,loading:o,className:l,class:c,...u}=this.attrs;e||="button","object"==typeof n&&(n=(0,i.A)(n)),(s||o)&&delete u.onclick,l=(0,a.A)(c,l,{hasIcon:r,disabled:s||o,loading:o});const d={disabled:s,className:l,type:e,"aria-label":n,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){super.oncreate(t);const{"aria-label":e}=this.attrs;this.view!==c.prototype.view||e||(0,i.A)(t.children)||this.element?.getAttribute?.("aria-label")||(0,s.A)('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(l.A,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(o.A,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",c)},374:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5710),s=n(4268);class a extends r.A{view(t){const{label:e,description:n,className:r,...a}=t.attrs;return m("div",Object.assign({className:(0,s.A)("Form",r)},a),(e||n)&&m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",a)},2855:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2849);class s extends r.A{wrapper(t){return m("form",{onsubmit:this.onsubmit.bind(this)},t)}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}onerror(t){this.alertAttrs=t.alert,m.redraw(),422===t.status&&t.response?.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}}flarum.reg.add("core","common/components/FormModal",s)},3550:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(367);class s extends r.A{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",s)},7479:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(4268),s=n(5710);class a extends s.A{view(t){const{name:e,...n}=t.attrs;return n.className=(0,r.A)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",a)},4164:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5710),s=n(7479),a=n(4268);class i extends r.A{view(t){const{icon:e,className:n,...r}=t.attrs;return m("div",Object.assign({className:(0,a.A)("InfoTile",n)},r),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(s.A,{name:(0,a.A)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",i)},7882:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5114),s=n(5710),a=n(7479),i=n(43),o=n(4268),l=n(3092);class c extends s.A{oninit(t){super.oninit(t)}view(t){const{className:e,...n}=this.attrs.inputAttrs||{},s=this.attrs.value||this.attrs.stream?.()||"";return m("div",{className:(0,o.A)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(a.A,{name:(0,o.A)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:e,value:s,inputAttrs:n}),this.attrs.loading&&m(i.A,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&s&&!this.attrs.loading&&m(l.A,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||r.A.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:n,inputAttrs:r}=t;const s={className:(0,o.A)("FormControl",e),type:this.attrs.type||"text",value:n,oninput:t=>this.onchange?.(t.target.value),"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...r};return this.attrs.renderInput?this.attrs.renderInput(s):m("input",s)}onchange(t){this.attrs.stream?this.attrs.stream(t):this.attrs.onchange?.(t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},43:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5114),s=n(5710),a=n(4268);class i extends s.A{view(){const{display:t="block",size:e="medium",containerClassName:n,className:s,...i}=this.attrs,o=(0,a.A)("LoadingIndicator",s),l=(0,a.A)("LoadingIndicator-container","unset"!==t&&`LoadingIndicator-container--${t}`,e&&`LoadingIndicator-container--${e}`,n);return m("div",Object.assign({"aria-label":r.A.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},i.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:o},i)))}}flarum.reg.add("core","common/components/LoadingIndicator",i)},2849:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(8805),s=n(5114),a=n(5710),i=n(9924),o=n(3092),l=n(4268);class c extends a.A{constructor(){super(...arguments),(0,r.A)(this,"loading",!1),(0,r.A)(this,"alertAttrs",null)}static get dismissibleOptions(){return{viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,l.A)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(o.A,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":s.A.translator.trans("core.lib.modal.close")})),this.wrapper(this.inner())))}wrapper(t){return m("[",null,t)}inner(){return m("[",null,m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(i.A,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,r.A)(c,"isDismissibleViaCloseButton",!0),(0,r.A)(c,"isDismissibleViaEscKey",!0),(0,r.A)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},4391:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(8805),s=n(5710),a=n(4268),i=n(117);class o extends s.A{constructor(){super(...arguments),(0,r.A)(this,"firstChild",null),(0,r.A)(this,"childDomNode",null),(0,r.A)(this,"oldText",""),(0,r.A)(this,"oldVisibility",void 0),(0,r.A)(this,"shouldRecreateTooltip",!1),(0,r.A)(this,"shouldChangeTooltipVisibility",!1)}view(t){const e=t.children,{text:n,tooltipVisible:r,showOnFocus:s=!0,position:a="top",ignoreTitleWarning:i=!1,html:o=!1,delay:l=0,...c}=this.attrs;this.attrs.title&&!i&&console.warn("`title` attribute was passed to Tooltip component. Was this intentional? Tooltip content should be passed to the `text` attr instead.");const u=this.getRealText();if(u!==this.oldText&&(this.oldText=u,this.shouldRecreateTooltip=!0),r!==this.oldVisibility&&(this.oldVisibility=this.attrs.tooltipVisible,this.shouldChangeTooltipVisibility=!0),void 0===e)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if(1!==e.length)throw new Error("Tooltip component was either passed more than one or no child node.\n\nPlease wrap multiple children in another element, such as a
    or .");const d=e[0];if("object"!=typeof d||Array.isArray(d)||null===d)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof d.tag&&["#","[","<"].includes(d.tag))throw new Error(`Tooltip component with provided with a vnode with tag "${d.tag}". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a
    or .`);return this.firstChild=d,e}oncreate(t){super.oncreate(t),this.checkDomNodeChanged(),this.recreateTooltip()}onupdate(t){super.onupdate(t),this.checkDomNodeChanged(),this.recreateTooltip()}recreateTooltip(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())}updateVisibility(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))}createTooltip(){if(null===this.childDomNode)return;const{showOnFocus:t=!0,position:e="top",delay:n,html:r=!1,tooltipVisible:s,text:i}=this.attrs,o="boolean"==typeof s?"manual":(0,a.A)("hover",[t&&"focus"]),l=this.getRealText();this.childDomNode.setAttribute("title",l),this.childDomNode.setAttribute("aria-label",l),$(this.childDomNode).tooltip({html:r,delay:n,placement:e,trigger:o},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}getRealText(){const{text:t}=this.attrs;return Array.isArray(t)?(0,i.A)(t):t}checkDomNodeChanged(){const t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)}}flarum.reg.add("core","common/components/Tooltip",o)},4434:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(5114);function s(){r.A.data.resources.find((t=>"forums"===t.type))?.attributes?.debug&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",s)},5673:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(646),s=n(4268);function a(t){return"object"==typeof t&&null!==t&&"tag"in t}function i(t){return a(t)&&t.tag===r.A}function o(t,e,n){void 0===e&&(e="li"),void 0===n&&(n={});const r=e;return function(t){const e=[];let n;return t.filter(Boolean).forEach(((r,s)=>{(!i(r)||n&&!i(n)&&s!==t.length-1)&&(n=r,e.push(r))})),e}(t instanceof Array?t:[t]).map((t=>{const e=[t.itemName&&`item-${t.itemName}`];if(a(t)&&t.tag.isListItem)return t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key,t;a(t)&&(e.push(t.attrs?.itemClassName||t.itemClassName),t.tag.isActive?.(t.attrs)&&e.push("active"));const i=a(t)&&t?.attrs?.key||t.itemName;return m(r,Object.assign({className:(0,s.A)(e),key:i},n),t)}))}flarum.reg.add("core","common/helpers/listItems",o)},3288:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2967);function s(t){return t?(0,r.A)(t)?"text-contrast--light":"text-contrast--dark":"text-contrast--unchanged"}flarum.reg.add("core","common/helpers/textContrastClass",s)},4583:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=n(5420);class a extends s.A{nameSingular(){return s.A.attribute("nameSingular").call(this)}namePlural(){return s.A.attribute("namePlural").call(this)}color(){return s.A.attribute("color").call(this)}icon(){return s.A.attribute("icon").call(this)}isHidden(){return s.A.attribute("isHidden").call(this)}}(0,r.A)(a,"ADMINISTRATOR_ID","1"),(0,r.A)(a,"GUEST_ID","2"),(0,r.A)(a,"MEMBER_ID","3"),flarum.reg.add("core","common/models/Group",a)},8631:(t,e,n)=>{"use strict";n.d(e,{$Q:()=>a,pm:()=>i,px:()=>o});var r=n(8805),s=n(5114);let a=function(t){return t.KeyValue="key:value",t.Grouped="grouped",t}({});class i{constructor(){(0,r.A)(this,"type",a.Grouped),(0,r.A)(this,"predicates",!1)}booleanKey(){return"is"}groupKey(){return s.A.translator.trans("core.lib.gambits.group_keys."+this.booleanKey(),{},!0)}pattern(){const t=this.groupKey();let e=this.key();return Array.isArray(e)&&(e=e.join("|")),`${t}:(${e})`}toFilter(t,e){const n=(e?"-":"")+this.filterKey();return{[n]:!0}}fromFilter(t,e){return`${e?"-":""}${this.groupKey()}:${this.key()}`}suggestion(){return{group:this.groupKey(),key:this.key()}}enabled(){return!0}}class o{constructor(){(0,r.A)(this,"type",a.KeyValue),(0,r.A)(this,"predicates",!1)}valuePattern(){return"(.+)"}gambitValueToFilterValue(t){return t}filterValueToGambitValue(t){return Array.isArray(t)?t.join(","):t.toString()}pattern(){return`${this.key()}:`+this.valuePattern()}toFilter(t,e){const n=(e?"-":"")+this.filterKey();return{[n]:this.gambitValueToFilterValue(t[1])}}fromFilter(t,e){return`${e?"-":""}${this.key()}:${this.filterValueToGambitValue(t)}`}suggestion(){return{key:this.key(),hint:this.hint()}}enabled(){return!0}}flarum.reg.add("core","common/query/IGambit",{GambitType:a,BooleanGambit:i,KeyValueGambit:o})},5992:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(t){(0,r.A)(this,"symbol",void 0),(0,r.A)(this,"relativeStart",0),(0,r.A)(this,"absoluteStart",0),this.symbol=t}check(t,e,n){void 0===n&&(n=null),this.absoluteStart=0;for(let r=t.length-1;r>=0;r--){const s=t.substr(r,1);if(n&&!n?.test(s))return null;if(this.symbol){const t="string"==typeof this.symbol?t=>t===this.symbol:this.symbol;if(!t(s))continue}if(0===r||/\s/.test(t.substr(r-1,1)))return this.relativeStart=r+(this.symbol?1:0),this.absoluteStart=e-t.length+r+(this.symbol?1:0),{symbol:this.symbol&&s,relativeStart:this.relativeStart,absoluteStart:this.absoluteStart,typed:t.substring(this.relativeStart).toLowerCase()}}return null}}flarum.reg.add("core","common/utils/AutocompleteReader",s)},6500:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(8805),s=n(5114),a=n(8631),i=n(5992),o=n(3092);class l{constructor(t,e,n,s){this.resource=t,this.jqueryInput=e,this.onchange=n,this.afterSuggest=s,(0,r.A)(this,"query","")}suggestions(t){const e=s.A.search.gambits.for(this.resource).filter((t=>t.enabled()));this.query=t;const n=e.filter((t=>t.type===a.$Q.Grouped)),r=e.filter((t=>t.type!==a.$Q.Grouped)),o=[];for(const t of n)o.includes(t.suggestion().group)||o.push(t.suggestion().group);const l=[];for(const t of o)l.push({type:a.$Q.Grouped,suggestion:()=>({group:t,key:n.filter((e=>e.suggestion().group===t)).map((t=>{const e=t.suggestion().key;return e instanceof Array?e.join(", "):e})).join(", ")}),pattern:()=>"",filterKey:()=>"",toFilter:()=>[],fromFilter:()=>"",predicates:!1,enabled:()=>!0});const c=new i.A(null),u=this.jqueryInput().prop("selectionStart")||t.length,d=t.slice(0,u),m=c.check(d,u,/\S+$/);let h=m?.typed||"";const p=h.startsWith("-");if(p&&(h=h.slice(1)),h.endsWith(":")){const t=h.replace(/:$/,"")||null,e=h.split(":").pop()||"";if(t){const r=this.specificGambitSuggestions(t,e,o,n,m);if(r)return r}}return[...l,...r].filter((t=>!m||new RegExp(h).test(t.type===a.$Q.Grouped?t.suggestion().group:t.suggestion().key))).map((t=>{const e=t.suggestion(),n=t.type===a.$Q.Grouped?e.group:e.key,r=t.type===a.$Q.Grouped?e.key:e.hint;return this.gambitSuggestion(n,r,(t=>this.suggest((t?"-":"")+n+":",h||"",(m?.relativeStart??u)+Number(p))))}))}specificGambitSuggestions(t,e,n,r,s){return n.includes(t)?r.filter((e=>e.suggestion().group===t)).flatMap((t=>t.suggestion().key instanceof Array?t.suggestion().key:[t.suggestion().key])).filter((t=>!e||t.toLowerCase().startsWith(e))).map((t=>this.gambitSuggestion(t,null,(()=>this.suggest(t,e,s.relativeStart+s.typed.length))))):null}gambitSuggestion(t,e,n){return m("li",null,m("span",{className:"Dropdown-item GambitsAutocomplete-gambit"},m("button",{type:"button",className:"Button--ua-reset",onclick:()=>n()},m("span",{className:"GambitsAutocomplete-gambit-key"},t,!!e&&":"),!!e&&m("span",{className:"GambitsAutocomplete-gambit-value"},e)),!!e&&m("span",{className:"GambitsAutocomplete-gambit-actions"},m(o.A,{class:"Button Button--icon",onclick:()=>n(),icon:"fas fa-plus","aria-label":s.A.translator.trans("core.lib.search.gambit_plus_button_a11y_label")}),m(o.A,{class:"Button Button--icon",onclick:()=>n(!0),icon:"fas fa-minus","aria-label":s.A.translator.trans("core.lib.search.gambit_minus_button_a11y_label")}))))}suggest(t,e,n){const r=this.jqueryInput(),s=this.query,a=s.slice(0,n)+t+s.slice(n+e.length);this.onchange(a),r[0].focus(),setTimeout((()=>{r[0].setSelectionRange(n+t.length,n+t.length),m.redraw()}),50),this.afterSuggest(a)}}flarum.reg.add("core","common/utils/GambitsAutocomplete",l)},6064:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(8805),s=n(9648);class a{constructor(t,e){(0,r.A)(this,"content",void 0),(0,r.A)(this,"priority",void 0),this.content=t,this.priority=e}}class i{constructor(){(0,r.A)(this,"_items",{})}isEmpty(){return 0===Object.keys(this._items).length}has(t){return Object.keys(this._items).includes(t)}get(t){return this._items[t].content}getPriority(t){return this._items[t].priority}add(t,e,n){return void 0===n&&(n=0),this._items[t]=new a(e,n),this}setContent(t,e){if(!this.has(t))throw new Error(`[ItemList] Cannot set content of Item. Key \`${t}\` is not present.`);return null!==e&&(this._items[t].content=e),this}setPriority(t,e){if(!this.has(t))throw new Error(`[ItemList] Cannot set priority of Item. Key \`${t}\` is not present.`);return this._items[t].priority=e,this}remove(t){return delete this._items[t],this}merge(t){return Object.keys(t._items).forEach((e=>{const n=t._items[e];n instanceof a&&(this._items[e]=n)})),this}toArray(t){return void 0===t&&(t=!1),Object.keys(this._items).map(((e,n)=>{const r=this._items[e];return!t||(0,s.A)(r.content)?{...r,content:this.createItemContentProxy((0,s.A)(r.content)?r.content:Object(r.content),e)}:{...r}})).sort(((t,e)=>e.priority-t.priority)).map((t=>t.content))}toObject(){return Object.keys(this._items).reduce(((t,e)=>{const n={content:this.get(e),itemName:e,priority:this.getPriority(e)};return t[e]=n,t}),{})}createItemContentProxy(t,e){return new Proxy(t,{get:(t,n,r)=>"itemName"===n?e:Reflect.get(t,n,r),set(t,n,r,s){if(null!==e&&"itemName"===n)throw new Error("`itemName` property is read-only");return Reflect.set(t,n,r,s)}})}}flarum.reg.add("core","common/utils/ItemList",i)},6732:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=function(t){return t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowDown=40]="ArrowDown",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowRight=39]="ArrowRight",t[t.Tab=9]="Tab",t[t.Backspace=8]="Backspace",t}(s||{});class a{constructor(){(0,r.A)(this,"callbacks",new Map),(0,r.A)(this,"whenCallback",(t=>!0))}onUp(t){return this.onDirection(t,s.ArrowUp)}onDown(t){return this.onDirection(t,s.ArrowDown)}onLeft(t){return this.onDirection(t,s.ArrowLeft)}onRight(t){return this.onDirection(t,s.ArrowRight)}onDirection(t,e){return this.callbacks.set(e,(e=>{e.preventDefault(),t(e)})),this}onSelect(t,e){void 0===e&&(e=!1);const n=e=>{e.preventDefault(),t(e)};return e||this.callbacks.set(s.Tab,n),this.callbacks.set(s.Enter,n),this}onTab(t){return this.callbacks.set(9,(e=>{e.preventDefault(),t(e)})),this}onCancel(t){return this.callbacks.set(s.Escape,(e=>{e.stopPropagation(),e.preventDefault(),t(e)})),this}onRemove(t){return this.callbacks.set(s.Backspace,(e=>{e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&0===e.target.selectionStart&&0===e.target.selectionEnd&&(t(e),e.preventDefault())})),this}when(t){return this.whenCallback=t,this}bindTo(t){t[0].addEventListener("keydown",this.navigate.bind(this))}navigate(t){if(!this.whenCallback(t))return;const e=this.callbacks.get(t.which);e&&e(t)}}flarum.reg.add("core","common/utils/KeyboardNavigatable",a)},4311:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5263),s=n.n(r);const a=s();flarum.reg.add("core","common/utils/Stream",s())},2202:()=>{Array.prototype.flat||(Array.prototype.flat=function t(e){return(e??1)>0?Array.prototype.reduce.call(this,((n,r)=>n.concat(Array.isArray(r)?t.call(r,e-1):r)),[]):[...this]})},4268:(t,e,n)=>{"use strict";function r(t){var e,n,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;ea});const s=function(){for(var t,e,n=0,s="";n{"use strict";function r(t,e){const n=t[e];return delete t[e],n}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/extract",r)},117:(t,e,n)=>{"use strict";function r(t){return t instanceof Array?t.map((t=>r(t))).join(""):"object"==typeof t&&null!==t?r(t.children):String(t)}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/extractText",r)},2967:(t,e,n)=>{"use strict";function r(t){if(!t||t.length<4)return!1;let e=t.replace("#","");return 3===e.length&&(e=e.split("").map((t=>t.repeat(2))).join("")),(299*parseInt(e.slice(0,2),16)+587*parseInt(e.slice(2,4),16)+114*parseInt(e.slice(4,6),16))/1e3<(parseInt(getComputedStyle(document.body).getPropertyValue("--yiq-threshold").trim())||128)}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/isDark",r)},9648:(t,e,n)=>{"use strict";function r(t){const e=typeof t;return"function"===e||"object"===e&&!!t}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/isObject",r)},1592:()=>{!function(t){"use strict";var e=function(n,r){this.options=t.extend({},e.DEFAULTS,r);var s=this.options.target===e.DEFAULTS.target?t(this.options.target):t(document).find(this.options.target);this.$target=s.on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var r=t(this),s=r.data("bs.affix"),a="object"==typeof n&&n;s||r.data("bs.affix",s=new e(this,a)),"string"==typeof n&&s[n]()}))}e.VERSION="3.4.1",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getState=function(t,e,n,r){var s=this.$target.scrollTop(),a=this.$element.offset(),i=this.$target.height();if(null!=n&&"top"==this.affixed)return s=t-r&&"bottom"},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),r=this.options.offset,s=r.top,a=r.bottom,i=Math.max(t(document).height(),t(document.body).height());"object"!=typeof r&&(a=s=r),"function"==typeof s&&(s=r.top(this.$element)),"function"==typeof a&&(a=r.bottom(this.$element));var o=this.getState(i,n,s,a);if(this.affixed!=o){null!=this.unpin&&this.$element.css("top","");var l="affix"+(o?"-"+o:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=o,this.unpin="bottom"==o?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==o&&this.$element.offset({top:i-n-a})}};var r=t.fn.affix;t.fn.affix=n,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=r,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var e=t(this),r=e.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),n.call(e,r)}))}))}(jQuery)},5941:()=>{!function(t){"use strict";var e='[data-toggle="dropdown"]',n=function(e){t(e).on("click.bs.dropdown",this.toggle)};function r(e){var n=e.attr("data-target");n||(n=(n=e.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r="#"!==n?t(document).find(n):null;return r&&r.length?r:e.parent()}function s(n){n&&3===n.which||(t(".dropdown-backdrop").remove(),t(e).each((function(){var e=t(this),s=r(e),a={relatedTarget:this};s.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&t.contains(s[0],n.target)||(s.trigger(n=t.Event("hide.bs.dropdown",a)),n.isDefaultPrevented()||(e.attr("aria-expanded","false"),s.removeClass("open").trigger(t.Event("hidden.bs.dropdown",a)))))})))}n.VERSION="3.4.1",n.prototype.toggle=function(e){var n=t(this);if(!n.is(".disabled, :disabled")){var a=r(n),i=a.hasClass("open");if(s(),!i){"ontouchstart"in document.documentElement&&!a.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",s);var o={relatedTarget:this};if(a.trigger(e=t.Event("show.bs.dropdown",o)),e.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),a.toggleClass("open").trigger(t.Event("shown.bs.dropdown",o))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var s=t(this);if(n.preventDefault(),n.stopPropagation(),!s.is(".disabled, :disabled")){var a=r(s),i=a.hasClass("open");if(!i&&27!=n.which||i&&27==n.which)return 27==n.which&&a.find(e).trigger("focus"),s.trigger("click");var o=a.find(".dropdown-menu li:not(.disabled):visible a");if(o.length){var l=o.index(n.target);38==n.which&&l>0&&l--,40==n.which&&l{!function(t){"use strict";var e=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,s=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function a(e,a){var i=e.nodeName.toLowerCase();if(-1!==t.inArray(i,a))return-1===t.inArray(i,n)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(s));for(var o=t(a).filter((function(t,e){return e instanceof RegExp})),l=0,c=o.length;l
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}},o.prototype.init=function(e,n,r){if(this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var s=this.options.trigger.split(" "),a=s.length;a--;){var i=s[a];if("click"==i)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=i){var o="hover"==i?"mouseenter":"focusin",l="hover"==i?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},o.prototype.getDefaults=function(){return o.DEFAULTS},o.prototype.getOptions=function(n){var r=this.$element.data();for(var s in r)r.hasOwnProperty(s)&&-1!==t.inArray(s,e)&&delete r[s];return(n=t.extend({},this.getDefaults(),r,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=i(n.template,n.whiteList,n.sanitizeFn)),n},o.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,(function(t,r){n[t]!=r&&(e[t]=r)})),e},o.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusin"==e.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},o.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},o.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusout"==e.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},o.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var n=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!n)return;var r=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(i);c&&(i=i.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this),this.options.container?s.appendTo(t(document).find(this.options.container)):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=s[0].offsetWidth,m=s[0].offsetHeight;if(c){var h=i,p=this.getPosition(this.$viewport);i="bottom"==i&&u.bottom+m>p.bottom?"top":"top"==i&&u.top-mp.width?"left":"left"==i&&u.left-di.top+i.height&&(s.top=i.top+i.height-l)}else{var c=e.left-a,u=e.left+a+n;ci.right&&(s.left=i.left+i.width-u)}return s},o.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},o.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},o.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},o.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},o.prototype.enable=function(){this.enabled=!0},o.prototype.disable=function(){this.enabled=!1},o.prototype.toggleEnabled=function(){this.enabled=!this.enabled},o.prototype.toggle=function(e){var n=this;e&&((n=t(e.currentTarget).data("bs."+this.type))||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n))),e?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},o.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null}))},o.prototype.sanitizeHtml=function(t){return i(t,this.options.whiteList,this.options.sanitizeFn)};var l=t.fn.tooltip;t.fn.tooltip=function(e){return this.each((function(){var n=t(this),r=n.data("bs.tooltip"),s="object"==typeof e&&e;!r&&/destroy|hide/.test(e)||(r||n.data("bs.tooltip",r=new o(this,s)),"string"==typeof e&&r[e]())}))},t.fn.tooltip.Constructor=o,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=l,this}}(jQuery)},3387:()=>{!function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var n=!1,r=this;return t(this).one("bsTransitionEnd",(function(){n=!0})),setTimeout((function(){n||t(r).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(jQuery)},7514:t=>{var e=function(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas),this.width=this.canvas.width=t.width,this.height=this.canvas.height=t.height,this.context.drawImage(t,0,0,this.width,this.height)};e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.update=function(t){this.context.putImageData(t,0,0)},e.prototype.getPixelCount=function(){return this.width*this.height},e.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)},e.prototype.removeCanvas=function(){this.canvas.parentNode.removeChild(this.canvas)};var n=function(){};if(n.prototype.getColor=function(t,e){return this.getPalette(t,5,e)[0]},n.prototype.getPalette=function(t,n,r){void 0===n&&(n=10),(void 0===r||1>r)&&(r=10);for(var a,i,o,l,c=new e(t),u=c.getImageData().data,d=c.getPixelCount(),m=[],h=0;d>h;h+=r)i=u[0+(a=4*h)],o=u[a+1],l=u[a+2],u[a+3]>=125&&(i>250&&o>250&&l>250||m.push([i,o,l]));var p=s.quantize(m,n),f=p?p.palette():null;return c.removeCanvas(),f},!r)var r={map:function(t,e){var n={};return e?t.map((function(t,r){return n.index=r,e.call(n,t)})):t.slice()},naturalOrder:function(t,e){return e>t?-1:t>e?1:0},sum:function(t,e){var n={};return t.reduce(e?function(t,r,s){return n.index=s,t+e.call(n,r)}:function(t,e){return t+e},0)},max:function(t,e){return Math.max.apply(null,e?r.map(t,e):t)}};var s=function(){function t(t,e,n){return(t<<2*l)+(e<>c,s=e[1]>>c,a=e[2]>>c,n=t(r,s,a),i[n]=(i[n]||0)+1})),i}function i(t,e){var r,s,a,i=1e6,o=0,l=1e6,u=0,d=1e6,m=0;return t.forEach((function(t){r=t[0]>>c,s=t[1]>>c,a=t[2]>>c,i>r?i=r:r>o&&(o=r),l>s?l=s:s>u&&(u=s),d>a?d=a:a>m&&(m=a)})),new n(i,o,l,u,d,m,e)}function o(e,n){if(n.count()){var s=n.r2-n.r1+1,a=n.g2-n.g1+1,i=n.b2-n.b1+1,o=r.max([s,a,i]);if(1==n.count())return[n.copy()];var l,c,u,d,m=0,h=[],p=[];if(o==s)for(l=n.r1;l<=n.r2;l++){for(d=0,c=n.g1;c<=n.g2;c++)for(u=n.b1;u<=n.b2;u++)d+=e[t(l,c,u)]||0;m+=d,h[l]=m}else if(o==a)for(l=n.g1;l<=n.g2;l++){for(d=0,c=n.r1;c<=n.r2;c++)for(u=n.b1;u<=n.b2;u++)d+=e[t(c,l,u)]||0;m+=d,h[l]=m}else for(l=n.b1;l<=n.b2;l++){for(d=0,c=n.r1;c<=n.r2;c++)for(u=n.g1;u<=n.g2;u++)d+=e[t(c,u,l)]||0;m+=d,h[l]=m}return h.forEach((function(t,e){p[e]=m-t})),function(t){var e,r,s,a,i,o=t+"1",c=t+"2",u=0;for(l=n[o];l<=n[c];l++)if(h[l]>m/2){for(s=n.copy(),a=n.copy(),e=l-n[o],i=(r=n[c]-l)>=e?Math.min(n[c]-1,~~(l+r/2)):Math.max(n[o],~~(l-1-e/2));!h[i];)i++;for(u=p[i];!u&&h[i-1];)u=p[--i];return s[c]=i,a[o]=s[c]+1,[s,a]}}(o==s?"r":o==a?"g":"b")}}var l=5,c=8-l;return n.prototype={volume:function(t){var e=this;return(!e._volume||t)&&(e._volume=(e.r2-e.r1+1)*(e.g2-e.g1+1)*(e.b2-e.b1+1)),e._volume},count:function(e){var n=this,r=n.histo;if(!n._count_set||e){var s,a,i,o=0;for(s=n.r1;s<=n.r2;s++)for(a=n.g1;a<=n.g2;a++)for(i=n.b1;i<=n.b2;i++)index=t(s,a,i),o+=r[index]||0;n._count=o,n._count_set=!0}return n._count},copy:function(){var t=this;return new n(t.r1,t.r2,t.g1,t.g2,t.b1,t.b2,t.histo)},avg:function(e){var n=this,r=n.histo;if(!n._avg||e){var s,a,i,o,c=0,u=1<<8-l,d=0,m=0,h=0;for(a=n.r1;a<=n.r2;a++)for(i=n.g1;i<=n.g2;i++)for(o=n.b1;o<=n.b2;o++)c+=s=r[t(a,i,o)]||0,d+=s*(a+.5)*u,m+=s*(i+.5)*u,h+=s*(o+.5)*u;n._avg=c?[~~(d/c),~~(m/c),~~(h/c)]:[~~(u*(n.r1+n.r2+1)/2),~~(u*(n.g1+n.g2+1)/2),~~(u*(n.b1+n.b2+1)/2)]}return n._avg},contains:function(t){var e=this,n=t[0]>>c;return gval=t[1]>>c,bval=t[2]>>c,n>=e.r1&&n<=e.r2&&gval>=e.g1&&gval<=e.g2&&bval>=e.b1&&bval<=e.b2}},s.prototype={push:function(t){this.vboxes.push({vbox:t,color:t.avg()})},palette:function(){return this.vboxes.map((function(t){return t.color}))},size:function(){return this.vboxes.size()},map:function(t){for(var e=this.vboxes,n=0;n(n=Math.sqrt(Math.pow(t[0]-s.peek(a).color[0],2)+Math.pow(t[1]-s.peek(a).color[1],2)+Math.pow(t[2]-s.peek(a).color[2],2)))||void 0===e)&&(e=n,r=s.peek(a).color);return r},forcebw:function(){var t=this.vboxes;t.sort((function(t,e){return r.naturalOrder(r.sum(t.color),r.sum(e.color))}));var e=t[0].color;e[0]<5&&e[1]<5&&e[2]<5&&(t[0].color=[0,0,0]);var n=t.length-1,s=t[n].color;s[0]>251&&s[1]>251&&s[2]>251&&(t[n].color=[255,255,255])}},{quantize:function(t,n){function l(t,e){for(var n,r=1,s=0;1e3>s;)if((n=t.pop()).count()){var a=o(c,n),i=a[0],l=a[1];if(!i)return;if(t.push(i),l&&(t.push(l),r++),r>=e)return;if(s++>1e3)return}else t.push(n),s++}if(!t.length||2>n||n>256)return!1;var c=a(t);c.forEach((function(){}));var u=i(t,c),d=new e((function(t,e){return r.naturalOrder(t.count(),e.count())}));d.push(u),l(d,.75*n);for(var m=new e((function(t,e){return r.naturalOrder(t.count()*t.volume(),e.count()*e.volume())}));d.size();)m.push(d.pop());l(m,n-m.size());for(var h=new s;m.size();)h.push(m.pop());return h}}}();t.exports=n},1720:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",s="minute",a="hour",i="day",o="week",l="month",c="quarter",u="year",d="date",m="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},g=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:g,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),s=n%60;return(e<=0?"+":"-")+g(r,2,"0")+":"+g(s,2,"0")},m:function t(e,n){if(e.date()1)return t(i[0])}else{var o=e.name;y[o]=e,s=o}return!r&&s&&(b=s),s||!r&&b},N=function(t,e){if(A(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},k=v;k.l=x,k.i=A,k.w=function(t,e){return N(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function f(t){this.$L=x(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var g=f.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r){var s=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return k},g.isValid=function(){return!(this.$d.toString()===m)},g.isSame=function(t,e){var n=N(t);return this.startOf(e)<=n&&n<=this.endOf(e)},g.isAfter=function(t,e){return N(t)0,g<=f.r||!f.r){g<=1&&p>0&&(f=m[p-1]);var v=d[f.l];o&&(g=o(""+g)),c="string"==typeof v?v.replace("%d",g):v(g,r,f.l,u);break}}if(r)return c;var b=u?d.future:d.past;return"function"==typeof b?b(c):b.replace("%s",c)},r.to=function(t,e){return a(t,e,this,!0)},r.from=function(t,e){return a(t,e,this)};var i=function(t){return t.$u?n.utc():n()};r.toNow=function(t){return this.to(i(this),t)},r.fromNow=function(t){return this.from(i(this),t)}}}()},5187:(t,e,n)=>{"use strict";t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return t}()},3102:t=>{var e="long",n="short",r="narrow",s="numeric",a="2-digit";t.exports={number:{decimal:{style:"decimal"},integer:{style:"decimal",maximumFractionDigits:0},currency:{style:"currency",currency:"USD"},percent:{style:"percent"},default:{style:"decimal"}},date:{short:{month:s,day:s,year:a},medium:{month:n,day:s,year:s},long:{month:e,day:s,year:s},full:{month:e,day:s,year:s,weekday:e},default:{month:n,day:s,year:s}},time:{short:{hour:s,minute:s},medium:{hour:s,minute:s,second:s},long:{hour:s,minute:s,second:s,timeZoneName:n},full:{hour:s,minute:s,second:s,timeZoneName:n},default:{hour:s,minute:s,second:s}},duration:{default:{hours:{minimumIntegerDigits:1,maximumFractionDigits:0},minutes:{minimumIntegerDigits:2,maximumFractionDigits:0},seconds:{minimumIntegerDigits:2,maximumFractionDigits:3}}},parseNumberPattern:function(t){if(t){var e={},n=t.match(/\b[A-Z]{3}\b/i),r=t.replace(/[^¤]/g,"").length;if(!r&&n&&(r=1),r?(e.style="currency",e.currencyDisplay=1===r?"symbol":2===r?"code":"name",e.currency=n?n[0].toUpperCase():"USD"):t.indexOf("%")>=0&&(e.style="percent"),!/[@#0]/.test(t))return e.style?e:void 0;if(e.useGrouping=t.indexOf(",")>=0,/E\+?[@#0]+/i.test(t)||t.indexOf("@")>=0){var s=t.replace(/E\+?[@#0]+|[^@#0]/gi,"");e.minimumSignificantDigits=Math.min(Math.max(s.replace(/[^@0]/g,"").length,1),21),e.maximumSignificantDigits=Math.min(Math.max(s.length,1),21)}else{for(var a=t.replace(/[^#0.]/g,"").split("."),i=a[0],o=i.length-1;"0"===i[o];)--o;e.minimumIntegerDigits=Math.min(Math.max(i.length-1-o,1),21);var l=a[1]||"";for(o=0;"0"===l[o];)++o;for(e.minimumFractionDigits=Math.min(Math.max(o,0),20);"#"===l[o];)++o;e.maximumFractionDigits=Math.min(Math.max(o,0),20)}return e}},parseDatePattern:function(t){if(t){for(var i={},o=0;o{"use strict";var r=n(3102),s=n(7995),a=n(2600);function i(t,e,n,r,s){var a=t.map((function(t){return function(t,e,n,r,s){if("string"==typeof t){var a=t;return function(){return a}}var l,c=t[0],u=t[1];if(e&&"#"===t[0]){c=e[0];var d=e[2],h=(r.number||m.number)([c,"number"],n);return function(t){return h(o(c,t)-d,t)}}"plural"===u||"selectordinal"===u?(l={},Object.keys(t[3]).forEach((function(e){l[e]=i(t[3][e],t,n,r,s)})),t=[t[0],t[1],t[2],l]):t[2]&&"object"==typeof t[2]&&(l={},Object.keys(t[2]).forEach((function(e){l[e]=i(t[2][e],t,n,r,s)})),t=[t[0],t[1],l]);var p=u&&(r[u]||m[u]);if(p){var f=p(t,n);return function(t){return f(o(c,t),t)}}return s?function(t){return String(o(c,t))}:function(t){return o(c,t)}}(t,e,n,r,s)}));return s?1===a.length?a[0]:function(t){for(var e="",n=0;n0)n=new Intl.PluralRules(e,{type:r});else{var l=s(e,a),c=l&&a[l][r]||d;n={select:c}}return function(t,e){return(o["="+ +t]||o[n.select(t-i)]||o.other)(e)}}function d(){return"other"}(e=t.exports=function(t,e,n){return i(t,null,e||"en",n||{},!0)}).toParts=function(t,e,n){return i(t,null,e||"en",n||{},!1)};var m={number:l,ordinal:l,spellout:l,duration:function(t,e){var n=t[2],s=r.duration[n]||r.duration.default,a=new Intl.NumberFormat(e,s.seconds).format,i=new Intl.NumberFormat(e,s.minutes).format,o=new Intl.NumberFormat(e,s.hours).format,l=/^fi$|^fi-|^da/.test(String(e))?".":":";return function(t,e){if(t=+t,!isFinite(t))return a(t);var n=~~(t/60/60),r=~~(t/60%60),s=(n?o(Math.abs(n))+l:"")+i(Math.abs(r))+l+a(Math.abs(t%60));return t<0?o(-1).replace(o(1),s):s}},date:c,time:c,plural:u,selectordinal:u,select:function(t,e){var n=t[2];return function(t,e){return(n[t]||n.other)(e)}}};e.types=m},2600:t=>{"use strict";var e="zero",n="one",r="two",s="few",a="many",i="other",o=[function(t){return 1==+t?n:i},function(t){var e=+t;return 0<=e&&e<=1?n:i},function(t){return 0===Math.floor(Math.abs(+t))||1==+t?n:i},function(t){var o=+t;return 0===o?e:1===o?n:2===o?r:3<=o%100&&o%100<=10?s:11<=o%100&&o%100<=99?a:i},function(t){var e=Math.floor(Math.abs(+t)),r=(t+".").split(".")[1].length;return 1===e&&0===r?n:i},function(t){var e=+t;return e%10==1&&e%100!=11?n:2<=e%10&&e%10<=4&&(e%100<12||14{"use strict";var n="{",r="}",s=",",a="#",i="<",o=">",l="=9&&t<=13||32===t||133===t||160===t||6158===t||t>=8192&&t<=8205||8232===t||8233===t||8239===t||8287===t||8288===t||12288===t||65279===t}function f(t){for(var e=t.pattern,n=e.length,r=t.index;t.index"===t.pattern.slice(t.index,t.index+2))return t.tokens&&t.tokens.push(["syntax","/>"]),t.index+=2,[n,e];if(t.pattern[t.index]!==o)throw A(t,o);t.tokens&&t.tokens.push(["syntax",o]),++t.index;var r=m(t,e),s=t.index;if(t.pattern.slice(t.index,t.index+2)!==l)throw A(t,l+n+o);t.tokens&&t.tokens.push(["syntax",l]),t.index+=2;var a=v(t,!0);if(a&&t.tokens&&t.tokens.push(["id",a]),n!==a)throw t.index=s,A(t,l+n+o,l+a+o);if(f(t),t.pattern[t.index]!==o)throw A(t,o);return t.tokens&&t.tokens.push(["syntax",o]),++t.index,[n,e,{children:r}]}}(t);if(c)return c;if(e[t.index]!==n)throw A(t,n);t.tokens&&t.tokens.push(["syntax",n]),++t.index,f(t);var d=v(t);if(!d)throw A(t,"placeholder id");t.tokens&&t.tokens.push(["id",d]),f(t);var h=e[t.index];if(h===r)return t.tokens&&t.tokens.push(["syntax",r]),++t.index,[d];if(h!==s)throw A(t,", or }");t.tokens&&t.tokens.push(["syntax",s]),++t.index,f(t);var p,g=v(t);if(!g)throw A(t,"placeholder type");if(t.tokens&&t.tokens.push(["type",g]),f(t),(h=e[t.index])===r){if(t.tokens&&t.tokens.push(["syntax",r]),"plural"===g||"selectordinal"===g||"select"===g)throw A(t,g+" sub-messages");return++t.index,[d,g]}if(h!==s)throw A(t,", or }");if(t.tokens&&t.tokens.push(["syntax",s]),++t.index,f(t),"plural"===g||"selectordinal"===g){var w=function(t){var e,n=t.pattern,r=n.length,s=0;if("offset:"===n.slice(t.index,t.index+7)){t.tokens&&t.tokens.push(["offset","offset"],["syntax",":"]),t.index+=7,f(t);for(var a=t.index;t.index=48&&e<=57);)++t.index;if(a===t.index)throw A(t,"offset number");t.tokens&&t.tokens.push(["number",n.slice(a,t.index)]),s=+n.slice(a,t.index)}return s}(t);f(t),p=[d,g,w,y(t,g)]}else if("select"===g)p=[d,g,y(t,g)];else if(u.indexOf(g)>=0)p=[d,g,b(t)];else{var x=t.index,N=b(t);f(t),e[t.index]===n&&(t.index=x,N=y(t,g)),p=[d,g,N]}if(f(t),e[t.index]!==r)throw A(t,r);return t.tokens&&t.tokens.push(["syntax",r]),++t.index,p}function v(t,e){for(var l=t.pattern,u=l.length,d="";t.index=0)throw A(t,null,null,'"other" sub-message must be specified in '+e);return a}function w(t,e){if(t.pattern[t.index]!==n)throw A(t,"{ to start sub-message");t.tokens&&t.tokens.push(["syntax",n]),++t.index;var s=m(t,e);if(t.pattern[t.index]!==r)throw A(t,"} to end sub-message");return t.tokens&&t.tokens.push(["syntax",r]),++t.index,s}function A(t,e,n,r){var s=t.pattern,a=s.slice(0,t.index).split(/\r?\n/),i=t.index,o=a.length,l=a.slice(-1)[0].length;return n=n||(t.index>=s.length?"end of message pattern":v(t)||s[t.index]),r||(r=function(t,e){return t?"Expected "+t+" but found "+e:"Unexpected "+e+" found"}(e,n)),new x(r+=" in "+s.replace(/\r?\n/g,"\n"),e,n,i,o,l)}function x(t,e,n,r,s,a){Error.call(this,t),this.name="SyntaxError",this.message=t,this.expected=e,this.found=n,this.offset=r,this.line=s,this.column=a}e=t.exports=function(t,e){return m({pattern:String(t),index:0,tagsType:e&&e.tagsType||null,tokens:e&&e.tokens||null},"")},x.prototype=Object.create(Error.prototype),e.SyntaxError=x},3083:(t,e,n)=>{"use strict";var r=n(9897),s=n(6087),a=n(2600),i=n(7995),o=n(3102);function l(t,e){return Object.keys(e).forEach((function(n){t[n]=e[n]})),t}t.exports=function t(){var e=l({},o),n="en",c={},u=function(t){return t},d=null,m="warning",h={};function p(t,e,a){var i="string"==typeof t?t:t.default,o=v(i,"object"==typeof t&&t.id||u(i),a||n);return(o.format||(o.format=s(r(o.message),a||n,h)))(e)}p.rich=function(t,e,a){var i="string"==typeof t?t:t.default,o=v(i,"object"==typeof t&&t.id||u(i),a||n);return(o.toParts||(o.toParts=s.toParts(r(o.message,{tagsType:f}),a||n,h)))(e)};var f="<>";function g(t,e){var n=t[2];return function(t,e){var r="object"==typeof n?function(t,e){return Object.keys(t).reduce((function(n,r){return n[r]=t[r](e),n}),{})}(n,e):n;return"function"==typeof t?t(r):t}}function v(t,e,n){var r=i(n,c)||"en",s=c[r]||(c[r]={}),a=s[e];if("string"==typeof a&&(a=s[e]={message:a}),!a){var o='Translation for "'+e+'" in "'+r+'" is missing';if("warning"===m)"undefined"!=typeof console&&console.warn(o);else if("ignore"!==m)throw new Error(o);var l="function"==typeof d?d(t,e,r)||t:d||t;a=s[e]={message:l}}return a}function b(t,e,r,s,o){"object"==typeof r&&"object"!=typeof s&&(o=s,s=r,r=0);var l=i(o||n,a),c=l&&a[l][t]||y;return s["="+ +e]||s[c(e-r)]||s.other}function y(){return"other"}return h[f]=g,p.setup=function(t){return(t=t||{}).locale&&(n=t.locale),"translations"in t&&(c=t.translations||{}),t.generateId&&(u=t.generateId),"missingReplacement"in t&&(d=t.missingReplacement),t.missingTranslation&&(m=t.missingTranslation),t.formats&&(t.formats.number&&l(e.number,t.formats.number),t.formats.date&&l(e.date,t.formats.date),t.formats.time&&l(e.time,t.formats.time)),t.types&&((h=t.types)[f]=g),{locale:n,translations:c,generateId:u,missingReplacement:d,missingTranslation:m,formats:e,types:h}},p.number=function(t,r,s){var a=r&&e.number[r]||e.parseNumberPattern(r)||e.number.default;return new Intl.NumberFormat(s||n,a).format(t)},p.date=function(t,r,s){var a=r&&e.date[r]||e.parseDatePattern(r)||e.date.default;return new Intl.DateTimeFormat(s||n,a).format(t)},p.time=function(t,r,s){var a=r&&e.time[r]||e.parseDatePattern(r)||e.time.default;return new Intl.DateTimeFormat(s||n,a).format(t)},p.select=function(t,e){return e[t]||e.other},p.custom=function(t,e,n,r){return t[1]in h?h[t[1]](t,e)(n,r):n},p.plural=b.bind(null,"cardinal"),p.selectordinal=b.bind(null,"ordinal"),p.namespace=t,p}()},2894:function(){!function(t){function e(e){if("string"==typeof e.data&&(e.data={keys:e.data}),e.data&&e.data.keys&&"string"==typeof e.data.keys){var n=e.handler,r=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable")||t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1)){var s="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),i="",o={};t.each(["alt","ctrl","shift"],(function(t,n){e[n+"Key"]&&s!==n&&(i+=n+"+")})),e.metaKey&&!e.ctrlKey&&"meta"!==s&&(i+="meta+"),e.metaKey&&"meta"!==s&&i.indexOf("alt+ctrl+shift+")>-1&&(i=i.replace("alt+ctrl+shift+","hyper+")),s?o[i+s]=!0:(o[i+a]=!0,o[i+t.hotkeys.shiftNums[a]]=!0,"shift+"===i&&(o[t.hotkeys.shiftNums[a]]=!0));for(var l=0,c=r.length;l","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},t.each(["keydown","keyup","keypress"],(function(){t.event.special[this]={add:e}}))}(jQuery||this.jQuery||window.jQuery)},1963:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(r,s){"use strict";var a=[],i=Object.getPrototypeOf,o=a.slice,l=a.flat?function(t){return a.flat.call(t)}:function(t){return a.concat.apply([],t)},c=a.push,u=a.indexOf,d={},m=d.toString,h=d.hasOwnProperty,p=h.toString,f=p.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},y=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function A(t,e,n){var r,s,a=(n=n||y).createElement("script");if(a.text=t,e)for(r in w)(s=e[r]||e.getAttribute&&e.getAttribute(r))&&a.setAttribute(r,s);n.head.appendChild(a).parentNode.removeChild(a)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[m.call(t)]||"object":typeof t}var N="3.7.1",k=/HTML$/i,_=function(t,e){return new _.fn.init(t,e)};function S(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!v(t)&&!b(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}_.fn=_.prototype={jquery:N,constructor:_,length:0,toArray:function(){return o.call(this)},get:function(t){return null==t?o.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=_.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return _.each(this,t)},map:function(t){return this.pushStack(_.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(_.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(_.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+P+")"+P+"*"),q=new RegExp(P+"|>"),H=new RegExp($),U=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:new RegExp("^(?:"+S+")$","i"),needsContext:new RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},z=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+P+"?|\\\\([^\\r\\n\\f])","g"),Q=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},X=function(){lt()},J=mt((function(t){return!0===t.disabled&&E(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{f.apply(a=o.call(L.childNodes),L.childNodes),a[L.childNodes.length].nodeType}catch(t){f={apply:function(t,e){j.apply(t,o.call(e))},call:function(t){j.apply(t,o.call(arguments,1))}}}function Z(t,e,n,r){var s,a,i,o,c,u,h,p=e&&e.ownerDocument,b=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return n;if(!r&&(lt(e),e=e||l,d)){if(11!==b&&(c=V.exec(t)))if(s=c[1]){if(9===b){if(!(i=e.getElementById(s)))return n;if(i.id===s)return f.call(n,i),n}else if(p&&(i=p.getElementById(s))&&Z.contains(e,i)&&i.id===s)return f.call(n,i),n}else{if(c[2])return f.apply(n,e.getElementsByTagName(t)),n;if((s=c[3])&&e.getElementsByClassName)return f.apply(n,e.getElementsByClassName(s)),n}if(!(N[t+" "]||m&&m.test(t))){if(h=t,p=e,1===b&&(q.test(t)||F.test(t))){for((p=K.test(t)&&ot(e.parentNode)||e)==e&&g.scope||((o=e.getAttribute("id"))?o=_.escapeSelector(o):e.setAttribute("id",o=v)),a=(u=ut(t)).length;a--;)u[a]=(o?"#"+o:":scope")+" "+dt(u[a]);h=u.join(",")}try{return f.apply(n,p.querySelectorAll(h)),n}catch(e){N(t,!0)}finally{o===v&&e.removeAttribute("id")}}}return bt(t.replace(M,"$1"),e,n,r)}function tt(){var t=[];return function n(r,s){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=s}}function et(t){return t[v]=!0,t}function nt(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function rt(t){return function(e){return E(e,"input")&&e.type===t}}function st(t){return function(e){return(E(e,"input")||E(e,"button"))&&e.type===t}}function at(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&J(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function it(t){return et((function(e){return e=+e,et((function(n,r){for(var s,a=t([],n.length,e),i=a.length;i--;)n[s=a[i]]&&(n[s]=!(r[s]=n[s]))}))}))}function ot(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var n,r=t?t.ownerDocument||t:L;return r!=l&&9===r.nodeType&&r.documentElement?(c=(l=r).documentElement,d=!_.isXMLDoc(l),p=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&L!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",X),g.getById=nt((function(t){return c.appendChild(t).id=_.expando,!l.getElementsByName||!l.getElementsByName(_.expando).length})),g.disconnectedMatch=nt((function(t){return p.call(t,"*")})),g.scope=nt((function(){return l.querySelectorAll(":scope")})),g.cssHas=nt((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),g.getById?(e.filter.ID=function(t){var e=t.replace(Y,Q);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(Y,Q);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var n,r,s,a=e.getElementById(t);if(a){if((n=a.getAttributeNode("id"))&&n.value===t)return[a];for(s=e.getElementsByName(t),r=0;a=s[r++];)if((n=a.getAttributeNode("id"))&&n.value===t)return[a]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&d)return e.getElementsByClassName(t)},m=[],nt((function(t){var e;c.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||m.push("\\["+P+"*(?:value|"+S+")"),t.querySelectorAll("[id~="+v+"-]").length||m.push("~="),t.querySelectorAll("a#"+v+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll(":checked").length||m.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+P+"*name"+P+"*="+P+"*(?:''|\"\")")})),g.cssHas||m.push(":has"),m=m.length&&new RegExp(m.join("|")),k=function(t,e){if(t===e)return i=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===n?t===l||t.ownerDocument==L&&Z.contains(L,t)?-1:e===l||e.ownerDocument==L&&Z.contains(L,e)?1:s?u.call(s,t)-u.call(s,e):0:4&n?-1:1)},l):l}for(t in Z.matches=function(t,e){return Z(t,null,null,e)},Z.matchesSelector=function(t,e){if(lt(t),d&&!N[e+" "]&&(!m||!m.test(e)))try{var n=p.call(t,e);if(n||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){N(e,!0)}return Z(e,l,null,[t]).length>0},Z.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),_.contains(t,e)},Z.attr=function(t,n){(t.ownerDocument||t)!=l&<(t);var r=e.attrHandle[n.toLowerCase()],s=r&&h.call(e.attrHandle,n.toLowerCase())?r(t,n,!d):void 0;return void 0!==s?s:t.getAttribute(n)},Z.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},_.uniqueSort=function(t){var e,n=[],r=0,a=0;if(i=!g.sortStable,s=!g.sortStable&&o.call(t,0),C.call(t,k),i){for(;e=t[a++];)e===t[a]&&(r=n.push(a));for(;r--;)D.call(t,n[r],1)}return s=null,t},_.fn.uniqueSort=function(){return this.pushStack(_.uniqueSort(o.apply(this)))},e=_.expr={cacheLength:50,createPseudo:et,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Y,Q),t[3]=(t[3]||t[4]||t[5]||"").replace(Y,Q),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Z.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Z.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&H.test(n)&&(e=ut(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Y,Q).toLowerCase();return"*"===t?function(){return!0}:function(t){return E(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+P+")"+t+"("+P+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var s=Z.attr(r,t);return null==s?"!="===e:!e||(s+="","="===e?s===n:"!="===e?s!==n:"^="===e?n&&0===s.indexOf(n):"*="===e?n&&s.indexOf(n)>-1:"$="===e?n&&s.slice(-n.length)===n:"~="===e?(" "+s.replace(B," ")+" ").indexOf(n)>-1:"|="===e&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,s){var a="nth"!==t.slice(0,3),i="last"!==t.slice(-4),o="of-type"===e;return 1===r&&0===s?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,m,h,p=a!==i?"nextSibling":"previousSibling",f=e.parentNode,g=o&&e.nodeName.toLowerCase(),y=!l&&!o,w=!1;if(f){if(a){for(;p;){for(d=e;d=d[p];)if(o?E(d,g):1===d.nodeType)return!1;h=p="only"===t&&!h&&"nextSibling"}return!0}if(h=[i?f.firstChild:f.lastChild],i&&y){for(w=(m=(c=(u=f[v]||(f[v]={}))[t]||[])[0]===b&&c[1])&&c[2],d=m&&f.childNodes[m];d=++m&&d&&d[p]||(w=m=0)||h.pop();)if(1===d.nodeType&&++w&&d===e){u[t]=[b,m,w];break}}else if(y&&(w=m=(c=(u=e[v]||(e[v]={}))[t]||[])[0]===b&&c[1]),!1===w)for(;(d=++m&&d&&d[p]||(w=m=0)||h.pop())&&(!(o?E(d,g):1===d.nodeType)||!++w||(y&&((u=d[v]||(d[v]={}))[t]=[b,w]),d!==e)););return(w-=s)===r||w%r==0&&w/r>=0}}},PSEUDO:function(t,n){var r,s=e.pseudos[t]||e.setFilters[t.toLowerCase()]||Z.error("unsupported pseudo: "+t);return s[v]?s(n):s.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var r,a=s(t,n),i=a.length;i--;)t[r=u.call(t,a[i])]=!(e[r]=a[i])})):function(t){return s(t,0,r)}):s}},pseudos:{not:et((function(t){var e=[],n=[],r=vt(t.replace(M,"$1"));return r[v]?et((function(t,e,n,s){for(var a,i=r(t,null,s,[]),o=t.length;o--;)(a=i[o])&&(t[o]=!(e[o]=a))})):function(t,s,a){return e[0]=t,r(e,null,a,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return Z(t,e).length>0}})),contains:et((function(t){return t=t.replace(Y,Q),function(e){return(e.textContent||_.text(e)).indexOf(t)>-1}})),lang:et((function(t){return U.test(t||"")||Z.error("unsupported lang: "+t),t=t.replace(Y,Q).toLowerCase(),function(e){var n;do{if(n=d?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=r.location&&r.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:at(!1),disabled:at(!0),checked:function(t){return E(t,"input")&&!!t.checked||E(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return W.test(t.nodeName)},input:function(t){return z.test(t.nodeName)},button:function(t){return E(t,"input")&&"button"===t.type||E(t,"button")},text:function(t){var e;return E(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:it((function(){return[0]})),last:it((function(t,e){return[e-1]})),eq:it((function(t,e,n){return[n<0?n+e:n]})),even:it((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:it((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var s=t.length;s--;)if(!t[s](e,n,r))return!1;return!0}:t[0]}function pt(t,e,n,r,s){for(var a,i=[],o=0,l=t.length,c=null!=e;o-1&&(a[c]=!(i[c]=m))}}else h=pt(h===i?h.splice(v,h.length):h),s?s(null,i,h,l):f.apply(i,h)}))}function gt(t){for(var r,s,a,i=t.length,o=e.relative[t[0].type],l=o||e.relative[" "],c=o?1:0,d=mt((function(t){return t===r}),l,!0),m=mt((function(t){return u.call(r,t)>-1}),l,!0),h=[function(t,e,s){var a=!o&&(s||e!=n)||((r=e).nodeType?d(t,e,s):m(t,e,s));return r=null,a}];c1&&ht(h),c>1&&dt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(M,"$1"),s,c0,a=t.length>0,i=function(i,o,c,u,m){var h,p,g,v=0,y="0",w=i&&[],A=[],x=n,N=i||a&&e.find.TAG("*",m),k=b+=null==x?1:Math.random()||.1,S=N.length;for(m&&(n=o==l||o||m);y!==S&&null!=(h=N[y]);y++){if(a&&h){for(p=0,o||h.ownerDocument==l||(lt(h),c=!d);g=t[p++];)if(g(h,o||l,c)){f.call(u,h);break}m&&(b=k)}s&&((h=!g&&h)&&v--,i&&w.push(h))}if(v+=y,s&&y!==v){for(p=0;g=r[p++];)g(w,A,o,c);if(i){if(v>0)for(;y--;)w[y]||A[y]||(A[y]=T.call(u));A=pt(A)}f.apply(u,A),m&&!i&&A.length>0&&v+r.length>1&&_.uniqueSort(u)}return m&&(b=k,n=x),w};return s?et(i):i}(i,a)),o.selector=t}return o}function bt(t,n,r,s){var a,i,o,l,c,u="function"==typeof t&&t,m=!s&&ut(t=u.selector||t);if(r=r||[],1===m.length){if((i=m[0]=m[0].slice(0)).length>2&&"ID"===(o=i[0]).type&&9===n.nodeType&&d&&e.relative[i[1].type]){if(!(n=(e.find.ID(o.matches[0].replace(Y,Q),n)||[])[0]))return r;u&&(n=n.parentNode),t=t.slice(i.shift().value.length)}for(a=G.needsContext.test(t)?0:i.length;a--&&(o=i[a],!e.relative[l=o.type]);)if((c=e.find[l])&&(s=c(o.matches[0].replace(Y,Q),K.test(i[0].type)&&ot(n.parentNode)||n))){if(i.splice(a,1),!(t=s.length&&dt(i)))return f.apply(r,s),r;break}}return(u||vt(t,m))(s,n,!d,r,!n||K.test(t)&&ot(n.parentNode)||n),r}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,g.sortStable=v.split("").sort(k).join("")===v,lt(),g.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),_.find=Z,_.expr[":"]=_.expr.pseudos,_.unique=_.uniqueSort,Z.compile=vt,Z.select=bt,Z.setDocument=lt,Z.tokenize=ut,Z.escape=_.escapeSelector,Z.getText=_.text,Z.isXML=_.isXMLDoc,Z.selectors=_.expr,Z.support=_.support,Z.uniqueSort=_.uniqueSort}();var $=function(t,e,n){for(var r=[],s=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(s&&_(t).is(n))break;r.push(t)}return r},B=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},R=_.expr.match.needsContext,F=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function q(t,e,n){return v(e)?_.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?_.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?_.grep(t,(function(t){return u.call(e,t)>-1!==n})):_.filter(e,t,n)}_.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?_.find.matchesSelector(r,t)?[r]:[]:_.find.matches(t,_.grep(e,(function(t){return 1===t.nodeType})))},_.fn.extend({find:function(t){var e,n,r=this.length,s=this;if("string"!=typeof t)return this.pushStack(_(t).filter((function(){for(e=0;e1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(q(this,t||[],!1))},not:function(t){return this.pushStack(q(this,t||[],!0))},is:function(t){return!!q(this,"string"==typeof t&&R.test(t)?_(t):t||[],!1).length}});var H,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var r,s;if(!t)return this;if(n=n||H,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:U.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),F.test(r[1])&&_.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(s=y.getElementById(r[2]))&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,H=_(y);var G=/^(?:parents|prev(?:Until|All))/,z={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&_.find.matchesSelector(n,t))){a.push(n);break}return this.pushStack(a.length>1?_.uniqueSort(a):a)},index:function(t){return t?"string"==typeof t?u.call(_(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return $(t,"parentNode")},parentsUntil:function(t,e,n){return $(t,"parentNode",n)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return $(t,"nextSibling")},prevAll:function(t){return $(t,"previousSibling")},nextUntil:function(t,e,n){return $(t,"nextSibling",n)},prevUntil:function(t,e,n){return $(t,"previousSibling",n)},siblings:function(t){return B((t.parentNode||{}).firstChild,t)},children:function(t){return B(t.firstChild)},contents:function(t){return null!=t.contentDocument&&i(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},(function(t,e){_.fn[t]=function(n,r){var s=_.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(s=_.filter(r,s)),this.length>1&&(z[t]||_.uniqueSort(s),G.test(t)&&s.reverse()),this.pushStack(s)}}));var V=/[^\x20\t\r\n\f]+/g;function K(t){return t}function Y(t){throw t}function Q(t,e,n,r){var s;try{t&&v(s=t.promise)?s.call(t).done(e).fail(n):t&&v(s=t.then)?s.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return _.each(t.match(V)||[],(function(t,n){e[n]=!0})),e}(t):_.extend({},t);var e,n,r,s,a=[],i=[],o=-1,l=function(){for(s=s||t.once,r=e=!0;i.length;o=-1)for(n=i.shift();++o-1;)a.splice(n,1),n<=o&&o--})),this},has:function(t){return t?_.inArray(t,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return s=i=[],a=n="",this},disabled:function(){return!a},lock:function(){return s=i=[],n||e||(a=n=""),this},locked:function(){return!!s},fireWith:function(t,n){return s||(n=[t,(n=n||[]).slice?n.slice():n],i.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],n="pending",s={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},catch:function(t){return s.then(null,t)},pipe:function(){var t=arguments;return _.Deferred((function(n){_.each(e,(function(e,r){var s=v(t[r[4]])&&t[r[4]];a[r[1]]((function(){var t=s&&s.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,s?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,s){var a=0;function i(t,e,n,s){return function(){var o=this,l=arguments,c=function(){var r,c;if(!(t=a&&(n!==Y&&(o=void 0,l=[r]),e.rejectWith(o,l))}};t?u():(_.Deferred.getErrorHook?u.error=_.Deferred.getErrorHook():_.Deferred.getStackHook&&(u.error=_.Deferred.getStackHook()),r.setTimeout(u))}}return _.Deferred((function(r){e[0][3].add(i(0,r,v(s)?s:K,r.notifyWith)),e[1][3].add(i(0,r,v(t)?t:K)),e[2][3].add(i(0,r,v(n)?n:Y))})).promise()},promise:function(t){return null!=t?_.extend(t,s):s}},a={};return _.each(e,(function(t,r){var i=r[2],o=r[5];s[r[1]]=i.add,o&&i.add((function(){n=o}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),i.add(r[3].fire),a[r[0]]=function(){return a[r[0]+"With"](this===a?void 0:this,arguments),this},a[r[0]+"With"]=i.fireWith})),s.promise(a),t&&t.call(a,a),a},when:function(t){var e=arguments.length,n=e,r=Array(n),s=o.call(arguments),a=_.Deferred(),i=function(t){return function(n){r[t]=this,s[t]=arguments.length>1?o.call(arguments):n,--e||a.resolveWith(r,s)}};if(e<=1&&(Q(t,a.done(i(n)).resolve,a.reject,!e),"pending"===a.state()||v(s[n]&&s[n].then)))return a.then();for(;n--;)Q(s[n],i(n),a.reject);return a.promise()}});var X=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&X.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){r.setTimeout((function(){throw t}))};var J=_.Deferred();function Z(){y.removeEventListener("DOMContentLoaded",Z),r.removeEventListener("load",Z),_.ready()}_.fn.ready=function(t){return J.then(t).catch((function(t){_.readyException(t)})),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||J.resolveWith(y,[_]))}}),_.ready.then=J.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?r.setTimeout(_.ready):(y.addEventListener("DOMContentLoaded",Z),r.addEventListener("load",Z));var tt=function(t,e,n,r,s,a,i){var o=0,l=t.length,c=null==n;if("object"===x(n))for(o in s=!0,n)tt(t,e,o,n[o],!0,a,i);else if(void 0!==r&&(s=!0,v(r)||(i=!0),c&&(i?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(_(t),n)})),e))for(;o1,null,!0)},removeData:function(t){return this.each((function(){lt.remove(this,t)}))}}),_.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=ot.get(t,e),n&&(!r||Array.isArray(n)?r=ot.access(t,e,_.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=_.queue(t,e),r=n.length,s=n.shift(),a=_._queueHooks(t,e);"inprogress"===s&&(s=n.shift(),r--),s&&("fx"===e&&n.unshift("inprogress"),delete a.stop,s.call(t,(function(){_.dequeue(t,e)}),a)),!r&&a&&a.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return ot.get(t,n)||ot.access(t,n,{empty:_.Callbacks("once memory").add((function(){ot.remove(t,[e+"queue",n])}))})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,Et=/^$|^module$|\/(?:java|ecma)script/i;Nt=y.createDocumentFragment().appendChild(y.createElement("div")),(kt=y.createElement("input")).setAttribute("type","radio"),kt.setAttribute("checked","checked"),kt.setAttribute("name","t"),Nt.appendChild(kt),g.checkClone=Nt.cloneNode(!0).cloneNode(!0).lastChild.checked,Nt.innerHTML="",g.noCloneChecked=!!Nt.cloneNode(!0).lastChild.defaultValue,Nt.innerHTML="",g.option=!!Nt.lastChild;var Tt={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function Ct(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?_.merge([t],n):n}function Dt(t,e){for(var n=0,r=t.length;n",""]);var Pt=/<|&#?\w+;/;function Mt(t,e,n,r,s){for(var a,i,o,l,c,u,d=e.createDocumentFragment(),m=[],h=0,p=t.length;h-1)s&&s.push(a);else if(c=gt(a),i=Ct(d.appendChild(a),"script"),c&&Dt(i),n)for(u=0;a=i[u++];)Et.test(a.type||"")&&n.push(a);return d}var It=/^([^.]*)(?:\.(.+)|)/;function Ot(){return!0}function Lt(){return!1}function jt(t,e,n,r,s,a){var i,o;if("object"==typeof e){for(o in"string"!=typeof n&&(r=r||n,n=void 0),e)jt(t,o,n,r,e[o],a);return t}if(null==r&&null==s?(s=n,r=n=void 0):null==s&&("string"==typeof n?(s=r,r=void 0):(s=r,r=n,n=void 0)),!1===s)s=Lt;else if(!s)return t;return 1===a&&(i=s,s=function(t){return _().off(t),i.apply(this,arguments)},s.guid=i.guid||(i.guid=_.guid++)),t.each((function(){_.event.add(this,e,s,r,n)}))}function $t(t,e,n){n?(ot.set(t,e,!1),_.event.add(t,e,{namespace:!1,handler:function(t){var n,r=ot.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(_.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=o.call(arguments),ot.set(this,e,r),this[e](),n=ot.get(this,e),ot.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(ot.set(this,e,_.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Ot)}})):void 0===ot.get(t,e)&&_.event.add(t,e,Ot)}_.event={global:{},add:function(t,e,n,r,s){var a,i,o,l,c,u,d,m,h,p,f,g=ot.get(t);if(at(t))for(n.handler&&(n=(a=n).handler,s=a.selector),s&&_.find.matchesSelector(ft,s),n.guid||(n.guid=_.guid++),(l=g.events)||(l=g.events=Object.create(null)),(i=g.handle)||(i=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(V)||[""]).length;c--;)h=f=(o=It.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),h&&(d=_.event.special[h]||{},h=(s?d.delegateType:d.bindType)||h,d=_.event.special[h]||{},u=_.extend({type:h,origType:f,data:r,handler:n,guid:n.guid,selector:s,needsContext:s&&_.expr.match.needsContext.test(s),namespace:p.join(".")},a),(m=l[h])||((m=l[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,p,i)||t.addEventListener&&t.addEventListener(h,i)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),s?m.splice(m.delegateCount++,0,u):m.push(u),_.event.global[h]=!0)},remove:function(t,e,n,r,s){var a,i,o,l,c,u,d,m,h,p,f,g=ot.hasData(t)&&ot.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(V)||[""]).length;c--;)if(h=f=(o=It.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),h){for(d=_.event.special[h]||{},m=l[h=(r?d.delegateType:d.bindType)||h]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=a=m.length;a--;)u=m[a],!s&&f!==u.origType||n&&n.guid!==u.guid||o&&!o.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(m.splice(a,1),u.selector&&m.delegateCount--,d.remove&&d.remove.call(t,u));i&&!m.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||_.removeEvent(t,h,g.handle),delete l[h])}else for(h in l)_.event.remove(t,h+e[c],n,r,!0);_.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,n,r,s,a,i,o=new Array(arguments.length),l=_.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],u=_.event.special[l.type]||{};for(o[0]=l,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(a=[],i={},n=0;n-1:_.find(s,this,null,[c]).length),i[s]&&a.push(r);a.length&&o.push({elem:c,handlers:a})}return c=this,l\s*$/g;function qt(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&_(t).children("tbody")[0]||t}function Ht(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ut(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Gt(t,e){var n,r,s,a,i,o;if(1===e.nodeType){if(ot.hasData(t)&&(o=ot.get(t).events))for(s in ot.remove(e,"handle events"),o)for(n=0,r=o[s].length;n1&&"string"==typeof p&&!g.checkClone&&Rt.test(p))return t.each((function(s){var a=t.eq(s);f&&(e[0]=p.call(this,s,a.html())),Wt(a,e,n,r)}));if(m&&(a=(s=Mt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===s.childNodes.length&&(s=a),a||r)){for(o=(i=_.map(Ct(s,"script"),Ht)).length;d0&&Dt(i,!l&&Ct(t,"script")),o},cleanData:function(t){for(var e,n,r,s=_.event.special,a=0;void 0!==(n=t[a]);a++)if(at(n)){if(e=n[ot.expando]){if(e.events)for(r in e.events)s[r]?_.event.remove(n,r):_.removeEvent(n,r,e.handle);n[ot.expando]=void 0}n[lt.expando]&&(n[lt.expando]=void 0)}}}),_.fn.extend({detach:function(t){return Vt(this,t,!0)},remove:function(t){return Vt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?_.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qt(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=qt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(Ct(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return _.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Bt.test(t)&&!Tt[(St.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-a-l-o-.5))||0),l+c}function ue(t,e,n){var r=Qt(t),s=(!g.boxSizingReliable()||n)&&"border-box"===_.css(t,"boxSizing",!1,r),a=s,i=Zt(t,e,r),o="offset"+e[0].toUpperCase()+e.slice(1);if(Kt.test(i)){if(!n)return i;i="auto"}return(!g.boxSizingReliable()&&s||!g.reliableTrDimensions()&&E(t,"tr")||"auto"===i||!parseFloat(i)&&"inline"===_.css(t,"display",!1,r))&&t.getClientRects().length&&(s="border-box"===_.css(t,"boxSizing",!1,r),(a=o in t)&&(i=t[o])),(i=parseFloat(i)||0)+ce(t,e,n||(s?"border":"content"),a,r,i)+"px"}function de(t,e,n,r,s){return new de.prototype.init(t,e,n,r,s)}_.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Zt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,a,i,o=st(e),l=Yt.test(e),c=t.style;if(l||(e=se(o)),i=_.cssHooks[e]||_.cssHooks[o],void 0===n)return i&&"get"in i&&void 0!==(s=i.get(t,!1,r))?s:c[e];"string"==(a=typeof n)&&(s=ht.exec(n))&&s[1]&&(n=yt(t,e,s),a="number"),null!=n&&n==n&&("number"!==a||l||(n+=s&&s[3]||(_.cssNumber[o]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),i&&"set"in i&&void 0===(n=i.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var s,a,i,o=st(e);return Yt.test(e)||(e=se(o)),(i=_.cssHooks[e]||_.cssHooks[o])&&"get"in i&&(s=i.get(t,!0,n)),void 0===s&&(s=Zt(t,e,r)),"normal"===s&&e in oe&&(s=oe[e]),""===n||n?(a=parseFloat(s),!0===n||isFinite(a)?a||0:s):s}}),_.each(["height","width"],(function(t,e){_.cssHooks[e]={get:function(t,n,r){if(n)return!ae.test(_.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,r):Xt(t,ie,(function(){return ue(t,e,r)}))},set:function(t,n,r){var s,a=Qt(t),i=!g.scrollboxSize()&&"absolute"===a.position,o=(i||r)&&"border-box"===_.css(t,"boxSizing",!1,a),l=r?ce(t,e,r,o,a):0;return o&&i&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(a[e])-ce(t,e,"border",!1,a)-.5)),l&&(s=ht.exec(n))&&"px"!==(s[3]||"px")&&(t.style[e]=n,n=_.css(t,e)),le(0,n,l)}}})),_.cssHooks.marginLeft=te(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Zt(t,"marginLeft"))||t.getBoundingClientRect().left-Xt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),_.each({margin:"",padding:"",border:"Width"},(function(t,e){_.cssHooks[t+e]={expand:function(n){for(var r=0,s={},a="string"==typeof n?n.split(" "):[n];r<4;r++)s[t+pt[r]+e]=a[r]||a[r-2]||a[0];return s}},"margin"!==t&&(_.cssHooks[t+e].set=le)})),_.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var r,s,a={},i=0;if(Array.isArray(e)){for(r=Qt(t),s=e.length;i1)}}),_.Tween=de,de.prototype={constructor:de,init:function(t,e,n,r,s,a){this.elem=t,this.prop=n,this.easing=s||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=a||(_.cssNumber[n]?"":"px")},cur:function(){var t=de.propHooks[this.prop];return t&&t.get?t.get(this):de.propHooks._default.get(this)},run:function(t){var e,n=de.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):de.propHooks._default.set(this),this}},de.prototype.init.prototype=de.prototype,de.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||!_.cssHooks[t.prop]&&null==t.elem.style[se(t.prop)]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},de.propHooks.scrollTop=de.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=de.prototype.init,_.fx.step={};var me,he,pe=/^(?:toggle|show|hide)$/,fe=/queueHooks$/;function ge(){he&&(!1===y.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ge):r.setTimeout(ge,_.fx.interval),_.fx.tick())}function ve(){return r.setTimeout((function(){me=void 0})),me=Date.now()}function be(t,e){var n,r=0,s={height:t};for(e=e?1:0;r<4;r+=2-e)s["margin"+(n=pt[r])]=s["padding"+n]=t;return e&&(s.opacity=s.width=t),s}function ye(t,e,n){for(var r,s=(we.tweeners[e]||[]).concat(we.tweeners["*"]),a=0,i=s.length;a1)},removeAttr:function(t){return this.each((function(){_.removeAttr(this,t)}))}}),_.extend({attr:function(t,e,n){var r,s,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===t.getAttribute?_.prop(t,e,n):(1===a&&_.isXMLDoc(t)||(s=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?Ae:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:(t.setAttribute(e,n+""),n):s&&"get"in s&&null!==(r=s.get(t,e))?r:null==(r=_.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&E(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,s=e&&e.match(V);if(s&&1===t.nodeType)for(;n=s[r++];)t.removeAttribute(n)}}),Ae={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=xe[e]||_.find.attr;xe[e]=function(t,e,r){var s,a,i=e.toLowerCase();return r||(a=xe[i],xe[i]=s,s=null!=n(t,e,r)?i:null,xe[i]=a),s}}));var Ne=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function _e(t){return(t.match(V)||[]).join(" ")}function Se(t){return t.getAttribute&&t.getAttribute("class")||""}function Ee(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}_.fn.extend({prop:function(t,e){return tt(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[_.propFix[t]||t]}))}}),_.extend({prop:function(t,e,n){var r,s,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&_.isXMLDoc(t)||(e=_.propFix[e]||e,s=_.propHooks[e]),void 0!==n?s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:t[e]=n:s&&"get"in s&&null!==(r=s.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):Ne.test(t.nodeName)||ke.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){_.propFix[this.toLowerCase()]=this})),_.fn.extend({addClass:function(t){var e,n,r,s,a,i;return v(t)?this.each((function(e){_(this).addClass(t.call(this,e,Se(this)))})):(e=Ee(t)).length?this.each((function(){if(r=Se(this),n=1===this.nodeType&&" "+_e(r)+" "){for(a=0;a-1;)n=n.replace(" "+s+" "," ");i=_e(n),r!==i&&this.setAttribute("class",i)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,r,s,a,i=typeof t,o="string"===i||Array.isArray(t);return v(t)?this.each((function(n){_(this).toggleClass(t.call(this,n,Se(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(t):this.removeClass(t):(n=Ee(t),this.each((function(){if(o)for(a=_(this),s=0;s-1)return!0;return!1}});var Te=/\r/g;_.fn.extend({val:function(t){var e,n,r,s=this[0];return arguments.length?(r=v(t),this.each((function(n){var s;1===this.nodeType&&(null==(s=r?t.call(this,n,_(this).val()):t)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=_.map(s,(function(t){return null==t?"":t+""}))),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))}))):s?(e=_.valHooks[s.type]||_.valHooks[s.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(s,"value"))?n:"string"==typeof(n=s.value)?n.replace(Te,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:_e(_.text(t))}},select:{get:function(t){var e,n,r,s=t.options,a=t.selectedIndex,i="select-one"===t.type,o=i?null:[],l=i?a+1:s.length;for(r=a<0?l:i?a:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),a}}}}),_.each(["radio","checkbox"],(function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},g.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ce=r.location,De={guid:Date.now()},Pe=/\?/;_.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||_.error("Invalid XML: "+(n?_.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Me=/^(?:focusinfocus|focusoutblur)$/,Ie=function(t){t.stopPropagation()};_.extend(_.event,{trigger:function(t,e,n,s){var a,i,o,l,c,u,d,m,p=[n||y],f=h.call(t,"type")?t.type:t,g=h.call(t,"namespace")?t.namespace.split("."):[];if(i=m=o=n=n||y,3!==n.nodeType&&8!==n.nodeType&&!Me.test(f+_.event.triggered)&&(f.indexOf(".")>-1&&(g=f.split("."),f=g.shift(),g.sort()),c=f.indexOf(":")<0&&"on"+f,(t=t[_.expando]?t:new _.Event(f,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:_.makeArray(e,[t]),d=_.event.special[f]||{},s||!d.trigger||!1!==d.trigger.apply(n,e))){if(!s&&!d.noBubble&&!b(n)){for(l=d.delegateType||f,Me.test(l+f)||(i=i.parentNode);i;i=i.parentNode)p.push(i),o=i;o===(n.ownerDocument||y)&&p.push(o.defaultView||o.parentWindow||r)}for(a=0;(i=p[a++])&&!t.isPropagationStopped();)m=i,t.type=a>1?l:d.bindType||f,(u=(ot.get(i,"events")||Object.create(null))[t.type]&&ot.get(i,"handle"))&&u.apply(i,e),(u=c&&i[c])&&u.apply&&at(i)&&(t.result=u.apply(i,e),!1===t.result&&t.preventDefault());return t.type=f,s||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),e)||!at(n)||c&&v(n[f])&&!b(n)&&((o=n[c])&&(n[c]=null),_.event.triggered=f,t.isPropagationStopped()&&m.addEventListener(f,Ie),n[f](),t.isPropagationStopped()&&m.removeEventListener(f,Ie),_.event.triggered=void 0,o&&(n[c]=o)),t.result}},simulate:function(t,e,n){var r=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(r,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each((function(){_.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}});var Oe=/\[\]$/,Le=/\r?\n/g,je=/^(?:submit|button|image|reset|file)$/i,$e=/^(?:input|select|textarea|keygen)/i;function Be(t,e,n,r){var s;if(Array.isArray(e))_.each(e,(function(e,s){n||Oe.test(t)?r(t,s):Be(t+"["+("object"==typeof s&&null!=s?e:"")+"]",s,n,r)}));else if(n||"object"!==x(e))r(t,e);else for(s in e)Be(t+"["+s+"]",e[s],n,r)}_.param=function(t,e){var n,r=[],s=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,(function(){s(this.name,this.value)}));else for(n in t)Be(n,t[n],e,s);return r.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&$e.test(this.nodeName)&&!je.test(t)&&(this.checked||!_t.test(t))})).map((function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,(function(t){return{name:e.name,value:t.replace(Le,"\r\n")}})):{name:e.name,value:n.replace(Le,"\r\n")}})).get()}});var Re=/%20/g,Fe=/#.*$/,qe=/([?&])_=[^&]*/,He=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,Ge=/^\/\//,ze={},We={},Ve="*/".concat("*"),Ke=y.createElement("a");function Ye(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,s=0,a=e.toLowerCase().match(V)||[];if(v(n))for(;r=a[s++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Qe(t,e,n,r){var s={},a=t===We;function i(o){var l;return s[o]=!0,_.each(t[o]||[],(function(t,o){var c=o(e,n,r);return"string"!=typeof c||a||s[c]?a?!(l=c):void 0:(e.dataTypes.unshift(c),i(c),!1)})),l}return i(e.dataTypes[0])||!s["*"]&&i("*")}function Xe(t,e){var n,r,s=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((s[n]?t:r||(r={}))[n]=e[n]);return r&&_.extend(!0,t,r),t}Ke.href=Ce.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Xe(Xe(t,_.ajaxSettings),e):Xe(_.ajaxSettings,t)},ajaxPrefilter:Ye(ze),ajaxTransport:Ye(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,s,a,i,o,l,c,u,d,m,h=_.ajaxSetup({},e),p=h.context||h,f=h.context&&(p.nodeType||p.jquery)?_(p):_.event,g=_.Deferred(),v=_.Callbacks("once memory"),b=h.statusCode||{},w={},A={},x="canceled",N={readyState:0,getResponseHeader:function(t){var e;if(c){if(!i)for(i={};e=He.exec(a);)i[e[1].toLowerCase()+" "]=(i[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=i[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(t,e){return null==c&&(t=A[t.toLowerCase()]=A[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)N.always(t[N.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),k(0,e),this}};if(g.promise(N),h.url=((t||h.url||Ce.href)+"").replace(Ge,Ce.protocol+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(V)||[""],null==h.crossDomain){l=y.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Ke.protocol+"//"+Ke.host!=l.protocol+"//"+l.host}catch(t){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=_.param(h.data,h.traditional)),Qe(ze,h,e,N),c)return N;for(d in(u=_.event&&h.global)&&0==_.active++&&_.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Ue.test(h.type),s=h.url.replace(Fe,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Re,"+")):(m=h.url.slice(s.length),h.data&&(h.processData||"string"==typeof h.data)&&(s+=(Pe.test(s)?"&":"?")+h.data,delete h.data),!1===h.cache&&(s=s.replace(qe,"$1"),m=(Pe.test(s)?"&":"?")+"_="+De.guid+++m),h.url=s+m),h.ifModified&&(_.lastModified[s]&&N.setRequestHeader("If-Modified-Since",_.lastModified[s]),_.etag[s]&&N.setRequestHeader("If-None-Match",_.etag[s])),(h.data&&h.hasContent&&!1!==h.contentType||e.contentType)&&N.setRequestHeader("Content-Type",h.contentType),N.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ve+"; q=0.01":""):h.accepts["*"]),h.headers)N.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(p,N,h)||c))return N.abort();if(x="abort",v.add(h.complete),N.done(h.success),N.fail(h.error),n=Qe(We,h,e,N)){if(N.readyState=1,u&&f.trigger("ajaxSend",[N,h]),c)return N;h.async&&h.timeout>0&&(o=r.setTimeout((function(){N.abort("timeout")}),h.timeout));try{c=!1,n.send(w,k)}catch(t){if(c)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,i,l){var d,m,y,w,A,x=e;c||(c=!0,o&&r.clearTimeout(o),n=void 0,a=l||"",N.readyState=t>0?4:0,d=t>=200&&t<300||304===t,i&&(w=function(t,e,n){for(var r,s,a,i,o=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(s in o)if(o[s]&&o[s].test(r)){l.unshift(s);break}if(l[0]in n)a=l[0];else{for(s in n){if(!l[0]||t.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}if(a)return a!==l[0]&&l.unshift(a),n[a]}(h,N,i)),!d&&_.inArray("script",h.dataTypes)>-1&&_.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),w=function(t,e,n,r){var s,a,i,o,l,c={},u=t.dataTypes.slice();if(u[1])for(i in t.converters)c[i.toLowerCase()]=t.converters[i];for(a=u.shift();a;)if(t.responseFields[a]&&(n[t.responseFields[a]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=a,a=u.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(i=c[l+" "+a]||c["* "+a]))for(s in c)if((o=s.split(" "))[1]===a&&(i=c[l+" "+o[0]]||c["* "+o[0]])){!0===i?i=c[s]:!0!==c[s]&&(a=o[0],u.unshift(o[1]));break}if(!0!==i)if(i&&t.throws)e=i(e);else try{e=i(e)}catch(t){return{state:"parsererror",error:i?t:"No conversion from "+l+" to "+a}}}return{state:"success",data:e}}(h,w,N,d),d?(h.ifModified&&((A=N.getResponseHeader("Last-Modified"))&&(_.lastModified[s]=A),(A=N.getResponseHeader("etag"))&&(_.etag[s]=A)),204===t||"HEAD"===h.type?x="nocontent":304===t?x="notmodified":(x=w.state,m=w.data,d=!(y=w.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),N.status=t,N.statusText=(e||x)+"",d?g.resolveWith(p,[m,x,N]):g.rejectWith(p,[N,x,y]),N.statusCode(b),b=void 0,u&&f.trigger(d?"ajaxSuccess":"ajaxError",[N,h,d?m:y]),v.fireWith(p,[N,x]),u&&(f.trigger("ajaxComplete",[N,h]),--_.active||_.event.trigger("ajaxStop")))}return N},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],(function(t,e){_[e]=function(t,n,r,s){return v(n)&&(s=s||r,r=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:s,data:n,success:r},_.isPlainObject(t)&&t))}})),_.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),_._evalUrl=function(t,e,n){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){_.globalEval(t,e,n)}})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){_(this).wrapInner(t.call(this,e))})):this.each((function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){_(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){_(this).replaceWith(this.childNodes)})),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Je={0:200,1223:204},Ze=_.ajaxSettings.xhr();g.cors=!!Ze&&"withCredentials"in Ze,g.ajax=Ze=!!Ze,_.ajaxTransport((function(t){var e,n;if(g.cors||Ze&&!t.crossDomain)return{send:function(s,a){var i,o=t.xhr();if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(i in t.xhrFields)o[i]=t.xhrFields[i];for(i in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)o.setRequestHeader(i,s[i]);e=function(t){return function(){e&&(e=n=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===t?o.abort():"error"===t?"number"!=typeof o.status?a(0,"error"):a(o.status,o.statusText):a(Je[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=e(),n=o.onerror=o.ontimeout=e("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),_.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),_.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,s){e=_("