{"version":3,"sources":["/@whpath/whinstallationroot::jssdk/env/src/concepts.ts","/@whpath/whinstallationroot::jssdk/env/src/envbackend.ts","/@whpath/whinstallationroot::jssdk/tsrun/src/polyfills.ts","/@whpath/whinstallationroot::jssdk/std/quacks.ts","/@whpath/whinstallationroot::jssdk/std/datetime.ts","/@whpath/whinstallationroot::jssdk/std/promises.ts","/@whpath/whinstallationroot::jssdk/std/types.ts","/@whpath/whinstallationroot::jssdk/std/finmath.ts","/@whpath/whinstallationroot::jssdk/std/money.ts","/@whpath/whinstallationroot::jssdk/std/strings.ts","/@whpath/whinstallationroot::jssdk/std/platformbased.ts","/@whpath/whinstallationroot::jssdk/std/collections.ts","/@whpath/whinstallationroot::jssdk/std/std.ts","/@whpath/whinstallationroot::jssdk/env/src/fetchdebug.ts","/@whpath/whinstallationroot::jssdk/env/src/navigation.ts","/@whpath/whinstallationroot::jssdk/env/src/env.ts","/@whpath/mod::system/js/dompack/src/events.ts","/@whpath/whinstallationroot::jssdk/dompack/impl/busy.ts","/@whpath/whinstallationroot::jssdk/dompack/impl/tree.ts","/@whpath/mod::system/js/dompack/src/tree.ts","/@whpath/mod::system/js/dompack/src/create.ts","/@whpath/mod::system/js/dompack/src/components.ts","/@whpath/whinstallationroot::jssdk/dompack/impl/cookiebuilder.ts","/@whpath/whinstallationroot::jssdk/dompack/impl/storage.ts","/@whpath/whinstallationroot::jssdk/dompack/impl/preload.ts","/@whpath/whinstallationroot::jssdk/dompack/impl/browser.ts","/@whpath/whinstallationroot::jssdk/dompack/dompack.ts","/@whpath/mod::system/js/dompack/index.ts","/@whpath/whinstallationroot::node_modules/stackframe/stackframe.js","/@whpath/whinstallationroot::node_modules/error-stack-parser/error-stack-parser.js","/@whpath/whinstallationroot::node_modules/stack-generator/stack-generator.js","/@whpath/whinstallationroot::node_modules/source-map/lib/util.js","/@whpath/whinstallationroot::node_modules/source-map/lib/binary-search.js","/@whpath/whinstallationroot::node_modules/source-map/lib/array-set.js","/@whpath/whinstallationroot::node_modules/source-map/lib/base64.js","/@whpath/whinstallationroot::node_modules/source-map/lib/base64-vlq.js","/@whpath/whinstallationroot::node_modules/source-map/lib/quick-sort.js","/@whpath/whinstallationroot::node_modules/source-map/lib/source-map-consumer.js","/@whpath/whinstallationroot::node_modules/stacktrace-gps/stacktrace-gps.js","/@whpath/whinstallationroot::node_modules/stacktrace-js/stacktrace.js","/@whpath/whinstallationroot::node_modules/events/events.js","/@whpath/mod::system/js/net/requester.ts","/@whpath/mod::system/js/net/jsonrpc.ts","/@whpath/whinstallationroot::jssdk/gettid/src/hooks.ts","/@whpath/whinstallationroot::jssdk/gettid/src/internal.ts","/@whpath/whinstallationroot::jssdk/gettid/src/gettid.ts","/@whpath/mod::tollium/js/gettid.ts","/@whpath/mod::ipkot/node_modules/jquery/dist/jquery.js","/@whpath/whinstallationroot::jssdk/frontend/src/init.ts","/@whpath/whinstallationroot::jssdk/env/src/init-browser.ts","/@whpath/mod::publisher/js/internal/polyfills/all.ts","/@whpath/mod::publisher/js/internal/polyfills/iterator-helpers.ts","/@whpath/whdata::storage/system/js/publicconfig.json","/@whpath/mod::publisher/js/internal/polyfills/publisher-integration.ts","/@whpath/mod::ipkot/webdesigns/ipkotsite/ipkotsite.es","/@whpath/mod::system/js/wh/integration.ts","/@whpath/mod::system/js/wh/errorreporting.ts","/@whpath/mod::system/js/dompack/extra/browser.ts","/@whpath/mod::ipkot/webdesigns/shared/multiselect/index.es","/@whpath/mod::ipkot/webdesigns/ipkotsite/shared/forms/index.es","/@whpath/mod::publisher/js/forms/index.ts","/@whpath/mod::system/js/dompack/extra/merge.ts","/@whpath/mod::publisher/js/forms/internal/customvalidation.ts","/@whpath/mod::publisher/js/forms/internal/form.lang.json","/@whpath/mod::publisher/js/forms/internal/webharefields.tsx","/@whpath/mod::system/js/dompack/types/datetime.ts","/@whpath/mod::publisher/js/forms/fields/addressfield.ts","/@whpath/mod::publisher/js/forms/formbase.ts","/@whpath/mod::system/js/dompack/browserfix/focus.ts","/@whpath/mod::consilio/js/pxl.ts","/@whpath/whinstallationroot::jssdk/forms/src/registeredfield.ts","/@whpath/mod::publisher/js/forms/fields/arrayfield.ts","/@whpath/whinstallationroot::jssdk/forms/src/fieldmap.ts","/@whpath/whinstallationroot::jssdk/forms/src/address.ts","/@whpath/whinstallationroot::jssdk/jsonrpc-client/src/jsonrpc-client.ts","/@whpath/whinstallationroot::jssdk/js-api-tools/src/async.ts","/@whpath/whinstallationroot::node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js","/@whpath/whinstallationroot::jssdk/js-api-tools/src/stacktracing.ts","/@whpath/whinstallationroot::jssdk/js-api-tools/src/levenshtein.ts","/@whpath/whinstallationroot::jssdk/forms/src/formservice.ts","/@whpath/mod::publisher/js/forms/fields/captchafield.ts","/@whpath/mod::publisher/js/captcha/api.ts","/@whpath/mod::publisher/js/captcha/__captcha.lang.json","/@whpath/mod::publisher/js/forms/internal/datehelpers.ts","/@whpath/whinstallationroot::jssdk/forms/src/domsupport.ts","/@whpath/whinstallationroot::jssdk/forms/src/jsformelement.ts","/@whpath/mod::publisher/js/forms/rpc.ts","/@whpath/mod::publisher/js/forms/internal/emailvalidation.tsx","/@whpath/mod::system/js/dompack/api/dialog.ts","/@whpath/mod::system/js/dompack/extra/keyboard.ts","/@whpath/mod::system/js/dompack/src/debug.ts","/@whpath/whinstallationroot::jssdk/upload/src/upload.ts","/@whpath/mod::publisher/js/forms/fields/splitdatetime.tsx","/@whpath/mod::ipkot/web/jquery-ui/jquery.es","/@whpath/mod::ipkot/web/jquery-ui/widgets/autocomplete.es","/@whpath/mod::ipkot/web/jquery-ui/widgets/menu.es","/@whpath/mod::ipkot/web/jquery-ui/keycode.es","/@whpath/mod::ipkot/web/jquery-ui/version.es","/@whpath/mod::ipkot/web/jquery-ui/position.es","/@whpath/mod::ipkot/web/jquery-ui/safe-active-element.es","/@whpath/mod::ipkot/web/jquery-ui/unique-id.es","/@whpath/mod::ipkot/web/jquery-ui/widget.es","/@whpath/mod::ipkot/web/jquery-ui/widgets/selectmenu.es","/@whpath/mod::ipkot/web/jquery-ui/escape-selector.es","/@whpath/mod::ipkot/web/jquery-ui/form-reset-mixin.es","/@whpath/mod::ipkot/web/jquery-ui/form.es","/@whpath/mod::ipkot/web/jquery-ui/labels.es","/@whpath/mod::ipkot/web/jquery-ui/widgets/slider.es","/@whpath/mod::ipkot/web/jquery-ui/widgets/mouse.es","/@whpath/mod::ipkot/web/jquery-ui/ie.es","/@whpath/mod::ipkot/web/jquery-ui/widgets/datepicker.es","/@whpath/mod::ipkot/web/jquery-ui/i18n/datepicker-nl.es","/@whpath/mod::ipkot/web/jquery-ui/i18n/datepicker-en.es","/@whpath/mod::ipkot/web/jquery-ui-touch-punch/index.es","/@whpath/mod::publisher/js/richcontent/video.ts","/@whpath/mod::publisher/js/internal/rtd.lang.json","/@whpath/mod::publisher/js/analytics/consenthandler.ts","/@whpath/mod::ipkot/webdesigns/ipkotsite/ipkotsite.lang.json","/@whpath/mod::ipkot/webdesigns/ipkotsite/pages/search/index.es","/@whpath/mod::ipkot/libwoo/js/serverpool.es","/@whpath/mod::ipkot/webdesigns/ipkotsite/pages/search/firstvisit.es","/@whpath/mod::ipkot/webdesigns/shared/skiplinks.es","/@whpath/mod::publisher/js/linkhandler.ts"],"sourceRoot":"@mod-humpty/dumpty/had/a/great/fall/humpty/dumpty/fell/of/the/wall.js","sourcesContent":["// Types shared between front- and backend\n\n/** The DTAP stages */\nexport enum DTAPStage {\n Development = \"development\",\n Test = \"test\",\n Acceptance = \"acceptance\",\n Production = \"production\"\n}\n\nexport type ConsoleLogItemLocation = {\n filename: string;\n line: number;\n col: number;\n func: string;\n};\n\nexport type ConsoleLogItem = {\n /** Date when console function was called */\n when: Date;\n /** `console` method that was called (eg 'log') */\n method: string;\n /** Logged data */\n data: string;\n /** Location of caller */\n location?: ConsoleLogItemLocation;\n /** Codecontext */\n codeContextId?: string;\n};\n\n//TODO should perhaps be in std?\nexport type Serialized<T> = {\n [P in keyof T]: T[P] extends Date ? string : Serialized<T[P]>\n};\n\nexport type ConsoleLogItemJSON = Omit<ConsoleLogItem, \"when\"> & { when: string };\n","//We implement the backend version of getWHDebugFlags so bridge can access us without going through a recursive dep\n\nimport { DTAPStage } from \"./concepts\";\n\n/// An object with string keys and typed values\nexport interface WellKnownFlags {\n /** Log RPcs */\n rpc?: boolean;\n /** Log web traffic */\n wrq?: boolean;\n /** Autoprofile */\n apr?: boolean;\n /** IPC */\n ipc?: boolean;\n /** async */\n async?: boolean;\n}\nexport type DebugFlags = WellKnownFlags & { [key: string]: boolean | undefined };\n\nexport type DebugConfig = {\n tags: readonly string[];\n outputsession: string;\n context: string;\n};\n\nconst settingschangedcallbacks = new Array<() => void>;\n\n/* Global debug flags are set by `wh debug`, local flags are prefilled by environment variables.\n Edits to the debug flags will be applied to the local flags (unless setDebugFlagsOverrideCB returns\n override records).\n*/\nconst globalDebugFlags: DebugFlags = {}, localDebugFlags: DebugFlags = {};\n\n/** Returns the flag override records. The first record is examined first, then the second, etc. */\nlet debugFlagsOverridesCB: undefined | (() => DebugFlags[]);\n\n/** Override the debug flag override getter. */\nexport function setDebugFlagsOverrideCB(cb: undefined | (() => DebugFlags[])) {\n debugFlagsOverridesCB = cb;\n}\n\n/* Proxy handler for the published debug flags. Uses the override records (with the first record\n examined first, then the second, etc.) to override the flags from baseDebugFlags. Setting to `true` sets\n the flag, `false` disables it and setting to `undefined` has the same effect as deleting the property in the\n current top record (exposing any value from a lower record, like the debug settings from `wh debug`).\n*/\nclass DebugFlagsProxyHandler implements ProxyHandler<DebugFlags> {\n private getRecordList(): DebugFlags[] {\n return [...debugFlagsOverridesCB?.() ?? [], localDebugFlags, globalDebugFlags];\n }\n\n get(target: DebugFlags, p: string) {\n for (const record of this.getRecordList())\n if (p in record && typeof record[p] !== \"undefined\")\n return record[p];\n return undefined;\n }\n has(target: DebugFlags, p: string): boolean {\n return this.get(target, p) !== undefined;\n }\n ownKeys(target: DebugFlags): Array<string | symbol> {\n const keys = new Array<string | symbol>;\n for (const record of this.getRecordList())\n for (const key of Reflect.ownKeys(record))\n if (typeof key === \"string\" && record[key] !== undefined && !keys.includes(key))\n keys.push(key);\n return keys;\n }\n set(target: DebugFlags, p: string, newValue: boolean | undefined): boolean {\n const toModify = this.getRecordList()[0];\n if (typeof newValue === \"boolean\")\n toModify[p] = newValue;\n else\n delete toModify[p];\n return true;\n }\n deleteProperty(target: DebugFlags, p: string): boolean {\n const toModify = this.getRecordList()[0];\n delete toModify[p];\n return true;\n }\n getOwnPropertyDescriptor(target: DebugFlags, p: string): PropertyDescriptor | undefined {\n const value = this.get(target, p);\n return value !== undefined ? { enumerable: true, value, configurable: true } : undefined;\n }\n}\n\nexport const debugFlags = new Proxy<DebugFlags>({\n [Symbol.for('nodejs.util.inspect.custom')]: formatForConsoleLogs\n}, new DebugFlagsProxyHandler());\n\nfunction formatForConsoleLogs() {\n return `DebugFlags [${[...Object.keys(debugFlags)].filter(key => debugFlags[key]).join(\", \")}]`;\n}\n\n/** Update the debugconfig as present in the system configuration record\n @param settings - debugconfig cell of the system configuration record\n*/\nexport function updateDebugConfig(settings: DebugConfig | null) {\n const oldenabledflags = Object.keys(globalDebugFlags).sort();\n const newenabledflags = settings?.tags ? [...settings.tags].sort() : [];\n\n if (oldenabledflags.join(\",\") !== newenabledflags.join(\",\")) {\n for (const flag of newenabledflags)\n globalDebugFlags[flag] = true;\n for (const flag of oldenabledflags)\n if (!newenabledflags.includes(flag))\n delete globalDebugFlags[flag];\n for (const cb of [...settingschangedcallbacks]) {\n // ignore throws here, we can't do anything in this lowlevel code\n try { cb(); } catch (e) { }\n }\n }\n if (debugFlags.async && Error.stackTraceLimit < 100)\n Error.stackTraceLimit = 100;\n}\n\nexport function registerDebugConfigChangedCallback(cb: () => void) {\n settingschangedcallbacks.push(cb);\n}\n\n/** DTAP stage set for this WebHare */\nlet dtapStage: DTAPStage = DTAPStage.Production as const;\n\n/** Whether we should (pretend) to be live/production ... true on production and acceptance */\nlet isLive: boolean = true;\n\n/** The backend base URL. Used for eg. autoconfiguring JSON/RPC */\nlet backendBase = \"\";\n\n//deprecated variants\n/** @deprecated For WH5.4 and up use 'dtapStage' */\nlet dtapstage: DTAPStage = dtapStage;\n/** @deprecated For WH5.4 and up use 'isLive' */\nlet islive: boolean = isLive;\n\nexport function initEnv(setDtapStage: DTAPStage, setBackendBase: string) {\n dtapStage = setDtapStage;\n isLive = dtapStage === DTAPStage.Production || dtapStage === DTAPStage.Acceptance;\n backendBase = setBackendBase;\n\n dtapstage = dtapStage;\n islive = isLive;\n}\n\nexport { dtapStage, isLive, backendBase };\nexport { dtapstage, islive }; //deprecated variants\n","// Set up dispose symbols - https://github.com/evanw/esbuild/pull/3192 \"you'll need to polyfill Symbol.dispose if it's not present before you use it.\n\n//@ts-ignore -- It's marked readonly\nSymbol.dispose ||= Symbol.for('Symbol.dispose');\n//@ts-ignore -- It's marked readonly\nSymbol.asyncDispose ||= Symbol.for('Symbol.asyncDispose');\n\n// Set up promise resolvers (ES2024)\nPromise.withResolvers ||= function <T>(): PromiseWithResolvers<T> {\n let resolve: (value: T | PromiseLike<T>) => void;\n let reject: (reason: Error) => void;\n const promise = new Promise<T>((_resolve, _reject) => { resolve = _resolve; reject = _reject; });\n // @ts-ignore `resolve` and `reject` are assigned synchronously, which isn't picked up by the TypeScript compiler (see\n // https://github.com/Microsoft/TypeScript/issues/30053)\n return { promise, resolve, reject };\n};\n\n// Polyfills for https://caniuse.com/?search=groupby - needed until we can assume safari 17.4 as global baseline\nif (!Map.groupBy)\n Map.groupBy = function <Item, Key>(items: Iterable<Item>, callbackfn: (item: Item, idx: number) => Key): Map<Key, Item[]> {\n const retval = new Map<Key, Item[]>;\n let idx = 0;\n for (const item of items) {\n const key = callbackfn(item, idx++);\n let list = retval.get(key);\n if (!list)\n retval.set(key, list = []);\n list.push(item);\n }\n return retval;\n };\n\nif (!Object.groupBy)\n Object.groupBy = function <Item, Key extends string | number | symbol>(items: Iterable<Item>, callbackfn: (item: Item, idx: number) => Key): Partial<Record<Key, Item[]>> {\n return Object.fromEntries(Map.groupBy(items, callbackfn).entries()) as Partial<Record<Key, Item[]>>;\n };\n","//TODO can we replace ourselves with nodejs util.types in a pure NodeJS environment?\n\nfunction isCrossRealm(value: unknown): value is object {\n return Boolean(value // it's not null\n && typeof value === \"object\" //and it's an object\n && !(value instanceof Object)); //and it's not an instance of our Object\n}\n\n/** Test whether a value looks like an instance of Date (assumes no subclasses) */\nexport function isDate(value: unknown): value is Date {\n return value instanceof Date || (isCrossRealm(value) && value.constructor.name === \"Date\");\n}\n\n/** Test whether a value implements Blob */\nexport function isBlob(value: unknown): value is Blob {\n return value instanceof Blob || (isCrossRealm(value) && \"size\" in value && \"type\" in value && \"slice\" in value);\n}\n\n/** Test whether a value implements File */\nexport function isFile(value: unknown): value is File {\n return isBlob(value) && \"name\" in value;\n}\n\n/** Check if the object is probably an Error object. Can't use 'instanceof Error' as an Error might come from a different frame */\nexport function isError(e: unknown): e is Error {\n return e instanceof Error || (isCrossRealm(e) && \"name\" in e && \"stack\" in e && \"message\" in e);\n}\n\n/** Check if the object looks like a promise */\nexport function isPromise<T>(e: unknown): e is Promise<T> {\n return Boolean(e && typeof (e as Promise<unknown>).then === \"function\" && typeof (e as Promise<unknown>).catch === \"function\");\n}\n","import { isDate } from \"./quacks\";\n\n/** A relative (up to a week) or absolute wait period. Use 0 for 'polling' and Infinity to indicate an endless waits. Numbers are interpreted to be in milliseconds, a string is interpreted as a ISO8601 duration */\nexport type WaitPeriod = 0 | number | string | Date;\n\nexport interface Duration {\n sign: \"+\" | \"-\";\n years: number;\n months: number;\n weeks: number;\n days: number;\n hours: number;\n minutes: number;\n seconds: number;\n milliseconds: number;\n}\n\nfunction parseMS(ms: string): number {\n if (ms.length === 2) //.5\n return parseInt(ms.substring(1)) * 100;\n if (ms.length === 3) //.54\n return parseInt(ms.substring(1)) * 10;\n return parseInt(ms.substring(1, 4));\n}\n\n/** Parse an ISO8601 duration\n * @param duration - ISO8601 duration string (e.g. \"P1Y2M3DT4H5M6S\")\n */\nexport function parseDuration(duration: string): Duration {\n // const matches = duration.match(/(-)?P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?T(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?/);\n const matches = duration.match(/^(-)?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(\\.\\d+)?S)?)?$/);\n if (!matches ||\n (matches[4] && (matches[2] || matches[3] || matches[5])) || //can't have weeks and years/months/days\n !(matches[2] || matches[3] || matches[4] || matches[5] || matches[6] || matches[7] || matches[8])) //one component must be present\n throw new Error(`Invalid ISO8601 duration '${duration}'`);\n\n return {\n sign: matches[1] ? '-' : '+',\n years: parseInt(matches[2]) || 0,\n months: parseInt(matches[3]) || 0,\n weeks: parseInt(matches[4]) || 0,\n days: parseInt(matches[5]) || 0,\n hours: parseInt(matches[6]) || 0,\n minutes: parseInt(matches[7]) || 0,\n seconds: parseInt(matches[8]) || 0,\n milliseconds: matches[9] ? parseMS(matches[9]) : 0\n };\n}\n\n/** Add a duration (time) to a date\n * @param startingdate - Date to start from\n * @param duration - Duration to add (as object or as ISO8601 duration string, eg \"P1Y2M3DT4H5M6S\")\n */\nexport function addDuration(startingdate: Date, duration: Partial<Duration> | string): Date {\n if (typeof duration === \"string\")\n duration = parseDuration(duration);\n\n const direction = duration.sign === \"-\" ? -1 : 1;\n const date = new Date(startingdate);\n if (duration.years)\n date.setUTCFullYear(date.getUTCFullYear() + direction * duration.years);\n if (duration.months)\n date.setUTCMonth(date.getUTCMonth() + direction * duration.months);\n\n const modifydays = (duration.days ?? 0) + (duration.weeks ?? 0) * 7;\n if (modifydays)\n date.setUTCDate(date.getUTCDate() + direction * modifydays);\n\n const timeoffset = (duration.hours ?? 0) * 60 * 60 * 1000 + (duration.minutes ?? 0) * 60 * 1000 + (duration.seconds ?? 0) * 1000 + (duration.milliseconds ?? 0);\n date.setTime(date.getTime() + direction * timeoffset);\n\n return date;\n}\n\n/** Convert a WaitPeriod parameter to a Date\n * @param wait - Wait time as milliseconds or a Date\n * @param relativeTo - Date to use as a reference for relative waits\n*/\nexport function convertWaitPeriodToDate(wait: WaitPeriod, { relativeTo = null }: { relativeTo?: Date | null } = {}): Date {\n if (isDate(wait)) {\n return wait;\n } else if (typeof wait === \"string\") {\n return addDuration(relativeTo ?? new Date(), wait);\n } else if (typeof wait === \"number\") {\n if (wait === 0)\n return new Date(-864000 * 1000 * 10000000);\n if (wait === Infinity)\n return new Date(864000 * 1000 * 10000000);\n if (wait > 7 * 86400 * 1000)\n throw new Error(\"Invalid wait duration - a wait may not be longer than a week\"); //prevents you from passing in Date.now() based values\n if (wait > 0)\n return new Date((relativeTo?.getTime() ?? Date.now()) + wait);\n }\n\n throw new Error(\"Invalid wait duration - it must either be an absolute date, 0, a number of milliseconds or Infinity\");\n}\n\n/** Check whether the specified parts make a valid and reasonable (usually 1600+) date */\nexport function isValidDate(year: number, month: number, day: number, { minYear = 1601 } = {}) {\n if (!(year >= minYear && year <= 9999 && month >= 1 && month <= 12 && day >= 1 && day <= 31\n && Number.isSafeInteger(year) && Number.isSafeInteger(month) && Number.isSafeInteger(day)))\n return false;\n if ([4, 6, 9, 11].includes(month) && day > 30) //handle april, june, sep, nov\n return false;\n const isleapyear = (year % 400) === 0 || ((year % 100) !== 0 && (year % 4) === 0);\n if (month === 2 && day > (isleapyear ? 29 : 28))\n return false;\n return true;\n}\n\n/** Check whether the specified parts make a reasonable time (does not consider the leap second a valid time) */\nexport function isValidTime(hour: number, minute: number, second: number, msec: number) {\n return hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59 && second >= 0 && second <= 59 && msec >= 0 && msec <= 999\n && Number.isSafeInteger(hour) && Number.isSafeInteger(minute) && Number.isSafeInteger(second) && Number.isSafeInteger(msec);\n}\n","import { WaitPeriod, convertWaitPeriodToDate } from \"./datetime\";\n\n//TODO Deprecate once everyone is WH5.5+\nexport type DeferredPromise<T> = PromiseWithResolvers<T>;\n\n/** A promise that sleeps for the specified number of milliseconds\n * @param duration - Relative (milliseconds, but not Infinity) or absolute (Date) wait duration. May not be Infinity\n * @param options - Options - `signal` to set an AbortSignal which will canel this sleep\n*/\nexport function sleep(duration: WaitPeriod, options?: { signal?: AbortSignal }): Promise<void> {\n if (duration === Infinity)\n throw new Error(`A sleep may not be infinite`);\n\n const until = convertWaitPeriodToDate(duration);\n return new Promise(resolve => {\n const timeoutid = setTimeout(resolve, Math.max(0, until.getTime() - Date.now()));\n if (options?.signal)\n options.signal.addEventListener(\"abort\", () => clearTimeout(timeoutid));\n });\n}\n\n//TODO Deprecate once everyone is WH5.5+\nexport function createDeferred<T>(): PromiseWithResolvers<T> {\n return Promise.withResolvers<T>();\n}\n\n/** Wrap a promise in a timeout\n * @param promise - Promise to wrap\n * @param timeout - Timeout in milliseconds or as a Date\n * @param rejectWith - Error to reject with if the timeout expires (string, Error, or a callback returning one)\n*/\nexport function wrapInTimeout<T>(promise: Promise<T>, timeout: WaitPeriod, rejectWith: string | Error | (() => string | Error)): Promise<T> {\n if (timeout === Infinity)\n return promise;\n\n const until = convertWaitPeriodToDate(timeout);\n const timeoutpromise = new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => {\n //this approach allows to delay actual Error object construction\n const error: string | Error = typeof rejectWith === \"function\" ? rejectWith() : rejectWith;\n reject(typeof error === \"object\" ? error : new Error(error));\n }, until.getTime() - Date.now());\n\n //ensure timer cancellation\n promise.finally(() => clearTimeout(timer));\n });\n\n return Promise.race([promise, timeoutpromise]);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we need to accept any callback.\ntype CallbackFunctionVariadic<RetType> = (...args: any[]) => Promise<RetType>;\n\nexport interface SerializeOptions {\n ///Coalescing will ignore intermediate calls if the original call has not completed yet. Eg when invoking functions 1,2,3 in succession, only 3 will run, calls 1 and 2 will be merged into that call\n coalesce?: boolean;\n}\n\nclass Coalescer<RetVal> {\n private queue: Array<PromiseWithResolvers<RetVal>> = [];\n private call: CallbackFunctionVariadic<RetVal> | null = null;\n private readonly fn: CallbackFunctionVariadic<RetVal>;\n\n //invoke is the actual entry point for incoming calls (ie C++'s operator() )\n readonly invoke: CallbackFunctionVariadic<RetVal>;\n\n constructor(fn: CallbackFunctionVariadic<RetVal>) {\n this.invoke = this.onInvoke.bind(this);\n this.fn = fn;\n }\n private onInvoke(...args: unknown[]): Promise<RetVal> {\n //overwrite the call to execute\n this.call = () => this.fn(...args); //TODO just queueing the parameters might do?\n\n if (!this.queue.length) //schedule a flush of the queue\n setTimeout(() => this.flush(), 0);\n\n this.queue.push(Promise.withResolvers<RetVal>());\n return this.queue[this.queue.length - 1].promise;\n }\n\n private async flush() {\n for (let startpos = 0; this.queue && startpos < this.queue?.length;) {\n const currentpos = this.queue?.length;\n\n try {\n //invoke the last known call. *NOTE* new calls may be added to the queue now\n const result = await this.call!();\n for (let i = startpos; i < currentpos; i++)\n this.queue[i].resolve(result);\n } catch (e) {\n for (let i = startpos; i < currentpos; i++)\n this.queue[i].reject(e as Error);\n }\n startpos = currentpos;\n }\n //empty the queue\n this.queue.splice(0, this.queue.length);\n }\n}\n\n// export function<Fn extends (...args: any[]) => Promise<any>>(fn: Fn, options?: SerializeOptions): Fn {\n// type RetVal = ReturnType<Fn>;\n\n/** Wrap a function in a serializer */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we need to accept any callback.\nexport function wrapSerialized<Fn extends (...args: any[]) => Promise<any>>(fn: Fn, options?: SerializeOptions): Fn {\n type RetVal = ReturnType<Fn>;\n if (options?.coalesce)\n return (new Coalescer<RetVal>(fn)).invoke as Fn;\n\n let queue = Promise.resolve() as Promise<unknown>;\n return ((...args: unknown[]): Promise<RetVal> => {\n const res = queue.then(() => fn(...args));\n queue = res.catch(() => { /* ignore errors */ });\n return res;\n }) as Fn;\n}\n\n//TODO abandon the name 'serialize' for now so it's free and safe to use once JS Decorators land (so we can use @serialize there)\n/** @deprecated Use wrapSerialized instead */\nexport function serialize<RetVal>(fn: (...args: unknown[]) => Promise<RetVal>, context: unknown) {\n return wrapSerialized(fn, undefined);\n}\n","type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}`\n ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}`\n : Lowercase<S>;\n\ntype KeysToCamelCase<T> = {\n [K in keyof T as CamelCase<string & K>]: ToCamelCase<T[K]>;\n};\n\ntype CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ?\n `${T extends Capitalize<T> ? \"_\" : \"\"}${Lowercase<T>}${CamelToSnakeCase<U>}` :\n S;\n\ntype KeysToSnakeCase<T> = {\n [K in keyof T as CamelToSnakeCase<string & K>]: ToSnakeCase<T[K]>\n};\n\nexport type ToSnakeCase<T> =\n T extends unknown[] ? Array<ToSnakeCase<T[number]>> :\n T extends object ? KeysToSnakeCase<T> :\n T;\n\nexport type ToCamelCase<T> =\n T extends unknown[] ? Array<ToCamelCase<T[number]>> :\n T extends object ? KeysToCamelCase<T> :\n T;\n\n/** Convert a snake_case_name to its corresponding camelCaseName\n * @param name - Name to convert\n * @returns Converted name\n*/\nexport function nameToCamelCase(name: string) {\n return name.replaceAll(/_[a-z]/g, c => c[1].toUpperCase());\n}\n\n/** Convert a camelCaseName to corresponding snake_case_name\n * @param name - Name to convert\n * @returns Converted name\n*/\nexport function nameToSnakeCase(name: string) {\n return name.replaceAll(/[A-Z]/g, c => '_' + c.toLowerCase());\n}\n\n/** Convert all keys to camel case recursively\n * @param inp - Array or object to convert\n * @returns Converted object\n*/\nexport function toSnakeCase<T>(inp: T): ToSnakeCase<T> {\n if (Array.isArray(inp))\n return inp.map(toSnakeCase) as ToSnakeCase<T>;\n if (inp && typeof inp === \"object\")\n return Object.fromEntries(Object.entries(inp).map(([key, value]) => [nameToSnakeCase(key), toSnakeCase(value)])) as ToSnakeCase<T>;\n return inp as ToSnakeCase<T>;\n}\n\n/** Convert all keys to snake case recursively\n * @param inp - Array or object to convert\n * @returns Converted object\n*/\nexport function toCamelCase<T>(inp: T): ToCamelCase<T> {\n if (Array.isArray(inp))\n return inp.map(toCamelCase) as ToCamelCase<T>;\n if (inp && typeof inp === \"object\")\n return Object.fromEntries(Object.entries(inp).map(([key, value]) => [nameToCamelCase(key), toCamelCase(value)])) as ToCamelCase<T>;\n return inp as ToCamelCase<T>;\n}\n","/* A math library for safe calculation with money amounts in JS. If you don't\n know why we need this, try to predict what the following code would print:\n var cents=0;for(var i=0;i<100;++i)cents+=0.01;cents-=1;console.log(cents);\n and think twice about whether you want to code anything financial in JS.\n\n Money values supplied from HareScript should be formatted using FormatJSFinmathMoney\n*/\n\nexport type FinmathInput = string | number;\n\nexport type RoundMode = \"none\" | \"toward-zero\" | \"down\" | \"up\" | \"half-toward-zero\" | \"half-down\" | \"half-up\" | \"toward-infinity\" | \"half-toward-infinity\";\n\nexport interface SplitNumber {\n num: number;\n decimals: number;\n}\n\n//a 'price' is a string of the form \"nnn[.NNNN]\"\n\nfunction stripUnneededDecimals(num: number, decimals: number) {\n //we have a maximum of 5 digits of external precision\n if (decimals > 5) {\n // math.round rounds toward positive infinity\n const isneg = num < 0;\n if (isneg)\n num = -num;\n\n while (decimals > 6) { //truncate excess digits\n num = Math.floor(num / 10);\n --decimals;\n }\n //round up if 6th decimal >= 5\n num = Math.round(num / 10);\n decimals = 5;\n\n if (isneg)\n num = -num;\n }\n\n //strip unneeded decimals\n while (decimals > 0 && !(num % 10)) {\n num /= 10;\n --decimals;\n }\n\n return { num, decimals };\n}\n\nfunction toText(amount: SplitNumber, decimalpoint: string, mindecimals: number) {\n if (!Number.isSafeInteger(amount.num))\n throw new Error(\"Result would overflow the safe value range\");\n\n let num, decimals;\n ({ num, decimals } = stripUnneededDecimals(amount.num, amount.decimals));\n\n // Strip sign from number, may need to prefix it\n const isnegative = num < 0;\n if (isnegative)\n num = -num;\n\n let astext = String(num);\n\n // Ensure we have enough leading 0's to render the first integer digit\n if (astext.length <= decimals)\n astext = '00000000000000000000'.substr(0, decimals + 1 - astext.length) + astext;\n // make sure we have enough 0's to show mindecimals\n if (decimals < mindecimals) {\n astext += '00000000000000000000'.substr(0, mindecimals - decimals);\n decimals = mindecimals;\n }\n\n // insert decimal point if needed\n if (decimals)\n astext = astext.substr(0, astext.length - decimals) + decimalpoint + astext.substr(-decimals);\n\n // add sign if needed\n astext = (isnegative ? \"-\" : \"\") + astext;\n return astext;\n}\n\n/** Convert a money of any format to a split number object\n @param money - Either an integer number or string with a number\n @returns Split number object\n*/\nfunction splitValue(money: FinmathInput): SplitNumber {\n if (typeof money === 'number') {\n if (money !== Math.floor(money))\n throw new Error(\"Non-integer number passed\");\n if (!Number.isSafeInteger(money))\n throw new Error(`The value ${money} is outside the safe value range`);\n return { num: money, decimals: 0 };\n }\n if (typeof money !== 'string')\n throw new Error(\"Number or string expected, got \" + money);\n\n const split = money.match(/^(-)?([0-9]*)(\\.([0-9]{0,5})([0-9]*))?$/);\n if (!split)\n throw new Error(`Illegal money value received: '${money}'`);\n\n const sign = split[1] === '-' ? -1 : 1;\n const decimals = split[3] ? split[4].length : 0;\n // If there are more than 5 decimals, round up (using halfExpand strategy)\n const num = sign * (parseInt(split[2] || \"0\") * Math.pow(10, decimals) + (parseInt((split[4] || '')) || 0) + (split[5]?.[0] >= '5' ? 1 : 0));\n if (!Number.isSafeInteger(num))\n throw new Error(`The value '${money}' is outside the safe value range`);\n\n return stripUnneededDecimals(num, decimals);\n}\n\n/** Convert split number into a string\n*/\nfunction joinPrice(parts: SplitNumber): string {\n return toText(parts, '.', 0);\n}\n\nfunction adjustDecimals(amount: SplitNumber, requiredecimals: number) {\n const toadd = requiredecimals - amount.decimals;\n if (toadd <= 0)\n return;\n\n let multiplier = 1;\n for (let idx = 0; idx < toadd; ++idx)\n multiplier *= 10;\n\n if (!Number.isSafeInteger(amount.num * multiplier))\n throw new Error(\"adjustDecimals would overflow the safe value range\");\n\n amount.num *= multiplier;\n amount.decimals += toadd;\n}\n\n/** Returns if a price string is valid\n*/\nexport function isValidPrice(money: string) {\n if (typeof money !== 'string' || !money.match(/[0-9]+(\\.[0-9]{0,5})?$/))\n return false;\n return true;\n}\n\nfunction __add(lhs: SplitNumber, rhs: SplitNumber) {\n //equalize # of decimals, and then it's a simple addition\n const requiredecimals = Math.max(lhs.decimals, rhs.decimals);\n adjustDecimals(lhs, requiredecimals);\n adjustDecimals(rhs, requiredecimals);\n return { num: lhs.num + rhs.num, decimals: requiredecimals };\n}\n\n/** Adds two numbers together\n*/\nexport function add(amount1: FinmathInput, amount2: FinmathInput): string {\n return joinPrice(__add(splitValue(amount1), splitValue(amount2)));\n}\n\n/** Subtracts a number from another number\n*/\nexport function subtract(amount: FinmathInput, tosubtract: FinmathInput) {\n const lhs = splitValue(amount), rhs = splitValue(tosubtract);\n rhs.num = -rhs.num;\n return joinPrice(__add(lhs, rhs));\n}\n\nfunction __multiply(lhs: SplitNumber, rhs: SplitNumber) {\n //ADDME the naive 'add decimals, multiple nums' approach gets you out of the safe range real fast. needs tests\n return { num: lhs.num * rhs.num, decimals: lhs.decimals + rhs.decimals };\n}\n\n/** Multiplies two numbers together\n*/\nexport function multiply(amount1: FinmathInput, amount2: FinmathInput): string {\n const lhs = splitValue(amount1), rhs = splitValue(amount2);\n return joinPrice(__multiply(lhs, rhs));\n}\n\n/** Compares two numbers\n @param amount1 - Left hand value\n @param amount2 - Right hand value\n @returns Returns 0 if amount1 === amount2, -1 if amount1 \\< amount2, 1 if amount1 \\> amount2\n*/\nexport function cmp(amount1: FinmathInput, amount2: FinmathInput) {\n const diff = __add(splitValue(amount1), __multiply(splitValue(amount2), { num: -1, decimals: 0 }));\n return diff.num < 0 ? -1 : diff.num === 0 ? 0 : 1;\n}\n\n/** Returns a percentage of an amount\n @param amount - Original amount\n @param perc - Percentage of the amount to return\n @returns Percentage of the amount\n*/\nexport function getPercentageOfAmount(amount: FinmathInput, perc: FinmathInput) {\n const lhs = splitValue(amount), rhs = splitValue(perc);\n const result = __multiply(lhs, rhs);\n result.decimals += 2;\n return joinPrice(normalize(result));\n}\n\nfunction normalize(amount: SplitNumber) {\n while (amount.decimals && (amount.num % 10) === 0) {\n amount.num /= 10;\n --amount.decimals;\n }\n return amount;\n}\n\n/// format a price amount. extend # of decimals to specified # if not enough\nexport function formatPrice(money: FinmathInput, decimalpoint: string, decimals: number) {\n return toText(splitValue(money), decimalpoint, decimals);\n}\n\n/** Rounds integer to multiple, exposed for testing only\n*/\nexport function __roundIntegerToMultiple(value: number, roundunit: number, mode: RoundMode) {\n switch (mode) {\n case \"none\":\n {\n // no rounding\n } break;\n case \"toward-zero\":\n {\n value = Math.trunc(value / roundunit) * roundunit;\n } break;\n case \"toward-infinity\":\n {\n if (value > 0)\n value = Math.trunc((value + roundunit - 1) / roundunit) * roundunit;\n else\n value = Math.trunc((value - roundunit + 1) / roundunit) * roundunit;\n } break;\n case \"down\":\n {\n if (value > 0)\n value = Math.trunc(value / roundunit) * roundunit;\n else\n value = Math.trunc((value - roundunit + 1) / roundunit) * roundunit;\n } break;\n case \"up\":\n {\n if (value > 0)\n value = Math.trunc((value + roundunit - 1) / roundunit) * roundunit;\n else\n value = Math.trunc(value / roundunit) * roundunit;\n } break;\n case \"half-toward-zero\":\n {\n if (value > 0)\n value = Math.trunc((value + (roundunit - 1) / 2) / roundunit) * roundunit;\n else\n value = Math.trunc((value - (roundunit - 1) / 2) / roundunit) * roundunit;\n } break;\n case \"half-toward-infinity\":\n {\n if (value > 0)\n value = Math.trunc((value + roundunit / 2) / roundunit) * roundunit;\n else\n value = Math.trunc((value - roundunit / 2) / roundunit) * roundunit;\n } break;\n case \"half-down\":\n {\n if (value > 0)\n value = Math.trunc((value + (roundunit - 1) / 2) / roundunit) * roundunit;\n else\n value = Math.trunc((value - roundunit / 2) / roundunit) * roundunit;\n } break;\n case \"half-up\":\n {\n if (value > 0)\n value = Math.trunc((value + roundunit / 2) / roundunit) * roundunit;\n else\n value = Math.trunc((value - (roundunit - 1) / 2) / roundunit) * roundunit;\n } break;\n default:\n {\n throw new Error(`Unknown rounding mode ${mode}`);\n }\n }\n return value;\n}\n\n/** Rounds a value to a multiple of a unit, with a specific rounding mode\n @param value - Value to round\n @param unit - The value will be rounded to a mulitple of this unit (except when rounding mode is 'none')\n @param mode - Rounding mode. Possible values:<br>\n <ul>\n <li>none: No rounding</li>\n <li>toward-zero: Round toward zero</li>\n <li>down: Round toward negative infity</li>\n <li>up: Round toward positive infity</li>\n <li>half-toward-zero: Round nearest multiple, round half of a multiple toward zero</li>\n <li>half-down: Round nearest multiple, round half of a multiple toward negative infinity</li>\n <li>half-up: Round nearest multiple, round half of a multiple toward positive infity</li>\n </ul>\n @returns The rounded value\n*/\nexport function roundToMultiple(value: FinmathInput, unit: FinmathInput, mode: RoundMode) {\n const split_value = splitValue(value);\n const split_unit = splitValue(unit);\n\n const requiredecimals = Math.max(split_value.decimals, split_unit.decimals);\n adjustDecimals(split_value, requiredecimals);\n adjustDecimals(split_unit, requiredecimals);\n\n const result = { num: __roundIntegerToMultiple(split_value.num, split_unit.num, mode), decimals: split_value.decimals };\n return joinPrice(result);\n}\n\n/** Returns the minimum of all the arguments\n @param amount - First value\n @param amounts - Rest of the values\n @returns The lowest value among amount and amounts\n*/\nexport function min(amount: FinmathInput, ...amounts: FinmathInput[]) {\n for (const val of amounts)\n if (cmp(amount, val) > 0)\n amount = val;\n return joinPrice(splitValue(amount));\n}\n\n/** Returns the maximum of all the arguments\n @param amount - First value\n @param amounts - Rest of the values\n @returns The highest value among amount and amounts\n*/\nexport function max(amount: FinmathInput, ...amounts: FinmathInput[]) {\n for (const val of amounts)\n if (cmp(amount, val) < 0)\n amount = val;\n return joinPrice(splitValue(amount));\n}\n\n/** Returns a power of 10\n @param exp - Integer power, must be 0 or bigger\n @returns Requested power of 10\n*/\nfunction getNonNegativePowerOf10(exp: number) {\n let retval = 1, running_exp = 10;\n while (exp) {\n if (exp & 1)\n retval *= running_exp;\n running_exp *= running_exp;\n exp = exp >> 1;\n }\n return retval;\n}\n\n/** Divides two values, with 5 decimals of precision\n @param value - Value To divide\n @param divisor - Divisor\n @returns Divided value, with 5 decimals of precision\n*/\nexport function divide(value: FinmathInput, divisor: FinmathInput) {\n const lhs = splitValue(value), rhs = splitValue(divisor);\n const mul10exp = lhs.decimals - rhs.decimals - 5;\n const mulfactor = mul10exp < 0 ? getNonNegativePowerOf10(-mul10exp) : 1;\n const roundunit = mul10exp > 0 ? getNonNegativePowerOf10(mul10exp) : 1;\n return joinPrice({ num: __roundIntegerToMultiple(mulfactor * lhs.num / rhs.num, roundunit, \"half-toward-infinity\"), decimals: 5 });\n}\n\nexport function moneyDivide(value: FinmathInput, divisor: FinmathInput) { //divide was added in 5.0. remove this old name eventually\n return divide(value, divisor);\n}\n\n/** Test whether two values have a specific relation\n @param lhs - Left hand value\n @param relation - One of '\\<', '\\<=', '==', '!=', '\\>', '\\>=''\n @param rhs - Right hand value\n @returns TRUE if the relation holds\n @example\n console.log(finmath.test(1, '\\<', 2)); // prints 'true'\n*/\nexport function test(lhs: FinmathInput, relation: \"<\" | \"<=\" | \"==\" | \"!=\" | \">\" | \">=\", rhs: FinmathInput) {\n const compareresult = cmp(lhs, rhs);\n switch (relation) {\n case '<': return compareresult < 0;\n case '<=': return compareresult <= 0;\n case '==': return compareresult === 0;\n case '!=': return compareresult !== 0;\n case '>': return compareresult > 0;\n case '>=': return compareresult >= 0;\n }\n throw Error(`Cannot test for unknown relation '${relation}'`);\n}\n","/* A Money type library for safe calculation with money amounts in JS. If you don't\n know why we need this, try to predict what the following code would print:\n var cents=0;for(var i=0;i<100;++i)cents+=0.01;cents-=1;console.log(cents);\n and think twice about whether you want to code anything financial in JS.\n\n We haven't decideded yet what range Money should support. To keep our options open and keep HS compatbility for now\n we will fix ourselves to 5 digits (HS compat) and not allow values bigger than 900_000_000 (2**53 / 100000 'number' compatbiility clamped to a more readable number)\n\n Users should not rely on JS Money keeping this smaller range in the future. Money values supplied from HareScript should be formatted using FormatJSFinmathMoney\n*/\n\nimport * as finmath from \"./finmath\"; //TODO absorb into us as soon as noone externally depends on finmath anymore\n\nexport type MoneyRoundingMode = \"none\" | \"toward-zero\" | \"down\" | \"up\" | \"half-toward-zero\" | \"half-down\" | \"half-up\" | \"toward-infinity\" | \"half-toward-infinity\";\nexport type MoneyTestTypes = \"<\" | \"<=\" | \"==\" | \"!=\" | \">\" | \">=\";\n\n// const moneySymbol = Symbol.for(\"@webhare/std:Money\");\n\ntype MoneyParameter = Money | string;\n\ninterface SplitNumber {\n num: number;\n decimals: number;\n}\n\nexport interface MoneyFormatOptions {\n //thousand separator. defaults to \"\"\n thousandsSeparator?: string;\n //decimal separator. defaults to \".\"\n decimalSeparator?: string;\n //minimum # of decimals. defaults to 2\n minDecimals?: number;\n}\n\nfunction stripUnneededDecimals(num: number, decimals: number) {\n //we have a maximum of 5 digits of external precision\n if (decimals > 5) {\n // math.round rounds toward positive infinity\n const isneg = num < 0;\n if (isneg)\n num = -num;\n\n while (decimals > 6) { //truncate excess digits\n num = Math.floor(num / 10);\n --decimals;\n }\n //round up if 6th decimal >= 5\n num = Math.round(num / 10);\n decimals = 5;\n\n if (isneg)\n num = -num;\n }\n\n //strip unneeded decimals\n while (decimals > 0 && !(num % 10)) {\n num /= 10;\n --decimals;\n }\n\n return { num, decimals };\n}\n\n/** Convert a money of any format to a split number object\n @param money - Either an integer number or string with a number\n @returns Split number object\n*/\nfunction splitValue(money: MoneyParameter): SplitNumber {\n if (typeof money === 'number') {\n if (money !== Math.floor(money))\n throw new Error(\"Non-integer number passed\");\n if (!Number.isSafeInteger(money))\n throw new Error(`The value ${money} is outside the safe value range`);\n return { num: money, decimals: 0 };\n }\n if (typeof money !== 'string')\n throw new Error(\"Number or string expected, got \" + money);\n\n const split = money.match(/^(-)?([0-9]*)(\\.([0-9]{0,5})([0-9]*))?$/);\n if (!split)\n throw new Error(`Illegal money value received: '${money}'`);\n\n const sign = split[1] === '-' ? -1 : 1;\n const decimals = split[3] ? split[4].length : 0;\n // If there are more than 5 decimals, round up (using halfExpand strategy)\n const num = sign * (parseInt(split[2] || \"0\") * Math.pow(10, decimals) + (parseInt((split[4] || '')) || 0) + (split[5]?.[0] >= '5' ? 1 : 0));\n if (!Number.isSafeInteger(num))\n throw new Error(`The value '${money}' is outside the safe value range`);\n\n return stripUnneededDecimals(num, decimals);\n}\n\nfunction toText(amount: SplitNumber, decimalpoint: string, mindecimals: number, thousandpoint: string) {\n if (!Number.isSafeInteger(amount.num))\n throw new Error(\"Result would overflow the safe value range\");\n\n let { num, decimals } = stripUnneededDecimals(amount.num, amount.decimals);\n\n // Strip sign from number, may need to prefix it\n const isnegative = num < 0;\n if (isnegative)\n num = -num;\n\n let astext = String(num);\n\n // Ensure we have enough leading 0's to render the first integer digit\n if (astext.length <= decimals)\n astext = '00000000000000000000'.substring(0, decimals + 1 - astext.length) + astext;\n // make sure we have enough 0's to show mindecimals\n if (decimals < mindecimals) {\n astext += '00000000000000000000'.substring(0, mindecimals - decimals);\n decimals = mindecimals;\n }\n\n let beforepoint = astext.substring(0, astext.length - decimals);\n const afterpoint = astext.substring(astext.length - decimals);\n\n // Add thouands points if neeed\n if (thousandpoint)\n beforepoint = beforepoint.replaceAll(/\\B(?=(\\d{3})+(?!\\d))/g, thousandpoint);\n\n return (isnegative ? \"-\" : \"\") + beforepoint + (afterpoint.length ? decimalpoint + afterpoint : \"\");\n}\n\n/** A decimal based JS money type*/\nexport class Money {\n /** finmath-compatible value */\n readonly value: string;\n [\"__ moneySymbol\"] = true; //Symbol breaks tree shaking, so this is our workaround. Reported as https://github.com/evanw/esbuild/issues/3940\n\n constructor(value: MoneyParameter = \"0\") {\n this.value = Money.parseParameter(value);\n\n const intvalue = parseInt(this.value);\n //We need the number to be in the safe range even after adding 5 decimals\n if (intvalue <= (Number.MIN_SAFE_INTEGER / 100000) || intvalue >= (Number.MAX_SAFE_INTEGER / 100000))\n throw new TypeError(`Money value '${value}' is out of range`);\n }\n\n private static parseParameter(param: MoneyParameter): string {\n if (typeof param === \"string\")\n return toText(splitValue(param), \".\", 0, \"\");\n if (Money.isMoney(param))\n return (param as unknown as { value: string }).value;\n\n throw new TypeError(`Money cannot be constructed out of a value of type ${typeof param}`);\n }\n\n static isMoney(value: unknown): value is Money {\n return Boolean((value as Money)?.[\"__ moneySymbol\"]);\n }\n\n static fromNumber(value: number): Money {\n return new Money(String(value));\n }\n\n /** Adds numbers together\n */\n static add(left: MoneyParameter, ...right: MoneyParameter[]): Money {\n let sum = Money.parseParameter(left);\n for (const item of right)\n sum = finmath.add(sum, Money.parseParameter(item));\n return new Money(sum);\n }\n\n /** Subtracts a number from another number\n */\n static subtract(left: MoneyParameter, right: MoneyParameter): Money {\n return new Money(finmath.subtract(Money.parseParameter(left), Money.parseParameter(right)));\n }\n\n /** Rounds a value to a multiple of a unit, with a specific rounding mode\n @param value - Value to round\n @param unit - The value will be rounded to a mulitple of this unit (except when rounding mode is 'none')\n @param mode - Rounding mode. Possible values:<br>\n <ul>\n <li>none: No rounding</li>\n <li>toward-zero: Round toward zero</li>\n <li>down: Round toward negative infity</li>\n <li>up: Round toward positive infity</li>\n <li>half-toward-zero: Round nearest multiple, round half of a multiple toward zero</li>\n <li>half-down: Round nearest multiple, round half of a multiple toward negative infinity</li>\n <li>half-up: Round nearest multiple, round half of a multiple toward positive infity</li>\n </ul>\n @returns The rounded value\n */\n static roundToMultiple(amount: MoneyParameter, roundto: MoneyParameter, mode: MoneyRoundingMode): Money {\n return new Money(finmath.roundToMultiple(Money.parseParameter(amount), Money.parseParameter(roundto), mode));\n }\n\n /** Compares two numbers\n @param amount1 - Left hand value\n @param amount2 - Right hand value\n @returns Returns 0 if amount1 === amount2, -1 if amount1 \\< amount2, 1 if amount1 \\> amount2\n */\n static cmp(left: MoneyParameter, right: MoneyParameter): -1 | 0 | 1 {\n return finmath.cmp(Money.parseParameter(left), Money.parseParameter(right));\n }\n\n /** Test whether two values have a specific relation\n @param lhs - Left hand value\n @param relation - One of '\\<', '\\<=', '==', '!=', '\\>', '\\>=''\n @param rhs - Right hand value\n @returns TRUE if the relation holds\n @example\n console.log(Money.check(1, '\\<', 2)); // prints 'true'\n */\n static check(left: MoneyParameter, relation: MoneyTestTypes, right: MoneyParameter): boolean {\n return finmath.test(Money.parseParameter(left), relation, Money.parseParameter(right));\n }\n\n /** Multiplies two numbers together\n */\n static multiply(left: MoneyParameter, right: MoneyParameter): Money {\n return new Money(finmath.multiply(Money.parseParameter(left), Money.parseParameter(right)));\n }\n\n /** Returns a percentage of an amount\n @param amount - Original amount\n @param perc - Percentage of the amount to return\n @returns Percentage of the amount\n */\n static getPercentage(amount: MoneyParameter, percentage: MoneyParameter): Money {\n return new Money(finmath.getPercentageOfAmount(Money.parseParameter(amount), Money.parseParameter(percentage)));\n }\n\n /** Divides two values, (currently with up to 5 decimals of precision)\n @param numerator - Value to divide\n @param divisor - Divisor\n @returns Divided value\n */\n static divide(numerator: MoneyParameter, divider: MoneyParameter): Money {\n return new Money(finmath.divide(Money.parseParameter(numerator), Money.parseParameter(divider)));\n }\n /** Returns the minimum of all the arguments\n @param amount - First value\n @param amounts - Rest of the values\n @returns The lowest value among amount and amounts\n */\n static min(amount: MoneyParameter, ...amounts: MoneyParameter[]): Money {\n return new Money(finmath.min(Money.parseParameter(amount), ...(amounts.map(Money.parseParameter))));\n\n }\n\n /** Returns the maximum of all the arguments\n @param amount - First value\n @param amounts - Rest of the values\n @returns The highest value among amount and amounts\n */\n static max(amount: MoneyParameter, ...amounts: MoneyParameter[]): Money {\n return new Money(finmath.max(Money.parseParameter(amount), ...(amounts.map(Money.parseParameter))));\n }\n\n /** format a price amount. extend # of decimals to specified # if not enough */\n format(format?: MoneyFormatOptions): string {\n return toText(splitValue(this.value),\n format?.decimalSeparator ?? \".\",\n format?.minDecimals ?? 2,\n format?.thousandsSeparator ?? \"\");\n }\n\n toJSON(): string {\n return finmath.formatPrice(this.value, \".\", 0);\n }\n\n toString(): string {\n return finmath.formatPrice(this.value, \".\", 0);\n }\n\n toNumber(): number {\n return parseFloat(this.value);\n }\n}\n","import { isDate } from \"./quacks\";\nimport { Money } from \"./money\";\n\n/** Encode string for use in a regexp\n * @param text - Text to encode\n * @returns Encoded for safe use in a RegExp\n*/\nexport function escapeRegExp(text: string) {\n return text.replaceAll(/[/\\-\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'); // $& means the whole matched string\n}\n\n/** Create a regular expression from a string with DOS-like wildcards (? and *)\n * @param mask - Mask with '?' and/or '*' wildcards\n * @returns Regular expression string which can be passed to new RegExp\n*/\nexport function wildcardsToRegExp(mask: string): string {\n mask = escapeRegExp(mask);\n mask = mask.replaceAll(\"\\\\*\", \".*\");\n mask = mask.replaceAll(\"\\\\?\", \".\");\n return mask;\n}\n\nfunction isHTMLUnrepresentableChar(curch: number) {\n return (curch < 32 && curch !== 9 && curch !== 10 && curch !== 13)\n || (curch >= 128 && curch <= 159);\n}\n\nfunction encodeEntities(str: string, html: boolean) {\n let s = \"\";\n for (const char of str) {\n const curch = char.codePointAt(0);\n if (curch === undefined || isHTMLUnrepresentableChar(curch))\n continue;\n if (curch >= 32 && curch < 128 && curch !== 38 && curch !== 60 && curch !== 62 && (html || curch !== 34 && curch !== 39)) {\n s += String.fromCodePoint(curch);\n continue;\n }\n\n switch (curch) {\n case 10:\n {\n if (html) {\n s += \"<br>\";\n continue;\n }\n break;\n }\n case 13:\n {\n if (html)\n continue;\n break;\n }\n case 34:\n {\n s += \""\";\n continue;\n }\n case 38:\n {\n s += \"&\";\n continue;\n }\n case 39:\n {\n s += \"'\";\n continue;\n }\n case 60:\n {\n s += \"<\";\n continue;\n }\n case 62:\n {\n s += \">\";\n continue;\n }\n }\n\n s += \"&#\" + curch + \";\";\n }\n return s;\n}\n\nfunction decodeEntities(str: string, html: boolean) {\n if (html)\n str = str.replace(/<br *\\/?>/g, \"\\n\");\n\n str = str.replace(/&#(\\d+);/g, (_, dec) => String.fromCharCode(dec))\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(/&/g, \"&\");\n\n return str;\n}\n\nexport type StringEncodings = \"base64url\" | \"attribute\" | \"html\";\n\nexport function encodeString(str: string, encoding: StringEncodings): string {\n if (encoding === \"base64url\")\n return btoa(str).replaceAll(\"=\", \"\").replaceAll(\"+\", \"-\").replaceAll(\"/\", \"_\");\n if (encoding === \"attribute\")\n return encodeEntities(str, false);\n if (encoding === \"html\")\n return encodeEntities(str, true);\n\n throw new Error(`Invalid encoding '${encoding}'`);\n}\n\nexport function decodeString(str: string, encoding: StringEncodings): string {\n if (encoding === \"base64url\")\n return atob(str.replaceAll(\"-\", \"+\").replaceAll(\"_\", \"/\"));\n if (encoding === \"attribute\")\n return decodeEntities(str, false);\n if (encoding === \"html\")\n return decodeEntities(str, true);\n\n throw new Error(`Invalid encoding '${encoding}'`);\n}\n\ntype JSONReplacerArgument = ((this: unknown, key: string, value: unknown) => unknown) | undefined;\n\nexport interface StringifyOptions {\n replacer?: JSONReplacerArgument;\n space?: string | number;\n stable?: boolean;\n ///Encode with types (preserve Money, Date, BigInt). Needs std.parseTyped\n typed?: boolean;\n ///What to target: string (like JSON.stringify), script (escapes '/') or attribute (escapes '/' and applies attribute encoding)\n target?: \"string\" | \"script\" | \"attribute\";\n}\n\n/** Improved JSON encoder\n * @param arg - Object to encode\n * @param options - Encoding options\n*/\nexport function stringify(arg: unknown, options?: StringifyOptions) {\n const usereplacer: JSONReplacerArgument = options?.stable || options?.typed ? (function (this: unknown, key: string, value: unknown) {\n if (options.typed) {\n const origvalue = (this as Record<string, unknown>)[key]; //We can't use 'value' as .toJSON() will already have been invoked\n if (Money.isMoney(origvalue))\n value = { \"$stdType\": \"Money\", money: origvalue.value };\n else if (isDate(origvalue))\n value = { \"$stdType\": \"Date\", date: origvalue.toISOString() };\n else if (typeof origvalue === \"object\" && (origvalue as { \"$stdType\": string })?.[\"$stdType\"])\n throw new Error(`Cannot encode objects with already embedded '$stdType's`);\n else if (typeof origvalue === \"bigint\")\n value = { \"$stdType\": \"BigInt\", bigint: origvalue.toString() };\n }\n if (options.stable && value && typeof value === \"object\" && !Array.isArray(value))\n value = Object.fromEntries(Object.entries(value).sort((lhs, rhs) => lhs < rhs ? -1 : lhs === rhs ? 0 : 1));\n if (options.replacer)\n value = options.replacer.call(this, key, value);\n return value;\n }) : options?.replacer ?? undefined;\n\n let result = JSON.stringify(arg, usereplacer, options?.space);\n if (options?.target && [\"script\", \"attribute\"].includes(options.target)) {\n result = result.replaceAll(\"/\", \"\\\\/\");\n if (options.target === \"attribute\")\n result = encodeEntities(result, false);\n }\n return result;\n}\n\n/** Decode JSON with types (Generated using stringify with typed:true ) */\nexport function parseTyped(input: string) {\n return JSON.parse(input, (key, value) => {\n switch (value?.[\"$stdType\"]) {\n case \"Money\":\n return new Money(value.money);\n case \"Date\":\n return new Date(value.date);\n case \"BigInt\":\n return BigInt(value.bigint as string);\n case undefined:\n return value;\n default:\n throw new Error(`Unrecognized type '${value[\"$stdType\"]}'`);\n }\n });\n}\n\n/** Generate a slug from a (suggested) (file)name\n * @param text - Text to convert\n * @param separator - Separator to use between words (defaults to '-')\n * @param keep - Set of characters to keep in addition to a-z0-9\n * @returns Slugified text or null if we couldn't generate anything reeadable\n */\nexport function slugify(text: string, { separator = \"-\", keep = \"\" }: {\n separator?: string;\n keep?: string;\n} = {}): string | null {\n //This function mixes HS getSafeName with a few more modern approaches\n const keepclass = `[^a-z0-9${escapeRegExp(keep)}]`;\n text = text\n .normalize('NFD') // split an accented letter in the base letter and the acent\n // eslint-disable-next-line no-control-regex\n .replaceAll(/[\\u0000-\\u001F]/g, '')\n .replaceAll(/[\\u0300-\\u036f]/g, '') // remove all previously split accents\n .replaceAll(/ß/g, 'ss') // german ss\n .toLowerCase()\n .replace(new RegExp(`^${keepclass}+`), \"\") //replace bad characters at the start\n .replace(new RegExp(`${keepclass}+$`), \"\") //.. and end\n .replaceAll(new RegExp(`${keepclass}+`, \"g\"), separator); // replace all non alphanumeric/space with a single dash\n\n return text || null; //we return 'null' on purpose so callers realize we won't necessarily give them a string!\n}\n\n/** Check if an email address is valid in modern times (an emailcheck much closer to what a browser would do, with additional sanity checks. No attempt to allow all legacy styles supported by the RFCs but 99.9%+ sure to be an error if seen submitted in a form\n @returns True if the email address appears to be a well-formed email address to a non-greybeard\n*/\nexport function isValidEmail(email: string): boolean {\n if (email.length > 254) //TODO count bytes instead of characters\n return false;\n\n return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*(?:\\.[a-zA-Z0-9-]{2,})$/.test(email);\n}\n\n/** Joins a path to a URL, eliminating any double slash (similar to NodeJS path.join)\n * @param baseurl - URL to join to\n * @param path - Path to join. May not contain '.' or '..' segments in the path\n * @returns Joined URL, with a single slash between both parts\n*/\nexport function joinURL(baseurl: string, path: string) {\n const pathtoks = path.match(/([^?#]*)(.*)/)!; //this will always return something\n if (pathtoks[1].match(/(\\/\\/)|:/))\n throw new Error(`Invalid path to merge with: ${path}`);\n //look for any . or .. path segments\n if ((\"/\" + path + \"/\").match(/\\/\\.\\.?\\//))\n throw new Error(`Invalid path to merge with: ${path}`);\n\n if (baseurl.endsWith(\"/\"))\n baseurl = baseurl.substring(0, baseurl.length - 1);\n return baseurl + (path.startsWith(\"/\") ? path : \"/\" + path);\n}\n\nfunction unpackUrl(inUrl: string) {\n const retval = {\n inUrl,\n scheme: \"\",\n schemeSpecificPart: \"\",\n user: \"\",\n password: \"\",\n host: \"\",\n port: 0,\n urlPathSlash: false,\n urlPath: \"\",\n secure: false,\n specifiedPort: false,\n isDefaultPort: false,\n origin: \"\",\n };\n let missingSlash = false;\n const firstColon = inUrl.indexOf(\":\");\n if (firstColon < 0) {\n retval.scheme = inUrl;\n return retval;\n }\n\n retval.scheme = decodeURIComponent(inUrl.substring(0, firstColon)).toLowerCase();\n inUrl = inUrl.substring(firstColon + 1);\n retval.schemeSpecificPart = inUrl;\n\n if (!retval.schemeSpecificPart.startsWith(\"//\")) //not an internet host format\n return retval;\n\n inUrl = inUrl.substring(2);\n\n //Find the first slash, it terminates the user..port part\n let firstSlash = inUrl.indexOf(\"/\");\n if (firstSlash < 0)\n firstSlash = inUrl.length;\n\n const firstAt = inUrl.indexOf(\"@\");\n if (firstAt >= 0 && firstAt < firstSlash) {\n //Username and possible password are present\n const pwdColon = inUrl.indexOf(\":\");\n if (pwdColon >= 0 && pwdColon < firstAt) {\n retval.user = decodeURIComponent(inUrl.substring(0, pwdColon));\n retval.password = decodeURIComponent(inUrl.substring(pwdColon + 1, firstAt));\n } else {\n retval.user = decodeURIComponent(inUrl.substring(0, firstAt));\n }\n inUrl = inUrl.substring(firstAt + 1);\n firstSlash = inUrl.indexOf(\"/\");\n if (firstSlash < 0)\n firstSlash = inUrl.length;\n }\n\n //Common mistake, at least in http* urls, specifying a ? right after the URL (ADDME perhaps this shoud apply for all URLs? check rfc)\n if (retval.scheme === \"http\" || retval.scheme === \"https\") {\n const firstQuestionMark = inUrl.indexOf(\"?\");\n if (firstQuestionMark >= 0 && firstQuestionMark < firstSlash) {\n firstSlash = firstQuestionMark;\n missingSlash = true;\n }\n }\n\n let closingBracket = 0;\n if (inUrl.startsWith(\"[\")) //RFC3986 IP-literal\n closingBracket = inUrl.indexOf(\"]\");\n\n if (closingBracket > 0) { //Indeed an IP-literal\n retval.host = decodeURIComponent(inUrl.substring(1, closingBracket));\n if (inUrl[closingBracket + 1] === ':') //port follows\n retval.port = parseInt(decodeURIComponent(inUrl.substring(closingBracket + 2, firstSlash - 1)), 0) || 0;\n else\n retval.port = getSchemeDefaultPort(retval.scheme);\n } else {\n const portColon = inUrl.indexOf(\":\");\n if (portColon >= 0 && portColon < firstSlash) {\n retval.host = decodeURIComponent(inUrl.substring(0, portColon));\n retval.port = parseInt(decodeURIComponent(inUrl.substring(portColon + 1, firstSlash)), 0) || 0;\n retval.specifiedPort = true;\n retval.isDefaultPort = retval.port === getSchemeDefaultPort(retval.scheme);\n } else {\n retval.host = decodeURIComponent(inUrl.substring(0, firstSlash));\n retval.port = getSchemeDefaultPort(retval.scheme);\n retval.isDefaultPort = true;\n }\n }\n\n retval.urlPathSlash = !(missingSlash || firstSlash === inUrl.length);\n retval.urlPath = inUrl.substring(firstSlash + (missingSlash ? 0 : 1));\n retval.secure = [\"aas\", \"ftps\", \"https\", \"imaps\", \"ldaps\", \"shttp\", \"sips\", \"ssh\", \"sftp\"].includes(retval.scheme);\n if (retval.host)\n retval.origin = retval.scheme + \"://\" + retval.host + (retval.isDefaultPort ? \"\" : \":\" + retval.port);\n return retval;\n}\n\nfunction getSchemeDefaultPort(scheme: string) {\n switch (scheme) {//port numbers from RFC1738\n case \"ftp\": return 21;\n case \"http\": return 80;\n case \"ws\": return 80;\n case \"gopher\": return 70;\n case \"nntp\": return 119;\n case \"telnet\": return 23;\n case \"wais\": return 210;\n case \"prospero\": return 1525;\n //well known protocols\n case \"https\": return 443;\n case \"wss\": return 443;\n case \"ldap\": return 389;\n case \"ldaps\": return 636;\n case \"smtp\": return 25;\n default: return 0;\n }\n}\n\n\n/** Test whether an URL is a valid url. This function verifies that an URL looks\n * like an URL. If the scheme is recognized, more stringent checks are performed\n * @returns True if the url appears to be a well-formed url\n */\nexport function isValidUrl(url: string): boolean {\n // test: no control characters or spaces (0x00 - 0x20)\n // test: starts with 'scheme' ':' anychar +\n // test: scheme only has letters, numbers, '-', '.' or '+' (and is not empty)\n // Unpack url\n // test: for http/https schema, hostname is not empty and port is in range 1-65535\n\n // eslint-disable-next-line no-control-regex\n if (!url.match(/^[-.+a-zA-Z0-9]+:[^\\x00-\\x20]+$/))\n return false;\n const unpacked = unpackUrl(url);\n if (unpacked.scheme !== \"http\" && unpacked.scheme !== \"https\")\n return true;\n if (unpacked.port < 1 || unpacked.port > 65535 || !unpacked.host)\n return false;\n return true;\n}\n\n/** Uppercases a string using the C-locale (so only the ASCII characters a-z are uppercased)\n * @param str - String to uppercase\n * @returns Uppercased string\n */\nexport function toCLocaleUppercase(str: string) {\n return str.replaceAll(/[a-z]+/g, part => part.toUpperCase());\n}\n\n/** Lowercases a string using the C-locale (so only the ASCII characters A-Z are lowercased)\n * @param str - String to lowercase\n * @returns Lowercased string\n */\nexport function toCLocaleLowercase(str: string) {\n return str.replaceAll(/[A-Z]+/g, part => part.toLowerCase());\n}\n\n/** Calculate the levenshtein distance between two strings */\nexport function levenshteinDistance(a: string, b: string): number {\n /* calculateLevenshteinDistance is adopted from https://github.com/gustf/js-levenshtein/blob/master/index.js, licensed MIT © Gustaf Andersson\n Picked over fastest-levenshtein because a permanent 256KB memory area for a bit more speed doesn't seem worth it\n */\n function _min(d0: number, d1: number, d2: number, bx: number, ay: number) {\n return d0 < d1 || d2 < d1\n ? d0 > d2\n ? d2 + 1\n : d0 + 1\n : bx === ay\n ? d1\n : d1 + 1;\n }\n\n if (a === b) {\n return 0;\n }\n\n if (a.length > b.length) {\n const tmp = a;\n a = b;\n b = tmp;\n }\n\n let la = a.length;\n let lb = b.length;\n\n while (la > 0 && (a.charCodeAt(la - 1) === b.charCodeAt(lb - 1))) {\n la--;\n lb--;\n }\n\n let offset = 0;\n\n while (offset < la && (a.charCodeAt(offset) === b.charCodeAt(offset))) {\n offset++;\n }\n\n la -= offset;\n lb -= offset;\n\n if (la === 0 || lb < 3) {\n return lb;\n }\n\n let x = 0;\n let y, d0, d1, d2, d3, dd = 0, dy, ay, bx0, bx1, bx2, bx3;\n\n const vector: number[] = [];\n\n for (y = 0; y < la; y++) {\n vector.push(y + 1);\n vector.push(a.charCodeAt(offset + y));\n }\n\n const len = vector.length - 1;\n\n for (; x < lb - 3;) {\n bx0 = b.charCodeAt(offset + (d0 = x));\n bx1 = b.charCodeAt(offset + (d1 = x + 1));\n bx2 = b.charCodeAt(offset + (d2 = x + 2));\n bx3 = b.charCodeAt(offset + (d3 = x + 3));\n dd = (x += 4);\n for (y = 0; y < len; y += 2) {\n dy = vector[y];\n ay = vector[y + 1];\n d0 = _min(dy, d0, d1, bx0, ay);\n d1 = _min(d0, d1, d2, bx1, ay);\n d2 = _min(d1, d2, d3, bx2, ay);\n dd = _min(d2, d3, dd, bx3, ay);\n vector[y] = dd;\n d3 = d2;\n d2 = d1;\n d1 = d0;\n d0 = dy;\n }\n }\n\n for (; x < lb;) {\n bx0 = b.charCodeAt(offset + (d0 = x));\n dd = ++x;\n for (y = 0; y < len; y += 2) {\n dy = vector[y];\n vector[y] = dd = _min(dy, d0, dd, bx0, vector[y + 1]);\n d0 = dy;\n }\n }\n\n return dd;\n}\n","/** Generate a configurable random id (the default settings, base64url and 16 bytes, match HareScript's GenerateUFS128BitId)\n * @param encoding - Encoding to use, base64url, hex or uuidv4. Default is base64url\n * @param bytes - Number of bytes to generate. Default is 16\n * @returns An encoded ID. With the default settings it will be a url (and filename) safe string of 22 characters in length\n */\nexport function generateRandomId(encoding: \"base64url\" | \"hex\" | \"uuidv4\" = \"base64url\", bytes: number = 16): string {\n if (encoding === \"uuidv4\") {\n if (bytes !== 16)\n throw new Error(\"UUIDv4 encoding only supports 16 bytes\");\n\n if (crypto.randomUUID) //NOTE: not available in non-secure contexts so the fallback can never go away\n return crypto.randomUUID();\n }\n\n const u8array = new Uint8Array(bytes);\n crypto.getRandomValues(u8array);\n\n if (encoding === \"uuidv4\") {\n u8array[6] = (u8array[6] & 0x0f) | 0x40;\n u8array[8] = (u8array[8] & 0x3f) | 0x80;\n return [...u8array.values()].map(x => x.toString(16).padStart(2, \"0\")).join(\"\").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, \"$1-$2-$3-$4-$5\");\n }\n\n if (encoding === \"base64url\")\n return btoa(String.fromCharCode.apply(null, u8array as unknown as number[])).replaceAll(\"=\", \"\").replaceAll(\"+\", \"-\").replaceAll(\"/\", \"_\");\n\n if (encoding === \"hex\")\n return [...u8array.values()].map(x => x.toString(16).padStart(2, \"0\")).join(\"\");\n\n throw new Error(`Invalid encoding '${encoding}'`);\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any -- Cannot specify this without using any */\n\nexport interface EmplaceHandler<ValueType> {\n insert?: () => ValueType;\n update?: (current: ValueType) => ValueType;\n}\n\n//emplace is based on https://github.com/tc39/proposal-upsert (a Map.prototype.emplace)\n/** Place a value into a Map\n * @param map - The map to place the value into\n * @param key - The key to add/replace\n * @param handler - Callbacks for inserting or updating the value\n * @returns The value that was placed into the map.\n * @throws If the key is not found and no insert handler is provided\n */\nexport function emplace<T extends Map<any, any> | WeakMap<any, any>>(\n map: T,\n key: T extends Map<infer K, any> ? K : T extends WeakMap<infer K, any> ? K : never,\n handler?: T extends Map<any, infer V> ? EmplaceHandler<V> : T extends WeakMap<any, infer V> ? EmplaceHandler<V> : never):\n T extends Map<any, infer V> ? V : T extends WeakMap<any, infer V> ? V : never {\n let current = map.get(key);\n if (current !== undefined) {\n if (handler?.update) {\n current = handler.update(current);\n map.set(key, current);\n }\n return current;\n }\n\n if (!handler?.insert)\n throw new Error(\"Key not found and no insert handler provided\");\n\n const setvalue = handler.insert();\n map.set(key, setvalue);\n return setvalue;\n}\n\n// the `| keyof X` is needed to be able to use a `keyof X` type as key parameter in DistributedPick or DistributedOmit in generics\nexport type DistributedKeys<X extends object> = (X extends object ? keyof X : never) | keyof X;\n\n/** Applies Pick to all types in a union. Allows all keys that are present in any object in the union. Warning: You might not be\n able to use all keys of the union if TypeScript has narrowed the union to a specific type. Eg:\n```typescript\ntype A = { x: number; t: \"a\"; a: number } | { x: number; t: \"b\"; b: number };\nconst a: A = { t: \"a\", a: 1 };\nconst b = pick(a, [\"t\", \"a\", \"b\"]); // No overload matches this call. <snip> Type '\"b\"' is not assignable to type '\"a\" | \"t\" | \"d\"'.\n```\n @typeParam T - Type of the supplied object\n @typeParam K - Type of the property keys to return\n @returns Type with only the specified keys (distributed over the union if present)\n*/\nexport type DistributedPick<X extends object, Y extends DistributedKeys<X>> = X extends object ? Pick<X, keyof X & Y> : never;\n\n/** Applies Omit to all types in a union. Allows all keys that are not present in any object in the union. Warning: You might not be\n able to use all keys of the union if TypeScript has narrowed the union to a specific type. Eg:\n```typescript\ntype A = { x: number; t: \"a\"; a: number } | { x: number; t: \"b\"; b: number };\nconst a: A = { t: \"a\", a: 1 };\nconst b = omit(a, [\"b\"]); // No overload matches this call. <snip> Type '\"b\"' is not assignable to type '\"a\" | \"t\" | \"d\"'.\n```\n @typeParam T - Type of the supplied object\n @typeParam K - Type of the property keys to leave out\n @returns Type with only the specified keys left out (distributed over the union if present)\n*/\nexport type DistributedOmit<X extends object, Y extends DistributedKeys<X>> = X extends object ? Omit<X, keyof X & Y> : never;\n\n/** Returns an object with a selection of properties\n @typeParam T - Type of the supplied object\n @typeParam K - Type of the property keys to return\n @param obj - Object to pick properties out of\n @param keys - Names of the properties to pick\n @returns Resulting object\n*/\nexport function pick<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(obj: T, keys: readonly K[]): DistributedPick<T, K>;\n\n/** Returns an array with a selection of properties\n @typeParam T - Type of the supplied array\n @typeParam K - Type of the property keys to return\n @param obj - Array to pick properties out of\n @param keys - Names of the properties to pick\n @returns Resulting array\n*/\nexport function pick<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(arr: T[], keys: readonly K[]): Array<DistributedPick<T, K>>;\n\nexport function pick<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(value: T | T[], keys: readonly K[]): DistributedPick<T, K> | Array<DistributedPick<T, K>> {\n if (Array.isArray(value))\n return value.map((elt: T) => pick(elt, keys));\n const ret = {} as T;\n keys.forEach((key: K) => {\n if (key in value)\n ret[key] = value[key];\n });\n return ret as object as DistributedPick<T, K>;\n}\n\n/** Returns an object with a selection of properties left out\n @typeParam T - Type of the supplied object\n @typeParam K - Type of the property keys to leave out\n @param obj - Object to leave properties out of\n @param keys - Names of the properties to remove\n @returns Resulting object\n*/\nexport function omit<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(obj: T, keys: readonly K[]): DistributedOmit<T, K>;\n\n/** Returns an array with a selection of properties left out\n @typeParam T - Type of the supplied array\n @typeParam K - Type of the property keys to leave out\n @param obj - Array to leave properties out of\n @param keys - Names of the properties to leave out\n @returns Resulting array\n*/\nexport function omit<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(arr: T[], keys: readonly K[]): Array<DistributedOmit<T, K>>;\n\nexport function omit<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(value: T | T[], keys: readonly K[]): DistributedOmit<T, K> | Array<DistributedOmit<T, K>> {\n if (Array.isArray(value))\n return value.map((elt: T) => omit(elt, keys));\n const ret = {} as T;\n for (const [key, val] of Object.entries(value)) {\n if (!keys.includes(key as K))\n ret[key as K] = val;\n }\n return ret as object as DistributedOmit<T, K>;\n}\n\n/** Shuffle an array in-place\n * @param array - Array to shuffle\n * @returns The shuffled array\n*/\nexport function shuffle<T>(array: T[]): T[] {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n}\n\n/** Returns (and TypeScript-asserts) that the specified function is truthy. Handy for adjusting the type of an array when\n * filtering out falsy values\n * @example\n * const myarray: Array<number | null> = [0, null];\n * const filtered: number[] = myarray.filter(isTruthy);\n **/\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isTruthy<T>(a: T): a is (T & {}) {\n return Boolean(a);\n}\n\n//TODO obsolete once all are WH5.5+\nexport function mapGroupBy<Item, Key>(items: Iterable<Item>, callbackfn: (item: Item, idx: number) => Key): Map<Key, Item[]> {\n return Map.groupBy(items, callbackfn);\n}\n\n//TODO obsolete once all are WH5.5+\nexport function objectGroupBy<Item, Key extends string | number | symbol>(items: Iterable<Item>, callbackfn: (item: Item, idx: number) => Key): Partial<Record<Key, Item[]>> {\n return Object.groupBy(items, callbackfn);\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/std\" {\n}\n\n// Adding APIs may also require an update to https://www.webhare.dev/manuals/typescript/harescript-conversion-guide/\nexport { sleep, createDeferred, wrapInTimeout, serialize, wrapSerialized, type DeferredPromise, type SerializeOptions } from \"./promises\";\nexport { nameToCamelCase, nameToSnakeCase, toSnakeCase, toCamelCase, type ToSnakeCase, type ToCamelCase } from \"./types\";\nexport { encodeString, decodeString, escapeRegExp, wildcardsToRegExp, stringify, parseTyped, slugify, isValidEmail, isValidUrl, joinURL, type StringEncodings, toCLocaleLowercase, toCLocaleUppercase, levenshteinDistance } from \"./strings\";\nexport { generateRandomId } from \"./platformbased\";\nexport { shuffle, emplace, pick, omit, isTruthy, mapGroupBy, objectGroupBy, type EmplaceHandler, type DistributedKeys, type DistributedOmit, type DistributedPick } from \"./collections\";\nexport { Money, type MoneyRoundingMode, type MoneyFormatOptions } from \"./money\";\nexport { addDuration, parseDuration, convertWaitPeriodToDate, isValidDate, isValidTime, type Duration, type WaitPeriod } from \"./datetime\";\nexport { isDate, isBlob, isFile, isError, isPromise } from \"./quacks\";\nexport { type AddressValue } from \"./address\";\n\n/** Throw an error with the specified message. This function allows you to throw inside expressions\n * @param err - The error message\n * @returns This function never returns\n * @throws An error with the specified message\n */\nexport function throwError(err: string): never {\n //TODO remove ourselves from the stack ?\n throw new Error(err);\n}\n","import { debugFlags } from \"./envbackend\";\nimport { generateRandomId } from \"@webhare/std\";\n\nlet hookedfetch = false;\n\nfunction sanitizeBody(body: unknown) {\n if (body instanceof ArrayBuffer) {\n const view = new Uint8Array(body.slice(0, 5000)); //show the bytes but filter unprintable as '.'\n return Array.from(view).map(v => v >= 32 && v < 127 ? String.fromCharCode(v) : \".\").join(\"\");\n }\n if (typeof body !== 'string') {\n return `[${typeof body}]`;\n }\n body = body.substring(0, 5000).replaceAll(\"\\r\", \" \").replaceAll(\"\\n\", \" \");\n return body;\n}\n\nfunction getResponseSummary(response: Response) {\n const toks = [];\n if (response.headers.get(\"Content-Type\"))\n toks.push(response.headers.get(\"Content-Type\"));\n if (response.headers.get(\"Content-Length\"))\n toks.push(response.headers.get(\"Content-Length\") + \" bytes\");\n if (response.headers.get(\"Transfer-Encoding\"))\n toks.push(response.headers.get(\"Transfer-Encoding\"));\n if (response.headers.get(\"Content-Encoding\"))\n toks.push(response.headers.get(\"Content-Encoding\"));\n\n return toks.length ? `(${toks.join(\", \")})` : \"\";\n}\n\nfunction headersToString(headers: Headers) {\n return JSON.stringify(Object.fromEntries(headers.entries()));\n}\n\nasync function debuggableFetch(originalfetch: typeof fetch, input: RequestInfo | URL, init?: RequestInit) {\n if (!debugFlags.wrq)\n return originalfetch(input, init);\n\n const method = (init?.method || (input as Request)?.method || \"GET\").padEnd(7);\n const url = input instanceof URL ? input.toString() : typeof input === \"string\" ? input : input.url;\n const headers = new Headers(typeof input === \"object\" && !(input instanceof URL) ? input.headers : init?.headers);\n let body = typeof input === \"object\" && !(input instanceof URL) ? input.body : init?.body;\n const debugrequestid = generateRandomId();\n\n console.log(`[wrq] ${debugrequestid} ${method} ${url}`);\n if (headers)\n console.log(`[wrq] ${debugrequestid} headers ${headersToString(headers)}`);\n if (body) {\n if (body instanceof ReadableStream) {\n //convert the ReadableStream to ArrayBuffer so we can print AND send it (TODO ideally 'tee' the stream and just grab the first 5K bytes)\n const reader = body.getReader();\n const chunks = [];\n for (; ;) {\n const { done, value } = await reader.read();\n if (done)\n break;\n chunks.push(value);\n }\n body = await new Blob(chunks).arrayBuffer();\n init = { ...init, body };\n }\n console.log(`[wrq] ${debugrequestid} body ${sanitizeBody(body)}`);\n }\n\n const fetchresult = await originalfetch(input, init); //TODO log responses as well (if safe/applicable, eg not binary or Very Long... and we probably should wait for the first json()/text()/body() call? but at least log the status and time!)\n console.log(`[wrq] ${debugrequestid} result ${fetchresult.status} ${fetchresult.statusText} ${getResponseSummary(fetchresult)}`);\n console.log(`[wrq] ${debugrequestid} headers ${headersToString(fetchresult.headers)}`);\n\n const ct = fetchresult.headers.get(\"Content-Type\");\n if (ct && [\"text/html\", \"text/plain\", \"application/json\"].includes(ct?.split(';')[0])) {\n const responsebody = await fetchresult.clone().text();\n console.log(`[wrq] ${debugrequestid} body ${sanitizeBody(responsebody)}`);\n }\n\n return fetchresult;\n}\n\nexport function hookFetch() {\n if (hookedfetch)\n return;\n\n globalThis.fetch = debuggableFetch.bind(null, globalThis.fetch);\n hookedfetch = true;\n}\n","type FormValueList = Array<{ name: string; value: string }>;\n\n/** A navigation instruction encapsulates the next step that a client has to take in eg. a login, payment or wizard flow.\n * Use navigateTo to execute a navigation in a browser\n*/\n\nexport type NavigateInstruction =\n {\n type: \"redirect\";\n url: string;\n } | {\n type: \"form\";\n form: {\n action: string;\n vars: FormValueList;\n method?: \"POST\";\n };\n } | {\n type: \"reload\";\n } | {\n type: \"postmessage\";\n message: unknown;\n target?: \"parent\" | \"opener\";\n } | {\n type: \"close\";\n };\n\nfunction submitForm(action: string, values: FormValueList, method = \"POST\") {\n const form = document.createElement(\"form\");\n form.method = method;\n form.action = action;\n form.append(...values.map(item => {\n const input = document.createElement(\"input\");\n input.type = \"hidden\";\n input.name = item.name;\n input.value = item.value;\n return input;\n }));\n document.body.appendChild(form);\n form.submit();\n}\n\n/** Navigate to a specific URL (may be hookable by other scripts)\n* @param navigation - Target URL or NavigateInstruction\n*/\nexport function navigateTo(navigation: string | NavigateInstruction) {\n if (typeof window === \"undefined\")\n throw new Error(`navigateTo() is not available in this environment`);\n\n if (typeof navigation === \"string\")\n navigation = { type: \"redirect\", url: navigation };\n\n switch (navigation.type) {\n case \"redirect\":\n {\n location.href = navigation.url;\n } break;\n\n case \"form\":\n {\n submitForm(navigation.form.action, navigation.form.vars, navigation.form.method);\n } break;\n\n case \"reload\":\n {\n window.location.reload();\n } break;\n\n case \"postmessage\":\n {\n if (!navigation.target || navigation.target === \"parent\")\n window.parent.postMessage(navigation.message, \"*\");\n else if (navigation.target === \"opener\") {\n window.opener.postMessage(navigation.message, \"*\");\n window.close();\n } else\n throw Error(\"Unknown postmessage target '\" + navigation.target + \"' received\");\n } break;\n\n case \"close\":\n {\n window.close();\n } break;\n\n default:\n throw new Error(`Unknown navigation type '${(navigation as { type: string }).type}'`);\n }\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/env\" {\n}\n\nimport { debugFlags, registerDebugConfigChangedCallback, dtapStage, isLive, backendBase } from \"./envbackend\";\nimport { hookFetch } from \"./fetchdebug\";\nimport { DTAPStage } from \"./concepts\";\n\nexport { type NavigateInstruction, navigateTo } from \"./navigation\";\nexport { DTAPStage, dtapStage, debugFlags, isLive, backendBase };\n\n//export deprecated variants\nexport { dtapstage, islive } from \"./envbackend\";\n\n// Hook fetch if requested\nif (globalThis[\"fetch\"]) {\n if (debugFlags.wrq)\n hookFetch();\n\n registerDebugConfigChangedCallback(() => {\n if (debugFlags.wrq)\n hookFetch();\n });\n}\n\n/** @deprecated For WH5.4 and up use 'debugFlags' */\nexport const flags = debugFlags;\n","import { FormControlElement } from \"@webhare/dompack/dompack\";\n\nexport const CustomEvent = globalThis.CustomEvent;\n/** Wrap an event to ensure it's target is a HTMLElement\n * @typeParam EventType - The expected event type\n * @typeParam CurrentTargetType - The type of the elemnt you're binding the event to. Optional, defaults to HTMLElement\n*/\nexport type DocEvent<EventType extends Event, CurrentTargetType extends HTMLElement = HTMLElement> = EventType & {\n target: HTMLElement;\n currentTarget: CurrentTargetType;\n};\n\nexport interface AddDocEventListenerOptions extends AddEventListenerOptions {\n /** Add to listenerset to allow easy deregistration */\n listenerSet?: EventListenerSet;\n}\n\nexport type DomEventOptions =\n {\n bubbles?: boolean;\n cancelable?: boolean;\n relatedTarget?: EventTarget;\n detail?: object;\n };\n\nexport function dispatchDomEvent(element: EventTarget, eventtype: string, options?: DomEventOptions) {\n //see here https://developer.mozilla.org/en-US/docs/Web/Events whether an event is bubbles/cancelabel\n options = {\n bubbles: [\n \"input\", \"change\", \"click\", \"contextmenu\", \"dblclick\",\n \"reset\", \"submit\"\n ].includes(eventtype),\n cancelable: [\n \"animationstart\", \"animationcancel\", \"animationend\", \"animationiteration\",\n \"beforeunload\",\n \"click\", \"contextmenu\", \"dblclick\",\n \"reset\", \"submit\",\n \"transitionstart\", \"transitioncancel\", \"transitionend\", \"transitionrun\"\n ].includes(eventtype),\n ...options\n };\n\n if (!element || !(element as Node).ownerDocument)\n return true; //the element has left the dom... so there's no more bubbling. just drop it\n\n //FIXME the load/scroll is buggy and we should be probably be using new Event (but an earlier attempt at that triggered quite a few test failures)\n const createtype = /*[\"load\",\"scroll\"].includes(eventtype) === \"load\" ? \"UIEvents\" :*/[\"focus\", \"blur\", \"focusin\", \"focusout\"].includes(eventtype) ? \"FocusEvent\" : eventtype === \"click\" ? \"MouseEvents\" : \"HTMLEvents\";\n //we verified its non-null ness above but TS doesn't really understand that\n const evt = (element as Node).ownerDocument!.createEvent(createtype);\n evt.initEvent(eventtype, options.bubbles, options.cancelable);\n if (options.detail)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we should just rewrite to new Event\n (evt as any).detail = options.detail;\n if (options.relatedTarget) //its a readonly prop, so redefine it\n Object.defineProperty(evt, 'relatedTarget', { value: options.relatedTarget, writable: false });\n\n //TODO: Should we keep this code?\n // @ts-ignore IScroll is a custom Window property set by IScroll\n if (eventtype === 'click' && window.IScroll)\n // @ts-ignore _constructed is a custom Event property used by IScroll\n evt._constructed = true; //ensure IScroll doesn't blindly cancel our synthetic clicks\n\n return element.dispatchEvent(evt);\n}\n\n/** Fire the proper modified events (input and/or change) on the element after changing its value\n * @param element - Element to receive event\n * @param options - Event options\n * @deprecated Use changeValue so we can figure out the proper events to fire\n */\nexport function fireModifiedEvents(element: FormControlElement, options?: DomEventOptions) {\n dispatchDomEvent(element, 'input', options);\n dispatchDomEvent(element, 'change', options);\n}\n\n//manually fire 'onchange' events. needed for event simulation - DEPRECATED\n/**\n * @param element - Element to receive event\n * @param type - Event type\n * @param options - Event options\n * @deprecated Use dispatchDomEvent instead\n */\nexport function fireHTMLEvent(element: EventTarget, type: string, options?: DomEventOptions) {\n return dispatchDomEvent(element, type, options);\n}\n\ntype CustomEventParams =\n {\n /** Whether this event should bubble up in the DOM */\n bubbles: boolean;\n /** Whether this event can be cancelled */\n cancelable: boolean;\n /** Custom event information */\n detail?: unknown;\n /** Handler to execute if the default isn't prevented by a event listener */\n defaulthandler?: (evt: CustomEvent) => void;\n };\n\n/** Fire a custom event\n @param node - node to fire the event on\n @param event - event type. You should add this event to the GlobalEventHandlersEventMap for validation in dispatchCustomEvent calls and addEventListener callbacks.\n @param params - Event options\n @returns true if the default wasn't prevented\n */\n\nexport function dispatchCustomEvent<K extends string>(\n node: EventTarget,\n event: K,\n params: CustomEventParams & (K extends keyof GlobalEventHandlersEventMap ?\n GlobalEventHandlersEventMap[K] extends CustomEvent ?\n { detail: GlobalEventHandlersEventMap[K][\"detail\"] } : unknown : unknown)) {\n\n if (!params)\n throw new Error(`Missing dispatchCustomEvent params`);\n ['bubbles', 'cancelable'].forEach(prop => {\n if (!(prop in params))\n throw new Error(`Missing '${prop}' in dispatchCustomEvent params`);\n });\n\n const evt = new CustomEvent(event, {\n bubbles: params.bubbles,\n cancelable: params.cancelable,\n detail: params.detail\n });\n let defaultaction = true;\n try {\n if (!node.dispatchEvent(evt))\n defaultaction = false; //defaultPrevented is unreliable on IE11, so double check\n } finally {\n if (!evt.defaultPrevented && params.defaulthandler && defaultaction) {\n params.defaulthandler(evt);\n }\n }\n return defaultaction && !evt.defaultPrevented;\n}\n\n/**\n Change the value of a form element, and fire the correct events as if it were a user change\n *\n @param element - Element to change\n @param newvalue - New value\n */\nexport function changeValue(element: FormControlElement, newvalue: string | number | boolean) {\n if (element.matches(`input[type=radio], input[type=checkbox]`)) {\n if (Boolean((element as HTMLInputElement).checked) === Boolean(newvalue))\n return;\n (element as HTMLInputElement).checked = Boolean(newvalue);\n } else {\n //FIXME it's not really clean to assume that this element is changeable - throw for non input/select..\n const asString = String(newvalue);\n if ((element as HTMLInputElement).value === asString)\n return;\n\n (element as HTMLInputElement).value = String(newvalue);\n }\n dispatchDomEvent(element as EventTarget, 'input');\n dispatchDomEvent(element as EventTarget, 'change');\n}\n\nlet keydata: { mapping: { [key: string]: string } };\n\nfunction initKeyMapping() {\n keydata =\n {\n // Mapping from keyIdentifier/key to key. If not found, translate U+XXXX to the unicode char and return that.\n\n // List of all current key mappings (and current inconsistencies\n // at https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\n mapping:\n {\n \"Del\": \"Delete\", // IE/edge use 'Del' instead of 'Delete'\n \"Esc\": \"Escape\", // IE/edge use 'Esc' instead of 'Escape'\n \"OS\": \"Meta\", // Meta key is called OS on IE 9 and Firefox (tested v50)\n \"Win\": \"Meta\", // Meta key is called Win on IE/Edge\n \"Scroll\": \"ScrollLock\", // More IE/Edge, from tests\n \"PrintScreen\": \"Print\", // More IE/Edge, from tests\n \"MozHomeScreen\": \"GoHome\", // Prior to Firefox 37, the Home button generated a key code of \"Exit\". Starting in Firefox 37, the button generates the key code \"MozHomeScreen\".\n\n // Internet Explorer 9 and Firefox 36 and earlier return \"Left\", \"Right\", \"Up\", and \"Down\" for the arrow keys, instead of \"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", and \"ArrowDown\".\n \"Left\": \"ArrowLeft\",\n \"Right\": \"ArrowRight\",\n \"Up\": \"ArrowUp\",\n \"Down\": \"ArrowDown\",\n // More IE and old Firefox stuff\n \"Crsel\": \"CrSel\",\n \"Exsel\": \"ExSel\",\n \"Nonconvert\": \"NonConvert\",\n // Internet Explorer 9 and Firefox 36 and earlier report \"Apps\" instead of \"ContextMenu\" for the context menu key.\n \"Apps\": \"ContextMenu\",\n // Internet Explorer 9 and Firefox 36 and earlier use \"MediaNextTrack\" and \"MediaPreviousTrack\" instead of \"MediaTrackNext\" and \"MediaTrackPrevious\".\n \"MediaNextTrack\": \"MediaTrackNext\",\n \"MediaPreviousTrack\": \"MediaTrackPrevious\",\n // In Internet Explorer 9, and prior to Firefox 49, \"AudioVolumeUp\", \"AudioVolumeDown\", and \"AudioVolumeMute\" were \"VolumeUp\", \"VolumeDown\", and \"VolumeMute\".\n // In Firefox 49 they were updated to match the latest specification. The old names are still used on Boot to Gecko.\n \"VolumeUp\": \"AudioVolumeUp\",\n \"VolumeDown\": \"AudioVolumeDown\",\n \"VolumeMute\": \"AudioVolumeMute\",\n // Firefox added proper support for the \"TV\" key in Firefox 37; before that, this key generated the key code \"Live\".\n \"Live\": \"TV\",\n // Internet Explorer 9 and Firefox 36 and earlier identify the zoom toggle button as \"Zoom\". Firefox 37 corrects this to \"ZoomToggle\".\n \"Zoom\": \"ZoomToggle\",\n // Internet Explorer 9 and Firefox 36 and earlier use \"SelectMedia\" instead of \"LaunchMediaPlayer\". Firefox 37 through Firefox 48 use \"MediaSelect\". Firefox 49 has been updated to match the latest specification, and to return \"LaunchMediaPlayer\".\n \"SelectMedia\": \"LaunchMediaPlayer\",\n \"MediaSelect\": \"LaunchMediaPlayer\",\n // Google Chrome returns \"LaunchCalculator\" instead of \"LaunchApplication1\". See Chromium bug 612743 for more information.\n // Google Chrome returns \"LaunchMyComputer\" instead of \"LaunchApplication2\". See Chromium bug 612743 for more information.\n // (LaunchCalculator and LaunchMyComputer are valid too, so no translation)\n\n // While older browsers used words like \"Add\", \"Decimal\", \"Multiply\", and so forth modern browsers identify these using the actual character (\"+\", \".\", \"*\", and so forth).\n \"Multiply\": \"*\",\n \"Add\": \"+\",\n \"Divide\": \"/\",\n \"Subtract\": \"-\",\n \"Decimal\": \".\", // (mozilla Key_Values doc says depends on region)\n \"Separator\": \".\", // (mozilla Key_Values doc says depends on region)\n\n // keyIdenfier spec mapping of non-printable keys: https://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#keyset-keyidentifiers\n // Used in safari\n \"U+0008\": \"Backspace\",\n \"U+0009\": \"Tab\",\n \"U+000D\": \"Enter\",\n \"U+0018\": \"Cancel\",\n \"U+001B\": \"Escape\",\n \"U+007F\": \"Delete\",\n \"U+0300\": \"DeadGrave\",\n \"U+0301\": \"DeadEacute\",\n \"U+0302\": \"DeadCircumflex\",\n \"U+0303\": \"DeadTilde\",\n \"U+0304\": \"DeadMacron\",\n \"U+0306\": \"DeadBreve\",\n \"U+0307\": \"DeadAboveDot\",\n \"U+0308\": \"DeadUmlaut\",\n \"U+030A\": \"DeadAboveRing\",\n \"U+030B\": \"DeadDoubleacute\",\n \"U+030C\": \"DeadCaron\",\n \"U+0327\": \"DeadCedilla\",\n \"U+0328\": \"DeadOgonek\",\n \"U+0345\": \"DeadIota\",\n \"U+3099\": \"DeadVoicedSound\",\n \"U+309A\": \"DeadSemivoicedSound\",\n\n // keyIdenfier spec mapping to characters: https://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#keyset-keyidentifiers\n \"Exclamation\": \"!\",\n \"DoubleQuote\": \"\\\"\",\n \"Hash\": \"#\",\n \"Dollar\": \"$\",\n \"Ampersand\": \"&\",\n \"LeftParen\": \"(\",\n \"RightParen\": \")\",\n \"Asterisk\": \"*\",\n \"Plus\": \"+\",\n \"Percent\": \"%\",\n \"Comma\": \",\",\n \"HyphenMinus\": \"-\",\n \"Period\": \".\",\n \"Solidus\": \"/\",\n \"Colon\": \":\",\n \"Semicolon\": \";\",\n \"LessThan\": \"<\",\n \"Equals\": \"=\",\n \"GreaterThan\": \">\",\n \"QuestionMark\": \"?\",\n \"At\": \"@\",\n \"LeftSquareBracket\": \"[\",\n \"Backslash\": \"\\\\\",\n \"RightSquareBracket\": \"]\",\n \"Circumflex\": \"^\",\n \"Underscore\": \"_\",\n \"Grave\": \"`\",\n \"LeftCurlyBracket\": \"{\",\n \"Pipe\": \"|\",\n \"RightCurlyBracket\": \"}\",\n \"Euro\": \"€\",\n \"InvertedExclamation\": \"¡\",\n\n // Safari fixes: viewed in local tests\n \"U+0010\": \"ContextMenu\"\n }\n };\n}\n\nexport type NormalizedKeyboardEvent =\n {\n type: string;\n target: EventTarget | null;\n key: string;\n code: string;\n ctrlKey: boolean;\n altKey: boolean;\n location: number;\n shiftKey: boolean;\n metaKey: boolean;\n repeat: boolean;\n isComposing: boolean;\n };\n\n/**\n Returns normalized keyboard event properties, following the current W3C UI Events spec\n *\n @param evt - Keyboard event\n @returns Normalized keyboard event data\n */\nexport function normalizeKeyboardEventData(evt: KeyboardEvent): NormalizedKeyboardEvent {\n // event.key is supported from chrome:51, edge, ff: 29, ie: 9, not in safari\n // event.keyIdentifier in chrome 26-54, opera 15-41, safara: 5.1\n // safari doesn't provide either in keypress events, use U+evt.keyCode (uppercase 4-byte hex)\n\n let key = evt.key;\n if (!keydata)\n initKeyMapping();\n if (keydata.mapping[key])\n key = keydata.mapping[key];\n else if (key.startsWith(\"U+\")) // U+xxxx code\n key = String.fromCodePoint(parseInt(key.substring(2), 16));\n\n // Seen in chrome 56.0.2924.76 on linux, numpad '.' without numlock returns key \"\\u0000\"\n if (evt.key === \"\\u0000\" && evt.code === \"NumpadDecimal\")\n key = \".\";\n\n return (\n {\n type: evt.type,\n target: evt.target,\n key: key,\n code: evt.code || \"Unidentified\",\n ctrlKey: evt.ctrlKey,\n altKey: evt.altKey,\n location: evt.location,\n shiftKey: evt.shiftKey,\n metaKey: evt.metaKey,\n repeat: evt.repeat,\n isComposing: evt.isComposing\n });\n}\n\n/**\n * Stop, fully, an event\n *\n * @param event - Event to stop\n */\nexport function stop(event: Event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n\nexport class EventListenerSet {\n listeners = new Array<{\n node: HTMLElement;\n type: string;\n listener: EventListener;\n options?: AddEventListenerOptions;\n }>();\n\n removeAll() {\n for (const listener of this.listeners)\n listener.node.removeEventListener(listener.type, listener.listener, listener.options);\n\n this.listeners.splice(0); //clear array\n }\n [Symbol.dispose]() {\n this.removeAll();\n }\n}\n\n/** Add an event listener to HTMLElements inside a document (which allows us to ensure that 'target' is a HTMLElement for easier typings) */\nexport function addDocEventListener<CurrentTargetType extends HTMLElement, Type extends keyof HTMLElementEventMap>(node: CurrentTargetType, type: Type, listener: (this: CurrentTargetType, ev: DocEvent<HTMLElementEventMap[Type], CurrentTargetType>) => void, options?: AddDocEventListenerOptions): void;\nexport function addDocEventListener<CurrentTargetType extends HTMLElement>(node: CurrentTargetType, type: string, listener: (this: CurrentTargetType, evt: DocEvent<Event, CurrentTargetType>) => void, options?: AddDocEventListenerOptions): void;\n\nexport function addDocEventListener<CurrentTargetType extends HTMLElement>(node: CurrentTargetType, type: string, listener: (this: CurrentTargetType, evt: DocEvent<Event, CurrentTargetType>) => void, options?: AddDocEventListenerOptions): void {\n node.addEventListener(type, listener as EventListener, options);\n if (options?.listenerSet)\n options.listenerSet.listeners.push({ node, type, listener: listener as EventListener, options });\n}\n","import { debugFlags } from '@webhare/env';\nimport * as domevents from '../../../modules/system/js/dompack/src/events';\nimport \"@webhare/tsrun/src/polyfills\";\n\nlet locallocks: BusyLock[] = [];\nlet modallocked = false;\nlet uiwatcher: NodeJS.Timeout | null = null;\nlet installedanticancelhandler = false;\n\nlet currentbusymodaldialog: HTMLDialogElement | null = null;\nlet currentbusymodaluserdialog: HTMLDialogElement | null = null;\nlet busymodalcontent: string | HTMLElement | HTMLDialogElement | undefined;\nlet mylockmgr: LockManager | undefined;\n\nexport type BusyModalEvent = CustomEvent<{ show: boolean }>;\n\n// As 'Lock' already exists on the Web (https://developer.mozilla.org/docs/Web/API/Lock) and it's seldom used just use a longer name. Available since WH 5.4\nexport interface UIBusyLock extends Disposable {\n release(): void;\n [Symbol.dispose](): void;\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n \"dompack:busymodal\": BusyModalEvent;\n }\n interface Window {\n __dompack_busylockmanager?: LockManager;\n }\n\n // __dompack_busylockmanager: LockManager | undefined; //\n}\n\nfunction getLockmgr(): LockManager {\n if (!mylockmgr) {\n mylockmgr = getParentLockManager() || new LockManager;\n if (typeof window !== \"undefined\")\n window.__dompack_busylockmanager = mylockmgr;\n }\n return mylockmgr;\n}\n\nfunction anyModalLocks() {\n return locallocks.some(l => l.modal);\n}\n\n/* scheduleCheckUIFree is invoked by release() or when waitUIFree is explicitly called. the call from release() should\n be a 'fast' path. We schedule a full check for the next tick if there's a chance it might actually find a free UI */\nfunction scheduleCheckUIFree() {\n if (!uiwatcher && locallocks.length === 0)\n uiwatcher = setTimeout(() => checkUIFree(), 0);\n}\n\n/* check if the UI is actually free. if so, remove busymodals and resolve waitUIFrees for the benefit of testfw */\nfunction checkUIFree() {\n uiwatcher = null;\n\n if (modallocked && !anyModalLocks()) { //did the last frame-level *modal* lock just get released?\n modallocked = false;\n toggleBusyModal(false);\n }\n\n if (locallocks.length === 0) {\n const lockmgr = getLockmgr();\n lockmgr.busyframes.delete(window); //we won't release our block in the lockmanager until we've had a chance to remove our modal layer\n lockmgr.checkUIFree(); //to resolve any waitUIFrees. runs in the top-level frame. note that lockmgr cares about ALL ui locks, not just modals\n }\n}\n\nfunction isDialogElement(el: unknown): boolean {\n return typeof el === \"object\" && (el as HTMLElement).matches?.(\"dialog\") || false;\n}\n\nfunction checkCancelEvent(evt: Event) {\n if (modallocked)\n evt.preventDefault();\n}\n\nfunction toggleBusyModal(show: boolean) {\n //'islock' is legacy non-camel version. TypeScript typing should help us transition (since 5.3). 'as' shuts up the warning TODO remove 'islock' and the 'as'\n if (!domevents.dispatchCustomEvent(window, 'dompack:busymodal', { bubbles: true, cancelable: true, detail: { show: show, islock: show } as BusyModalEvent['detail'] }))\n return; //cancelled!\n\n if (!installedanticancelhandler) {\n //capture cancel, as it doesn't bubble up\n addEventListener(\"cancel\", evt => checkCancelEvent(evt), { capture: true });\n installedanticancelhandler = true;\n }\n\n if (show) {\n if (isDialogElement(busymodalcontent)) { //the user provided us with an element\n currentbusymodaluserdialog = busymodalcontent as HTMLDialogElement;\n currentbusymodaluserdialog.showModal();\n } else if (busymodalcontent) { //we'll create our own dialog\n const dialog = document.createElement('dialog');\n const toembed = typeof busymodalcontent === \"string\" ? document.createTextNode(busymodalcontent) : busymodalcontent.cloneNode(true);\n dialog.className = \"dompack-busydialog\";\n dialog.role = \"status\";\n dialog.ariaLive = \"off\";\n dialog.append(toembed);\n document.body.appendChild(dialog);\n currentbusymodaldialog = dialog;\n dialog.showModal();\n return;\n }\n\n document.documentElement.classList.add(\"dompack--busymodal\");\n return;\n }\n\n //hiding\n document.documentElement.classList.remove(\"dompack--busymodal\");\n if (currentbusymodaluserdialog)\n currentbusymodaluserdialog.close();\n if (currentbusymodaldialog) { //we added a dialog to the dom\n currentbusymodaldialog.close();\n document.body.removeChild(currentbusymodaldialog);\n currentbusymodaldialog = null;\n }\n}\n\nclass LockManager {\n locks: BusyLock[];\n busyframes: Set<Window> = new Set;\n busycounter: number;\n deferreduipromise: PromiseWithResolvers<boolean> | null;\n\n //this object is not for external consumption\n constructor() {\n this.locks = [];\n this.busycounter = 0;\n this.deferreduipromise = null;\n }\n add(lock: BusyLock) {\n this.locks.push(lock);\n const returnvalue = this.busycounter++;\n return returnvalue;\n }\n release(lock: BusyLock) {\n const pos = this.locks.indexOf(lock);\n if (pos === -1) {\n if (debugFlags.bus) {\n console.error(\"Duplicate release of busy lock #\" + lock.locknum);\n console.log(\"Lock allocated:\");\n console.log(lock.acquirestack);\n console.log(\"Lock first released:\");\n console.log(lock.releasestack);\n }\n throw new Error(\"Duplicate release of busy lock\");\n }\n\n this.locks.splice(pos, 1);\n }\n getNumLocks() {\n return this.locks.length;\n }\n //used by child windows to schedule a check in *our* frame (eg before they themselves are unloaded)\n scheduleCheckUIFree() {\n scheduleCheckUIFree();\n }\n checkUIFree() {\n if (this.locks.length === 0 && this.busyframes.size === 0 && this.deferreduipromise) {\n this.deferreduipromise.resolve(true);\n this.deferreduipromise = null;\n }\n }\n waitUIFree() {\n if (!this.deferreduipromise)\n this.deferreduipromise = Promise.withResolvers();\n\n scheduleCheckUIFree(); //ensures uiwait is released at next tick if no locks are present at all\n return this.deferreduipromise.promise;\n }\n logLocks() {\n this.locks.forEach(lock => console.log('[bus] lock #' + lock.locknum, lock.acquirestack, lock));\n console.log(\"[bus] total \" + this.locks.length + \" locks\");\n }\n getLockIds() {\n return this.locks.map(l => \"#\" + l.locknum).join(\", \");\n }\n}\n\n/** Configure an (accessible) modal dialog\n * @param bmc - What to show in the dialog: either a text or DOM fragment to clone.\n * If a <dialog> element is passed, this dialog will be used instead of creating a new one.\n */\nexport function setupBusyModal(bmc: NonNullable<typeof busymodalcontent>) {\n busymodalcontent = bmc;\n}\n\ninterface LockOptions {\n ///Whether this lock should enable a modality laayer\n modal?: boolean;\n}\n\nclass BusyLock implements UIBusyLock {\n modal: boolean;\n locknum: number;\n acquirestack: string | undefined;\n releasestack: string | undefined;\n\n constructor(options?: LockOptions) {\n //legacy non-camel name is 'ismodal'\n this.modal = options?.modal ?? (options as { ismodal?: boolean })?.ismodal ?? false;\n\n const lockmgr = getLockmgr();\n this.locknum = lockmgr.add(this);\n lockmgr.busyframes.add(window);\n locallocks.push(this);\n\n if (this.modal && !modallocked) {\n modallocked = true;\n toggleBusyModal(true);\n }\n\n if (debugFlags.bus) {\n this.acquirestack = (new Error).stack;\n console.trace('[bus] Busy lock #' + this.locknum + ' taken. ' + lockmgr.getNumLocks() + \" locks active now: \" + lockmgr.getLockIds());\n }\n }\n\n [Symbol.dispose]() {\n if (debugFlags.bus)\n this.releasestack = (new Error).stack;\n\n const lockmgr = getLockmgr();\n lockmgr.release(this);\n const lockpos = locallocks.indexOf(this);\n locallocks.splice(lockpos, 1);\n\n if (debugFlags.bus) {\n console.trace('[bus] Busy lock #' + this.locknum + ' released. ' + lockmgr.getNumLocks() + \" locks active now: \" + lockmgr.getLockIds());\n }\n\n scheduleCheckUIFree();\n }\n\n release() {\n this[Symbol.dispose]();\n }\n}\n\n/** Return a promise resolving as soon as the UI (any accessible frame) is free for at least one tick */\nexport function waitUIFree() {\n return getLockmgr().waitUIFree();\n}\n\n/**\n flag userinterface as busy. tests then know not to interact with the UI until the busy flag is released\n *\n @param options - Options.<br>\n - modal: true/false - Whether the lock is a modal lock\n */\nexport function flagUIBusy(options?: LockOptions): UIBusyLock {\n return new BusyLock(options);\n}\n\nexport function getUIBusyCounter() {\n return getLockmgr().busycounter;\n}\n\nfunction getParentLockManager(): LockManager | null {\n try { //we're accessing a parent window, so we may hit security exceptions\n if (!(window.parent?.__dompack_busylockmanager))\n return null;\n\n //if we connected to a parent... deregister our locks, eg. if parent navigated our frame away\n window.addEventListener(\"unload\", () => {\n if (debugFlags.bus)\n console.log(\"[bus] Frame unloading, \" + locallocks.length + \" locks pending.\", locallocks.map(l => \"#\" + l.locknum).join(\", \"), locallocks);\n\n //switch to local instance in case anyone still tries to touch these locks during unload\n const lockmgr = getLockmgr();\n const locallockmgr = new LockManager;\n locallocks.forEach(lock => { lockmgr.release(lock); locallockmgr.add(lock); });\n locallocks = [];\n\n lockmgr.busyframes.delete(window); //explicitly remove us so we won't be waited upon\n lockmgr.scheduleCheckUIFree();\n mylockmgr = locallockmgr;\n });\n\n return window.parent.__dompack_busylockmanager;\n } catch (e) {\n return null;\n }\n}\n","/** Rect describing an elements position */\nexport type Rect = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n width: number;\n height: number;\n};\n\n/** Elements you can set a value on and would have to trigger change and/or input events */\nexport type FormControlElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n\n/** Types that support querySelector(All) */\ntype QuerySelectorAble = ParentNode | ShadowRoot;\n\nexport function qS<E extends Element = HTMLElement>(startnode: QuerySelectorAble, selector: string): E | null;\nexport function qS<E extends Element = HTMLElement>(selector: string): E | null;\n\n/** Match the first element using a CSS selector\n * @param node_or_selector - The starting node or selector\n * @param selector - The selector to match if the starting node was specified\n * @returns The first matching element or null\n */\nexport function qS<E extends Element>(node_or_selector: QuerySelectorAble | string, selector?: string): E | null {\n if (typeof node_or_selector === 'string')\n return document.querySelector<E>(node_or_selector);\n else if (selector)\n return node_or_selector.querySelector<E>(selector);\n return null;\n}\n\n\nexport function qR<E extends Element = HTMLElement>(startnode: QuerySelectorAble, selector: string): E;\nexport function qR<E extends Element = HTMLElement>(selector: string): E;\n\n/** Match a specific element using a CSS selector, requiring it to exist and be unique\n * @param node_or_selector - The starting node or selector\n * @param selector - The selector to match if the starting node was specified\n * @returns The requested element. Throw it the selector doesn't match exactly one element\n */\nexport function qR<E extends Element>(node_or_selector: QuerySelectorAble | string, selector?: string): E {\n const matches = qSA<E>(node_or_selector as QuerySelectorAble, selector as string);\n if (matches.length === 1)\n return matches[0];\n\n if (typeof node_or_selector !== 'string') {\n console.error(`${matches.length} elements match selector \\`${selector}\\` with startingpoint`, node_or_selector, matches);\n throw new Error(`${matches.length} elements match selector \\`${selector}\\` given startingpoint '${node_or_selector.nodeName}'`);\n } else {\n console.error(`${matches.length} elements match selector \\`${node_or_selector}\\` in the document`, matches);\n throw new Error(`${matches.length} elements match selector \\`${node_or_selector}\\` in the document`);\n }\n}\n\nexport function qSA<E extends Element = HTMLElement>(startnode: QuerySelectorAble, selector: string): E[];\nexport function qSA<E extends Element = HTMLElement>(selector: string): E[];\n\n/** Find multiple elements using a CSS selector\n * @param node_or_selector - The starting node or selector\n * @param selector - The selector to match if the starting node was specified\n * @returns The requested elements.\n */\nexport function qSA<E extends Element>(node_or_selector: QuerySelectorAble | string, selector?: string): E[] {\n if (typeof node_or_selector === 'string')\n return Array.from(document.querySelectorAll(node_or_selector));\n else if (selector)\n return Array.from(node_or_selector.querySelectorAll(selector));\n\n return [];\n}\n\n/** Return whether the passed element is a FormControlElement */\nexport function isFormControl(field: Element): field is FormControlElement {\n return isHTMLElement(field) && [\"INPUT\", \"SELECT\", \"TEXTAREA\"].includes(field.tagName);\n}\n\n/** Test whether node is an Element, even if it's in a different iframe */\nexport function isElement(node: unknown): node is Element {\n //TODO What is actually going on if defaultView is missing?\n if (!node || typeof node !== \"object\")\n return false;\n\n /* Getting the proto doesn't always work:\n const proto = (node as Element).ownerDocument.defaultView?.Element;\n (because our iframes derive off about? not sure) so until someone finds the real answer, we'll do a heuristic\n */\n\n /** Analyzing node.constructor.name doesn't work because custom elements don't necessarily have their constructor's name ending in Element\n return Boolean(\"ownerDocument\" in node && node.constructor.name.match(/Element$/));\n */\n\n return Boolean(\"ownerDocument\" in node && (node as Element).nodeType === 1);\n\n}\n\n/** Test whether node is a HTMLElement, even if it's in a different iframe */\nexport function isHTMLElement(node: unknown): node is HTMLElement {\n return isElement(node) && \"accessKey\" in node;\n}\n\n/**\n * get the relative bound difference between two elements, and return a writable copy\n *\n * @param node - The node for which you need coordinates\n * @param relativeto - Optional reference point. If not set, you just get a 'normal' coordinate object\n */\nexport function getRelativeBounds(node: Element, relativeto?: Element): Rect {\n if (!relativeto)\n relativeto = node.ownerDocument.documentElement;\n\n const nodecoords = node.getBoundingClientRect();\n const relcoords = relativeto.getBoundingClientRect();\n return {\n top: nodecoords.top - relcoords.top,\n left: nodecoords.left - relcoords.left,\n right: nodecoords.right - relcoords.left,\n bottom: nodecoords.bottom - relcoords.top,\n width: nodecoords.width,\n height: nodecoords.height\n };\n}\n","\n/* Regex to identify dimensionless style sttributes. copied from old version of preact/src/constants.js (MIT)\n meant to capture:\n { boxFlex:1, boxFlexGroup:1, columnCount:1, fillOpacity:1, flex:1, flexGrow:1,\n flexPositive:1, flexShrink:1, flexNegative:1, fontWeight:1, lineClamp:1, lineHeight:1,\n opacity:1, order:1, orphans:1, strokeOpacity:1, widows:1, zIndex:1, zoom:1\n*/\nconst IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nexport { qS, qSA } from '@webhare/dompack';\n\nfunction generateInsertList(nodes: Array<string | Node>) {\n if (nodes.length === 1)\n return typeof nodes[0] === 'string' ? document.createTextNode(nodes[0]) : nodes[0];\n\n const frag = document.createDocumentFragment();\n nodes.forEach(node => frag.appendChild(typeof node === 'string' ? document.createTextNode(node) : node));\n return frag;\n}\n\n/** @deprecated Use node.matches() */\nexport function matches(node: Element, selector: string): boolean {\n //only invoke 'matches' if it exists. it *should* but past versions of dompack.matches would check for it too (and thus not fail if you passed in a string instead of a Node)\n return node.matches?.(selector);\n}\n/** @deprecated Use node.closest() */\nexport function closest(node: Element, selector: string) {\n if (node.closest)\n return node.closest(selector);\n //TODO: Warn about out-of-date browser?\n let testNode: Element | null = node;\n for (; testNode && !matches(testNode, selector); testNode = testNode.parentElement)\n /*iterate*/;\n return testNode;\n}\n//implements contains. TODO we only really need this on IE11, which doesn't consider a text node a child, we can probably fall back to native elsewhere ?\n/** @deprecated Use node.contains() */\nexport function contains(ancestor: Node, child: Node) {\n if (ancestor.contains)\n return ancestor.contains(child);\n //TODO: Warn about out-of-date browser?\n for (let testNode: Node | null = child; testNode; testNode = testNode.parentNode)\n if (testNode === ancestor)\n return true;\n return false;\n}\n//insert a range of nodes before a node: https://dom.spec.whatwg.org/#dom-childnode-before\n/** @deprecated Use node.before() */\nexport function before(node: ChildNode, ...nodes: Array<string | Node>) {\n if (node.before) {\n node.before(...nodes);\n return;\n }\n //TODO: Warn about out-of-date browser?\n if (node.parentNode)\n node.parentNode.insertBefore(generateInsertList(nodes), node);\n}\n//insert a range of nodes after a node: https://dom.spec.whatwg.org/#dom-childnode-after\n/** @deprecated Use node.after() */\nexport function after(node: ChildNode, ...nodes: Array<string | Node>) {\n if (node.after) {\n node.after(...nodes);\n return;\n }\n //TODO: Warn about out-of-date browser?\n if (node.parentNode)\n node.parentNode.insertBefore(generateInsertList(nodes), node.nextSibling);\n}\n//replace node with a set of nodes : https://dom.spec.whatwg.org/#dom-childnode-replacewith\n/** @deprecated Use node.replaceWith() */\nexport function replaceWith(node: ChildNode, ...nodes: Array<string | Node>) {\n if (node.replaceWith) {\n node.replaceWith(...nodes);\n return;\n }\n //TODO: Warn about out-of-date browser?\n if (node.parentNode)\n node.parentNode.replaceChild(generateInsertList(nodes), node);\n}\n//remove node with a set of nodes : https://dom.spec.whatwg.org/#dom-childnode-remove\n/** @deprecated Use node.remove() */\nexport function remove(node: ChildNode) {\n if (node.remove) {\n node.remove();\n return;\n }\n //TODO: Warn about out-of-date browser?\n if (node.parentNode)\n node.parentNode.removeChild(node);\n}\n//insert nodes at start: https://dom.spec.whatwg.org/#dom-parentnode-prepend\n/** @deprecated Use node.prepend() */\nexport function prepend(node: ParentNode, ...nodes: Array<string | Node>) {\n if (node.prepend) {\n node.prepend(...nodes);\n return;\n }\n //TODO: Warn about out-of-date browser?\n node.insertBefore(generateInsertList(nodes), node.firstChild);\n}\n//insert nodes at end: https://dom.spec.whatwg.org/#dom-parentnode-append\n/** @deprecated Use node.append() */\nexport function append(node: ParentNode, ...nodes: Array<string | Node>) {\n if (node.append) {\n node.append(...nodes);\n return;\n }\n //TODO: Warn about out-of-date browser?\n node.appendChild(generateInsertList(nodes));\n}\n\n/**\n * Toggle a single class\n *\n * @param node - Node to modify\n * @param classname - Class to toggle\n * @param settoggle - true to enable, false to disable, undefined to toggle\n * @deprecated Just use classList.toggle on the node itself\n */\n/** @deprecated Use classList.toggle() */\nexport function toggleClass(node: Element, classname: string, settoggle?: boolean) {\n if (arguments.length === 2) //in old dompack, 2 argument version toggled and 3 argument version toggled off. match that behavior\n node.classList.toggle(classname);\n else\n node.classList.toggle(classname, settoggle);\n}\n\n/**\n Toggle classes in a node\n *\n @param node - Node which classes to toggle\n @param toggles - Object, all keys will be added/removed based on the truthyness of their values\n */\nexport function toggleClasses(node: Element, toggles: { [key: string]: boolean }) {\n if (typeof (toggles) !== \"object\")\n throw new Error(\"Expected an object with keys as classnames\");\n Object.keys(toggles).forEach(key => node.classList[toggles[key] ? \"add\" : \"remove\"](key));\n}\n\n/* remove the contents of an existing node */\n/** @deprecated Use node.replaceChildren() */\nexport function empty(node: Element) {\n if (node.replaceChildren) {\n node.replaceChildren();\n return;\n }\n //TODO: Warn about out-of-date browser?\n while (node.lastChild)\n node.removeChild(node.lastChild);\n}\n\nexport function isDomReady() {\n //ensure no domready events can run if there will never be a dom\n return typeof document !== \"undefined\" && (document.readyState === \"interactive\" || document.readyState === \"complete\");\n}\n\n/* run the specified function 'on ready'. adds to DOMContentLoaded if dom is not ready yet. Exceptions from the ready handler will not be fatal to the rest of code execution */\nexport function onDomReady(callback: () => void) {\n if (isDomReady()) {\n try {\n callback();\n } catch (e) {\n console.error(\"Exception executing a domready handler\");\n if (e instanceof Error) {\n console.log(e, e.stack);\n if (window.onerror) {\n // Send to onerror to trigger exception reporting\n try {\n // @ts-ignore fileName, lineNumber and columnNumber are non-standard\n window.onerror(e.message, e.fileName || \"\", e.lineNumber || 1, e.columNumber || 1, e);\n } catch (e2) { }\n }\n } else\n console.log(e);\n }\n } else\n document.addEventListener(\"DOMContentLoaded\", callback);\n}\n\n//parse JSON data, throw with more info on parse failure\nexport function getJSONAttribute<T>(node: Element, attributename: string): T | null {\n try {\n if (node.hasAttribute(attributename))\n return JSON.parse(node.getAttribute(attributename) as string);\n } catch (e) {\n console.error(\"JSON parse failure on attribute '\" + attributename + \"' of node\", node);\n throw e;\n }\n return null;\n}\n\n/**\n Get the base URI of the current document. IE11 doesn't implement document.baseURI\n *\n @param doc - Document to query. Defaults to window.document\n @deprecated Use document.baseURI\n */\nexport function getBaseURI(doc: Document | undefined) {\n if (!doc)\n doc = window.document;\n if (doc.baseURI)\n return doc.baseURI;\n\n const base = doc.querySelector('base');\n if (base && base.href)\n return base.href;\n return doc.URL;\n}\n\n/**\n Sets multiple styles on a node, automatically adding 'px' to numbers when appropriate\n (can be used as replacement for Mootools .setStyles)\n *\n * @param node - Node to update\n * @param value - Styles to set\n */\nexport function setStyles(node: HTMLElement, value?: string | { [key: string]: string | number }) {\n if (!value)\n node.style.cssText = '';\n else if (typeof value === 'string')\n node.style.cssText = value || '';\n else {\n for (const [key, propvalue] of Object.entries(value)) {\n // for numbers, add 'px' if the constant isn't dimensionless (eg zIndex)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we don't know which keys will be set\n (node.style as any)[key] = typeof value[key] === 'number' && IS_NON_DIMENSIONAL.test(key) === false\n ? propvalue + 'px'\n : propvalue;\n }\n }\n}\n","import { append, setStyles } from './tree';\n\n// This will assign the `any` type to the list of accepted attributes for elements constructed via JSX syntax.\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [eleName: string]: any;\n }\n }\n}\n\ntype CreateAttributes = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n on?: {\n [key in keyof GlobalEventHandlersEventMap]?: (evt: GlobalEventHandlersEventMap[key]) => void;\n };\n};\n\ntype CreateElementFunction = (attributes: CreateAttributes, _1?: null, _2?: null) => HTMLElement;\n\nfunction flattenArray<T>(list: T[]): T[] {\n return list.reduce((acc: T[], elt) => acc.concat(Array.isArray(elt) ? flattenArray(elt) : elt), []);\n}\n\nfunction setClassName(node: Element, value?: string | string[] | { [key: string]: boolean }) {\n if (!value)\n node.className = '';\n else if (typeof value === 'string')\n node.className = value || '';\n else if (Array.isArray(value))\n node.className = value.filter(elt => elt && typeof elt === 'string').join(\" \");\n else if (typeof value === \"object\") {\n let str = \"\";\n Object.keys(value).forEach((key, idx) => { if (value[key]) str += (idx ? \" \" : \"\") + key; });\n node.className = str;\n }\n}\n\n/**\n Matches non-first uppercase characters\n (when the second char is uppercases, the first char is passed too)\n */\nconst MATCH_UPCASE = /([A-Z])/g;\nconst MATCH_DASH_AND_CHAR = /-([a-zA-Z])/g;\n\n/**\n Convert a camelCased identifier to a dashed string\n *\n * @param value - identifier to convert\n */\nexport function toDashed(value: string) {\n if (value)\n return (value.substring(0, 1) + value.substring(1).replace(MATCH_UPCASE, \"-$1\")).toLowerCase();\n return \"\";\n}\n\n/**\n Convert a dashed string to a camelCase identifier\n *\n * @param value - identifier to convert\n */\nexport function toCamel(value: string) {\n return value.replace(MATCH_DASH_AND_CHAR, (_, match_1) => match_1.toUpperCase());\n}\n\nfunction attrHasBooleanValue(propname: string) {\n return ['disabled', 'checked', 'selected', 'readonly', 'multiple', 'ismap'].includes(propname);\n}\n\nfunction createElement(elementname: string, attributes?: CreateAttributes, toattrs?: boolean) {\n const node = document.createElement(elementname);\n if (attributes) {\n Object.keys(attributes).forEach(attrname => {\n if (attrname === 'events')\n throw new Error(\"Use 'on' instead of 'events' in dompack.create\");\n if (attrname === 'styles')\n throw new Error(\"Use 'style' instead of 'styles' in dompack.create\");\n if (attrname === 'children') {\n // allow null 'children' property for jsxcreate, property delete is detrimental to performance.\n if (attributes[attrname])\n throw new Error(\"Use 'childNodes' instead of 'children' in dompack.create\");\n return;\n }\n\n const value = attributes[attrname];\n\n if (attrname === 'on') //create event listeners\n return void Object.keys(value).forEach(eventname => node.addEventListener(eventname, value[eventname], false));\n else if (attrname.startsWith(\"on\"))\n return void node.addEventListener(toDashed(attrname.substring(2)), value, false);\n\n if (attrname === \"className\" || attrname === \"class\") {\n if (node.className) // already modified the class?\n throw new Error(\"Specify either 'className' or 'class' to dompack.create, but not both\");\n setClassName(node, value);\n return;\n }\n\n if (attrname === 'style')\n return void setStyles(node, value);\n\n if (attrname === 'dataset') //explicitly assign\n return void Object.assign(node[attrname], value);\n\n if (attrname === 'childNodes') //append as children\n return void append(node, ...attributes.childNodes.filter((child: Node | string | number | boolean | null) => child !== null && child !== true && child !== false && child !== undefined));\n\n if (toattrs && attrHasBooleanValue(attrname)) {\n if (value)\n node.setAttribute(attrname, \"\");\n else\n node.removeAttribute(attrname);\n return;\n }\n\n if (toattrs && !attrname.startsWith(\"prop\")) {\n if (value !== null && value !== undefined) {\n if (value && typeof value === \"object\")\n throw new Error(\"Cannot store non-null objects in attributes, use a property starting with 'prop'\");\n node.setAttribute(attrname, attributes[attrname]);\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we don't know which keys will be set\n (node as any)[attrname] = attributes[attrname];\n }\n });\n }\n return node;\n}\n\n/* create elements. sets properties (not attributes!) immediately.\n everything inside 'on' is added as an addEventListener without capture\n everything inside 'childNodes' is appended to the node. nulls are ignored inside childNodes\n\n Examples:\n domtools.create(\"input\", { type:\"file\", className: \"myupload\", style: { display: \"none\" }));\n\n*/\nexport function create<K extends keyof HTMLElementTagNameMap>(elementname: K, attributes?: CreateAttributes): HTMLElementTagNameMap[K];\nexport function create(elementname: string, attributes?: CreateAttributes): HTMLElement;\n\nexport function create(elementname: string, attributes?: CreateAttributes) {\n return createElement(elementname, attributes, false);\n}\n\n/** Function to create for jsx, create elements directly (instead of virtual dom nodes).\n\n import * as dompack from 'dompack';\n\n /* \\@jsx dompack.jsxcreate *\\/\n /* \\@jsxFrag dompack.jsxfragment *\\/\n your code\n\n @param element - Name of the element to create\n @param childNodes - Any child nodes to add immediately\n*/\nexport function jsxcreate<K extends keyof HTMLElementTagNameMap>(element: K, attributes: CreateAttributes, ...childNodes: Array<Node | string | number>): HTMLElementTagNameMap[K];\nexport function jsxcreate(element: string | CreateElementFunction, attributes: CreateAttributes, ...childNodes: Array<Node | string | number>): HTMLElement;\n\nexport function jsxcreate(element: string | CreateElementFunction, attributes: CreateAttributes, ...childNodes: Array<Node | string | number>): HTMLElement {\n // Ensure attributes\n attributes = attributes || {};\n // Flatten childnodes arrays, convert numbers to strings. Also support children property (React uses that)\n let parts: Array<Node | string | number> = (attributes.childNodes || []).concat(attributes.children || []).concat(childNodes);\n if (attributes.children)\n attributes.children = null;\n parts = flattenArray(parts);\n parts = parts.map((elt) => typeof elt === \"number\" ? String(elt) : elt);\n // Create the element\n attributes.childNodes = parts;\n if (typeof element === \"function\")\n return element(attributes, null, null);\n return createElement(element, attributes, true);\n}\n\nexport function jsxfragment(inp: Node): DocumentFragment {\n const frag = document.createDocumentFragment();\n frag.append(...inp.childNodes);\n return frag;\n}\n","import * as domtree from './tree';\nimport * as domevents from './events';\n\nexport type TakeFocusEvent = CustomEvent<{ options?: FocusOptions }>;\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n \"dompack:takefocus\": TakeFocusEvent;\n }\n}\n\ntype RegistrationHandler<E extends Element = HTMLElement> = (node: E, index?: number) => void;\ntype ComponentRegistration<E extends Element = HTMLElement> =\n {\n selector: string;\n handler: RegistrationHandler<E>;\n index: number;\n num: number;\n afterdomready: boolean;\n };\n\nconst components: Array<ComponentRegistration<Element>> = [];\nconst map = new WeakMap();\n\n//is a node completely in the dom? if we can find a sibling anywhere, it must be closed\nfunction isNodeCompletelyInDom(node: Element | null) {\n for (; node; node = node.parentElement)\n if (node.nextSibling)\n return true;\n return false;\n}\nfunction processRegistration<E extends Element>(item: E, reg: ComponentRegistration<E>, domready: boolean) {\n if (!domready && !isNodeCompletelyInDom(item))\n return; //not safe to register\n\n if (!map.has(item))\n map.set(item, [reg.num]);\n else {\n const list = map.get(item);\n if (list.includes(reg.num))\n return;\n list.push(reg.num);\n }\n reg.handler(item, reg.index++); //note: if an exception is reported from Object.handler,\n}\nfunction applyRegistration<E extends Element>(reg: ComponentRegistration<E>, startnode?: Element) {\n const domready = domtree.isDomReady();\n if (reg.afterdomready && !domready)\n return;\n\n const items = Array.from((startnode || document).querySelectorAll(reg.selector)) as E[];\n if (startnode?.matches(reg.selector))\n items.unshift(startnode as E); //if startnode matches it has to be an E\n\n items.forEach(item => {\n try {\n processRegistration<E>(item, reg, domready);\n } catch (e) {\n console.error(\"Exception handling registration of\", item, \"for rule\", reg.selector);\n console.log(\"Registration\", reg);\n if (e instanceof Error) {\n console.log(e, e.stack);\n if (window.onerror) {\n // Send to onerror to trigger exception reporting\n try {\n // @ts-ignore: fileName, lineNumber and columnNumber are non-standard\n window.onerror(e.message, e.fileName || \"\", e.lineNumber || 1, e.columNumber || 1, e);\n } catch (e2) { }\n }\n } else\n console.log(e);\n }\n });\n}\n\n/* A focus implementation that allows the node to intercept focused, allowing eg\n radio/checkbox replacements to redirect focus but also explicitly preventing\n focus of a disabled element\n Returns true when the focus operation was successfull or handled by an event handler.\n @param node Node to focus\n @param options.preventScroll Prevent scroll to focused element\n*/\nexport function focus(node: Element, options?: FocusOptions) {\n if (!domevents.dispatchCustomEvent(node, 'dompack:takefocus', { bubbles: true, cancelable: true, detail: { options } }))\n return true;\n\n if (typeof (node as HTMLElement).focus !== \"function\" || (node as HTMLInputElement).disabled)\n return false;\n\n (node as HTMLInputElement).focus(options);\n return true;\n}\n\n/**\n * @param node - Node to show\n * @param options - Scroll options\n * @deprecated invoke scrollIntoView directly on the nodes\n */\nexport function scrollIntoView(node: Element, options?: ScrollIntoViewOptions) {\n node.scrollIntoView(options);\n return true;\n}\n\n/**\n Register a component for auto-initialization.\n\n @param selector - Selector the component must match\n @param handler - Handler\n @param options - Any unrecognized options are passed to the handler\n\n The handler will be invoked with two parameters\n - the node to register\n - the index of the node (a unique counter for this selector - first is 0)\n */\n\nexport function register<E extends Element = HTMLElement>(selector: string, handler: RegistrationHandler<E>, options?: { afterdomready: boolean }) {\n const newreg: ComponentRegistration<E> =\n {\n selector: selector,\n handler: handler,\n index: 0,\n num: components.length,\n afterdomready: !options || options.afterdomready\n };\n if (components.length === 0 && !domtree.isDomReady()) //first component... we'll need a ready handler\n domtree.onDomReady(() => registerMissed());\n\n components.push(newreg as ComponentRegistration<Element>);\n applyRegistration(newreg);\n}\n\n// register any components we missed on previous scans\nexport function registerMissed(startnode?: Element) {\n const todo = components.slice(0);\n todo.forEach(item => applyRegistration(item, startnode));\n}\n","export type CookieOptions = {\n path?: string;\n domain?: string | null;\n expires?: Date | null;\n duration?: number | null;\n secure?: boolean;\n sameSite?: \"Strict\" | \"Lax\" | \"None\";\n};\n\nexport type ServersideCookieOptions = CookieOptions & {\n httpOnly?: boolean;\n};\n\nexport function buildCookieHeader(name: string, value: string, options?: ServersideCookieOptions) {\n value = encodeURIComponent(value);\n if (options?.domain)\n value += ';domain=' + options?.domain;\n value += ';path=' + (options?.path || '/');\n if (options?.expires)\n value += ';expires=' + options?.expires.toUTCString();\n else if (options?.duration) {\n const date = new Date();\n date.setTime(date.getTime() + options?.duration * 24 * 60 * 60 * 1000);\n value += ';expires=' + date.toUTCString();\n }\n if (options?.secure)\n value += ';secure';\n if (options?.sameSite)\n value += ';SameSite=' + options?.sameSite;\n if (options?.httpOnly) //NOTE browsers cannot effectively set this\n value += ';HttpOnly';\n return `${name}=${value}`;\n}\n","import { buildCookieHeader, type CookieOptions } from '@webhare/dompack/impl/cookiebuilder';\nimport { escapeRegExp, parseTyped, stringify } from '@webhare/std';\n\nconst isolatedcookies: Record<string, string> = {};\nconst backup: {\n sessionStorage?: Record<string, string>;\n localStorage?: Record<string, string>;\n} = {};\ntype BrowserStorage = keyof typeof backup;\n\n//isolate us when running previews, CI tests use same Chrome for both preview and tests so the previews start increasing visitorcounts behind our back\nconst isolated = typeof document === \"undefined\" || \"whIsolateStorage\" in document.documentElement.dataset;\n\n/** @returns True if our storage is fully isolated */\nexport function isIsolated(): boolean {\n return isolated;\n}\n\nexport function listCookies() {\n if (isIsolated())\n return Object.entries(isolatedcookies).map((entry: string[]) => ({ name: entry[0].substring(2), value: entry[1] }));\n\n return document.cookie.split(';').map(cookie => {\n const parts = cookie.split('=');\n return { name: decodeURIComponent(parts[0].trim()), value: decodeURIComponent(parts[1] || '') };\n });\n}\n\nexport function setCookie(key: string, value: string, options?: CookieOptions) {\n if (!isIsolated())\n document.cookie = buildCookieHeader(key, value, options);\n else if (!value || (options?.duration && options?.duration < 0 && options?.expires === undefined)) //TODO there are probably many more ways to delete a cookie ?\n delete isolatedcookies[\"c.\" + key];\n else\n isolatedcookies[\"c.\" + key] = value;\n}\n\nexport function getCookie(key: string): string | null {\n if (isIsolated())\n return isolatedcookies[\"c.\" + key] || null;\n\n const value = document.cookie.match('(?:^|;)\\\\s*' + escapeRegExp(key) + '=([^;]*)');\n return (value) ? decodeURIComponent(value[1]) : null;\n}\n\nexport function deleteCookie(key: string, options?: CookieOptions) {\n setCookie(key, '', { ...options, duration: -1, expires: undefined });\n}\n\n// Report whether browser storage APIs are unavailable. They might not be in eg Chrome incognito 'Block third-party cookies'\nlet _available: boolean;\nexport function isStorageAvailable(): boolean {\n if (isolated)\n return true;\n\n if (_available === undefined) {\n try {\n _available = Boolean(window.sessionStorage);\n } catch (ignore) {\n _available = false;\n }\n }\n return _available as boolean;\n}\n\nfunction get(storage: BrowserStorage, key: string): unknown | null {\n let foundvalue = backup[storage]?.[key];\n if (foundvalue === undefined && !isolated) { //it's not in the backup\n try {\n foundvalue = window[storage].getItem(key) || undefined;\n } catch (e) {\n return null; //if storage throws, it's definitely not there\n }\n }\n\n return foundvalue !== undefined ? parseTyped(foundvalue) : null;\n}\n\nfunction set(storage: BrowserStorage, key: string, value: unknown) {\n const tostore = value !== null && value !== undefined ? stringify(value, { typed: true }) : null;\n if (!backup[storage] && !isolated) //we didn't fall back yet\n try {\n if (tostore !== null)\n window[storage].setItem(key, tostore);\n else\n window[storage].removeItem(key);\n return;\n } catch (e) {\n //ignore\n }\n\n const store = (backup[storage] ||= {});\n if (tostore !== null)\n store[key] = tostore;\n else\n delete store[key];\n}\n\nexport function getSession<T>(key: string): T | null {\n return get(\"sessionStorage\", key) as T | null;\n}\nexport function setSession<T>(key: string, value: T) {\n set(\"sessionStorage\", key, value);\n}\nexport function getLocal<T>(key: string): T | null {\n return get(\"localStorage\", key) as T | null;\n}\nexport function setLocal<T>(key: string, value: T) {\n set(\"localStorage\", key, value);\n}\n","/** Load an image\n * @param imgsrc - The image source URL\n * @returns A promise resolving to the image node\n */\nexport function loadImage(imgsrc: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const img = new Image;\n img.onload = () => {\n resolve(img);\n };\n img.onerror = reject;\n img.src = imgsrc;\n });\n}\n\n/** Load a JavaScript file and add it to the DOM\n * @param scriptsrc - The script source URL\n * @param module - Load as module\n * @returns A promise resolving to the script node\n */\nexport function loadScript(scriptsrc: string, { module = false } = {}): Promise<HTMLScriptElement> {\n return new Promise((resolve, reject) => {\n const scripttag = document.createElement('script');\n scripttag.onload = () => {\n resolve(scripttag);\n };\n scripttag.onerror = reject;\n scripttag.src = scriptsrc;\n if (module)\n scripttag.type = \"module\";\n\n document.querySelector('head,body')?.appendChild(scripttag);\n });\n}\n\n/** Load a CSS file and add it to the DOM\n * @param src - The CSS source URL\n * @returns A promise resolving to the link node\n*/\nexport function loadCSS(src: string): Promise<HTMLLinkElement> {\n const element = document.createElement('link');\n element.type = 'text/css';\n element.rel = 'stylesheet';\n element.href = src;\n\n const retval = new Promise<HTMLLinkElement>((resolve, reject) => {\n element.onload = () => resolve(element);\n element.onerror = reject;\n });\n\n document.querySelector('head,body')?.appendChild(element);\n return retval;\n}\n","/* Identify devices for the purpose of analytics/tracing\n NOT a library for feature detection!\n Originally based on Mootools.Browser\n*/\n\ntype Platform = \"windows\" | \"ios\" | \"webos\" | \"android\" | \"linux\" | \"mac\" | \"other\";\ntype Device = \"desktop\" | \"mobile\" | \"tablet\" | \"\";\n\n/** Valid KeyboardEvent.key values (next to 'plain' keys)\n This list was built from https://www.w3.org/TR/uievents-key/\n using `console.log([...new Set([...document.querySelectorAll(\".key-table-key .key\")].map(_ => _.textContent))].toSorted().join(' | '))`\n*/\nexport type KeyAttributeValue = \"AVRInput\" | \"AVRPower\" | \"Accept\" | \"Again\" | \"AllCandidates\" | \"Alphanumeric\" | \"Alt\" | \"AltGraph\" | \"AppSwitch\" | \"ArrowDown\" | \"ArrowLeft\" | \"ArrowRight\" | \"ArrowUp\" | \"Attn\" | \"AudioBalanceLeft\" | \"AudioBalanceRight\" | \"AudioBassBoostDown\" | \"AudioBassBoostToggle\" | \"AudioBassBoostUp\" | \"AudioFaderFront\" | \"AudioFaderRear\" | \"AudioSurroundModeNext\" | \"AudioTrebleDown\" | \"AudioTrebleUp\" | \"AudioVolumeDown\" | \"AudioVolumeMute\" | \"AudioVolumeUp\" | \"Backspace\" | \"BrightnessDown\" | \"BrightnessUp\" | \"BrowserBack\" | \"BrowserFavorites\" | \"BrowserForward\" | \"BrowserHome\" | \"BrowserRefresh\" | \"BrowserSearch\" | \"BrowserStop\" | \"Call\" | \"Camera\" | \"CameraFocus\" | \"Cancel\" | \"CapsLock\" | \"ChannelDown\" | \"ChannelUp\" | \"Clear\" | \"Close\" | \"ClosedCaptionToggle\" | \"CodeInput\" | \"ColorF0Red\" | \"ColorF1Green\" | \"ColorF2Yellow\" | \"ColorF3Blue\" | \"ColorF4Grey\" | \"ColorF5Brown\" | \"Compose\" | \"ContextMenu\" | \"Control\" | \"Convert\" | \"Copy\" | \"CrSel\" | \"Cut\" | \"DVR\" | \"Dead\" | \"Delete\" | \"Dimmer\" | \"DisplaySwap\" | \"Eisu\" | \"Eject\" | \"End\" | \"EndCall\" | \"Enter\" | \"EraseEof\" | \"Escape\" | \"ExSel\" | \"Execute\" | \"Exit\" | \"F1\" | \"F10\" | \"F11\" | \"F12\" | \"F2\" | \"F3\" | \"F4\" | \"F5\" | \"F6\" | \"F7\" | \"F8\" | \"F9\" | \"FavoriteClear0\" | \"FavoriteClear1\" | \"FavoriteClear2\" | \"FavoriteClear3\" | \"FavoriteRecall0\" | \"FavoriteRecall1\" | \"FavoriteRecall2\" | \"FavoriteRecall3\" | \"FavoriteStore0\" | \"FavoriteStore1\" | \"FavoriteStore2\" | \"FavoriteStore3\" | \"FinalMode\" | \"Find\" | \"Fn\" | \"FnLock\" | \"GoBack\" | \"GoHome\" | \"GroupFirst\" | \"GroupLast\" | \"GroupNext\" | \"GroupPrevious\" | \"Guide\" | \"GuideNextDay\" | \"GuidePreviousDay\" | \"HangulMode\" | \"HanjaMode\" | \"Hankaku\" | \"HeadsetHook\" | \"Help\" | \"Hibernate\" | \"Hiragana\" | \"HiraganaKatakana\" | \"Home\" | \"Hyper\" | \"Info\" | \"Insert\" | \"InstantReplay\" | \"JunjaMode\" | \"KanaMode\" | \"KanjiMode\" | \"Katakana\" | \"Key11\" | \"Key12\" | \"LastNumberRedial\" | \"LaunchApplication1\" | \"LaunchApplication2\" | \"LaunchCalendar\" | \"LaunchContacts\" | \"LaunchMail\" | \"LaunchMediaPlayer\" | \"LaunchMusicPlayer\" | \"LaunchPhone\" | \"LaunchScreenSaver\" | \"LaunchSpreadsheet\" | \"LaunchWebBrowser\" | \"LaunchWebCam\" | \"LaunchWordProcessor\" | \"Link\" | \"ListProgram\" | \"LiveContent\" | \"Lock\" | \"LogOff\" | \"MailForward\" | \"MailReply\" | \"MailSend\" | \"MannerMode\" | \"MediaApps\" | \"MediaAudioTrack\" | \"MediaClose\" | \"MediaFastForward\" | \"MediaLast\" | \"MediaNextTrack\" | \"MediaPause\" | \"MediaPlay\" | \"MediaPlayPause\" | \"MediaPreviousTrack\" | \"MediaRecord\" | \"MediaRewind\" | \"MediaSkipBackward\" | \"MediaSkipForward\" | \"MediaStepBackward\" | \"MediaStepForward\" | \"MediaStop\" | \"MediaTopMenu\" | \"MediaTrackNext\" | \"MediaTrackPrevious\" | \"Meta\" | \"MicrophoneToggle\" | \"MicrophoneVolumeDown\" | \"MicrophoneVolumeMute\" | \"MicrophoneVolumeUp\" | \"ModeChange\" | \"NavigateIn\" | \"NavigateNext\" | \"NavigateOut\" | \"NavigatePrevious\" | \"New\" | \"NextCandidate\" | \"NextFavoriteChannel\" | \"NextUserProfile\" | \"NonConvert\" | \"Notification\" | \"NumLock\" | \"OnDemand\" | \"Open\" | \"PageDown\" | \"PageUp\" | \"Pairing\" | \"Paste\" | \"Pause\" | \"PinPDown\" | \"PinPMove\" | \"PinPToggle\" | \"PinPUp\" | \"Play\" | \"PlaySpeedDown\" | \"PlaySpeedReset\" | \"PlaySpeedUp\" | \"Power\" | \"PowerOff\" | \"PreviousCandidate\" | \"Print\" | \"PrintScreen\" | \"Process\" | \"Props\" | \"RandomToggle\" | \"RcLowBattery\" | \"RecordSpeedNext\" | \"Redo\" | \"RfBypass\" | \"Romaji\" | \"STBInput\" | \"STBPower\" | \"Save\" | \"ScanChannelsToggle\" | \"ScreenModeNext\" | \"ScrollLock\" | \"Select\" | \"Settings\" | \"Shift\" | \"SingleCandidate\" | \"Soft1\" | \"Soft2\" | \"Soft3\" | \"Soft4\" | \"SpeechCorrectionList\" | \"SpeechInputToggle\" | \"SpellCheck\" | \"SplitScreenToggle\" | \"Standby\" | \"Subtitle\" | \"Super\" | \"Symbol\" | \"SymbolLock\" | \"TV\" | \"TV3DMode\" | \"TVAntennaCable\" | \"TVAudioDescription\" | \"TVAudioDescriptionMixDown\" | \"TVAudioDescriptionMixUp\" | \"TVContentsMenu\" | \"TVDataService\" | \"TVInput\" | \"TVInputComponent1\" | \"TVInputComponent2\" | \"TVInputComposite1\" | \"TVInputComposite2\" | \"TVInputHDMI1\" | \"TVInputHDMI2\" | \"TVInputHDMI3\" | \"TVInputHDMI4\" | \"TVInputVGA1\" | \"TVMediaContext\" | \"TVNetwork\" | \"TVNumberEntry\" | \"TVPower\" | \"TVRadioService\" | \"TVSatellite\" | \"TVSatelliteBS\" | \"TVSatelliteCS\" | \"TVSatelliteToggle\" | \"TVTerrestrialAnalog\" | \"TVTerrestrialDigital\" | \"TVTimer\" | \"Tab\" | \"Teletext\" | \"Undo\" | \"Unidentified\" | \"VideoModeNext\" | \"VoiceDial\" | \"WakeUp\" | \"Wink\" | \"Zenkaku\" | \"ZenkakuHankaku\" | \"ZoomIn\" | \"ZoomOut\" | \"ZoomToggle\";\n\nexport type UserAgentInfo =\n {\n /** Browser name, eg 'chrome' or 'firefox' */\n name: string;\n /** Browser numeric version (eg 97) */\n version: number;\n /** Platform the browser is running on (eg 'windows') */\n platform: Platform;\n /** Type of device (eg 'desktop' or 'tablet' for an iPad) */\n device: Device;\n /** platform-browsername-version eg ios-safari-11 */\n triplet: string;\n };\n\nexport function parseUserAgent(ua: string): UserAgentInfo {\n ua = ua.toLowerCase();\n\n // chrome is included in the edge UA, so need to check for edge first, before checking if it's chrome.\n // safari is included in the miuibrowser UA, so need to check for miuibrowser first, before checking if it's safari.\n let UA: RegExpMatchArray | null = ua.match(/(edge|miuibrowser)[\\s/:]([\\w\\d.]+)/);\n if (!UA)\n UA = ua.match(/(opera|ie|firefox|chrome|trident|crios|version)[\\s/:]([\\w\\d.]+)?.*?(safari|(?:rv[\\s/:]|version[\\s/:])([\\w\\d.]+)|$)/);\n if (!UA) { //try ios 11.4.1\n UA = ua.match(/; cpu os ([\\d]+)/);\n if (UA)\n UA = ['', 'safari', UA[1]];\n }\n if (!UA)\n UA = ['', 'unknown', \"0\"];\n\n if (UA[1] === 'trident') {\n UA[1] = 'ie';\n if (UA[4]) UA[2] = UA[4];\n } else if (UA[1] === 'crios') {\n UA[1] = 'chrome';\n }\n\n let platform = ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match(/(?:webos|android)/) || ua.match(/mac|win|linux/) || ['other'])[0];\n if (platform === 'win')\n platform = 'windows';\n\n const name = (UA[1] === 'version') ? UA[3] : UA[1];\n const version = parseInt((UA[1] === 'opera' && UA[4]) ? UA[4] : UA[2]);\n const device = ua.match(/ipad/) ? 'tablet' : ['ios', 'webos', 'android'].includes(platform) ? 'mobile' : ['mac', 'windows', 'linux'].includes(platform) ? 'desktop' : '';\n\n return {\n name,\n version,\n platform: platform as Platform,\n device,\n triplet: platform + '-' + name + '-' + version\n };\n}\n\n/**\n * Is the native 'multiselect' modifier for this platform pressed? (Cmd for Mac, Ctrl for Windows/Linux)\n *\n * @param event - Event to check\n */\nexport function isMultiSelectKey(event: KeyboardEvent): boolean {\n return browser.platform === 'mac' ? event.metaKey : event.ctrlKey;\n}\n\n/**\n * Is the native 'copy' modifier for this platform pressed?\n *\n * @param event - Event to check\n */\nexport function isCopyKey(event: KeyboardEvent): boolean {\n return browser.platform === 'mac' ? event.altKey : event.ctrlKey;\n}\n\n/** @deprecated Use getBrowser() instead, available since WH5.6.3. We will remove `browser` in the future to improve tree shaking */\nexport const browser: Readonly<UserAgentInfo> = Object.freeze(parseUserAgent(globalThis.navigator?.userAgent || \"\"));\n\n/** Get browser information */\nexport function getBrowser(): Readonly<UserAgentInfo> {\n //Offer this as a function to improve treeshakability\n return browser;\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/dompack\" {\n}\n\n/* This is our public api */\nexport { flagUIBusy, setupBusyModal } from './impl/busy';\nexport type { UIBusyLock, BusyModalEvent } from './impl/busy';\nexport { dispatchCustomEvent, dispatchDomEvent, fireModifiedEvents, changeValue, stop, addDocEventListener, EventListenerSet } from '../../modules/system/js/dompack/src/events';\nexport type { AddDocEventListenerOptions, DocEvent, DomEventOptions } from '../../modules/system/js/dompack/src/events';\nexport { qS, qR, qSA, isFormControl, isElement, isHTMLElement, getRelativeBounds } from './impl/tree';\nexport type { FormControlElement, Rect } from './impl/tree';\nexport { isDomReady, onDomReady } from '../../modules/system/js/dompack/src/tree';\nexport { create, jsxcreate, jsxfragment } from '../../modules/system/js/dompack/src/create';\nexport { focus, register, registerMissed } from '../../modules/system/js/dompack/src/components';\nexport type { TakeFocusEvent } from '../../modules/system/js/dompack/src/components';\nexport { getLocal, setLocal, getSession, setSession, isIsolated as isStorageIsolated, isStorageAvailable, listCookies, getCookie, setCookie, deleteCookie } from './impl/storage';\nexport { loadImage, loadScript, loadCSS } from \"./impl/preload\";\nexport { browser, getBrowser, isMultiSelectKey, isCopyKey, type KeyAttributeValue } from './impl/browser';\n\n/** @deprecated As 'Lock' conflicts, in WH5.4+ you can safely switch to UIBusyLock */\nimport { type UIBusyLock } from './impl/busy';\nexport type Lock = UIBusyLock;\n","/* This is our public api. Any direct inclusions from src/.... not mentioned here are not a stable API\n*/\n\nexport { createDeferred } from '@webhare/std';\nexport { flagUIBusy, getRelativeBounds, type Rect } from '@webhare/dompack';\nexport {\n dispatchCustomEvent, dispatchDomEvent, fireModifiedEvents, changeValue, normalizeKeyboardEventData,\n stop\n} from './src/events';\nexport {\n qS, qSA, contains, closest, matches,\n empty, isDomReady, onDomReady, getJSONAttribute,\n before, after, replaceWith, remove, prepend, append,\n toggleClass, toggleClasses,\n setStyles,\n getBaseURI,\n} from './src/tree';\nexport { create, jsxcreate, jsxfragment } from './src/create';\nexport { focus, register, registerMissed, scrollIntoView } from './src/components';\nexport type { TakeFocusEvent } from './src/components';\n\nimport { debugFlags } from \"@webhare/env\";\n\n/** @deprecated You should use debugFlags from \\@webhare/env */\nexport const debugflags = debugFlags;\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function() {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n\n function _getter(p) {\n return function() {\n return this[p];\n };\n }\n\n var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];\n var numericProps = ['columnNumber', 'lineNumber'];\n var stringProps = ['fileName', 'functionName', 'source'];\n var arrayProps = ['args'];\n var objectProps = ['evalOrigin'];\n\n var props = booleanProps.concat(numericProps, stringProps, arrayProps, objectProps);\n\n function StackFrame(obj) {\n if (!obj) return;\n for (var i = 0; i < props.length; i++) {\n if (obj[props[i]] !== undefined) {\n this['set' + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n\n StackFrame.prototype = {\n getArgs: function() {\n return this.args;\n },\n setArgs: function(v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n getEvalOrigin: function() {\n return this.evalOrigin;\n },\n setEvalOrigin: function(v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError('Eval Origin must be an Object or StackFrame');\n }\n },\n\n toString: function() {\n var fileName = this.getFileName() || '';\n var lineNumber = this.getLineNumber() || '';\n var columnNumber = this.getColumnNumber() || '';\n var functionName = this.getFunctionName() || '';\n if (this.getIsEval()) {\n if (fileName) {\n return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return '[eval]:' + lineNumber + ':' + columnNumber;\n }\n if (functionName) {\n return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return fileName + ':' + lineNumber + ':' + columnNumber;\n }\n };\n\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf('(');\n var argsEndIndex = str.lastIndexOf(')');\n\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');\n var locationString = str.substring(argsEndIndex + 1);\n\n if (locationString.indexOf('@') === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, '');\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype['set' + _capitalize(booleanProps[i])] = (function(p) {\n return function(v) {\n this[p] = Boolean(v);\n };\n })(booleanProps[i]);\n }\n\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype['set' + _capitalize(numericProps[j])] = (function(p) {\n return function(v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + ' must be a Number');\n }\n this[p] = Number(v);\n };\n })(numericProps[j]);\n }\n\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype['set' + _capitalize(stringProps[k])] = (function(p) {\n return function(v) {\n this[p] = String(v);\n };\n })(stringProps[k]);\n }\n\n return StackFrame;\n}));\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(,.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').replace(/^.*?\\s+/, '');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\(.+\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n\n // if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine\n // because this line doesn't have function name\n var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);\n var functionName = location && sanitizedLine || undefined;\n var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(/<anonymous function(: (\\w+))?>/, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n}));\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stack-generator', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.StackGenerator = factory(root.StackFrame);\n }\n}(this, function(StackFrame) {\n return {\n backtrace: function StackGenerator$$backtrace(opts) {\n var stack = [];\n var maxStackSize = 10;\n\n if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {\n maxStackSize = opts.maxStackSize;\n }\n\n var curr = arguments.callee;\n while (curr && stack.length < maxStackSize && curr['arguments']) {\n // Allow V8 optimizations\n var args = new Array(curr['arguments'].length);\n for (var i = 0; i < args.length; ++i) {\n args[i] = curr['arguments'][i];\n }\n if (/function(?:\\s+([\\w$]+))+\\s*\\(/.test(curr.toString())) {\n stack.push(new StackFrame({functionName: RegExp.$1 || undefined, args: args}));\n } else {\n stack.push(new StackFrame({args: args}));\n }\n\n try {\n curr = curr.caller;\n } catch (e) {\n break;\n }\n }\n return stack;\n }\n };\n}));\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = util.toSetString(aStr);\n var isDuplicate = has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n this._set[sStr] = idx;\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap)\n : new BasicSourceMapConsumer(sourceMap);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n if (source != null && sourceRoot != null) {\n source = util.join(sourceRoot, source);\n }\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: Optional. the column number in the original source.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n if (this.sourceRoot != null) {\n needle.source = util.relative(this.sourceRoot, needle.source);\n }\n if (!this._sources.has(needle.source)) {\n return [];\n }\n needle.source = this._sources.indexOf(needle.source);\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The only parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._sources.toArray().map(function (s) {\n return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;\n }, this);\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n if (this.sourceRoot != null) {\n source = util.join(this.sourceRoot, source);\n }\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n if (this.sourceRoot != null) {\n aSource = util.relative(this.sourceRoot, aSource);\n }\n\n if (this._sources.has(aSource)) {\n return this.sourcesContent[this._sources.indexOf(aSource)];\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + aSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n if (this.sourceRoot != null) {\n source = util.relative(this.sourceRoot, source);\n }\n if (!this._sources.has(source)) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n source = this._sources.indexOf(source);\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The only parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'))\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n if (section.consumer.sourceRoot !== null) {\n source = util.join(section.consumer.sourceRoot, source);\n }\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stacktrace-gps', ['source-map', 'stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('source-map/lib/source-map-consumer'), require('stackframe'));\n } else {\n root.StackTraceGPS = factory(root.SourceMap || root.sourceMap, root.StackFrame);\n }\n}(this, function(SourceMap, StackFrame) {\n 'use strict';\n\n /**\n * Make a X-Domain request to url and callback.\n *\n * @param {String} url\n * @returns {Promise} with response text if fulfilled\n */\n function _xdr(url) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.open('get', url);\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if ((req.status >= 200 && req.status < 300) ||\n (url.substr(0, 7) === 'file://' && req.responseText)) {\n resolve(req.responseText);\n } else {\n reject(new Error('HTTP status: ' + req.status + ' retrieving ' + url));\n }\n }\n };\n req.send();\n });\n\n }\n\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== 'undefined' && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error('You must supply a polyfill for window.atob in this environment');\n }\n }\n\n function _parseJson(string) {\n if (typeof JSON !== 'undefined' && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error('You must supply a polyfill for JSON.parse in this environment');\n }\n }\n\n function _findFunctionName(source, lineNumber/*, columnNumber*/) {\n var syntaxes = [\n // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/,\n // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/,\n // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/,\n // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/,\n // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/\n ];\n var lines = source.split('\\n');\n\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = '';\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf('//');\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== 'function' || typeof Object.create !== 'function') {\n throw new Error('Unable to consume source maps in older browsers');\n }\n }\n\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== 'object') {\n throw new TypeError('Given StackFrame is not an object');\n } else if (typeof stackframe.fileName !== 'string') {\n throw new TypeError('Given file name is not a String');\n } else if (typeof stackframe.lineNumber !== 'number' ||\n stackframe.lineNumber % 1 !== 0 ||\n stackframe.lineNumber < 1) {\n throw new TypeError('Given line number must be a positive integer');\n } else if (typeof stackframe.columnNumber !== 'number' ||\n stackframe.columnNumber % 1 !== 0 ||\n stackframe.columnNumber < 0) {\n throw new TypeError('Given column number must be a non-negative integer');\n }\n return true;\n }\n\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/mg;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n // eslint-disable-next-line no-cond-assign\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error('sourceMappingURL not found');\n }\n }\n\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function(resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n\n resolve(\n // given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error('Could not get original source for given stackframe and source map'));\n }\n });\n }\n\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n\n this.ajax = opts.ajax || _xdr;\n\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function(resolve, reject) {\n var isDataUrl = location.substr(0, 5) === 'data:';\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error('Cannot make network requests in offline mode'));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp =\n /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error('The encoding of the inline sourcemap is not supported'));\n }\n } else {\n var xhrPromise = this.ajax(location, {method: 'get'});\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function(resolve) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function(resolve, reject) {\n return this._get(sourceMappingURL).then(function(sourceMapSource) {\n if (typeof sourceMapSource === 'string') {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, ''));\n }\n if (typeof sourceMapSource.sourceRoot === 'undefined') {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }).catch(reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function(resolve, reject) {\n this.getMappedLocation(stackframe).then(function(mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n\n this.findFunctionName(mappedStackFrame)\n .then(resolve, resolveMappedStackFrame)\n // eslint-disable-next-line no-unexpected-multiline\n ['catch'](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)['catch'](reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function(source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === 'data:';\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf('/') + 1);\n\n if (sourceMappingURL[0] !== '/' && !isDataUrl && !(/^https?:\\/\\/|^\\/\\//i).test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot)\n .then(function(sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)\n .then(resolve)['catch'](function() {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)['catch'](reject);\n }.bind(this));\n };\n };\n}));\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stacktrace', ['error-stack-parser', 'stack-generator', 'stacktrace-gps'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('error-stack-parser'), require('stack-generator'), require('stacktrace-gps'));\n } else {\n root.StackTrace = factory(root.ErrorStackParser, root.StackGenerator, root.StackTraceGPS);\n }\n}(this, function StackTrace(ErrorStackParser, StackGenerator, StackTraceGPS) {\n var _options = {\n filter: function(stackframe) {\n // Filter out stackframes for this library by default\n return (stackframe.functionName || '').indexOf('StackTrace$$') === -1 &&\n (stackframe.functionName || '').indexOf('ErrorStackParser$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackTraceGPS$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackGenerator$$') === -1;\n },\n sourceCache: {}\n };\n\n var _generateError = function StackTrace$$GenerateError() {\n try {\n // Error must be thrown to get stack in IE\n throw new Error();\n } catch (err) {\n return err;\n }\n };\n\n /**\n * Merge 2 given Objects. If a conflict occurs the second object wins.\n * Does not do deep merges.\n *\n * @param {Object} first base object\n * @param {Object} second overrides\n * @returns {Object} merged first and second\n * @private\n */\n function _merge(first, second) {\n var target = {};\n\n [first, second].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n return target;\n });\n\n return target;\n }\n\n function _isShapedLikeParsableError(err) {\n return err.stack || err['opera#sourceloc'];\n }\n\n function _filtered(stackframes, filter) {\n if (typeof filter === 'function') {\n return stackframes.filter(filter);\n }\n return stackframes;\n }\n\n return {\n /**\n * Get a backtrace from invocation point.\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n get: function StackTrace$$get(opts) {\n var err = _generateError();\n return _isShapedLikeParsableError(err) ? this.fromError(err, opts) : this.generateArtificially(opts);\n },\n\n /**\n * Get a backtrace from invocation point.\n * IMPORTANT: Does not handle source maps or guess function names!\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n getSync: function StackTrace$$getSync(opts) {\n opts = _merge(_options, opts);\n var err = _generateError();\n var stack = _isShapedLikeParsableError(err) ? ErrorStackParser.parse(err) : StackGenerator.backtrace(opts);\n return _filtered(stack, opts.filter);\n },\n\n /**\n * Given an error object, parse it.\n *\n * @param {Error} error object\n * @param {Object} opts\n * @returns {Promise} for Array[StackFrame}\n */\n fromError: function StackTrace$$fromError(error, opts) {\n opts = _merge(_options, opts);\n var gps = new StackTraceGPS(opts);\n return new Promise(function(resolve) {\n var stackframes = _filtered(ErrorStackParser.parse(error), opts.filter);\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n }.bind(this));\n },\n\n /**\n * Use StackGenerator to generate a backtrace.\n *\n * @param {Object} opts\n * @returns {Promise} of Array[StackFrame]\n */\n generateArtificially: function StackTrace$$generateArtificially(opts) {\n opts = _merge(_options, opts);\n var stackFrames = StackGenerator.backtrace(opts);\n if (typeof opts.filter === 'function') {\n stackFrames = stackFrames.filter(opts.filter);\n }\n return Promise.resolve(stackFrames);\n },\n\n /**\n * Given a function, wrap it such that invocations trigger a callback that\n * is called with a stack trace.\n *\n * @param {Function} fn to be instrumented\n * @param {Function} callback function to call with a stack trace on invocation\n * @param {Function} errback optional function to call with error if unable to get stack trace.\n * @param {Object} thisArg optional context object (e.g. window)\n */\n instrument: function StackTrace$$instrument(fn, callback, errback, thisArg) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n // Already instrumented, return given Function\n return fn;\n }\n\n var instrumented = function StackTrace$$instrumented() {\n try {\n this.get().then(callback, errback)['catch'](errback);\n return fn.apply(thisArg || this, arguments);\n } catch (e) {\n if (_isShapedLikeParsableError(e)) {\n this.fromError(e).then(callback, errback)['catch'](errback);\n }\n throw e;\n }\n }.bind(this);\n instrumented.__stacktraceOriginalFn = fn;\n\n return instrumented;\n },\n\n /**\n * Given a function that has been instrumented,\n * revert the function to it's original (non-instrumented) state.\n *\n * @param {Function} fn to de-instrument\n */\n deinstrument: function StackTrace$$deinstrument(fn) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot de-instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n return fn.__stacktraceOriginalFn;\n } else {\n // Function not instrumented, return original\n return fn;\n }\n },\n\n /**\n * Given an error message and Array of StackFrames, serialize and POST to given URL.\n *\n * @param {Array} stackframes\n * @param {String} url\n * @param {String} errorMsg\n * @param {Object} requestOptions\n */\n report: function StackTrace$$report(stackframes, url, errorMsg, requestOptions) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if (req.status >= 200 && req.status < 400) {\n resolve(req.responseText);\n } else {\n reject(new Error('POST to ' + url + ' failed with status: ' + req.status));\n }\n }\n };\n req.open('post', url);\n\n // Set request headers\n req.setRequestHeader('Content-Type', 'application/json');\n if (requestOptions && typeof requestOptions.headers === 'object') {\n var headers = requestOptions.headers;\n for (var header in headers) {\n if (Object.prototype.hasOwnProperty.call(headers, header)) {\n req.setRequestHeader(header, headers[header]);\n }\n }\n }\n\n var reportPayload = {stack: stackframes};\n if (errorMsg !== undefined && errorMsg !== null) {\n reportPayload.message = errorMsg;\n }\n\n req.send(JSON.stringify(reportPayload));\n });\n }\n };\n}));\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","/* eslint-disable */\n/// @ts-nocheck -- Bulk rename to enable TypeScript validation\n\nimport * as dompack from 'dompack';\nconst EventEmitter = require('events');\n\nclass InternetRequester extends EventEmitter {\n constructor(options) {\n super();\n if (!options)\n options = {};\n //Host url of event server\n this.options = {\n url: options.url || '',\n log: Boolean(options.log || dompack.debugflags.rpc),\n withcredentials: 'withCredentials' in options && options.withcredentials\n };\n\n // XMLHttpRequest\n this.conn = null;\n\n // used for estimating the server date\n this.__date_server = null;\n this.__date_client = null;\n this.__date_diff = null;\n }\n\n destroy() {\n this.stopCurrentRequest();\n this.conn = null;\n }\n\n stopCurrentRequest() {\n if (this.conn) {\n this.conn.onreadystatechange = null;\n this.conn.onloadend = null;\n\n this.conn.abort();\n }\n if (this.jsoncheckinterval) {\n clearTimeout(this.jsoncheckinterval);\n this.jsoncheckinterval = null;\n }\n }\n\n ensureConnection() {\n if (!this.conn)\n this.conn = new XMLHttpRequest();\n }\n\n startXMLHTTPRequest(method, url, body, options) {\n this.ensureConnection();\n\n const async = !options || !options.synchronous;\n\n // Because aborting the connection may result in a readystatechange event (yes, we're looking at you, Titanium's\n // TiNetworkHTTPClient...), we have to reset the have_response flag _after_ aborting the connection, so the response for\n // the previous request isn't used for the new request\n\n this.laststateevent = null; //make sure we don't accidentally cancel the previous request\n this.conn.abort();\n this.have_response = false;\n\n this.conn.open(method.toUpperCase(), url, async);\n if (options && options.headers)\n Object.keys(options.headers).forEach(key => { this.conn.setRequestHeader(key, options.headers[key]); });\n\n if (this.options.withcredentials)\n this.conn.withCredentials = true;\n\n this.conn.onreadystatechange = this.onStateChange.bind(this);\n // Required for Firefox 12 (+firebug?), without it statechange to 4 doesn't seem to be fired sometimes\n this.conn.onloadend = this.onStateChange.bind(this);\n this.conn.onabort = this.onAbort.bind(this);\n\n this.emit(\"requeststart\", { target: this });\n this.conn.send(body);\n\n if (!async)\n this.onStateChange();\n }\n\n onAbort(event) {\n if (this.laststateevent)\n this.laststateevent.isaborted = true;\n }\n\n onStateChange(event) {\n if (this.conn.readyState !== 4 || this.have_response)\n return;\n\n this.have_response = true;\n\n const datestr = this.conn.getResponseHeader(\"date\");\n if (datestr !== \"\") {\n const parseddate = Date.parse(datestr);\n this.__date_server = parseddate;\n this.__date_client = new Date();\n this.__date_diff = this.__date_server - this.__date_client;\n }\n\n const evt = {\n target: this,\n success: this.conn.status === 200,\n internalerror: this.conn.status === 500,\n message: this.conn.status,\n\n responsetext: this.conn.responseText,\n responsejson: null\n };\n\n //FIXME only decode JSON data if the mimetype specified it was JSON, and then log any errors\n try {\n evt.responsejson = JSON.parse(evt.responsetext);\n } catch (e) {\n }\n\n this.laststateevent = evt;\n this.emit(\"requestend\", evt);\n }\n}\n\nmodule.exports = InternetRequester;\n","/* eslint-disable */\n/// @ts-nocheck -- Bulk rename to enable TypeScript validation\n\n/** @require: var JSONRPC = require('@mod-system/js/net/jsonrpc')\n*/\nconst InternetRequester = require('./requester');\nimport { isLive } from \"@webhare/env\";\nimport * as dompack from 'dompack';\n\nconst rpcscriptid = Math.floor(Math.random() * 1000);\n\nclass JSONRPC extends InternetRequester {\n /** @short RPC status codes (defined as getter-only properties as long as we don't have static const properties) */\n static get HTTP_ERROR() { return -1; } // Error connecting to the RPC server\n static get JSON_ERROR() { return -2; } // The returned value could not be decoded into a JSON object\n static get PROTOCOL_ERROR() { return -3; } // The return object did not contain an id, or the id did not match the request id\n static get RPC_ERROR() { return -4; } // The RPC returned an error\n static get OFFLINE_ERROR() { return -5; } // The application is not online (only returned if the onlineonly option was set)\n static get TIMEOUT_ERROR() { return -6; } // The request could not be sent or was not answered before within the timeout set in the options\n static get SERVER_ERROR() { return -7; } // The server encountered an internal error\n\n constructor(options) {\n super(options);\n if (!options)\n options = {};\n\n this.lastid = 0;\n this.requestqueue = [];\n this.cachecounter = 0;\n this.activerequest = null;\n this.haveresponse = false;\n //timeout after which we trigger a 'wait' action, eg a spinner\n this.options.waittimeout = 'waittimeout' in options ? options.waittimeout : 500;\n this.options.appendfunctionname = 'appendfunctionname' in options ? options.appendfunctionname : false;\n this.waitcallback = null;\n this.waittimeoutid = null;\n this.waitingnow = false;\n\n this.on(\"requestend\", this.onResponse.bind(this));\n }\n\n destroy() {\n super.destroy();\n this.requestqueue = [];\n this.activerequest = null;\n\n if (this.waittimeoutid) {\n clearTimeout(this.waittimeoutid);\n this.waittimeoutid = null;\n }\n }\n\n promiseRequest(method, params, options) {\n const deferred = Promise.withResolvers();\n const req = this.request(method, params, deferred.resolve, (errorcode, errormsg, rpcid) => { deferred.reject(new Error(errormsg)); }, options);\n deferred.promise.__jsonrpcinfo = { deferred, req };\n return deferred.promise;\n }\n async(method, ...params) {\n return this.promiseRequest(method, params);\n }\n\n _doAsyncAbort(promise, result, rejection) {\n if (!promise.__jsonrpcinfo)\n throw new Error(\"The promise is not an async JSONRPC request\");\n if (!rejection)\n promise.__jsonrpcinfo.deferred.resolve(result);\n else\n promise.__jsonrpcinfo.deferred.reject(rejection);\n promise.__jsonrpcinfo.req.cancel();\n }\n\n rpcResolve(promise, result) {\n this._doAsyncAbort(promise, result);\n }\n rpcReject(promise, rejection) {\n this._doAsyncAbort(promise, null, rejection);\n }\n\n\n /**\n * @short Queue an RPC request\n * @param method The RPC method to call\n * @param params Params for the RPC method\n * @param callback The callback which is called, with:\n * param status A JSONRPC. value\n * param result The result object as sent by the RPC, or an error message string sent by the RPC, or an error\n * message\n * param id The request id\n * @param options Options\n * @param options.url The URL to connect to\n * @param options.timeout Timeout in ms after which the request will fail (callback is called with ERROR_TIMEOUT error)\n * @param options.waittimeout Timeout in ms after which the request will set waiting status to TRUE (via the waitCallback)\n * Set negative to not trigger waiting status.\n * @return The request id\n */\n request(method, params, onsuccess, onfailure, options) {\n if (!params || typeof params !== \"object\" || params.length === undefined)\n throw new Error(\"The parameters passed to request must be an Array\");\n\n const id = ++this.lastid;\n\n let url;\n if (options && options.url)\n url = options.url + (options.appendfunctionname ? (options.url.match(/\\/$/) ? '' : '/') + method : '');\n else if (this.options.url)\n url = this.options.url + (this.options.appendfunctionname ? (this.options.url.match(/\\/$/) ? '' : '/') + method : '');\n else\n url = location.href; //we do not support appendfunctionname for self-posts\n\n const timeout = Math.max((options && typeof options.timeout === \"number\") ? options.timeout : 0, 0);\n const waittimeout = (options && typeof options.waittimeout === \"number\") ? options.waittimeout : this.options.waittimeout;\n const synchronous = options && options.synchronous || false;\n const errortrace = options && options.errortrace || null;\n\n if (this.options.log)\n console.log(\"JSONRPC request\", method, params, options, 'timeout:', timeout, 'waitTimeout:', waittimeout);\n\n const request = new Request(this, id, method, params, url, timeout, waittimeout, onsuccess, onfailure, synchronous, errortrace);\n if (this.options.log || !isLive)\n request.stack = new Error().stack;\n\n this.requestqueue.push(request);\n if (this.options.log)\n console.log(\"JSONRPC request is on queue\");\n this.processNextRequest();\n return request;\n }\n\n handleError(onfailure, errorcode, errormsg, rpcid) {\n if (onfailure)\n setTimeout(() => onfailure(errorcode, errormsg, rpcid), 0);\n\n setTimeout(() => this.emit([\"error\", { target: this, errorcode: errorcode, errormessage: errormsg, rpcid: rpcid }]), 0);\n }\n\n //is a json request pending?\n isRequestPending() {\n return this.activerequest !== null || this.requestqueue.length;\n }\n\n //ADDME is it possible for the 'next' response to already be .delay/setTimeout() scheduled, racing against our cancel ?\n __cancelRequest(id) {\n if (typeof id !== 'number')\n return;\n\n if (this.activerequest === id) {\n this.stopCurrentRequest();\n this.activerequest = null;\n\n const request = this.requestqueue.shift();\n if (request.timeout && typeof request.timeout !== \"boolean\")\n clearTimeout(request.timeout);\n\n this.processNextRequest();\n } else {\n for (let i = 0; i < this.requestqueue.length; ++i)\n if (this.requestqueue[i].id === id) {\n this.requestqueue.splice(i, 1);\n break;\n }\n }\n }\n\n processNextRequest() {\n if (this.activerequest) {\n if (this.options.log)\n console.log(\"JSONRPC request #\" + this.activerequest + \" pending, not scheduling a new one yet\");\n this.handleWaitTimeouts();\n return;\n }\n\n let request = null;\n while (!request) {\n request = this.requestqueue[0];\n if (!request) {\n if (this.options.log)\n console.log(\"JSONRPC request - processNextRequest, queue is empty\");\n return;\n }\n if (request.timeout && typeof request.timeout === \"boolean\") {\n this.requestqueue = this.requestqueue.filter(el => el !== request);\n request = this.requestqueue[0];\n }\n }\n\n this.activerequest = request.id;\n\n if (request.timeout)\n request.timeout = setTimeout(() => this.onTimeout(request), request.timeout);\n\n if (this.options.log)\n console.log(\"JSONRPC request #\" + request.id + \" offering for XMLHTTP\");\n this.startXMLHTTPRequest(\n \"post\",\n request.url,\n JSON.stringify(request.request),\n {\n headers: { \"Content-Type\": \"application/json; charset=utf-8\" },\n synchronous: request.synchronous\n });\n this.handleWaitTimeouts();\n }\n\n onResponse(event) {\n this.activerequest = null;\n\n const request = this.requestqueue[0];\n if (!request)\n return;\n\n this.requestqueue = this.requestqueue.slice(1);\n\n if (request.timeout) {\n if (typeof request.timeout === \"boolean\") {\n this.processNextRequest();\n return;\n }\n clearTimeout(request.timeout);\n }\n\n let status = -1;\n let result = null;\n\n if (!event.success) {\n status = JSONRPC.HTTP_ERROR;\n result = \"HTTP Error: \" + event.message;\n\n if (event.internalerror) {\n let json = null;\n try {\n json = event.responsejson;\n let trace;\n if (json && json.error && json.error.data) {\n trace = json.error.data.trace || json.error.data.errors || json.error.data.list || [];\n\n console.group();\n const line = \"RPC #\" + rpcscriptid + \":\" + request.id + \" failed: \" + json.error.message;\n console.warn(line);\n if (request.errortrace)\n request.errortrace.push(line);\n trace.forEach(rec => {\n if (rec.filename || rec.line) {\n const line = rec.filename + '#' + rec.line + '#' + rec.col + (rec.func ? ' (' + rec.func + ')' : '');\n console.warn(line);\n if (request.errortrace)\n request.errortrace.push(line);\n }\n });\n console.groupEnd();\n }\n status = JSONRPC.SERVER_ERROR;\n result = json.error && `${json.error.message} from ${request.url}` || \"Unknown error\";\n } catch (e) {\n }\n }\n } else {\n const json = event.responsejson;\n\n if (!json) {\n status = JSONRPC.JSON_ERROR;\n result = \"Invalid JSON response\";\n } else if (json.id === null || json.id !== request.id) {\n status = JSONRPC.PROTOCOL_ERROR;\n result = \"Protocol error: invalid id\";\n } else if (json.error !== null) {\n status = JSONRPC.RPC_ERROR;\n result = json.error;\n if (this.options.log)\n console.log('RPC error:', result.message ? result.message : '*no message*');\n } else if (\"result\" in json) {\n status = 0;\n result = json.result;\n } else {\n status = JSONRPC.PROTOCOL_ERROR;\n result = \"Could not interpret response\";\n }\n }\n\n this.processNextRequest();\n\n if (this.options.log) {\n console.log(\"JSONRPC request\", request.request.method, 'status:', status, 'time:', (new Date).getTime() - request.scheduled, 'ms, result:');\n console.log(result);\n }\n\n /*\n console.log({ serverdate: this.__date_server\n , clientdate: this.__date_client\n , diff: this.__date_diff\n });\n */\n setTimeout(() => request.__completedCall(status, result, event), 0);\n }\n\n onTimeout(request) {\n request.timeout = true;\n if (this.activerequest === request.id) {\n this.activerequest = null;\n this.stopCurrentRequest();\n this.processNextRequest();\n }\n this.handleError(request.onfailure, JSONRPC.TIMEOUT_ERROR, \"Timeout while waiting for response\", request.id);\n }\n\n onWaitTimeout() {\n this.waittimeoutid = null;\n this.handleWaitTimeouts();\n }\n\n handleWaitTimeouts() {\n if (this.waittimeoutid) {\n clearTimeout(this.waittimeoutid);\n this.waittimeoutid = null;\n }\n\n if (!this.waitCallback)\n return;\n\n let waiting = false;\n let nextTimeout = -1;\n\n const now = (new Date).getTime();\n for (let i = 0; i < this.requestqueue.length; ++i) {\n const req = this.requestqueue[i];\n if (req.waitTimeout >= 0) {\n const waitLength = now - req.scheduled;\n\n if (waitLength >= req.waitTimeout)\n waiting = true;\n else {\n const toGo = req.waitTimeout - waitLength;\n if (nextTimeout < 0 || nextTimeout > toGo)\n nextTimeout = toGo;\n }\n }\n }\n\n if (this.waitingNow !== waiting) {\n this.waitingNow = waiting;\n setTimeout(() => this.waitCallback(waiting), 0);\n }\n\n if (nextTimeout >= 0)\n this.waittimeoutid = setTimeout(() => this.onWaitTimeout(), nextTimeout);\n }\n\n getEstimatedServerTime() {\n return new Date().getTime() + this.__date_diff;\n }\n\n /** @short estimate the server's datetime based on the known descrepancy between the date of an reponse from the server and the time on the client\n */\n getEstimatedServerDate() {\n return new Date(this.getEstimatedServerTime());\n }\n}\n\nclass Request //extends PreloadableAsset\n{\n constructor(parent, id, method, params, url, timeout, waittimeout, onsuccess, onfailure, synchronous, errortrace) {\n // super();\n\n this.cancelled = false;\n this.stack = null;\n\n if (parent.options.log)\n console.log('req', this);\n this.parent = parent;\n this.id = id;\n this.request = {\n id: id,\n method: method,\n params: params || []\n };\n this.url = url;\n this.onsuccess = onsuccess;\n this.onfailure = onfailure;\n this.timeout = timeout;\n this.scheduled = new Date - 0;\n this.waittimeout = waittimeout;\n this.synchronous = synchronous;\n this.errortrace = errortrace;\n\n //this.startPreload();\n }\n onStartPreload() {\n\n }\n cancel() {\n //we need to prevent a race when our parent invokes cancel(), but we actually had our __completedCall already queued up. if we still fire onsuccess/onfailure, our parent might think we completed the _next_ request our parent submitted\n this.cancelled = true;\n this.parent.__cancelRequest(this.id);\n }\n\n __completedCall(status, result, event) {\n if (event.isaborted)\n this.cancelled = true;\n\n if (status === 0) {\n if (this.onsuccess && !this.cancelled)\n this.onsuccess(result);\n //this.donePreload(true);\n } else {\n if (!this.cancelled) {\n if (this.stack) {\n console.log(\"Stack at calling point:\");\n console.log(this.stack);\n }\n this.parent.handleError(this.onfailure, status, result, this.id);\n }\n //this.donePreload(false);\n }\n }\n}\n\nmodule.exports = JSONRPC;\n","import type { GetTidHooks } from \"./types.js\";\n\nlet hookFactory: (() => GetTidHooks) | undefined;\nlet gotHooks = false;\n\nexport function setGetTidHooksFactory(newHookFactory: () => GetTidHooks) {\n if (gotHooks)\n throw new Error(`Hooks have already been retrieved`);\n hookFactory = newHookFactory;\n}\n\nexport function getGetTidHooks() {\n if (gotHooks)\n throw new Error(`Hooks cannot be retrieved twice`);\n gotHooks = true;\n return hookFactory?.();\n}\n","import { decodeString, encodeString } from '@webhare/std';\nimport type { CompiledLanguageFile, GetTidHooks, LanguagePart, LanguageText, RecursiveLanguageTexts, TidParam } from './types';\nimport { getGetTidHooks } from './hooks';\nimport { debugFlags, isLive } from '@webhare/env';\n\n\n\nlet hooks: GetTidHooks | undefined;\nlet browserSetLanguage = (\"document\" in globalThis && document?.documentElement?.lang?.substring(0, 2).toLowerCase()) || \"\";\nconst defaultLanguage = \"en\";\n\nfunction ensureHooks(): GetTidHooks {\n return hooks ??= getGetTidHooks?.() ?? {\n loader: null,\n currentLanguage: (lang) => {\n if (lang)\n browserSetLanguage = lang;\n return browserSetLanguage;\n }\n };\n}\n\nexport function getTidLanguage(): string {\n return ensureHooks().currentLanguage() || defaultLanguage;\n}\n\nexport function setTidLanguage(newLanguage: string): void {\n ensureHooks().currentLanguage(newLanguage.toLowerCase());\n}\n\nconst langFileCache: Record<string, CompiledLanguageFile> = {};\n\nfunction getLanguageFile(module: string, langCode: string): CompiledLanguageFile | undefined {\n const langkey = `${module}:${langCode}`;\n let compiled = langFileCache[langkey];\n if (!compiled || !compiled.resource) {\n const loader = ensureHooks().loader;\n if (loader) {\n try {\n compiled = loader(module, langCode, compiled?.registered ?? new Map);\n } catch (e) {\n // loading failed, erase the loaded texts (keep the registered texts, though)\n if (!isLive || debugFlags.gtd) {\n console.error(e);\n }\n const texts = compiled?.registered ?? new Map;\n compiled = { resource: \"\", fallbackLanguage: \"\", langCode, texts, registered: texts };\n }\n langFileCache[langkey] = compiled;\n }\n }\n if (!compiled && (isLive || debugFlags.gtd)) {\n console.warn(`No language texts found for module '${module}' and language '${langCode}'`);\n }\n return compiled;\n}\n\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed for generics\nexport type GetTidRenderFunc<Result extends object = object> = ((tag: keyof HTMLElementTagNameMap, props: { children?: any[]; href?: string }, ...childNodes: any[]) => Result);\nexport type GetTidOptions = { langCode?: string; render?: GetTidRenderFunc | \"fragment\" };\n\ntype GetTidArgumentTypes = [GetTidOptions?] | [TidParam[], GetTidOptions?] | [TidParam?, TidParam?, TidParam?, TidParam?];\n\nfunction toHTMLNode(tag: string, props: { href?: string; children?: Array<string | Node> }): Node {\n const node = document.createElement(tag);\n if (props.href)\n node.setAttribute(\"href\", props.href);\n if (props.children)\n node.append(...props.children);\n return node;\n}\n\nfunction wrapInFragment(children: Array<string | Node>): DocumentFragment {\n const fragment = document.createDocumentFragment();\n fragment.append(...children);\n return fragment;\n}\n\n\nfunction getTidInternal(tid: string, params: TidParam[], options?: GetTidOptions): string | Array<string | object> | DocumentFragment {\n if (tid === \"\") {\n return \"\";\n }\n\n if (tid.startsWith(\":\")) {\n return tid.substring(1);\n } else if (tid.startsWith(\"<>\")) {\n return decodeString(tid.substring(2), \"html\");\n }\n\n const langCode = options?.langCode?.toLowerCase() || getTidLanguage();\n if (options?.render) {\n if (options.render === \"fragment\") {\n const nodes = calcTIDForLanguage(langCode, tid, params, true, toHTMLNode) as Array<string | Node>;\n return wrapInFragment(nodes);\n }\n return calcTIDForLanguage(langCode, tid, params, true, options.render);\n } else\n return calcTIDForLanguage(langCode, tid, params, false, null).join(\"\");\n}\n\nexport function getTid(tid: string, options?: GetTidOptions & { render?: undefined }): string;\nexport function getTid<VNode extends object>(tid: string, options?: GetTidOptions & { render?: GetTidRenderFunc<VNode> }): string | Array<string | VNode>;\nexport function getTid(tid: string, options?: GetTidOptions & { render?: \"fragment\" }): DocumentFragment;\nexport function getTid(tid: string, param: TidParam[], options?: GetTidOptions & { render?: undefined }): string;\nexport function getTid<VNode extends object>(tid: string, param: TidParam[], options?: GetTidOptions & { render?: GetTidRenderFunc<VNode> }): string | Array<string | VNode>;\nexport function getTid(tid: string, param: TidParam[], options?: GetTidOptions & { render?: \"fragment\" }): DocumentFragment;\nexport function getTid(tid: string, p1?: TidParam, p2?: TidParam, p3?: TidParam, p4?: TidParam): string;\n\nexport function getTid(tid: string, ...p: GetTidArgumentTypes): string | Array<string | object> | DocumentFragment {\n if (Array.isArray(p[0])) // case: param: TidParam[], options?: GetTidOptions)\n return getTidInternal(tid, p[0], p[1] as GetTidOptions);\n if (p[0] && typeof p[0] === \"object\") // case: options: GetTidOptions\n return getTidInternal(tid, [], p[0]);\n return getTidInternal(tid, p as Array<TidParam | undefined>, {});\n}\n\nexport function getTidForLanguage(langCode: string, tid: string, p1: TidParam = null, p2: TidParam = null, p3: TidParam = null, p4: TidParam = null) {\n return getTidInternal(tid, [p1, p2, p3, p4], { langCode });\n}\n\nexport function getHTMLTid(tid: string, ...params: TidParam[]): string {\n return getHTMLTidForLanguage(getTidLanguage(), tid, ...params);\n}\n\nexport function getHTMLTidForLanguage(langCode: string, tid: string, ...params: TidParam[]): string {\n if (tid === \"\") {\n return \"\";\n }\n\n if (tid.startsWith(\":\")) {\n return encodeString(tid.substring(1), \"html\");\n } else if (tid.startsWith(\"<>\")) {\n return tid.substring(2);\n }\n\n return calcTIDForLanguage(langCode, tid, params, true, null).join(\"\");\n}\n\nexport function getTIDListForLanguage(langcode: string, gid: string) {\n gid = getCanonicalTid(gid.toLowerCase());\n langcode = langcode.toLowerCase();\n\n const modsep = gid.indexOf(':');\n if (modsep === -1) {\n if (isLive || debugFlags.gtd)\n console.warn(`Missing module name in call for gid '${gid}'`);\n return `(cannot find textnode: ${gid})`;\n }\n\n const module = gid.substring(0, modsep);\n const lookup = gid.substring(modsep + 1).replace(/ /g, \"_\") + \".\";\n\n const compiled = getLanguageFile(module, langcode);\n const result: string[] = [];\n if (compiled) {\n for (const key of compiled.texts.keys()) {\n if (key.startsWith(lookup) && key.indexOf(\".\", lookup.length) === -1)\n result.push(`${module}:${key}`);\n }\n if (compiled.fallbackLanguage) {\n const fallback = getLanguageFile(module, compiled.fallbackLanguage);\n if (fallback) {\n for (const key of fallback.texts.keys()) {\n if (key.startsWith(lookup) && key.indexOf(\".\", lookup.length) === -1 && !result.includes(`${module}:${key}`))\n result.push(`${module}:${key}`);\n }\n }\n }\n }\n\n return result;\n}\n\nfunction cannotFind(tid: string) {\n if (debugFlags.sut)\n return [tid.substring(tid.lastIndexOf(\".\"))];\n\n return [`(cannot find text: ${tid})`];\n}\nfunction calcTIDForLanguage(langcode: string, tid: string, rawParams: TidParam[], rich: boolean, render: null): string[];\nfunction calcTIDForLanguage(langcode: string, tid: string, rawParams: TidParam[], rich: boolean, render: GetTidRenderFunc): Array<string | object>;\n\n\nfunction calcTIDForLanguage(langcode: string, tid: string, rawParams: TidParam[], rich: boolean, render: GetTidRenderFunc | null): Array<string | object> {\n tid = getCanonicalTid(tid.toLowerCase());\n if (tid === \"tollium:tilde.locale.datetimestrings\") {\n return [getLanguageDatetimeStrings(langcode)];\n }\n\n // convert null to \"\", numbers to strings\n const params = rawParams.map(p => (typeof p === \"number\" ? p.toString() : (p ?? \"\")));\n\n const modsep = tid.indexOf(':');\n if (modsep === -1) {\n if (isLive || debugFlags.gtd)\n console.warn(`Missing module name in call for tid '${tid}'`);\n return [`(missing module name in tid: ${tid})`];\n }\n\n const module = tid.substring(0, modsep);\n const lookup = tid.substring(modsep + 1).replace(/ /g, \"_\");\n tid = `${module}:${lookup}`;\n\n if (langcode === \"debug\") {\n const debugtid = `{${[tid, ...params].join(\"|\")}}`;\n return [rich ? encodeString(debugtid, \"html\") : debugtid];\n }\n\n const compiled = getLanguageFile(module, langcode);\n const match = compiled?.texts.get(lookup);\n if (!match && compiled?.fallbackLanguage) {\n const fallback = getLanguageFile(module, compiled.fallbackLanguage);\n const fallbackMatch = fallback?.texts.get(lookup);\n if (!fallbackMatch && (!isLive || debugFlags.gtd)) {\n console.warn(`Cannot find text ${tid} for language ${langcode}, also tried fallback language '${compiled.fallbackLanguage}'`);\n }\n return fallbackMatch ? executeCompiledTidText(fallbackMatch, params, rich, render) : cannotFind(tid);\n }\n\n if (!match && (!isLive || debugFlags.gtd)) {\n console.warn(`Cannot find text ${tid} for language ${langcode}, no fallback language`);\n }\n return match ? executeCompiledTidText(match, params, rich, render) : cannotFind(tid);\n}\n\nfunction getCanonicalTid(tid: string) {\n if (tid.startsWith(\"tollium:common.buttons.\") || tid.startsWith(\"tollium:common.actions.\") || tid.startsWith(\"tollium:common.labels.\")) {\n return `tollium:tilde.${tid.substring(tid.indexOf(\".\") + 1)}`;\n } else if (tid.startsWith(\"~\")) {\n return `tollium:tilde.${tid.substring(1)}`;\n }\n\n return tid;\n}\n\nfunction renderString(tok: string, rich: boolean, render: GetTidRenderFunc | null) {\n return rich ?\n render ?\n tok.split(/(\\n)/).map(part => part !== \"\\n\" ? part : render(\"br\", {})).filter(_ => _) :\n [encodeString(tok, \"html\")] :\n [tok];\n}\n\nfunction executeCompiledTidText(text: string | LanguagePart[], params: string[], rich: boolean, render: GetTidRenderFunc | null): Array<object | string> {\n if (typeof text === \"string\")\n return renderString(text, rich, render);\n\n const parts = new Array<object | string>;\n for (const tok of text) {\n if (typeof tok === \"string\") {\n parts.push(...renderString(tok, rich, render));\n } else if (typeof tok === \"number\") {\n if (tok >= 1) {\n const get_param = params[tok - 1];\n if (get_param) {\n parts.push(...renderString(get_param, rich, render));\n }\n }\n } else if (tok.t === \"tag\") {\n const sub = executeCompiledTidText(tok.subs, params, rich, render);\n if (rich && render)\n parts.push(render(tok.tag as keyof HTMLElementTagNameMap, { children: sub }));\n else\n parts.push(...(rich ? [`<${tok.tag}>`, ...sub, `</${tok.tag}>`] : sub));\n } else if (tok.t === \"ifparam\") {\n const get_param = params[tok.p - 1] || \"\";\n parts.push(...executeCompiledTidText(get_param.toUpperCase() === tok.value.toUpperCase() ? tok.subs : tok.subselse, params, rich, render));\n } else if (tok.t === \"a\") {\n const sub = executeCompiledTidText(tok.subs, params, rich, render);\n if (rich) {\n let link = tok.link;\n if (tok.linkparam > 0 && tok.linkparam <= params.length) {\n link = params[tok.linkparam - 1] || link;\n }\n if (link) {\n if (render)\n parts.push(render(\"a\", { href: link, children: sub }));\n else\n parts.push(`<a href=\"${encodeString(link, \"attribute\")}\">`, ...sub, `</a>`);\n } else {\n parts.push(...sub);\n }\n } else {\n parts.push(...sub);\n }\n }\n }\n return parts;\n}\n\nfunction flattenRecursiveLanguageTexts(text: RecursiveLanguageTexts, pathsofar: string, result: Map<string, LanguageText>): void {\n if (typeof text === \"string\" || Array.isArray(text))\n result.set(pathsofar, text);\n else\n for (const [name, value] of Object.entries(text))\n flattenRecursiveLanguageTexts(value, `${pathsofar}${pathsofar && name ? \".\" : \"\"}${name}`, result);\n}\n\nexport function registerTexts(module: string, langCode: string, tids: RecursiveLanguageTexts) {\n const langkey = `${module}:${langCode}`;\n let compiledFile = langFileCache[langkey];\n if (!compiledFile) {\n const texts = new Map;\n langFileCache[langkey] = compiledFile = { resource: \"\", fallbackLanguage: \"\", langCode, texts, registered: texts };\n }\n flattenRecursiveLanguageTexts(tids, \"\", compiledFile.registered);\n if (compiledFile.texts !== compiledFile.registered) {\n for (const [key, value] of compiledFile.registered)\n compiledFile.texts.set(key, value);\n }\n}\n\nfunction getLanguageDatetimeStrings(langCode: string) {\n switch (langCode.substring(0, 2)) {\n case \"nl\": return \"am;pm;januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag;zondag;jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec;ma;di;wo;do;vr;za;zo\";\n case \"de\": return \"am;pm;Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember;Montag;Dienstag;Mittwoch;Donnerstag;Freitag;Samstag;Sonntag;Jan.;Febr.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez.;Mo;Di;Mi;Do;Fr;Sa;So\";\n case \"fr\": return \"am;pm;Janvier;Février;Mars;Avril;Mai;Juin;Juillet;Août;Septembre;Octobre;Novembre;Décembre;Lundi;Mardi;Mercredi;Jeudi;Vendredi;Samedi;Dimanche;Janv;Févr;Mars;Avril;Mai;Juin;Juil;Août;Sept;Oct;Nov;Déc;Lun;Mar;Mer;Jeu;Ven;Sam;Dim\";\n case \"jp\": {\n return Buffer.from(\"5Y2I5YmNO+WNiOW+jDvvvJHmnIg777yS5pyIO++8k+aciDvvvJTmnIg777yV5pyIO++8luaciDvvvJfmnIg777yY5pyIO++8meaciDvvvJHvvJDmnIg777yR77yR5pyIO++8ke+8kuaciDvmnIjmm5zml6U754Gr5puc5pelO+awtOabnOaXpTvmnKjmm5zml6U76YeR5puc5pelO+Wcn+abnOaXpTvml6Xmm5zml6U777yR5pyIO++8kuaciDvvvJPmnIg777yU5pyIO++8leaciDvvvJbmnIg777yX5pyIO++8mOaciDvvvJnmnIg777yR77yQ5pyIO++8ke+8keaciDvvvJHvvJLmnIg75pyIO+eBqzvmsLQ75pyoO+mHkTvlnJ875pel\", \"base64\").toString();\n }\n }\n\n // \"en\" is the default\n return \"am;pm;January;February;March;April;May;June;July;August;September;October;November;December;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday;Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec;Mon;Tue;Wed;Thu;Fri;Sat;Sun\";\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/gettid\" {\n}\n\nexport {\n getTidLanguage,\n setTidLanguage,\n getTid,\n getTidForLanguage,\n getHTMLTid,\n getHTMLTidForLanguage,\n getTIDListForLanguage\n} from \"./internal\";\n","\nimport {\n getTid as getTidFromJSSDK,\n getTidLanguage,\n setTidLanguage,\n getHTMLTid,\n} from \"@webhare/gettid\";\nimport { registerTexts } from \"@webhare/gettid/src/internal\";\n\n// Fill nodes with a data-texttid attribute with the translated text\nfunction convertElementTids(scope = document.body) {\n // Only available in a DOM context and if the DOM is ready\n if (typeof document === \"undefined\" || !scope)\n return;\n Array.from(scope.querySelectorAll(\"*[data-texttid]\")).forEach(function (node) {\n node.textContent = getTid(node.getAttribute(\"data-texttid\") || \"\");\n });\n}\n\n// If this script is run within a DOM context, convert data-texttid attributes automatically\nif (typeof document !== \"undefined\")\n document.addEventListener(\"DOMContentLoaded\", () => convertElementTids());\n\nconst getTid = ((...args: Parameters<typeof getTidFromJSSDK>): string => getTidFromJSSDK(...args)) as typeof getTidFromJSSDK & {\n tidLanguage: string;\n html: typeof getHTMLTid;\n};\n\n// Define 'tidLanguage' as a property on the main export (so you can use getTid.tidLanguage)\nObject.defineProperty(getTid, \"tidLanguage\", { get: getTidLanguage, set: setTidLanguage });\n// Define 'html' as a method on the main export (so you can use getTid.html)\ngetTid.html = getHTMLTid;\n\n// Export getTid as the default function, explicitly export getTid, getHTMLTid and registerTexts as well\nexport {\n getTid as default,\n getTid,\n getTidLanguage,\n setTidLanguage,\n getHTMLTid,\n convertElementTids,\n registerTexts\n};\n","/*!\n * jQuery JavaScript Library v3.6.0\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2021-03-02T17:08Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n\t\t// Support: Chrome <=57, Firefox <=52\n\t\t// In some browsers, typeof returns \"function\" for HTML <object> elements\n\t\t// (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n\t\t// We don't want to classify *any* DOM node as a function.\n\t\t// Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5\n\t\t// Plus for old WebKit, typeof returns \"function\" for HTML collections\n\t\t// (e.g., `typeof document.getElementsByTagName(\"div\") === \"function\"`). (gh-4756)\n\t\treturn typeof obj === \"function\" && typeof obj.nodeType !== \"number\" &&\n\t\t\ttypeof obj.item !== \"function\";\n\t};\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = \"3.6.0\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\n\tfunction( _i, name ) {\n\t\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n\t} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.6\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2021-02-16\n */\n( function( window ) {\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ( {} ).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpushNative = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\n\t// Use a stripped-down indexOf as it's faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[ i ] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|\" +\n\t\t\"ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\n\t\t// \"Attribute values must be CSS identifiers [capture 5]\n\t\t// or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" +\n\t\twhitespace + \"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" +\n\t\twhitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace +\n\t\t\"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" +\n\t\t\twhitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" +\n\t\t\twhitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace +\n\t\t\t\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace +\n\t\t\t\"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = \"0x\" + escape.slice( 1 ) - 0x10000;\n\n\t\treturn nonHex ?\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\tnonHex :\n\n\t\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t\t// Support: IE <=11+\n\t\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t\t// surrogate pair\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === \"\\0\" ) {\n\t\t\t\treturn \"\\uFFFD\";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + \"\\\\\" +\n\t\t\t\tch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn \"\\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === \"fieldset\";\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( ( target[ j++ ] = els[ i++ ] ) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t( nodeType !== 1 || context.nodeName.toLowerCase() !== \"object\" ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we're not changing the context.\n\t\t\t\t\tif ( newContext !== context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( \"id\" ) ) ) {\n\t\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( \"id\", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? \"#\" + nid : \":scope\" ) + \" \" +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( \"fieldset\" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split( \"|\" ),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[ i ] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( ( cur = cur.nextSibling ) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn ( name === \"input\" || name === \"button\" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem && elem.namespaceURI,\n\t\tdocElem = elem && ( elem.ownerDocument || elem ).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( preferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\n\t// Safari 4 - 5 only, Opera <=11.6 - 12.x only\n\t// IE/Edge & older browsers don't support the :scope pseudo-class.\n\t// Support: Safari 6.0 only\n\t// Safari 6.0 supports :scope but it's an alias of :root there.\n\tsupport.scope = assert( function( el ) {\n\t\tdocElem.appendChild( el ).appendChild( document.createElement( \"div\" ) );\n\t\treturn typeof el.querySelectorAll !== \"undefined\" &&\n\t\t\t!el.querySelectorAll( \":scope fieldset div\" ).length;\n\t} );\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert( function( el ) {\n\t\tel.className = \"i\";\n\t\treturn !el.getAttribute( \"className\" );\n\t} );\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert( function( el ) {\n\t\tel.appendChild( document.createComment( \"\" ) );\n\t\treturn !el.getElementsByTagName( \"*\" ).length;\n\t} );\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[ \"ID\" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"id\" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[ \"ID\" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode( \"id\" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[ \"TAG\" ] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[ \"CLASS\" ] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {\n\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert( function( el ) {\n\n\t\t\tvar input;\n\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n\t\t\t\t\"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n\t\t\t\t\"<option selected=''></option></select>\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll( \"[msallowcapture^='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !el.querySelectorAll( \"[selected]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"~=\" );\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t\t// IE 11/Edge don't find elements on a `[name='']` query in some cases.\n\t\t\t// Adding a temporary attribute to the document before the selection works\n\t\t\t// around the issue.\n\t\t\t// Interestingly, IE 10 & older don't seem to have the issue.\n\t\t\tinput = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"name\", \"\" );\n\t\t\tel.appendChild( input );\n\t\t\tif ( !el.querySelectorAll( \"[name='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" +\n\t\t\t\t\twhitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll( \":checked\" ).length ) {\n\t\t\t\trbuggyQSA.push( \":checked\" );\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push( \".#.+[+~]\" );\n\t\t\t}\n\n\t\t\t// Support: Firefox <=3.6 - 5 only\n\t\t\t// Old Firefox doesn't throw on a badly-escaped identifier.\n\t\t\tel.querySelectorAll( \"\\\\\\f\" );\n\t\t\trbuggyQSA.push( \"[\\\\r\\\\n\\\\f]\" );\n\t\t} );\n\n\t\tassert( function( el ) {\n\t\t\tel.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n\t\t\t\t\"<select disabled='disabled'><option/></select>\";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll( \"[name=d]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll( \":enabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll( \":disabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: Opera 10 - 11 only\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll( \"*,:x\" );\n\t\t\trbuggyQSA.push( \",.*:\" );\n\t\t} );\n\t}\n\n\tif ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector ) ) ) ) {\n\n\t\tassert( function( el ) {\n\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, \"*\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t} );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( \"|\" ) );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( \"|\" ) );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t) );\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( ( b = b.parentNode ) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a == document || a.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b == document || b.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\treturn a == document ? -1 :\n\t\t\t\tb == document ? 1 :\n\t\t\t\t/* eslint-enable eqeqeq */\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[ i ] === bp[ i ] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[ i ], bp[ i ] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\tap[ i ] == preferredDoc ? -1 :\n\t\t\tbp[ i ] == preferredDoc ? 1 :\n\t\t\t/* eslint-enable eqeqeq */\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t// fragment in IE 9\n\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn ( sel + \"\" ).replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] ||\n\t\t\t\tmatch[ 5 ] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === \"~=\" ) {\n\t\t\t\tmatch[ 3 ] = \" \" + match[ 3 ] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === \"nth\" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === \"even\" || match[ 3 ] === \"odd\" ) );\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === \"odd\" );\n\n\t\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr[ \"CHILD\" ].test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( \"(^|\" + whitespace +\n\t\t\t\t\t\")\" + className + \"(\" + whitespace + \"|$)\" ) ) && classCache(\n\t\t\t\t\t\tclassName, function( elem ) {\n\t\t\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\t\t\ttypeof elem.className === \"string\" && elem.className ||\n\t\t\t\t\t\t\t\ttypeof elem.getAttribute !== \"undefined\" &&\n\t\t\t\t\t\t\t\t\telem.getAttribute( \"class\" ) ||\n\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\t/* eslint-disable max-len */\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t\t/* eslint-enable max-len */\n\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\t\"has\": markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\t\"contains\": markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || \"\" ) ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( \"xml:lang\" ) || elem.getAttribute( \"lang\" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement &&\n\t\t\t\t( !document.hasFocus || document.hasFocus() ) &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": createDisabledPseudo( false ),\n\t\t\"disabled\": createDisabledPseudo( true ),\n\n\t\t\"checked\": function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn ( nodeName === \"input\" && !!elem.checked ) ||\n\t\t\t\t( nodeName === \"option\" && !!elem.selected );\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t// but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[ \"empty\" ]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( ( attr = elem.getAttribute( \"type\" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\t\"last\": createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\t\"eq\": createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\t\"even\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"odd\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"lt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ?\n\t\t\t\targument + length :\n\t\t\t\targument > length ?\n\t\t\t\t\tlength :\n\t\t\t\t\targument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"gt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos[ \"nth\" ] = Expr.pseudos[ \"eq\" ];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rcombinators.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrim, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] ||\n\t\t\t\t\t\t\t( outerCache[ elem.uniqueID ] = {} );\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = uniqueCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts(\n\t\t\t\tselector || \"*\",\n\t\t\t\tcontext.nodeType ? [ context ] : context,\n\t\t\t\t[]\n\t\t\t),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ \" \" ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\ttokens\n\t\t\t\t\t\t.slice( 0, i - 1 )\n\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" } )\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[ \"TAG\" ]( \"*\", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache(\n\t\t\tselector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers )\n\t\t);\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === \"ID\" &&\n\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find[ \"ID\" ]( token.matches[ 0 ]\n\t\t\t\t.replace( runescape, funescape ), context ) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[ \"needsContext\" ].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split( \"\" ).sort( sortOrder ).join( \"\" ) === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( \"fieldset\" ) ) & 1;\n} );\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert( function( el ) {\n\tel.innerHTML = \"<a href='#'></a>\";\n\treturn el.firstChild.getAttribute( \"href\" ) === \"#\";\n} ) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert( function( el ) {\n\tel.innerHTML = \"<input/>\";\n\tel.firstChild.setAttribute( \"value\", \"\" );\n\treturn el.firstChild.getAttribute( \"value\" ) === \"\";\n} ) ) {\n\taddHandle( \"value\", function( elem, _name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert( function( el ) {\n\treturn el.getAttribute( \"disabled\" ) == null;\n} ) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\t\tnull;\n\t\t}\n\t} );\n}\n\nreturn Sizzle;\n\n} )( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n}\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// <object> elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the primary Deferred\n\t\t\tprimary = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tprimary.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( primary.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn primary.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );\n\t\t}\n\n\t\treturn primary.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\t\tvalue :\n\t\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (#9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t// 1. No key was specified\n\t\t// 2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t// 1. The entire cache object\n\t\t// 2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t// 1. An object of properties\n\t\t// 2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces <option> tags with their contents when inserted outside of\n\t// the select element.\n\tdiv.innerHTML = \"<option></option>\";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, \"<select multiple='multiple'>\", \"</select>\" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 - 11+\n// focus() and blur() are asynchronous, except when they are no-op.\n// So expect focus to be synchronous when the element is already active,\n// and blur to be synchronous when the element is not already active.\n// (focus and blur are always synchronous in other supported browsers,\n// this just defines when we can count on it).\nfunction expectSync( elem, type ) {\n\treturn ( elem === safeActiveElement() ) === ( type === \"focus\" );\n}\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\tdataPriv.get( this, \"events\" ) || Object.create( null )\n\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", returnTrue );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, expectSync ) {\n\n\t// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !expectSync ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar notAsync, result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\t// Saved data should be false in such cases, but might be a leftover capture object\n\t\t\t\t// from an async native handler (gh-4350)\n\t\t\t\tif ( !saved.length ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t// focus() and blur() are asynchronous\n\t\t\t\t\tnotAsync = expectSync( this, type );\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tif ( saved !== result || notAsync ) {\n\t\t\t\t\t\tdataPriv.set( this, type, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t}\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Support: Chrome 86+\n\t\t\t\t\t\t// In Chrome, if an element having a focusout handler is blurred by\n\t\t\t\t\t\t// clicking outside of it, it invokes the handler synchronously. If\n\t\t\t\t\t\t// that handler calls `.remove()` on the element, the data is cleared,\n\t\t\t\t\t\t// leaving `result` undefined. We need to guard against this.\n\t\t\t\t\t\treturn result && result.value;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering the\n\t\t\t\t// native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved.length ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, {\n\t\t\t\t\tvalue: jQuery.event.trigger(\n\n\t\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t\t// Extend with the prototype to reset the above stopImmediatePropagation()\n\t\t\t\t\t\tjQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\n\t\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\t\tthis\n\t\t\t\t\t)\n\t\t\t\t} );\n\n\t\t\t\t// Abort handling of the native event\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (#504, #13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\twhich: true\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, expectSync );\n\n\t\t\t// Return false to allow normal processing in the caller\n\t\t\treturn false;\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\t// Suppress native focus or blur as it's already being fired\n\t\t// in leverageNative.\n\t\t_default: function() {\n\t\t\treturn true;\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event ) dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, \"handle events\" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase() !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\t//\n\t\t// Support: Firefox 70+\n\t\t// Only Firefox includes border widths\n\t\t// in computed dimensions. (gh-4529)\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( \"table\" );\n\t\t\t\ttr = document.createElement( \"tr\" );\n\t\t\t\ttrChild = document.createElement( \"div\" );\n\n\t\t\t\ttable.style.cssText = \"position:absolute;left:-11111px;border-collapse:separate\";\n\t\t\t\ttr.style.cssText = \"border:1px solid\";\n\n\t\t\t\t// Support: Chrome 86+\n\t\t\t\t// Height set through cssText does not get applied.\n\t\t\t\t// Computed height then comes back as 0.\n\t\t\t\ttr.style.height = \"1px\";\n\t\t\t\ttrChild.style.height = \"9px\";\n\n\t\t\t\t// Support: Android 8 Chrome 86+\n\t\t\t\t// In our bodyBackground.html iframe,\n\t\t\t\t// display for all div elements is set to \"inline\",\n\t\t\t\t// which causes a problem only in Android 8 Chrome 86.\n\t\t\t\t// Ensuring the div is display: block\n\t\t\t\t// gets around this issue.\n\t\t\t\ttrChild.style.display = \"block\";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderTopWidth, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t// .css('filter') (IE 9 only, #12537)\n\t// .css('--customProperty) (#3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trcustomProp = /^--/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === \"margin\" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn't suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, \"tr\" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === \"auto\" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"animationIterationCount\": true,\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"gridArea\": true,\n\t\t\"gridColumn\": true,\n\t\t\"gridColumnEnd\": true,\n\t\t\"gridColumnStart\": true,\n\t\t\"gridRow\": true,\n\t\t\"gridRowEnd\": true,\n\t\t\"gridRowStart\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t} ) :\n\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\n\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\t// Use proper attribute retrieval(#12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar className, i, self, classNames;\n\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\ti = 0;\n\t\t\t\tself = jQuery( this );\n\t\t\t\tclassNames = classesToArray( value );\n\n\t\t\t\twhile ( ( className = classNames[ i++ ] ) ) {\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( dataPriv.get( cur, \"events\" ) || Object.create( null ) )[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\n\t\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml, parserErrorElem;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {}\n\n\tparserErrorElem = xml && xml.getElementsByTagName( \"parsererror\" )[ 0 ];\n\tif ( !xml || parserErrorElem ) {\n\t\tjQuery.error( \"Invalid XML: \" + (\n\t\t\tparserErrorElem ?\n\t\t\t\tjQuery.map( parserErrorElem.childNodes, function( el ) {\n\t\t\t\t\treturn el.textContent;\n\t\t\t\t} ).join( \"\\n\" ) :\n\t\t\t\tdata\n\t\t) );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} ).filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} ).map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t * - BEFORE asking for a transport\n\t * - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\noriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script but not if jsonp\n\t\t\tif ( !isSuccess &&\n\t\t\t\tjQuery.inArray( \"script\", s.dataTypes ) > -1 &&\n\t\t\t\tjQuery.inArray( \"json\", s.dataTypes ) < 0 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === \"content-type\" ) {\n\t\t\ts.contentType = s.headers[ i ] || \"\";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (#11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\" ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( \"load error\", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce.guid++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t// documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( _i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( {\n\t\tpadding: \"inner\" + name,\n\t\tcontent: type,\n\t\t\"\": \"outer\" + name\n\t}, function( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( _i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t},\n\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t}\n} );\n\njQuery.each(\n\t( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( _i, name ) {\n\n\t\t// Handle event binding\n\t\tjQuery.fn[ name ] = function( data, fn ) {\n\t\t\treturn arguments.length > 0 ?\n\t\t\t\tthis.on( name, null, data, fn ) :\n\t\t\t\tthis.trigger( name );\n\t\t};\n\t}\n);\n\n\n\n\n// Support: Android <=4.0 only\n// Make sure we trim BOM and NBSP\nvar rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\njQuery.trim = function( text ) {\n\treturn text == null ?\n\t\t\"\" :\n\t\t( text + \"\" ).replace( rtrim, \"\" );\n};\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n\tdefine( \"jquery\", [], function() {\n\t\treturn jQuery;\n\t} );\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( typeof noGlobal === \"undefined\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n","/* frontend-config parses the wh-config object in the browser and mocks any missing data. @webhare/env does not actually expose this config, @webhare/frontend does\n The frontend configuration is built in the SiteResponse's 'frontendConfig' member */\n\nimport { DTAPStage } from \"@webhare/env/src/concepts\";\nimport { debugFlags, initEnv } from \"@webhare/env/src/envbackend\";\nimport { getBrowserDebugFlags } from \"@webhare/env/src/init-browser\";\n\n/** The format of the <script id=\"wh-config\"> object */\nexport interface WHConfigScriptData {\n ///Plugins may add keys at this level\n [key: string]: unknown;\n\n //NOTE: existing frontend code doesn't expect site/obj to ever be null. not sure if 'object' provides the best interface or whether we need some sort of 'unknown but an existing object'\n /** Page (targetobject) specific settings */\n obj: { [key: string]: unknown };\n /** Site specific settings */\n site: { [key: string]: unknown };\n\n /** Numeric server version number (eg 5.02.24 = 50224)\n * @deprecated Interpreting numbers (or version strings) is dangerous. Feature flags/testing or limiting your entire module to compatible versions is safer\n */\n server: number;\n /** Root URL of this site */\n siteRoot: string;\n /** @deprecated Use `document.documentElement.lang` instead */\n locale: never;\n}\n\n//names fields can still have when not yet republished\nexport interface WHConfigScriptData_OldPublishFields {\n islive: boolean;\n dtapstage: DTAPStage;\n siteroot: string;\n}\n\n//fallback names with deprecation warnings\nexport interface WHConfigScriptData_LegacyFields {\n //TODO: once 5.4 is the expected baseline everwhere: /** @deprecated use import { isLive } from \"@webhare/env\"; in WH5.4 */\n islive: boolean;\n //TODO: once 5.4 is the expected baseline everwhere:/** @deprecated use import { dtapStage } from \"@webhare/env\"; in WH5.4 */\n dtapstage: DTAPStage;\n //TODO: once 5.4 is the expected baseline everwhere:/** @deprecated Renamed to siteRoot in WH5.4 */\n siteroot: string;\n}\n\n\nlet config, siteroot;\nlet dtapStage = DTAPStage.Production;\n\n//if document is undefined, we're serverside or in a worker\nconst whconfigel = typeof document !== \"undefined\" ? document.querySelector('script#wh-config') : null;\nif (whconfigel?.textContent) {\n config = JSON.parse(whconfigel.textContent) as Partial<WHConfigScriptData & WHConfigScriptData_OldPublishFields & { dtapStage?: DTAPStage }>;\n\n //Fallbacks for pages last published with WH5.3 *and* pages published from HareScript which still emit lowercase props\n siteroot = config.siteRoot ?? config.siteroot;\n dtapStage = config.dtapstage ?? config.dtapStage ?? dtapStage;\n}\n\ninitEnv(dtapStage, '/');\n\nfor (const flag of getBrowserDebugFlags('wh-debug'))\n debugFlags[flag] = true;\n\n// Make sure we have obj/site as some sort of object, to prevent crashes on naive 'if ($wh.config.obj.x)' tests'\nexport const frontendConfig = {\n server: 0,\n ...config,\n obj: config?.obj || {},\n site: config?.site || {},\n siteRoot: siteroot,\n //deprecated variables:\n dtapstage: dtapStage,\n islive: ([DTAPStage.Production, DTAPStage.Acceptance]).includes(dtapStage!),\n siteroot\n} as WHConfigScriptData & WHConfigScriptData_LegacyFields; //in a future version we can either obsolete or even drop '& WHConfigScriptData_LegacyFields' and validation will fail without breaking existing JS code\n","\n//Note that @webhare/env does not invoke this API itself. In WebHare @webhare/frontend/src/init uses this to initialize\nexport function getBrowserDebugFlags(varname: string): string[] {\n const flags = [];\n const urldebugvar = new URL(location.href).searchParams.get(varname);\n if (urldebugvar)\n flags.push(...urldebugvar.split(','));\n\n //not importing getCookie to solve some import ordering issues\n if (typeof document !== \"undefined\") { //'document' is undefined in a worker but assetpacks compiled for a ServiceWorker will also load us\n const debugcookie = document.cookie.match(`(?:^|;)\\\\s*${varname}=([^;]*)`); //TODO escape varname\n if (debugcookie) {\n const debugcookievalue = decodeURIComponent(debugcookie[1]);\n if (debugcookievalue)\n flags.push(... (debugcookievalue.split('.').filter(flag => !flag.startsWith('sig='))));\n }\n }\n\n return flags;\n}\n","import \"@webhare/tsrun/src/polyfills\";\nimport \"./iterator-helpers\";\nimport \"./publisher-integration\";\n","/* eslint-disable @typescript-eslint/array-type */\n/* eslint-disable @typescript-eslint/no-loop-func */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-this-alias */\n\n/* Iterator polyfills (https://caniuse.com/?search=iterator) - stage 4 ES but not in all browsers yet\n Based on https://github.com/alkihis/iterator-polyfill/tree/master but we removed all the AsyncIterator\n stuff as that's still stage 2 AND not implemented in TypeScript (as of 5.6)\n\n We're ignoring a few linting/any issues as we really don't care to maintain this much\n Fixed an issue with .some - reported as https://github.com/alkihis/iterator-polyfill/issues/6\n*/\n\n(function () {\n // polyfill already applied / proposal implemented\n if ('Iterator' in globalThis) {\n return;\n }\n\n // Polyfill for Iterator\n const IteratorPrototype = {};\n\n const ArrayIteratorPrototype = Object.getPrototypeOf([][Symbol.iterator]());\n const OriginalIteratorPrototype = Object.getPrototypeOf(ArrayIteratorPrototype);\n\n Object.setPrototypeOf(OriginalIteratorPrototype, IteratorPrototype);\n\n Object.defineProperties(IteratorPrototype, {\n [Symbol.iterator]: {\n value() {\n return this;\n }\n },\n map: {\n *value<T, R>(callback: (value: T) => R): Generator<any, any, any> {\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = callback(value.value);\n const next_value = yield real_value;\n value = it.next(next_value);\n }\n\n return value.value;\n },\n },\n filter: {\n *value<T>(callback: (value: T) => boolean): Generator<any, any, any> {\n const it = this;\n let value = it.next();\n let next_value;\n\n while (!value.done) {\n const real_value = value.value;\n if (callback(real_value)) {\n next_value = yield real_value;\n value = it.next(next_value);\n } else {\n value = it.next(next_value);\n }\n }\n\n return value.value;\n },\n },\n find: {\n value<T>(callback: (value: boolean) => T) {\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (callback(real_value))\n return real_value;\n\n value = it.next();\n }\n }\n },\n every: {\n value<T>(callback: (value: T) => boolean) {\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (!callback(real_value))\n return false;\n\n value = it.next();\n }\n\n return true;\n }\n },\n some: {\n value<T>(callback: (value: T) => boolean) {\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (callback(real_value)) {\n it.return();\n return true;\n }\n\n value = it.next();\n }\n\n return false;\n }\n },\n toArray: {\n value(max_count = Infinity) {\n const values = [];\n\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (max_count <= 0)\n return values;\n\n values.push(real_value);\n\n if (max_count !== Infinity)\n max_count--;\n\n value = it.next();\n }\n\n return values;\n }\n },\n take: {\n *value(limit: number): Generator<any, any, any> {\n limit = Number(limit);\n if (limit < 0)\n throw new RangeError('Invalid limit.');\n\n const it = this;\n let value = it.next();\n let remaining = limit;\n let next_value;\n\n while (!value.done) {\n const real_value = value.value;\n\n if (remaining <= 0)\n return;\n\n next_value = yield real_value;\n value = it.next(next_value);\n remaining--;\n }\n\n return value.value;\n },\n },\n drop: {\n *value(limit: number): Generator<any, any, any> {\n limit = Number(limit);\n if (limit < 0)\n throw new RangeError('Invalid limit.');\n\n const it = this;\n let value = it.next();\n let remaining = limit;\n let next_value;\n\n while (!value.done) {\n const real_value = value.value;\n\n if (remaining > 0) {\n value = it.next(next_value);\n remaining--;\n continue;\n }\n\n next_value = yield real_value;\n value = it.next(next_value);\n }\n\n return value.value;\n },\n },\n asIndexedPairs: {\n *value(): Generator<any, any, any> {\n const it = this;\n let value = it.next();\n let index = 0;\n\n while (!value.done) {\n const real_value = value.value;\n const next_value = yield [index, real_value];\n value = it.next(next_value);\n index++;\n }\n\n return value.value;\n }\n },\n flatMap: {\n *value<T, R extends object>(mapper: (value: T) => IterableIterator<R> | R): Generator<any, any, any> {\n if (typeof mapper !== 'function') {\n throw new TypeError('Mapper must be a function.');\n }\n\n const it = this;\n let value = it.next();\n let next_value;\n\n while (!value.done) {\n const real_value = value.value;\n const mapped = mapper(real_value);\n\n if (Symbol.iterator in mapped) {\n // @ts-ignore -- copied from original\n next_value = yield* mapped[Symbol.iterator]();\n } else {\n next_value = yield mapped;\n }\n\n value = it.next(next_value);\n }\n\n return value.value;\n },\n },\n reduce: {\n value<T, V>(reducer: (acc: V, value: T) => V, initial_value?: V) {\n let acc = initial_value;\n\n const it = this;\n if (acc === undefined) {\n acc = it.next().value;\n }\n\n let value = it.next();\n while (!value.done) {\n const real_value = value.value;\n\n acc = reducer(acc!, real_value);\n\n value = it.next();\n }\n\n return acc;\n }\n },\n forEach: {\n value<T>(callback: (value: T) => any) {\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n callback(real_value);\n\n value = it.next();\n }\n }\n },\n [Symbol.toStringTag]: {\n value: 'IteratorPrototype'\n },\n\n /* OUTSIDE PROPOSAL */\n count: {\n value() {\n let count = 0;\n\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n count++;\n value = it.next();\n }\n\n return count;\n },\n },\n join: {\n value(string: string) {\n let final = '';\n let first = true;\n\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (first) {\n first = false;\n final += real_value;\n } else {\n final += string + real_value;\n }\n\n value = it.next();\n }\n\n return final;\n }\n },\n chain: {\n *value<I>(...iterables: IterableIterator<I>[]) {\n yield* this;\n\n for (const it of iterables) {\n yield* it;\n }\n }\n },\n zip: {\n *value<T, O>(...others: IterableIterator<O>[]): Iterator<(T | O)[]> {\n const it_array = [this, ...others].map((e: any) => Symbol.iterator in e ? e[Symbol.iterator]() : e as Iterator<T | O>);\n let values = it_array.map(e => e.next());\n let next_value: any;\n\n while (values.every(e => !e.done)) {\n next_value = yield values.map(e => e.value);\n values = it_array.map(e => e.next(next_value));\n }\n },\n },\n takeWhile: {\n *value<T>(callback: (value: T) => boolean): Generator<any, any, any> {\n const it = this;\n let value = it.next();\n let next_value;\n\n while (!value.done) {\n const real_value = value.value;\n\n if (callback(real_value))\n next_value = yield real_value;\n else\n return;\n\n value = it.next(next_value);\n }\n\n return value.value;\n }\n },\n dropWhile: {\n *value<T>(callback: (value: T) => boolean): Generator<any, any, any> {\n const it = this;\n let value = it.next();\n let next_value;\n let finished = false;\n\n while (!value.done) {\n const real_value = value.value;\n\n if (!finished && callback(real_value)) {\n value = it.next(next_value);\n continue;\n }\n\n finished = true;\n next_value = yield real_value;\n\n value = it.next(next_value);\n }\n\n return value.value;\n }\n },\n fuse: {\n *value(): Generator<any, any, any> {\n const it = this;\n let value = it.next();\n let next_value;\n\n while (!value.done) {\n const real_value = value.value;\n\n if (real_value !== undefined && real_value !== null)\n next_value = yield real_value;\n else\n return;\n\n value = it.next(next_value);\n }\n\n return value.value;\n }\n },\n partition: {\n value<T>(callback: (value: T) => boolean) {\n const partition1 = [], partition2 = [];\n\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (callback(real_value))\n partition1.push(real_value);\n else\n partition2.push(real_value);\n\n value = it.next();\n }\n\n return [partition1, partition2];\n },\n },\n findIndex: {\n value<T>(callback: (value: T) => boolean) {\n const it = this;\n let i = 0;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (callback(real_value))\n return i;\n\n value = it.next();\n i++;\n }\n\n return -1;\n }\n },\n max: {\n value() {\n let max = -Infinity;\n\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (max < real_value)\n max = real_value;\n\n value = it.next();\n }\n\n return max;\n },\n },\n min: {\n value() {\n let min = Infinity;\n\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n\n if (min > real_value)\n min = real_value;\n\n value = it.next();\n }\n\n return min;\n },\n },\n cycle: {\n *value(): Generator<any, any, any> {\n const values = [];\n\n const it = this;\n let value = it.next();\n\n while (!value.done) {\n const real_value = value.value;\n values.push(real_value);\n\n const next_value = yield real_value;\n value = it.next(next_value);\n }\n\n while (true) {\n yield* values;\n }\n },\n },\n });\n\n //iterator.from from https://github.com/rauschma/iterator-helpers-polyfill/\n\n function isObject(value: unknown) {\n if (value === null) return false;\n const t = typeof value;\n return t === 'object' || t === 'function';\n }\n\n function GetIteratorFlattenable<T>(obj: Record<symbol, any>): T {\n if (!isObject(obj)) {\n throw new TypeError();\n }\n const method = obj[Symbol.iterator];\n let iterator = undefined;\n if (typeof method !== 'function') {\n iterator = obj;\n } else {\n iterator = method.call(obj);\n }\n if (!isObject(iterator)) {\n throw new TypeError();\n }\n return iterator;\n }\n\n if (!('Iterator' in globalThis)) {\n const Iterator = function Iterator() { };\n\n Iterator.prototype = IteratorPrototype;\n\n // @ts-expect-error We're still missing From in this poyfill\n (globalThis).Iterator = Iterator;\n }\n\n\n //----- Static method -----\n // Must be done after Iterator.prototype was set up,\n // so that `extends Iterator` works below\n\n class WrappedIterator<T, TReturn = any, TNext = undefined> extends Iterator<T, TReturn, TNext> {\n #iterator;\n constructor(iterator: Iterator<T, TReturn, TNext>) {\n super();\n this.#iterator = iterator;\n }\n override next(...args: [] | [TNext]): any {\n return this.#iterator.next(...args);\n }\n // `async` helps with line (*)\n override return(value?: TReturn | PromiseLike<TReturn>): any {\n const returnMethod = this.#iterator.return;\n if (returnMethod === undefined) {\n return { done: true, value: value as any }; // (*)\n }\n return returnMethod.call(this.#iterator);\n }\n }\n\n function Iterator_from<T>(value: any) {\n const iterator = GetIteratorFlattenable<Iterator<T>>(value);\n if (iterator instanceof Iterator) {\n return iterator;\n }\n // `iterator´ does not support the new API – wrap it so that it does\n return new WrappedIterator(iterator);\n }\n\n Object.defineProperty(\n Iterator, 'from',\n {\n writable: true,\n enumerable: false,\n configurable: true,\n value: Iterator_from,\n }\n );\n})();\n","{\"interfaces\":[\"https://ipkot.apps.webhare.nl\"]}","/* eslint-disable */\n/// @ts-nocheck -- Bulk rename to enable TypeScript validation\n\nimport publicconfig from \"@storage-system/js/publicconfig.json\";\n\nfunction forwardPublisherNavigation(event) {\n /* we watch for clicks.. as we only want to update the Publisher's selection for user triggered actions (otherwise we'd\n start navigation in response to JS or internal link autoredirects) */\n\n const navaction = event.target.closest('a[href]');\n if (!navaction)\n return;\n\n const desturl = navaction.href;\n if (desturl.split('#')[0] !== location.href.split('#')[0]) //it's actual navigation...\n {\n for (const origin of publicconfig.interfaces) {\n try {\n window.top.postMessage({ type: \"webhare-navigation\", location: desturl }, origin);\n } catch (ignore) {\n //ignore crossdomain errors\n }\n }\n }\n}\n\nif (window !== window.top) { //if we're in an iframe, we may be running in WebHare and need to forward navigation events\n window.addEventListener(\"click\", forwardPublisherNavigation);\n}\n","import * as dompack from 'dompack';\nimport 'dompack/browserfix/reset.css';\n\nimport * as whintegration from '@mod-system/js/wh/integration';\nimport '@mod-system/js/wh/errorreporting'; //log JS errors to notice log\n\nimport \"./footer\";\n\nimport \"../shared/multiselect\";\n\nimport './shared/forms';\nimport './shared/rtd/rtd';\nimport './ipkotsite.scss';\n\nimport './widgets/video';\n\nimport './ipkotsite.lang.json';\n\nimport \"./pages/search\";\nimport \"./pages/publication\";\n\n\n// Behaviour\nimport \"../shared/skiplinks.es\";\n\nimport \"./widgets/accordion\";\n\n// open external links in new window - see https://code.webhare.com/publisher/utilities/linkhandler/\nimport { openLinksInNewWindow } from '@mod-publisher/js/linkhandler';\n\n\n\n// open external links in new window\n/*\nvar ourdomain = (new URL(location.href)).host.toLowerCase();\nlet internalhosts =\n [ ourdomain\n //, \"rijksoverheid.nl\"\n ];\n*/\nopenLinksInNewWindow({ extensions: [ 'pdf', 'rss' ]\n //, internalhosts: internalhosts\n });\n\n\n\ndompack.onDomReady(\n function()\n {\n initHeaderSearchBar();\n });\n\nfunction initHeaderSearchBar()\n{\n let form = document.querySelector(\"form.header__search\");\n if (form)\n {\n document.querySelector(\".header__search__submit\").addEventListener(\"click\", onSubmit);\n form.addEventListener(\"focusout\", hideSearch);\n }\n}\n\nfunction onSubmit(evt)\n{\n // We only want to submit if the search was already activated\n // if (!document.activeElement || !dompack.closest(document.activeElement, \"form.header__search\"))\n if (!document.documentElement.classList.contains(\"headersearch--active\"))\n {\n evt.preventDefault();\n document.documentElement.classList.add(\"headersearch--active\");\n document.getElementById(\"header__search__keyword\").focus();\n return;\n }\n}\n\nfunction hideSearch(evt)\n{\n if ( evt.relatedTarget != null // (if relatedTarget is null nothing was explictly focussed, but <body> probably got focus now)\n && dompack.closest(evt.relatedTarget, \"form.header__search\"))\n return; // focus is still in the header search\n\n document.documentElement.classList.remove(\"headersearch--active\");\n}\n","import * as dompack from '@webhare/dompack';\n\n//NOTE: Do *NOT* load @webhare/frontend or we enforce the new CSS reset!\nimport { navigateTo, NavigateInstruction } from \"@webhare/env\";\nexport { frontendConfig as config } from '@webhare/frontend/src/init';\n\nexport function executeSubmitInstruction(instr: NavigateInstruction, options?: {\n ismodal?: boolean;\n iframe?: HTMLIFrameElement;\n}) {\n if (!instr)\n throw Error(\"Unknown instruction received\");\n\n options = { ismodal: true, ...options };\n //Are there any cirumstances where you would want to reelase this lock?\n dompack.flagUIBusy({ modal: options.ismodal || false });\n navigateTo(instr);\n}\n","/* eslint-disable no-restricted-globals */\n\n/* This libraries monitors root.error and reports errors to the webhare notice log\n*/\n\nimport { debugFlags } from \"@webhare/env\";\n// eslint-disable-next-line @typescript-eslint/no-var-requires -- not fully converted to TS yet\nconst JSONRPC = require('@mod-system/js/net/jsonrpc');\nimport * as browser from 'dompack/extra/browser';\nimport StackTrace from \"stacktrace-js\";\nimport { isError } from \"@webhare/std\";\n\nlet haveerror = false;\nlet mayreport = true;\nlet saved_onerror: typeof onerror = null;\n\n// Determine root object\nlet root: typeof self;\nif (typeof window !== \"undefined\")\n root = window;\nelse if (typeof self !== \"undefined\")\n root = self;\n\n// With promise debugging, we replace the promise constructor to add a stack trace to the promise\n// at construction time, so we can trace where the rejected promise came from\nif (debugFlags.pro) {\n const P = Promise;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type MyAny = any;\n const MyPromise = function (executor: MyAny) {\n const p = new P(executor) as MyAny;\n p.error = new Error(\"unhandled rejected promise\");\n p.__proto__ = MyPromise.prototype;\n return p;\n };\n MyPromise.__proto__ = P;\n MyPromise.prototype.__proto__ = P.prototype;\n root!.Promise = MyPromise as MyAny;\n}\n\nfunction installHandlers() {\n // We'll use the onerror handler - the error event doesn't give much extra stuff\n // and won't work in ie<=10 and safari anyways\n\n saved_onerror = root.onerror;\n root.onerror = handleOnError;\n\n root.addEventListener('unhandledrejection', async event => {\n console.log(\"unhandled rejection\", event);\n if (debugFlags.pro && (event.promise as Promise<unknown> & { error: Error }).error)\n reportException((event.promise as Promise<unknown> & { error: Error }).error);\n });\n}\n\nfunction resetMayReport() {\n mayreport = true;\n}\n\nconst reported: string[] = [];\nconst sourceCache = {};\nlet reportPromise: Promise<unknown> | null = null;\n\n/** Send an exception\n @param errorobj - Error exception\n @param options -\n - options.altstack: Alternative exception text to show when the exception has no stack member\n - options.forcesend: Always send the exception (no throttling)\n - options.extradata: Extra data to mix in with the report\n - options.serviceuri: Alternative serviceuri to use\n - options.servicefunction: Alternative servicefunction to use\n*/\nexport async function reportException(errorobj: Error, options?: { altstack?: string; forcesend?: boolean; forceresolve?: boolean; extradata?: object; serviceuri?: string; servicefunction?: string }) {\n options = options || {};\n\n //try { console.log(\"reportException\", errorobj, errorobj.stack) }catch(e) {}\n let exception_text = '';\n if (isError(errorobj))\n exception_text = `${errorobj.name}: ${errorobj.message}`;\n\n if (!exception_text && options && options.altstack)\n exception_text = options.altstack;\n\n if (!exception_text)\n try { exception_text = JSON.stringify(errorobj); } catch (e) { }\n if (!exception_text)\n try { exception_text = errorobj.toString(); } catch (e) { }\n\n // Max 10 reports per page, and no duplicates\n const shouldsend = reported.length <= 10 && !reported.includes(exception_text);\n if (!shouldsend && !options.forcesend && !options.forceresolve)\n return;\n\n const { resolve, promise } = Promise.withResolvers<boolean>();\n reportPromise = (reportPromise || Promise.resolve(true)).then(() => promise);\n try {\n reported.push(exception_text);\n\n let stackframes;\n try {\n console.info(\"Getting stack trace for exception\", errorobj);\n // Must specify a sourceCache to avoid duplicate requests\n if (StackTrace) {\n const parsedStackFrames = await StackTrace.fromError(errorobj, { sourceCache });\n stackframes = parsedStackFrames.map(frame => (\n {\n line: frame.lineNumber || 0,\n functionname: frame.functionName || \"unknown\",\n filename: (frame.fileName || \"unknown\").replace(\"/@whpath/\", \"\"),\n column: frame.columnNumber || 0\n }));\n }\n } catch (e) {\n console.info(\"Could not retrieve stack trace\", (e as Error).stack || e);\n }\n\n if (!shouldsend && !options.forcesend)\n return ({ stacktrace: stackframes });\n\n type Data = {\n v: number;\n browser: { name: string };\n location: string;\n message: string;\n trace: Array<{ line: number; functionname: string; filename: string; column: number }> | undefined;\n data?: object;\n };\n\n const data: Data = {\n v: 1,\n browser: { name: browser.getTriplet() },\n location: location.href,\n message: exception_text,\n trace: stackframes,\n };\n\n if (options && options.extradata) {\n data.data = Object.fromEntries(Object.entries(options.extradata));\n }\n\n if (typeof (root.location) === 'undefined')\n return;\n\n const serviceuri = (new URL((options && options.serviceuri) || \"/wh_services/publisher/designfiles/\", root.location.href)).toString();\n const rpc = new JSONRPC({ url: serviceuri, timeout: 10000 });\n rpc.request((options && options.servicefunction) || \"ReportJavaScriptError\", [data]);\n\n if (stackframes) {\n console.warn(\"Reported exception: \", exception_text);\n console.warn(\"Translated trace: \" + stackframes.map(s => `\\n at ${s.functionname || \"\"} (${s.filename}:${s.line}:${s.column})`).join(\"\"));\n } else\n console.warn('Reported exception: ', exception_text);\n\n return ({ stacktrace: stackframes });\n } finally {\n resolve(true);\n }\n}\n\nfunction handleOnError(errormsg: Event | string, url?: string, linenumber?: number, column?: number, errorobj?: Error) {\n // Test if we should ignore this callback\n if (typeof errormsg !== \"string\" || shouldIgnoreOnErrorCallback(errormsg))\n return false;\n\n if (!mayreport) {\n console.log('not reporting exception, first waiting for a click', errormsg);\n return false;\n }\n try {\n mayreport = false;\n\n let altstack = 'onerror:' + errormsg;\n if (url)\n altstack += \"\\nat unknown_function (\" + url + \":\" + linenumber + \":\" + (column || 1) + \")\";\n\n if (errorobj)\n reportException(errorobj, { altstack: altstack });\n\n if (!haveerror && root.addEventListener)\n root.addEventListener('click', resetMayReport, true);\n\n haveerror = true;\n } catch (e) {\n console.error('Exception while reporting earlier exception', e);\n }\n\n if (saved_onerror) {\n // @ts-ignore -- This works, but TS complains\n // eslint-disable-next-line @typescript-eslint/no-invalid-this, prefer-rest-params\n return saved_onerror.apply(this, arguments);\n }\n return false;\n}\n\nexport function shouldIgnoreOnErrorCallback(errormsg: string) {\n // Firefox fires the performance warning 'mutating the [[Prototype]] of an object will cause your code to run very slowly; instead ...'\n // via onerror. Ignore it, it is not an error.\n if (/mutating the \\[\\[Prototype\\]\\] of an/.exec(errormsg))\n return true;\n\n return false;\n}\n\n/** If any reports have been issued, returns a promise that will be resolved when all reports have been submitted.\n Returns null otherwise.\n*/\nexport function waitForReports() {\n return reportPromise;\n}\n\nif (!debugFlags.ner)\n installHandlers();\n","/* @recommendedimport: import * as browser from 'dompack/extra/browser';\n\n Identify devices for the purpose of analytics/tracing\n NOT a library for feature detection!\n\n Based on Mootools.Browser\n*/\n/* eslint no-useless-escape: off */\n\ntype Platform = \"windows\" | \"ios\" | \"webos\" | \"android\" | \"linux\" | \"mac\" | \"other\";\n\nexport type UserAgentInfo =\n {\n name: string;\n version: number;\n platform: Platform;\n device: \"desktop\" | \"mobile\" | \"tablet\" | \"\";\n };\n\nexport function parseUserAgent(ua: string): UserAgentInfo {\n ua = ua.toLowerCase();\n\n // chrome is included in the edge UA, so need to check for edge first, before checking if it's chrome.\n // safari is included in the miuibrowser UA, so need to check for miuibrowser first, before checking if it's safari.\n let UA: RegExpMatchArray | null = ua.match(/(edge|miuibrowser)[\\s\\/:]([\\w\\d\\.]+)/);\n if (!UA)\n UA = ua.match(/(opera|ie|firefox|chrome|trident|crios|version)[\\s\\/:]([\\w\\d\\.]+)?.*?(safari|(?:rv[\\s\\/:]|version[\\s\\/:])([\\w\\d\\.]+)|$)/);\n if (!UA) { //try ios 11.4.1\n UA = ua.match(/; cpu os ([\\d]+)/);\n if (UA)\n UA = ['', 'safari', UA[1]];\n }\n if (!UA)\n UA = ['', 'unknown', \"0\"];\n\n if (UA[1] === 'trident') {\n UA[1] = 'ie';\n if (UA[4]) UA[2] = UA[4];\n } else if (UA[1] === 'crios') {\n UA[1] = 'chrome';\n }\n\n let platform = ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match(/(?:webos|android)/) || ua.match(/mac|win|linux/) || ['other'])[0];\n if (platform === 'win') platform = 'windows';\n\n const ret: UserAgentInfo =\n {\n name: (UA[1] === 'version') ? UA[3] : UA[1],\n version: parseInt((UA[1] === 'opera' && UA[4]) ? UA[4] : UA[2]),\n platform: platform as Platform,\n device: ua.match(/ipad/) ? 'tablet' : ['ios', 'webos', 'android'].includes(platform) ? 'mobile' : ['mac', 'windows', 'linux'].includes(platform) ? 'desktop' : ''\n };\n\n return ret;\n}\n\n//module.exports =\nconst browser = parseUserAgent(globalThis.navigator?.userAgent || \"\");\n\nexport function getName() {\n return browser.name;\n}\nexport function getVersion() {\n return browser.version;\n}\nexport function getPlatform() {\n return browser.platform;\n}\nexport function getDevice() {\n return browser.device;\n}\nexport function getTriplet() {\n return browser.platform + '-' + browser.name + '-' + browser.version;\n}\n","import * as dompack from \"dompack\";\n//import \"./multiselect.scss\";\n\ndocument.addEventListener(\"click\", evt => doCheckForMultiselectClear(evt));\n\n//document.addEventListener(\"change\", evt => doCheckForMultiSelectChange(evt));\n\n\n\n\nfunction getTitleForCheckbox(elemid)\n{\n if (elemid == \"\")\n return \"\";\n\n let labelnode = document.querySelector('label[for=\"'+elemid+'\"]:not(:empty)');\n if (labelnode)\n return labelnode.textContent;\n}\n\nfunction doCheckForMultiSelectChange(evt)\n{\n let panel = dompack.closest(evt.target, \".multiselect__panel\");\n if (!panel)\n return;\n\n //window.flup = evt.target;\n\n let multiselect = dompack.closest(evt.target, \".multiselect\");\n updateMultiSelectByNode(multiselect);\n}\n\n// update label within the multiselect pulldown to reflect what or how many options are selected\nfunction updateMultiSelectByNode(multiselect)\n{\n // console.info(\"updateMultiSelectByNode\", multiselect);\n// let field = targetnode.form[targetnode.name];\n\n // let multiselect = dompack.closest(targetnode, \".multiselect\");\n let valuenode = multiselect.querySelector(\".multiselect__valuedisplay__title\");\n\n let cbnodes = multiselect.querySelectorAll('input[type=\"checkbox\"]');\n\n let titles = [];\n for (let node of cbnodes)\n {\n if (node.checked)\n {\n let title = getTitleForCheckbox(node.id);\n titles.push(title != \"\" ? title : \"??\");\n }\n }\n\n if (titles.length == 0)\n valuenode.textContent = valuenode.getAttribute(\"data-emptytext\");\n else\n {\n let fixedtitle;\n if (titles.length > 1)\n fixedtitle = valuenode.getAttribute(\"data-multitext\");\n else\n fixedtitle = valuenode.getAttribute(\"data-singletext\");\n\n if (fixedtitle != \"\")\n {\n fixedtitle = fixedtitle.replace(\"[amount]\", titles.length);\n valuenode.textContent = fixedtitle;\n }\n else\n valuenode.textContent = titles.join(\", \");\n }\n}\n\nfunction doCheckForMultiselectClear(evt)\n{\n let clearbutton = dompack.closest(evt.target, \".multiselect__panel__clear\");\n if (!clearbutton)\n return;\n\n let panel = dompack.closest(evt.target, \".multiselect__panel\");\n\n // deselect all checkboxes within the multiselect panel\n let cbs = panel.querySelectorAll('input[type=\"checkbox\"]');\n for (let cb of cbs)\n cb.checked = false;\n\n let multiselect = dompack.closest(evt.target, \".multiselect\");\n updateMultiSelectByNode(multiselect);\n\n let form = dompack.closest(evt.target, \"form\");\n if (form)\n dompack.dispatchCustomEvent(form, \"submit\", { bubbles: false, cancelable: true});\n\n let component = dompack.closest(evt.target, \".multiselect\");\n let closetrigger = component.querySelector(\".multiselect__closetrigger\");\n closetrigger.focus();\n}\n\nexport function refreshAll()\n{\n let multiselects = document.querySelectorAll(\".multiselect\");\n for (let mscontainer of multiselects)\n updateMultiSelectByNode(mscontainer);\n}\n\ndompack.onDomReady(refreshAll);\n","import * as dompack from \"dompack\";\nimport * as browser from 'dompack/extra/browser';\nimport * as forms from '@mod-publisher/js/forms';\nimport { SplitDateField, SplitTimeField } from '@mod-publisher/js/forms/fields/splitdatetime';\n//import ImgEditField from '@mod-publisher/js/forms/fields/imgedit';\n//import RTDField from '@mod-publisher/js/forms/fields/rtd';\n//import UploadField from '@mod-publisher/js/forms/fields/upload';\n//import * as googleRecaptcha from \"@mod-publisher/js/captcha/google-recaptcha\";\n\n//import \"../../../shared/multiselect\";\n\n// Load neutral styling (optional, but you'll need to supply your own styling for some of the fields below if you skip this)\nimport '@mod-publisher/js/forms/themes/neutral';\n\nimport './buttons.scss';\nimport './checkbox-radio.scss';\nimport './textual-input.scss';\n\nimport './formlayout.scss';\nimport './pulldown.scss';\n//import './uploadfields.scss';\nimport './multiselect.scss';\nimport \"./dateinputgroup.scss\";\n\n\n// import $ from \"jquery\";\n// import \"jquery-ui/ui/widgets/datepicker\";\n// import \"jquery-ui/ui/i18n/datepicker-nl.js\";\n// import \"jquery-ui/themes/base/datepicker.css\";\n\n\nimport $ from \"@mod-ipkot/web/jquery-ui/jquery\";\nimport \"@mod-ipkot/web/jquery-ui/widgets/autocomplete\";\nimport \"@mod-ipkot/web/jquery-ui/widgets/selectmenu\";\nimport \"@mod-ipkot/web/jquery-ui/widgets/slider\";\nimport \"@mod-ipkot/web/jquery-ui/widgets/datepicker\";\nimport \"@mod-ipkot/web/jquery-ui/i18n/datepicker-nl\";\nimport \"@mod-ipkot/web/jquery-ui/i18n/datepicker-en\";\nimport \"@mod-ipkot/web/jquery-ui-touch-punch\";\n\nimport \"./datepicker.scss\";\n\n\n// Enable forms and our builtin validation\nforms.setup({ validate:true });\n\n$.datepicker.setDefaults($.datepicker.regional[\"nl\"]);\n\n\n// Replaces date fields with a split version\n// dompack.register(\".wh-form__date\", node => new SplitDateField(node));\ndompack.register(\".wh-form__time\", node => new SplitTimeField(node));\n\n\n\ndompack.register(\".wh-form__date\", function(node)\n {\n // iOS and Android have datepickers specialized for touch interaction\n // and small screens, so using our own datepicker is not help to users\n // of those mobile/tablet OS'ses.\n if (browser.getPlatform() == \"ios\" || browser.getPlatform() == \"android\")\n return;\n\n document.documentElement.classList.add(\"datefieldsreplaced\");\n\n console.log(\"INIT datepicker\");\n $(node).datepicker({ showOn: \"button\"\n , dateFormat: \"yy-mm-dd\"\n //, selectOtherMonths: true\n // , changeMonth: true\n //, changeYear: true\n\n , changeMonth: !0\n , changeYear: !0\n //dateFormat: \"dd-mm-yy\"\n , showWeek: !0\n , showOn: \"button\"\n , buttonText: node.dataset.buttontext ? `<span class=\"assistive\">${node.dataset.buttontext}</span>` : \"\"\n , weekHeader: \"weeknummer\"\n , nextText: \"Maand later\"\n , prevText: \"Maand eerder\"\n , closeText: \"Sluiten\"\n/*\n , monthNames: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"]\n , monthNamesShort: [\"Jan\", \"Feb\", \"Maa\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"]\n , dayNames: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\n , dayNamesShort: [\"Zon\", \"Maa\", \"Din\", \"Woe\", \"Don\", \"Vrij\", \"Zat\"]\n , dayNamesMin: [\"ZO\", \"MA\", \"DI\", \"WO\", \"DO\", \"VR\", \"ZA\"]\n*/\n , yearRange: \"c-5:c+5\"\n , firstDay: 1\n\n //, beforeShow: function() {} // FIX DOM ordering here?\n //, onSelect: function(dateStr) { alert(dateStr); }\n });\n\n new SplitDateField(node);\n\n /*\n let button = <div class=\"wh-form__dateinputgroup__showpicker\" aria-label=\"Kies startdatum uit kalender\"></div>;\nconsole.log(button);\n button.addEventListener(\"click\", doShowDatePicker);\n node.parentNode.querySelector(\".wh-form__dateinputgroup\").appendChild(button);\n */\n });\n\n/*\nNOTE: For future use, we might want to replace the button/buttonText of the JQuery UI Datepicker with our own:\n\nfunction doShowDatePicker(evt)\n{\n let originalfield = evt.target.closest(\".wh-form__dateinputgroup\").querySelector(`input[type=\"date\"]`);\n\nconsole.log(\"datepicker\", $(originalfield).datepicker);\n\n $(originalfield).datepicker(\"show\");\nwindow.__ofield = $(originalfield);\n\n //class=\"ui-datepicker-inline ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"\n}\n*/\n\n\n\n/*\n// Replaces upload fields with a nicer and edit-supporting version\ndompack.register(\".wh-form__upload\", node => new UploadField(node));\n\n// Enable the imgedit and/or rtd fields:\ndompack.register(\".wh-form__imgedit\", node => new ImgEditField(node));\ndompack.register(\".wh-form__rtd\", node => new RTDField(node));\n\ndompack.register(\".canvasupload\", node => new CanvasUploadField(node));\n\n// enable the line below AND the googleRecaptcha import if you want to use this recaptcha. you'll also need to enable it in the site profile\n// googleRecaptcha.setupGoogleRecaptcha();\n*/\n\n\n/*\n// Styled (native) pulldown: add wrapper around select element + arrow for css-styling\ndompack.register(\".wh-form select\", selectnode => {\n let wrappernode = <div class=\"wh-form__pulldown-styled\" />;\n selectnode.parentNode.insertBefore(wrappernode, selectnode);\n wrappernode.appendChild(selectnode);\n wrappernode.appendChild(<span class=\"arrow fas fa-angle-down\" />);\n});\n*/\n","import * as dompack from '@webhare/dompack';\nimport './internal/requiredstyles.css';\nimport * as merge from './internal/merge';\nimport { setFieldError, setupValidator } from './internal/customvalidation';\nimport FormBase, { type FormSubmitEmbeddedResult } from './formbase';\nimport RPCFormBase from './rpc';\nimport { sleep } from '@webhare/std';\nimport { downgradeUploadFields } from '@webhare/forms/src/domsupport';\n\nexport { FormBase, RPCFormBase, setFieldError, setupValidator, type FormSubmitEmbeddedResult };\n\ntype FormHandlerFactory = (form: HTMLFormElement) => FormBase;\n\nconst firstWarningMs = 150, warningIntervalMs = 5000;\nconst handlers: Record<string, FormHandlerFactory> = {\n \"publisher:form\": form => new FormBase(form),\n \"publisher:rpc\": form => new RPCFormBase(form)\n};\n\nexport const registerMergeFormatter = merge.registerFormatter;\n\nasync function scheduleFormSetup(form: HTMLFormElement, factory: FormHandlerFactory) {\n using lock = dompack.flagUIBusy();\n void (lock);\n\n const customEls = [...new Set(dompack.qSA(form, \"[name]\").map(_ => _.tagName.toLowerCase()))].filter(_ => _.includes(\"-\"));\n if (customEls.length) {\n const initPromise = Promise.all(customEls.map(_ => customElements.whenDefined(_))).then(() => ({ timeout: false }));\n\n let nextWarning = Date.now() + firstWarningMs;\n for (; ;) {\n const timeoutPromise = sleep(new Date(nextWarning)).then(() => ({ timeout: true }));\n const result = await Promise.race([initPromise, timeoutPromise]);\n if (!result.timeout)\n break;\n\n const missing = customEls.filter(tag => !customElements.get(tag)).join(\", \");\n if (missing === 'wh-fileedit') {\n console.warn(`Developers: we recommend explicitly registering a component for \".wh-form__upload\"`);\n downgradeUploadFields(form);\n break;\n }\n console.warn(`Still waiting for the following custom elements to be defined in form ${form.id ?? form.dataset.whFormId}:`, missing);\n nextWarning = Date.now() + warningIntervalMs;\n }\n }\n\n factory(form);\n}\n\nexport function registerHandler(handlername: string, handler: FormHandlerFactory) {\n if (handlers[handlername]) {\n console.error(`Duplicate registerHandler for handler '${handlername}'`);\n return; //this _MAY_ be caused by somehow duplicate loading of libs... seen that once and ignoring+continue would indeed be the safer solution\n }\n handlers[handlername] = handler;\n for (const form of dompack.qSA<HTMLFormElement>(`form[data-wh-form-handler=\"${CSS.escape(handlername)}\"]`))\n scheduleFormSetup(form, handler);\n}\n\n/** @deprecated setup() is no longer needed */\nexport function setup(options: unknown) {\n}\n\n/// Initialize all forms we already have the handler for\n//TODO consider explicitly registering a global capturing submit event to block all submission attempts on forms still being unhandled\ndompack.register<HTMLFormElement>(\"form[data-wh-form-handler]\", function (form) {\n if (handlers[form.dataset.whFormHandler!] && !form.propWhFormhandler) {\n scheduleFormSetup(form, handlers[form.dataset.whFormHandler!]);\n }\n});\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we can't know the types passed to merge call\ntype FormatFunction = (value: any) => string | number;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we can't know the types passed to merge call\ntype UpdateFunction = (node: HTMLElement, value: any) => void;\nconst formatters: { [key: string]: FormatFunction } = {};\nconst updaters: { [key: string]: UpdateFunction } = {};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we can't know the types passed to merge call\nfunction mergeNode(node: HTMLElement, set: string, data: any) {\n const parts = set.split(\":\");\n const isNodeFunc = parts.length === 1;\n if (parts.length > 2) {\n console.error(`Illegal merge expression: '${set}'`, node);\n return;\n }\n\n let func = \"\";\n let exprpath = (isNodeFunc ? parts[0] : parts[1]).trim();\n\n const callparts = exprpath.split(\"(\");\n if (callparts.length > 1) {\n if (callparts.length !== 2) {\n console.error(`Illegal merge value: '${set}'`, node);\n return;\n }\n\n func = callparts[0].trim();\n const funcrest = callparts[1].split(\")\");\n if (funcrest.length !== 2 || funcrest[1] !== \"\") {\n console.error(`Illegal merge value: '${set}'`, node);\n return;\n }\n exprpath = funcrest[0].trim();\n }\n\n let value = data;\n if (exprpath !== \"*\") {\n const exprpathparts = exprpath.split(\".\");\n for (let i = 0; i < exprpathparts.length; ++i) {\n value = value[exprpathparts[i].trim()];\n if (typeof value === \"undefined\")\n return;\n }\n }\n\n if (isNodeFunc) {\n if (func && updaters[func])\n updaters[func](node, value);\n else if (func)\n console.error(`Unknown updating function '${func}' in '${set}'`, node);\n else\n console.error(`A function is required for merges without a property (in '${set}')`, node);\n return;\n }\n\n const prop = parts[0].trim();\n if (func) {\n if (formatters[func])\n value = formatters[func](value);\n else {\n console.error(`Unknown formatting function '${func}' in '${set}'`, node);\n return;\n }\n }\n\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n console.error(`Got a value of type ${typeof value} in '${set}'`, node);\n return;\n }\n\n switch (prop) {\n case 'events':\n case 'styles':\n case 'children':\n case 'on':\n case \"className\":\n case \"class\":\n case 'style':\n case 'dataset':\n case 'childNodes':\n {\n console.error(`Cannot modify '${prop}' with merge`, node);\n return;\n }\n default:\n {\n // 1-to-1 name to property mapping\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we don't know which keys will be set\n (node as any)[prop] = value;\n return;\n }\n }\n}\n\n/**\n Apply all merge fields within a node, recursively\n *\n @param mergenode - Root node to start merging\n @param data - Merge data\n @param options - filter: If set, a function that will be called for every node with merge functions. If it returns a falsy value, the node will be skipped.\n */\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we can't know the types passed to merge call\nexport async function run(mergenode: ParentNode, data: any, { filter }: { filter?: (node: Element) => boolean } = {}) {\n const nodes = mergenode.querySelectorAll('*[data-merge],*[data-wh-merge]') as NodeListOf<HTMLElement>;\n for (const node of Array.from(nodes)) { //FIXME drop support for data-wh-merge as soon as we've completed the phase out\n if (node.nodeType !== 1 || (filter && !filter(node)))\n continue;\n\n // Parse 'a=b;c=d(e)'\n const sets = ((node as HTMLElement).dataset.merge || (node as HTMLElement).dataset.whMerge)?.split(\";\");\n if (sets)\n for (const set of sets)\n mergeNode(node, set, data);\n }\n}\n\n/**\n Register a formatter function.\n *\n @param name - Name of the formatter function\n @param callback - Formatter function. Called with parameter (value), must return a formatted value to write to the property.\n */\nexport function registerFormatter(name: string, callback: FormatFunction) {\n formatters[name] = callback;\n}\n\n/**\n Register an updater function (used to update multiple properties of a node at once)\n *\n @param name - Name of the updater function\n @param callback - Updater function. Called with parameters (node: HTMLElement, value: Any).\n */\nexport function registerUpdater(name: string, callback: UpdateFunction) {\n updaters[name] = callback;\n}\n","import * as dompack from '@webhare/dompack';\nimport \"./form.lang.json\";\nimport type { FieldErrorOptions, FormFrontendMessage } from '../formbase';\nimport { debugFlags } from '@webhare/env';\nimport { getFieldDisplayName, getFieldNativeError } from '@webhare/forms/src/domsupport';\n\n///Fired at nodes to apply error\nexport type SetFieldErrorData = {\n error: FormFrontendMessage;\n reportimmediately: boolean;\n serverside: boolean;\n metadata: unknown;\n};\n\nexport type FieldValidator<E extends HTMLElement = HTMLElement> = (node: E) => Promise<FormFrontendMessage | undefined> | FormFrontendMessage | undefined;\n\nfunction setupServerErrorClear(field: HTMLElement) {\n const group = field.closest<HTMLElement>('.wh-form__fieldgroup') || field;\n field.propWhCleanupFunction = () => {\n group.removeEventListener(\"change\", field.propWhCleanupFunction!, true);\n group.removeEventListener(\"input\", field.propWhCleanupFunction!, true);\n group.removeEventListener(\"blur\", field.propWhCleanupFunction!, true);\n setFieldError(field, '', { serverside: true });\n field.propWhCleanupFunction = undefined;\n };\n\n // to be rightly paranoid (plugins and JS directly editing other fields) we'll blur when anything anywhere seems to change\n // eg wrd.testwrdauth-emailchange would fail on Chrome without this if the browser window was not currently focused\n group.addEventListener(\"change\", field.propWhCleanupFunction, true);\n group.addEventListener(\"input\", field.propWhCleanupFunction, true);\n if (!field.closest('form[novalidate]')) //if we're doing html5 validation, errors will block submit, so let's already clear on blur\n group.addEventListener(\"blur\", field.propWhCleanupFunction, true);\n}\n\nclass ComponentValidationState {\n el: HTMLElement;\n\n /** Explicitly set error */\n explicit: {\n error: FormFrontendMessage;\n serverside: boolean;\n reportimmediately: boolean;\n metadata?: unknown;\n\n } | null = null;\n\n /** Dynamic errors (generated by the validation steps, refreshable instead of waiting for explciit errors) */\n dynamicError: FormFrontendMessage | null = null;\n\n validators: FieldValidator[] = [];\n\n constructor(el: HTMLElement) {\n this.el = el;\n }\n\n getState(): { error: FormFrontendMessage; suggested?: never } | { error?: never; suggested: FormFrontendMessage } | null {\n const err = this.getError();\n if (err)\n return { error: err };\n\n if (this.el.propWhValidationSuggestion)\n return { suggested: this.el.propWhValidationSuggestion };\n\n return null;\n }\n\n getError(): FormFrontendMessage | null {\n return this.explicit?.error || this.dynamicError || getFieldNativeError(this.el) || null;\n }\n\n hasError(): boolean {\n return Boolean(this.getError());\n }\n}\n\nconst validations = new WeakMap<HTMLElement, ComponentValidationState>();\n\nexport function getValidationState(field: HTMLElement) {\n\n const state = validations.get(field);\n if (state)\n return state;\n\n const newstate = new ComponentValidationState(field);\n validations.set(field, newstate);\n return newstate;\n}\n\n/* TODO Are we sure we should expose this API? A form-level setupValidator might be better as we can then re-validate at the proper point in time\n instead of relying on an external user to enable and shutdown the error. We're mixing two completely different systems with setupValidator (which\n works nicely with our focusout hadling) and setFieldError (which is extremely stateful and relies on the error-setter managing all the edge cases)\n\n Oh and serverside errors float somewhere halfway that spectrum.. as we setup explicit clearing callbacks to remove the state we created ourselves.\n*/\nexport function setFieldError(field: Element, error: FormFrontendMessage, options?: Partial<FieldErrorOptions>) {\n if (!dompack.isHTMLElement(field))\n throw new Error(`Field is not a valid target for handling errors`);\n\n const state = getValidationState(field);\n if (!error) { //clearing\n if (!state.explicit)\n return; //no change\n\n state.explicit = null;\n if (debugFlags.fhv)\n console.log(`[fhv] Clearing error state for ${getFieldDisplayName(field)}`, field, error, options);\n } else { //changing ?\n if (debugFlags.fhv)\n console.log(`[fhv] ${state.explicit ? 'Updating' : 'Setting'} error state for ${getFieldDisplayName(field)}`, field, error, options);\n\n state.explicit = {\n error,\n serverside: options?.serverside || false,\n reportimmediately: options?.reportimmediately || false,\n metadata: options?.metadata\n };\n\n if (options?.serverside)\n setupServerErrorClear(field);\n }\n\n updateFieldError(field);\n}\n\nexport function updateFieldError(field: HTMLElement) {\n const state = getValidationState(field);\n\n dompack.dispatchCustomEvent(field, 'wh:form-setfielderror', //this is where parsley hooks in and cancels to handle the rendering of faults itself\n {\n bubbles: true,\n cancelable: true,\n detail: {\n error: state.explicit?.error || getFieldNativeError(field) || '',\n reportimmediately: state.explicit?.reportimmediately || false,\n serverside: state.explicit?.serverside || false,\n metadata: state.explicit?.metadata\n }\n });\n}\n\n/** Set up a custom validator\n * @param node - Form element to validate\n * @param checker - Sync or async function that returns a string with an error message or undefined if the field is valid.\n*/\nexport function setupValidator<NodeType extends HTMLElement>(node: NodeType, checker: FieldValidator<NodeType>): void {\n getValidationState(node).validators.push(checker as FieldValidator);\n\n //if the checker as a name, we'll add it. otherwise we'll ensure that data-wh-form-custom-validator is set so we can scan for it (and it's probably nice to see it in the dom)\n node.dataset.whFormCustomValidator = ((node.dataset.whFormCustomValidator || \"\") + \" \" + (checker.name || \"?\")).trim();\n}\n","// Auto-generated language file from /opt/wh/whtree/modules/publisher/js/forms/internal/form.lang.json\nvar registerTexts = require(\"@mod-tollium/js/gettid\").registerTexts;\nregisterTexts(\"publisher\",\"nl\",{\"site\":{\"forms\":{\"addressfield\":{\"address_not_found\":\"Het adres kon niet worden gevonden.\",\"invalid_nr_detail\":\"Ongeldig huisnummer.\",\"invalid_zip\":\"Ongeldige postcode.\",\"zip_not_found\":\"Combinatie van postcode en huisnummer komt niet voor.\"},\"commonerrors\":{\"alphanum\":\"De waarde moet alfanumeriek zijn.\",\"badfiletype\":\"Dit bestandstype is niet toegestaan\",\"check\":[\"Kies minimaal \",1,\" en maximaal \",2,\" items.\"],\"date\":\"Dit is geen geldige datum.\",\"default\":\"Deze waarde is onjuist.\",\"digits\":\"De waarde moet numeriek zijn.\",\"email\":\"Dit is geen geldig e-mailadres.\",\"email_baddomain\":[\"Vanwege problemen met het e-mailen naar \",1,\" e-mailadressen, willen we je vragen om een alternatief e-mailadres te gebruiken.\"],\"email_suggestion\":[\"Bedoel je \",1,\"?\"],\"equalto\":\"De waardes moeten identiek zijn.\",\"integer\":\"De waarde moet een nummer zijn.\",\"length\":[\"De waarde moet tussen \",1,\" en \",2,\" karakters lang zijn.\"],\"max\":[\"De waarde mag niet groter zijn dan \",1,\".\"],\"maxarray\":[\"U kunt maximaal \",{\"t\":\"ifparam\",\"subs\":[\"1 onderdeel\"],\"subselse\":[1,\" onderdelen\"],\"p\":1,\"value\":\"1\"},\" toevoegen.\"],\"maxcheck\":[\"Kies maximaal \",{\"t\":\"ifparam\",\"subs\":[\"1 item\"],\"subselse\":[1,\" items\"],\"p\":1,\"value\":\"1\"},\".\"],\"maxlength\":[\"De waarde is te lang. Deze mag maximaal \",{\"t\":\"ifparam\",\"subs\":[\"1 karakter\"],\"subselse\":[1,\" karakters\"],\"p\":1,\"value\":\"1\"},\" lang zijn.\"],\"min\":[\"De waarde mag niet lager zijn dan \",1,\".\"],\"minarray\":[\"U moet minimaal \",{\"t\":\"ifparam\",\"subs\":[\"1 onderdeel\"],\"subselse\":[1,\" onderdelen\"],\"p\":1,\"value\":\"1\"},\" toevoegen.\"],\"mincheck\":[\"Kies minimaal \",{\"t\":\"ifparam\",\"subs\":[\"1 item\"],\"subselse\":[1,\" items\"],\"p\":1,\"value\":\"1\"},\".\"],\"minlength\":[\"De tekst is te kort. Deze moet uit minimaal \",{\"t\":\"ifparam\",\"subs\":[\"1 karakter\"],\"subselse\":[1,\" karakters\"],\"p\":1,\"value\":\"1\"},\" bestaan.\"],\"notblank\":\"De waarde mag niet leeg zijn.\",\"number\":\"De waarde moet een nummer zijn.\",\"pattern\":\"De waarde is onjuist.\",\"range\":[\"De waarde moet tussen \",1,\" en \",2,\" liggen.\"],\"required\":\"Dit veld is verplicht.\",\"step1mismatch\":\"De waarde moet een geheel getal zijn\",\"stepmismatch\":[\"De waarde moet een meervoud zijn van \",1,\".\"],\"time\":\"Dit is geen geldige tijd.\",\"unacceptableemail\":\"Dit e-mailadres is hier niet toegestaan\",\"upload_cannotcheck\":\"Dit bestand kan niet geüpload worden omdat we het momenteel niet kunnen verifiëren\",\"upload_suspicious\":\"Dit bestand ziet er verdacht uit en kan helaas niet geüpload worden\",\"url\":\"Dit is geen geldige URL.\"},\"imgedit-explain-upload\":\"Sleep bestanden hier of klik om te uploaden\",\"imgedit-groupelement-replace\":[1,\", Vervang afbeelding\"],\"imgedit-groupelement-upload\":[1,\", Upload afbeelding\"],\"imgedit-remove\":\"Verwijder afbeelding\",\"nextpage\":\"Volgende\",\"previouspage\":\"Vorige\",\"selectfile\":\"Selecteer bestand\",\"splitdatetime-day-arialabel\":\"dag\",\"splitdatetime-hours-arialabel\":\"uur\",\"splitdatetime-minutes-arialabel\":\"minuut\",\"splitdatetime-month-arialabel\":\"maand\",\"splitdatetime-seconds-arialabel\":\"seconde\",\"splitdatetime-year-arialabel\":\"jaar\",\"starsrequired\":\"* betekent dat een veld verplicht is\",\"submit\":\"Versturen\",\"upload-emptytext\":\"Geen bestand geselecteerd\",\"upload-filename\":[\"Geselecteerde bestand is \",1],\"upload-remove\":\"Verwijder bestand\"}}});\n// Adding dependency: /opt/wh/whtree/modules/publisher/language/nl.xml\n","import * as dompack from 'dompack';\nimport { qSA } from 'dompack';\nimport * as datetime from 'dompack/types/datetime';\nimport AddressField from '@mod-publisher/js/forms/fields/addressfield';\nimport CaptchaField from '@mod-publisher/js/forms/fields/captchafield';\nimport { setupValidator } from './customvalidation';\n\nimport { getTid } from \"@mod-tollium/js/gettid\";\nimport \"./form.lang.json\";\nimport { formatDate, parseISODate } from './datehelpers';\nimport { isValidDate } from '@webhare/std';\n\nfunction validateCheckboxGroup(groupnode: HTMLElement) {\n const nodes = dompack.qSA<HTMLInputElement>(groupnode, \"input[type='checkbox']\");\n const min = Number(groupnode.dataset.whMin) || 0;\n const max = Number(groupnode.dataset.whMax) || 0;\n\n const anyenabled = nodes.some(node => !node.disabled);\n const numChecked = nodes.filter(node => node.checked).length;\n\n if (anyenabled) {\n if (numChecked < min)\n return getTid(\"publisher:site.forms.commonerrors.mincheck\", min);\n else if (max > 0 && numChecked > max)\n return getTid(\"publisher:site.forms.commonerrors.maxcheck\", max);\n }\n}\n\nfunction validateRadioGroup(groupnode: HTMLElement) {\n const nodes = dompack.qSA<HTMLInputElement>(groupnode, \"input[type='radio']\");\n const isrequired = nodes.some(node => node.required);\n\n if (isrequired) {\n const isanychecked = nodes.some(node => node.checked && !node.disabled);\n if (!isanychecked)\n return getTid(\"publisher:site.forms.commonerrors.required\");\n }\n}\n\nexport function reformatDate(datestr: string): string {\n const parsed = parseISODate(datestr);\n return parsed ? formatDate(\"D-M-Y\", parsed.year, parsed.month, parsed.day) : \"\";\n}\n\nfunction validateDate(date: HTMLInputElement) {\n if (date.getAttribute('type') !== 'date') //it's no longer a date field\n return '';\n if (!date.value) //any required checks should be handled by the HTML5 compat layer, nothing for us to check\n return '';\n\n const dateparts = date.value.match(/^([0-9]+)-([0-9]+)-([0-9]+)$/) || [];\n const year = parseInt(dateparts[1]), month = parseInt(dateparts[2]), day = parseInt(dateparts[3]);\n if (!isValidDate(year, month, day))\n return getTid(\"publisher:site.forms.commonerrors.default\");\n\n const normalizeddate = ('0000' + year).substr(-4) + '-' + ('00' + month).substr(-2) + '-' + ('00' + day).substr(-2);\n const min = date.getAttribute(\"min\"), max = date.getAttribute(\"max\");\n if (min && normalizeddate < min)\n return getTid(\"publisher:site.forms.commonerrors.min\", reformatDate(min));\n if (max && normalizeddate > max)\n return getTid(\"publisher:site.forms.commonerrors.max\", reformatDate(max));\n\n return '';\n}\n\nfunction validateTime(time: HTMLInputElement) {\n if (time.getAttribute('type') !== 'time') //it's no longer a time field\n return '';\n if (!time.value) //any required checks should be handled by the HTML5 compat layer, nothing for us to check\n return '';\n\n const timeparts = time.value.match(/^([0-9]+):([0-9]+)(:([0-9]+))?$/) || [];\n const hours = parseInt(timeparts[1]), minutes = parseInt(timeparts[2]), seconds = parseInt(timeparts[3]);\n if (isNaN(hours) || isNaN(minutes) || hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || (!isNaN(seconds) && (seconds < 0 || seconds > 59)))\n return getTid(\"publisher:site.forms.commonerrors.default\");\n\n return '';\n}\n\nexport function setup(form: HTMLElement) {\n for (const datecontrol of qSA<HTMLInputElement>(form, 'input[type=date]')) {\n for (const field of ['whMin', 'whMax', 'whValue'])\n if (datecontrol.dataset[field]) {\n //parse 'now' or 'now+5d'. be able to extract '+5d'\n const datematch = datecontrol.dataset[field]!.match(/^now((\\+|-)\\d+d)?$/);\n\n if (datematch) {\n const propname = field.substr(2).toLowerCase();\n let thedate;\n if (datematch[1])\n thedate = new Date(Date.now() + parseInt(datematch[1]) * 86400 * 1000);\n else\n thedate = new Date;\n\n (datecontrol as unknown as Record<string, string>)[propname] = datetime.getISOLocalDate(thedate);\n }\n }\n\n if (datecontrol.type !== 'date' && !datecontrol.whValidationPolyfilled) { //this browser doesn't natively support date fields\n datecontrol.whValidationPolyfilled = true;\n //ADDME some sort of global validator would be better so we don't get confused by fields that change their type\n setupValidator(datecontrol, validateDate);\n }\n }\n\n for (const timecontrol of qSA<HTMLInputElement>(form, 'input[type=time][data-wh-value]')) {\n //parse 'now'\n //ADDME: Support for stuff like 'now + 15 minutes' 'next whole hour + 2.5 hours'?\n const timematch = timecontrol.dataset.whValue!.match(/^now$/);\n\n if (timematch) {\n const thedate = new Date;\n\n let propvalue = ('0' + thedate.getHours()).substr(-2) + '-' + ('0' + thedate.getMinutes()).substr(-2);\n if (parseInt(timecontrol.getAttribute(\"step\") || '0') % 60) //step not multiple of 60? seconds\n propvalue += '-' + ('0' + thedate.getSeconds()).substr(-2);\n timecontrol.value = propvalue;\n }\n\n if (timecontrol.type !== 'time' && !timecontrol.whValidationPolyfilled) { //this browser doesn't natively support time fields\n timecontrol.whValidationPolyfilled = true;\n //ADDME some sort of global validator would be better so we don't get confused by fields that change their type\n setupValidator(timecontrol, validateTime);\n }\n }\n\n // Setup checkbox group (min/max checked) validation\n for (const checkboxgroup of qSA(form, \".wh-form__fieldgroup--checkboxgroup\"))\n setupValidator(checkboxgroup, validateCheckboxGroup);\n\n // Setup radio group (hidden/disabled) validation\n for (const radiogroup of qSA(form, \".wh-form__fieldgroup--radiogroup\")) {\n setupValidator(radiogroup, validateRadioGroup);\n\n //we should probably disable by name (or form.elements[name] but validate() and form isn't really tracking name either...\n dompack.qSA<HTMLInputElement>(radiogroup, `input[type='radio']`).forEach(\n node => node.dataset.whFormSkipnativevalidation = \"true\"); //don't handle by both RadioGroupField *and* native validation\n\n }\n\n // Setup address field validation\n for (const addresscontrol of qSA(form, \".wh-form__fieldgroup--addressfield\"))\n new AddressField(addresscontrol);\n\n // Setup on-demand captcha\n if (form.dataset.whFormCaptcha) {\n //TODO add something like virtualfields to forms but that is too much for a backport.\n const captchanode = <wh-form-captcha data-wh-form-name={form.dataset.whFormCaptcha} />;\n form.appendChild(captchanode);\n new CaptchaField(captchanode);\n }\n}\n","/**\n * Get ISO-formatted local date from a date (getISOString returns an UTC datetime)\n *\n * @param date - Date to return\n * @returns Date as a YYYY-MM-DD string\n */\nexport function getISOLocalDate(date: Date) {\n return date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + date.getDate()).slice(-2);\n}\n","import * as dompack from \"@webhare/dompack\";\nimport FormBase from \"../formbase\";\nimport { debugFlags } from \"@webhare/env\";\nimport { verifyHareScriptAddress, type HareScriptAddressValidationResult, type AddressChecks, type HareScriptAddressValue } from \"@webhare/forms/src/address\";\nimport { setFieldError } from \"../internal/customvalidation\";\nimport { throwError } from \"@webhare/std\";\n\nclass SubField {\n node;\n fieldgroup: HTMLElement;\n pos: number;\n\n constructor(node: dompack.FormControlElement, pos: number) {\n this.node = node;\n this.pos = pos;\n this.fieldgroup = node.closest(\".wh-form__fieldgroup\") ?? throwError(\"Could not find fieldgroup for field\");\n }\n}\n\ninterface OrderingData {\n countries: string[];\n fieldorder: string[];\n}\n\nexport default class AddressField {\n numvaliditycalls = 0;\n node: HTMLElement;\n formnode: HTMLFormElement;\n countryNode: HTMLSelectElement;\n currentcountry: string;\n fieldName: string;\n orderingData: OrderingData[];\n allFields = new Map<string, SubField>;\n _updatingFields = false;\n\n constructor(node: HTMLElement) {\n this.node = node;\n //We won't FormBase.getForNode yet here so we're not too dependent on registration ordering\n this.formnode = node.closest(\"form\") ?? throwError(\"Could not find form for addressfield\");\n\n // AddressField is initialized for the address's country field, so first find the other fields\n this.countryNode = dompack.qR(this.node, \"select.wh-form__pulldown\"); //TODO why aren't we targetting by ID ? this will work but seems ambiguous\n if (!this.countryNode)\n throw new Error(\"Could not find country select node\");\n if (!this.countryNode.dataset.orderingdata)\n throw new Error(\"Addressfield not properly configured\");\n\n this.currentcountry = this.countryNode.value;\n this.fieldName = this.countryNode.name.substr(0, this.countryNode.name.lastIndexOf(\".\"));\n this.orderingData = JSON.parse(this.countryNode.dataset.orderingdata) as OrderingData[];\n const prefixLength = this.fieldName.length + 1; // fieldName + \".\"\n this.allFields = new Map();\n let fieldpos = 0;\n this.allFields.set(this.countryNode.name.substr(prefixLength), new SubField(this.countryNode, ++fieldpos));\n\n for (const field of dompack.qSA<HTMLInputElement | HTMLTextAreaElement>(this.formnode, `[name^='${this.fieldName}.']`)) {\n this.allFields.set(field.name.substring(prefixLength), new SubField(field, ++fieldpos));\n\n field.addEventListener(\"change\", event => this._gotFieldChange(event));\n }\n\n if (this.orderingData) {\n this.countryNode.addEventListener(\"change\", () => this._reconfigureFieldOrdering());\n this._reconfigureFieldOrdering();\n }\n }\n\n _gotFieldChange(event: Event) {\n if (this._updatingFields)\n return; // We're updating our own fields\n\n if (event.target === this.countryNode && this.currentcountry !== this.countryNode.value) {\n //country changed. clear errors on all fields before revalidating.. otherwise the errors will just seem to 'linger' for a while after switching\n this._clearErrors();\n this.currentcountry = this.countryNode.value;\n }\n\n if (this._getFieldValue(\"country\") === \"NL\") {\n if (!this._getFieldValue(\"zip\") || !this._getFieldValue(\"nr_detail\"))\n return;\n }\n this._checkValidity(event);\n }\n\n _getFieldValue(fieldname: string) {\n const data = this.allFields.get(fieldname);\n if (data)\n return data.node.value;\n return \"\";\n }\n\n _getFirstCountrySpecificField() {\n let firstfield = null;\n for (const [key, field] of this.allFields.entries())\n if (key !== \"country\" && !field.fieldgroup.classList.contains(\"wh-form__fieldgroup--hidden\") && (!firstfield || firstfield.pos > field.pos))\n firstfield = field;\n\n return firstfield ?? throwError(\"Cannot find field for error\");\n }\n\n _reconfigureFieldOrdering() {\n const country = this.countryNode.value;\n if (country) {\n const ordering = this.orderingData.find(e => e.countries.length === 0 || e.countries.includes(country));\n if (ordering) {\n let prevgroup;\n for (let idx = 0; idx < ordering.fieldorder.length; ++idx) {\n const item = this.allFields.get(ordering.fieldorder[idx]);\n if (!item)\n continue; //ordering may appear to fields that have not been rendered, eg 'state'\n\n item.pos = idx + 1;\n const fieldgroup = item.fieldgroup;\n if (prevgroup) {\n const compareres = prevgroup!.compareDocumentPosition(fieldgroup);\n if (compareres & Node.DOCUMENT_POSITION_PRECEDING)\n prevgroup!.parentNode!.insertBefore(fieldgroup, prevgroup!.nextSibling);\n }\n prevgroup = fieldgroup;\n }\n }\n }\n\n //street + city should skip client side validation for NL, we will be looking it up server side (FIXME we should consider overwriting our validation to delay validation until address lookups are complete)\n for (const fieldname of ['street', 'city']) {\n const field = this.allFields.get(fieldname);\n if (field)\n if (country.toUpperCase() === 'NL')\n field.node.setAttribute(\"data-wh-form-skipnativevalidation\", \"\");\n else\n field.node.removeAttribute(\"data-wh-form-skipnativevalidation\");\n }\n }\n\n _clearErrors() {\n this.allFields.forEach(field => setFieldError(field.node, \"\", { reportimmediately: true }));\n }\n\n _getCurState() {\n const value: HareScriptAddressValue = { country: \"\" };\n const visiblefields: HTMLElement[] = [];\n let anyset = false, allrequiredset = true;\n this.allFields.forEach((field, key) => {\n if (!field.fieldgroup.classList.contains(\"wh-form__fieldgroup--hidden\")) {\n visiblefields.push(field.node.closest(\".wh-form__fieldgroup\")!);\n value[key as keyof HareScriptAddressValue] = field.node.value;\n\n if (!anyset && key !== 'country' && field.node.value)\n anyset = true;\n if (field.node.required && !field.node.value && !field.node.hasAttribute(\"data-wh-form-skipnativevalidation\"))\n allrequiredset = false;\n }\n });\n\n return { value, visiblefields, anyset, allrequiredset, lookupkey: JSON.stringify(value) };\n }\n\n async _checkValidity(event: Event) {\n const form = FormBase.getForNode(this.formnode) ?? throwError(\"Parent form for address field not yet initialized\");\n /* we used to clear fields that are no longer visible after a country change, add visible fields to the value we're checking\n but not sure why. ignoring those fields should be okay? and this is a very eager trigger, so if we really do this, do\n this on base of the country actually changing, not an external checkbox controlling visibility of the whole country field\n and a stray update event\n */\n const curstate = this._getCurState();\n if (!curstate.anyset) { //fields are empty..\n this._clearErrors();\n return; //then don't validate\n }\n if (!curstate.allrequiredset)\n return; //no need to validate if we don't even have the required fields in place\n\n let result: HareScriptAddressValidationResult;\n const lock = dompack.flagUIBusy();\n try {\n curstate.visiblefields.forEach(el => el.classList.add(\"wh-form__fieldgroup--addresslookup\"));\n ++this.numvaliditycalls;\n result = await verifyHareScriptAddress(curstate.value as HareScriptAddressValue, {\n lang: form.getLangCode(),\n checks: (this.node.dataset.checks?.split(' ') ?? []) as AddressChecks[]\n });\n } catch (e) {\n console.error(`Error while validating value: ${e}`);\n return;\n } finally {\n if (--this.numvaliditycalls === 0) //we're the last call\n curstate.visiblefields.forEach(el => el.classList.remove(\"wh-form__fieldgroup--addresslookup\"));\n\n lock.release();\n }\n if (this._getCurState().lookupkey !== curstate.lookupkey)\n return; //abandon this _checkValidity call, the field has already changed.\n\n if (debugFlags.fhv)\n console.log(`[fhv] Validation result for address '${this.fieldName}': ${result.status}`);\n\n if (debugFlags.fdv) {\n if ([\"different_citystreet\", \"incomplete\"].includes(result.status))\n console.warn(`[fdv] Address validation was performed, processing incomplete address (status: '${result.status}')`);\n else {\n console.warn(`[fdv] Ignoring return status '${result.status}' of address validation`);\n result.status = \"ok\";\n }\n }\n\n this._clearErrors();\n\n for (const err of result.errors) {\n const field = this.allFields.get(err.fields[0]) ?? this._getFirstCountrySpecificField();\n if (field)\n form.setFieldError(field.node, err.message, { reportimmediately: true });\n }\n\n if (result.corrections) {\n let anychanges = false;\n this._updatingFields = true;\n\n for (const [key, newvalue] of Object.entries(result.corrections)) {\n const field = this.allFields.get(key);\n if (field && field.node.value !== newvalue) {\n dompack.changeValue(field.node, newvalue);\n anychanges = true;\n }\n }\n\n this._updatingFields = false;\n if (anychanges)\n form.refreshConditions();\n }\n }\n}\n","import * as dompack from '@webhare/dompack';\nimport { DocEvent, FormControlElement, TakeFocusEvent, addDocEventListener, isFormControl } from '@webhare/dompack';\nimport * as domfocus from 'dompack/browserfix/focus';\nimport * as webharefields from './internal/webharefields';\nimport * as merge from './internal/merge';\nimport './internal/requiredstyles.css';\nimport \"./internal/form.lang.json\";\nimport { SetFieldErrorData, getValidationState, setFieldError, setupValidator, updateFieldError } from './internal/customvalidation';\nimport * as pxl from '@mod-consilio/js/pxl';\nimport { generateRandomId, isPromise, wrapSerialized } from '@webhare/std';\nimport { debugFlags, isLive, navigateTo, type NavigateInstruction } from '@webhare/env';\nimport { getFieldDisplayName, isFieldNativeErrored, isRadioOrCheckbox, isRadioNodeList, type ConstrainedRadioNodeList, parseCondition, getFormElementCandidates, isFormFieldLike, queryFormFieldLike } from '@webhare/forms/src/domsupport';\nimport { rfSymbol } from '@webhare/forms/src/registeredfield';\nimport type { FormCondition, FormFileValue } from '@webhare/forms/src/types';\nimport { FieldMapDataProxy, FormFieldMap } from '@webhare/forms/src/fieldmap';\n\n//Suggestion or error messages\nexport type FormFrontendMessage = HTMLElement | string;\n\ndeclare global {\n interface HTMLElement {\n //TODO Clean this up, these are internal. Move to a weakobject ?\n propWhFormSavedRequired?: boolean;\n propWhFormSavedEnabled?: boolean;\n propWhFormSavedHidden?: boolean;\n //TODO And how does this differ from propWhFormSavedRequired?\n propWhFormInitialRequired?: boolean;\n propWhFormCurrentEnabled?: boolean;\n propWhFormCurrentRequired?: boolean;\n propWhFormCurrentVisible?: boolean;\n //TODO It's suspicious that both propWhFormCurrent... and propWhNodeCurrent... exist\n propWhNodeCurrentEnabled?: boolean;\n propWhNodeCurrentRequired?: boolean;\n propWhNodeCurrentHidden?: boolean;\n propWhFormlineCurrentVisible?: boolean;\n propWhValidationSuggestion?: FormFrontendMessage | null;\n propWhCleanupFunction?: () => void;\n propWhFormhandler?: FormBase<object>;\n whFormsApiChecker?: () => Promise<void> | void;\n whUseFormGetValue?: boolean;\n whValidationPolyfilled?: boolean;\n __didPlaceholderWarning?: boolean;\n }\n\n interface GlobalEventHandlersEventMap {\n \"wh:form-enable\": CustomEvent<{ enabled: boolean }>;\n \"wh:form-require\": CustomEvent<{ required: boolean }>;\n \"wh:form-getvalue\": CustomEvent<{ deferred: PromiseWithResolvers<unknown> }>;\n \"wh:form-setfielderror\": CustomEvent<SetFieldErrorData>; //TODO can we phase this out? it's a too deep integration\n \"wh:form-pagechange\": CustomEvent<{\n formHandler: FormBase<object>;\n /** TODO Add numPages and currentPage, but we'd need to figure out how to properly account for Captcha pages (you don't want either numPages or currentPage to count that one)\n numPages: number;\n currentPage: number;\n */\n }>;\n }\n}\n\ntype ExtraData = unknown;\n\ntype FormControlDescription = {\n name: string;\n multi: false;\n node: HTMLElement;\n} | {\n name: string;\n multi: true;\n nodes: HTMLInputElement[];\n};\n\nexport type FormResultValue = Record<string, unknown>;\n\n/** The result returned to onSubmitSuccess */\nexport type FormSubmitEmbeddedResult<UserResult = { [key: string]: unknown }> = UserResult & {\n //webtool submit additions. TODO a future API shouldn't mix these at the same level but allow them in the FormSubmitResult\n submittype?: string;\n richvalues?: RichValues;\n resultsguid?: string;\n submitinstruction?: NavigateInstruction;\n};\n\nexport interface FormSubmitMessage {\n name: string;\n message: string;\n metadata: unknown;\n}\n\nexport interface FormSubmitResult {\n success: boolean;\n //TODO a next form iteration should not mix all these additional props into the form user's 'result'\n result: FormSubmitEmbeddedResult;\n errors: FormSubmitMessage[];\n warnings: FormSubmitMessage[];\n}\n\ntype RichValues = Array<{ field: string; value: string }>;\n\nexport interface FieldErrorOptions {\n serverside: boolean;\n reportimmediately: boolean;\n metadata?: unknown;\n}\n\ntype LimitSet = undefined | HTMLElement | HTMLElement[];\n\ninterface ValidationOptions {\n // focusfailed Focus the first invalid element (defaults to true)\n focusfailed?: boolean;\n iffailedbefore?: boolean;\n}\n\ninterface ValidationResult {\n /// True if the fields successfuly validated\n valid: boolean;\n failed: HTMLElement[];\n firstfailed: HTMLElement | null;\n}\n\ninterface ValidationQueueElement {\n limitset?: LimitSet;\n options?: ValidationOptions;\n defer: PromiseWithResolvers<ValidationResult>;\n}\n\ninterface PageState {\n pages: HTMLElement[];\n curpage: number;\n}\n\n//Query used to find valid submittors\nconst submitselector = 'input[type=submit],input[type=image],button[type=submit],button:not([type])';\n//Must match possible types returned by the submitselector\ntype SubmitSelectorType = HTMLInputElement | HTMLButtonElement;\n\nlet delayvalidation = false, validationpendingfor: EventTarget | null = null;\n\nfunction getPageIdx(state: PageState, page: number | HTMLElement) {\n if (typeof page === 'number') {\n if (page < 0 || page >= state.pages.length)\n throw new Error(`Cannot navigate to nonexisting page #${page}`);\n return page;\n }\n\n const idx = state.pages.indexOf(page);\n if (idx === -1) {\n console.error(`Cannot find page by element`, page);\n throw new Error(`Cannot find page`);\n }\n\n return idx;\n}\n\nfunction getErrorFields(validationresult: ValidationResult) {\n return validationresult.failed.map(field => getName(field) || field.dataset.whFormGroupFor || \"?\")\n .sort()\n .filter((value, index, self) => self.indexOf(value) === index) //unique filter\n .join(\" \");\n}\nfunction hasEverFailed(field: HTMLElement) {\n if (field.matches(\"input[type=radio],input[type=checkbox]\")) //these are handled by their group, so do the failed check there\n return field.closest(\".wh-form__fieldgroup\")?.classList.contains('wh-form__field--everfailed');\n\n return field.classList.contains('wh-form__field--everfailed');\n}\nfunction doValidation(field: EventTarget | null, iffailedbefore: boolean) {\n if (iffailedbefore || validationpendingfor)\n releasePendingValidations(); //release any earlier validation. this also cancels 'delayvalidation' but better safe than sorry if we double-run here\n\n if (delayvalidation) { //Can't be \"iffailedbefore\" as that would have been cleared above\n if (debugFlags.fhv)\n console.log(\"[fhv] doValidation: validations are delayed. now pending: \", field);\n validationpendingfor = field;\n return;\n }\n\n const form = (field as HTMLElement).closest?.('form');\n if (!form || !form.propWhFormhandler)\n return;\n\n const formhandler = form.propWhFormhandler;\n formhandler.validate([field as HTMLElement], { focusfailed: false, iffailedbefore: iffailedbefore });\n}\n\n\nfunction doDelayValidation() {\n if (delayvalidation)\n releasePendingValidations();\n\n delayvalidation = true;\n}\n\nfunction getName(field: HTMLElement) {\n return field.dataset.whFormName || (field as HTMLInputElement).name || \"\";\n}\n\nfunction releasePendingValidations() {\n if (!delayvalidation)\n return;\n\n delayvalidation = false;\n\n if (validationpendingfor) {\n const tovalidate = validationpendingfor;\n if (debugFlags.fhv)\n console.log(\"[fhv] releasePendingValidations: \", tovalidate);\n validationpendingfor = null;\n doValidation(tovalidate, false);\n }\n}\n\n/* Browser extensions such as 1Password interfere with the event model and may\n cause focusout to not fire for email and password fields. They don't seem\n to break focusin so we'll watch focusin to detect missed focusout events */\nlet lastfocusout: EventTarget | null = null;\nfunction handleFocusOutEvent(event: FocusEvent) {\n lastfocusout = event.target;\n doValidation(event.target, false);\n}\nfunction handleFocusInEvent(event: FocusEvent) {\n if (event.relatedTarget && lastfocusout !== event.relatedTarget)\n doValidation(event.relatedTarget, false);\n}\n\nfunction handleValidateAfterEvent(event: Event) {\n doValidation(event.target, true);\n}\n\nexport default class FormBase<DataShape extends object = Record<string, unknown>> extends FormFieldMap<DataShape> {\n /** @deprecated Use node.elements if you want a true HTMLFormControlsCollection, use getElementByName since WH5.4+ for properly typed elements */\n readonly elements: HTMLFormControlsCollection;\n private _formsessionid = generateRandomId();\n private _firstinteraction: number | undefined;\n protected _submitstart: number | undefined;\n private validationqueue = new Array<ValidationQueueElement>;\n private _submitter: SubmitSelectorType | null = null;\n private _submittimeout: NodeJS.Timeout | undefined;\n /** Is the form considered interactive yet? Used to ignore changes done by code/setFieldValue */\n private isInteractive = true;\n /** Did we warn about old style form controls? */\n private didLegacyWarning = false;\n\n readonly data = new Proxy<DataShape>({} as DataShape, new FieldMapDataProxy(this));\n\n constructor(public readonly node: HTMLFormElement) {\n if (node.nodeName !== 'FORM')\n throw new Error(\"Specified node is not a <form>\"); //we want our clients to be able to assume 'this.node.elements' works\n\n super(\"\", getFormElementCandidates(node, ''));\n\n this.elements = node.elements;\n if (this.node.propWhFormhandler)\n throw new Error(\"Specified node already has an attached form handler\");\n this.node.propWhFormhandler = this;\n\n //Implement webhare fields extensions, eg 'now' for date fields or 'enablecomponents'\n webharefields.setup(this.node);\n //Implement page navigation\n addDocEventListener(this.node, \"click\", evt => this._checkClick(evt));\n addDocEventListener(this.node, \"dompack:takefocus\", evt => this._onTakeFocus(evt));\n addDocEventListener(this.node, \"input\", evt => this._onInputChange(), { capture: true });\n addDocEventListener(this.node, \"change\", evt => this._onInputChange(), { capture: true });\n addDocEventListener(this.node, 'submit', evt => this._submit(evt, null));\n addDocEventListener(this.node, 'wh:form-dosubmit', evt => { throw new Error(`wh:form-dosubmit is no longer supported`); });\n addDocEventListener(this.node, \"wh:form-setfielderror\", evt => this._doSetFieldError(evt));\n addDocEventListener(this.node, \"mousedown\", doDelayValidation);\n addDocEventListener(this.node, \"focusout\", handleFocusOutEvent, { capture: true });\n addDocEventListener(this.node, \"input\", handleValidateAfterEvent, { capture: true });\n addDocEventListener(this.node, \"change\", handleValidateAfterEvent, { capture: true });\n this.node.noValidate = true;\n\n this._rewriteEnableOn();\n this._updateConditions(true); //Update required etc handlers\n this._applyPrefills();\n\n //Update page navigation\n const pagestate = this._getPageState();\n this._updatePageVisibility(pagestate.pages, 0);\n this._updatePageNavigation();\n }\n\n static getForNode<DataShape extends object = Record<string, unknown>>(node: HTMLElement): FormBase<DataShape> | null {\n return (node.propWhFormhandler as FormBase<DataShape>) || null;\n }\n\n ///like namedItem but improves on the types returned. does *not* lookup by data-wh-form-name!\n getElementByName(name: string): FormControlElement | ConstrainedRadioNodeList | null {\n return this.node.elements.namedItem(name) as FormControlElement | ConstrainedRadioNodeList | null;\n }\n\n /** Get language for this form */\n getLangCode() {\n return this.node.closest<HTMLElement>('[lang]')?.lang ?? 'en';\n }\n\n sendFormEvent(eventtype: string, vars?: pxl.PxlEventData) {\n const now = Date.now();\n const isfirst = !this._firstinteraction;\n\n if (isfirst && !this.isInteractive) { //ignore events triggered by code. we didn't explicitly do this earlier because applyPrefills() happened to run before enabling form processing (_setupFormHandler)\n if (eventtype)\n console.warn(`[forms] Got a '${eventtype}' event due to a non-interactive change, ignoring`);\n return;\n }\n this._firstinteraction ||= now;\n\n const pagestate = this._getPageState();\n vars = {\n ds_formmeta_id: this.node.dataset.whFormId || '',\n ds_formmeta_session: this._formsessionid,\n ds_formmeta_pagetitle: this._getPageTitle(pagestate.curpage),\n ...vars\n };\n\n if (this._submitstart) //is set during a pending submission\n vars.dn_formmeta_waittime = Date.now() - this._submitstart;\n\n /* if isfirst and eventtype !== null, the user might eg. try to submit or nextpage *immediately* without ever having\n any other form interation. to make sure our stats make sense (counting started vs submitted), we'll send the\n formstarted anyway since WH 5.02 */\n if (isfirst)\n pxl.sendPxlEvent(\"publisher:formstarted\", vars, { node: this.node });\n\n if (eventtype) //if not set, we were only invoked for the implicit formstarted event\n pxl.sendPxlEvent(eventtype, {\n ...vars,\n dn_formmeta_time: now - this._firstinteraction,\n dn_formmeta_pagenum: pagestate.curpage + 1\n }, { node: this.node });\n }\n\n _rewriteEnableOn() { //ADDME move this to webhare server\n // EnablingComponents may set data-wh-form-enable. input(radio/checkbox) and option qualify\n type EnablingComponent = HTMLInputElement | HTMLOptionElement;\n\n // This is the initialization, check the enable components for all elements within the form\n for (const control of dompack.qSA<EnablingComponent>(this.node, \"*[data-wh-form-enable]\"))\n for (const element of control.dataset.whFormEnable!.split(\" \")) {\n const target = this.getElementByName(element);\n if (target && target instanceof HTMLElement) {\n const name = (control instanceof HTMLOptionElement ? control.closest<HTMLSelectElement>(\"select\") : control)?.name;\n if (!name) //duplicated node?\n continue;\n\n let ourcondition: FormCondition = { field: name, matchtype: \"IN\", value: control.value };\n if (target.dataset.whFormEnabledIf) //append to existing criterium\n ourcondition = { conditions: [parseCondition(target.dataset.whFormEnabledIf), ourcondition], matchtype: \"AND\" };\n target.dataset.whFormEnabledIf = JSON.stringify({ c: ourcondition });\n }\n }\n }\n\n _applyPrefills() {\n //Apply prefills. Set in field order, so controls-enabling-controls things will generally work\n const searchparams = new URL(location.href).searchParams;\n for (const field of this._queryAllFields()) {\n const allvalues = searchparams.getAll(field.name);\n if (!allvalues.length)\n continue;\n\n if (field.multi && field.nodes[0].type === 'checkbox') {\n for (const node of field.nodes) {\n const shouldbechecked = allvalues.includes(node.value);\n if (shouldbechecked !== node.checked) //NOTE: used to read 'field.checked' which doesn't exist so this if() would always evaluate to true\n this.setFieldValue(node, shouldbechecked);\n }\n } else if (field.multi) { //implies radio\n const tocheck = field.nodes.filter(_ => _.value === allvalues[allvalues.length - 1])[0];\n if (tocheck && !tocheck.checked)\n this.setFieldValue(tocheck, true);\n if (!tocheck)\n field.nodes.filter(_ => _.checked).forEach(_ => this.setFieldValue(_, false));\n } else if (field.node.matches(\"input:not([type=file]),select,textarea\")) { //Limit URL prefills to simple elements - TODO allow custom components to decide on this themselves OR *explicitly* require fields to opt-in to being prefillable\n if (!this._isNowSettable(field.node))\n continue;\n this.setFieldValue(field.node, allvalues[allvalues.length - 1]); //last value wins\n }\n }\n }\n\n /**\n * Set or update the message for the specified field\n * @param field - node on which the validation triggered\n * @param type - type of the message (\"error\" or \"suggestion\") - a field or group can have both an \"error\" and \"suggestion\" visible\n * @param getError - function which returns a reference to the error node (or DocumentFragment) or a text\n *\n * .wh-form__field--error - Used to indicate this element has an error\n * .wh-form__field--suggestion - Used to indicate this element has an suggestion\n * .wh-form__error - The error message container\n * .wh-form_suggestion - The suggestion message container\n */\n _updateFieldGroupMessageState(field: HTMLElement, type: \"error\" | \"suggestion\", getError: (field: HTMLElement) => FormFrontendMessage | null) {\n //Please note that _updateFieldGroupMessageState doesn't *validate* anything - it takes the current error/suggestion status and updates the DOM accordingly\n\n /*\n ADDME: ability to show multiple messages in case both the toplevel and a subfield have an error/suggestion.\n Example: a checkboxgroup in which too many options are selected AND the required textfield of a selected option is empty.\n\n ADDME: how should an error message reference a required nested textfield?\n\n ADDME: Support progressive enhancements such as splitdatetime which use a native form element\n to store the value. (it's probably confusing that aria-described by ends up on an\n element which needs receives focus and cannot be used to influence/fix the value).\n (such as the splitdatetime)\n\n Suggestion for possible solution:\n - have the progressive enchancement code add an attribute to the native form element\n with the ID of the (group)element.\n */\n const fieldgroup = field.closest<HTMLElement>(\".wh-form__fieldgroup\");\n //console.log(\"_updateFieldGroupMessageState\", field, fieldgroup);\n if (!fieldgroup)\n return;\n\n /* Within the group this field belongs to we lookup the first node we can find which is marked as having the\n type of message we want (\"error\" or \"suggestion\").\n First we'll see if the fieldgroup wants to report something (radio & checkboxes handle their errors at the group level)\n otherwise whe'll look for the first node which has a message.\n */\n const field_with_message = fieldgroup.classList.contains(\"wh-form__field--\" + type) ? fieldgroup : fieldgroup.querySelector<HTMLElement>(\".wh-form__field--\" + type);\n //Do not pick up errors from deeper groups (array rows)\n let error = (field_with_message && field_with_message.closest(\".wh-form__fieldgroup\") === fieldgroup ? getError(field_with_message) : null) || null;\n\n // Now mark the whole .wh-form__fieldgroup as having an error/suggestion\n fieldgroup.classList.toggle(\"wh-form__fieldgroup--\" + type, Boolean(error));\n\n // Lookup the error message from the field metadata\n if (error) { //mark the field has having failed at one point. we will now switch to faster updating error state\n if (!field.classList.contains('wh-form__field--everfailed')) {\n if (debugFlags.fhv)\n console.log('[fhv] marking as everfailed', field, 'because of error', error);\n field.classList.add('wh-form__field--everfailed');\n }\n }\n\n // if the error is plain text, convert it to a element containing the text\n if (error && !(error instanceof Node))\n error = dompack.create('span', { textContent: error });\n\n\n // Determine the contextnode to set ARIA attributes on\n\n // ADDME: before looking up a group, check if there an attribute specifying\n // another element with role=\"group\" handled the input.\n\n // Find the first role=\"group\" we can find\n // (ineither the .wh-form__subfield or .wh-form__field)\n const potentialgroupnode = field.closest<HTMLElement>(\"[role=group],.wh-form__subfield,wh-form__fieldgroup\");\n const group = potentialgroupnode?.role === \"group\" ? potentialgroupnode : null;\n const contextnode = group ?? field;\n\n let messageid = \"\";\n let messagenode = fieldgroup.querySelector(\".wh-form__\" + type); //either wh-form__error or wh-form__suggestion\n\n // Create a container for the suggestion or error\n if (messagenode) {\n messageid = messagenode.id; // reuse the existing messagenode\n messagenode.replaceChildren(); // remove previous errors/suggestions texts from the errornode\n } else {\n if (!error)\n return; //nothing to do\n\n // Generate a temporary id for the message which we can use in\n // the aria-describedby to point to the message.\n const random = Math.floor((1 + Math.random()) * 0x10000000).toString(16);\n messageid = \"whform-msg-\" + random; // `${fieldname}-${random}`;\n\n const suggestionholder = field.closest('.wh-form__fields') || fieldgroup.querySelector('.wh-form__fields') || fieldgroup;\n messagenode = dompack.create(\"div\", { className: \"wh-form__\" + type }); // add a wh-form__error or wh-form__suggestion message container\n messagenode.id = messageid; // id to reference to in the aria-describedby\n suggestionholder.appendChild(messagenode);\n }\n\n\n\n if (error) { // Do we show a message?\n messagenode.append(error);\n this._addDescribedBy(contextnode, messageid);\n\n if (type === \"error\")\n contextnode.setAttribute(\"aria-invalid\", \"true\");\n } else {\n this._removeDescribedBy(contextnode, messageid);\n contextnode.removeAttribute(\"aria-invalid\");\n }\n\n }\n\n // add the specified id of the message element to the list of elements in aria-describedby\n _addDescribedBy(contextnode: HTMLElement, messageid: string) {\n const describedby = contextnode.getAttribute(\"aria-describedby\") ?? \"\";\n const describedby_fields = describedby !== \"\" ? describedby.split(\" \") : [];\n\n if (describedby_fields.indexOf(messageid) === -1) {\n\n describedby_fields.push(messageid);\n contextnode.setAttribute(\"aria-describedby\", describedby_fields.join(\" \"));\n }\n }\n\n // remove the specified id of the message element from the list of elements in aria-describedby\n _removeDescribedBy(contextnode: HTMLElement, messageid: string) {\n const describedby = contextnode.getAttribute(\"aria-describedby\") ?? \"\";\n const describedby_fields = describedby !== \"\" ? describedby.split(\" \") : [];\n\n for (let idx = 0; idx < describedby_fields.length; idx++) {\n if (describedby_fields[idx] === messageid) {\n describedby_fields.splice(idx, 1); // remove that item\n break;\n }\n }\n\n if (describedby_fields.length > 0)\n contextnode.setAttribute(\"aria-describedby\", describedby_fields.join(\" \"));\n else\n contextnode.removeAttribute(\"aria-describedby\");\n }\n\n _updateFieldGroupErrorState(field: HTMLElement) {\n this._updateFieldGroupMessageState(field, 'error', failedfield => getValidationState(failedfield).getError());\n }\n\n _updateFieldGroupSuggestionState(field: HTMLElement) {\n this._updateFieldGroupMessageState(field, 'suggestion', failedfield => failedfield.propWhValidationSuggestion || '');\n }\n\n _doSetFieldError(evt: DocEvent<CustomEvent<SetFieldErrorData>>) {\n //FIXME properly handle multiple fields in this group reporting errors\n dompack.stop(evt);\n\n\n this._reportFieldValidity(evt.target);\n }\n\n /** @returns false on error */\n _reportFieldValidity(node: HTMLElement): boolean {\n const state = getValidationState(node).getState();\n node.classList.toggle(\"wh-form__field--error\", Boolean(state?.error));\n node.classList.toggle(\"wh-form__field--suggestion\", Boolean(state?.suggested));\n\n this._updateFieldGroupErrorState(node);\n this._updateFieldGroupSuggestionState(node);\n return !(state && \"error\" in state);\n }\n\n //validate and submit. normal submissions should use this function, directly calling submit() skips validation and busy locking\n async validateAndSubmit(extradata: ExtraData) {\n await this._submit(null, extradata);\n }\n\n async _submit(evt: SubmitEvent | null, extradata: ExtraData) {\n if (this.node.classList.contains('wh-form--submitting')) //already submitting\n return;\n\n //A form element's default button is the first submit button in tree order whose form owner is that form element.\n const submitter = this._submitter || this.node.querySelector(submitselector);\n this._submitter = null;\n\n if (debugFlags.fhv)\n console.log('[fhv] received submit event, submitter:', submitter);\n\n let tempbutton = null;\n if (submitter) { //temporarily add a hidden field representing the selected button\n tempbutton = document.createElement('input');\n tempbutton.name = submitter.name;\n tempbutton.value = submitter.value;\n tempbutton.type = \"hidden\";\n this.node.appendChild(tempbutton);\n }\n\n try {\n if (!dompack.dispatchCustomEvent(this.node, 'wh:form-beforesubmit', { bubbles: true, cancelable: true })) //allow parsley to hook into us\n return;\n\n await this._doSubmit(evt, extradata);\n } finally {\n tempbutton?.remove();\n }\n }\n\n private _shouldValidateField(el: HTMLElement) {\n //TODO maybe we can get rid of the data attributes by checking for explicit symbols like whFormsApiChecker\n return (el.whFormsApiChecker || el.matches(`${queryFormFieldLike},*[data-wh-form-name],*[data-wh-form-custom-validator`)) &&\n this._isPartOfForm(el);\n }\n\n _getFieldsToValidate(startingpoint?: HTMLElement) {\n return dompack.qSA<HTMLElement>(startingpoint ?? this.node, \"*\").filter(el => this._shouldValidateField(el));\n }\n\n //reset any serverside generated errors (generally done when preparing a new submission)\n resetServerSideErrors() {\n for (const field of this._getFieldsToValidate()) {\n const state = getValidationState(field);\n if (state?.explicit?.serverside && field.propWhCleanupFunction)\n field.propWhCleanupFunction();\n }\n }\n\n async _doSubmit(evt: SubmitEvent | null, extradata: ExtraData) {\n if (evt)\n evt.preventDefault();\n\n const lock = dompack.flagUIBusy({ modal: true });\n this._submitstart = Date.now();\n this._submittimeout = setTimeout(() => this._submitHasTimedOut(), 5000);\n this.node.classList.add('wh-form--submitting');\n\n try {\n this.resetServerSideErrors();\n\n const validationresult = await this.validate();\n if (validationresult.valid) {\n const result = await this.submit(extradata);\n if (result.result && result.result.submittype && result.result.submittype !== this._getVariableValueForConditions(\"formsubmittype\")) {\n this.node.setAttribute(\"data-wh-form-var-formsubmittype\", result.result.submittype);\n this._updateConditions(false);\n }\n } else {\n this.sendFormEvent('publisher:formfailed', {\n ds_formmeta_errorfields: getErrorFields(validationresult),\n ds_formmeta_errorsource: 'client',\n });\n }\n } finally {\n lock.release();\n this.node.classList.remove('wh-form--submitting');\n if (this._submittimeout) {\n clearTimeout(this._submittimeout);\n this._submittimeout = undefined;\n }\n this._submitstart = undefined;\n }\n }\n\n _submitHasTimedOut() { //TODO extend this to (background) RPCs too, and make waitfor more specific. also check whether we're stuck on client or server side\n this.sendFormEvent('publisher:formslow', {\n ds_formmeta_waitfor: \"submit\"\n });\n this._submittimeout = undefined;\n }\n\n //default submission function. eg. RPC will override this\n async submit(extradata?: ExtraData): Promise<{ result?: FormSubmitEmbeddedResult }> {\n this.node.submit();\n return {};\n }\n\n _onTakeFocus(evt: DocEvent<TakeFocusEvent>) {\n const containingpage = evt.target.closest('.wh-form__page');\n if (containingpage && containingpage.classList.contains('wh-form__page--hidden')) {\n //make sure the page containing the errored component is visible\n const pagenum = dompack.qSA(this.node, '.wh-form__page').findIndex(page => page === containingpage);\n if (pagenum >= 0)\n this.gotoPage(pagenum);\n }\n }\n\n _checkClick(evt: DocEvent<MouseEvent>) {\n const actionnode = evt.target?.closest<HTMLElement>(\"*[data-wh-form-action]\");\n if (!actionnode) {\n const submitter = evt.target.closest<SubmitSelectorType>(submitselector);\n if (submitter) {\n this._submitter = submitter; //store as submitter in case a submit event actually occurs\n setTimeout(() => this._submitter = null); //but clear it as soon as event processing ends\n }\n return;\n }\n\n dompack.stop(evt);\n this.executeFormAction(actionnode.dataset.whFormAction!);\n }\n\n private _getPageState(): PageState {\n const pages = dompack.qSA<HTMLElement>(this.node, '.wh-form__page');\n const curpage = pages.findIndex(page => !page.classList.contains('wh-form__page--hidden'));\n return { pages, curpage };\n }\n\n _updatePageVisibility(pagelist: HTMLElement[], currentpage: number) {\n pagelist.forEach((page, idx) => {\n page.classList.toggle('wh-form__page--hidden', idx !== currentpage);\n page.classList.toggle('wh-form__page--visible', idx === currentpage);\n });\n }\n\n ///Get the currently opened page (page node)\n getCurrentPage() {\n const state = this._getPageState();\n return state.curpage >= 0 ? state.pages[state.curpage] : null;\n }\n\n /** Position the specified element's group or the form itself into view, using `.wh-anchor` nodes to correct for fixed headers\n @param scrollto - Element to position into view. If not set, the form it scrolled into view */\n scrollIntoView(scrollto?: HTMLElement) {\n const origscrollto = scrollto;\n scrollto = (scrollto ? scrollto.closest<HTMLElement>('.wh-form__fieldgroup') : undefined) || this.node;\n scrollto = scrollto.querySelector<HTMLElement>('.wh-anchor') || scrollto;\n if (origscrollto && scrollto !== origscrollto && debugFlags.fhv)\n console.log('[fhv] Modified scroll target from ', origscrollto, ' to anchor ', scrollto);\n else if (debugFlags.fhv)\n console.log('[fhv] Scroll to ', scrollto);\n\n scrollto.scrollIntoView();\n }\n\n /** Get the current page number\n @returns 0-based index of page to jump to */\n getCurrentPageNumber() {\n return this._getPageState().curpage;\n }\n\n /** Goto a specific page\n @param pageidx - 0-based index of page to jump to */\n async gotoPage(page: number | HTMLElement): Promise<void> {\n const state = this._getPageState();\n const pageidx = getPageIdx(state, page);\n if (state.curpage === pageidx)\n return;\n\n const goingforward = pageidx > state.curpage;\n this.sendFormEvent(goingforward ? 'publisher:formnextpage' : 'publisher:formpreviouspage'\n , {\n dn_formmeta_targetpagenum: pageidx + 1,\n ds_formmeta_targetpagetitle: this._getPageTitle(pageidx)\n });\n\n this._updatePageVisibility(state.pages, pageidx);\n if (goingforward) //only makes sense to update if we're making progress\n merge.run(state.pages[pageidx], { form: await this.getFormValue() });\n\n this._updatePageNavigation();\n\n //scroll back up\n this.scrollIntoView();\n\n /* tell the page it's now visible - note that we specifically don't fire this on init, as it's very likely\n users would 'miss' the event anyway - registerHandler usually executes faster than your wh:form-pagechange\n registrations, if you wrapped those in a dompack.register */\n dompack.dispatchCustomEvent(state.pages[pageidx], \"wh:form-pagechange\", { bubbles: true, cancelable: false, detail: { formHandler: this } });\n }\n\n private _getDestinationPage(pagestate: PageState, direction: number) {\n let pagenum = pagestate.curpage + direction;\n while (pagenum >= 0 && pagenum < pagestate.pages.length && (pagestate.pages[pagenum].propWhFormCurrentVisible === false || pagestate.pages[pagenum].dataset.whFormPagerole === \"captcha\"))\n pagenum = pagenum + direction;\n if (pagenum < 0 || pagenum >= pagestate.pages.length)\n return -1;\n return pagenum;\n }\n\n _getPageTitle(pagenum: number) {\n const pagenode = this._getPageState().pages[pagenum];\n if (!pagenode)\n return \"\";\n return pagenode.dataset.whFormPagetitle || (\"#\" + (pagenum + 1));\n }\n\n async executeFormAction(action: string) {\n switch (action) {\n case 'previous':\n {\n if (this.node.classList.contains('wh-form--allowprevious')) {\n const pagestate = this._getPageState();\n if (pagestate.curpage > 0)\n this.gotoPage(this._getDestinationPage(pagestate, -1));\n else if (this.node.dataset.whFormBacklink)\n location.href = this.node.dataset.whFormBacklink;\n }\n return;\n }\n case 'next':\n {\n const pagestate = this._getPageState();\n if (this.node.classList.contains('wh-form--allownext')) {\n this.resetServerSideErrors();\n\n const validationstatus = await this.validate(pagestate.pages[pagestate.curpage]);\n if (validationstatus.valid) {\n this.gotoPage(this._getDestinationPage(pagestate, +1));\n } else {\n this.sendFormEvent('publisher:formfailed', {\n ds_formmeta_errorfields: getErrorFields(validationstatus),\n ds_formmeta_errorsource: 'nextpage'\n });\n }\n }\n return;\n }\n default:\n {\n console.error(`Unknown form action '${action}'`);\n }\n }\n }\n\n async refreshConditions() {\n await this._updateConditions(false);\n }\n\n _onInputChange() {\n this.sendFormEvent(''); //only trigger implicit _firstinteraction event\n this._updateConditions(false);\n }\n\n async _updateConditions(isinit: boolean) {\n // Check pages visibility\n const hiddenPages = [];\n const mergeNodes = [];\n let anychanges = false;\n\n for (const formpage of dompack.qSA(this.node, \".wh-form__page\")) {\n let visible = true;\n if (formpage.dataset.whFormVisibleIf) {\n visible = this._matchesCondition(formpage.dataset.whFormVisibleIf);\n if (!visible)\n hiddenPages.push(formpage); // We don't have to check fields on this page any further\n\n if (visible !== formpage.propWhFormCurrentVisible) {\n anychanges = true;\n formpage.propWhFormCurrentVisible = visible;\n mergeNodes.push(formpage);\n }\n }\n }\n if (anychanges)\n this._updatePageNavigation();\n\n const tovalidate = new Array<HTMLElement>;\n const hiddengroups = [], enabledgroups = [], requiredgroups = [];\n for (const formgroup of dompack.qSA(this.node, \".wh-form__fieldgroup\")) {\n const groupPage = formgroup.closest<HTMLElement>(\".wh-form__page\");\n const visible = (!groupPage || !hiddenPages.includes(groupPage)) && this._matchesCondition(formgroup.dataset.whFormVisibleIf);\n if (!visible)\n hiddengroups.push(formgroup);\n\n const enabled = visible\n && this._matchesCondition(formgroup.dataset.whFormEnabledIf);\n\n if (enabled)\n enabledgroups.push(formgroup);\n\n //load initial status?\n if (formgroup.propWhFormInitialRequired === undefined)\n formgroup.propWhFormInitialRequired = formgroup.classList.contains(\"wh-form__fieldgroup--required\");\n\n const required = enabled\n && (formgroup.dataset.whFormRequiredIf ? this._matchesCondition(formgroup.dataset.whFormRequiredIf) : formgroup.propWhFormInitialRequired);\n\n if (required)\n requiredgroups.push(formgroup);\n\n if (visible !== formgroup.propWhFormCurrentVisible // These are initially undefined, so this code will always run first time\n || enabled !== formgroup.propWhFormCurrentEnabled\n || required !== formgroup.propWhFormCurrentRequired) {\n formgroup.propWhFormCurrentVisible = visible;\n formgroup.propWhFormCurrentEnabled = enabled;\n formgroup.propWhFormCurrentRequired = required;\n\n formgroup.classList.toggle(\"wh-form__fieldgroup--disabled\", !enabled);\n formgroup.classList.toggle(\"wh-form__fieldgroup--hidden\", !visible);\n formgroup.classList.toggle(\"wh-form__fieldgroup--required\", required);\n\n mergeNodes.push(formgroup);\n }\n }\n\n for (const formline of dompack.qSA(this.node, \".wh-form__fieldline\")) {\n const formgroup = formline.closest<HTMLElement>(\".wh-form__fieldgroup\");\n if (!formgroup)\n continue;\n const visible = !hiddengroups.includes(formgroup) && this._matchesCondition(formline.dataset.whFormVisibleIf);\n const enabled = visible && enabledgroups.includes(formgroup) && this._matchesCondition(formline.dataset.whFormEnabledIf);\n const required = enabled && requiredgroups.includes(formgroup);\n\n if (visible !== formline.propWhFormlineCurrentVisible) { // These are initially undefined, so this code will always run first time\n formline.propWhFormlineCurrentVisible = visible;\n formline.classList.toggle(\"wh-form__fieldline--hidden\", !visible);\n }\n\n // Look for nodes that are explicit enable state (enablee/require) listeners, or that need to do so because they're real input controls\n const inputtargets = dompack.qSA(formline, `${queryFormFieldLike},[data-wh-form-state-listener='true']`);\n\n for (const node of inputtargets) {\n //Record initial states\n if (node.propWhFormSavedEnabled === undefined)\n node.propWhFormSavedEnabled = \"disabled\" in node ? !node.disabled : !(\"whFormDisabled\" in node.dataset);\n\n if (node.propWhFormSavedRequired === undefined)\n node.propWhFormSavedRequired = Boolean(\"required\" in node && node.required);\n\n // The field is enabled if all of these are matched:\n // - we're setting it to enabled now\n // - it hasn't been disabled explicitly (set initially on the node)\n // - it hasn't been disabled through enablecomponents\n const node_enabled = enabled && node.propWhFormSavedEnabled && this._matchesCondition(node.dataset.whFormEnabledIf);\n\n if (node_enabled !== node.propWhNodeCurrentEnabled) {\n node.propWhNodeCurrentEnabled = node_enabled;\n\n // Give the formgroup a chance to handle it\n if (dompack.dispatchCustomEvent(node, \"wh:form-enable\", { bubbles: true, cancelable: true, detail: { enabled: node_enabled } })) {\n // Not cancelled, so run our default handler\n if (isFormFieldLike(node)) //For true html5 inputs we'll use the native attributes. formstatelisteners: we use data attributes\n node.disabled = !node_enabled;\n else if (node_enabled)\n node.removeAttribute(\"data-wh-form-disabled\");\n else\n node.setAttribute(\"data-wh-form-disabled\", \"\");\n }\n\n if (!isinit && !node_enabled && !tovalidate.includes(node))\n tovalidate.push(node); // to clear errors for this disabled field\n }\n\n const node_required = (node.propWhFormSavedRequired || required) && node_enabled && visible;\n if (node.propWhNodeCurrentRequired !== node_required) {\n node.propWhNodeCurrentRequired = node_required;\n\n // Give the formgroup a chance to handle it\n if (dompack.dispatchCustomEvent(node, \"wh:form-require\", { bubbles: true, cancelable: true, detail: { required: node_required } })) {\n // Not cancelled, so run our default handler\n if (isFormFieldLike(node)) { //For true html5 inputs we'll use the native attributes. formstatelisteners: we use data attributes\n if (!isFormControl(node) || node.type !== 'checkbox') //don't set required on checkboxes, that doesn't do what you want\n node.required = node_required;\n } else if (node_required)\n node.setAttribute(\"data-wh-form-required\", \"\");\n else\n node.removeAttribute(\"data-wh-form-required\");\n }\n\n if (!isinit && !node_required && formgroup.classList.contains(\"wh-form__fieldgroup--error\") && !tovalidate.includes(node))\n tovalidate.push(node); // to clear errors for this now optional field\n }\n }\n }\n\n for (const option of dompack.qSA<HTMLOptionElement>(this.node, \".wh-form__fieldgroup select option\")) {\n const visible = this._matchesCondition(option.dataset.whFormVisibleIf);\n\n //Record initial states\n if (option.propWhFormSavedEnabled === undefined)\n option.propWhFormSavedEnabled = !option.disabled;\n if (option.propWhFormSavedHidden === undefined)\n option.propWhFormSavedHidden = option.hidden;\n\n const option_enabled = visible && option.propWhFormSavedEnabled;\n const option_hidden = !visible || option.propWhFormSavedHidden;\n\n if (option_enabled !== option.propWhNodeCurrentEnabled || option_hidden !== option.propWhNodeCurrentHidden) {\n option.propWhNodeCurrentEnabled = option_enabled;\n option.propWhNodeCurrentHidden = option_hidden;\n option.disabled = !option_enabled;\n option.hidden = option_hidden;\n\n // If this option was the selected option, but is now disabled (but not the placeholder), reset the select's value\n const selectnode = option.closest<HTMLSelectElement>(\"select\");\n if (selectnode && option.selected && (!option_enabled || option_hidden) && option.dataset.whPlaceholder === undefined) {\n if (selectnode.options[0].dataset.whPlaceholder !== undefined) { //we have a placeholder...\n selectnode.selectedIndex = 0;\n } else {\n selectnode.selectedIndex = -1;\n if (!selectnode.__didPlaceholderWarning) {\n selectnode.__didPlaceholderWarning = true;\n console.warn(\"This <select> lacks an explicit placeholder so we had to set selectedIndex to -1\", selectnode);\n }\n }\n }\n\n if (selectnode && !isinit && !tovalidate.includes(selectnode))\n tovalidate.push(selectnode); // to clear errors for this option's select field\n }\n }\n\n if (tovalidate.length)\n await this.validate(tovalidate, { focusfailed: false, iffailedbefore: true });\n\n this.fixupMergeFields(mergeNodes);\n }\n\n __scheduleUpdateConditions = wrapSerialized(() => this._updateConditions(false), { coalesce: true });\n\n async fixupMergeFields(nodes: HTMLElement[]) {\n // Rename the data-wh-merge attribute to data-wh-dont-merge on hidden pages and within hidden formgroups to prevent\n // merging invisible nodes\n // FIXME 'merge' has a filter option now - convert to that!\n const formvalue = await this.getFormValue();\n for (const node of nodes) {\n if (node.propWhFormCurrentVisible) {\n for (const mergeNode of dompack.qSA(node, '*[data-wh-dont-merge]')) {\n mergeNode.dataset.merge = mergeNode.dataset.whDontMerge;\n mergeNode.removeAttribute(\"data-wh-dont-merge\");\n }\n merge.run(node, { form: formvalue });\n } else {\n for (const mergeNode of dompack.qSA(node, '*[data-merge]')) {\n mergeNode.dataset.whDontMerge = mergeNode.dataset.merge;\n mergeNode.removeAttribute(\"data-merge\");\n }\n }\n }\n }\n\n _matchesCondition(conditiontext: string | undefined) {\n if (!conditiontext)\n return true;\n\n return this._matchesConditionRecursive(parseCondition(conditiontext));\n }\n\n _getConditionRawValue(fieldname: string, options?: { checkdisabled?: boolean }) {\n if (this.node.hasAttribute(\"data-wh-form-var-\" + fieldname))\n return this.node.getAttribute(\"data-wh-form-var-\" + fieldname);\n\n const matchfield = this.getElementByName(fieldname);\n if (!matchfield) {\n console.error(`No match for conditional required field '${fieldname}'`);\n return null;\n }\n\n if (isRadioNodeList(matchfield)) {\n let currentvalue = null;\n\n for (const field of matchfield)\n if (((options && options.checkdisabled) || this._isNowSettable(field)) && field.checked) {\n if (field.type !== \"checkbox\")\n return field.value;\n\n if (!currentvalue)\n currentvalue = [];\n currentvalue.push(field.value);\n }\n return currentvalue;\n } else {\n //Can we set this field?\n if ((!options || !options.checkdisabled) && !this._isNowSettable(matchfield))\n return null;\n }\n\n if (matchfield.type === \"checkbox\")\n return (matchfield as HTMLInputElement).checked ? [matchfield.value] : null;\n\n if (matchfield.type === \"radio\")\n return (matchfield as HTMLInputElement).checked ? matchfield.value : null;\n\n return matchfield.value;\n }\n\n _getVariableValueForConditions(conditionfield: string, options?: { matchcase?: boolean; checkdisabled?: boolean }) {\n if (this.node.hasAttribute(\"data-wh-form-var-\" + conditionfield))\n return this.node.getAttribute(\"data-wh-form-var-\" + conditionfield);\n\n const fields = conditionfield.split(\"$\");\n\n if (fields.length > 1) {\n // If the condition field has a subfield, check if it's available through a form var\n // The '$' in the attribute name is replaced with '.' to make the attribute name valid\n const attrname = fields.join(\".\");\n if (this.node.hasAttribute(\"data-wh-form-var-\" + attrname))\n return this.node.getAttribute(\"data-wh-form-var-\" + attrname);\n }\n\n let currentvalue = this._getConditionRawValue(fields[0], options);\n if (fields.length === 1 || currentvalue === null) //no subs to process\n return currentvalue;\n\n // Look for an extrafield match\n const matchfield = this.getElementByName(fields[0]);\n if (!matchfield) {\n console.error(`No match for conditional required field '${conditionfield}'`);\n return null;\n }\n\n if (matchfield instanceof HTMLSelectElement) {\n if (Array.isArray(currentvalue)) {\n const selectedvalue = currentvalue;\n currentvalue = [];\n for (const val of selectedvalue) {\n const selected = dompack.qS<HTMLOptionElement>(matchfield, `option[value=\"${CSS.escape(val)}\"]`);\n if (!selected?.dataset.__extrafields)\n return null;\n const extrafields = JSON.parse(selected.dataset.__extrafields);\n currentvalue.push(extrafields[fields[1]]);\n }\n } else {\n const selected = dompack.qS<HTMLOptionElement>(matchfield, `option[value=\"${CSS.escape(currentvalue)}\"]`);\n if (!selected?.dataset.__extrafields)\n return null;\n const extrafields = JSON.parse(selected.dataset.__extrafields);\n currentvalue = extrafields[fields[1]];\n }\n return currentvalue;\n } else {\n console.error(\"Subfield matching not supported for non-select fields\");\n return null;\n }\n }\n\n\n _matchesConditionRecursive(condition: FormCondition): boolean {\n switch (condition.matchtype) {\n case \"AND\":\n for (const subcondition of condition.conditions)\n if (!this._matchesConditionRecursive(subcondition))\n return false;\n return true;\n\n case \"OR\":\n for (const subcondition of condition.conditions)\n if (this._matchesConditionRecursive(subcondition))\n return true;\n return false;\n\n case \"NOT\":\n return !this._matchesConditionRecursive(condition.condition);\n\n case \"AGE<\":\n case \"AGE>=\": {\n const currentvalue = this._getVariableValueForConditions(condition.field);\n if (!currentvalue)\n return false;\n\n const now = new Date, birthdate = new Date(Array.isArray(currentvalue) ? currentvalue[0] : currentvalue); //should never be an array, but _getVariableValueForConditions is generic\n let age = now.getFullYear() - birthdate.getFullYear();\n //birthdate not hit yet this year? then you lose a year\n if (now.getMonth() < birthdate.getMonth()\n || (now.getMonth() === birthdate.getMonth() && now.getDate() < birthdate.getDate())) {\n --age;\n }\n\n return (condition.matchtype === 'AGE<' ? age < condition.value : age >= condition.value);\n }\n }\n\n const currentvalue = this._getVariableValueForConditions(condition.field, condition.options);\n\n if (condition.matchtype === \"HASVALUE\")\n return Boolean(currentvalue) === Boolean(condition.value);\n\n if ([\"IN\", \"HAS\", \"IS\"].includes(condition.matchtype)) {\n const matchcase = condition.options?.matchcase !== false; // Defaults to true\n const compareagainst = Array.isArray(condition.value) ? condition.value : condition.value ? [condition.value] : [];\n const currentValArray: string[] = Array.isArray(currentvalue) ? currentvalue : currentvalue ? [currentvalue] : [];\n\n // If the match is not case-sensitive, the condition value is already uppercased, so we only have to uppercase the\n // current value(s) when checking\n if (!matchcase)\n currentValArray.forEach((_, idx) => currentValArray[idx] = currentValArray[idx].toUpperCase());\n\n // The current value and the condition value should (at least) overlap\n if (!currentValArray.some(value => compareagainst.includes(value)))\n return false;\n\n // For \"HAS\" and \"IS\" conditions, all of the required values should be selected (there shouldn't be required values\n // that are not selected)\n if ((condition.matchtype === \"HAS\" || condition.matchtype === \"IS\") && compareagainst.some(value => !currentValArray.includes(value)))\n return false;\n\n // For an \"IS\" condition, all of the selected values should be required (there shouldn't be selected values that are\n // not required)\n if (condition.matchtype === \"IS\" && currentValArray.some(value => !compareagainst.includes(value)))\n return false;\n\n return true;\n }\n\n return console.error(`No support for conditional type '${condition.matchtype}'`), false;\n }\n\n _updatePageNavigation() {\n const pagestate = this._getPageState();\n const nextpage = this._getDestinationPage(pagestate, +1);\n const morepages = nextpage !== -1;\n const curpagerole = pagestate.pages[pagestate.curpage] ? pagestate.pages[pagestate.curpage].dataset.whFormPagerole : '';\n const nextpagerole = morepages ? pagestate.pages[nextpage].dataset.whFormPagerole : \"\";\n\n this.node.classList.toggle(\"wh-form--allowprevious\", Boolean((pagestate.curpage > 0 && curpagerole !== 'thankyou') || (pagestate.curpage <= 0 && this.node.dataset.whFormBacklink)));\n this.node.classList.toggle(\"wh-form--allownext\", morepages && nextpagerole !== 'thankyou');\n this.node.classList.toggle(\"wh-form--allowsubmit\", curpagerole !== 'thankyou' && (!morepages || nextpagerole === 'thankyou'));\n }\n\n _navigateToThankYou(richvalues?: RichValues) {\n const state = this._getPageState();\n if (state.curpage >= 0) {\n const nextpage = this._getDestinationPage(state, +1);\n if (nextpage !== -1 && state.pages[nextpage] && state.pages[nextpage].dataset.whFormPagerole === 'thankyou') {\n const redirectto = state.pages[nextpage].dataset.whFormPageredirect;\n const redirectdelay = parseInt(state.pages[nextpage].dataset.whFormPageredirectDelay ?? \"\");\n if (redirectto && !(redirectdelay >= 0))\n navigateTo({ type: \"redirect\", url: redirectto });\n else {\n this.updateRichValues(state.pages[nextpage], richvalues);\n this.gotoPage(nextpage);\n if (redirectto) {\n // If redirectdelay==0 (redirect immediately, while showing the thank you page), redirect after a small delay to\n // give the browser time to hide the busy layer\n // Might be caused by this: https://stackoverflow.com/a/60439478\n setTimeout(() => navigateTo({ type: \"redirect\", url: redirectto }), redirectdelay * 1000 || 100);\n }\n }\n }\n }\n }\n updateRichValues(page: HTMLElement, richvalues?: RichValues) {\n if (richvalues) {\n for (const { field, value } of richvalues) {\n const node = page.querySelector(`.wh-form__fieldgroup--richtext[data-wh-form-group-for=\"${CSS.escape(field)}\"] .wh-form__richtext`);\n if (node) {\n node.innerHTML = value;\n dompack.registerMissed(node);\n }\n }\n }\n }\n\n private ensureLegacyWarning(field: HTMLElement) {\n if (!this.didLegacyWarning && !isLive)\n console.warn(`[form] ${getFieldDisplayName(field)} is using wh:form-getvalue/wh:form-setvalue events. It should switch to RegisteredFieldBase in WebHare 5.6+`);\n\n this.didLegacyWarning = true;\n }\n\n /* Override this to overwrite the processing of individual fields. Note that\n radio and checkboxes are not passed through getFieldValue, and that\n getFieldValue may return undefined or a promise. */\n async getFieldValue(field: HTMLElement) {\n if (field[rfSymbol])\n return field[rfSymbol].getValue();\n\n if (field.hasAttribute('data-wh-form-name') || field.whUseFormGetValue) {\n //create a deferred promise for the field to fulfill\n const deferred = Promise.withResolvers<unknown>();\n //if cancelled, we'll assume the promise is taken over\n if (!dompack.dispatchCustomEvent(field, 'wh:form-getvalue', { bubbles: true, cancelable: true, detail: { deferred } })) {\n this.ensureLegacyWarning(field);\n return deferred.promise;\n }\n }\n if (!isFormFieldLike(field)) {\n console.error(`Cannot get value on non-FormControl`, field);\n return undefined; //TODO throw? but wasn't currently fatal\n }\n\n if (field.matches('input[type=file]')) //We don't care for multiple yet, as our form RPC APIs don't support that either\n return [...(field as HTMLInputElement).files || []].map(file => ({ fileName: file.name, file: file, link: null })) satisfies FormFileValue[];\n\n return field.value;\n }\n\n /* Override this to overwrite the setting of individual fields. In contrast\n to getFieldValue, this function will also be invoked for radio and checkboxes */\n setFieldValue(fieldnode: HTMLElement, value: unknown) {\n if (fieldnode[rfSymbol])\n return fieldnode[rfSymbol].setValue(value);\n\n if (fieldnode.hasAttribute('data-wh-form-name')) {\n if (!dompack.dispatchCustomEvent(fieldnode, 'wh:form-setvalue', { bubbles: true, cancelable: true, detail: { value } })) {\n this.ensureLegacyWarning(fieldnode);\n return;\n }\n // Event is not cancelled, set node value directly\n }\n\n if (!isFormFieldLike(fieldnode)) {\n console.error(`Cannot set value on non-FormControl`, fieldnode, value);\n return; //TODO throw? but wasn't currently fatal\n }\n\n //NOTE this blocks a lot of 'new sets' being done through setFieldValue, eg resetting an array by setting it to []. which is fine for me, just use the data proxy..\n if (typeof value !== \"string\" && typeof value !== \"number\" && typeof value !== \"boolean\") {\n console.error(`Setting value of type ${typeof value} on a FormControl`, fieldnode, value);\n return; //TODO throw? but wasn't currently fatal\n }\n\n const saveInteractive = this.isInteractive;\n try {\n this.isInteractive = false;\n if (isFormControl(fieldnode))\n dompack.changeValue(fieldnode, value);\n else\n fieldnode.value = value;\n } finally {\n this.isInteractive = saveInteractive;\n }\n }\n\n _isPartOfForm(el: HTMLElement) {\n //In HTML terms, an input must either have *no* form attribute or explicitly point to us. eg <input form> is *outside* a form\n //However nodes may live in fragments (eg arrayedits) that are not in the DOM and not attached anywhere, so we also consider anything outside the DOM to be in our form...\n return !(\"form\" in el) || el.form === this.node || !document.contains(el)\n || (!this.node && !el.hasAttribute(\"form\")); //FIXME remove this workaround needed now to work around form init race where arrayfields try to use _queryAllFields\n }\n\n _queryAllFields(options?: {\n skiparraymembers?: boolean;\n skipfield?: HTMLElement;\n onlysettable?: boolean;\n startnode?: HTMLElement;\n }): FormControlDescription[] {\n const foundfields = new Array<FormControlDescription>;\n const skiparraymembers = options && options.skiparraymembers;\n\n for (const field of this._getFieldsToValidate(options?.startnode)) {\n if (options && field === options.skipfield) //arrayfield.es needs it\n continue;\n if (!this._isPartOfForm(field))\n continue;\n if (options && options.onlysettable && !this._isNowSettable(field))\n continue;\n if (skiparraymembers && field.closest(\".wh-form__arrayrow\"))\n continue;\n\n const name = getName(field);\n if (!name)\n continue;\n\n let addto = foundfields.find(_ => _.name === name);\n if (isRadioOrCheckbox(field)) { //expect multiple inputs with this name?\n if (!addto) {\n addto = { name: name, multi: true, nodes: [] };\n foundfields.push(addto);\n } else if (!addto.multi) {\n console.error(`[fhv] Encountered duplicate field '${name}'`, field);\n continue;\n }\n addto.nodes.push(field);\n } else {\n if (addto) {\n console.error(`[fhv] Encountered duplicate field '${name}'`, field);\n continue;\n }\n\n foundfields.push({ name: name, multi: false, node: field });\n }\n }\n\n return foundfields;\n }\n\n /** Return the names of all form elements */\n getFormElementNames() {\n return this._queryAllFields().map(_ => _.name);\n }\n\n /** getValue from a field as returned by _queryAllFields (supporting both multilevel and plain fields)\n @returns promise */\n _getQueryiedFieldValue(field: FormControlDescription) {\n if (!field.multi)\n return this.getFieldValue(field.node);\n\n return field.nodes.filter(node => node.checked).map(node => node.value);\n }\n\n /** Return a promise resolving to the submittable form value */\n getFormValue(): Promise<FormResultValue> {\n return new Promise<FormResultValue>((resolve, reject) => {\n const outdata = {};\n const fieldpromises = new Array<Promise<void>>;\n\n for (const field of this._queryAllFields({ onlysettable: true, skiparraymembers: true }))\n this._processFieldValue(outdata, fieldpromises, field.name, this._getQueryiedFieldValue(field));\n\n Promise.all(fieldpromises).then(() => resolve(outdata)).catch(e => reject(e));\n });\n }\n\n _isNowSettable(node: HTMLElement) {\n // If the node is disabled, it's not settable\n if (\"disabled\" in node && node.disabled)\n return false;\n\n // If the node's field group is disabled or hidden, it's not settable\n const formgroup = node.closest(\".wh-form__fieldgroup\");\n if (formgroup) {\n if (formgroup.classList.contains(\"wh-form__fieldgroup--disabled\"))\n return false;\n if (formgroup.classList.contains(\"wh-form__fieldgroup--hidden\"))\n return false;\n }\n\n // If the node's form page is hidden dynamically, it's not settable\n const formpage = node.closest<HTMLElement>(\".wh-form__page\");\n if (formpage) {\n if (formpage.propWhFormCurrentVisible === false)\n return false;\n }\n // The node is settable\n return true;\n }\n\n _processFieldValue(outdata: FormResultValue, fieldpromises: Array<Promise<void>>, fieldname: string, receivedvalue: unknown) {\n if (receivedvalue === undefined)\n return;\n if (isPromise(receivedvalue)) {\n fieldpromises.push(new Promise<void>((resolve, reject) => {\n receivedvalue.then(result => {\n if (result !== undefined)\n outdata[fieldname] = result;\n\n resolve();\n }).catch(e => reject(e));\n }));\n } else {\n outdata[fieldname] = receivedvalue;\n }\n }\n\n //get the option lines associated with a specific radio/checkbox group\n getOptions(name: string) {\n const nodes = this.getElementByName(name);\n if (!(nodes instanceof RadioNodeList))\n return [];\n\n return [...nodes].map(node => ({\n inputnode: node,\n fieldline: node.closest<HTMLElement>('.wh-form__fieldline'),\n value: node.value\n }));\n }\n\n /** gets the selected option associated with a radio/checkbox group as an array\n */\n getSelectedOptions(name: string) {\n let opts = this.getOptions(name);\n opts = opts.filter(node => node.inputnode.checked);\n return opts;\n }\n\n /** get the selected option associated with a radio/checkbox group. returns an object that's either null or the first selected option\n */\n getSelectedOption(name: string) {\n const opts = this.getSelectedOptions(name);\n return opts.length ? opts[0] : null;\n }\n\n /** get the fieldgroup for an element */\n getFieldGroup(name: string): HTMLElement | null {\n let node = this.getElementByName(name);\n if (node instanceof RadioNodeList)\n node = node[0];\n\n return node ? node.closest<HTMLElement>('.wh-form__fieldgroup') : null;\n }\n\n /** get the values of the currently selected radio/checkbox group */\n private getValues(name: string) {\n return this.getSelectedOptions(name).map(node => node.value);\n }\n /** get the value of the first currently selected radio/checkbox group */\n private getValue(name: string) {\n const vals = this.getValues(name);\n return vals.length ? vals[0] : null;\n }\n\n /** @deprecated Just import setupValidator from \\@mod-publisher/js/forms */\n static setupValidator(node: HTMLElement, checker: (node: HTMLElement) => Promise<string> | string) {\n setupValidator(node, checker);\n }\n\n /** @deprecated Just import setFieldError from \\@mod-publisher/js/forms */\n static setFieldError(field: HTMLElement, error: string, options?: Partial<FieldErrorOptions>) {\n setFieldError(field, error, options);\n }\n\n setFieldError(field: HTMLElement, error: string, options?: Partial<FieldErrorOptions>) {\n setFieldError(field, error, options);\n }\n\n async validateSingleFormField(field: HTMLElement): Promise<boolean> {\n return true;\n }\n\n async _validateSingleFieldOurselves(field: HTMLElement): Promise<boolean> {\n const state = getValidationState(field);\n\n if (!state.explicit && isFieldNativeErrored(field)) {\n //browser checks go first, any additional checks are always additive (just disable browserchecks you don't want to apply)\n updateFieldError(field);\n return this._reportFieldValidity(field);\n }\n\n //TODO we probably *shouldn't* be bothering running our validations if state.explicit is set, but then setFieldError needs to rerun the checks once the explicit error is dropped\n state.dynamicError = null;\n await this.validateSingleFormField(field);\n\n if (!state.dynamicError)\n for (const validator of state.validators) {\n state.dynamicError = await validator(field) || null;\n if (state.dynamicError)\n break; //one is enough\n }\n\n if (!state.dynamicError && field.whFormsApiChecker)\n await field.whFormsApiChecker();\n\n return this._reportFieldValidity(field);\n }\n\n /** validate the form\n @param limitset - A single element, nodelist or array of elements to validate (or their children)\n @returns a promise that will fulfill when the form is validated\n */\n async validate(limitset?: LimitSet, options?: ValidationOptions): Promise<ValidationResult> {\n if (debugFlags.fdv) {\n console.warn(`[fdv] Validation of form was skipped`);\n return { valid: true, failed: [], firstfailed: null };\n }\n\n //Overlapping validations are dangerous, because we can't evaluate 'hasEverFailed' too early... if an earlier validation is still running it may still decide to mark fields as failed.\n const defer = Promise.withResolvers<ValidationResult>();\n this.validationqueue.push({ defer, limitset, options });\n if (this.validationqueue.length === 1)\n this._executeNextValidation(); //we're first on the queue so process it\n\n return defer.promise;\n }\n\n async _executeNextValidation() {\n while (this.validationqueue.length) {\n const item = this.validationqueue[0];\n try {\n const result = await this._executeQueuedValidation(item.limitset, item.options);\n item.defer.resolve(result);\n } catch (error) {\n item.defer.reject(error as Error);\n }\n this.validationqueue.shift(); //remove the top item\n }\n }\n\n async _executeQueuedValidation(limitset?: LimitSet, options?: ValidationOptions): Promise<ValidationResult> {\n const original = limitset;\n if (!limitset) //validate entire form if unspecified what to validate\n limitset = this._getFieldsToValidate();\n\n const tovalidate = new Set<HTMLElement>;\n for (const node of Array.isArray(limitset) ? limitset : [limitset]) {\n /* If you're explicitly validating a radio/checkbox, we need to validate its group (but not recurse down) as that's where radiogroup.es and checkboxgroup.es attach their validations\n If you're targeting a group, we'll end up validating both the radio/checkbox (directly attached here) and any eg. embedded textedits */\n if (node.matches(`input[type=radio],input[type=checkbox]`)) {\n const group = node.closest<HTMLElement>(\".wh-form__fieldgroup\");\n if (group)\n tovalidate.add(group);\n continue;\n }\n\n if (this._shouldValidateField(node))\n tovalidate.add(node);\n for (const subnode of this._getFieldsToValidate(node)) //TODO this is overly recursive esp. if limitset is empty...\n tovalidate.add(subnode);\n }\n\n /* This was:\n tovalidate = Array.from(tovalidate); //we need an array now for further processing\n but that breaks on some old mootools integrations, see https://gitlab.webhare.com/webharebv/codekloppers/-/issues/677#note_146801\n wokaround: */\n let tovalidatelist = [...tovalidate]; //we need an array now for further processing\n\n if (options && options.iffailedbefore)\n tovalidatelist = tovalidatelist.filter(node => hasEverFailed(node));\n\n if (debugFlags.fhv)\n console.log(\"[fhv] Validation of %o expanded to %d elements: %o\", original, tovalidatelist.length, [...tovalidatelist]);\n\n const lock = dompack.flagUIBusy();\n try {\n if (!tovalidatelist.length)\n return { valid: true, failed: [], firstfailed: null };\n\n const validationresults = await Promise.all(tovalidatelist.map(fld => this._validateSingleFieldOurselves(fld)));\n //remove the elements from validate for which the promise failed\n const failed = tovalidatelist.filter((fld, idx) => !validationresults[idx]);\n const result: ValidationResult = {\n valid: failed.length === 0,\n failed: failed,\n firstfailed: null\n };\n\n result.firstfailed = result.failed.length ? result.failed[0] : null;\n if (result.firstfailed && (!options || options.focusfailed)) {\n //FIXME shouldn't getFocusableComponents also return startnode if focusable?\n const tofocus = domfocus.canFocusTo(result.firstfailed) ? result.firstfailed : domfocus.getFocusableComponents(result.firstfailed)[0];\n if (tofocus)\n dompack.focus(tofocus, { preventScroll: true });\n\n this.scrollIntoView(result.firstfailed);\n }\n\n if (debugFlags.fhv)\n console.log(`[fhv] Validation of ${tovalidatelist.length} fields done, ${result.failed.length} failed`, result);\n\n return result;\n } finally {\n lock.release();\n }\n }\n\n reset() {\n this.node.reset();\n }\n}\n\nwindow.addEventListener(\"mouseup\", releasePendingValidations, true);\nwindow.addEventListener(\"focusin\", handleFocusInEvent, true);\n","export function getActiveElement(doc: Document | null): HTMLElement | null {\n return doc?.activeElement as HTMLElement || null;\n}\n\nexport function getToplevelWindow() {\n let toplevelwindow: Window = window;\n while (toplevelwindow.frameElement)\n toplevelwindow = toplevelwindow.parent;\n return toplevelwindow;\n}\n\nexport function asIframe(node: Element | null): HTMLIFrameElement | null {\n return node && (node as HTMLElement)?.matches?.('iframe') ? node as HTMLIFrameElement : null;\n}\n\n/**\n Find the currently focused element\n *\n @param limitdoc - If set, only return compontents in the specified document (prevents editable iframes from returning subframes)\n @returns The element or null\n */\nexport function getCurrentlyFocusedElement(limitdoc?: Document): HTMLElement | null {\n try {\n let focused = getActiveElement(getToplevelWindow().document);\n for (; ;) {\n const frame = asIframe(focused);\n if (frame && (!limitdoc || frame.ownerDocument !== limitdoc))\n focused = getActiveElement(frame.contentDocument);\n else\n break;\n }\n if (focused && limitdoc && focused.ownerDocument !== limitdoc)\n return null;\n return focused;\n } catch (e) {\n return null;\n }\n}\n\nfunction getIframeFocusableNodes(currentnode: HTMLIFrameElement, recurseframes: boolean) {\n //ADDME force body into list?\n let subnodes: HTMLElement[] = [];\n try {\n const body = currentnode.contentDocument?.body || currentnode.contentWindow?.document.body || null;\n if (body?.isContentEditable)\n return subnodes;\n\n subnodes = getFocusableComponents(body, recurseframes);\n } catch (e) {\n console.log(\"failed to descend into iframe\", e);\n }\n\n return subnodes;\n}\n\n/** Return whether the node is reachable for focus by keyboard navigation\n (because tabIndex === -1 will be seen a non(keyboard)focusable by this function)\n\n @param node - Node to test\n @param ignoreInert - Ignore the inert attribute\n*/\nexport function canFocusTo(node: Element, { ignoreInertAttribute = false } = {}): node is HTMLElement { //returns if a -visible- node is focusable (this function does not check for visibility itself)\n if (!node.closest) //callers are not necessarily calling us with HTMLElement, eg getClosestValidFocusTarget might supply a document\n return false;\n if (!ignoreInertAttribute && node.closest('[inert]'))\n return false;\n\n if ((node as HTMLElement).contentEditable === \"true\")\n return true;\n if (node.shadowRoot?.delegatesFocus)\n return true;\n\n return (node as HTMLElement).tabIndex >= 0 && !(node as HTMLInputElement).disabled && !(node.tagName === 'A' && !(node as HTMLAnchorElement).href);\n}\n\nexport function getFocusableComponents(startnode: Element | null, recurseframes?: boolean) {\n let focusable: HTMLElement[] = [];\n if (!startnode)\n return focusable;\n for (const currentnode of startnode.children) {\n // Get current style (avoid mootools due to cross-frame issues)\n const currentstyle = getComputedStyle(currentnode);\n if (!currentstyle || currentstyle.display === \"none\" || currentstyle.visibility === \"hidden\") {\n //if(currentnode.getStyle) console.log(\"getFocusableComponents skipping\",currentnode, $(currentnode).getStyle(\"display\"), currentnode.getStyle(\"visibility\"))\n continue;\n }\n\n let iframe;\n if (recurseframes && (iframe = asIframe(currentnode))) { //might contain more things to focus\n const subnodes = getIframeFocusableNodes(iframe, recurseframes);\n if (subnodes.length)\n focusable = focusable.concat(subnodes);\n } else if (canFocusTo(currentnode)) {\n focusable.push(currentnode);\n }\n\n if ((currentnode as HTMLElement).isContentEditable)\n continue; //don't look for further focusable nodes inside, the whole RTE counts as an editable component\n\n const subnodes = getFocusableComponents(currentnode, recurseframes);\n if (subnodes.length)\n focusable = focusable.concat(subnodes);\n }\n return focusable;\n}\n\nexport function getAllFocusableComponents() {\n return getFocusableComponents(getToplevelWindow().document.documentElement, true);\n}\n","import * as dompack from \"@webhare/dompack\";\nimport { generateRandomId } from \"@webhare/std\";\nimport { debugFlags, isLive } from \"@webhare/env\";\n\ninterface PxlEventDetails {\n event: string;\n data: PxlEventData;\n options: PxlOptions;\n isaltsample: boolean;\n}\n\nexport type PxlEvent = CustomEvent<PxlEventDetails>;\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n \"consilio:pxl\": PxlEvent;\n }\n interface Window {\n whPxlLog?: PxlEventDetails[];\n }\n}\n\nexport type PxlEventData = {\n [K in `ds_${string}` | `db_${string}` | `dn_${string}`]: (K extends `ds_${string}` ? string :\n (K extends `db_${string}` ? boolean :\n (K extends `dn_${string}` ? number : never)))\n};\n\nexport interface PxlOptions {\n /** Set to \"0\" or \"1\" to explicitly allow resp. refuse tracking, or set to \"unspecified\", which means the browser's Do Not Track setting is used. Defaults to \"0\". */\n donottrack: \"0\" | \"1\" | \"unspecified\";\n /** Base url to which to send PXL events. Defaults to \"/.px/\". */\n recordurl: string;\n /** Sample rate for the alternative record url as a fraction of the number of events, for example, setting it to 1/100 sends 1 in 100 events to the alternative record url. Defaults to 0 (no sampling). */\n altsamplerate: number;\n /** Alternative record url. Defaults to \"/.px/alt/\". */\n altrecordurl: string;\n /** The number of days the user id is valid. Defaults to 30. */\n sessionexpiration: number; //TODO if we ever camel this, also add 'Days' to the name\n /** Set to true to omit some browser context fields (\"bu\", \"bs\" and \"bp\"). This option can\n be used to reduce the length of the pxl url. Defaults to false. */\n nobrowserenvironment: boolean;\n /** Enable debug messages */\n debug: boolean;\n /** Node responsible for generating this event (if not set, 'window' is assumed). Used for the event handlers */\n node?: HTMLElement;\n /** Send pixels as beacons */\n beacon: boolean;\n}\n\n//event names must match isValidModuleScopedName, but we won't do the module name checks here. also isValidModuleScopedName lives in @webhare/services so..\nconst eventname_regex = /^([a-z0-9][-a-z0-9_]*[a-z0-9]):([a-z0-9][-.a-z0-9_]*[a-z0-9])$/;\nconst datakey_regex = /^(ds_[0-9a-z_]+)|(dn_[0-9a-z_]+)|(db_[0-9a-z_]+)$/;\n/*TODO: Not sure yet what the new maximum URL length will be\nconst max_data_length = 600; // The maximum number of bytes stored for the request*/\nconst max_sessionid_age = 30;\n\nconst globalOptions: PxlOptions = {\n donottrack: \"0\",\n recordurl: \"/.px/\",\n altsamplerate: 0,\n altrecordurl: \"/.px/alt/\",\n sessionexpiration: max_sessionid_age,\n nobrowserenvironment: false,\n debug: Boolean(debugFlags.pxl),\n beacon: false\n};\n\nlet pagesession: string | undefined; //current page session id (used to track multiple events from single page)\nlet useAltRecordURL = false; //send events for this page to the altrecordurl\nlet seqnr = 0;\n\n/** Set global pxl options\n @param options - Option updates\n*/\nexport function setPxlOptions(options: Partial<PxlOptions> | null) {\n Object.assign(globalOptions, options);\n\n if (globalOptions.altrecordurl && globalOptions.altsamplerate) {\n useAltRecordURL = Math.random() < globalOptions.altsamplerate;\n if (globalOptions.debug)\n console.log(`[pxl] using altrecordurl for ${100 * globalOptions.altsamplerate}% of pageloads, this session is sent to the ${useAltRecordURL ? \"alternative\" : \"normal\"} url`);\n } else\n useAltRecordURL = false;\n}\n\nfunction pxlFailed(errormessage: string, ...params: unknown[]) {\n console.error('[pxl] ' + errormessage, ...params);\n if (!isLive)\n throw new Error(errormessage); //big errors on test servers\n return null;\n}\n\nexport function makePxlURL(baseurl: string, eventname: string, data?: PxlEventData | null, options?: Partial<PxlOptions>) {\n options = { ...globalOptions, ...options };\n\n if (typeof eventname !== \"string\")\n return pxlFailed(`Invalid eventname name '${eventname}', expected string, got ${typeof eventname}`);\n if (!eventname_regex.test(eventname))\n return pxlFailed(`Invalid eventname name '${eventname}', must be a valid module:event name`);\n if (data && typeof data !== \"object\")\n return pxlFailed(`Invalid data, expected object, got ${typeof data}`);\n\n if (!pagesession)\n pagesession = generateRandomId();\n\n //not using URL object, simplifies support of relative URLs\n const url = new URL(baseurl, document.baseURI);\n url.searchParams.set(\"pe\", eventname);\n url.searchParams.set(\"pp\", pagesession);\n url.searchParams.set(\"pc\", String(++seqnr));\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/navigator/doNotTrack\n // The 'doNotTrack' option overrides the browser setting if not \"unspecified\"\n const donottrack = options.donottrack === \"1\" || (options.donottrack === \"unspecified\" && (window.navigator.doNotTrack === \"1\" || window.navigator.doNotTrack === \"yes\"));\n if (!donottrack) {\n url.searchParams.set(\"pi\", getPxlId());\n url.searchParams.set(\"ps\", getPxlSessionId());\n } else if (options.debug)\n console.log(`[pxl] Do Not Track is set, not adding pi and ps`);\n\n if (options.altsamplerate)\n url.searchParams.set(\"pr\", String(options.altsamplerate));\n\n if (document.location)\n url.searchParams.set(\"bl\", document.location.href);\n if (document.referrer)\n url.searchParams.set(\"br\", document.referrer.substring(0, 1000));\n url.searchParams.set(\"bt\", dompack.browser.triplet);\n if (dompack.browser.device)\n url.searchParams.set(\"bd\", dompack.browser.device);\n if (!options.nobrowserenvironment) {\n url.searchParams.set(\"bu\", window.navigator.userAgent);\n if (window.screen.width && window.screen.height)\n url.searchParams.set(\"bs\", `${window.screen.width}x${window.screen.height}`);\n if (window.devicePixelRatio)\n url.searchParams.set(\"bp\", String(window.devicePixelRatio));\n }\n\n if (data) {\n for (const [name, value] of Object.entries(data)) {\n const test = datakey_regex.exec(name);\n if (!test)\n return pxlFailed(`Invalid data field name '${name}', should be ds_XXX, dn_XXX or db_XXX with X consisting of characters in the range 0 - 9, a - z or an underscore`);\n\n const type = typeof value;\n\n if (test[1]) { // String\n if (value && type !== \"string\")\n return pxlFailed(`Invalid value type '${type}', expected 'string' for field '${name}'`);\n\n url.searchParams.set(name, value as string || '');\n } else if (test[2]) { // Number\n if (value && type !== \"number\")\n return pxlFailed(`Invalid value type '${type}', expected 'number' for field '${name}'`);\n\n url.searchParams.set(name, String(value) || '0');\n } else if (test[3]) { // Boolean\n if (value && type !== \"boolean\")\n return pxlFailed(`Invalid value type '${type}', expected 'boolean' for field '${name}'`);\n\n url.searchParams.set(name, value ? \"true\" : \"false\");\n }\n }\n }\n return url;\n}\n\nexport function getPxlId(options?: Partial<PxlOptions>) {\n options = { ...globalOptions, ...options };\n\n //Chrome's cookie block setting throws when acessing window.localStorage, so check for it in a safer way\n const havelocalstorage = dompack.isStorageAvailable();\n\n const sessionExpireDays = (options?.sessionexpiration ?? max_sessionid_age);\n\n // Use localStorage if available, otherwise just use a cookie\n if (havelocalstorage) {\n let expiration = new Date();\n let id = localStorage.getItem(\"_wh.pi\");\n if (id) {\n const timestampvar = localStorage.getItem(\"_wh.ti\");\n if (timestampvar) {\n const timestamp = new Date(timestampvar);\n if (timestamp > expiration) {\n if (options.debug)\n console.log(`[pxl] Using id ${id} from localStorage`);\n return id;\n } else if (options.debug)\n console.log(`[pxl] Id from localStorage has expired(${timestamp} <= ${expiration})`);\n }\n }\n\n id = generateRandomId();\n expiration = new Date(expiration.getTime() + sessionExpireDays * 24 * 60 * 60 * 1000);\n localStorage.setItem(\"_wh.pi\", id);\n localStorage.setItem(\"_wh.ti\", expiration.toISOString());\n if (options.debug)\n console.log(`[pxl] Storing id ${id} in localStorage with expiration date ${expiration} `);\n return id;\n } else {\n let id = dompack.getCookie(\"_wh.pi\");\n if (!id) {\n id = generateRandomId();\n dompack.setCookie(\"_wh.pi\", id, { duration: sessionExpireDays });\n if (options.debug)\n console.log(`[pxl] Storing user id ${id} in cookie`);\n } else if (options.debug)\n console.log(`[pxl] Using user id ${id} from cookie`);\n return id;\n }\n}\n\nfunction getPxlSessionId(options?: Partial<PxlOptions>) {\n options = { ...globalOptions, ...options };\n\n let id = dompack.getCookie(\"_wh.ps\");\n if (!id) {\n id = generateRandomId();\n dompack.setCookie(\"_wh.ps\", id);\n if (options.debug)\n console.log(`[pxl] Storing session id ${id} in cookie`);\n } else if (options.debug)\n console.log(`[pxl] Using session id ${id} from cookie`);\n return id;\n}\n\n/** Send a pxl event\n @param event - Event type, preferably in the format 'module:event'\n @param data - Event data. A map whose keys must start with either ds_ (string), db_ (boolean) or dn_ (number)\n*/\nexport function sendPxlEvent(event: string, data?: PxlEventData | null, options?: Partial<PxlOptions>) {\n const finaloptions: PxlOptions = { ...globalOptions, ...options };\n\n if (!dompack.dispatchCustomEvent(finaloptions.node || window, \"consilio:pxl\", {\n bubbles: true, cancelable: true, defaulthandler: pingPxlEvent, detail: {\n event,\n data: data || {},\n options: finaloptions,\n isaltsample: useAltRecordURL\n }\n })) {\n if (finaloptions.debug)\n console.log(`[pxl] Event of type '${event}' cancelled by consilio:pxl event handler`);\n }\n}\n\nfunction pingPxlEvent(evt: PxlEvent) {\n // determine the recordurl for this page\n const isaltsample = evt.detail.isaltsample;\n const event = evt.detail.event;\n const data = evt.detail.data;\n const options = evt.detail.options;\n const baseurl = isaltsample ? options.altrecordurl : options.recordurl;\n\n // Add the pxl event to the url\n const url = makePxlURL(baseurl, event, data, options);\n if (!url)\n return;\n\n if (!window.whPxlLog)\n window.whPxlLog = [];\n window.whPxlLog.push({ event, data, options, isaltsample });\n if (options.debug)\n console.log(`[pxl] Event '${event}'`, data);\n\n if (options.beacon) {\n //@ts-ignore Older browsers might not have sendBeacon\n if (window.navigator.sendBeacon) {\n if (options.debug)\n console.log(`[pxl] Beacon - pinging pxl '${url}'(sendBeacon)`);\n navigator.sendBeacon(url);\n } else {\n if (options.debug)\n console.log(`[pxl] Beacon - pinging pxl '${url}'(sync XHR)`);\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", url, false);\n xhr.send();\n\n if (options.debug)\n console.log(`[pxl] Beacon - pinging pxl '${url}' - sync XHR done!`);\n }\n } else {\n // Load the pxl file using fetch\n const promise = fetch(url, { mode: \"no-cors\", method: \"HEAD\", credentials: \"same-origin\", cache: \"no-store\", keepalive: true });\n if (options.debug) {\n console.log(`[pxl] Pinging pxl '${url}'`);\n promise.then(() => {\n console.log(`[pxl] Pinged pxl`);\n }).catch(error => {\n console.error(`[pxl] Error while pinging pxl`, error);\n });\n } else {\n promise.catch(function () { }); //we don't really care about failed fetches, but don't turn them into unhandled rejections\n }\n }\n}\n\nsetPxlOptions(null);\n","export const rfSymbol = Symbol('RegisteredField');\n\ndeclare global {\n interface HTMLElement {\n [rfSymbol]?: FormFieldAPI;\n }\n}\n\nexport interface FormFieldAPI {\n getValue(): unknown;\n setValue(newvalue: unknown): void;\n}\n","import { getTid } from \"@webhare/gettid\";\nimport \"./arrayfield.css\";\nimport { throwError } from \"@webhare/std\";\nimport { addDocEventListener, qS, qSA, type DocEvent, registerMissed, stop } from \"@webhare/dompack\";\nimport { getFieldName, getFormElementCandidates, getFormHandler, parseCondition, setFieldName } from \"@webhare/forms/src/domsupport\";\nimport type { FormCondition } from \"@webhare/forms/src/types\";\nimport { RecordFieldHandler, type FormParent } from \"@webhare/forms/src/fieldmap\";\nimport type FormBase from \"../formbase\";\nimport { setup } from \"../internal/webharefields\";\n\n\nfunction fixupConditionRecursive(node: HTMLElement, condition: FormCondition, mapping: Map<string, string>): boolean {\n switch (condition.matchtype) {\n case \"AND\":\n case \"OR\":\n {\n let anychanges = false;\n for (const subcondition of condition.conditions)\n anychanges = fixupConditionRecursive(node, subcondition, mapping) || anychanges;\n return anychanges;\n }\n case \"NOT\":\n {\n return fixupConditionRecursive(node, condition.condition, mapping);\n }\n default:\n {\n const newName = mapping.get(condition.field);\n if (newName && node.querySelector(`[name=\"${newName}\"]`)) {\n condition.field = newName;\n return true;\n }\n }\n }\n return false;\n}\n\ntype NewType = FormParent;\n\nexport default class ArrayField {\n valueNode: HTMLInputElement;\n nextrowid = 0;\n template;\n insertPoint: HTMLElement;\n arrayBaseName;\n\n constructor(private handler: NewType, private node: HTMLElement, items: HTMLElement[], private name: string) {\n node.dataset.whFormRegisteredField = \"dynamic\"; //just to keep the parent class happy\n this.arrayBaseName = node.dataset.whFormGroupFor || throwError(\"Missing array base name\");\n\n // The template for new rows. If we have arrays-in-array, it will still be the first <template>\n this.template = qS<HTMLTemplateElement>(node, \"template\") || throwError(\"Missing array template\");\n // The node before which to add new rows\n this.insertPoint = this.template.parentNode!.lastElementChild! as HTMLElement;\n if (!this.insertPoint.matches(\".wh-form__arrayadd\"))\n throw new Error(\"Missing array insert point\");\n\n // Event handler for add/delete button clicks\n this.insertPoint.addEventListener(\"click\", event => this.onAddRow(event));\n addDocEventListener(node, \"click\", event => this._onClick(event));\n\n // Proxy node for getting/setting properties and receiving events\n this.valueNode = qS<HTMLInputElement>(node, \"input.wh-form__arrayinput\") ?? throwError(\"Missing array input\");\n this.valueNode.whUseFormGetValue = true;\n this.valueNode.addEventListener(\"wh:form-getvalue\", event => this._onGetValue(event));\n //@ts-expect-error wh:form-setvalue isn't defined - but it'll go away anyway\n this.valueNode.addEventListener(\"wh:form-setvalue\", event => this._onSetValue(event));\n\n // Initialize initial value rows\n for (const rownode of qSA(this.node, \".wh-form__arrayrow\"))\n this._fixupRowNode(rownode);\n\n this._checkValidity();\n }\n\n get form(): FormBase {\n const form = getFormHandler(this.node.closest(\"form\") ?? throwError(\"Could not find <form>\")) ?? throwError(\"Could not find form for arrayfield\");\n if (!form._getFieldsToValidate) //avoid calling into formbase from our constructor, it may not be there yet...\n throw new Error(\"The <form> is not ready yet\");\n return form;\n }\n\n addRow(): HTMLElement {\n // Instatiate a new row\n const newrow = this.template.content.cloneNode(true) as HTMLElement;\n (newrow.firstElementChild! as HTMLElement).dataset.whFormRowid = String(this.nextrowid++);\n\n // Insert the new row\n this.insertPoint.parentNode!.insertBefore(newrow, this.insertPoint);\n const addedrow = this.insertPoint.previousElementSibling! as HTMLElement;\n\n /* If the form is relying on legacy dompack.register to go through ImgEditField and do the actual\n customElements.define call.... then the 'name' attributes won't actually work on the 'new' elements.\n therefore dompack.registerMissed must run before _fixupRowNode */\n registerMissed(addedrow);\n setup(addedrow);\n\n this._fixupRowNode(addedrow as HTMLElement);\n this._checkValidity();\n this.form.__scheduleUpdateConditions();\n return this.insertPoint.previousSibling as HTMLElement;\n }\n\n /* seems a unused API ?. .. if we need to provide this, just let people pass us a row node instead of understanding IDs\n removeRow(id)\n {\n // Remove a row by id\n let node = this.node.querySelector(`.wh-form__arrayrow[data-row-id=${id}]`);\n if (node)\n this._removeRowNode(node);\n }\n */\n\n private onAddRow(event: Event) {\n stop(event);\n this.addRow();\n }\n _onClick(event: DocEvent<MouseEvent>) {\n // Check if a delete button was clicked\n const delNode = event.target.closest(\".wh-form__arraydelete\");\n if (delNode) {\n event.preventDefault();\n this._removeRowNode(delNode.closest(\".wh-form__arrayrow\")!);\n }\n }\n\n getRowHandler(row: HTMLElement): RecordFieldHandler {\n const rowBaseName = this.valueNode.name + \".\" + row.dataset.whFormRowid;\n const rowFields = getFormElementCandidates(row, rowBaseName).filter(_ => _.dataset.whFormCellname !== \"row_uid\"); //row_uid points back to us, so requesting that triggers a loop\n return new RecordFieldHandler(this.handler, rowBaseName, rowFields);\n }\n\n getValue() {\n const rows = [];\n for (const row of qSA(this.node, \".wh-form__arrayrow\").filter(n => n.parentNode === this.template.parentNode)) {\n const handler = this.getRowHandler(row);\n const rowval = handler.getValue();\n rows.push(rowval);\n }\n return rows;\n }\n\n _onGetValue(event: CustomEvent<{ deferred: PromiseWithResolvers<unknown> }>) {\n // We're using the deferred promise to return our value\n event.preventDefault();\n event.stopPropagation();\n\n // Create a promise for each row that resolves with the combined value of all fields in the row\n const valuePromises = [];\n for (const row of qSA(this.node, \".wh-form__arrayrow\").filter(n => n.parentNode === this.template.parentNode)) {\n const rowFields = this._queryAllFields(row);\n // Create a promise for each of the row's subfields to get its value\n const rowPromises = rowFields.map(field => (this.form as FormBase)._getQueryiedFieldValue(field)); //FIXME get rid of 'as FormBase' to support array-in-array\n // Add an all promise for the value promises and add it to the list of row promises\n valuePromises.push(Promise.all(rowPromises).then(values => {\n // Combine the values into a value object for this row\n const rowValue: Record<string, unknown> = { formrowid: row.dataset.whFormRowid };\n values.forEach((value, idx) => {\n // The values are returned in the order that the promises were added to the list of value promises, so we can use\n // the index of the value to get the original field\n const rowField = rowFields[idx];\n const firstnode = rowField.multi ? rowField.nodes[0] : rowField.node;\n rowValue[firstnode.dataset.whFormCellname!] = value;\n });\n return rowValue;\n }));\n }\n // Wait for all the row promises (which resolves with a list of promise resolution values, which will be the final value\n // of the array field)\n Promise.all(valuePromises).then(valueRows => event.detail.deferred.resolve(valueRows));\n }\n\n setValue(newvalue: unknown[]) {\n if (!Array.isArray(newvalue))\n throw new Error(`Invalid value for array field '${this.name}': ${JSON.stringify(newvalue)}`);\n\n // Remove all current rows (TODO optimize)\n while (this.insertPoint.previousElementSibling?.classList.contains(\"wh-form__arrayrow\"))\n this._removeRowNode(this.insertPoint.previousElementSibling);\n\n // Check if we have an array value\n for (const value of newvalue) {\n // Add a row\n const row = this.addRow();\n const handler = this.getRowHandler(row);\n handler.setValue(value);\n }\n this._checkValidity();\n }\n\n _onSetValue(event: CustomEvent<{ value: unknown }>) {\n event.preventDefault();\n event.stopPropagation();\n\n // Remove all current rows\n while (this.insertPoint.previousElementSibling?.classList.contains(\"wh-form__arrayrow\"))\n this._removeRowNode(this.insertPoint.previousElementSibling);\n\n // Check if we have an array value\n if (Array.isArray(event.detail.value)) {\n for (const value of event.detail.value) {\n // Add a row\n const row = this.addRow();\n // Initialize the row's fields\n for (const field of this._queryAllFields(row)) {\n for (const fieldnode of (field.multi ? field.nodes : [field.node])) {\n if (fieldnode.dataset.whFormCellname && fieldnode.dataset.whFormCellname in value) {\n (this.form as FormBase).setFieldValue(fieldnode, value[fieldnode.dataset.whFormCellname]); //FIXME get rid of 'as FormBase' to support array-in-array\n }\n }\n }\n }\n }\n this._checkValidity();\n }\n\n _fixupRowNode(node: HTMLElement) {\n const rowid = node.dataset.whFormRowid;\n\n // Rename all fields to avoid duplicate field names\n const mapping = new Map<string, string>;\n for (const fieldnode of getFormElementCandidates(node, this.arrayBaseName)) {\n\n // Leave embedded arrayfields alone! Except if this is specifically the wh-form__arrayinput one level down\n const nodeArray = fieldnode.closest(\".wh-form__fieldgroup--array\");\n if (nodeArray && nodeArray !== this.node && !(fieldnode.matches(\".wh-form__arrayinput\") && (nodeArray.parentNode! as HTMLElement).closest(\".wh-form__fieldgroup--array\") === this.node)) {\n // console.log(\"Skipping\", fieldnode, \"as it's not in our array\");\n continue;\n }\n\n // Rename fields\n const fieldname = getFieldName(fieldnode);\n // When rendering, the fields simply have their arrayname prefixed in their name=, see InstantiateField in array.whlib (TODO seems dangerous, eg preset radio buttons interfering with each other?\n // So we'll just take the part after the first dot as the cellname\n fieldnode.dataset.whFormCellname ||= fieldname.substring(this.arrayBaseName.length + 1);\n\n const cellname: string = fieldnode.dataset.whFormCellname;\n const subname = this.valueNode.name + \".\" + rowid + \".\" + cellname;\n // console.log(\"for\", this.name, \"rename\", fieldname, \"to\", subname, fieldnode);\n setFieldName(fieldnode, subname);\n mapping.set(fieldname, subname);\n\n // Rename id's to make them unique; update the labels within the field's fieldgroup to point to the new id\n if (fieldnode.id) {\n const labelnodes = qSA<HTMLLabelElement>(node, `label[for=\"${fieldnode.id}\"]`);\n fieldnode.id += \"-\" + rowid;\n for (const labelnode of labelnodes)\n labelnode.htmlFor = fieldnode.id;\n }\n\n // Rewrite conditions after all fields have been renamed\n for (const type of [\"visible\", \"enabled\", \"required\"]) {\n for (const conditionnode of qSA(node, `[data-wh-form-${type}-if]`)) {\n const condition = parseCondition(conditionnode.dataset[`whForm${type[0].toUpperCase() + type.slice(1)}If`]!);\n if (fixupConditionRecursive(node, condition, mapping))\n conditionnode.dataset[`whForm${type[0].toUpperCase() + type.slice(1)}If`] = JSON.stringify({ c: condition });\n }\n }\n }\n\n this.getRowHandler(node); //initializes deeper arrays. fieldmap should probably be handling this and build a full mapping top to botom...\n }\n\n _removeRowNode(node: Element) {\n // Remove the row node\n node.remove();\n this._checkValidity();\n }\n\n _checkValidity() {\n const minRows = parseInt(this.valueNode.dataset.whMin || \"0\");\n const maxRows = parseInt(this.valueNode.dataset.whMax || \"0\");\n\n const numRows = this.node.querySelectorAll(\".wh-form__arrayrow\").length;\n if (numRows < minRows)\n this.valueNode.setCustomValidity(getTid(\"publisher:site.forms.commonerrors.minarray\", minRows));\n else if (maxRows > 0 && numRows > maxRows)\n this.valueNode.setCustomValidity(getTid(\"publisher:site.forms.commonerrors.maxarray\", maxRows));\n else\n this.valueNode.setCustomValidity(\"\");\n\n // Disable the add button if the maximum number of rows is reached\n if (maxRows > 0 && numRows >= maxRows)\n this.node.classList.add(\"wh-form__array--maxrows\");\n else\n this.node.classList.remove(\"wh-form__array--maxrows\");\n }\n\n _queryAllFields(node: HTMLElement) {\n return (this.form as FormBase)._queryAllFields({ startnode: node, skipfield: this.valueNode }); //FIXME get rid of 'as FormBase' to support array-in-array\n }\n}\n","import { getFieldName } from \"./domsupport\";\nimport { rfSymbol, type FormFieldAPI } from \"./registeredfield\";\nimport ArrayField from \"@mod-publisher/js/forms/fields/arrayfield\";\nimport { omit, type AddressValue, nameToSnakeCase, nameToCamelCase, throwError, isDate } from \"@webhare/std\";\nimport type { RecursivePartial } from \"@webhare/js-api-tools\";\nimport type { FormFieldLike } from \"./jsformelement\";\n\nexport interface FormParent {\n __scheduleUpdateConditions(): void;\n}\n\n\ninterface FormField {\n getValue(): unknown;\n\n /** Set a value\n * @param newvalue - The new value to set\n * @param ignoreInvalid - Do not throw if the value is invalid. Used for eg. prefills which can't usefully handle it anyway\n * @returns True if succesfully set */\n\n setValue(newvalue: unknown): void;\n}\n\ntype ValueType = \"number\" | \"boolean\" | \"date\";\n\nfunction unmapFieldName(camelCaseName: string) {\n return camelCaseName.startsWith(\"__formfield\") ? camelCaseName : nameToSnakeCase(camelCaseName);\n\n}\nfunction mapFieldName(htmlName: string) {\n return htmlName.startsWith(\"__formfield\") ? htmlName : nameToCamelCase(htmlName);\n}\n\nfunction mapValue(type: ValueType, invalue: string) {\n switch (type) {\n case \"number\":\n return parseFloat(invalue);\n case \"boolean\":\n return invalue === \"true\";\n case \"date\":\n return new Date(invalue);\n }\n}\n\nfunction unmapValue(type: ValueType | undefined, invalue: unknown, fieldDescr: string) {\n switch (type) {\n case null:\n if (typeof invalue !== \"string\")\n throw new Error(`Invalid type ${typeof invalue} for string field ${fieldDescr}: ${invalue}`);\n return invalue;\n\n case \"number\":\n if (typeof invalue !== \"number\")\n throw new Error(`Invalid type ${typeof invalue} for number field ${fieldDescr}: ${invalue}`);\n return String(invalue);\n\n case \"boolean\":\n if (typeof invalue !== \"boolean\")\n throw new Error(`Invalid type ${typeof invalue} for boolean field ${fieldDescr}: ${invalue}`);\n return String(invalue);\n\n case \"date\":\n if (!isDate(invalue))\n throw new Error(`Invalid type ${typeof invalue} for date field ${fieldDescr}: ${invalue}`);\n return invalue.toISOString();\n }\n}\n\nclass HTMLFormFieldHandler implements FormField {\n valuetype?: ValueType;\n\n constructor(private form: FormParent, private readonly field: FormFieldLike) {\n this.valuetype = field.dataset.whFormValueType as undefined | ValueType;\n if (!this.valuetype && field.matches('input[type=number]'))\n this.valuetype = \"number\";\n }\n\n getValue(): unknown {\n if (this.field.matches('input[type=checkbox]'))\n return (this.field as HTMLInputElement).checked;\n if (this.field.matches('input[type=date]'))\n return (this.field as HTMLInputElement).valueAsDate;\n\n if (this.field.tagName === \"SELECT\") {\n const selectedrow = (this.field as HTMLSelectElement).selectedOptions[0];\n if (!selectedrow || selectedrow.dataset.whPlaceholder !== undefined)\n return null; //didn't select a 'real' option\n\n return this.valuetype ? mapValue(this.valuetype, selectedrow.value) : selectedrow.value;\n }\n\n return this.valuetype ? mapValue(this.valuetype, this.field.value as string) : this.field.value;\n }\n\n setValue(newvalue: unknown): void {\n if (this.field.matches('input[type=checkbox]')) {\n //For convenience we're interpreting setting a checkbox as 'truthy' instead of explicit true/false\n const setvalue = Boolean(newvalue);\n if (setvalue === (this.field as HTMLInputElement).checked)\n return;\n\n (this.field as HTMLInputElement).checked = setvalue;\n } else if (this.field.matches('input[type=date]')) {\n if ((this.field as HTMLInputElement)?.valueAsDate?.getTime() === (newvalue as Date | null)?.getTime())\n return;\n (this.field as HTMLInputElement).valueAsDate = newvalue as Date;\n } else if (this.field.tagName === \"SELECT\" && newvalue === null) { //'null' resets the select to 'no value', so figure out if there's a placeholder row\n const setvalue = (this.field as HTMLSelectElement).options[0]?.dataset.whPlaceholder !== undefined ? 0 : -1;\n if ((this.field as HTMLSelectElement).selectedIndex === setvalue)\n return;\n (this.field as HTMLSelectElement).selectedIndex = setvalue;\n } else {\n const setvalue = this.valuetype ? unmapValue(this.valuetype, newvalue, this.field.name) : newvalue;\n if (this.field.value === setvalue)\n return;\n this.field.value = setvalue;\n }\n this.form.__scheduleUpdateConditions();\n }\n}\n\nclass RadioFormFieldHandler implements FormField {\n valuetype?: ValueType;\n constructor(private form: FormParent, private readonly name: string, private readonly rnodes: HTMLInputElement[]) {\n this.valuetype = (rnodes[0].closest<HTMLElement>(\".wh-form__fieldgroup\") ?? throwError(\"RadioFormFieldHandler: Missing group\")).dataset.whFormValueType as undefined | ValueType;\n }\n getValue(): unknown {\n const node = this.rnodes.find(_ => _.checked);\n return (node ? this.valuetype ? mapValue(this.valuetype, node.value) : node.value : null);\n }\n setValue(newvalue: unknown): void {\n if (newvalue === null) {\n for (const node of this.rnodes)\n node.checked = false;\n\n this.form.__scheduleUpdateConditions();\n return;\n }\n\n const myname = `radio group ${this.name}`;\n const setvalue = unmapValue(this.valuetype, newvalue, myname);\n\n const node = this.rnodes.find(_ => _.value === setvalue);\n if (!node)\n throw new Error(`No such value '${setvalue}' in radio group '${this.name}`);\n\n node.checked = true;\n this.form.__scheduleUpdateConditions();\n }\n}\n\nclass CheckboxGroupHandler implements FormField {\n valuetype?: ValueType;\n constructor(private form: FormParent, private readonly name: string, private readonly cboxes: HTMLInputElement[]) {\n this.valuetype = (cboxes[0].closest<HTMLElement>(\".wh-form__fieldgroup\") ?? throwError(\"RadioFormFieldHandler: Missing group\")).dataset.whFormValueType as undefined | ValueType;\n }\n getValue(): unknown {\n return this.cboxes.filter(_ => _.checked).map(_ => this.valuetype ? mapValue(this.valuetype, _.value) : _.value);\n }\n setValue(newvalue: unknown): void {\n const myname = `checkbox group '${this.name}'`;\n if (!Array.isArray(newvalue))\n throw new Error(`Value for ${myname} should be an array, got '${JSON.stringify(newvalue)}'`);\n\n const toset = newvalue.map(_ => unmapValue(this.valuetype, _, myname));\n\n this.cboxes.forEach(_ => _.checked = toset.includes(_.value));\n this.form.__scheduleUpdateConditions();\n\n //in case the error is caught and ignored (eg prefill), we'll update what we can\n const missing = toset.filter(_ => !this.cboxes.some(cbox => cbox.value === _));\n if (missing.length)\n throw new Error(`Invalid value(s) for ${myname}: ${missing.join(', ')}`);\n }\n}\n\nclass RegisteredFieldHandler implements FormField {\n constructor(protected form: FormParent, private readonly field: FormFieldAPI) {\n }\n\n getValue(): unknown {\n return this.field.getValue();\n }\n setValue(newvalue: unknown): void {\n this.field.setValue(newvalue);\n }\n}\n\nexport class ArrayFieldHandler extends RegisteredFieldHandler implements FormField {\n constructor(form: FormParent, private node: HTMLElement, items: HTMLElement[]) {\n node[rfSymbol] ||= new ArrayField(form, node, items, getFieldName(items[0]));\n super(form, node[rfSymbol]);\n }\n\n __scheduleUpdateConditions() {\n this.form.__scheduleUpdateConditions();\n }\n}\n\n/** The FormFieldMap exposes a multi-level (ie unflattened) view of the form values. Internally it works with the\n original names because generated fields names, eg __formfieldbbbwVsWih_0DrJOc0beS7Q_, cannot be assumed to be snake_case and convertable */\nexport abstract class FormFieldMap<DataShape> {\n /** Field mapping. Uses original names */\n protected fieldmap = new Map<string, FormField>();\n\n constructor(protected fieldName: string, nodes: HTMLElement[]) {\n const subpos = fieldName ? fieldName.length + 1 : 0;\n const groups = Map.groupBy(nodes, _ => getFieldName(_).substring(subpos).split('.')[0]);\n\n for (const [name, items] of groups) {\n const fullName = (fieldName ? fieldName + '.' : '') + name;\n if (!name) {\n console.error(`There are fields without a name:`, items);\n continue;\n }\n\n if (items[0].matches('input[type=radio]')) {\n this.fieldmap.set(name, new RadioFormFieldHandler(this, fullName, items as HTMLInputElement[]));\n continue;\n }\n\n if (items[0].matches('.wh-form__arrayinput')) {\n const arraygroup = items[0].closest<HTMLElement>('.wh-form__fieldgroup--array');\n if (arraygroup) {\n this.fieldmap.set(name, new ArrayFieldHandler(this, arraygroup, items));\n continue;\n }\n }\n\n const hasGroupLeader = getFieldName(items[0]) === fullName; //ie name has no followup '.xx'\n if (hasGroupLeader) { //if no subname, it's the group leader ?\n if (items[0].matches('input[type=checkbox]')) {//is it a checkbox group?\n const cboxgroup = items[0].closest(\".wh-form__fieldgroup--checkboxgroup\");\n if (cboxgroup) {\n this.fieldmap.set(name, new CheckboxGroupHandler(this, fullName, items as HTMLInputElement[]));\n continue;\n }\n }\n\n this.fieldmap.set(name, new HTMLFormFieldHandler(this, items[0] as FormFieldLike));\n continue;\n }\n\n //We're an implicit record (even if with just one member)\n if (items[0].matches('select[name$=\".country\"][data-orderingdata]')) //looks like address.whlib\n this.fieldmap.set(name, new AddressFieldHandler(this, fullName, items));\n else\n this.fieldmap.set(name, new RecordFieldHandler(this, fullName, items));\n }\n }\n\n abstract __scheduleUpdateConditions(): void;\n\n /** Get a field handler by name */\n getField(name: string, options: { allowMissing: true }): FormField | null;\n getField(name: string, options?: { allowMissing?: boolean }): FormField;\n\n getField(name: string, options?: { allowMissing?: boolean }): FormField | null {\n const mapName = unmapFieldName(name);\n const match = this.fieldmap.get(mapName);\n if (match)\n return match;\n if (options?.allowMissing)\n return null;\n\n throw new Error(`Field '${name}' not found in this form`); //TODO report the fukll anme\n }\n\n getFieldNames(): string[] {\n return [...this.fieldmap.keys()].map(mapFieldName);\n }\n\n /** Set a value for multiple fields\n * @param data - The data to set\n * @param ignoreUnknownFields - Do not throw if a field is not found in the form. This is the default\n */\n assign(data: RecursivePartial<DataShape>, { ignoreUnknownFields = true } = {}) {\n for (const [key, value] of Object.entries(data as object)) {\n const field = this.getField(key, { allowMissing: ignoreUnknownFields });\n if (field)\n field.setValue(value);\n }\n }\n}\n\nexport class RecordFieldHandler extends FormFieldMap<object> implements FormField {\n constructor(private form: FormParent, baseName: string, nodes: HTMLElement[]) {\n super(baseName, nodes);\n }\n\n getValue(): unknown {\n const retval: Record<string, unknown> = {};\n for (const [name, field] of this.fieldmap) {\n const val = field.getValue();\n if (val !== undefined) //Suppress undefined values (where we cannot safely re-set them, eg images in Object.keys\n retval[mapFieldName(name)] = val;\n }\n\n return retval;\n }\n\n setValue(newvalue: unknown): void {\n if (typeof newvalue !== 'object' || newvalue === null)\n throw new Error(`Invalid value for record field '${this.fieldName}': ${newvalue}`);\n\n for (const [name, field] of this.fieldmap) {\n const prettyName = mapFieldName(name);\n if (prettyName in newvalue)\n field.setValue((newvalue as Record<string, unknown>)[prettyName]);\n }\n }\n\n __scheduleUpdateConditions() {\n this.form.__scheduleUpdateConditions();\n }\n}\n\n/* TODO cleanup... this is a workaround to translate nr_detail to houseNumber. ideally the server would just send house_number as field\n name but that transition will take time. also we need a nice way to 'take over' addressifelds rather than fieldmapper special casing\n its detection\n*/\ntype OldAddressValue = Omit<AddressValue, \"houseNumber\"> & { nrDetail?: string };\n\nclass AddressFieldHandler extends RecordFieldHandler {\n constructor(form: FormParent, baseName: string, nodes: HTMLElement[]) {\n super(form, baseName, nodes);\n }\n\n getValue(): unknown {\n const val = super.getValue() as OldAddressValue;\n if (val?.country === null)\n return null;\n\n return val?.nrDetail !== undefined ? { ...omit(val, [\"nrDetail\"]), houseNumber: val.nrDetail } : val;\n }\n\n setValue(val: unknown) {\n if (val === null) {\n super.setValue({ country: null, city: \"\", street: \"\", zip: \"\", nrDetail: \"\", state: \"\" });\n return;\n }\n\n ///@ts-expect-error ugly hack, not really worth overwriting with as\n super.setValue(val?.houseNumber !== undefined ? { ...omit(val, [\"houseNumber\"]), nrDetail: val.houseNumber } : val);\n }\n}\n\nexport class FieldMapDataProxy implements ProxyHandler<object> {\n constructor(private readonly form: FormFieldMap<object>) {\n }\n get(target: object, p: string | symbol) {\n //Don't attempt to validate getters... it will break various introspection calls (eg requesting constructor, checking for 'then'...)\n const field = typeof p === \"string\" ? this.form.getField(p, { allowMissing: true }) : null;\n return field ? field.getValue() : (target as Record<string | symbol, unknown>)[p];\n }\n set(target: unknown, p: string, value: unknown): boolean {\n this.form.getField(p).setValue(value);\n return true;\n }\n ownKeys(target: object): ArrayLike<string | symbol> {\n return this.form.getFieldNames();\n }\n getOwnPropertyDescriptor(target: unknown, prop: string) { // allows ownKeys to actually return to Object.keys\n return { enumerable: true, configurable: true };\n }\n}\n","import { stringify, emplace, type AddressValue, omit } from \"@webhare/std\";\nimport PublisherFormService, { type HareScriptAddressValidationResult, type HareScriptAddressValue } from \"./formservice\";\n\nexport type { HareScriptAddressValue, HareScriptAddressValidationResult } from \"./formservice\";\n\nexport type AddressChecks = \"nl-zip-suggest\" | \"nl-zip-force\";\n\nexport type AddressValidationStatus = \"ok\" | \"unknown\" | \"error\";\n// not_supported\" | \"ok\" | \"not_enough_data\" | \"invalid_city\" | \"invalid_zip\" | \"invalid_nr_detail\" | \"zip_not_found\" | \"address_not_found\" | \"different_citystreet\" | \"incomplete\" | \"lookup_failed\";\n\nexport interface AddressValidationOptions {\n checks?: AddressChecks[];\n lang?: string;\n}\n\nexport interface AddressValidationResult {\n status: AddressValidationStatus;\n errors: Array<{\n ///Fields affected by the error\n fields: string[];\n ///Error message in the requested language\n message: string;\n }>;\n corrections: Partial<Record<keyof AddressValue, string>> | null;\n}\n\nlet lookupcache: Map<string, Promise<AddressValidationResult>> | undefined;\n\nexport async function verifyHareScriptAddress(address: HareScriptAddressValue, options: AddressValidationOptions = {}): Promise<HareScriptAddressValidationResult> {\n if (!lookupcache)\n lookupcache = new Map<string, Promise<AddressValidationResult>>;\n\n const lookupkey = stringify({ address, options }, { stable: true });\n const lookup = emplace(lookupcache, lookupkey, {\n insert: () => PublisherFormService.verifyAddress(location.pathname, address, options)\n });\n return await lookup;\n}\n\nexport async function verifyAddress(address: AddressValue, options: AddressValidationOptions = {}): Promise<AddressValidationResult> {\n if (!lookupcache)\n lookupcache = new Map<string, Promise<AddressValidationResult>>;\n\n // convert houseNumber to nr_detail\n const hsAddress = { ...omit(address, [\"houseNumber\"]), nr_detail: address.houseNumber };\n\n const hsresult = await verifyHareScriptAddress(hsAddress, options);\n\n // back-convert nr_detail to houseNumber\n let corrections: AddressValidationResult[\"corrections\"] = null;\n if (hsresult.corrections) {\n corrections = {};\n for (const [key, value] of Object.entries(hsresult.corrections) as Array<[keyof HareScriptAddressValue, string]>) {\n corrections[key === \"nr_detail\" ? \"houseNumber\" as const : key] = value;\n }\n }\n return {\n status: hsresult.status,\n errors: hsresult.errors.map(error => ({ fields: error.fields.map(f => f === \"houseNumber\" ? \"nr_detail\" : f), message: error.message })),\n corrections,\n };\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/jsonrpc-client\" {\n}\n\nimport { debugFlags, backendBase } from \"@webhare/env\";\nimport type { ConsoleLogItem, Serialized } from \"@webhare/env/src/concepts\";\nimport { StackTrace, parseTrace, prependStackTrace, type PromisifyFunctionReturnType } from \"@webhare/js-api-tools\";\n\n//just number RPCs globally instead of per server, makes debug ouput more useful\nlet globalseqnr = 1;\n\n\nexport interface RPCCallOptions {\n /** Append function name to URLs. Purely for better logging/visibility as the WebHare JSONRPC server will ignore it */\n addfunctionname?: boolean;\n /** Custom URL marker */\n urlappend?: string;\n /** Call timeout */\n timeout?: number;\n /** Abort signal to cancel the RPC */\n signal?: AbortSignal;\n /** Retry on 429 */\n retry429?: boolean;\n /** Silent - do not log errors */\n silent?: boolean;\n /** Debug (Follows 'rpc' debugflag if not explicity specified) */\n debug?: boolean;\n /** Wrap result with response info */\n wrapresult?: boolean;\n keepalive?: boolean;\n /** Headers to submit (Eg Authorization) */\n headers?: Record<string, string>;\n /** Base URL for service paths */\n baseUrl?: string;\n /** Overide fetch credentials option (defaults to same-origin) */\n credentials?: RequestCredentials;\n}\n\nexport type RequestID = number | string | null;\n\nexport interface JSONRPCBaseResponse {\n id: RequestID;\n debug?: {\n consoleLog: Serialized<ConsoleLogItem[]>;\n };\n}\n\nexport interface JSONRPCSuccesfulResponse extends JSONRPCBaseResponse {\n error: null;\n result: unknown;\n}\n\nexport interface JSONRPCErrorResponse extends JSONRPCBaseResponse {\n result: null;\n error: {\n code: number;\n message: string;\n data?: {\n trace?: StackTrace;\n };\n };\n}\n\nexport type JSONRPCResponse = JSONRPCSuccesfulResponse | JSONRPCErrorResponse;\n\nfunction getDebugAppend() {\n if (typeof window !== \"undefined\" && typeof window.location !== \"undefined\") {\n const urldebugvar = new URL(window.location.href).searchParams.get(\"wh-debug\");\n if (urldebugvar)\n return '?wh-debug=' + encodeURIComponent(urldebugvar);\n }\n return '';\n}\n\nclass ControlledCall {\n client: RPCClient;\n options: RPCCallOptions;\n abortcontroller: AbortController;\n timeout?: number;\n _callurl: string;\n _fetchoptions: RequestInit;\n promise: Promise<unknown>;\n timedout?: boolean;\n aborted?: boolean;\n\n constructor(client: RPCClient, method: string, stack: StackTrace | null, id: number, options: RPCCallOptions, callurl: string, fetchoptions: RequestInit) {\n this.client = client;\n this.options = options;\n\n // if(options.timeout || options.signal) //as long as rpcResolve exists, we'll ALWAYS need to setup a controller\n {\n this.abortcontroller = new AbortController;\n fetchoptions.signal = this.abortcontroller.signal;\n\n if (options.timeout && options.timeout > 0) {\n this.timeout = options.timeout;\n setTimeout(() => this._handleTimeout(), options.timeout);\n }\n if (options.signal) {\n options.signal.addEventListener(\"abort\", () => this._abort());\n }\n }\n\n this._callurl = callurl;\n this._fetchoptions = fetchoptions;\n\n const fetchpromise = fetch(this._callurl, this._fetchoptions);\n this.promise = this._completeCall(method, stack, id, fetchpromise) as Promise<unknown>;\n }\n _handleTimeout() {\n this.timedout = true;\n this.abortcontroller.abort();\n }\n _abort() {\n this.aborted = true;\n this.abortcontroller.abort();\n }\n\n async _completeCall(method: string, requestStack: StackTrace | null, id: number, fetchpromise: Promise<Response>) {\n let response;\n try {\n for (; ;) { //loop to handle \"429 Conflict\"s\n response = await fetchpromise;\n if (response.status === 429 && !(\"retry429\" in this.options && !this.options.retry429) && response.headers.get(\"Retry-After\")) {\n const retryafter = parseInt(response.headers.get(\"Retry-After\") || \"\");\n if (this.client.debug)\n console.warn(`[rpc] We are being throttled (429 Too Many Requests) - retrying after ${retryafter} seconds`);\n\n await new Promise(resolve => setTimeout(resolve, retryafter * 1000));\n fetchpromise = fetch(this._callurl, this._fetchoptions);\n continue;\n }\n break;\n }\n } catch (exception) {\n if (this.client.debug)\n console.log(`[rpc] #${id} Exception invoking '${method}'`, exception);\n\n if (this.aborted)\n throw new Error(`RPC Aborted`);\n else if (this.timedout)\n throw new Error(`RPC Timeout: timeout was set to ${this.timeout} milliseconds`);\n else\n throw new Error(`RPC Failed: exception: ` + exception);\n }\n\n let jsonresponse;\n try {\n jsonresponse = await response.json() as JSONRPCResponse;\n if (jsonresponse?.debug) {\n if (jsonresponse.debug.consoleLog) {\n for (const logitem of jsonresponse.debug.consoleLog) {\n //should we log 'when'? it's getting more and more noisy then though....\n //TODO should we match the remote's method (after validating) or just keep eveyrthing at 'log' ?\n console.log(`[remote:${logitem.method}] ${logitem.location ? `${logitem.location.filename.split(\"/\").at(-1)}:${logitem.location.line}: ` : ''}${logitem.data}`);\n }\n }\n\n delete jsonresponse.debug; //reduce noise in later logs\n }\n\n if (this.client.debug)\n console.log(`[rpc] #${id} Received response to '${method}'`, jsonresponse);\n } catch (exception) {\n if (this.client.debug)\n console.warn(`[rpc] #${id} Response was not valid JSON`, exception);\n }\n\n if (!jsonresponse)\n throw new Error(\"RPC Failed: Invalid JSON/RPC response received\");\n\n if (jsonresponse?.error) {\n const err = new Error(\"RPC Error: \" + (jsonresponse.error.message || \"Unknown error\"));\n if (jsonresponse.error.data?.trace) {\n try {\n prependStackTrace(err, jsonresponse.error.data.trace);\n } catch (err2) {\n //ignore stacktrace manipulation error\n }\n }\n\n if (!this.options.silent)\n this.client._tryLogError(requestStack, err);\n throw err;\n }\n\n if (response.status === 200 && jsonresponse && jsonresponse.id !== id)\n throw new Error(\"RPC Failed: Invalid JSON/RPC response received\");\n\n if (this.options.wrapresult) {\n return {\n status: response.status,\n result: jsonresponse.result || null,\n error: jsonresponse.error || null,\n retryafter: response.headers.get(\"Retry-After\") ? parseInt(response.headers.get(\"Retry-After\") || \"\") : null\n };\n }\n\n return jsonresponse.result;\n }\n}\n\n/** Invokes (WebHare) JSON/RPC\n @param url - URL to invoke (leave empty or pass no parameters at all to callback to the current page)\n */\nclass RPCClient {\n url: string;\n addfunctionname: boolean;\n urlappend: string;\n options: RPCCallOptions;\n whservicematch: RegExpMatchArray | null;\n\n constructor(url: string, options?: RPCCallOptions) {\n this.options = {\n timeout: 0,\n debug: false,\n ...options\n };\n\n if (!url)\n throw new Error(`You must specify either a WebHare service name or a full URL`);\n\n this.url = url;\n this.whservicematch = this.url.match(/^([a-z0-9_]+):([a-z0-9_]+)$/);\n //if shorthand syntax is used, we know we're talking to our local webhare. add function names and the profiling flag if needed\n this.addfunctionname = this.options.addfunctionname !== undefined ? this.options.addfunctionname : Boolean(this.whservicematch);\n this.urlappend = this.options.urlappend !== undefined ? this.options.urlappend : this.whservicematch ? getDebugAppend() : \"\";\n }\n\n get debug() {\n return this.options.debug || debugFlags.rpc;\n }\n\n _tryLogError(requestStack: StackTrace | null, error: Error) {\n console.group();\n console.warn(\"RPC failed:\", error);\n if (requestStack) {\n console.warn(\"Stack at calling point\");\n console.log(requestStack);\n }\n console.groupEnd();\n }\n\n //calculate the final URL. delayed here so services can be created on import (getDefaultRPCBase may require waiting for service.ready)\n private getURL() {\n //wh_services are always in the root (and soon inside /.wh)\n const url = this.whservicematch ? `/wh_services/${this.whservicematch[1]}/${this.whservicematch[2]}` : this.url;\n if (url.match(/^https?:\\/\\//))\n return url;\n\n if (this.options.baseUrl)\n return new URL(url, this.options.baseUrl).toString();\n else if (backendBase)\n return backendBase + (backendBase.endsWith('/') && url.startsWith('/') ? url.substring(1) : url);\n else\n throw new Error(`You must set the baseUrl option when using the JSONRPC Client without a full URL outside Webhare`);\n }\n\n invoke(method: string, params: unknown[]) {\n //build the URL, add profiling and function parameters where needed\n let callurl = this.getURL();\n if (this.addfunctionname) //simplifies log analysis, ignored by the server\n callurl += `/${method}`;\n callurl += this.urlappend;\n\n const id = ++globalseqnr;\n let requestStack: StackTrace | null = null;\n\n if (this.debug) {\n requestStack = parseTrace(new Error);\n console.log(`[rpc] #${id} Invoking '${method}'`, params, callurl);\n }\n\n const fetchoptions: RequestInit = {\n method: \"POST\",\n credentials: this.options.credentials || 'same-origin', //this is the default since 2017-08-25, but Edge pre-18 is still around and will fail here\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json; charset=utf-8\",\n ...this.options.headers\n },\n body: JSON.stringify(\n {\n id: id,\n method: method,\n params: params || []\n }),\n keepalive: Boolean(this.options.keepalive)\n };\n\n return new ControlledCall(this, method, requestStack, id, this.options, callurl, fetchoptions).promise;\n }\n}\n\ntype ServiceBase<T> = {\n withOptions(options: RPCCallOptions): T & ServiceBase<T>;\n};\n\nclass ServiceProxy<T> {\n client: RPCClient;\n\n constructor(client: RPCClient) {\n this.client = client;\n }\n\n get(target: object, prop: string, receiver: unknown) {\n if (prop === 'withOptions') { //create a withOptions function\n return (options: RPCCallOptions) => {\n const newoptions = {\n ...this.client.options,\n ...options,\n headers: { ...this.client.options.headers, ...options.headers }\n };\n return createClient<T>(this.client.url, newoptions);\n };\n }\n\n return (...args: unknown[]) => this.client.invoke(prop, args);\n }\n}\n\n\n/** Creates an async version of the functions in a class\n * @typeParam ServiceType - Type definition of the service class that implements this service.\n*/\ntype ConvertToRPCInterface<ServiceType> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- using any is needed for this type definition\n [K in Exclude<keyof ServiceType, `_${string}` | \"close\" | \"emit\"> as ServiceType[K] extends (...a: any) => any ? K : never]: ServiceType[K] extends (...a: any[]) => void ? PromisifyFunctionReturnType<ServiceType[K]> : never;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- If you don't care to type the service, just assume it can do anything\nexport function createClient<T = any>(servicename: string, options?: RPCCallOptions): ConvertToRPCInterface<T> & ServiceBase<ConvertToRPCInterface<T>> {\n const rpcclient = new RPCClient(servicename, options);\n return new Proxy({}, new ServiceProxy<T>(rpcclient)) as ConvertToRPCInterface<T> & ServiceBase<ConvertToRPCInterface<T>>;\n}\n\nexport default createClient; //TODO this breaks @webhare/ lib convention and should start to go away as soon as all are on 5.3+\n","import { debugFlags } from \"@webhare/env\";\n\n/** Throws an unhandled rejection if a promise isn't awaited on within a few milliseconds after\n * its creation if the `async` debug flag is enabled\n */\nexport function checkPromiseErrorsHandled<T>(promise: Promise<T>): Promise<T> {\n if (!debugFlags.async)\n return promise;\n\n // Prepare an error to get a stack trace\n const preparederror = new Error(`Rejected promises from the called function are not handled`);\n let handlesrejections = false;\n\n // Warn after 5 milli seconds, should be enough for handlers to be attached.\n setTimeout(() => {\n // Throw an unhandled rejection if no handlers attacked\n if (!handlesrejections)\n throw preparederror;\n }, 5);\n\n // Implementation that is compatible with the TypeScript type for Promise.\n return {\n [Symbol.toStringTag]: promise[Symbol.toStringTag],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\n if (onrejected)\n handlesrejections = true;\n return promise.then(onfulfilled, onrejected);\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {\n handlesrejections = true;\n return promise.catch(onrejected);\n },\n finally(onfinally?: (() => void) | undefined | null): Promise<T> {\n return promise.finally(onfinally);\n }\n };\n}\n","var UNKNOWN_FUNCTION = '<unknown>';\n/**\n * This parses the different stack traces and puts them into one format\n * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit)\n */\n\nfunction parse(stackString) {\n var lines = stackString.split('\\n');\n return lines.reduce(function (stack, line) {\n var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);\n\n if (parseResult) {\n stack.push(parseResult);\n }\n\n return stack;\n }, []);\n}\nvar chromeRe = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nvar chromeEvalRe = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nfunction parseChrome(line) {\n var parts = chromeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n\n var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n var submatch = chromeEvalRe.exec(parts[2]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n\n parts[3] = submatch[2]; // line\n\n parts[4] = submatch[3]; // column\n }\n\n return {\n file: !isNative ? parts[2] : null,\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: isNative ? [parts[2]] : [],\n lineNumber: parts[3] ? +parts[3] : null,\n column: parts[4] ? +parts[4] : null\n };\n}\n\nvar winjsRe = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseWinjs(line) {\n var parts = winjsRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nvar geckoRe = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nvar geckoEvalRe = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nfunction parseGecko(line) {\n var parts = geckoRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n var submatch = geckoEvalRe.exec(parts[3]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: parts[2] ? parts[2].split(',') : [],\n lineNumber: parts[4] ? +parts[4] : null,\n column: parts[5] ? +parts[5] : null\n };\n}\n\nvar javaScriptCoreRe = /^\\s*(?:([^@]*)(?:\\((.*?)\\))?@)?(\\S.*?):(\\d+)(?::(\\d+))?\\s*$/i;\n\nfunction parseJSC(line) {\n var parts = javaScriptCoreRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[4],\n column: parts[5] ? +parts[5] : null\n };\n}\n\nvar nodeRe = /^\\s*at (?:((?:\\[object object\\])?[^\\\\/]+(?: \\[as \\S+\\])?) )?\\(?(.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseNode(line) {\n var parts = nodeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nexport { parse };\n","import * as stacktrace_parser from \"stacktrace-parser\";\n\nexport type StackTraceItem = {\n filename: string;\n line: number;\n col: number;\n func: string;\n};\n\nexport type StackTrace = StackTraceItem[];\n\nexport function parseTrace(e: Error): StackTrace {\n if (!e?.stack)\n return [];\n\n const trace = stacktrace_parser.parse(e.stack);\n return trace.map(i => ({ filename: i.file || \"\", line: i.lineNumber || 1, col: i.column || 1, func: (i.methodName || \"\") }));\n}\n\nexport function getStackTrace(): StackTrace {\n return parseTrace(new Error()).slice(1);\n}\n\nexport function prependStackTrace(error: Error, trace: StackTrace) {\n if (!error.stack)\n return; //no stack to manipulate\n\n const stacklines = error.stack?.split(\"\\n\") || [];\n const tracelines = trace.map(e =>\n ` at ${e.func} (${e.filename}:${e.line}:${e.col})`).join(\"\\n\");\n error.stack = (stacklines[0] ? stacklines[0] + \"\\n\" : \"\") + tracelines + '\\n' + (stacklines.slice(1).join(\"\\n\"));\n return error;\n}\n","import { levenshteinDistance } from \"@webhare/std\";\n\n/** Find the best match for a string fiven a list of alternatives. Defaults to case insensitive match.\n @param name - Name to search\n @param alternatives - Alternatives to choose from\n @param matchCase - Do a case sensitive compare (defaults to FALSE)\n @returns Best match or null if none found\n*/\nexport function getBestMatch(name: string, alternatives: string[], { matchCase = false } = {}): string | null {\n if (!matchCase)\n name = name.toLowerCase();\n\n const threshold = name.length < 3 ? 1 : 2;\n const matches = alternatives.\n map((value) => ({ value, distance: levenshteinDistance(name, matchCase ? value : value.toLowerCase()) })).\n filter((match) => match.distance <= threshold).\n sort((a, b) => a.distance - b.distance);\n\n return matches[0]?.value || null;\n}\n\n/** Return match info as text to append to the end of a message\n @param name - Name to search\n @param alternatives - Alternatives to choose from\n @param matchCase - Do a case sensitive compare (defaults to FALSE)\n @returns Returns \", did you mean 'XXX'?\" text if a better match was found, otherwise an empty string\n @example throw new Error(`${libname} does not export '${name}'${addBestMatch(name, Object.keys(lib))}`);\n\n*/\nexport function addBestMatch(name: string, alternatives: string[], { matchCase = false } = {}): string {\n const match = getBestMatch(name, alternatives, { matchCase });\n return match ? `, did you mean '${match}'?` : \"\";\n}\n","import { createClient } from \"@webhare/jsonrpc-client\";\nimport type { AddressValidationOptions, AddressValidationStatus } from \"./address\";\nimport { FormSubmitResult } from \"@mod-publisher/js/forms/formbase\";\nimport type { EmailValidationResult, RPCFormTarget, RPCFormInvokeRPC, RPCFormSubmission } from \"./types\";\nimport type { FormService } from \"@mod-publisher/lib/internal/forms/service\";\nimport type { AddressValue } from \"@webhare/std\";\n\n\n/// HareScript uses 'nr_detail' instead of 'houseNumber'\nexport type HareScriptAddressValue = Omit<AddressValue, \"houseNumber\"> & { nr_detail?: string };\n\nexport interface HareScriptAddressValidationResult {\n status: AddressValidationStatus;\n errors: Array<{\n ///Fields affected by the error\n fields: string[];\n ///Error message in the requested language\n message: string;\n }>;\n corrections: Partial<Record<keyof HareScriptAddressValue, string>> | null;\n}\n\nexport interface PublisherFormService {\n /** Validate an email address for validity (including against server configured correction/blacklists)\n *\n * @param langcode - Language code for messages\n * @param emailaddress - Address to validate\n * @returns Validation result\n */\n validateEmail(langcode: string, emailaddress: string): Promise<EmailValidationResult>;\n\n formValidateEmail(target: RPCFormTarget & { field: string }, emailaddress: string): Promise<EmailValidationResult>;\n\n /** Get an image from a remote URL */\n getImgFromRemoteURL(imageurl: string): Promise<string>;\n\n /** Get the final image URL to use */\n getUploadedFileFinalURL(uploadurl: string): Promise<string>;\n\n validateEmbeddedObjects(objrefs: string[]): Promise<{ tokill: string[] }>;\n\n /** Verify address */\n verifyAddress(url: string, address: HareScriptAddressValue, options: AddressValidationOptions): Promise<HareScriptAddressValidationResult>;\n\n formSubmit(submitinfo: RPCFormSubmission): Promise<FormSubmitResult>;\n\n formInvoke(submitinfo: RPCFormInvokeRPC): Promise<{\n messages: Array<{ field: string; prop: string; data: unknown }>;\n result: unknown;\n }>;\n\n requestBuiltinForm(submitinfo: RPCFormTarget, filename: string, formname: string): Promise<{ html: string }>;\n}\n\nexport const hsFormService = createClient<PublisherFormService>(\"publisher:forms\");\nexport const tsFormService = createClient<FormService>(\"publisher:formsts\");\n\nexport default hsFormService;\n","import * as dompack from 'dompack';\nimport { getCaptchaResponse } from \"@mod-publisher/js/captcha/api\";\nimport { DocEvent, addDocEventListener } from '@webhare/dompack';\nimport { SetFieldErrorData } from '../internal/customvalidation';\nimport FormBase from '../formbase';\n\nexport default class CaptchaField {\n node;\n response = '';\n\n constructor(node: HTMLElement) {\n this.node = node;\n addDocEventListener(this.node, 'wh:form-getvalue', evt => this._getValue(evt));\n addDocEventListener(this.node, 'wh:form-setfielderror', evt => this._setFieldError(evt));\n }\n _getValue(evt: DocEvent<CustomEvent<{ deferred: PromiseWithResolvers<unknown> }>>) {\n dompack.stop(evt);\n evt.detail.deferred.resolve(this.response);\n }\n\n async _setFieldError(evt: DocEvent<CustomEvent<SetFieldErrorData>>) {\n dompack.stop(evt);\n if (!evt.detail.error) //error cleared\n return;\n\n //If we get here, we captcha is either invalid or not set yet (and required).\n const metadata = evt.detail.metadata as { apikey: string };\n if (!metadata.apikey)\n throw new Error(\"No apikey received in captcha error message\");\n\n const formel = this.node.closest('form');\n const form = formel ? FormBase.getForNode(formel) : null;\n if (!form)\n throw new Error(`Cannot find associated form`);\n\n const captchapage = form.node.querySelector<HTMLElement>('[data-wh-form-pagerole=captcha]');\n if (!captchapage) { // Execute old (WH5.3) implementation\n //ADDME start a modality layer? coordinate with form? make sure this executes only once!\n const result = await getCaptchaResponse(metadata.apikey);\n\n if (result) {\n this.response = result;\n //FIXME: We should make sure the same button (submitter) is pressed again, and we should also submit the original\n // extradata... It's probably better to have the captcha field use the same (kind of) confirmation flow as the\n // mail confirmation handler. This also has the benefit that the field value is already stored, which would allow\n // the result to be confirmed in the backend, if a user is stuck on the captcha.\n form._doSubmit(null, undefined); //FIXME we're losing the extradata here!\n }\n return;\n }\n\n form.gotoPage(captchapage);\n getCaptchaResponse(metadata.apikey, { injectInto: captchapage }).then(result => {\n this.response = result || '';\n });\n }\n}\n","import { getTid } from \"@mod-tollium/js/gettid\";\nimport \"./__captcha.lang.json\";\n\nexport interface CaptchaSettings {\n title: string;\n explain: string;\n injectInto: HTMLElement | null;\n}\n\nexport const captcharegistry: Record<string, { getResponse: (apikey: string, settings: CaptchaSettings) => Promise<string | null> }> = {};\n\nexport async function getCaptchaResponse(apikey: string, settings: Partial<CaptchaSettings> = {}): Promise<string | null> {\n if (!captcharegistry[\"google-recaptcha\"]) //only supported one so far\n throw new Error(\"No captcha provider registered\");\n\n const finalsettings: CaptchaSettings = {\n title: settings?.title ?? getTid(\"publisher:site.captcha.title\"),\n explain: settings?.explain ?? getTid(\"publisher:site.captcha.explain\"),\n injectInto: settings?.injectInto ?? null\n };\n\n return await captcharegistry[\"google-recaptcha\"].getResponse(apikey, finalsettings);\n}\n","// Auto-generated language file from /opt/wh/whtree/modules/publisher/js/captcha/__captcha.lang.json\nvar registerTexts = require(\"@mod-tollium/js/gettid\").registerTexts;\nregisterTexts(\"publisher\",\"nl\",{\"site\":{\"captcha\":{\"explain\":\"Vink het vakje hieronder aan\",\"title\":\"Verificatie\"}}});\n// Adding dependency: /opt/wh/whtree/modules/publisher/language/nl.xml\n","import { isValidDate, isValidTime } from '@webhare/std';\n\nexport function formatDate(dateformat: string, year: number, month: number, day: number): string {\n if (!isValidDate(year, month, day, { minYear: 1 }))\n return '';\n\n let output = '';\n\n for (const c of dateformat.split(\"\")) {\n switch (c.toUpperCase()) {\n case \"Y\":\n output += ('000' + year).slice(-4);\n break;\n case \"M\":\n output += ('0' + month).slice(-2);\n break;\n case \"D\":\n output += ('0' + day).slice(-2);\n break;\n default:\n output += c;\n break;\n }\n }\n return output;\n}\n\nexport function formatISODate(year: number, month: number, date: number) {\n return formatDate(\"Y-M-D\", year, month, date);\n}\n\nexport function formatISOTime(hour: number, minute: number, second: number | null, msec: number | null) {\n if (!isValidTime(hour, minute, second !== null ? second : 0, msec !== null ? msec : 0))\n return '';\n\n let time = ('0' + hour).slice(-2) + ':' + ('0' + minute).slice(-2);\n if (second !== null)\n time += ':' + ('0' + second).slice(-2);\n if (msec !== null)\n time += '.' + ('00' + msec).slice(-3);\n return time;\n}\n\nexport interface DateParts {\n day: number;\n month: number;\n year: number;\n}\n\nexport function parseDate(format: string, newdate: string, options?: { nofail: boolean }): DateParts | null {\n if (!newdate) //empty\n return null;\n\n //replace . and / with -\n const setdate = newdate.replace(/[./]/g, '-');\n const parts = setdate.split('-');\n\n if (parts.length === 3) { //parseable\n format = format.toLowerCase();\n const dayoffset = format.indexOf('d');\n const monthoffset = format.indexOf('m');\n const yearoffset = format.indexOf('y');\n\n const daypos = 0 + (dayoffset > monthoffset ? 1 : 0) + (dayoffset > yearoffset ? 1 : 0);\n const monthpos = 0 + (monthoffset > dayoffset ? 1 : 0) + (monthoffset > yearoffset ? 1 : 0);\n const yearpos = 0 + (yearoffset > dayoffset ? 1 : 0) + (yearoffset > monthoffset ? 1 : 0);\n\n const day = parseInt(parts[daypos], 0);\n const month = parseInt(parts[monthpos], 0);\n const year = parseInt(parts[yearpos], 0);\n\n // The browser will always add 1900 for years 0-99, so handle years < 100\n // if (year >= 0 && year < 100 && this.options.cutoffyear > 0)\n // {\n // if (year < this.options.cutoffyear)\n // year += 2000;\n // else\n // year += 1900;\n // }\n if (isValidDate(year, month, day))\n return { year, month, day };\n }\n if (options && options.nofail)\n return null;\n\n throw new Error(`Invalid date value: '${newdate}'`);\n}\n\n//compare two dates. return -1 if lhs<rhs, 0 if lhs==rhs, 1 if lhs>rhs\nexport function compareDate(lhs: DateParts | null, rhs: DateParts | null) {\n if (!lhs)\n return rhs ? -1 : 0; //if rhs is set, <null> is before anything. oterhwise equal\n else if (!rhs)\n return 1; //lhs must be set, so lhs>rhs\n\n return lhs.year < rhs.year ? -1\n : lhs.year > rhs.year ? 1\n : lhs.month < rhs.month ? -1\n : lhs.month > rhs.month ? 1\n : lhs.day < rhs.day ? -1\n : lhs.day > rhs.day ? 1\n : 0;\n}\n\nexport function parseISODate(newdate: string, options?: { nofail: boolean }) {\n return parseDate('y-m-d', newdate, options);\n}\n\nexport function getLocalToday(): DateParts {\n const today = new Date;\n return { year: today.getFullYear(), month: 1 + today.getMonth(), day: today.getDate() };\n}\n\nexport function parseISOTime(intime: string, { nofail = false } = {}) {\n const split = intime.match(/^([0-9]+):([0-9]+)(:([0-9]+))?(\\.([0-9]+))?$/);\n if (split) {\n const hour = parseInt(split[1], 10);\n const minute = parseInt(split[2], 10);\n const second = parseInt(split[4] || \"0\", 10);\n const msec = parseInt(split[6] || \"0\", 10);\n return { hour, minute, second, msec };\n }\n if (nofail)\n return undefined;\n\n throw new Error(`Invalid time value: '${intime}'`);\n}\n\nexport function getWeekNumber(jsdate: Date) {\n jsdate = new Date(jsdate); //don't modify the caller's date!\n jsdate.setHours(0, 0, 0, 0);\n // Thursday in current week decides the year.\n jsdate.setDate(jsdate.getDate() + 3 - (jsdate.getDay() + 6) % 7);\n // January 4 is always in week 1.\n const week1 = new Date(jsdate.getFullYear(), 0, 4);\n // Adjust to Thursday in week 1 and count number of weeks from jsdate to week1.\n return 1 + Math.round(((jsdate.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);\n}\n\nexport function makeJSUTCDate(dateparts: DateParts) {\n return new Date(Date.UTC(dateparts.year, dateparts.month - 1, dateparts.day));\n}\n\nexport function formatJSUTCISODate(dateobj: Date) {\n return dateobj.getUTCFullYear() + '-' + ('0' + (dateobj.getUTCMonth() + 1)).slice(-2) + '-' + ('0' + dateobj.getUTCDate()).slice(-2);\n}\n","/* Support APIs to deal with DOM native form elements (eg input, select, textarea) */\n\nimport type FormBase from '@mod-publisher/js/forms/formbase';\nimport { reformatDate } from \"@mod-publisher/js/forms/internal/webharefields\";\nimport { getTid } from \"@mod-tollium/js/gettid\";\nimport { isFormControl, isHTMLElement, qSA, type FormControlElement } from \"@webhare/dompack\";\nimport type { FormCondition } from \"./types\";\nimport { JSFormElement, type FormFieldLike } from \"./jsformelement\";\nimport { throwError } from '@webhare/std';\n\nexport type ConstrainedRadioNodeList = RadioNodeList & NodeListOf<HTMLInputElement>;\n\n//Query elements that are likely to be formfieldlike. Anything with a [name] but not eg button (and not data-wh-form-name which usually relies on getformvalue events)\nexport const queryFormFieldLike = `[name]:not(button):not(a):not(output)`;\n\nexport function isInputElement(field: Element): field is HTMLInputElement {\n return isHTMLElement(field) && field.tagName === 'INPUT';\n}\n\n/// Implements required, disabled, ..\nexport function isFormFieldLike(control: HTMLElement): control is FormFieldLike {\n return isFormControl(control as HTMLElement) || control instanceof JSFormElement;\n}\n\nexport function isRadioOrCheckbox(field: Element): field is HTMLInputElement {\n return isInputElement(field) && [\"radio\", \"checkbox\"].includes(field.type);\n}\n\n// Constrains the RadioNodeList type to only return HTMLInputElements. reduces number of casts we need\nexport function isRadioNodeList(el: RadioNodeList | Element): el is ConstrainedRadioNodeList {\n return el instanceof RadioNodeList;\n}\n\nexport function getFieldName(field: HTMLElement): string {\n return field.dataset.whFormName || (field as HTMLInputElement).name || '';\n}\n\nexport function setFieldName(field: HTMLElement, newname: string) {\n if (field.dataset.whFormName !== undefined)\n field.dataset.whFormName = newname;\n else if ((field as HTMLInputElement).name !== undefined)\n (field as HTMLInputElement).name = newname;\n else\n throw new Error('Cannot set name on field without existing name');\n}\n\nexport function getFieldDisplayName(field: HTMLElement | ConstrainedRadioNodeList): string {\n if (isRadioNodeList(field))\n return `radiogroup '${(field.item(0) as HTMLInputElement)?.name || (field.item(0) as HTMLElement)?.id || '<unnamed>'}'`;\n if (isFormControl(field))\n return `native field '${field.name || field.id || '<unnamed>'}'`;\n if (field.dataset.whFormName)\n return `custom field '${field.dataset.whFormName || field.id || '<unnamed>'}'`;\n if (field.classList.contains('wh-form__fieldgroup'))\n return `field group '${field.dataset.whFormGroupFor || field.id || '<unnamed>'}'`;\n return `${field.tagName} element '${field.id || '<unnamed>'}'`;\n}\n\n/** The WH Form rendering generates wh-fileedit elements. If no handler is detected for them, we downgrade them to input type=file before\n * the form actually sets up its handler (it's still safe to rewrite top level form elements then)\n*/\nexport function downgradeUploadFields(form: HTMLElement) {\n for (const uploadfield of qSA(form, \"wh-fileedit\")) {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n for (const attr of uploadfield.attributes)\n input.setAttribute(attr.name, attr.value);\n\n uploadfield.replaceWith(input);\n }\n}\n\nexport function getErrorForValidity(field: FormControlElement): string {\n const validity = field.validity;\n if (validity.customError && field.validationMessage)\n return field.validationMessage;\n\n if (validity.valueMissing)\n return getTid(\"publisher:site.forms.commonerrors.required\");\n if (field instanceof HTMLInputElement) {\n if (validity.rangeOverflow) {\n const max = field.type === 'date' ? reformatDate(field.max) : field.max;\n return getTid(\"publisher:site.forms.commonerrors.max\", max);\n }\n if (validity.rangeUnderflow) {\n const min = field.type === 'date' ? reformatDate(field.min) : field.min;\n return getTid(\"publisher:site.forms.commonerrors.min\", min);\n }\n if (validity.tooShort)\n return getTid(\"publisher:site.forms.commonerrors.minlength\", field.minLength);\n if (validity.tooLong)\n return getTid(\"publisher:site.forms.commonerrors.maxlength\", field.maxLength);\n if (validity.stepMismatch)\n if (!field.step || parseInt(field.step) === 1)\n return getTid(\"publisher:site.forms.commonerrors.step1mismatch\");\n else\n return getTid(\"publisher:site.forms.commonerrors.stepmismatch\", field.step);\n }\n\n if (validity.badInput)\n return getTid(\"publisher:site.forms.commonerrors.default\");\n if (validity.typeMismatch)\n if ([\"email\", \"url\", \"number\"].includes(field.type))\n return getTid(\"publisher:site.forms.commonerrors.\" + field.type);\n\n for (const key of [\"badInput\", \"customError\", \"patternMismatch\", \"rangeOverflow\", \"rangeUnderflow\", \"stepMismatch\", \"typeMismatch\", \"valueMissing\"] as const)\n if (validity[key])\n return key;\n\n return '?';\n}\n\nexport function isFieldNativeErrored(field: HTMLElement): field is FormControlElement {\n return isFormControl(field) && !field.hasAttribute(\"data-wh-form-skipnativevalidation\") && !field.checkValidity();\n}\n\nexport function getFieldNativeError(field: HTMLElement) {\n if (isFieldNativeErrored(field))\n return getErrorForValidity(field);\n\n return null;\n}\n\n\nexport function parseCondition(conditiontext: string): FormCondition {\n interface FormConditionWrapper {\n c: FormCondition;\n }\n\n return (JSON.parse(conditiontext) as FormConditionWrapper).c;\n}\n\nexport function getFormElementCandidates(basenode: HTMLElement, namePrefix: string) {\n const parentForm = basenode.closest('form');\n if (!parentForm)\n throw new Error('No form found for element');\n\n const candidates = qSA<HTMLElement>(basenode, queryFormFieldLike).filter(el => !(\"form\" in el) || el.form === parentForm);\n if (namePrefix)\n return candidates.filter(el => getFieldName(el).startsWith(namePrefix + '.'));\n else\n return candidates;\n}\n\n/** Get the handler for a form element */\nexport function getFormHandler<FormType extends FormBase<object> = FormBase>(node: HTMLFormElement, options: { allowMissing: true }): FormType | null;\nexport function getFormHandler<FormType extends FormBase<object> = FormBase>(node: HTMLFormElement, options?: { allowMissing?: boolean }): FormType;\n\nexport function getFormHandler<FormType extends FormBase<object> = FormBase>(node: HTMLFormElement, { allowMissing = false } = {}): FormType | null {\n //FIXME convert to Symbol? but make sure we work cross-realm (ie tests)\n return (node.propWhFormhandler as FormType) || (allowMissing ? null : throwError('No form handler found for form'));\n}\n\n/** Get the data for a form element. Shorthand for getFormHandler\\<FormBase\\<Shape\\>\\>(xx).data */\nexport function getFormData<DataShape extends object = Record<string, unknown>>(node: HTMLFormElement, options: { allowMissing: true }): DataShape | null;\nexport function getFormData<DataShape extends object = Record<string, unknown>>(node: HTMLFormElement, options?: { allowMissing?: boolean }): DataShape;\n\nexport function getFormData<DataShape extends object = Record<string, unknown>>(node: HTMLFormElement, { allowMissing = false } = {}): DataShape | null {\n return getFormHandler<FormBase<DataShape>>(node, { allowMissing })?.data;\n}\n","export interface FormFieldLike extends HTMLElement {\n disabled: boolean;\n name: string;\n required: boolean;\n value: unknown;\n}\n\n/** Base class for customElements that need to act as WebHare (Publisher) form elements */\nexport abstract class JSFormElement<ValueType> extends HTMLElement implements FormFieldLike {\n static formAssociated = true;\n static observedAttributes = [\"required\", \"disabled\"];\n\n // #internals = this.attachInternals();\n\n constructor() {\n super();\n }\n\n get name() {\n return this.getAttribute('name') || '';\n }\n set name(newname: string) {\n this.setAttribute('name', newname);\n }\n get required(): boolean {\n return this.hasAttribute('required');\n }\n set required(required: boolean) {\n if (required)\n this.setAttribute(\"required\", \"\");\n else\n this.removeAttribute(\"required\");\n\n this.refreshState();\n }\n\n get disabled(): boolean {\n return this.hasAttribute('disabled');\n }\n set disabled(disable: boolean) {\n if (disable)\n this.setAttribute(\"disabled\", \"\");\n else\n this.removeAttribute(\"disabled\");\n\n this.refreshState();\n }\n\n abstract value: ValueType;\n\n /** Invoked whenever disabled/required states change */\n protected refreshState() {\n }\n\n attributeChangedCallback(name: string, oldValue: unknown, newValue: unknown) {\n if ([\"disabled\", \"required\"].includes(name))\n this.refreshState();\n }\n}\n","import * as dompack from '@webhare/dompack';\nimport * as focus from 'dompack/browserfix/focus';\nimport * as merge from './internal/merge';\nimport FormBase, { FormResultValue, FormSubmitEmbeddedResult, FormSubmitMessage } from './formbase';\nimport publisherFormService from \"@webhare/forms/src/formservice\";\nimport * as emailvalidation from './internal/emailvalidation';\nimport { runMessageBox } from 'dompack/api/dialog';\nimport * as pxl from '@mod-consilio/js/pxl';\nimport { debugFlags, isLive, navigateTo } from \"@webhare/env\";\nimport { isBlob, pick } from '@webhare/std';\nimport { setFieldError } from './internal/customvalidation';\nimport type { RPCFormTarget, RPCFormInvokeBase, RPCFormSubmission } from '@webhare/forms/src/types';\nimport { tsFormService } from '@webhare/forms/src/formservice';\nimport { SingleFileUploader, type UploadResult } from '@webhare/upload';\n\nfunction unpackObject(formvalue: FormResultValue): RPCFormInvokeBase[\"vals\"] {\n return Object.entries(formvalue).map(_ => ({ name: _[0], value: _[1] }));\n}\n\ninterface FormSubmitDetails {\n form: HTMLElement;\n rpchandler: RPCFormBase;\n extrasubmitdata?: unknown;\n submitted: FormResultValue;\n result: unknown;\n errors: FormSubmitMessage[];\n}\n\ntype UploadCache = WeakMap<Blob, UploadResult>;\n\nclass FormSubmitter {\n private readonly target;\n private readonly cache: UploadCache;\n\n constructor(target: RPCFormTarget, cache?: UploadCache) {\n this.target = target;\n this.cache = cache || new WeakMap();\n }\n\n private async uploadFile(file: Blob) {\n //TODO what if the server discarded the token? we should negotiate with the server which files it (still) wants\n const completed = this.cache.get(file);\n if (completed)\n return completed;\n\n const uploader = new SingleFileUploader(file);\n //Ask the server if it's okay to upload these files\n const uploadinstructions = await tsFormService.requestUpload(this.target, uploader.manifest);\n //Run the actual upload. Options: onProgress, signal\n const uploadedfile: UploadResult = await uploader.upload(uploadinstructions);\n this.cache.set(file, uploadedfile);\n return uploadedfile;\n }\n\n private async convertSubmittable(formvalue: unknown): Promise<unknown> {\n //TODO combine multiple uploads into one\n if (Array.isArray(formvalue))\n return await Promise.all(formvalue.map(file => this.getSubmittable(file)));\n\n if (formvalue && typeof formvalue === 'object') {\n if (isBlob(formvalue))\n return await this.uploadFile(formvalue as Blob);\n\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(formvalue)) {\n result[key] = await this.getSubmittable(value);\n //console.log(key, value, result[key]);\n }\n return result;\n }\n return formvalue;\n }\n\n async getSubmittable(formvalue: FormResultValue): Promise<FormResultValue> {\n return await this.convertSubmittable(formvalue) as FormResultValue;\n }\n}\n\n/** Directly submit a RPC form to WebHare\n * @param target - Formtarget as obtained from\n */\nexport async function submitForm(target: string, formvalue: FormResultValue, options?: { extrasubmit: unknown }) {\n const submitstart = Date.now();\n const formTarget: RPCFormTarget = { target, url: location.href.split('/').slice(3).join('/') };\n const submitter = new FormSubmitter(formTarget);\n\n let eventtype = 'publisher:formsubmitted';\n const fields: pxl.PxlEventData = {\n ds_formmeta_jssource: 'submitForm'\n };\n\n try {\n const vals = await submitter.getSubmittable(formvalue);\n const submitparameters: RPCFormSubmission = {\n ...formTarget,\n vals: unpackObject(vals),\n extrasubmit: options?.extrasubmit || null\n };\n\n const retval = await publisherFormService.formSubmit(submitparameters);\n if (!retval.success) {\n const failedfields = retval.errors.map(error => error.name || \"*\").sort().join(\" \");\n fields.ds_formmeta_errorfields = failedfields;\n fields.ds_formmeta_errorsource = 'server';\n }\n return retval;\n } catch (e) {\n eventtype = 'publisher:formexception';\n fields.ds_formmeta_exception = String(e);\n fields.ds_formmeta_errorsource = 'server';\n throw e;\n } finally {\n fields.dn_formmeta_waittime = Date.now() - submitstart;\n pxl.sendPxlEvent(eventtype, fields);\n }\n}\n\nexport default class RPCFormBase extends FormBase {\n __formhandler = {\n errors: [],\n warnings: [],\n formid: \"\",\n url: \"\",\n target: \"\",\n submitting: false\n };\n\n #completedUploads = new WeakMap<Blob, UploadResult>;\n\n pendingrpcs = new Array<Promise<unknown>>;\n\n constructor(formnode: HTMLFormElement) {\n super(formnode);\n this.__formhandler.formid = formnode.dataset.whFormId || ''; //needed for 'old' __formwidget: stuff\n this.__formhandler.url = location.href.split('/').slice(3).join('/');\n this.__formhandler.target = formnode.dataset.whFormTarget || '';\n\n if (!this.__formhandler.target) {\n if (this.__formhandler.formid) {\n console.error(\"This page needs to be republished!\");\n } else {\n if (!isLive)\n console.error(\"Missing data-wh-form-target on form, did your witty apply '[form.formattributes]' to the <form> tag ?\", formnode);\n throw new Error(\"Form does not appear to be a WebHare form\");\n }\n }\n }\n\n getRPCFormIdentifier(): RPCFormTarget { //submitinfo as required by some RPCs\n return {\n url: location.href.split('/').slice(3).join('/'),\n target: this.__formhandler.target\n };\n }\n\n async #getSubmitVals(): Promise<FormResultValue> {\n const formvalue = await this.getFormValue();\n const submitter = new FormSubmitter(this.getRPCFormIdentifier(), this.#completedUploads);\n return await submitter.getSubmittable(formvalue);\n }\n\n //Invoke a function on the form on the server\n async _invokeRPC(background: boolean, methodname: string, args: unknown[]) {\n const waiter = Promise.withResolvers<void>();\n\n if (!background)\n this.onRPC(waiter.promise);\n\n const lock = dompack.flagUIBusy({ modal: !background });\n try {\n const rpc = publisherFormService.formInvoke({\n ...this.getRPCFormIdentifier(),\n vals: unpackObject(await this.#getSubmitVals()),\n methodname,\n args\n });\n this.pendingrpcs.push(rpc);\n const result = await rpc;\n this._processMessages(result.messages);\n return result.result;\n } finally {\n lock.release();\n waiter.resolve();\n }\n }\n\n /* Override this to implement support for incoming field messages */\n processFieldMessage(field: string, prop: string, value: unknown) {\n const fieldnode = this.node.querySelector<HTMLElement>(`*[name=\"${CSS.escape(field)}\"], *[data-wh-form-name=\"${CSS.escape(field)}\"]`);\n if (!fieldnode) {\n console.warn(\"Message for non-existent field: \" + field + \", prop: \" + prop + \", value: \" + String(value));\n return;\n }\n if (prop === 'value') {\n this.setFieldValue(fieldnode, value);\n return;\n }\n console.warn(\"Unknown field message: field: \" + field + \", prop: \" + prop + \", value: \" + String(value));\n }\n\n //Override this function to easily submit extra fields\n getFormExtraSubmitData() {\n return {};\n }\n\n //Invoked when RPC is occuring. Is passed a promise that will resolve on completion\n //onRPC is DEPRECATED, switching to event based api\n onRPC(promise: Promise<void>) {\n }\n\n /** Invoke a function on the form on the server\n @param methodname- Name of the function on the form\n @param args - Arguments for the function\n @returns Promise that resolves to the result of the rpc call\n */\n invokeRPC(methodname: string, ...args: unknown[]) {\n return this._invokeRPC(false, methodname, args);\n }\n\n /** Invoke a function on the form on the server, doesn't call .onRPC or request modality layers\n @param methodname - Name of the function on the form\n @param args - Arguments for the function\n @returns Promise that resolves to the result of the rpc call\n */\n invokeBackgroundRPC(methodname: string, ...args: unknown[]) {\n return this._invokeRPC(true, methodname, args);\n }\n\n _processMessages(messages: Array<{ field: string; prop: string; data: unknown }>) {\n for (const msg of messages) {\n this.processFieldMessage(msg.field, msg.prop, msg.data);\n }\n }\n\n async _flushPendingRPCs() {\n while (this.pendingrpcs.length) {\n try {\n await this.pendingrpcs.pop();\n } catch (ignore) {\n //*we* can't handle those...\n }\n }\n }\n\n async submit(extradata?: object): Promise<{ result?: FormSubmitEmbeddedResult }> {\n //ADDME timeout and free the form after some time\n if (this.__formhandler.submitting) //throwing is the safest solution... having the caller register a second resolve is too dangerous\n throw new Error(\"The form is already being submitted\");\n\n const waiter = Promise.withResolvers<void>();\n let insubmitrpc = false;\n this.onRPC(waiter.promise);\n\n const eventdetail: FormSubmitDetails = {\n form: this.node,\n rpchandler: this,\n submitted: {},\n errors: [],\n result: null\n };\n await this._flushPendingRPCs();\n try {\n this.__formhandler.submitting = true;\n\n //Request extrasubmit first, so that if it returns a promise, it can execute in parallel with getFormValue\n const extraSubmitAwaitable = this.getFormExtraSubmitData();\n const valsAwaitable = this.#getSubmitVals();\n\n const extrasubmit = { ...extradata, ...(await extraSubmitAwaitable) };\n const vals = await valsAwaitable;\n\n eventdetail.extrasubmitdata = extrasubmit;\n eventdetail.submitted = vals;\n\n /* make sure no getFormValue RPCs are still pending, assuming they went through us, eg if an address validation is\n still running (and could update)\n TODO probably wiser to have validators take and hold a submission preventing lock in such a case, but this most closely matches original formservice behavior\n */\n await this._flushPendingRPCs();\n dompack.dispatchCustomEvent(this.node, \"wh:form-preparesubmit\", { bubbles: true, cancelable: false, detail: { extrasubmit: extrasubmit } });\n const submitparameters: RPCFormSubmission = {\n ...this.getRPCFormIdentifier(),\n vals: unpackObject(vals),\n extrasubmit: extrasubmit\n };\n\n if (debugFlags.fhv)\n console.log('[fhv] start submission', submitparameters);\n\n insubmitrpc = true; //so we can easily determine exception source\n const result = await publisherFormService.formSubmit(submitparameters);\n insubmitrpc = false;\n\n if (debugFlags.fhv)\n console.log('[fhv] received response', result);\n\n if (!dompack.dispatchCustomEvent(this.node, \"wh:form-response\", { bubbles: true, cancelable: true, detail: result }))\n return result;\n\n eventdetail.result = result.result;\n eventdetail.errors = result.errors;\n\n let didfirstfocus = false;\n const globalerrors = [];\n for (const error of result.errors) {\n if (!error.name) {\n globalerrors.push(error);\n continue;\n }\n\n const failednode = this.node.querySelector('[name=\"' + error.name + '\"], [data-wh-form-name=\"' + error.name + '\"]');\n if (!failednode) {\n console.error(\"[fhv] Unable to find node '\" + error.name + \"' which caused error:\" + error.message);\n continue;\n }\n if (!didfirstfocus) {\n dompack.focus(failednode);\n didfirstfocus = true;\n }\n setFieldError(failednode, error.message, { reportimmediately: true, serverside: true, metadata: error.metadata });\n }\n\n if (result.success) {\n dompack.dispatchCustomEvent(this.node, \"wh:form-values\", { bubbles: true, cancelable: false, detail: eventdetail });\n this.sendFormEvent('publisher:formsubmitted');\n if (dompack.dispatchCustomEvent(this.node, \"wh:form-submitted\", { bubbles: true, cancelable: true, detail: eventdetail })) {\n merge.run(this.node, { form: await this.getFormValue() });\n\n //FIXME why is going to 'thank you' not in the formbase?\n this._navigateToThankYou(result.result && result.result.richvalues);\n this.onSubmitSuccess(result.result);\n }\n } else {\n const failedfields = result.errors.map(error => error.name || \"*\").sort().join(\" \");\n this.sendFormEvent('publisher:formfailed', {\n ds_formmeta_errorfields: failedfields,\n ds_formmeta_errorsource: 'server'\n });\n\n if (globalerrors.length) {\n if (dompack.dispatchCustomEvent(this.node, \"wh:form-globalerrors\", { bubbles: true, cancelable: true, detail: { globalerrors } }))\n this.displayGlobalErrors(globalerrors);\n }\n\n if (dompack.dispatchCustomEvent(this.node, \"wh:form-failed\", { bubbles: true, cancelable: true, detail: eventdetail }))\n this.onSubmitFailed(result.errors, result.result);\n }\n return pick(result, [\"result\"]);\n } catch (e) {\n this.sendFormEvent('publisher:formexception', {\n ds_formmeta_exception: String(e),\n ds_formmeta_errorsource: insubmitrpc ? 'server' : 'client'\n });\n\n if (dompack.dispatchCustomEvent(this.node, \"wh:form-exception\", { bubbles: true, cancelable: true, detail: eventdetail }))\n this.onSubmitException(e as Error);\n\n throw e;\n } finally {\n waiter.resolve();\n this.__formhandler.submitting = false;\n }\n }\n\n displayGlobalErrors(globalerrors: FormSubmitMessage[]) {\n try {\n const errors = globalerrors.map(error => dompack.create(\"p\", { textContent: error.message }));\n runMessageBox(errors, [{ title: \"OK\" }]); //TODO: language?\n } catch (e) {\n console.error(\"runMessageBox failed\", e);\n // eslint-disable-next-line no-alert -- alert is our fallback without message boxes\n alert(globalerrors.map(error => error.message).join(\"\\n\"));\n }\n }\n\n //Get the first group that failed error handling\n getFirstFailedGroup() {\n return this.node.querySelector(\".wh-form__fieldgroup-error\");\n }\n\n //override this to deal with succesful submissions\n onSubmitSuccess(result: FormSubmitEmbeddedResult<unknown>) {\n const formpos = this.node.getBoundingClientRect();\n if (formpos.top < 0)\n this.node.scrollIntoView({ block: 'start', behavior: 'smooth' });\n\n if (result && result.resultsguid)\n this.node.dataset.whFormResultguid = result.resultsguid;\n\n if (result && result.submitinstruction)\n navigateTo(result.submitinstruction);\n }\n\n //override this to deal with failed submissions\n onSubmitFailed(errors: FormSubmitMessage[], result: unknown) {\n }\n\n //override this to deal with form exceptions\n onSubmitException(e: Error) {\n }\n\n async validateSingleFormField(field: HTMLElement): Promise<boolean> {\n if (field instanceof HTMLInputElement && field.type === \"email\") { //TODO perhaps move this to webharefields.es ?\n if (focus.getCurrentlyFocusedElement() === field) { //TODO clearing suggestion on change should probably be generalized\n if (field.propWhValidationSuggestion) {\n field.propWhValidationSuggestion = null;\n }\n }\n\n //Just because it's focused doesn't mean we shouldn't validate it\n const validation = emailvalidation.validateField(this, field);\n this.pendingrpcs.push(validation);\n if (!(await validation))\n return false;\n }\n return true;\n }\n}\n","import * as dompack from 'dompack';\nimport { getTid, getTidLanguage } from \"@mod-tollium/js/gettid\";\nimport formservice from \"@webhare/forms/src/formservice\";\nimport { isValidEmail } from '@webhare/std';\nimport { setFieldError } from './customvalidation';\nimport type { EmailValidationResult } from '@webhare/forms/src/types';\nimport type FormBase from '../formbase';\nimport type RPCFormBase from '../rpc';\n\nconst cache:\n {\n [key: string]: Promise<EmailValidationResult>;\n } = {};\n\nfunction mayValidateField(field: HTMLInputElement) {\n if (field.disabled || field.readOnly) //FIXME shouldn't we just decide not to validate at a much higher level if something cannot be changed ?\n return false;\n\n if (field.autocomplete && field.autocomplete.split(' ').includes(\"username\")) //Well, we shouldn't *force* usernames as a blacklisted domain might still have been explicitly added as login. but suggestions are still useful?\n return false;\n return true;\n}\n\nfunction acceptEmailSuggestion(evt: Event, form: FormBase, field: HTMLInputElement, suggestion: string) {\n dompack.stop(evt);\n field.value = suggestion;\n field.propWhValidationSuggestion = null;\n form._reportFieldValidity(field);\n}\n\nexport async function validateField(form: FormBase | RPCFormBase, field: HTMLInputElement) {\n if (field.dataset.whFormEmailBlocked) {\n delete field.dataset.whFormEmailBlocked;\n setFieldError(field, \"\"); //explicitly clear our earlier setFieldError, but only if we set it. FIXME To really cleanly solve this we need better integration with rpc.ts - we want to be in the setupValidation chain and simply return errors instead of being explictly invoked\n }\n\n const checkvalue: string = field.value;\n if (!checkvalue || !mayValidateField(field)) {\n return true; //not a problem\n }\n\n if (!isValidEmail(checkvalue)) {\n //TODO why aren't we just returning the error like a validator callback? may also help avoid the whFormEamailBlocked hack..\n field.dataset.whFormEmailBlocked = \"true\";\n setFieldError(field, getTid(\"publisher:site.forms.commonerrors.email\"));\n return false;\n }\n\n //user is 'done' with email field apparently. remotely validate it\n const key = \"e_\" + field.name + \".\" + checkvalue; //e_ prefix protects against funny people using 'constructor' etc. TODO just switch to a Map<> or similar. TODO only include field.name if needed, and also bind to the form then\n if (!cache[key]) {\n cache[key] = \"getRPCFormIdentifier\" in form ?\n //TODO rendering.whlib should add a data attribute if there are form+field-specific checks, perhaps we can even generalize that for all fields instead of just email whenever they need to do direct validation\n formservice.formValidateEmail({ ...form.getRPCFormIdentifier(), field: field.name }, checkvalue)\n : formservice.validateEmail(getTidLanguage(), checkvalue);\n }\n\n //TODO should we ever clear the cache? only relevant probably if someone is on the frontend testing emails and doesn't want to refresh\n const result = await cache[key];\n if (checkvalue !== field.value || !mayValidateField(field))\n return true; //the field already changed, don't report about old errors\n\n if (result?.blocked) {\n field.dataset.whFormEmailBlocked = \"true\";\n setFieldError(field, result.blocked);\n return false;\n }\n\n if (result?.force) {\n field.value = result.force;\n\n //we should be able to assume we won't have to revalidate a server-provided suggestion\n cache[\"e_\" + field.name + \".\" + result.force] = Promise.resolve<EmailValidationResult>({});\n\n return true;\n } else if (result?.suggestion) {\n const suggestion = getTid(\"publisher:site.forms.commonerrors.email_suggestion\", \"___SUGGESTION___\").split(\"___SUGGESTION___\");\n\n //we should be able to assume we won't have to revalidate a server-provided suggestion\n cache[\"e_\" + field.name + \".\" + result.suggestion] = Promise.resolve<EmailValidationResult>({});\n\n field.propWhValidationSuggestion =\n <span class=\"wh-form__emailcorrection\">\n {suggestion[0]}\n <a href=\"#\" class=\"wh-form__emailcorrected\" on={{ click: (evt: Event) => acceptEmailSuggestion(evt, form, field, result.suggestion as string) }}>{result.suggestion}</a>\n {suggestion[1]}\n </span>;\n return true;\n }\n return true;\n}\n","/* Dialogapi offers an API to which dialog providers cannot connect. It does\n not implement the dialogs themselves\n*/\n\nimport * as dompack from 'dompack';\nimport * as domfocus from 'dompack/browserfix/focus';\nimport KeyboardHandler from \"dompack/extra/keyboard\";\n\nexport type DialogOptions =\n {\n /** Allow the dialog to be cancelled by clicking outside the dialog. Defaults to true if no choices are specified */\n allowcancel?: boolean;\n /** Element to focus on closing the dialog */\n focusonclose?: HTMLElement;\n /** An AbortSignal which if set will close the dialog and resolve it with a null response */\n signal?: EventTarget;\n /** Additional class to set on the dialog */\n messageboxclassbase?: string;\n\n borrow?: Element | string;\n };\ntype DialogConstructor = (options?: DialogOptions) => DialogBase;\n\nconst dialogstack: DialogBase[] = [];\nlet keyhandler: KeyboardHandler | null = null;\nlet dialogconstructor: DialogConstructor | null = null;\nlet dialogoptions: DialogOptions | null = null;\n\nfunction onEscape(event: KeyboardEvent) {\n if (!dialogstack.length)\n return;\n\n dompack.stop(event);\n if (dialogstack[dialogstack.length - 1].options.allowcancel)\n dialogstack[dialogstack.length - 1].resolve(null);\n}\n\nfunction onTab(event: KeyboardEvent, direction: number) {\n if (!dialogstack.length)\n return;\n\n dompack.stop(event);\n\n const focusable = domfocus.getFocusableComponents(dialogstack[dialogstack.length - 1].contentnode, true);\n const el = domfocus.getCurrentlyFocusedElement();\n const tofocusidx = el ? focusable.indexOf(el) + direction : -1;\n const tofocus = tofocusidx < 0 ? focusable[focusable.length - 1] : tofocusidx >= focusable.length ? focusable[0] : focusable[tofocusidx];\n if (tofocus)\n dompack.focus(tofocus);\n}\n\nexport class DialogBase {\n options: DialogOptions;\n private _borrowedfrom: Element | null = null;\n private _borrowednext: Element | null = null;\n contentnode: Element | null; //FIXME a successor to DialogBase should not allow these to be | null. have our child inform us through super() about the contentnode and buttonsnode so we can ensure it's set\n buttonsnode: Element | null = null;\n private _deferred: PromiseWithResolvers<string | null>;\n open: boolean;\n private _previousfocus: Element | null = null;\n\n constructor(options?: DialogOptions) {\n this.options = {\n allowcancel: true,\n ...options\n };\n\n if (this.options.borrow && typeof this.options.borrow === 'string') {\n const borrow = document.querySelector(this.options.borrow);\n if (!borrow)\n throw new Error(\"Invalid 'borrow' selectior: \" + this.options.borrow);\n this.options.borrow = borrow;\n }\n // At this point, if this.options.borrow was a string, it's been resolved to an Element\n\n if (this.options.borrow) {\n this._borrowedfrom = (this.options.borrow as Element).parentElement;\n this._borrowednext = (this.options.borrow as Element).nextElementSibling;\n }\n\n if (this.options.signal)\n this.options.signal.addEventListener(\"abort\", () => { this.resolve(null); });\n\n this.contentnode = null;\n this._deferred = Promise.withResolvers();\n this.open = false;\n }\n\n async runModal() {\n if (this.open)\n throw new Error(\"Attempting to re-open already opened dialog\");\n\n if (!keyhandler)\n keyhandler = new KeyboardHandler(window, {\n \"Escape\": (evt: KeyboardEvent) => onEscape(evt),\n \"Tab\": (evt: KeyboardEvent) => onTab(evt, +1),\n \"Shift+Tab\": (evt: KeyboardEvent) => onTab(evt, -1)\n }, { captureunsafekeys: true, listenoptions: { capture: true } });\n\n this._previousfocus = domfocus.getCurrentlyFocusedElement();\n this._openDialog();\n\n this.open = true;\n dialogstack.push(this);\n\n try {\n this.afterShow();\n this._checkFocus();\n return await this._deferred.promise;\n } finally {\n if (this.open)\n this.closeDialog();\n }\n }\n\n _openDialog() {\n throw new Error(\"_openDialog not overridden by dialog class\");\n }\n\n _checkFocus() {\n const focusable = domfocus.getFocusableComponents(this.contentnode, true);\n if (focusable.length !== 0)\n dompack.focus(focusable[0]);\n else\n dompack.focus(document.body);\n }\n\n //close the dialog. this may be invoked even when inside runModal to ensure synchronous dialog cleanup\n closeDialog() {\n if (!this.open)\n return;\n\n const myoffset = dialogstack.indexOf(this);\n if (myoffset >= 0)\n dialogstack.splice(myoffset, 1);\n\n this.open = false;\n if (this.options.borrow)\n if (this._borrowedfrom)\n this._borrowedfrom.insertBefore(this.options.borrow as Element, this._borrowednext);\n else\n this._borrowednext?.remove();\n\n if (this.options.focusonclose)\n dompack.focus(this.options.focusonclose);\n else if (this._previousfocus)\n dompack.focus(this._previousfocus as HTMLElement);\n\n if (dialogstack.length === 0 && keyhandler) {\n keyhandler.destroy();\n keyhandler = null;\n }\n }\n\n /**\n * resolve the dialog with the specified answer\n *\n * @param response - Response (or choice) to return. null if the dialog was simply cancelled\n */\n resolve(response: string | null) {\n if (this.open)\n this.closeDialog();\n this._deferred.resolve(response);\n }\n\n afterShow() {\n // supposed to be empty but extenders can override\n }\n}\n\nexport function setupDialogs(newdialogconstructor: DialogConstructor, options?: DialogOptions) {\n if (dialogconstructor) {\n console.error(\"Duplicate setupDialogs call!\");\n return;\n }\n\n dialogconstructor = newdialogconstructor;\n dialogoptions = { messageboxclassbase: 'dompack-messagebox__', ...options };\n}\n\n/** Verify whether the dialog api is initialized */\nexport function isCreateDialogAvailable(): boolean {\n return Boolean(dialogconstructor);\n}\n\n/**\n * Create a dialog\n *\n * @param options - dialog settings\n */\nexport function createDialog(options?: DialogOptions) {\n if (!dialogconstructor)\n throw new Error(\"Cannot create dialog, no dialog class defined\");\n\n const dialog = dialogconstructor(options);\n if (dialog.options.borrow)\n dialog.contentnode?.appendChild(dialog.options.borrow as Element);\n return dialog;\n}\n\ntype DialogChoice =\n {\n /** Title for the choice */\n title: string;\n /** Override result to return if clicked (otherwise you'll just receive the title) */\n result?: string;\n className?: string;\n };\n\n\n/**\n @param question - if a string, will be wrapped as textContent into a <p> and presented as the question\n - if a html node, will appear as the question (allowing you to insert html)\n - if an array of nodes, all these nodes will be inserted\n @param choices - Buttons (choices) the message box will offer, eg Ok and Cancel\n @param options - Dialog options\n */\nexport async function runMessageBox(question: string | HTMLElement | HTMLElement[], choices: DialogChoice[], options?: DialogOptions) {\n choices = choices || [];\n options = { allowcancel: choices.length === 0, ...options };\n\n const dialog = createDialog(options);\n const choicebuttons = choices.map(choice =>\n dompack.create(\"button\", {\n type: \"button\",\n className: dialogoptions ? dialogoptions.messageboxclassbase + \"button \" + (choice.className || \"\") : \"\",\n textContent: choice.title,\n on: { click: () => dialog.resolve(choice.result || choice.title) },\n dataset: { messageboxResult: choice.result || choice.title }\n }));\n\n if (typeof question === 'string')\n question = dompack.create(\"p\", { textContent: question });\n\n if (Array.isArray(question))\n dialog.contentnode?.append(...question);\n else\n dialog.contentnode?.append(question);\n\n if (dialog.buttonsnode) //this dialog has a separte node for the button area\n dialog.buttonsnode.append(...choicebuttons);\n else\n dialog.contentnode?.append(dompack.create(\"div\", {\n className: dialogoptions ? dialogoptions.messageboxclassbase + \"buttongroup\" : \"\",\n childNodes: choicebuttons\n }));\n\n return dialog.runModal();\n}\n","/* All keynames should be mixed-cased, as done here: http://www.w3.org/TR/DOM-Level-3-Events-key/\n\n Modifiers should be in the ordering Alt+Control+Meta+Shift+key (ie alphabetical)\n\n To simply prevent keys from propagating up (ie to keep Enter inside its textarea)\n new KeyboardHandler(this.textarea, {}, { dontpropagate: ['Enter']});\n*/\n\nimport { NormalizedKeyboardEvent, normalizeKeyboardEventData } from '../src/events';\nimport { debugflags } from '../src/debug';\nimport { getPlatform } from './browser';\nconst IS_MAC_PLATFORM = getPlatform() === \"mac\";\n\nconst propnames = {\n shiftKey: \"Shift\",\n ctrlKey: IS_MAC_PLATFORM ? \"Control\" : [\"Accel\", \"Control\"],\n metaKey: IS_MAC_PLATFORM ? [\"Accel\", \"Meta\"] : \"Meta\",\n altKey: \"Alt\"\n};\n\nfunction getFinalKey(event: NormalizedKeyboardEvent) { //get the name for the 'final' key, eg the 'D' in 'alt+control+d'\n if (event.code?.startsWith('Key') && event.code.length === 4)\n return event.code.substring(3, 4).toUpperCase();\n if (event.code?.startsWith('Digit') && event.code.length === 6)\n return event.code.substring(5, 6).toUpperCase();\n return event.key.length === 1 ? event.key.toUpperCase() : event.key;\n}\n\nfunction getKeyNames(event: NormalizedKeyboardEvent) {\n let names: string[][] = [[]];\n\n /*\n // Firefix under selenium on linux always says 'Unidentified' as key. Backup for some keys.\n if (basekey === \"Unidentified\")\n basekey = selenium_backup[event.keyCode];\n */\n // Create the modifiers in the names array (omit the basekey, so we can sort on modifier first)\n (Object.keys(propnames) as Array<keyof typeof propnames>).forEach(propname => {\n if (event[propname]) {\n // The key is pressed. Add the modifier name to all current names.\n const modifier: string | string[] = propnames[propname];\n if (!Array.isArray(modifier))\n names.forEach(function (arr) { arr.push(modifier); });\n else {\n // Multiple modifiers map to this key, duplicate all result sequences for every modifier\n const newkeys: string[][] = [];\n modifier.forEach(function (singlemodifier) {\n names.forEach(function (arr) {\n newkeys.push(arr.concat([singlemodifier]));\n });\n });\n names = newkeys;\n }\n }\n });\n\n return names.map(function (arr) {\n // Sort the modifier names\n arr = arr.sort();\n arr.push(getFinalKey(event));\n return arr.join(\"+\");\n });\n}\n\nfunction validateKeyName(key: string) {\n const modifiers = key.split(\"+\");\n modifiers.pop();\n\n // Check for allowed modifiers\n modifiers.forEach(function (mod) {\n if (![\"Accel\", \"Alt\", \"Control\", \"Meta\", \"Shift\"].includes(mod))\n throw new Error(\"Illegal modifier name '\" + mod + \"' in key '\" + key + \"'\");\n });\n\n const original_order = modifiers.join('+');\n modifiers.sort();\n if (modifiers.join('+') !== original_order)\n throw new Error(\"Illegal key name \" + key + \", modifiers must be sorted alphabetically\");\n}\n\ntype KeyboardMappingHandler = (event: KeyboardEvent) => boolean | void;\ntype KeyboardMapping = { [key: string]: KeyboardMappingHandler };\ntype KeyPressHandler = (event: KeyboardEvent, key: string) => boolean | void;\ntype KeyboardEventHandler = (event: Event) => void;\ntype KeyboardHandlerOptions =\n {\n stopmapped?: boolean;\n dontpropagate?: string[];\n onkeypress?: KeyPressHandler;\n captureunsafekeys?: boolean;\n listenoptions?: AddEventListenerOptions;\n };\n\n/**\n node: The node to attach to\n keymap: Keymap\n options.stopmapped - preventDefault and stopPropagation on any key we have in our map\n options.dontpropagate - string array of keys not to propagate out of this object\n options.onkeypress - when set, call for all keypresses. signature: function (event, key). Should always return true and preventDefault (and/or stop) the event to cancel its handling\n options.listenoptions - addEventListener options (eg \\{capture:true\\})\n */\nexport default class KeyboardHandler {\n node: EventTarget;\n keymap: KeyboardMapping;\n stopmapped: boolean;\n dontpropagate: string[];\n onkeypress?: KeyPressHandler;\n captureunsafekeys: boolean;\n private _listenoptions?: AddEventListenerOptions;\n private _onkeydown: KeyboardEventHandler;\n private _onkeypress: KeyboardEventHandler;\n\n constructor(node: EventTarget, keymap: KeyboardMapping, options?: KeyboardHandlerOptions) {\n this.node = node;\n this.keymap = {};\n this.stopmapped = options?.stopmapped ?? false;\n this.dontpropagate = options?.dontpropagate ? [...options.dontpropagate].map(name => name.toUpperCase()) : [];\n this.onkeypress = options?.onkeypress;\n this.captureunsafekeys = options?.captureunsafekeys ?? false;\n this._listenoptions = options?.listenoptions;\n\n Object.keys(keymap).forEach(keyname => {\n if (debugflags.key)\n validateKeyName(keyname);\n this.keymap[keyname.toUpperCase()] = keymap[keyname];\n });\n\n this._onkeydown = (event) => this._onKeyDown(event);\n this._onkeypress = (event) => this._onKeyPress(event);\n node.addEventListener('keydown', this._onkeydown, this._listenoptions);\n node.addEventListener('keypress', this._onkeypress, this._listenoptions);\n }\n\n destroy() {\n this.node.removeEventListener('keydown', this._onkeydown, this._listenoptions);\n this.node.removeEventListener('keypress', this._onkeypress, this._listenoptions);\n }\n\n /**\n Returns thether the current pressed special key should be ignored for the current target node\n Used to detect input/textarea/rte's\n *\n @param target - Current target node for keyboard event\n @param key - Parsed key\n @param keynames - Potential names for the keys (as returned by GetKeyNames)\n @returns Whether the key must be ignored by KeyboardHandler, default browser behaviour should be triggered.\n */\n private _mustIgnoreKey(target: EventTarget | null, key: string, keynames: string[]) {\n if (!(target instanceof Node))\n return false;\n const tag = target.nodeName.toLowerCase();\n if (tag === \"select\") {\n if ([\"ArrowUp\", \"ArrowDown\", \"Home\", \"End\", \"PageUp\", \"PageDown\"].indexOf(key) !== -1)\n return true;\n } else if (tag === \"input\" || tag === \"textarea\" || (target instanceof HTMLElement && target.isContentEditable)) {\n // These keys we ignore, regardless of the modifier\n if ([\n \"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\",\n \"PageUp\", \"PageDown\",\n \"Home\", \"End\",\n \"Insert\", \"Delete\", \"Backspace\"\n ].indexOf(key) !== -1)\n return true;\n\n let is_special_combo = false;\n\n // only input doesn't want exact combo 'Enter', the rest does\n if (tag !== \"input\" && keynames.indexOf(\"Enter\") !== -1)\n is_special_combo = true;\n\n // Only contenteditable wants \"Shift+Enter\"\n if (target instanceof HTMLElement && target.isContentEditable && keynames.indexOf(\"Shift+Enter\") !== -1)\n is_special_combo = true;\n\n // These exact combo's are wanted by all inputs\n [\"Accel+A\", \"Accel+V\", \"Accel+C\", \"Accel+X\"].forEach(function (name) {\n is_special_combo = is_special_combo || keynames.indexOf(name) !== -1;\n });\n return is_special_combo;\n }\n return false;\n }\n\n addKey(keybinding: string, handler: KeyboardMappingHandler) {\n if (debugflags.key) {\n validateKeyName(keybinding);\n console.log(\"[key] KeyDown handler registered for \" + keybinding);\n }\n this.keymap[keybinding.toUpperCase()] = handler;\n }\n removeKey(keybinding: string) {\n delete this.keymap[keybinding.toUpperCase()];\n }\n _onKeyDown(event: Event) { // We're a key event handler, so we know the event is a KeyboardEvent\n const keydata = normalizeKeyboardEventData(event as KeyboardEvent);\n\n // Get all possible names for this key\n const keynames = getKeyNames(keydata);\n if (!keydata.key || !keynames.length) {\n if (debugflags.key)\n console.log(\"[key] KeyDown handler for \", this.node, \" did not recognize key from event\", event);\n return true;\n }\n\n if (debugflags.key)\n console.log(\"[key] KeyDown handler for \", this.node, \" got key \", keydata.key, \" with target \", event.target, \" keynames:\", keynames);\n\n /* Some keys we ignore, unless we're explicitly bound to a node, so we don't inadvertly break eg a <input> node inside\n a listview we're handling or otherwise break a user's expectation. Set the option 'captureunsafekeys' if you explicitly\n want to be able to capture any key */\n\n if (!this.captureunsafekeys && this._mustIgnoreKey(event.target, keydata.key, keynames)) {\n if (debugflags.key)\n console.log(\"[key] KeyDown event will not be intercepted, it's an unsafe key to intercept\");\n return true;\n }\n\n if (this.dontpropagate) {\n keynames.forEach(keyname => {\n if (this.dontpropagate.includes(keyname)) {\n if (debugflags.key)\n console.log(\"[key] KeyDown event will not bubbleup because of our dontpropagate option (but may still trigger a default action)\");\n event.stopPropagation();\n }\n });\n }\n\n for (let i = 0; i < keynames.length; ++i) {\n const mapping = this.keymap[keynames[i].toUpperCase()];\n if (!mapping)\n continue;\n\n if (this.stopmapped) {\n if (debugflags.key)\n console.log(\"[key] KeyDown event will not bubbleup or trigger default, because we're configured to block any mapped key\");\n event.stopPropagation();\n event.preventDefault();\n }\n\n const ishandled = mapping.apply(this.node, [event as KeyboardEvent]);\n if (ishandled && !event.defaultPrevented) {\n console.warn(`The key handler for '${keynames[i]}' should preventDefault (or dompack.stop) the event to block fruther propagation`);\n event.stopPropagation();\n event.preventDefault();\n if (debugflags.key)\n console.log(\"[key] KeyDown event will not bubbleup or trigger default, because the keyhandler indicated the key was handled\");\n }\n\n if (!event.defaultPrevented && debugflags.key)\n console.log(\"[key] KeyDown event was not blocked by its explicitly configured handler\");\n }\n return true;\n }\n _onKeyPress(event: Event) { // We're a key event handler, so we know the event is a KeyboardEvent\n const keydata = normalizeKeyboardEventData(event as KeyboardEvent);\n\n if (this.onkeypress) {\n if (!this.onkeypress.apply(this.node, [event as KeyboardEvent, keydata.key])) {\n if (!event.defaultPrevented)\n console.warn(\"The onkeypress handler should preventDefault (or dompack.stop) the event to block fruther propagation\");\n event.stopPropagation();\n event.preventDefault();\n }\n }\n }\n}\n\nexport function getEventKeyNames(event: KeyboardEvent) {\n const keydata = normalizeKeyboardEventData(event);\n return getKeyNames(keydata);\n}\n","import { debugFlags } from \"@webhare/env\";\nexport { debugFlags as debugflags } from \"@webhare/env\";\n\n//Add all flags as a dompack-debug-- class\nif (typeof document !== 'undefined')\n document.documentElement.classList.add(...Object.keys(debugFlags).map(flagname => \"dompack--debug-\" + flagname));\nif (debugFlags.dompack)\n console.log('[dompack] debugging flags: ' + Object.keys(debugFlags).join(', '));\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/upload\" {\n}\n\nimport * as dompack from \"@webhare/dompack\";\n\n/* Note: you can't really build a FileList yourself, but FileList doesn't satisfy File[] and neither the reverse works. (noone is really happy with that though)\n So we'll just accept both types */\n\ntype FileListLike = FileList | Blob[];\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n \"wh:requestfiles\": CustomEvent<{\n /** Callback to invoke with the list of files to upload */\n resolve: (files: FileListLike) => void;\n } & Required<UploadRequestOptions>>;\n }\n}\n\nexport interface UploadRequestOptions {\n ///List of mimetypes to accept, supports wildcards (eg `image/*`)\n accept?: string[];\n ///Allow multiple files to be selected. By default determined by whether you use requestFiles or requestFile, but can be set to false to force requestFiles to only accept one file\n multiple?: boolean;\n}\n\nexport interface UploadProgressStatus {\n uploadedBytes: number;\n totalBytes: number;\n uploadedFiles: number;\n totalFiles: number;\n //Upload speed in bytes/sec.\n uploadSpeed: number;\n}\n\nexport interface UploadOptions {\n onProgress?: (progress: UploadProgressStatus) => void;\n signal?: AbortSignal;\n}\n\nexport interface UploadResult {\n name: string;\n size: number;\n type: string;\n token: string;\n}\n\nexport interface UploadManifest {\n files: Array<{\n name: string;\n size: number;\n type: string;\n }>;\n}\n\nexport interface UploadInstructions {\n baseUrl: string;\n sessionId: string;\n chunkSize: number;\n signal?: AbortSignal;\n}\n\nexport interface UploaderBase {\n readonly manifest: UploadManifest;\n upload(instructions: UploadInstructions, options?: UploadOptions): Promise<UploadResult | UploadResult[]>;\n}\n\nexport class MultiFileUploader implements UploaderBase {\n readonly files: File[];\n readonly manifest: UploadManifest;\n\n constructor(files: FileListLike, signal?: AbortSignal) {\n if (!files.length)\n throw new Error(\"No files to upload\");\n\n this.files = [...files].map(_ => (_ as File)?.name ? _ as File : new File([_], \"upload\", { type: _.type || \"application/octet-stream\" }));\n this.manifest = {\n files: this.files.map(_ => ({\n name: (_ as File)?.name ?? \"upload\",\n size: _.size,\n type: _.type\n }))\n };\n }\n\n async upload(instructions: UploadInstructions, options?: UploadOptions): Promise<UploadResult[]> {\n const outfiles: UploadResult[] = [];\n let uploadedBytes = 0, uploadedFiles = 0;\n const totalBytes = this.files.reduce((acc, file) => acc + file.size, 0);\n const totalFiles = this.files.length;\n const start = Date.now();\n\n function fireProgressEvent(partialbytes: number) {\n const curUploaded = uploadedBytes + partialbytes;\n const timeElapsed = Date.now() - start;\n options?.onProgress?.({ uploadedBytes: curUploaded, totalBytes, uploadedFiles, totalFiles, uploadSpeed: timeElapsed ? curUploaded / (timeElapsed / 1000) : 0 });\n }\n\n fireProgressEvent(0);\n\n for (const [idx, file] of this.files.entries()) {\n for (let offset = 0; offset < file.size; offset += instructions.chunkSize) {\n const data = file.slice(offset, offset + instructions.chunkSize);\n const uploadurl = `${instructions.baseUrl}&offset=${offset}&file=${idx}`;\n\n\n /* we can't use fetch as we can't do progress tracking there!\n there's https://stackoverflow.com/questions/35711724/upload-progress-indicators-for-fetch but it requires duplex: half which requires QUIC/H2\n\n https://fetch.spec.whatwg.org/#fetch-api says\n The fetch() method is relatively low-level API for fetching resources. It covers slightly more ground than XMLHttpRequest, although it is currently lacking when it comes to request progression (not response progression).\n\n let bytesUploaded = 0;\n const progressTrackingStream = new TransformStream<Uint8Array, Uint8Array>({\n transform(chunk: Uint8Array, controller: TransformStreamDefaultController<Uint8Array>) {\n controller.enqueue(chunk);\n bytesUploaded += chunk.byteLength;\n console.log(\"upload progress:\", bytesUploaded / data.size);\n // uploadProgress.value = bytesUploaded / totalBytes;\n },\n flush(controller: TransformStreamDefaultController<Uint8Array>) {\n console.log(\"completed stream\");\n },\n });\n */\n if (options?.signal?.aborted)\n throw new Error(\"Upload has been aborted\");\n\n // eslint-disable-next-line no-inner-declarations\n if (globalThis.XMLHttpRequest) { //let's hope by the time browsers drop XMLHttpRequest, fetch finally has proper progress\n const defer = Promise.withResolvers<void>();\n const xmlhttp = new globalThis.XMLHttpRequest;\n xmlhttp.overrideMimeType(\"application/octet-stream\");\n xmlhttp.upload.addEventListener('progress', ev => fireProgressEvent(ev.loaded));\n xmlhttp.addEventListener('abort', (ev: ProgressEvent<XMLHttpRequestEventTarget>) => defer.reject(new Error(\"Aborted\")));\n xmlhttp.addEventListener('error', (ev: ProgressEvent<XMLHttpRequestEventTarget>) => defer.reject(new Error(\"Error\")));\n xmlhttp.addEventListener('load', () => defer.resolve()); //invoked on success\n xmlhttp.addEventListener('loadend', (ev: ProgressEvent<XMLHttpRequestEventTarget>) => { //invoked after either abort/error/load\n });\n xmlhttp.open(\"POST\", uploadurl, true);\n xmlhttp.send(data);\n\n const doAbort = () => xmlhttp.abort();\n options?.signal?.addEventListener(\"abort\", doAbort);\n await defer.promise;\n options?.signal?.removeEventListener(\"abort\", doAbort);\n } else { //fallback to fetch(). needed on Node, but it'll break progress reporting\n const uploadresult = await fetch(uploadurl, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/octet-stream\" },\n body: data // At some point... .stream().pipeThrough(progressTrackingStream) - but see above why it won't work yet\n });\n\n if (!uploadresult.ok)\n throw new Error(`Upload failed`);\n }\n\n uploadedBytes += data.size;\n }\n\n outfiles.push({ ...this.manifest.files[idx], token: instructions.sessionId + '#' + idx });\n ++uploadedFiles;\n fireProgressEvent(0);\n }\n\n return outfiles;\n }\n}\n\nexport class SingleFileUploader implements UploaderBase {\n uploader;\n\n get manifest() {\n return this.uploader.manifest;\n }\n\n get file() {\n return this.uploader.files[0];\n }\n\n constructor(file: Blob) {\n this.uploader = new MultiFileUploader([file]);\n }\n\n async upload(instructions: UploadInstructions, options?: UploadOptions): Promise<UploadResult> {\n return (await this.uploader.upload(instructions, options))[0];\n }\n}\n\nasync function getFilelistFromUser(multiple: boolean, accept: string[]): Promise<FileListLike> {\n const defer = Promise.withResolvers<FileListLike>();\n if (dompack.dispatchCustomEvent(window, \"wh:requestfiles\", { bubbles: true, cancelable: true, detail: { resolve: defer.resolve, multiple, accept } })) {\n const input = document.createElement('input');\n input.type = \"file\";\n input.multiple = multiple;\n\n if (accept.length)\n input.accept = accept.join(\",\");\n input.addEventListener(\"change\", () => defer.resolve(input.files || []));\n input.addEventListener(\"cancel\", () => defer.resolve([]));\n input.showPicker();\n }\n\n const list = await defer.promise;\n if (!multiple && list.length > 1)\n throw new Error(`wh:requestfiles intercepter selected multiple files, but only one was requested`);\n return list;\n}\n\nexport async function requestFiles(options?: UploadRequestOptions): Promise<MultiFileUploader | null> {\n const files = await getFilelistFromUser(!(options?.multiple === false), options?.accept || []);\n if (!files.length)\n return null;\n\n const uploader = new MultiFileUploader(files);\n return uploader;\n}\n\n// We're adding a separate interface for single-file uploads as it's quite annoying to have to deal with interfaces generalized for multiple files if you really, really know you only ever wanted one file anyway\nexport async function requestFile(options?: UploadRequestOptions): Promise<SingleFileUploader | null> {\n const files = await getFilelistFromUser(false, options?.accept || []);\n if (files.length !== 1)\n return null;\n\n const uploader = new SingleFileUploader(files[0]);\n return uploader;\n}\n\n/** Convert a file to a data: URL\n * @param file - The file to convert\n * @returns A promise that resolves to the data: URL\n*/\nexport function getFileAsDataURL(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader;\n // MDN: When the read operation is finished… the loadend event is triggered.\n reader.addEventListener(\"loadend\", () => {\n //At that time, the result attribute contains the data as a data: URL representing the file's data as a base64 encoded string.\n resolve(reader.result as string);\n });\n reader.addEventListener(\"error\", () => reject(new Error(\"Failed to load file\")));\n reader.readAsDataURL(file);\n });\n}\n","/* eslint-disable */\n/// @ts-nocheck -- Bulk rename to enable TypeScript validation\n\nimport * as dompack from \"dompack\";\nimport * as domevents from \"dompack/src/events\";\nimport * as whintegration from \"@mod-system/js/wh/integration\";\nimport { getTid } from \"@mod-tollium/js/gettid\";\nimport { isLive } from \"@webhare/env\";\nimport { isValidDate } from '@webhare/std';\nimport \"../internal/form.lang.json\";\n\nimport \"./splitdatetime.scss\";\n\n\nif (!isLive)\n console.warn(\"@mod-publisher/js/forms/splitdatetime has some known issues and is no longer being maintained. Please switch to the @mod-publisher/js/forms/fields/datetime version\");\n\nlet labelcount = 0;\n\n\nfunction formatDate(dateformat, dateparts) {\n let output = '';\n if (!dateparts)\n return '';\n\n for (const c of dateformat.split(\"\")) {\n switch (c.toUpperCase()) {\n case \"Y\":\n output += dateparts.year;\n break;\n case \"M\":\n output += (dateparts.month >= 10 ? '' : '0') + dateparts.month;\n break;\n case \"D\":\n output += (dateparts.day >= 10 ? '' : '0') + dateparts.day;\n break;\n default:\n output += c;\n break;\n }\n }\n return output;\n}\n\nfunction formatISODate(dateparts) {\n return formatDate(\"Y-M-D\", dateparts);\n}\n\nfunction ensureLabelID(inputnode) {\n const id = inputnode.id;\n if (id === \"\") {\n // FIXME: lookup whether we are nested in a label\n return \"\";\n }\n\n const labelnode = document.querySelector(`[for=\"${CSS.escape(id)}\"]`);\n if (!labelnode) {\n console.log(\"Failed to find label for\", id);\n return \"\";\n }\n\n // Ensure the label has an unique ID\n if (labelnode.id === \"\") {\n labelcount++;\n labelnode.setAttribute(\"id\", `splitdatetime_lbl_${labelcount}`);\n }\n\n return labelnode.id;\n}\n\n\n\n\n/*\ncSplitDateInput replaces date input with 3 separate number type inputs\nfield ordering can be set by data attribute data-dateformat\n\nnice to have:\n - placeholder translations\n - for time input option for seconds/msec??\n*/\n\n///////////////////////////////////////\n//\n// new 'value' property\n//\nfunction mySelectGetValue() {\n const origgetter = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this), 'value').get;\n //console.error(\"mySelectGetValue\", origgetter, origgetter.apply(this));\n return origgetter.apply(this);\n}\nfunction mySelectSetValue(newvalue) {\n const origsetter = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this), 'value').set;\n if (origsetter) //this works on chrome, firefox and IE\n {\n origsetter.apply(this, [newvalue]);\n } else {\n //safari doesnt let us call the original setter. but we _can_ remove the value property and it will be restored\n delete this.value;\n this.value = newvalue;\n setupMyDateValueProperty(this); //reset our custom property\n }\n this._split_doupdate();\n}\n\nfunction setupMyDateValueProperty(select) {\n Object.defineProperty(select, 'value', { configurable: true, get: mySelectGetValue, set: mySelectSetValue });\n}\n\nclass MultiInputSubstition {\n constructor(inpnode) {\n if (!window.MutationObserver)\n return; //best to leave it alone\n\n this._replacednode = inpnode;\n this._replacednode._split_doupdate = () => this._split_doupdate();\n\n if (window.MutationObserver) {\n this._observer = new MutationObserver(() => this._onObserve());\n this._observer.observe(this._replacednode, { attributes: true, attributeFilter: ['disabled', 'required', 'class'], subtree: false, childList: false });\n }\n }\n _onObserve() {\n console.log(\"observed!\");\n this._refreshAttributes();\n }\n\n _split_doupdate() {\n this._refreshReplacingFields();\n }\n\n _refreshAttributes() {\n const isdisabled = this._replacednode.disabled;\n const isrequired = this._replacednode.required;\n\n dompack.toggleClass(this.inputgroup, this._class + '--disabled', isdisabled);\n dompack.toggleClass(this.inputgroup, this._class + '--required', isrequired);\n this._getSubInputs().forEach(node => { node.disabled = isdisabled; node.required = isrequired; });\n }\n}\nexport class SplitDateField extends MultiInputSubstition {\n constructor(inpnode) {\n super(inpnode);\n if (!this._replacednode)\n return;\n\n this._class = \"wh-form__dateinputgroup\";\n setupMyDateValueProperty(this._replacednode);\n\n __hideInput(inpnode);//hide current input\n\n this.previous = { value: '' };\n\n let day_pos = 0;\n let month_pos = 1;\n let year_pos = 2;\n\n if (inpnode.dataset.dateformat) // y-m-d, d-m-y, ...\n {\n const ordering = __strToIntegerArray(inpnode.dataset.dateformat);\n for (let i = 0; i < ordering.length; ++i) {\n if (ordering[i].indexOf(\"y\") > -1)\n year_pos = i;\n else if (ordering[i].indexOf(\"m\") > -1)\n month_pos = i;\n else if (ordering[i].indexOf(\"d\") > -1)\n day_pos = i;\n }\n }\n\n this.placeholder = {\n year: \"yyyy\",\n month: \"mm\",\n day: \"dd\"\n };\n\n if (whintegration.config.locale.indexOf(\"nl\") > -1)\n this.placeholder = {\n year: \"jjjj\",\n month: \"mm\",\n day: \"dd\"\n };\n\n this.day = null;\n this.month = null;\n this.year = null;\n\n if (this._replacednode.value !== \"\")//Should be iso date\n {\n const parts = __strToIntegerArray(this._replacednode.value);\n if (parts.length > 2) {\n this.day = parts[2];\n this.month = parts[1];\n this.year = parts[0];\n }\n }\n\n const isdisabled = this._replacednode.disabled;\n const isreadonly = this._replacednode.readonly;\n\n let year_min = 1900; let year_max = 2999;\n\n if (this._replacednode.min !== \"\") //Should be iso date\n {\n const parts = __strToIntegerArray(this._replacednode.min);\n if (parts.length)\n year_min = parts[0];\n }\n\n if (this._replacednode.max !== \"\") {\n const parts = __strToIntegerArray(this._replacednode.max);\n if (parts.length && parts[0] >= year_min)\n year_max = parts[0];\n }\n\n\n this.inputgroup = <div class=\"wh-form__dateinputgroup\" role=\"group\" />;\n\n\n // Refer to the label (Because we have role=\"group\" we need a label)\n const labelid = ensureLabelID(inpnode);\n if (labelid !== \"\")\n this.inputgroup.setAttribute(\"aria-labelledby\", labelid);\n\n\n this.daynode = <input readonly={isreadonly} pattern=\"[0-9]*\" inputmode=\"numeric\" autocomplete=\"off\" maxlength=\"2\" placeholder={this.placeholder.day} min=\"1\" max=\"31\" type=\"number\" aria-label={getTid(\"publisher:site.forms.splitdatetime-day-arialabel\")} />;\n this.monthnode = <input readonly={isreadonly} pattern=\"[0-9]*\" inputmode=\"numeric\" autocomplete=\"off\" maxlength=\"2\" placeholder={this.placeholder.month} min=\"1\" max=\"12\" type=\"number\" aria-label={getTid(\"publisher:site.forms.splitdatetime-month-arialabel\")} />;\n this.yearnode = <input readonly={isreadonly} pattern=\"[0-9]*\" inputmode=\"numeric\" autocomplete=\"off\" maxlength=\"4\" placeholder={this.placeholder.year} min={year_min} max={year_max} type=\"number\" aria-label={getTid(\"publisher:site.forms.splitdatetime-year-arialabel\")} />;\n this._refreshAttributes();\n this._refreshReplacingFields();\n\n for (let i = 0; i < 3; ++i) {\n if (i === day_pos) {\n this.inputgroup.appendChild(<div class=\"wh-form__dateinputgroup__line wh-form__dateinputgroup__day\">\n {this.daynode}\n </div>); //\n }\n if (i === month_pos) {\n this.inputgroup.appendChild(<div class=\"wh-form__dateinputgroup__line wh-form__dateinputgroup__month\">\n {this.monthnode}\n </div>); //\n }\n if (i === year_pos) {\n this.inputgroup.appendChild(<div class=\"wh-form__dateinputgroup__line wh-form__dateinputgroup__year\">\n {this.yearnode}\n </div>); //\n }\n }\n\n\n // Take the replaced input out of the keyboard navigation.\n // But it'll retain the ability to get focus. So if code sets the focus it will be forwarded to the first input in the group (the day).\n this._replacednode.setAttribute(\"tabindex\", \"-1\");\n\n //If focus on hidden date input, set focus on first field in replacement\n this._replacednode.addEventListener(\"focus\", ev => {\n // NOTE: It's important we have set tabindex=\"-1\" on the input, otherwise when we tab backwards from\n // the first input in our group we are returned back to the day input. (so we can never escape backwards)\n const nextnode = this.inputgroup.querySelector(\"input\");\n if (nextnode)\n nextnode.focus();\n });\n\n\n if (isdisabled)\n this.inputgroup.classList.add(\"wh-form__dateinputgroup--disabled\");\n if (isreadonly)\n this.inputgroup.classList.add(\"wh-form__dateinputgroup--disabled\");\n\n inpnode.parentNode.appendChild(this.inputgroup);\n\n // this._replacednode.addEventListener(\"wh:form-enable\", ev =>\n // {\n // dompack.toggleClass(this.inputgroup, \"wh-form__dateinputgroup--disabled\", ev.detail.enabled );\n\n // this.daynode.disabled = !ev.detail.enabled;\n // this.monthnode.disabled = !ev.detail.enabled;\n // this.yearnode.disabled = !ev.detail.enabled;\n\n // this.daynode.readonly = !ev.detail.enabled;\n // this.monthnode.readonly = !ev.detail.enabled;\n // this.yearnode.readonly = !ev.detail.enabled;\n // });\n\n for (const node of this.inputgroup.querySelectorAll(\"input\")) {\n node.addEventListener(\"blur\", () => { this.inputgroup.classList.remove(\"focus\"); });\n node.addEventListener(\"focus\", () => {\n this.previous.value = node.value;\n this.inputgroup.classList.add(\"focus\");\n });\n\n node.addEventListener(\"change\", ev => this.onChange(ev, node));\n node.addEventListener(\"keyup\", ev => this.onKeyUp(ev, node));\n }\n }\n\n _getSubInputs() {\n return [this.daynode, this.monthnode, this.yearnode];\n }\n\n _refreshReplacingFields() {\n this.day = null;\n this.month = null;\n this.year = null;\n\n if (this._replacednode.value !== \"\")//Should be iso date\n {\n const parts = __strToIntegerArray(this._replacednode.value);\n if (parts.length > 2) {\n this.day = parts[2];\n this.month = parts[1];\n this.year = parts[0];\n }\n }\n\n this.daynode.value = this.day === null ? \"\" : this.day;\n this.monthnode.value = this.month === null ? \"\" : this.month;\n this.yearnode.value = this.year === null ? \"\" : this.year;\n }\n\n onChange(ev, node) {\n const prev_day = this.day;\n const prev_month = this.month;\n const prev_year = this.year;\n\n if (node === this.daynode)\n __validateNumberField(this, \"day\", node);\n else if (node === this.monthnode)\n __validateNumberField(this, \"month\", node);\n else if (node === this.yearnode)\n __validateNumberField(this, \"year\", node);\n\n let setvalue = null;\n if (this.day !== null && this.month !== null && this.year !== null && isValidDate(this.year, this.month, this.day))\n setvalue = formatISODate(this);\n else if (this.daynode.value === \"\" && this.monthnode.value === \"\" && this.yearnode.value === \"\")\n setvalue = \"\";\n\n //FIXME who needs these classes ?\n const hasvalue = this.day !== null && this.month !== null && this.year !== null;\n dompack.toggleClass(this.inputgroup, \"hasvalue\", hasvalue);\n dompack.toggleClass(this.inputgroup, \"partlyfilled\", !hasvalue && (this.day !== null || this.month !== null || this.year !== null));\n\n if (setvalue !== null && this._lastsetvalue !== setvalue) {\n this._replacednode.value = setvalue;\n this._lastsetvalue = setvalue;\n domevents.fireHTMLEvent(this._replacednode, 'change');\n }\n }\n\n onKeyUp(ev, node) {\n ev.preventDefault();\n ev.stopPropagation();\n\n const prevval = this.previous.value;\n this.previous.value = node.value;\n\n if (ev.keyCode === 8 && node.value === \"\" && prevval === \"\")//backspace\n {\n //Try to set focus on previous input\n const prevnode = node.parentNode.previousSibling;\n if (prevnode) {\n const previnp = prevnode.querySelector(\"input\");\n if (previnp)\n previnp.focus();\n }\n\n return;\n }\n\n //First some basic validation\n const value = node.value.replace(/[^0-9]+/g, '');\n\n if (value === \"\" || value !== node.value || Number(value) < Number(node.min) || Number(value) > Number(node.max))\n return;\n\n //Is field value minimal length\n if ((node === this.yearnode && value.length < 4) || (node !== this.yearnode && value.length < 2))\n return;\n\n if (prevval === node.value)\n return;//Only go to next input if value changed\n\n //Try to set focus on next input\n const nextnode = node.parentNode.nextSibling;\n if (!nextnode)\n return;\n\n const nextinp = nextnode.querySelector(\"input\");\n if (nextinp)\n nextinp.focus();\n }\n}\n\nexport class SplitTimeField extends MultiInputSubstition {\n constructor(inpnode) {\n super(inpnode);\n if (!this._replacednode)\n return;\n\n __hideInput(inpnode);//hide current input\n\n this.previous = { value: '' };\n\n this.placeholder = {\n hours: \"hh\",\n minutes: \"mm\",\n seconds: \"ss\"\n };\n\n if (whintegration.config.locale.indexOf(\"nl\") > -1)\n this.placeholder = {\n hours: \"uu\",\n minutes: \"mm\",\n seconds: \"ss\"\n };\n\n this.hours = null;\n this.minutes = null;\n this.seconds = null;\n\n if (this._replacednode.value !== \"\")//Should be iso date\n {\n const parts = __strToIntegerArray(this._replacednode.value);\n if (parts.length > 1) {\n this.hour = parts[0];\n this.minute = parts[1];\n\n if (this._replacednode.dataset.whPrecision === \"seconds\" && parts.length > 2)\n this.seconds = parts[2];\n }\n }\n\n const isdisabled = this._replacednode.disabled;\n const isreadonly = this._replacednode.readonly;\n\n this.hournode = <input disabled={isdisabled} readonly={isreadonly} pattern=\"[0-9]*\" inputmode=\"numeric\" autocomplete=\"off\" maxlength=\"2\" value={this.hours === null ? \"\" : this.hours} min=\"0\" max=\"23\" type=\"number\"\n placeholder={this.placeholder.hours}\n aria-label={getTid(\"publisher:site.forms.splitdatetime-hours-arialabel\")}\n />;\n this.minutenode = <input disabled={isdisabled} readonly={isreadonly} pattern=\"[0-9]*\" inputmode=\"numeric\" autocomplete=\"off\" maxlength=\"2\" value={this.minutes === null ? \"\" : this.minutes} min=\"0\" max=\"59\" type=\"number\"\n placeholder={this.placeholder.minutes}\n aria-label={getTid(\"publisher:site.forms.splitdatetime-minutes-arialabel\")}\n />;\n\n this.inputgroup = <div class=\"wh-form__timeinputgroup\" role=\"group\">\n <div class=\"wh-form__timeinputgroup__line wh-form__timeinputgroup__hour\">\n {this.hournode}\n </div>\n <div class=\"wh-form__timeinputgroup__line wh-form__timeinputgroup__minute\">\n {this.minutenode}\n </div>\n </div>;\n\n // Refer to the label (Because we have role=\"group\" we need a label)\n const labelid = ensureLabelID(inpnode);\n //console.log(\"labelid for time field\", labelid);\n if (labelid !== \"\")\n this.inputgroup.setAttribute(\"aria-labelledby\", labelid);\n\n\n if (this._replacednode.dataset.whPrecision === \"seconds\") {\n this.secondnode = <input disabled={isdisabled} readonly={isreadonly} pattern=\"[0-9]*\" inputmode=\"numeric\" autocomplete=\"off\" maxlength=\"2\" value={this.seconds === null ? \"\" : this.seconds} min=\"0\" max=\"59\" type=\"number\"\n placeholder={this.placeholder.seconds}\n aria-label={getTid(\"publisher:site.forms.splitdatetime-seconds-arialabel\")}\n />;\n this.inputgroup.appendChild(<div class=\"wh-form__timeinputgroup__line wh-form__timeinputgroup__second\">\n {this.secondnode}\n </div>);\n\n this.inputgroup.classList.add(\"wh-form__timeinputgroup--3col\");\n }\n\n\n // Take the replaced input out of the keyboard navigation.\n // But it'll retain the ability to get focus. So if code sets the focus it will be forwarded to the first input in the group (the day).\n this._replacednode.setAttribute(\"tabindex\", \"-1\");\n\n //If focus on hidden time input, set focus on first field in replacement\n this._replacednode.addEventListener(\"focus\", ev => {\n // NOTE: It's important we have set tabindex=\"-1\" on the input, otherwise when we tab backwards from\n // the first input in our group we are returned back to the day input. (so we can never escape backwards)\n const nextnode = this.inputgroup.querySelector(\"input\");\n if (nextnode)\n nextnode.focus();\n });\n\n\n if (isdisabled)\n this.inputgroup.classList.add(\"wh-form__timeinputgroup--disabled\");\n if (isreadonly)\n this.inputgroup.classList.add(\"wh-form__timeinputgroup--disabled\");\n\n inpnode.parentNode.appendChild(this.inputgroup);\n\n this._replacednode.addEventListener(\"wh:form-enable\", ev => {\n dompack.toggleClass(this.inputgroup, \"wh-form__timeinputgroup--disabled\", ev.detail.enabled);\n\n this.hournode.disabled = !ev.detail.enabled;\n this.minutenode.disabled = !ev.detail.enabled;\n if (this.secondnode)\n this.secondnode.disabled = !ev.detail.enabled;\n\n this.hournode.readonly = !ev.detail.enabled;\n this.minutenode.readonly = !ev.detail.enabled;\n if (this.secondnode)\n this.secondnode.readonly = !ev.detail.enabled;\n });\n\n for (const node of this.inputgroup.querySelectorAll(\"input\")) {\n node.addEventListener(\"blur\", () => { this.inputgroup.classList.remove(\"focus\"); });\n node.addEventListener(\"focus\", () => {\n this.previous.value = node.value;\n this.inputgroup.classList.add(\"focus\");\n });\n\n node.addEventListener(\"change\", ev => this.onChange(ev, node));\n node.addEventListener(\"keyup\", ev => this.onKeyUp(ev, node));\n }\n }\n\n _getSubInputs() {\n return [this.hournode, this.minutenode, ...(this.secondnode ? [this.secondenode] : [])];\n }\n\n onChange(ev, node) {\n const prev_hours = this.hours;\n const prev_minutes = this.minutes;\n const prev_seconds = this.seconds;\n\n if (node === this.hournode)\n __validateNumberField(this, \"hours\", node);\n else if (node === this.minutenode) {\n __validateNumberField(this, \"minutes\", node);\n if (node.value.length === 1)\n node.value = \"0\" + node.value;\n } else if (node === this.secondnode) {\n __validateNumberField(this, \"seconds\", node);\n if (node.value.length === 1)\n node.value = \"0\" + node.value;\n }\n\n if (this.hours !== null && this.minutes !== null)\n this._replacednode.value = (this.hours < 10 ? \"0\" : \"\") + this.hours + (this.minutes < 10 ? \":0\" : \":\") + this.minutes;\n else\n this._replacednode.value = \"\";\n\n let hasvalue = this.hours !== null && this.minutes !== null;\n if (hasvalue && this.secondnode && this.seconds === null)\n hasvalue = false;\n dompack.toggleClass(this.inputgroup, \"hasvalue\", hasvalue);\n dompack.toggleClass(this.inputgroup, \"partlyfilled\", !hasvalue && (this.hours !== null || this.minutes !== null || (this.secondnode && this.seconds !== null)));\n\n //Trigger change event on original input\n if (prev_hours !== this.hours || prev_minutes !== this.minutes || prev_seconds !== this.seconds)\n domevents.fireHTMLEvent(this._replacednode, 'change');\n }\n\n onKeyUp(ev, node) {\n ev.preventDefault();\n ev.stopPropagation();\n\n const prevval = this.previous.value;\n this.previous.value = node.value;\n\n if (ev.keyCode === 8 && node.value === \"\" && prevval === \"\")//backspace\n {\n //Try to set focus on previous input\n const prevnode = node.parentNode.previousSibling;\n if (prevnode) {\n const previnp = prevnode.querySelector(\"input\");\n if (previnp)\n previnp.focus();\n }\n\n return;\n }\n\n //First some basic validation\n const value = node.value.replace(/[^0-9]+/g, '');\n if (value === \"\" || value !== node.value || Number(value) < Number(node.min) || Number(value) > Number(node.max))\n return;\n\n //Is field value minimal length\n if (value.length < 2)\n return;\n\n if (prevval === node.value)\n return;//Only go to next input if value changed\n\n //Try to set focus on next input\n const nextnode = node.parentNode.nextSibling;\n if (!nextnode)\n return;\n\n const nextinp = nextnode.querySelector(\"input\");\n if (nextinp)\n nextinp.focus();\n }\n}\n\n\nfunction __strToIntegerArray(str) {\n const ilist = [];\n const parts = str.split(/[^0-9]+/);\n for (let i = 0; i < parts.length; ++i)\n ilist.push(Number(parts[i]));\n\n return ilist;\n}\n\n\nfunction __validateNumberField(self, fieldname, node) {\n const value = node.value.replace(/[^0-9]+/g, '');\n node.value = value;\n\n if (value !== \"\")\n self[fieldname] = Number(value);\n else\n self[fieldname] = null;\n}\n\n\nfunction __hideInput(node) {\n node.style.display = \"block\";\n node.style.position = \"absolute\";\n node.style.left = \"-9999px\";\n node.style.width = \"0px\";\n node.style.height = \"0px\";\n}\n","export { default } from \"jquery\";\n","/*!\n * jQuery UI Autocomplete 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Autocomplete\n//>>group: Widgets\n//>>description: Lists suggested words as the user is typing.\n//>>docs: http://api.jqueryui.com/autocomplete/\n//>>demos: http://jqueryui.com/autocomplete/\n//>>css.structure: ../../themes/base/core.css\n//>>css.structure: ../../themes/base/autocomplete.css\n//>>css.theme: ../../themes/base/theme.css\n\nimport $ from \"jquery\";\nimport \"./menu\";\nimport \"../keycode\";\nimport \"../position\";\nimport \"../safe-active-element\";\nimport \"../version\";\nimport \"../widget\";\n\n$.widget( \"ui.autocomplete\", {\n\tversion: \"1.12.1\",\n\tdefaultElement: \"<input>\",\n\toptions: {\n\t\tappendTo: null,\n\t\tautoFocus: false,\n\t\tdelay: 300,\n\t\tminLength: 1,\n\t\tposition: {\n\t\t\tmy: \"left top\",\n\t\t\tat: \"left bottom\",\n\t\t\tcollision: \"none\"\n\t\t},\n\t\tsource: null,\n\n\t\t// Callbacks\n\t\tchange: null,\n\t\tclose: null,\n\t\tfocus: null,\n\t\topen: null,\n\t\tresponse: null,\n\t\tsearch: null,\n\t\tselect: null\n\t},\n\n\trequestIndex: 0,\n\tpending: 0,\n\n\t_create: function() {\n\n\t\t// Some browsers only repeat keydown events, not keypress events,\n\t\t// so we use the suppressKeyPress flag to determine if we've already\n\t\t// handled the keydown event. #7269\n\t\t// Unfortunately the code for & in keypress is the same as the up arrow,\n\t\t// so we use the suppressKeyPressRepeat flag to avoid handling keypress\n\t\t// events when we know the keydown event was used to modify the\n\t\t// search term. #7799\n\t\tvar suppressKeyPress, suppressKeyPressRepeat, suppressInput,\n\t\t\tnodeName = this.element[ 0 ].nodeName.toLowerCase(),\n\t\t\tisTextarea = nodeName === \"textarea\",\n\t\t\tisInput = nodeName === \"input\";\n\n\t\t// Textareas are always multi-line\n\t\t// Inputs are always single-line, even if inside a contentEditable element\n\t\t// IE also treats inputs as contentEditable\n\t\t// All other element types are determined by whether or not they're contentEditable\n\t\tthis.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );\n\n\t\tthis.valueMethod = this.element[ isTextarea || isInput ? \"val\" : \"text\" ];\n\t\tthis.isNewMenu = true;\n\n\t\tthis._addClass( \"ui-autocomplete-input\" );\n\t\tthis.element.attr( \"autocomplete\", \"off\" );\n\n\t\tthis._on( this.element, {\n\t\t\tkeydown: function( event ) {\n\t\t\t\tif ( this.element.prop( \"readOnly\" ) ) {\n\t\t\t\t\tsuppressKeyPress = true;\n\t\t\t\t\tsuppressInput = true;\n\t\t\t\t\tsuppressKeyPressRepeat = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsuppressKeyPress = false;\n\t\t\t\tsuppressInput = false;\n\t\t\t\tsuppressKeyPressRepeat = false;\n\t\t\t\tvar keyCode = $.ui.keyCode;\n\t\t\t\tswitch ( event.keyCode ) {\n\t\t\t\tcase keyCode.PAGE_UP:\n\t\t\t\t\tsuppressKeyPress = true;\n\t\t\t\t\tthis._move( \"previousPage\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.PAGE_DOWN:\n\t\t\t\t\tsuppressKeyPress = true;\n\t\t\t\t\tthis._move( \"nextPage\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.UP:\n\t\t\t\t\tsuppressKeyPress = true;\n\t\t\t\t\tthis._keyEvent( \"previous\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.DOWN:\n\t\t\t\t\tsuppressKeyPress = true;\n\t\t\t\t\tthis._keyEvent( \"next\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.ENTER:\n\n\t\t\t\t\t// when menu is open and has focus\n\t\t\t\t\tif ( this.menu.active ) {\n\n\t\t\t\t\t\t// #6055 - Opera still allows the keypress to occur\n\t\t\t\t\t\t// which causes forms to submit\n\t\t\t\t\t\tsuppressKeyPress = true;\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tthis.menu.select( event );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.TAB:\n\t\t\t\t\tif ( this.menu.active ) {\n\t\t\t\t\t\tthis.menu.select( event );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.ESCAPE:\n\t\t\t\t\tif ( this.menu.element.is( \":visible\" ) ) {\n\t\t\t\t\t\tif ( !this.isMultiLine ) {\n\t\t\t\t\t\t\tthis._value( this.term );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.close( event );\n\n\t\t\t\t\t\t// Different browsers have different default behavior for escape\n\t\t\t\t\t\t// Single press can mean undo or clear\n\t\t\t\t\t\t// Double press in IE means clear the whole form\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsuppressKeyPressRepeat = true;\n\n\t\t\t\t\t// search timeout should be triggered before the input value is changed\n\t\t\t\t\tthis._searchTimeout( event );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tkeypress: function( event ) {\n\t\t\t\tif ( suppressKeyPress ) {\n\t\t\t\t\tsuppressKeyPress = false;\n\t\t\t\t\tif ( !this.isMultiLine || this.menu.element.is( \":visible\" ) ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( suppressKeyPressRepeat ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Replicate some key handlers to allow them to repeat in Firefox and Opera\n\t\t\t\tvar keyCode = $.ui.keyCode;\n\t\t\t\tswitch ( event.keyCode ) {\n\t\t\t\tcase keyCode.PAGE_UP:\n\t\t\t\t\tthis._move( \"previousPage\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.PAGE_DOWN:\n\t\t\t\t\tthis._move( \"nextPage\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.UP:\n\t\t\t\t\tthis._keyEvent( \"previous\", event );\n\t\t\t\t\tbreak;\n\t\t\t\tcase keyCode.DOWN:\n\t\t\t\t\tthis._keyEvent( \"next\", event );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tinput: function( event ) {\n\t\t\t\tif ( suppressInput ) {\n\t\t\t\t\tsuppressInput = false;\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._searchTimeout( event );\n\t\t\t},\n\t\t\tfocus: function() {\n\t\t\t\tthis.selectedItem = null;\n\t\t\t\tthis.previous = this._value();\n\t\t\t},\n\t\t\tblur: function( event ) {\n\t\t\t\tif ( this.cancelBlur ) {\n\t\t\t\t\tdelete this.cancelBlur;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tclearTimeout( this.searching );\n\t\t\t\tthis.close( event );\n\t\t\t\tthis._change( event );\n\t\t\t}\n\t\t} );\n\n\t\tthis._initSource();\n\t\tthis.menu = $( \"<ul>\" )\n\t\t\t.appendTo( this._appendTo() )\n\t\t\t.menu( {\n\n\t\t\t\t// disable ARIA support, the live region takes care of that\n\t\t\t\trole: null\n\t\t\t} )\n\t\t\t.hide()\n\t\t\t.menu( \"instance\" );\n\n\t\tthis._addClass( this.menu.element, \"ui-autocomplete\", \"ui-front\" );\n\t\tthis._on( this.menu.element, {\n\t\t\tmousedown: function( event ) {\n\n\t\t\t\t// prevent moving focus out of the text field\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// IE doesn't prevent moving focus even with event.preventDefault()\n\t\t\t\t// so we set a flag to know when we should ignore the blur event\n\t\t\t\tthis.cancelBlur = true;\n\t\t\t\tthis._delay( function() {\n\t\t\t\t\tdelete this.cancelBlur;\n\n\t\t\t\t\t// Support: IE 8 only\n\t\t\t\t\t// Right clicking a menu item or selecting text from the menu items will\n\t\t\t\t\t// result in focus moving out of the input. However, we've already received\n\t\t\t\t\t// and ignored the blur event because of the cancelBlur flag set above. So\n\t\t\t\t\t// we restore focus to ensure that the menu closes properly based on the user's\n\t\t\t\t\t// next actions.\n\t\t\t\t\tif ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {\n\t\t\t\t\t\tthis.element.trigger( \"focus\" );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tmenufocus: function( event, ui ) {\n\t\t\t\tvar label, item;\n\n\t\t\t\t// support: Firefox\n\t\t\t\t// Prevent accidental activation of menu items in Firefox (#7024 #9118)\n\t\t\t\tif ( this.isNewMenu ) {\n\t\t\t\t\tthis.isNewMenu = false;\n\t\t\t\t\tif ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {\n\t\t\t\t\t\tthis.menu.blur();\n\n\t\t\t\t\t\tthis.document.one( \"mousemove\", function() {\n\t\t\t\t\t\t\t$( event.target ).trigger( event.originalEvent );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\titem = ui.item.data( \"ui-autocomplete-item\" );\n\t\t\t\tif ( false !== this._trigger( \"focus\", event, { item: item } ) ) {\n\n\t\t\t\t\t// use value to match what will end up in the input, if it was a key event\n\t\t\t\t\tif ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {\n\t\t\t\t\t\tthis._value( item.value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Announce the value in the liveRegion\n\t\t\t\tlabel = ui.item.attr( \"aria-label\" ) || item.value;\n\t\t\t\tif ( label && $.trim( label ).length ) {\n\t\t\t\t\tthis.liveRegion.children().hide();\n\t\t\t\t\t$( \"<div>\" ).text( label ).appendTo( this.liveRegion );\n\t\t\t\t}\n\t\t\t},\n\t\t\tmenuselect: function( event, ui ) {\n\t\t\t\tvar item = ui.item.data( \"ui-autocomplete-item\" ),\n\t\t\t\t\tprevious = this.previous;\n\n\t\t\t\t// Only trigger when focus was lost (click on menu)\n\t\t\t\tif ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {\n\t\t\t\t\tthis.element.trigger( \"focus\" );\n\t\t\t\t\tthis.previous = previous;\n\n\t\t\t\t\t// #6109 - IE triggers two focus events and the second\n\t\t\t\t\t// is asynchronous, so we need to reset the previous\n\t\t\t\t\t// term synchronously and asynchronously :-(\n\t\t\t\t\tthis._delay( function() {\n\t\t\t\t\t\tthis.previous = previous;\n\t\t\t\t\t\tthis.selectedItem = item;\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tif ( false !== this._trigger( \"select\", event, { item: item } ) ) {\n\t\t\t\t\tthis._value( item.value );\n\t\t\t\t}\n\n\t\t\t\t// reset the term after the select event\n\t\t\t\t// this allows custom select handling to work properly\n\t\t\t\tthis.term = this._value();\n\n\t\t\t\tthis.close( event );\n\t\t\t\tthis.selectedItem = item;\n\t\t\t}\n\t\t} );\n\n\t\tthis.liveRegion = $( \"<div>\", {\n\t\t\trole: \"status\",\n\t\t\t\"aria-live\": \"assertive\",\n\t\t\t\"aria-relevant\": \"additions\"\n\t\t} )\n\t\t\t.appendTo( this.document[ 0 ].body );\n\n\t\tthis._addClass( this.liveRegion, null, \"ui-helper-hidden-accessible\" );\n\n\t\t// Turning off autocomplete prevents the browser from remembering the\n\t\t// value when navigating through history, so we re-enable autocomplete\n\t\t// if the page is unloaded before the widget is destroyed. #7790\n\t\tthis._on( this.window, {\n\t\t\tbeforeunload: function() {\n\t\t\t\tthis.element.removeAttr( \"autocomplete\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_destroy: function() {\n\t\tclearTimeout( this.searching );\n\t\tthis.element.removeAttr( \"autocomplete\" );\n\t\tthis.menu.element.remove();\n\t\tthis.liveRegion.remove();\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tthis._super( key, value );\n\t\tif ( key === \"source\" ) {\n\t\t\tthis._initSource();\n\t\t}\n\t\tif ( key === \"appendTo\" ) {\n\t\t\tthis.menu.element.appendTo( this._appendTo() );\n\t\t}\n\t\tif ( key === \"disabled\" && value && this.xhr ) {\n\t\t\tthis.xhr.abort();\n\t\t}\n\t},\n\n\t_isEventTargetInWidget: function( event ) {\n\t\tvar menuElement = this.menu.element[ 0 ];\n\n\t\treturn event.target === this.element[ 0 ] ||\n\t\t\tevent.target === menuElement ||\n\t\t\t$.contains( menuElement, event.target );\n\t},\n\n\t_closeOnClickOutside: function( event ) {\n\t\tif ( !this._isEventTargetInWidget( event ) ) {\n\t\t\tthis.close();\n\t\t}\n\t},\n\n\t_appendTo: function() {\n\t\tvar element = this.options.appendTo;\n\n\t\tif ( element ) {\n\t\t\telement = element.jquery || element.nodeType ?\n\t\t\t\t$( element ) :\n\t\t\t\tthis.document.find( element ).eq( 0 );\n\t\t}\n\n\t\tif ( !element || !element[ 0 ] ) {\n\t\t\telement = this.element.closest( \".ui-front, dialog\" );\n\t\t}\n\n\t\tif ( !element.length ) {\n\t\t\telement = $( \"<div>\" ).css( \"position\", \"absolute\" ).appendTo( this.document[ 0 ].body );\n\t\t}\n\n\t\treturn element;\n\t},\n\n\t_initSource: function() {\n\t\tvar array, url,\n\t\t\tthat = this;\n\t\tif ( $.isArray( this.options.source ) ) {\n\t\t\tarray = this.options.source;\n\t\t\tthis.source = function( request, response ) {\n\t\t\t\tresponse( $.ui.autocomplete.filter( array, request.term ) );\n\t\t\t};\n\t\t} else if ( typeof this.options.source === \"string\" ) {\n\t\t\turl = this.options.source;\n\t\t\tthis.source = function( request, response ) {\n\t\t\t\tif ( that.xhr ) {\n\t\t\t\t\tthat.xhr.abort();\n\t\t\t\t}\n\t\t\t\tthat.xhr = $.ajax( {\n\t\t\t\t\turl: url,\n\t\t\t\t\tdata: request,\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t\tresponse( data );\n\t\t\t\t\t},\n\t\t\t\t\terror: function() {\n\t\t\t\t\t\tresponse( [] );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t} else {\n\t\t\tthis.source = this.options.source;\n\t\t}\n\t},\n\n\t_searchTimeout: function( event ) {\n\t\tclearTimeout( this.searching );\n\t\tthis.searching = this._delay( function() {\n\n\t\t\t// Search if the value has changed, or if the user retypes the same value (see #7434)\n\t\t\tvar equalValues = this.term === this._value(),\n\t\t\t\tmenuVisible = this.menu.element.is( \":visible\" ),\n\t\t\t\tmodifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;\n\n\t\t\tif ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {\n\t\t\t\tthis.selectedItem = null;\n\t\t\t\tthis.search( null, event );\n\t\t\t}\n\t\t}, this.options.delay );\n\t},\n\n\tsearch: function( value, event ) {\n\t\tvalue = value != null ? value : this._value();\n\n\t\t// Always save the actual value, not the one passed as an argument\n\t\tthis.term = this._value();\n\n\t\tif ( value.length < this.options.minLength ) {\n\t\t\treturn this.close( event );\n\t\t}\n\n\t\tif ( this._trigger( \"search\", event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._search( value );\n\t},\n\n\t_search: function( value ) {\n\t\tthis.pending++;\n\t\tthis._addClass( \"ui-autocomplete-loading\" );\n\t\tthis.cancelSearch = false;\n\n\t\tthis.source( { term: value }, this._response() );\n\t},\n\n\t_response: function() {\n\t\tvar index = ++this.requestIndex;\n\n\t\treturn $.proxy( function( content ) {\n\t\t\tif ( index === this.requestIndex ) {\n\t\t\t\tthis.__response( content );\n\t\t\t}\n\n\t\t\tthis.pending--;\n\t\t\tif ( !this.pending ) {\n\t\t\t\tthis._removeClass( \"ui-autocomplete-loading\" );\n\t\t\t}\n\t\t}, this );\n\t},\n\n\t__response: function( content ) {\n\t\tif ( content ) {\n\t\t\tcontent = this._normalize( content );\n\t\t}\n\t\tthis._trigger( \"response\", null, { content: content } );\n\t\tif ( !this.options.disabled && content && content.length && !this.cancelSearch ) {\n\t\t\tthis._suggest( content );\n\t\t\tthis._trigger( \"open\" );\n\t\t} else {\n\n\t\t\t// use ._close() instead of .close() so we don't cancel future searches\n\t\t\tthis._close();\n\t\t}\n\t},\n\n\tclose: function( event ) {\n\t\tthis.cancelSearch = true;\n\t\tthis._close( event );\n\t},\n\n\t_close: function( event ) {\n\n\t\t// Remove the handler that closes the menu on outside clicks\n\t\tthis._off( this.document, \"mousedown\" );\n\n\t\tif ( this.menu.element.is( \":visible\" ) ) {\n\t\t\tthis.menu.element.hide();\n\t\t\tthis.menu.blur();\n\t\t\tthis.isNewMenu = true;\n\t\t\tthis._trigger( \"close\", event );\n\t\t}\n\t},\n\n\t_change: function( event ) {\n\t\tif ( this.previous !== this._value() ) {\n\t\t\tthis._trigger( \"change\", event, { item: this.selectedItem } );\n\t\t}\n\t},\n\n\t_normalize: function( items ) {\n\n\t\t// assume all items have the right format when the first item is complete\n\t\tif ( items.length && items[ 0 ].label && items[ 0 ].value ) {\n\t\t\treturn items;\n\t\t}\n\t\treturn $.map( items, function( item ) {\n\t\t\tif ( typeof item === \"string\" ) {\n\t\t\t\treturn {\n\t\t\t\t\tlabel: item,\n\t\t\t\t\tvalue: item\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn $.extend( {}, item, {\n\t\t\t\tlabel: item.label || item.value,\n\t\t\t\tvalue: item.value || item.label\n\t\t\t} );\n\t\t} );\n\t},\n\n\t_suggest: function( items ) {\n\t\tvar ul = this.menu.element.empty();\n\t\tthis._renderMenu( ul, items );\n\t\tthis.isNewMenu = true;\n\t\tthis.menu.refresh();\n\n\t\t// Size and position menu\n\t\tul.show();\n\t\tthis._resizeMenu();\n\t\tul.position( $.extend( {\n\t\t\tof: this.element\n\t\t}, this.options.position ) );\n\n\t\tif ( this.options.autoFocus ) {\n\t\t\tthis.menu.next();\n\t\t}\n\n\t\t// Listen for interactions outside of the widget (#6642)\n\t\tthis._on( this.document, {\n\t\t\tmousedown: \"_closeOnClickOutside\"\n\t\t} );\n\t},\n\n\t_resizeMenu: function() {\n\t\tvar ul = this.menu.element;\n\t\tul.outerWidth( Math.max(\n\n\t\t\t// Firefox wraps long text (possibly a rounding bug)\n\t\t\t// so we add 1px to avoid the wrapping (#7513)\n\t\t\tul.width( \"\" ).outerWidth() + 1,\n\t\t\tthis.element.outerWidth()\n\t\t) );\n\t},\n\n\t_renderMenu: function( ul, items ) {\n\t\tvar that = this;\n\t\t$.each( items, function( index, item ) {\n\t\t\tthat._renderItemData( ul, item );\n\t\t} );\n\t},\n\n\t_renderItemData: function( ul, item ) {\n\t\treturn this._renderItem( ul, item ).data( \"ui-autocomplete-item\", item );\n\t},\n\n\t_renderItem: function( ul, item ) {\n\t\treturn $( \"<li>\" )\n\t\t\t.append( $( \"<div>\" ).text( item.label ) )\n\t\t\t.appendTo( ul );\n\t},\n\n\t_move: function( direction, event ) {\n\t\tif ( !this.menu.element.is( \":visible\" ) ) {\n\t\t\tthis.search( null, event );\n\t\t\treturn;\n\t\t}\n\t\tif ( this.menu.isFirstItem() && /^previous/.test( direction ) ||\n\t\t\t\tthis.menu.isLastItem() && /^next/.test( direction ) ) {\n\n\t\t\tif ( !this.isMultiLine ) {\n\t\t\t\tthis._value( this.term );\n\t\t\t}\n\n\t\t\tthis.menu.blur();\n\t\t\treturn;\n\t\t}\n\t\tthis.menu[ direction ]( event );\n\t},\n\n\twidget: function() {\n\t\treturn this.menu.element;\n\t},\n\n\t_value: function() {\n\t\treturn this.valueMethod.apply( this.element, arguments );\n\t},\n\n\t_keyEvent: function( keyEvent, event ) {\n\t\tif ( !this.isMultiLine || this.menu.element.is( \":visible\" ) ) {\n\t\t\tthis._move( keyEvent, event );\n\n\t\t\t// Prevents moving cursor to beginning/end of the text field in some browsers\n\t\t\tevent.preventDefault();\n\t\t}\n\t},\n\n\t// Support: Chrome <=50\n\t// We should be able to just use this.element.prop( \"isContentEditable\" )\n\t// but hidden elements always report false in Chrome.\n\t// https://code.google.com/p/chromium/issues/detail?id=313082\n\t_isContentEditable: function( element ) {\n\t\tif ( !element.length ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar editable = element.prop( \"contentEditable\" );\n\n\t\tif ( editable === \"inherit\" ) {\n\t\t return this._isContentEditable( element.parent() );\n\t\t}\n\n\t\treturn editable === \"true\";\n\t}\n} );\n\n$.extend( $.ui.autocomplete, {\n\tescapeRegex: function( value ) {\n\t\treturn value.replace( /[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\" );\n\t},\n\tfilter: function( array, term ) {\n\t\tvar matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), \"i\" );\n\t\treturn $.grep( array, function( value ) {\n\t\t\treturn matcher.test( value.label || value.value || value );\n\t\t} );\n\t}\n} );\n\n// Live region extension, adding a `messages` option\n// NOTE: This is an experimental API. We are still investigating\n// a full solution for string manipulation and internationalization.\n$.widget( \"ui.autocomplete\", $.ui.autocomplete, {\n\toptions: {\n\t\tmessages: {\n\t\t\tnoResults: \"No search results.\",\n\t\t\tresults: function( amount ) {\n\t\t\t\treturn amount + ( amount > 1 ? \" results are\" : \" result is\" ) +\n\t\t\t\t\t\" available, use up and down arrow keys to navigate.\";\n\t\t\t}\n\t\t}\n\t},\n\n\t__response: function( content ) {\n\t\tvar message;\n\t\tthis._superApply( arguments );\n\t\tif ( this.options.disabled || this.cancelSearch ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( content && content.length ) {\n\t\t\tmessage = this.options.messages.results( content.length );\n\t\t} else {\n\t\t\tmessage = this.options.messages.noResults;\n\t\t}\n\t\tthis.liveRegion.children().hide();\n\t\t$( \"<div>\" ).text( message ).appendTo( this.liveRegion );\n\t}\n} );\n\nexport default $.ui.autocomplete;\n","/*!\n * jQuery UI Menu 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Menu\n//>>group: Widgets\n//>>description: Creates nestable menus.\n//>>docs: http://api.jqueryui.com/menu/\n//>>demos: http://jqueryui.com/menu/\n//>>css.structure: ../../themes/base/core.css\n//>>css.structure: ../../themes/base/menu.css\n//>>css.theme: ../../themes/base/theme.css\n\nimport $ from \"jquery\";\nimport \"../keycode\";\nimport \"../position\";\nimport \"../safe-active-element\";\nimport \"../unique-id\";\nimport \"../version\";\nimport \"../widget\";\n\n$.widget( \"ui.menu\", {\n\tversion: \"1.12.1\",\n\tdefaultElement: \"<ul>\",\n\tdelay: 300,\n\toptions: {\n\t\ticons: {\n\t\t\tsubmenu: \"ui-icon-caret-1-e\"\n\t\t},\n\t\titems: \"> *\",\n\t\tmenus: \"ul\",\n\t\tposition: {\n\t\t\tmy: \"left top\",\n\t\t\tat: \"right top\"\n\t\t},\n\t\trole: \"menu\",\n\n\t\t// Callbacks\n\t\tblur: null,\n\t\tfocus: null,\n\t\tselect: null\n\t},\n\n\t_create: function() {\n\t\tthis.activeMenu = this.element;\n\n\t\t// Flag used to prevent firing of the click handler\n\t\t// as the event bubbles up through nested menus\n\t\tthis.mouseHandled = false;\n\t\tthis.element\n\t\t\t.uniqueId()\n\t\t\t.attr( {\n\t\t\t\trole: this.options.role,\n\t\t\t\ttabIndex: 0\n\t\t\t} );\n\n\t\tthis._addClass( \"ui-menu\", \"ui-widget ui-widget-content\" );\n\t\tthis._on( {\n\n\t\t\t// Prevent focus from sticking to links inside menu after clicking\n\t\t\t// them (focus should always stay on UL during navigation).\n\t\t\t\"mousedown .ui-menu-item\": function( event ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t},\n\t\t\t\"click .ui-menu-item\": function( event ) {\n\t\t\t\tvar target = $( event.target );\n\t\t\t\tvar active = $( $.ui.safeActiveElement( this.document[ 0 ] ) );\n\t\t\t\tif ( !this.mouseHandled && target.not( \".ui-state-disabled\" ).length ) {\n\t\t\t\t\tthis.select( event );\n\n\t\t\t\t\t// Only set the mouseHandled flag if the event will bubble, see #9469.\n\t\t\t\t\tif ( !event.isPropagationStopped() ) {\n\t\t\t\t\t\tthis.mouseHandled = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Open submenu on click\n\t\t\t\t\tif ( target.has( \".ui-menu\" ).length ) {\n\t\t\t\t\t\tthis.expand( event );\n\t\t\t\t\t} else if ( !this.element.is( \":focus\" ) &&\n\t\t\t\t\t\t\tactive.closest( \".ui-menu\" ).length ) {\n\n\t\t\t\t\t\t// Redirect focus to the menu\n\t\t\t\t\t\tthis.element.trigger( \"focus\", [ true ] );\n\n\t\t\t\t\t\t// If the active item is on the top level, let it stay active.\n\t\t\t\t\t\t// Otherwise, blur the active item since it is no longer visible.\n\t\t\t\t\t\tif ( this.active && this.active.parents( \".ui-menu\" ).length === 1 ) {\n\t\t\t\t\t\t\tclearTimeout( this.timer );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"mouseenter .ui-menu-item\": function( event ) {\n\n\t\t\t\t// Ignore mouse events while typeahead is active, see #10458.\n\t\t\t\t// Prevents focusing the wrong item when typeahead causes a scroll while the mouse\n\t\t\t\t// is over an item in the menu\n\t\t\t\tif ( this.previousFilter ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar actualTarget = $( event.target ).closest( \".ui-menu-item\" ),\n\t\t\t\t\ttarget = $( event.currentTarget );\n\n\t\t\t\t// Ignore bubbled events on parent items, see #11641\n\t\t\t\tif ( actualTarget[ 0 ] !== target[ 0 ] ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Remove ui-state-active class from siblings of the newly focused menu item\n\t\t\t\t// to avoid a jump caused by adjacent elements both having a class with a border\n\t\t\t\tthis._removeClass( target.siblings().children( \".ui-state-active\" ),\n\t\t\t\t\tnull, \"ui-state-active\" );\n\t\t\t\tthis.focus( event, target );\n\t\t\t},\n\t\t\tmouseleave: \"collapseAll\",\n\t\t\t\"mouseleave .ui-menu\": \"collapseAll\",\n\t\t\tfocus: function( event, keepActiveItem ) {\n\n\t\t\t\t// If there's already an active item, keep it active\n\t\t\t\t// If not, activate the first item\n\t\t\t\tvar item = this.active || this.element.find( this.options.items ).eq( 0 );\n\n\t\t\t\tif ( !keepActiveItem ) {\n\t\t\t\t\tthis.focus( event, item );\n\t\t\t\t}\n\t\t\t},\n\t\t\tblur: function( event ) {\n\t\t\t\tthis._delay( function() {\n\t\t\t\t\tvar notContained = !$.contains(\n\t\t\t\t\t\tthis.element[ 0 ],\n\t\t\t\t\t\t$.ui.safeActiveElement( this.document[ 0 ] )\n\t\t\t\t\t);\n\t\t\t\t\tif ( notContained ) {\n\t\t\t\t\t\tthis.collapseAll( event );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\tkeydown: \"_keydown\"\n\t\t} );\n\n\t\tthis.refresh();\n\n\t\t// Clicks outside of a menu collapse any open menus\n\t\tthis._on( this.document, {\n\t\t\tclick: function( event ) {\n\t\t\t\tif ( this._closeOnDocumentClick( event ) ) {\n\t\t\t\t\tthis.collapseAll( event );\n\t\t\t\t}\n\n\t\t\t\t// Reset the mouseHandled flag\n\t\t\t\tthis.mouseHandled = false;\n\t\t\t}\n\t\t} );\n\t},\n\n\t_destroy: function() {\n\t\tvar items = this.element.find( \".ui-menu-item\" )\n\t\t\t\t.removeAttr( \"role aria-disabled\" ),\n\t\t\tsubmenus = items.children( \".ui-menu-item-wrapper\" )\n\t\t\t\t.removeUniqueId()\n\t\t\t\t.removeAttr( \"tabIndex role aria-haspopup\" );\n\n\t\t// Destroy (sub)menus\n\t\tthis.element\n\t\t\t.removeAttr( \"aria-activedescendant\" )\n\t\t\t.find( \".ui-menu\" ).addBack()\n\t\t\t\t.removeAttr( \"role aria-labelledby aria-expanded aria-hidden aria-disabled \" +\n\t\t\t\t\t\"tabIndex\" )\n\t\t\t\t.removeUniqueId()\n\t\t\t\t.show();\n\n\t\tsubmenus.children().each( function() {\n\t\t\tvar elem = $( this );\n\t\t\tif ( elem.data( \"ui-menu-submenu-caret\" ) ) {\n\t\t\t\telem.remove();\n\t\t\t}\n\t\t} );\n\t},\n\n\t_keydown: function( event ) {\n\t\tvar match, prev, character, skip,\n\t\t\tpreventDefault = true;\n\n\t\tswitch ( event.keyCode ) {\n\t\tcase $.ui.keyCode.PAGE_UP:\n\t\t\tthis.previousPage( event );\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.PAGE_DOWN:\n\t\t\tthis.nextPage( event );\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.HOME:\n\t\t\tthis._move( \"first\", \"first\", event );\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.END:\n\t\t\tthis._move( \"last\", \"last\", event );\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.UP:\n\t\t\tthis.previous( event );\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.DOWN:\n\t\t\tthis.next( event );\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.LEFT:\n\t\t\tthis.collapse( event );\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.RIGHT:\n\t\t\tif ( this.active && !this.active.is( \".ui-state-disabled\" ) ) {\n\t\t\t\tthis.expand( event );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.ENTER:\n\t\tcase $.ui.keyCode.SPACE:\n\t\t\tthis._activate( event );\n\t\t\tbreak;\n\t\tcase $.ui.keyCode.ESCAPE:\n\t\t\tthis.collapse( event );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpreventDefault = false;\n\t\t\tprev = this.previousFilter || \"\";\n\t\t\tskip = false;\n\n\t\t\t// Support number pad values\n\t\t\tcharacter = event.keyCode >= 96 && event.keyCode <= 105 ?\n\t\t\t\t( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode );\n\n\t\t\tclearTimeout( this.filterTimer );\n\n\t\t\tif ( character === prev ) {\n\t\t\t\tskip = true;\n\t\t\t} else {\n\t\t\t\tcharacter = prev + character;\n\t\t\t}\n\n\t\t\tmatch = this._filterMenuItems( character );\n\t\t\tmatch = skip && match.index( this.active.next() ) !== -1 ?\n\t\t\t\tthis.active.nextAll( \".ui-menu-item\" ) :\n\t\t\t\tmatch;\n\n\t\t\t// If no matches on the current filter, reset to the last character pressed\n\t\t\t// to move down the menu to the first item that starts with that character\n\t\t\tif ( !match.length ) {\n\t\t\t\tcharacter = String.fromCharCode( event.keyCode );\n\t\t\t\tmatch = this._filterMenuItems( character );\n\t\t\t}\n\n\t\t\tif ( match.length ) {\n\t\t\t\tthis.focus( event, match );\n\t\t\t\tthis.previousFilter = character;\n\t\t\t\tthis.filterTimer = this._delay( function() {\n\t\t\t\t\tdelete this.previousFilter;\n\t\t\t\t}, 1000 );\n\t\t\t} else {\n\t\t\t\tdelete this.previousFilter;\n\t\t\t}\n\t\t}\n\n\t\tif ( preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t},\n\n\t_activate: function( event ) {\n\t\tif ( this.active && !this.active.is( \".ui-state-disabled\" ) ) {\n\t\t\tif ( this.active.children( \"[aria-haspopup='true']\" ).length ) {\n\t\t\t\tthis.expand( event );\n\t\t\t} else {\n\t\t\t\tthis.select( event );\n\t\t\t}\n\t\t}\n\t},\n\n\trefresh: function() {\n\t\tvar menus, items, newSubmenus, newItems, newWrappers,\n\t\t\tthat = this,\n\t\t\ticon = this.options.icons.submenu,\n\t\t\tsubmenus = this.element.find( this.options.menus );\n\n\t\tthis._toggleClass( \"ui-menu-icons\", null, !!this.element.find( \".ui-icon\" ).length );\n\n\t\t// Initialize nested menus\n\t\tnewSubmenus = submenus.filter( \":not(.ui-menu)\" )\n\t\t\t.hide()\n\t\t\t.attr( {\n\t\t\t\trole: this.options.role,\n\t\t\t\t\"aria-hidden\": \"true\",\n\t\t\t\t\"aria-expanded\": \"false\"\n\t\t\t} )\n\t\t\t.each( function() {\n\t\t\t\tvar menu = $( this ),\n\t\t\t\t\titem = menu.prev(),\n\t\t\t\t\tsubmenuCaret = $( \"<span>\" ).data( \"ui-menu-submenu-caret\", true );\n\n\t\t\t\tthat._addClass( submenuCaret, \"ui-menu-icon\", \"ui-icon \" + icon );\n\t\t\t\titem\n\t\t\t\t\t.attr( \"aria-haspopup\", \"true\" )\n\t\t\t\t\t.prepend( submenuCaret );\n\t\t\t\tmenu.attr( \"aria-labelledby\", item.attr( \"id\" ) );\n\t\t\t} );\n\n\t\tthis._addClass( newSubmenus, \"ui-menu\", \"ui-widget ui-widget-content ui-front\" );\n\n\t\tmenus = submenus.add( this.element );\n\t\titems = menus.find( this.options.items );\n\n\t\t// Initialize menu-items containing spaces and/or dashes only as dividers\n\t\titems.not( \".ui-menu-item\" ).each( function() {\n\t\t\tvar item = $( this );\n\t\t\tif ( that._isDivider( item ) ) {\n\t\t\t\tthat._addClass( item, \"ui-menu-divider\", \"ui-widget-content\" );\n\t\t\t}\n\t\t} );\n\n\t\t// Don't refresh list items that are already adapted\n\t\tnewItems = items.not( \".ui-menu-item, .ui-menu-divider\" );\n\t\tnewWrappers = newItems.children()\n\t\t\t.not( \".ui-menu\" )\n\t\t\t\t.uniqueId()\n\t\t\t\t.attr( {\n\t\t\t\t\ttabIndex: -1,\n\t\t\t\t\trole: this._itemRole()\n\t\t\t\t} );\n\t\tthis._addClass( newItems, \"ui-menu-item\" )\n\t\t\t._addClass( newWrappers, \"ui-menu-item-wrapper\" );\n\n\t\t// Add aria-disabled attribute to any disabled menu item\n\t\titems.filter( \".ui-state-disabled\" ).attr( \"aria-disabled\", \"true\" );\n\n\t\t// If the active item has been removed, blur the menu\n\t\tif ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {\n\t\t\tthis.blur();\n\t\t}\n\t},\n\n\t_itemRole: function() {\n\t\treturn {\n\t\t\tmenu: \"menuitem\",\n\t\t\tlistbox: \"option\"\n\t\t}[ this.options.role ];\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === \"icons\" ) {\n\t\t\tvar icons = this.element.find( \".ui-menu-icon\" );\n\t\t\tthis._removeClass( icons, null, this.options.icons.submenu )\n\t\t\t\t._addClass( icons, null, value.submenu );\n\t\t}\n\t\tthis._super( key, value );\n\t},\n\n\t_setOptionDisabled: function( value ) {\n\t\tthis._super( value );\n\n\t\tthis.element.attr( \"aria-disabled\", String( value ) );\n\t\tthis._toggleClass( null, \"ui-state-disabled\", !!value );\n\t},\n\n\tfocus: function( event, item ) {\n\t\tvar nested, focused, activeParent;\n\t\tthis.blur( event, event && event.type === \"focus\" );\n\n\t\tthis._scrollIntoView( item );\n\n\t\tthis.active = item.first();\n\n\t\tfocused = this.active.children( \".ui-menu-item-wrapper\" );\n\t\tthis._addClass( focused, null, \"ui-state-active\" );\n\n\t\t// Only update aria-activedescendant if there's a role\n\t\t// otherwise we assume focus is managed elsewhere\n\t\tif ( this.options.role ) {\n\t\t\tthis.element.attr( \"aria-activedescendant\", focused.attr( \"id\" ) );\n\t\t}\n\n\t\t// Highlight active parent menu item, if any\n\t\tactiveParent = this.active\n\t\t\t.parent()\n\t\t\t\t.closest( \".ui-menu-item\" )\n\t\t\t\t\t.children( \".ui-menu-item-wrapper\" );\n\t\tthis._addClass( activeParent, null, \"ui-state-active\" );\n\n\t\tif ( event && event.type === \"keydown\" ) {\n\t\t\tthis._close();\n\t\t} else {\n\t\t\tthis.timer = this._delay( function() {\n\t\t\t\tthis._close();\n\t\t\t}, this.delay );\n\t\t}\n\n\t\tnested = item.children( \".ui-menu\" );\n\t\tif ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {\n\t\t\tthis._startOpening( nested );\n\t\t}\n\t\tthis.activeMenu = item.parent();\n\n\t\tthis._trigger( \"focus\", event, { item: item } );\n\t},\n\n\t_scrollIntoView: function( item ) {\n\t\tvar borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;\n\t\tif ( this._hasScroll() ) {\n\t\t\tborderTop = parseFloat( $.css( this.activeMenu[ 0 ], \"borderTopWidth\" ) ) || 0;\n\t\t\tpaddingTop = parseFloat( $.css( this.activeMenu[ 0 ], \"paddingTop\" ) ) || 0;\n\t\t\toffset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;\n\t\t\tscroll = this.activeMenu.scrollTop();\n\t\t\telementHeight = this.activeMenu.height();\n\t\t\titemHeight = item.outerHeight();\n\n\t\t\tif ( offset < 0 ) {\n\t\t\t\tthis.activeMenu.scrollTop( scroll + offset );\n\t\t\t} else if ( offset + itemHeight > elementHeight ) {\n\t\t\t\tthis.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );\n\t\t\t}\n\t\t}\n\t},\n\n\tblur: function( event, fromFocus ) {\n\t\tif ( !fromFocus ) {\n\t\t\tclearTimeout( this.timer );\n\t\t}\n\n\t\tif ( !this.active ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._removeClass( this.active.children( \".ui-menu-item-wrapper\" ),\n\t\t\tnull, \"ui-state-active\" );\n\n\t\tthis._trigger( \"blur\", event, { item: this.active } );\n\t\tthis.active = null;\n\t},\n\n\t_startOpening: function( submenu ) {\n\t\tclearTimeout( this.timer );\n\n\t\t// Don't open if already open fixes a Firefox bug that caused a .5 pixel\n\t\t// shift in the submenu position when mousing over the caret icon\n\t\tif ( submenu.attr( \"aria-hidden\" ) !== \"true\" ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.timer = this._delay( function() {\n\t\t\tthis._close();\n\t\t\tthis._open( submenu );\n\t\t}, this.delay );\n\t},\n\n\t_open: function( submenu ) {\n\t\tvar position = $.extend( {\n\t\t\tof: this.active\n\t\t}, this.options.position );\n\n\t\tclearTimeout( this.timer );\n\t\tthis.element.find( \".ui-menu\" ).not( submenu.parents( \".ui-menu\" ) )\n\t\t\t.hide()\n\t\t\t.attr( \"aria-hidden\", \"true\" );\n\n\t\tsubmenu\n\t\t\t.show()\n\t\t\t.removeAttr( \"aria-hidden\" )\n\t\t\t.attr( \"aria-expanded\", \"true\" )\n\t\t\t.position( position );\n\t},\n\n\tcollapseAll: function( event, all ) {\n\t\tclearTimeout( this.timer );\n\t\tthis.timer = this._delay( function() {\n\n\t\t\t// If we were passed an event, look for the submenu that contains the event\n\t\t\tvar currentMenu = all ? this.element :\n\t\t\t\t$( event && event.target ).closest( this.element.find( \".ui-menu\" ) );\n\n\t\t\t// If we found no valid submenu ancestor, use the main menu to close all\n\t\t\t// sub menus anyway\n\t\t\tif ( !currentMenu.length ) {\n\t\t\t\tcurrentMenu = this.element;\n\t\t\t}\n\n\t\t\tthis._close( currentMenu );\n\n\t\t\tthis.blur( event );\n\n\t\t\t// Work around active item staying active after menu is blurred\n\t\t\tthis._removeClass( currentMenu.find( \".ui-state-active\" ), null, \"ui-state-active\" );\n\n\t\t\tthis.activeMenu = currentMenu;\n\t\t}, this.delay );\n\t},\n\n\t// With no arguments, closes the currently active menu - if nothing is active\n\t// it closes all menus. If passed an argument, it will search for menus BELOW\n\t_close: function( startMenu ) {\n\t\tif ( !startMenu ) {\n\t\t\tstartMenu = this.active ? this.active.parent() : this.element;\n\t\t}\n\n\t\tstartMenu.find( \".ui-menu\" )\n\t\t\t.hide()\n\t\t\t.attr( \"aria-hidden\", \"true\" )\n\t\t\t.attr( \"aria-expanded\", \"false\" );\n\t},\n\n\t_closeOnDocumentClick: function( event ) {\n\t\treturn !$( event.target ).closest( \".ui-menu\" ).length;\n\t},\n\n\t_isDivider: function( item ) {\n\n\t\t// Match hyphen, em dash, en dash\n\t\treturn !/[^\\-\\u2014\\u2013\\s]/.test( item.text() );\n\t},\n\n\tcollapse: function( event ) {\n\t\tvar newItem = this.active &&\n\t\t\tthis.active.parent().closest( \".ui-menu-item\", this.element );\n\t\tif ( newItem && newItem.length ) {\n\t\t\tthis._close();\n\t\t\tthis.focus( event, newItem );\n\t\t}\n\t},\n\n\texpand: function( event ) {\n\t\tvar newItem = this.active &&\n\t\t\tthis.active\n\t\t\t\t.children( \".ui-menu \" )\n\t\t\t\t\t.find( this.options.items )\n\t\t\t\t\t\t.first();\n\n\t\tif ( newItem && newItem.length ) {\n\t\t\tthis._open( newItem.parent() );\n\n\t\t\t// Delay so Firefox will not hide activedescendant change in expanding submenu from AT\n\t\t\tthis._delay( function() {\n\t\t\t\tthis.focus( event, newItem );\n\t\t\t} );\n\t\t}\n\t},\n\n\tnext: function( event ) {\n\t\tthis._move( \"next\", \"first\", event );\n\t},\n\n\tprevious: function( event ) {\n\t\tthis._move( \"prev\", \"last\", event );\n\t},\n\n\tisFirstItem: function() {\n\t\treturn this.active && !this.active.prevAll( \".ui-menu-item\" ).length;\n\t},\n\n\tisLastItem: function() {\n\t\treturn this.active && !this.active.nextAll( \".ui-menu-item\" ).length;\n\t},\n\n\t_move: function( direction, filter, event ) {\n\t\tvar next;\n\t\tif ( this.active ) {\n\t\t\tif ( direction === \"first\" || direction === \"last\" ) {\n\t\t\t\tnext = this.active\n\t\t\t\t\t[ direction === \"first\" ? \"prevAll\" : \"nextAll\" ]( \".ui-menu-item\" )\n\t\t\t\t\t.eq( -1 );\n\t\t\t} else {\n\t\t\t\tnext = this.active\n\t\t\t\t\t[ direction + \"All\" ]( \".ui-menu-item\" )\n\t\t\t\t\t.eq( 0 );\n\t\t\t}\n\t\t}\n\t\tif ( !next || !next.length || !this.active ) {\n\t\t\tnext = this.activeMenu.find( this.options.items )[ filter ]();\n\t\t}\n\n\t\tthis.focus( event, next );\n\t},\n\n\tnextPage: function( event ) {\n\t\tvar item, base, height;\n\n\t\tif ( !this.active ) {\n\t\t\tthis.next( event );\n\t\t\treturn;\n\t\t}\n\t\tif ( this.isLastItem() ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( this._hasScroll() ) {\n\t\t\tbase = this.active.offset().top;\n\t\t\theight = this.element.height();\n\t\t\tthis.active.nextAll( \".ui-menu-item\" ).each( function() {\n\t\t\t\titem = $( this );\n\t\t\t\treturn item.offset().top - base - height < 0;\n\t\t\t} );\n\n\t\t\tthis.focus( event, item );\n\t\t} else {\n\t\t\tthis.focus( event, this.activeMenu.find( this.options.items )\n\t\t\t\t[ !this.active ? \"first\" : \"last\" ]() );\n\t\t}\n\t},\n\n\tpreviousPage: function( event ) {\n\t\tvar item, base, height;\n\t\tif ( !this.active ) {\n\t\t\tthis.next( event );\n\t\t\treturn;\n\t\t}\n\t\tif ( this.isFirstItem() ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( this._hasScroll() ) {\n\t\t\tbase = this.active.offset().top;\n\t\t\theight = this.element.height();\n\t\t\tthis.active.prevAll( \".ui-menu-item\" ).each( function() {\n\t\t\t\titem = $( this );\n\t\t\t\treturn item.offset().top - base + height > 0;\n\t\t\t} );\n\n\t\t\tthis.focus( event, item );\n\t\t} else {\n\t\t\tthis.focus( event, this.activeMenu.find( this.options.items ).first() );\n\t\t}\n\t},\n\n\t_hasScroll: function() {\n\t\treturn this.element.outerHeight() < this.element.prop( \"scrollHeight\" );\n\t},\n\n\tselect: function( event ) {\n\n\t\t// TODO: It should never be possible to not have an active item at this\n\t\t// point, but the tests don't trigger mouseenter before click.\n\t\tthis.active = this.active || $( event.target ).closest( \".ui-menu-item\" );\n\t\tvar ui = { item: this.active };\n\t\tif ( !this.active.has( \".ui-menu\" ).length ) {\n\t\t\tthis.collapseAll( event, true );\n\t\t}\n\t\tthis._trigger( \"select\", event, ui );\n\t},\n\n\t_filterMenuItems: function( character ) {\n\t\tvar escapedCharacter = character.replace( /[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\" ),\n\t\t\tregex = new RegExp( \"^\" + escapedCharacter, \"i\" );\n\n\t\treturn this.activeMenu\n\t\t\t.find( this.options.items )\n\n\t\t\t\t// Only match on items, not dividers or other content (#10571)\n\t\t\t\t.filter( \".ui-menu-item\" )\n\t\t\t\t\t.filter( function() {\n\t\t\t\t\t\treturn regex.test(\n\t\t\t\t\t\t\t$.trim( $( this ).children( \".ui-menu-item-wrapper\" ).text() ) );\n\t\t\t\t\t} );\n\t}\n} );\n","/*!\n * jQuery UI Keycode 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Keycode\n//>>group: Core\n//>>description: Provide keycodes as keynames\n//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/\n\nimport $ from \"jquery\";\nimport \"./version\";\n\n$.ui = $.ui || {};\n$.ui.keyCode = {\n\tBACKSPACE: 8,\n\tCOMMA: 188,\n\tDELETE: 46,\n\tDOWN: 40,\n\tEND: 35,\n\tENTER: 13,\n\tESCAPE: 27,\n\tHOME: 36,\n\tLEFT: 37,\n\tPAGE_DOWN: 34,\n\tPAGE_UP: 33,\n\tPERIOD: 190,\n\tRIGHT: 39,\n\tSPACE: 32,\n\tTAB: 9,\n\tUP: 38\n};\n","import $ from \"jquery\";\n\n$.ui = $.ui || {};\n\n$.ui.version = \"1.12.0\";\n","/*!\n * jQuery UI Position 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/position/\n */\n\n//>>label: Position\n//>>group: Core\n//>>description: Positions elements relative to other elements.\n//>>docs: http://api.jqueryui.com/position/\n//>>demos: http://jqueryui.com/position/\n\nimport $ from \"jquery\";\nimport \"./version\";\n\nvar cachedScrollbarWidth,\n\tmax = Math.max,\n\tabs = Math.abs,\n\trhorizontal = /left|center|right/,\n\trvertical = /top|center|bottom/,\n\troffset = /[\\+\\-]\\d+(\\.[\\d]+)?%?/,\n\trposition = /^\\w+/,\n\trpercent = /%$/,\n\t_position = $.fn.position;\n\nfunction getOffsets( offsets, width, height ) {\n\treturn [\n\t\tparseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),\n\t\tparseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )\n\t];\n}\n\nfunction parseCss( element, property ) {\n\treturn parseInt( $.css( element, property ), 10 ) || 0;\n}\n\nfunction getDimensions( elem ) {\n\tvar raw = elem[ 0 ];\n\tif ( raw.nodeType === 9 ) {\n\t\treturn {\n\t\t\twidth: elem.width(),\n\t\t\theight: elem.height(),\n\t\t\toffset: { top: 0, left: 0 }\n\t\t};\n\t}\n\tif ( $.isWindow( raw ) ) {\n\t\treturn {\n\t\t\twidth: elem.width(),\n\t\t\theight: elem.height(),\n\t\t\toffset: { top: elem.scrollTop(), left: elem.scrollLeft() }\n\t\t};\n\t}\n\tif ( raw.preventDefault ) {\n\t\treturn {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\toffset: { top: raw.pageY, left: raw.pageX }\n\t\t};\n\t}\n\treturn {\n\t\twidth: elem.outerWidth(),\n\t\theight: elem.outerHeight(),\n\t\toffset: elem.offset()\n\t};\n}\n\n$.position = {\n\tscrollbarWidth: function() {\n\t\tif ( cachedScrollbarWidth !== undefined ) {\n\t\t\treturn cachedScrollbarWidth;\n\t\t}\n\t\tvar w1, w2,\n\t\t\tdiv = $( \"<div \" +\n\t\t\t\t\"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>\" +\n\t\t\t\t\"<div style='height:100px;width:auto;'></div></div>\" ),\n\t\t\tinnerDiv = div.children()[ 0 ];\n\n\t\t$( \"body\" ).append( div );\n\t\tw1 = innerDiv.offsetWidth;\n\t\tdiv.css( \"overflow\", \"scroll\" );\n\n\t\tw2 = innerDiv.offsetWidth;\n\n\t\tif ( w1 === w2 ) {\n\t\t\tw2 = div[ 0 ].clientWidth;\n\t\t}\n\n\t\tdiv.remove();\n\n\t\treturn ( cachedScrollbarWidth = w1 - w2 );\n\t},\n\tgetScrollInfo: function( within ) {\n\t\tvar overflowX = within.isWindow || within.isDocument ? \"\" :\n\t\t\t\twithin.element.css( \"overflow-x\" ),\n\t\t\toverflowY = within.isWindow || within.isDocument ? \"\" :\n\t\t\t\twithin.element.css( \"overflow-y\" ),\n\t\t\thasOverflowX = overflowX === \"scroll\" ||\n\t\t\t\t( overflowX === \"auto\" && within.width < within.element[ 0 ].scrollWidth ),\n\t\t\thasOverflowY = overflowY === \"scroll\" ||\n\t\t\t\t( overflowY === \"auto\" && within.height < within.element[ 0 ].scrollHeight );\n\t\treturn {\n\t\t\twidth: hasOverflowY ? $.position.scrollbarWidth() : 0,\n\t\t\theight: hasOverflowX ? $.position.scrollbarWidth() : 0\n\t\t};\n\t},\n\tgetWithinInfo: function( element ) {\n\t\tvar withinElement = $( element || window ),\n\t\t\tisWindow = $.isWindow( withinElement[ 0 ] ),\n\t\t\tisDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,\n\t\t\thasOffset = !isWindow && !isDocument;\n\t\treturn {\n\t\t\telement: withinElement,\n\t\t\tisWindow: isWindow,\n\t\t\tisDocument: isDocument,\n\t\t\toffset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },\n\t\t\tscrollLeft: withinElement.scrollLeft(),\n\t\t\tscrollTop: withinElement.scrollTop(),\n\t\t\twidth: withinElement.outerWidth(),\n\t\t\theight: withinElement.outerHeight()\n\t\t};\n\t}\n};\n\n$.fn.position = function( options ) {\n\tif ( !options || !options.of ) {\n\t\treturn _position.apply( this, arguments );\n\t}\n\n\t// Make a copy, we don't want to modify arguments\n\toptions = $.extend( {}, options );\n\n\tvar atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,\n\t\ttarget = $( options.of ),\n\t\twithin = $.position.getWithinInfo( options.within ),\n\t\tscrollInfo = $.position.getScrollInfo( within ),\n\t\tcollision = ( options.collision || \"flip\" ).split( \" \" ),\n\t\toffsets = {};\n\n\tdimensions = getDimensions( target );\n\tif ( target[ 0 ].preventDefault ) {\n\n\t\t// Force left top to allow flipping\n\t\toptions.at = \"left top\";\n\t}\n\ttargetWidth = dimensions.width;\n\ttargetHeight = dimensions.height;\n\ttargetOffset = dimensions.offset;\n\n\t// Clone to reuse original targetOffset later\n\tbasePosition = $.extend( {}, targetOffset );\n\n\t// Force my and at to have valid horizontal and vertical positions\n\t// if a value is missing or invalid, it will be converted to center\n\t$.each( [ \"my\", \"at\" ], function() {\n\t\tvar pos = ( options[ this ] || \"\" ).split( \" \" ),\n\t\t\thorizontalOffset,\n\t\t\tverticalOffset;\n\n\t\tif ( pos.length === 1 ) {\n\t\t\tpos = rhorizontal.test( pos[ 0 ] ) ?\n\t\t\t\tpos.concat( [ \"center\" ] ) :\n\t\t\t\trvertical.test( pos[ 0 ] ) ?\n\t\t\t\t\t[ \"center\" ].concat( pos ) :\n\t\t\t\t\t[ \"center\", \"center\" ];\n\t\t}\n\t\tpos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : \"center\";\n\t\tpos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : \"center\";\n\n\t\t// Calculate offsets\n\t\thorizontalOffset = roffset.exec( pos[ 0 ] );\n\t\tverticalOffset = roffset.exec( pos[ 1 ] );\n\t\toffsets[ this ] = [\n\t\t\thorizontalOffset ? horizontalOffset[ 0 ] : 0,\n\t\t\tverticalOffset ? verticalOffset[ 0 ] : 0\n\t\t];\n\n\t\t// Reduce to just the positions without the offsets\n\t\toptions[ this ] = [\n\t\t\trposition.exec( pos[ 0 ] )[ 0 ],\n\t\t\trposition.exec( pos[ 1 ] )[ 0 ]\n\t\t];\n\t} );\n\n\t// Normalize collision option\n\tif ( collision.length === 1 ) {\n\t\tcollision[ 1 ] = collision[ 0 ];\n\t}\n\n\tif ( options.at[ 0 ] === \"right\" ) {\n\t\tbasePosition.left += targetWidth;\n\t} else if ( options.at[ 0 ] === \"center\" ) {\n\t\tbasePosition.left += targetWidth / 2;\n\t}\n\n\tif ( options.at[ 1 ] === \"bottom\" ) {\n\t\tbasePosition.top += targetHeight;\n\t} else if ( options.at[ 1 ] === \"center\" ) {\n\t\tbasePosition.top += targetHeight / 2;\n\t}\n\n\tatOffset = getOffsets( offsets.at, targetWidth, targetHeight );\n\tbasePosition.left += atOffset[ 0 ];\n\tbasePosition.top += atOffset[ 1 ];\n\n\treturn this.each( function() {\n\t\tvar collisionPosition, using,\n\t\t\telem = $( this ),\n\t\t\telemWidth = elem.outerWidth(),\n\t\t\telemHeight = elem.outerHeight(),\n\t\t\tmarginLeft = parseCss( this, \"marginLeft\" ),\n\t\t\tmarginTop = parseCss( this, \"marginTop\" ),\n\t\t\tcollisionWidth = elemWidth + marginLeft + parseCss( this, \"marginRight\" ) +\n\t\t\t\tscrollInfo.width,\n\t\t\tcollisionHeight = elemHeight + marginTop + parseCss( this, \"marginBottom\" ) +\n\t\t\t\tscrollInfo.height,\n\t\t\tposition = $.extend( {}, basePosition ),\n\t\t\tmyOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );\n\n\t\tif ( options.my[ 0 ] === \"right\" ) {\n\t\t\tposition.left -= elemWidth;\n\t\t} else if ( options.my[ 0 ] === \"center\" ) {\n\t\t\tposition.left -= elemWidth / 2;\n\t\t}\n\n\t\tif ( options.my[ 1 ] === \"bottom\" ) {\n\t\t\tposition.top -= elemHeight;\n\t\t} else if ( options.my[ 1 ] === \"center\" ) {\n\t\t\tposition.top -= elemHeight / 2;\n\t\t}\n\n\t\tposition.left += myOffset[ 0 ];\n\t\tposition.top += myOffset[ 1 ];\n\n\t\tcollisionPosition = {\n\t\t\tmarginLeft: marginLeft,\n\t\t\tmarginTop: marginTop\n\t\t};\n\n\t\t$.each( [ \"left\", \"top\" ], function( i, dir ) {\n\t\t\tif ( $.ui.position[ collision[ i ] ] ) {\n\t\t\t\t$.ui.position[ collision[ i ] ][ dir ]( position, {\n\t\t\t\t\ttargetWidth: targetWidth,\n\t\t\t\t\ttargetHeight: targetHeight,\n\t\t\t\t\telemWidth: elemWidth,\n\t\t\t\t\telemHeight: elemHeight,\n\t\t\t\t\tcollisionPosition: collisionPosition,\n\t\t\t\t\tcollisionWidth: collisionWidth,\n\t\t\t\t\tcollisionHeight: collisionHeight,\n\t\t\t\t\toffset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],\n\t\t\t\t\tmy: options.my,\n\t\t\t\t\tat: options.at,\n\t\t\t\t\twithin: within,\n\t\t\t\t\telem: elem\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tif ( options.using ) {\n\n\t\t\t// Adds feedback as second argument to using callback, if present\n\t\t\tusing = function( props ) {\n\t\t\t\tvar left = targetOffset.left - position.left,\n\t\t\t\t\tright = left + targetWidth - elemWidth,\n\t\t\t\t\ttop = targetOffset.top - position.top,\n\t\t\t\t\tbottom = top + targetHeight - elemHeight,\n\t\t\t\t\tfeedback = {\n\t\t\t\t\t\ttarget: {\n\t\t\t\t\t\t\telement: target,\n\t\t\t\t\t\t\tleft: targetOffset.left,\n\t\t\t\t\t\t\ttop: targetOffset.top,\n\t\t\t\t\t\t\twidth: targetWidth,\n\t\t\t\t\t\t\theight: targetHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\telement: {\n\t\t\t\t\t\t\telement: elem,\n\t\t\t\t\t\t\tleft: position.left,\n\t\t\t\t\t\t\ttop: position.top,\n\t\t\t\t\t\t\twidth: elemWidth,\n\t\t\t\t\t\t\theight: elemHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\thorizontal: right < 0 ? \"left\" : left > 0 ? \"right\" : \"center\",\n\t\t\t\t\t\tvertical: bottom < 0 ? \"top\" : top > 0 ? \"bottom\" : \"middle\"\n\t\t\t\t\t};\n\t\t\t\tif ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {\n\t\t\t\t\tfeedback.horizontal = \"center\";\n\t\t\t\t}\n\t\t\t\tif ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {\n\t\t\t\t\tfeedback.vertical = \"middle\";\n\t\t\t\t}\n\t\t\t\tif ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {\n\t\t\t\t\tfeedback.important = \"horizontal\";\n\t\t\t\t} else {\n\t\t\t\t\tfeedback.important = \"vertical\";\n\t\t\t\t}\n\t\t\t\toptions.using.call( this, props, feedback );\n\t\t\t};\n\t\t}\n\n\t\telem.offset( $.extend( position, { using: using } ) );\n\t} );\n};\n\n$.ui.position = {\n\tfit: {\n\t\tleft: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.isWindow ? within.scrollLeft : within.offset.left,\n\t\t\t\touterWidth = within.width,\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\n\t\t\t\toverLeft = withinOffset - collisionPosLeft,\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,\n\t\t\t\tnewOverRight;\n\n\t\t\t// Element is wider than within\n\t\t\tif ( data.collisionWidth > outerWidth ) {\n\n\t\t\t\t// Element is initially over the left side of within\n\t\t\t\tif ( overLeft > 0 && overRight <= 0 ) {\n\t\t\t\t\tnewOverRight = position.left + overLeft + data.collisionWidth - outerWidth -\n\t\t\t\t\t\twithinOffset;\n\t\t\t\t\tposition.left += overLeft - newOverRight;\n\n\t\t\t\t// Element is initially over right side of within\n\t\t\t\t} else if ( overRight > 0 && overLeft <= 0 ) {\n\t\t\t\t\tposition.left = withinOffset;\n\n\t\t\t\t// Element is initially over both left and right sides of within\n\t\t\t\t} else {\n\t\t\t\t\tif ( overLeft > overRight ) {\n\t\t\t\t\t\tposition.left = withinOffset + outerWidth - data.collisionWidth;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tposition.left = withinOffset;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Too far left -> align with left edge\n\t\t\t} else if ( overLeft > 0 ) {\n\t\t\t\tposition.left += overLeft;\n\n\t\t\t// Too far right -> align with right edge\n\t\t\t} else if ( overRight > 0 ) {\n\t\t\t\tposition.left -= overRight;\n\n\t\t\t// Adjust based on position and margin\n\t\t\t} else {\n\t\t\t\tposition.left = max( position.left - collisionPosLeft, position.left );\n\t\t\t}\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.isWindow ? within.scrollTop : within.offset.top,\n\t\t\t\touterHeight = data.within.height,\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\n\t\t\t\toverTop = withinOffset - collisionPosTop,\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,\n\t\t\t\tnewOverBottom;\n\n\t\t\t// Element is taller than within\n\t\t\tif ( data.collisionHeight > outerHeight ) {\n\n\t\t\t\t// Element is initially over the top of within\n\t\t\t\tif ( overTop > 0 && overBottom <= 0 ) {\n\t\t\t\t\tnewOverBottom = position.top + overTop + data.collisionHeight - outerHeight -\n\t\t\t\t\t\twithinOffset;\n\t\t\t\t\tposition.top += overTop - newOverBottom;\n\n\t\t\t\t// Element is initially over bottom of within\n\t\t\t\t} else if ( overBottom > 0 && overTop <= 0 ) {\n\t\t\t\t\tposition.top = withinOffset;\n\n\t\t\t\t// Element is initially over both top and bottom of within\n\t\t\t\t} else {\n\t\t\t\t\tif ( overTop > overBottom ) {\n\t\t\t\t\t\tposition.top = withinOffset + outerHeight - data.collisionHeight;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tposition.top = withinOffset;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Too far up -> align with top\n\t\t\t} else if ( overTop > 0 ) {\n\t\t\t\tposition.top += overTop;\n\n\t\t\t// Too far down -> align with bottom edge\n\t\t\t} else if ( overBottom > 0 ) {\n\t\t\t\tposition.top -= overBottom;\n\n\t\t\t// Adjust based on position and margin\n\t\t\t} else {\n\t\t\t\tposition.top = max( position.top - collisionPosTop, position.top );\n\t\t\t}\n\t\t}\n\t},\n\tflip: {\n\t\tleft: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.offset.left + within.scrollLeft,\n\t\t\t\touterWidth = within.width,\n\t\t\t\toffsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\n\t\t\t\toverLeft = collisionPosLeft - offsetLeft,\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,\n\t\t\t\tmyOffset = data.my[ 0 ] === \"left\" ?\n\t\t\t\t\t-data.elemWidth :\n\t\t\t\t\tdata.my[ 0 ] === \"right\" ?\n\t\t\t\t\t\tdata.elemWidth :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 0 ] === \"left\" ?\n\t\t\t\t\tdata.targetWidth :\n\t\t\t\t\tdata.at[ 0 ] === \"right\" ?\n\t\t\t\t\t\t-data.targetWidth :\n\t\t\t\t\t\t0,\n\t\t\t\toffset = -2 * data.offset[ 0 ],\n\t\t\t\tnewOverRight,\n\t\t\t\tnewOverLeft;\n\n\t\t\tif ( overLeft < 0 ) {\n\t\t\t\tnewOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -\n\t\t\t\t\touterWidth - withinOffset;\n\t\t\t\tif ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t} else if ( overRight > 0 ) {\n\t\t\t\tnewOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +\n\t\t\t\t\tatOffset + offset - offsetLeft;\n\t\t\t\tif ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.offset.top + within.scrollTop,\n\t\t\t\touterHeight = within.height,\n\t\t\t\toffsetTop = within.isWindow ? within.scrollTop : within.offset.top,\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\n\t\t\t\toverTop = collisionPosTop - offsetTop,\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,\n\t\t\t\ttop = data.my[ 1 ] === \"top\",\n\t\t\t\tmyOffset = top ?\n\t\t\t\t\t-data.elemHeight :\n\t\t\t\t\tdata.my[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\tdata.elemHeight :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 1 ] === \"top\" ?\n\t\t\t\t\tdata.targetHeight :\n\t\t\t\t\tdata.at[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\t-data.targetHeight :\n\t\t\t\t\t\t0,\n\t\t\t\toffset = -2 * data.offset[ 1 ],\n\t\t\t\tnewOverTop,\n\t\t\t\tnewOverBottom;\n\t\t\tif ( overTop < 0 ) {\n\t\t\t\tnewOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -\n\t\t\t\t\touterHeight - withinOffset;\n\t\t\t\tif ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t} else if ( overBottom > 0 ) {\n\t\t\t\tnewOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +\n\t\t\t\t\toffset - offsetTop;\n\t\t\t\tif ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tflipfit: {\n\t\tleft: function() {\n\t\t\t$.ui.position.flip.left.apply( this, arguments );\n\t\t\t$.ui.position.fit.left.apply( this, arguments );\n\t\t},\n\t\ttop: function() {\n\t\t\t$.ui.position.flip.top.apply( this, arguments );\n\t\t\t$.ui.position.fit.top.apply( this, arguments );\n\t\t}\n\t}\n};\n","import $ from \"jquery\";\nimport \"./version\";\n\n$.ui.safeActiveElement = function( document ) {\n\tvar activeElement;\n\n\t// Support: IE 9 only\n\t// IE9 throws an \"Unspecified error\" accessing document.activeElement from an <iframe>\n\ttry {\n\t\tactiveElement = document.activeElement;\n\t} catch ( error ) {\n\t\tactiveElement = document.body;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE may return null instead of an element\n\t// Interestingly, this only seems to occur when NOT in an iframe\n\tif ( !activeElement ) {\n\t\tactiveElement = document.body;\n\t}\n\n\t// Support: IE 11 only\n\t// IE11 returns a seemingly empty object in some cases when accessing\n\t// document.activeElement from an <iframe>\n\tif ( !activeElement.nodeName ) {\n\t\tactiveElement = document.body;\n\t}\n\n\treturn activeElement;\n};\n","/*!\n * jQuery UI Unique ID 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: uniqueId\n//>>group: Core\n//>>description: Functions to generate and remove uniqueId's\n//>>docs: http://api.jqueryui.com/uniqueId/\n\nimport $ from \"jquery\";\nimport \"./version\";\n\n$.fn.extend( {\n\tuniqueId: ( function() {\n\t\tvar uuid = 0;\n\n\t\treturn function() {\n\t\t\treturn this.each( function() {\n\t\t\t\tif ( !this.id ) {\n\t\t\t\t\tthis.id = \"ui-id-\" + ( ++uuid );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t} )(),\n\n\tremoveUniqueId: function() {\n\t\treturn this.each( function() {\n\t\t\tif ( /^ui-id-\\d+$/.test( this.id ) ) {\n\t\t\t\t$( this ).removeAttr( \"id\" );\n\t\t\t}\n\t\t} );\n\t}\n} );\n","/*!\n * jQuery UI Widget 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Widget\n//>>group: Core\n//>>description: Provides a factory for creating stateful widgets with a common API.\n//>>docs: http://api.jqueryui.com/jQuery.widget/\n//>>demos: http://jqueryui.com/widget/\n\nimport $ from \"jquery\";\nimport \"./version\";\nimport \"./core.css\";\n\nvar widgetUuid = 0;\nvar widgetSlice = Array.prototype.slice;\n\n$.cleanData = ( function( orig ) {\n\treturn function( elems ) {\n\t\tvar events, elem, i;\n\t\tfor ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\ttry {\n\n\t\t\t\t// Only trigger remove when necessary to save time\n\t\t\t\tevents = $._data( elem, \"events\" );\n\t\t\t\tif ( events && events.remove ) {\n\t\t\t\t\t$( elem ).triggerHandler( \"remove\" );\n\t\t\t\t}\n\n\t\t\t// Http://bugs.jquery.com/ticket/8235\n\t\t\t} catch ( e ) {}\n\t\t}\n\t\torig( elems );\n\t};\n} )( $.cleanData );\n\n$.widget = function( name, base, prototype ) {\n\tvar existingConstructor, constructor, basePrototype;\n\n\t// ProxiedPrototype allows the provided prototype to remain unmodified\n\t// so that it can be used as a mixin for multiple widgets (#8876)\n\tvar proxiedPrototype = {};\n\n\tvar namespace = name.split( \".\" )[ 0 ];\n\tname = name.split( \".\" )[ 1 ];\n\tvar fullName = namespace + \"-\" + name;\n\n\tif ( !prototype ) {\n\t\tprototype = base;\n\t\tbase = $.Widget;\n\t}\n\n\tif ( $.isArray( prototype ) ) {\n\t\tprototype = $.extend.apply( null, [ {} ].concat( prototype ) );\n\t}\n\n\t// Create selector for plugin\n\t$.expr[ \":\" ][ fullName.toLowerCase() ] = function( elem ) {\n\t\treturn !!$.data( elem, fullName );\n\t};\n\n\t$[ namespace ] = $[ namespace ] || {};\n\texistingConstructor = $[ namespace ][ name ];\n\tconstructor = $[ namespace ][ name ] = function( options, element ) {\n\n\t\t// Allow instantiation without \"new\" keyword\n\t\tif ( !this._createWidget ) {\n\t\t\treturn new constructor( options, element );\n\t\t}\n\n\t\t// Allow instantiation without initializing for simple inheritance\n\t\t// must use \"new\" keyword (the code above always passes args)\n\t\tif ( arguments.length ) {\n\t\t\tthis._createWidget( options, element );\n\t\t}\n\t};\n\n\t// Extend with the existing constructor to carry over any static properties\n\t$.extend( constructor, existingConstructor, {\n\t\tversion: prototype.version,\n\n\t\t// Copy the object used to create the prototype in case we need to\n\t\t// redefine the widget later\n\t\t_proto: $.extend( {}, prototype ),\n\n\t\t// Track widgets that inherit from this widget in case this widget is\n\t\t// redefined after a widget inherits from it\n\t\t_childConstructors: []\n\t} );\n\n\tbasePrototype = new base();\n\n\t// We need to make the options hash a property directly on the new instance\n\t// otherwise we'll modify the options hash on the prototype that we're\n\t// inheriting from\n\tbasePrototype.options = $.widget.extend( {}, basePrototype.options );\n\t$.each( prototype, function( prop, value ) {\n\t\tif ( !$.isFunction( value ) ) {\n\t\t\tproxiedPrototype[ prop ] = value;\n\t\t\treturn;\n\t\t}\n\t\tproxiedPrototype[ prop ] = ( function() {\n\t\t\tfunction _super() {\n\t\t\t\treturn base.prototype[ prop ].apply( this, arguments );\n\t\t\t}\n\n\t\t\tfunction _superApply( args ) {\n\t\t\t\treturn base.prototype[ prop ].apply( this, args );\n\t\t\t}\n\n\t\t\treturn function() {\n\t\t\t\tvar __super = this._super;\n\t\t\t\tvar __superApply = this._superApply;\n\t\t\t\tvar returnValue;\n\n\t\t\t\tthis._super = _super;\n\t\t\t\tthis._superApply = _superApply;\n\n\t\t\t\treturnValue = value.apply( this, arguments );\n\n\t\t\t\tthis._super = __super;\n\t\t\t\tthis._superApply = __superApply;\n\n\t\t\t\treturn returnValue;\n\t\t\t};\n\t\t} )();\n\t} );\n\tconstructor.prototype = $.widget.extend( basePrototype, {\n\n\t\t// TODO: remove support for widgetEventPrefix\n\t\t// always use the name + a colon as the prefix, e.g., draggable:start\n\t\t// don't prefix for widgets that aren't DOM-based\n\t\twidgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name\n\t}, proxiedPrototype, {\n\t\tconstructor: constructor,\n\t\tnamespace: namespace,\n\t\twidgetName: name,\n\t\twidgetFullName: fullName\n\t} );\n\n\t// If this widget is being redefined then we need to find all widgets that\n\t// are inheriting from it and redefine all of them so that they inherit from\n\t// the new version of this widget. We're essentially trying to replace one\n\t// level in the prototype chain.\n\tif ( existingConstructor ) {\n\t\t$.each( existingConstructor._childConstructors, function( i, child ) {\n\t\t\tvar childPrototype = child.prototype;\n\n\t\t\t// Redefine the child widget using the same prototype that was\n\t\t\t// originally used, but inherit from the new version of the base\n\t\t\t$.widget( childPrototype.namespace + \".\" + childPrototype.widgetName, constructor,\n\t\t\t\tchild._proto );\n\t\t} );\n\n\t\t// Remove the list of existing child constructors from the old constructor\n\t\t// so the old child constructors can be garbage collected\n\t\tdelete existingConstructor._childConstructors;\n\t} else {\n\t\tbase._childConstructors.push( constructor );\n\t}\n\n\t$.widget.bridge( name, constructor );\n\n\treturn constructor;\n};\n\n$.widget.extend = function( target ) {\n\tvar input = widgetSlice.call( arguments, 1 );\n\tvar inputIndex = 0;\n\tvar inputLength = input.length;\n\tvar key;\n\tvar value;\n\n\tfor ( ; inputIndex < inputLength; inputIndex++ ) {\n\t\tfor ( key in input[ inputIndex ] ) {\n\t\t\tvalue = input[ inputIndex ][ key ];\n\t\t\tif ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {\n\n\t\t\t\t// Clone objects\n\t\t\t\tif ( $.isPlainObject( value ) ) {\n\t\t\t\t\ttarget[ key ] = $.isPlainObject( target[ key ] ) ?\n\t\t\t\t\t\t$.widget.extend( {}, target[ key ], value ) :\n\n\t\t\t\t\t\t// Don't extend strings, arrays, etc. with objects\n\t\t\t\t\t\t$.widget.extend( {}, value );\n\n\t\t\t\t// Copy everything else by reference\n\t\t\t\t} else {\n\t\t\t\t\ttarget[ key ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn target;\n};\n\n$.widget.bridge = function( name, object ) {\n\tvar fullName = object.prototype.widgetFullName || name;\n\t$.fn[ name ] = function( options ) {\n\t\tvar isMethodCall = typeof options === \"string\";\n\t\tvar args = widgetSlice.call( arguments, 1 );\n\t\tvar returnValue = this;\n\n\t\tif ( isMethodCall ) {\n\n\t\t\t// If this is an empty collection, we need to have the instance method\n\t\t\t// return undefined instead of the jQuery instance\n\t\t\tif ( !this.length && options === \"instance\" ) {\n\t\t\t\treturnValue = undefined;\n\t\t\t} else {\n\t\t\t\tthis.each( function() {\n\t\t\t\t\tvar methodValue;\n\t\t\t\t\tvar instance = $.data( this, fullName );\n\n\t\t\t\t\tif ( options === \"instance\" ) {\n\t\t\t\t\t\treturnValue = instance;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !instance ) {\n\t\t\t\t\t\treturn $.error( \"cannot call methods on \" + name +\n\t\t\t\t\t\t\t\" prior to initialization; \" +\n\t\t\t\t\t\t\t\"attempted to call method '\" + options + \"'\" );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === \"_\" ) {\n\t\t\t\t\t\treturn $.error( \"no such method '\" + options + \"' for \" + name +\n\t\t\t\t\t\t\t\" widget instance\" );\n\t\t\t\t\t}\n\n\t\t\t\t\tmethodValue = instance[ options ].apply( instance, args );\n\n\t\t\t\t\tif ( methodValue !== instance && methodValue !== undefined ) {\n\t\t\t\t\t\treturnValue = methodValue && methodValue.jquery ?\n\t\t\t\t\t\t\treturnValue.pushStack( methodValue.get() ) :\n\t\t\t\t\t\t\tmethodValue;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Allow multiple hashes to be passed on init\n\t\t\tif ( args.length ) {\n\t\t\t\toptions = $.widget.extend.apply( null, [ options ].concat( args ) );\n\t\t\t}\n\n\t\t\tthis.each( function() {\n\t\t\t\tvar instance = $.data( this, fullName );\n\t\t\t\tif ( instance ) {\n\t\t\t\t\tinstance.option( options || {} );\n\t\t\t\t\tif ( instance._init ) {\n\t\t\t\t\t\tinstance._init();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$.data( this, fullName, new object( options, this ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn returnValue;\n\t};\n};\n\n$.Widget = function( /* options, element */ ) {};\n$.Widget._childConstructors = [];\n\n$.Widget.prototype = {\n\twidgetName: \"widget\",\n\twidgetEventPrefix: \"\",\n\tdefaultElement: \"<div>\",\n\n\toptions: {\n\t\tclasses: {},\n\t\tdisabled: false,\n\n\t\t// Callbacks\n\t\tcreate: null\n\t},\n\n\t_createWidget: function( options, element ) {\n\t\telement = $( element || this.defaultElement || this )[ 0 ];\n\t\tthis.element = $( element );\n\t\tthis.uuid = widgetUuid++;\n\t\tthis.eventNamespace = \".\" + this.widgetName + this.uuid;\n\n\t\tthis.bindings = $();\n\t\tthis.hoverable = $();\n\t\tthis.focusable = $();\n\t\tthis.classesElementLookup = {};\n\n\t\tif ( element !== this ) {\n\t\t\t$.data( element, this.widgetFullName, this );\n\t\t\tthis._on( true, this.element, {\n\t\t\t\tremove: function( event ) {\n\t\t\t\t\tif ( event.target === element ) {\n\t\t\t\t\t\tthis.destroy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t\tthis.document = $( element.style ?\n\n\t\t\t\t// Element within the document\n\t\t\t\telement.ownerDocument :\n\n\t\t\t\t// Element is window or document\n\t\t\t\telement.document || element );\n\t\t\tthis.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );\n\t\t}\n\n\t\tthis.options = $.widget.extend( {},\n\t\t\tthis.options,\n\t\t\tthis._getCreateOptions(),\n\t\t\toptions );\n\n\t\tthis._create();\n\n\t\tif ( this.options.disabled ) {\n\t\t\tthis._setOptionDisabled( this.options.disabled );\n\t\t}\n\n\t\tthis._trigger( \"create\", null, this._getCreateEventData() );\n\t\tthis._init();\n\t},\n\n\t_getCreateOptions: function() {\n\t\treturn {};\n\t},\n\n\t_getCreateEventData: $.noop,\n\n\t_create: $.noop,\n\n\t_init: $.noop,\n\n\tdestroy: function() {\n\t\tvar that = this;\n\n\t\tthis._destroy();\n\t\t$.each( this.classesElementLookup, function( key, value ) {\n\t\t\tthat._removeClass( value, key );\n\t\t} );\n\n\t\t// We can probably remove the unbind calls in 2.0\n\t\t// all event bindings should go through this._on()\n\t\tthis.element\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeData( this.widgetFullName );\n\t\tthis.widget()\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeAttr( \"aria-disabled\" );\n\n\t\t// Clean up events and states\n\t\tthis.bindings.off( this.eventNamespace );\n\t},\n\n\t_destroy: $.noop,\n\n\twidget: function() {\n\t\treturn this.element;\n\t},\n\n\toption: function( key, value ) {\n\t\tvar options = key;\n\t\tvar parts;\n\t\tvar curOption;\n\t\tvar i;\n\n\t\tif ( arguments.length === 0 ) {\n\n\t\t\t// Don't return a reference to the internal hash\n\t\t\treturn $.widget.extend( {}, this.options );\n\t\t}\n\n\t\tif ( typeof key === \"string\" ) {\n\n\t\t\t// Handle nested keys, e.g., \"foo.bar\" => { foo: { bar: ___ } }\n\t\t\toptions = {};\n\t\t\tparts = key.split( \".\" );\n\t\t\tkey = parts.shift();\n\t\t\tif ( parts.length ) {\n\t\t\t\tcurOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );\n\t\t\t\tfor ( i = 0; i < parts.length - 1; i++ ) {\n\t\t\t\t\tcurOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};\n\t\t\t\t\tcurOption = curOption[ parts[ i ] ];\n\t\t\t\t}\n\t\t\t\tkey = parts.pop();\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn curOption[ key ] === undefined ? null : curOption[ key ];\n\t\t\t\t}\n\t\t\t\tcurOption[ key ] = value;\n\t\t\t} else {\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn this.options[ key ] === undefined ? null : this.options[ key ];\n\t\t\t\t}\n\t\t\t\toptions[ key ] = value;\n\t\t\t}\n\t\t}\n\n\t\tthis._setOptions( options );\n\n\t\treturn this;\n\t},\n\n\t_setOptions: function( options ) {\n\t\tvar key;\n\n\t\tfor ( key in options ) {\n\t\t\tthis._setOption( key, options[ key ] );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === \"classes\" ) {\n\t\t\tthis._setOptionClasses( value );\n\t\t}\n\n\t\tthis.options[ key ] = value;\n\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis._setOptionDisabled( value );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOptionClasses: function( value ) {\n\t\tvar classKey, elements, currentElements;\n\n\t\tfor ( classKey in value ) {\n\t\t\tcurrentElements = this.classesElementLookup[ classKey ];\n\t\t\tif ( value[ classKey ] === this.options.classes[ classKey ] ||\n\t\t\t\t\t!currentElements ||\n\t\t\t\t\t!currentElements.length ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// We are doing this to create a new jQuery object because the _removeClass() call\n\t\t\t// on the next line is going to destroy the reference to the current elements being\n\t\t\t// tracked. We need to save a copy of this collection so that we can add the new classes\n\t\t\t// below.\n\t\t\telements = $( currentElements.get() );\n\t\t\tthis._removeClass( currentElements, classKey );\n\n\t\t\t// We don't use _addClass() here, because that uses this.options.classes\n\t\t\t// for generating the string of classes. We want to use the value passed in from\n\t\t\t// _setOption(), this is the new value of the classes option which was passed to\n\t\t\t// _setOption(). We pass this value directly to _classes().\n\t\t\telements.addClass( this._classes( {\n\t\t\t\telement: elements,\n\t\t\t\tkeys: classKey,\n\t\t\t\tclasses: value,\n\t\t\t\tadd: true\n\t\t\t} ) );\n\t\t}\n\t},\n\n\t_setOptionDisabled: function( value ) {\n\t\tthis._toggleClass( this.widget(), this.widgetFullName + \"-disabled\", null, !!value );\n\n\t\t// If the widget is becoming disabled, then nothing is interactive\n\t\tif ( value ) {\n\t\t\tthis._removeClass( this.hoverable, null, \"ui-state-hover\" );\n\t\t\tthis._removeClass( this.focusable, null, \"ui-state-focus\" );\n\t\t}\n\t},\n\n\tenable: function() {\n\t\treturn this._setOptions( { disabled: false } );\n\t},\n\n\tdisable: function() {\n\t\treturn this._setOptions( { disabled: true } );\n\t},\n\n\t_classes: function( options ) {\n\t\tvar full = [];\n\t\tvar that = this;\n\n\t\toptions = $.extend( {\n\t\t\telement: this.element,\n\t\t\tclasses: this.options.classes || {}\n\t\t}, options );\n\n\t\tfunction processClassString( classes, checkOption ) {\n\t\t\tvar current, i;\n\t\t\tfor ( i = 0; i < classes.length; i++ ) {\n\t\t\t\tcurrent = that.classesElementLookup[ classes[ i ] ] || $();\n\t\t\t\tif ( options.add ) {\n\t\t\t\t\tcurrent = $( $.unique( current.get().concat( options.element.get() ) ) );\n\t\t\t\t} else {\n\t\t\t\t\tcurrent = $( current.not( options.element ).get() );\n\t\t\t\t}\n\t\t\t\tthat.classesElementLookup[ classes[ i ] ] = current;\n\t\t\t\tfull.push( classes[ i ] );\n\t\t\t\tif ( checkOption && options.classes[ classes[ i ] ] ) {\n\t\t\t\t\tfull.push( options.classes[ classes[ i ] ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._on( options.element, {\n\t\t\t\"remove\": \"_untrackClassesElement\"\n\t\t} );\n\n\t\tif ( options.keys ) {\n\t\t\tprocessClassString( options.keys.match( /\\S+/g ) || [], true );\n\t\t}\n\t\tif ( options.extra ) {\n\t\t\tprocessClassString( options.extra.match( /\\S+/g ) || [] );\n\t\t}\n\n\t\treturn full.join( \" \" );\n\t},\n\n\t_untrackClassesElement: function( event ) {\n\t\tvar that = this;\n\t\t$.each( that.classesElementLookup, function( key, value ) {\n\t\t\tif ( $.inArray( event.target, value ) !== -1 ) {\n\t\t\t\tthat.classesElementLookup[ key ] = $( value.not( event.target ).get() );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_removeClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, false );\n\t},\n\n\t_addClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, true );\n\t},\n\n\t_toggleClass: function( element, keys, extra, add ) {\n\t\tadd = ( typeof add === \"boolean\" ) ? add : extra;\n\t\tvar shift = ( typeof element === \"string\" || element === null ),\n\t\t\toptions = {\n\t\t\t\textra: shift ? keys : extra,\n\t\t\t\tkeys: shift ? element : keys,\n\t\t\t\telement: shift ? this.element : element,\n\t\t\t\tadd: add\n\t\t\t};\n\t\toptions.element.toggleClass( this._classes( options ), add );\n\t\treturn this;\n\t},\n\n\t_on: function( suppressDisabledCheck, element, handlers ) {\n\t\tvar delegateElement;\n\t\tvar instance = this;\n\n\t\t// No suppressDisabledCheck flag, shuffle arguments\n\t\tif ( typeof suppressDisabledCheck !== \"boolean\" ) {\n\t\t\thandlers = element;\n\t\t\telement = suppressDisabledCheck;\n\t\t\tsuppressDisabledCheck = false;\n\t\t}\n\n\t\t// No element argument, shuffle and use this.element\n\t\tif ( !handlers ) {\n\t\t\thandlers = element;\n\t\t\telement = this.element;\n\t\t\tdelegateElement = this.widget();\n\t\t} else {\n\t\t\telement = delegateElement = $( element );\n\t\t\tthis.bindings = this.bindings.add( element );\n\t\t}\n\n\t\t$.each( handlers, function( event, handler ) {\n\t\t\tfunction handlerProxy() {\n\n\t\t\t\t// Allow widgets to customize the disabled handling\n\t\t\t\t// - disabled as an array instead of boolean\n\t\t\t\t// - disabled class as method for disabling individual parts\n\t\t\t\tif ( !suppressDisabledCheck &&\n\t\t\t\t\t\t( instance.options.disabled === true ||\n\t\t\t\t\t\t$( this ).hasClass( \"ui-state-disabled\" ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t\t.apply( instance, arguments );\n\t\t\t}\n\n\t\t\t// Copy the guid so direct unbinding works\n\t\t\tif ( typeof handler !== \"string\" ) {\n\t\t\t\thandlerProxy.guid = handler.guid =\n\t\t\t\t\thandler.guid || handlerProxy.guid || $.guid++;\n\t\t\t}\n\n\t\t\tvar match = event.match( /^([\\w:-]*)\\s*(.*)$/ );\n\t\t\tvar eventName = match[ 1 ] + instance.eventNamespace;\n\t\t\tvar selector = match[ 2 ];\n\n\t\t\tif ( selector ) {\n\t\t\t\tdelegateElement.on( eventName, selector, handlerProxy );\n\t\t\t} else {\n\t\t\t\telement.on( eventName, handlerProxy );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_off: function( element, eventName ) {\n\t\teventName = ( eventName || \"\" ).split( \" \" ).join( this.eventNamespace + \" \" ) +\n\t\t\tthis.eventNamespace;\n\t\telement.off( eventName ).off( eventName );\n\n\t\t// Clear the stack to avoid memory leaks (#10056)\n\t\tthis.bindings = $( this.bindings.not( element ).get() );\n\t\tthis.focusable = $( this.focusable.not( element ).get() );\n\t\tthis.hoverable = $( this.hoverable.not( element ).get() );\n\t},\n\n\t_delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_hoverable: function( element ) {\n\t\tthis.hoverable = this.hoverable.add( element );\n\t\tthis._on( element, {\n\t\t\tmouseenter: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, \"ui-state-hover\" );\n\t\t\t},\n\t\t\tmouseleave: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, \"ui-state-hover\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_focusable: function( element ) {\n\t\tthis.focusable = this.focusable.add( element );\n\t\tthis._on( element, {\n\t\t\tfocusin: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, \"ui-state-focus\" );\n\t\t\t},\n\t\t\tfocusout: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, \"ui-state-focus\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_trigger: function( type, event, data ) {\n\t\tvar prop, orig;\n\t\tvar callback = this.options[ type ];\n\n\t\tdata = data || {};\n\t\tevent = $.Event( event );\n\t\tevent.type = ( type === this.widgetEventPrefix ?\n\t\t\ttype :\n\t\t\tthis.widgetEventPrefix + type ).toLowerCase();\n\n\t\t// The original event may come from any element\n\t\t// so we need to reset the target on the new event\n\t\tevent.target = this.element[ 0 ];\n\n\t\t// Copy original event properties over to the new event\n\t\torig = event.originalEvent;\n\t\tif ( orig ) {\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tif ( !( prop in event ) ) {\n\t\t\t\t\tevent[ prop ] = orig[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.element.trigger( event, data );\n\t\treturn !( $.isFunction( callback ) &&\n\t\t\tcallback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||\n\t\t\tevent.isDefaultPrevented() );\n\t}\n};\n\n$.each( { show: \"fadeIn\", hide: \"fadeOut\" }, function( method, defaultEffect ) {\n\t$.Widget.prototype[ \"_\" + method ] = function( element, options, callback ) {\n\t\tif ( typeof options === \"string\" ) {\n\t\t\toptions = { effect: options };\n\t\t}\n\n\t\tvar hasOptions;\n\t\tvar effectName = !options ?\n\t\t\tmethod :\n\t\t\toptions === true || typeof options === \"number\" ?\n\t\t\t\tdefaultEffect :\n\t\t\t\toptions.effect || defaultEffect;\n\n\t\toptions = options || {};\n\t\tif ( typeof options === \"number\" ) {\n\t\t\toptions = { duration: options };\n\t\t}\n\n\t\thasOptions = !$.isEmptyObject( options );\n\t\toptions.complete = callback;\n\n\t\tif ( options.delay ) {\n\t\t\telement.delay( options.delay );\n\t\t}\n\n\t\tif ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {\n\t\t\telement[ method ]( options );\n\t\t} else if ( effectName !== method && element[ effectName ] ) {\n\t\t\telement[ effectName ]( options.duration, options.easing, callback );\n\t\t} else {\n\t\t\telement.queue( function( next ) {\n\t\t\t\t$( this )[ method ]();\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback.call( element[ 0 ] );\n\t\t\t\t}\n\t\t\t\tnext();\n\t\t\t} );\n\t\t}\n\t};\n} );\n","/*!\n * jQuery UI Selectmenu 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Selectmenu\n//>>group: Widgets\n// jscs:disable maximumLineLength\n//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.\n// jscs:enable maximumLineLength\n//>>docs: http://api.jqueryui.com/selectmenu/\n//>>demos: http://jqueryui.com/selectmenu/\n//>>css.structure: ../../themes/base/core.css\n//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css\n//>>css.theme: ../../themes/base/theme.css\n\nimport $ from \"jquery\";\nimport \"./menu\";\nimport \"../escape-selector\";\nimport \"../form-reset-mixin\";\nimport \"../keycode\";\nimport \"../labels\";\nimport \"../position\";\nimport \"../unique-id\";\nimport \"../version\";\nimport \"../widget\";\n\n$.widget( \"ui.selectmenu\", [ $.ui.formResetMixin, {\n\tversion: \"1.12.1\",\n\tdefaultElement: \"<select>\",\n\toptions: {\n\t\tappendTo: null,\n\t\tclasses: {\n\t\t\t\"ui-selectmenu-button-open\": \"ui-corner-top\",\n\t\t\t\"ui-selectmenu-button-closed\": \"ui-corner-all\"\n\t\t},\n\t\tdisabled: null,\n\t\ticons: {\n\t\t\tbutton: \"ui-icon-triangle-1-s\"\n\t\t},\n\t\tposition: {\n\t\t\tmy: \"left top\",\n\t\t\tat: \"left bottom\",\n\t\t\tcollision: \"none\"\n\t\t},\n\t\twidth: false,\n\n\t\t// Callbacks\n\t\tchange: null,\n\t\tclose: null,\n\t\tfocus: null,\n\t\topen: null,\n\t\tselect: null\n\t},\n\n\t_create: function() {\n\t\tvar selectmenuId = this.element.uniqueId().attr( \"id\" );\n\t\tthis.ids = {\n\t\t\telement: selectmenuId,\n\t\t\tbutton: selectmenuId + \"-button\",\n\t\t\tmenu: selectmenuId + \"-menu\"\n\t\t};\n\n\t\tthis._drawButton();\n\t\tthis._drawMenu();\n\t\tthis._bindFormResetHandler();\n\n\t\tthis._rendered = false;\n\t\tthis.menuItems = $();\n\t},\n\n\t_drawButton: function() {\n\t\tvar icon,\n\t\t\tthat = this,\n\t\t\titem = this._parseOption(\n\t\t\t\tthis.element.find( \"option:selected\" ),\n\t\t\t\tthis.element[ 0 ].selectedIndex\n\t\t\t);\n\n\t\t// Associate existing label with the new button\n\t\tthis.labels = this.element.labels().attr( \"for\", this.ids.button );\n\t\tthis._on( this.labels, {\n\t\t\tclick: function( event ) {\n\t\t\t\tthis.button.focus();\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} );\n\n\t\t// Hide original select element\n\t\tthis.element.hide();\n\n\t\t// Create button\n\t\tthis.button = $( \"<span>\", {\n\t\t\ttabindex: this.options.disabled ? -1 : 0,\n\t\t\tid: this.ids.button,\n\t\t\trole: \"combobox\",\n\t\t\t\"aria-expanded\": \"false\",\n\t\t\t\"aria-autocomplete\": \"list\",\n\t\t\t\"aria-owns\": this.ids.menu,\n\t\t\t\"aria-haspopup\": \"true\",\n\t\t\ttitle: this.element.attr( \"title\" )\n\t\t} )\n\t\t\t.insertAfter( this.element );\n\n\t\tthis._addClass( this.button, \"ui-selectmenu-button ui-selectmenu-button-closed\",\n\t\t\t\"ui-button ui-widget\" );\n\n\t\ticon = $( \"<span>\" ).appendTo( this.button );\n\t\tthis._addClass( icon, \"ui-selectmenu-icon\", \"ui-icon \" + this.options.icons.button );\n\t\tthis.buttonItem = this._renderButtonItem( item )\n\t\t\t.appendTo( this.button );\n\n\t\tif ( this.options.width !== false ) {\n\t\t\tthis._resizeButton();\n\t\t}\n\n\t\tthis._on( this.button, this._buttonEvents );\n\t\tthis.button.one( \"focusin\", function() {\n\n\t\t\t// Delay rendering the menu items until the button receives focus.\n\t\t\t// The menu may have already been rendered via a programmatic open.\n\t\t\tif ( !that._rendered ) {\n\t\t\t\tthat._refreshMenu();\n\t\t\t}\n\t\t} );\n\t},\n\n\t_drawMenu: function() {\n\t\tvar that = this;\n\n\t\t// Create menu\n\t\tthis.menu = $( \"<ul>\", {\n\t\t\t\"aria-hidden\": \"true\",\n\t\t\t\"aria-labelledby\": this.ids.button,\n\t\t\tid: this.ids.menu\n\t\t} );\n\n\t\t// Wrap menu\n\t\tthis.menuWrap = $( \"<div>\" ).append( this.menu );\n\t\tthis._addClass( this.menuWrap, \"ui-selectmenu-menu\", \"ui-front\" );\n\t\tthis.menuWrap.appendTo( this._appendTo() );\n\n\t\t// Initialize menu widget\n\t\tthis.menuInstance = this.menu\n\t\t\t.menu( {\n\t\t\t\tclasses: {\n\t\t\t\t\t\"ui-menu\": \"ui-corner-bottom\"\n\t\t\t\t},\n\t\t\t\trole: \"listbox\",\n\t\t\t\tselect: function( event, ui ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// Support: IE8\n\t\t\t\t\t// If the item was selected via a click, the text selection\n\t\t\t\t\t// will be destroyed in IE\n\t\t\t\t\tthat._setSelection();\n\n\t\t\t\t\tthat._select( ui.item.data( \"ui-selectmenu-item\" ), event );\n\t\t\t\t},\n\t\t\t\tfocus: function( event, ui ) {\n\t\t\t\t\tvar item = ui.item.data( \"ui-selectmenu-item\" );\n\n\t\t\t\t\t// Prevent inital focus from firing and check if its a newly focused item\n\t\t\t\t\tif ( that.focusIndex != null && item.index !== that.focusIndex ) {\n\t\t\t\t\t\tthat._trigger( \"focus\", event, { item: item } );\n\t\t\t\t\t\tif ( !that.isOpen ) {\n\t\t\t\t\t\t\tthat._select( item, event );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthat.focusIndex = item.index;\n\n\t\t\t\t\tthat.button.attr( \"aria-activedescendant\",\n\t\t\t\t\t\tthat.menuItems.eq( item.index ).attr( \"id\" ) );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.menu( \"instance\" );\n\n\t\t// Don't close the menu on mouseleave\n\t\tthis.menuInstance._off( this.menu, \"mouseleave\" );\n\n\t\t// Cancel the menu's collapseAll on document click\n\t\tthis.menuInstance._closeOnDocumentClick = function() {\n\t\t\treturn false;\n\t\t};\n\n\t\t// Selects often contain empty items, but never contain dividers\n\t\tthis.menuInstance._isDivider = function() {\n\t\t\treturn false;\n\t\t};\n\t},\n\n\trefresh: function() {\n\t\tthis._refreshMenu();\n\t\tthis.buttonItem.replaceWith(\n\t\t\tthis.buttonItem = this._renderButtonItem(\n\n\t\t\t\t// Fall back to an empty object in case there are no options\n\t\t\t\tthis._getSelectedItem().data( \"ui-selectmenu-item\" ) || {}\n\t\t\t)\n\t\t);\n\t\tif ( this.options.width === null ) {\n\t\t\tthis._resizeButton();\n\t\t}\n\t},\n\n\t_refreshMenu: function() {\n\t\tvar item,\n\t\t\toptions = this.element.find( \"option\" );\n\n\t\tthis.menu.empty();\n\n\t\tthis._parseOptions( options );\n\t\tthis._renderMenu( this.menu, this.items );\n\n\t\tthis.menuInstance.refresh();\n\t\tthis.menuItems = this.menu.find( \"li\" )\n\t\t\t.not( \".ui-selectmenu-optgroup\" )\n\t\t\t\t.find( \".ui-menu-item-wrapper\" );\n\n\t\tthis._rendered = true;\n\n\t\tif ( !options.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\titem = this._getSelectedItem();\n\n\t\t// Update the menu to have the correct item focused\n\t\tthis.menuInstance.focus( null, item );\n\t\tthis._setAria( item.data( \"ui-selectmenu-item\" ) );\n\n\t\t// Set disabled state\n\t\tthis._setOption( \"disabled\", this.element.prop( \"disabled\" ) );\n\t},\n\n\topen: function( event ) {\n\t\tif ( this.options.disabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If this is the first time the menu is being opened, render the items\n\t\tif ( !this._rendered ) {\n\t\t\tthis._refreshMenu();\n\t\t} else {\n\n\t\t\t// Menu clears focus on close, reset focus to selected item\n\t\t\tthis._removeClass( this.menu.find( \".ui-state-active\" ), null, \"ui-state-active\" );\n\t\t\tthis.menuInstance.focus( null, this._getSelectedItem() );\n\t\t}\n\n\t\t// If there are no options, don't open the menu\n\t\tif ( !this.menuItems.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isOpen = true;\n\t\tthis._toggleAttr();\n\t\tthis._resizeMenu();\n\t\tthis._position();\n\n\t\tthis._on( this.document, this._documentClick );\n\n\t\tthis._trigger( \"open\", event );\n\t},\n\n\t_position: function() {\n\t\tthis.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );\n\t},\n\n\tclose: function( event ) {\n\t\tif ( !this.isOpen ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isOpen = false;\n\t\tthis._toggleAttr();\n\n\t\tthis.range = null;\n\t\tthis._off( this.document );\n\n\t\tthis._trigger( \"close\", event );\n\t},\n\n\twidget: function() {\n\t\treturn this.button;\n\t},\n\n\tmenuWidget: function() {\n\t\treturn this.menu;\n\t},\n\n\t_renderButtonItem: function( item ) {\n\t\tvar buttonItem = $( \"<span>\" );\n\n\t\tthis._setText( buttonItem, item.label );\n\t\tthis._addClass( buttonItem, \"ui-selectmenu-text\" );\n\n\t\treturn buttonItem;\n\t},\n\n\t_renderMenu: function( ul, items ) {\n\t\tvar that = this,\n\t\t\tcurrentOptgroup = \"\";\n\n\t\t$.each( items, function( index, item ) {\n\t\t\tvar li;\n\n\t\t\tif ( item.optgroup !== currentOptgroup ) {\n\t\t\t\tli = $( \"<li>\", {\n\t\t\t\t\ttext: item.optgroup\n\t\t\t\t} );\n\t\t\t\tthat._addClass( li, \"ui-selectmenu-optgroup\", \"ui-menu-divider\" +\n\t\t\t\t\t( item.element.parent( \"optgroup\" ).prop( \"disabled\" ) ?\n\t\t\t\t\t\t\" ui-state-disabled\" :\n\t\t\t\t\t\t\"\" ) );\n\n\t\t\t\tli.appendTo( ul );\n\n\t\t\t\tcurrentOptgroup = item.optgroup;\n\t\t\t}\n\n\t\t\tthat._renderItemData( ul, item );\n\t\t} );\n\t},\n\n\t_renderItemData: function( ul, item ) {\n\t\treturn this._renderItem( ul, item ).data( \"ui-selectmenu-item\", item );\n\t},\n\n\t_renderItem: function( ul, item ) {\n\t\tvar li = $( \"<li>\" ),\n\t\t\twrapper = $( \"<div>\", {\n\t\t\t\ttitle: item.element.attr( \"title\" )\n\t\t\t} );\n\n\t\tif ( item.disabled ) {\n\t\t\tthis._addClass( li, null, \"ui-state-disabled\" );\n\t\t}\n\t\tthis._setText( wrapper, item.label );\n\n\t\treturn li.append( wrapper ).appendTo( ul );\n\t},\n\n\t_setText: function( element, value ) {\n\t\tif ( value ) {\n\t\t\telement.text( value );\n\t\t} else {\n\t\t\telement.html( \" \" );\n\t\t}\n\t},\n\n\t_move: function( direction, event ) {\n\t\tvar item, next,\n\t\t\tfilter = \".ui-menu-item\";\n\n\t\tif ( this.isOpen ) {\n\t\t\titem = this.menuItems.eq( this.focusIndex ).parent( \"li\" );\n\t\t} else {\n\t\t\titem = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( \"li\" );\n\t\t\tfilter += \":not(.ui-state-disabled)\";\n\t\t}\n\n\t\tif ( direction === \"first\" || direction === \"last\" ) {\n\t\t\tnext = item[ direction === \"first\" ? \"prevAll\" : \"nextAll\" ]( filter ).eq( -1 );\n\t\t} else {\n\t\t\tnext = item[ direction + \"All\" ]( filter ).eq( 0 );\n\t\t}\n\n\t\tif ( next.length ) {\n\t\t\tthis.menuInstance.focus( event, next );\n\t\t}\n\t},\n\n\t_getSelectedItem: function() {\n\t\treturn this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( \"li\" );\n\t},\n\n\t_toggle: function( event ) {\n\t\tthis[ this.isOpen ? \"close\" : \"open\" ]( event );\n\t},\n\n\t_setSelection: function() {\n\t\tvar selection;\n\n\t\tif ( !this.range ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( window.getSelection ) {\n\t\t\tselection = window.getSelection();\n\t\t\tselection.removeAllRanges();\n\t\t\tselection.addRange( this.range );\n\n\t\t// Support: IE8\n\t\t} else {\n\t\t\tthis.range.select();\n\t\t}\n\n\t\t// Support: IE\n\t\t// Setting the text selection kills the button focus in IE, but\n\t\t// restoring the focus doesn't kill the selection.\n\t\tthis.button.focus();\n\t},\n\n\t_documentClick: {\n\t\tmousedown: function( event ) {\n\t\t\tif ( !this.isOpen ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( !$( event.target ).closest( \".ui-selectmenu-menu, #\" +\n\t\t\t\t\t$.ui.escapeSelector( this.ids.button ) ).length ) {\n\t\t\t\tthis.close( event );\n\t\t\t}\n\t\t}\n\t},\n\n\t_buttonEvents: {\n\n\t\t// Prevent text selection from being reset when interacting with the selectmenu (#10144)\n\t\tmousedown: function() {\n\t\t\tvar selection;\n\n\t\t\tif ( window.getSelection ) {\n\t\t\t\tselection = window.getSelection();\n\t\t\t\tif ( selection.rangeCount ) {\n\t\t\t\t\tthis.range = selection.getRangeAt( 0 );\n\t\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t} else {\n\t\t\t\tthis.range = document.selection.createRange();\n\t\t\t}\n\t\t},\n\n\t\tclick: function( event ) {\n\t\t\tthis._setSelection();\n\t\t\tthis._toggle( event );\n\t\t},\n\n\t\tkeydown: function( event ) {\n\t\t\tvar preventDefault = true;\n\t\t\tswitch ( event.keyCode ) {\n\t\t\tcase $.ui.keyCode.TAB:\n\t\t\tcase $.ui.keyCode.ESCAPE:\n\t\t\t\tthis.close( event );\n\t\t\t\tpreventDefault = false;\n\t\t\t\tbreak;\n\t\t\tcase $.ui.keyCode.ENTER:\n\t\t\t\tif ( this.isOpen ) {\n\t\t\t\t\tthis._selectFocusedItem( event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase $.ui.keyCode.UP:\n\t\t\t\tif ( event.altKey ) {\n\t\t\t\t\tthis._toggle( event );\n\t\t\t\t} else {\n\t\t\t\t\tthis._move( \"prev\", event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase $.ui.keyCode.DOWN:\n\t\t\t\tif ( event.altKey ) {\n\t\t\t\t\tthis._toggle( event );\n\t\t\t\t} else {\n\t\t\t\t\tthis._move( \"next\", event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase $.ui.keyCode.SPACE:\n\t\t\t\tif ( this.isOpen ) {\n\t\t\t\t\tthis._selectFocusedItem( event );\n\t\t\t\t} else {\n\t\t\t\t\tthis._toggle( event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase $.ui.keyCode.LEFT:\n\t\t\t\tthis._move( \"prev\", event );\n\t\t\t\tbreak;\n\t\t\tcase $.ui.keyCode.RIGHT:\n\t\t\t\tthis._move( \"next\", event );\n\t\t\t\tbreak;\n\t\t\tcase $.ui.keyCode.HOME:\n\t\t\tcase $.ui.keyCode.PAGE_UP:\n\t\t\t\tthis._move( \"first\", event );\n\t\t\t\tbreak;\n\t\t\tcase $.ui.keyCode.END:\n\t\t\tcase $.ui.keyCode.PAGE_DOWN:\n\t\t\t\tthis._move( \"last\", event );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.menu.trigger( event );\n\t\t\t\tpreventDefault = false;\n\t\t\t}\n\n\t\t\tif ( preventDefault ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t},\n\n\t_selectFocusedItem: function( event ) {\n\t\tvar item = this.menuItems.eq( this.focusIndex ).parent( \"li\" );\n\t\tif ( !item.hasClass( \"ui-state-disabled\" ) ) {\n\t\t\tthis._select( item.data( \"ui-selectmenu-item\" ), event );\n\t\t}\n\t},\n\n\t_select: function( item, event ) {\n\t\tvar oldIndex = this.element[ 0 ].selectedIndex;\n\n\t\t// Change native select element\n\t\tthis.element[ 0 ].selectedIndex = item.index;\n\t\tthis.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );\n\t\tthis._setAria( item );\n\t\tthis._trigger( \"select\", event, { item: item } );\n\n\t\tif ( item.index !== oldIndex ) {\n\t\t\tthis._trigger( \"change\", event, { item: item } );\n\t\t}\n\n\t\tthis.close( event );\n\t},\n\n\t_setAria: function( item ) {\n\t\tvar id = this.menuItems.eq( item.index ).attr( \"id\" );\n\n\t\tthis.button.attr( {\n\t\t\t\"aria-labelledby\": id,\n\t\t\t\"aria-activedescendant\": id\n\t\t} );\n\t\tthis.menu.attr( \"aria-activedescendant\", id );\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === \"icons\" ) {\n\t\t\tvar icon = this.button.find( \"span.ui-icon\" );\n\t\t\tthis._removeClass( icon, null, this.options.icons.button )\n\t\t\t\t._addClass( icon, null, value.button );\n\t\t}\n\n\t\tthis._super( key, value );\n\n\t\tif ( key === \"appendTo\" ) {\n\t\t\tthis.menuWrap.appendTo( this._appendTo() );\n\t\t}\n\n\t\tif ( key === \"width\" ) {\n\t\t\tthis._resizeButton();\n\t\t}\n\t},\n\n\t_setOptionDisabled: function( value ) {\n\t\tthis._super( value );\n\n\t\tthis.menuInstance.option( \"disabled\", value );\n\t\tthis.button.attr( \"aria-disabled\", value );\n\t\tthis._toggleClass( this.button, null, \"ui-state-disabled\", value );\n\n\t\tthis.element.prop( \"disabled\", value );\n\t\tif ( value ) {\n\t\t\tthis.button.attr( \"tabindex\", -1 );\n\t\t\tthis.close();\n\t\t} else {\n\t\t\tthis.button.attr( \"tabindex\", 0 );\n\t\t}\n\t},\n\n\t_appendTo: function() {\n\t\tvar element = this.options.appendTo;\n\n\t\tif ( element ) {\n\t\t\telement = element.jquery || element.nodeType ?\n\t\t\t\t$( element ) :\n\t\t\t\tthis.document.find( element ).eq( 0 );\n\t\t}\n\n\t\tif ( !element || !element[ 0 ] ) {\n\t\t\telement = this.element.closest( \".ui-front, dialog\" );\n\t\t}\n\n\t\tif ( !element.length ) {\n element = $( \"<div>\" ).css( \"position\", \"absolute\" ).appendTo( this.document[ 0 ].body );\n\t\t}\n\n\t\treturn element;\n\t},\n\n\t_toggleAttr: function() {\n\t\tthis.button.attr( \"aria-expanded\", this.isOpen );\n\n\t\t// We can't use two _toggleClass() calls here, because we need to make sure\n\t\t// we always remove classes first and add them second, otherwise if both classes have the\n\t\t// same theme class, it will be removed after we add it.\n\t\tthis._removeClass( this.button, \"ui-selectmenu-button-\" +\n\t\t\t( this.isOpen ? \"closed\" : \"open\" ) )\n\t\t\t._addClass( this.button, \"ui-selectmenu-button-\" +\n\t\t\t\t( this.isOpen ? \"open\" : \"closed\" ) )\n\t\t\t._toggleClass( this.menuWrap, \"ui-selectmenu-open\", null, this.isOpen );\n\n\t\tthis.menu.attr( \"aria-hidden\", !this.isOpen );\n\t},\n\n\t_resizeButton: function() {\n\t\tvar width = this.options.width;\n\n\t\t// For `width: false`, just remove inline style and stop\n\t\tif ( width === false ) {\n\t\t\tthis.button.css( \"width\", \"\" );\n\t\t\treturn;\n\t\t}\n\n\t\t// For `width: null`, match the width of the original element\n\t\tif ( width === null ) {\n\t\t\twidth = this.element.show().outerWidth();\n\t\t\tthis.element.hide();\n\t\t}\n\n\t\tthis.button.outerWidth( width );\n\t},\n\n\t_resizeMenu: function() {\n\t\tthis.menu.outerWidth( Math.max(\n\t\t\tthis.button.outerWidth(),\n\n\t\t\t// Support: IE10\n\t\t\t// IE10 wraps long text (possibly a rounding bug)\n\t\t\t// so we add 1px to avoid the wrapping\n\t\t\tthis.menu.width( \"\" ).outerWidth() + 1\n\t\t) );\n\t},\n\n\t_getCreateOptions: function() {\n\t\tvar options = this._super();\n\n\t\toptions.disabled = this.element.prop( \"disabled\" );\n\n\t\treturn options;\n\t},\n\n\t_parseOptions: function( options ) {\n\t\tvar that = this,\n\t\t\tdata = [];\n\t\toptions.each( function( index, item ) {\n\t\t\tdata.push( that._parseOption( $( item ), index ) );\n\t\t} );\n\t\tthis.items = data;\n\t},\n\n\t_parseOption: function( option, index ) {\n\t\tvar optgroup = option.parent( \"optgroup\" );\n\n\t\treturn {\n\t\t\telement: option,\n\t\t\tindex: index,\n\t\t\tvalue: option.val(),\n\t\t\tlabel: option.text(),\n\t\t\toptgroup: optgroup.attr( \"label\" ) || \"\",\n\t\t\tdisabled: optgroup.prop( \"disabled\" ) || option.prop( \"disabled\" )\n\t\t};\n\t},\n\n\t_destroy: function() {\n\t\tthis._unbindFormResetHandler();\n\t\tthis.menuWrap.remove();\n\t\tthis.button.remove();\n\t\tthis.element.show();\n\t\tthis.element.removeUniqueId();\n\t\tthis.labels.attr( \"for\", this.ids.element );\n\t}\n} ] );\n\nexport default $.ui.selectmenu;\n","import $ from \"jquery\";\nimport \"./version\";\n\n// Internal use only\n$.ui.escapeSelector = ( function() {\n\tvar selectorEscape = /([!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~])/g;\n\treturn function( selector ) {\n\t\treturn selector.replace( selectorEscape, \"\\\\$1\" );\n\t};\n} )();\n","/*!\n * jQuery UI Form Reset Mixin 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Form Reset Mixin\n//>>group: Core\n//>>description: Refresh input widgets when their form is reset\n//>>docs: http://api.jqueryui.com/form-reset-mixin/\n\nimport $ from \"jquery\";\nimport \"./form\";\nimport \"./version\";\n\n$.ui.formResetMixin = {\n\t_formResetHandler: function() {\n\t\tvar form = $( this );\n\n\t\t// Wait for the form reset to actually happen before refreshing\n\t\tsetTimeout( function() {\n\t\t\tvar instances = form.data( \"ui-form-reset-instances\" );\n\t\t\t$.each( instances, function() {\n\t\t\t\tthis.refresh();\n\t\t\t} );\n\t\t} );\n\t},\n\n\t_bindFormResetHandler: function() {\n\t\tthis.form = this.element.form();\n\t\tif ( !this.form.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar instances = this.form.data( \"ui-form-reset-instances\" ) || [];\n\t\tif ( !instances.length ) {\n\n\t\t\t// We don't use _on() here because we use a single event handler per form\n\t\t\tthis.form.on( \"reset.ui-form-reset\", this._formResetHandler );\n\t\t}\n\t\tinstances.push( this );\n\t\tthis.form.data( \"ui-form-reset-instances\", instances );\n\t},\n\n\t_unbindFormResetHandler: function() {\n\t\tif ( !this.form.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar instances = this.form.data( \"ui-form-reset-instances\" );\n\t\tinstances.splice( $.inArray( this, instances ), 1 );\n\t\tif ( instances.length ) {\n\t\t\tthis.form.data( \"ui-form-reset-instances\", instances );\n\t\t} else {\n\t\t\tthis.form\n\t\t\t\t.removeData( \"ui-form-reset-instances\" )\n\t\t\t\t.off( \"reset.ui-form-reset\" );\n\t\t}\n\t}\n};\n","import $ from \"jquery\";\nimport \"./version\";\n\n// Support: IE8 Only\n// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop\n// with a string, so we need to find the proper form.\n$.fn.form = function() {\n\treturn typeof this[ 0 ].form === \"string\" ? this.closest( \"form\" ) : $( this[ 0 ].form );\n};\n","/*!\n * jQuery UI Labels 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: labels\n//>>group: Core\n//>>description: Find all the labels associated with a given input\n//>>docs: http://api.jqueryui.com/labels/\n\nimport $ from \"jquery\";\nimport \"./escape-selector\";\nimport \"./version\";\n\n$.fn.labels = function() {\n\tvar ancestor, selector, id, labels, ancestors;\n\n\t// Check control.labels first\n\tif ( this[ 0 ].labels && this[ 0 ].labels.length ) {\n\t\treturn this.pushStack( this[ 0 ].labels );\n\t}\n\n\t// Support: IE <= 11, FF <= 37, Android <= 2.3 only\n\t// Above browsers do not support control.labels. Everything below is to support them\n\t// as well as document fragments. control.labels does not work on document fragments\n\tlabels = this.eq( 0 ).parents( \"label\" );\n\n\t// Look for the label based on the id\n\tid = this.attr( \"id\" );\n\tif ( id ) {\n\n\t\t// We don't search against the document in case the element\n\t\t// is disconnected from the DOM\n\t\tancestor = this.eq( 0 ).parents().last();\n\n\t\t// Get a full set of top level ancestors\n\t\tancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );\n\n\t\t// Create a selector for the label based on the id\n\t\tselector = \"label[for='\" + $.ui.escapeSelector( id ) + \"']\";\n\n\t\tlabels = labels.add( ancestors.find( selector ).addBack( selector ) );\n\n\t}\n\n\t// Return whatever we have found for labels\n\treturn this.pushStack( labels );\n};\n","/*!\n * jQuery UI Slider 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Slider\n//>>group: Widgets\n//>>description: Displays a flexible slider with ranges and accessibility via keyboard.\n//>>docs: http://api.jqueryui.com/slider/\n//>>demos: http://jqueryui.com/slider/\n//>>css.structure: ../../themes/base/core.css\n//>>css.structure: ../../themes/base/slider.css\n//>>css.theme: ../../themes/base/theme.css\n\nimport $ from \"jquery\";\nimport \"./mouse\";\nimport \"../keycode\";\nimport \"../version\";\nimport \"../widget\";\n\n$.widget( \"ui.slider\", $.ui.mouse, {\n\tversion: \"1.12.1\",\n\twidgetEventPrefix: \"slide\",\n\n\toptions: {\n\t\tanimate: false,\n\t\tclasses: {\n\t\t\t\"ui-slider\": \"ui-corner-all\",\n\t\t\t\"ui-slider-handle\": \"ui-corner-all\",\n\n\t\t\t// Note: ui-widget-header isn't the most fittingly semantic framework class for this\n\t\t\t// element, but worked best visually with a variety of themes\n\t\t\t\"ui-slider-range\": \"ui-corner-all ui-widget-header\"\n\t\t},\n\t\tdistance: 0,\n\t\tmax: 100,\n\t\tmin: 0,\n\t\torientation: \"horizontal\",\n\t\trange: false,\n\t\tstep: 1,\n\t\tvalue: 0,\n\t\tvalues: null,\n\n\t\t// Callbacks\n\t\tchange: null,\n\t\tslide: null,\n\t\tstart: null,\n\t\tstop: null\n\t},\n\n\t// Number of pages in a slider\n\t// (how many times can you page up/down to go through the whole range)\n\tnumPages: 5,\n\n\t_create: function() {\n\t\tthis._keySliding = false;\n\t\tthis._mouseSliding = false;\n\t\tthis._animateOff = true;\n\t\tthis._handleIndex = null;\n\t\tthis._detectOrientation();\n\t\tthis._mouseInit();\n\t\tthis._calculateNewMax();\n\n\t\tthis._addClass( \"ui-slider ui-slider-\" + this.orientation,\n\t\t\t\"ui-widget ui-widget-content\" );\n\n\t\tthis._refresh();\n\n\t\tthis._animateOff = false;\n\t},\n\n\t_refresh: function() {\n\t\tthis._createRange();\n\t\tthis._createHandles();\n\t\tthis._setupEvents();\n\t\tthis._refreshValue();\n\t},\n\n\t_createHandles: function() {\n\t\tvar i, handleCount,\n\t\t\toptions = this.options,\n\t\t\texistingHandles = this.element.find( \".ui-slider-handle\" ),\n\t\t\thandle = \"<span tabindex='0'></span>\",\n\t\t\thandles = [];\n\n\t\thandleCount = ( options.values && options.values.length ) || 1;\n\n\t\tif ( existingHandles.length > handleCount ) {\n\t\t\texistingHandles.slice( handleCount ).remove();\n\t\t\texistingHandles = existingHandles.slice( 0, handleCount );\n\t\t}\n\n\t\tfor ( i = existingHandles.length; i < handleCount; i++ ) {\n\t\t\thandles.push( handle );\n\t\t}\n\n\t\tthis.handles = existingHandles.add( $( handles.join( \"\" ) ).appendTo( this.element ) );\n\n\t\tthis._addClass( this.handles, \"ui-slider-handle\", \"ui-state-default\" );\n\n\t\tthis.handle = this.handles.eq( 0 );\n\n\t\tthis.handles.each( function( i ) {\n\t\t\t$( this )\n\t\t\t\t.data( \"ui-slider-handle-index\", i )\n\t\t\t\t.attr( \"tabIndex\", 0 );\n\t\t} );\n\t},\n\n\t_createRange: function() {\n\t\tvar options = this.options;\n\n\t\tif ( options.range ) {\n\t\t\tif ( options.range === true ) {\n\t\t\t\tif ( !options.values ) {\n\t\t\t\t\toptions.values = [ this._valueMin(), this._valueMin() ];\n\t\t\t\t} else if ( options.values.length && options.values.length !== 2 ) {\n\t\t\t\t\toptions.values = [ options.values[ 0 ], options.values[ 0 ] ];\n\t\t\t\t} else if ( $.isArray( options.values ) ) {\n\t\t\t\t\toptions.values = options.values.slice( 0 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !this.range || !this.range.length ) {\n\t\t\t\tthis.range = $( \"<div>\" )\n\t\t\t\t\t.appendTo( this.element );\n\n\t\t\t\tthis._addClass( this.range, \"ui-slider-range\" );\n\t\t\t} else {\n\t\t\t\tthis._removeClass( this.range, \"ui-slider-range-min ui-slider-range-max\" );\n\n\t\t\t\t// Handle range switching from true to min/max\n\t\t\t\tthis.range.css( {\n\t\t\t\t\t\"left\": \"\",\n\t\t\t\t\t\"bottom\": \"\"\n\t\t\t\t} );\n\t\t\t}\n\t\t\tif ( options.range === \"min\" || options.range === \"max\" ) {\n\t\t\t\tthis._addClass( this.range, \"ui-slider-range-\" + options.range );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( this.range ) {\n\t\t\t\tthis.range.remove();\n\t\t\t}\n\t\t\tthis.range = null;\n\t\t}\n\t},\n\n\t_setupEvents: function() {\n\t\tthis._off( this.handles );\n\t\tthis._on( this.handles, this._handleEvents );\n\t\tthis._hoverable( this.handles );\n\t\tthis._focusable( this.handles );\n\t},\n\n\t_destroy: function() {\n\t\tthis.handles.remove();\n\t\tif ( this.range ) {\n\t\t\tthis.range.remove();\n\t\t}\n\n\t\tthis._mouseDestroy();\n\t},\n\n\t_mouseCapture: function( event ) {\n\t\tvar position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,\n\t\t\tthat = this,\n\t\t\to = this.options;\n\n\t\tif ( o.disabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.elementSize = {\n\t\t\twidth: this.element.outerWidth(),\n\t\t\theight: this.element.outerHeight()\n\t\t};\n\t\tthis.elementOffset = this.element.offset();\n\n\t\tposition = { x: event.pageX, y: event.pageY };\n\t\tnormValue = this._normValueFromMouse( position );\n\t\tdistance = this._valueMax() - this._valueMin() + 1;\n\t\tthis.handles.each( function( i ) {\n\t\t\tvar thisDistance = Math.abs( normValue - that.values( i ) );\n\t\t\tif ( ( distance > thisDistance ) ||\n\t\t\t\t( distance === thisDistance &&\n\t\t\t\t\t( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) {\n\t\t\t\tdistance = thisDistance;\n\t\t\t\tclosestHandle = $( this );\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t} );\n\n\t\tallowed = this._start( event, index );\n\t\tif ( allowed === false ) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._mouseSliding = true;\n\n\t\tthis._handleIndex = index;\n\n\t\tthis._addClass( closestHandle, null, \"ui-state-active\" );\n\t\tclosestHandle.trigger( \"focus\" );\n\n\t\toffset = closestHandle.offset();\n\t\tmouseOverHandle = !$( event.target ).parents().addBack().is( \".ui-slider-handle\" );\n\t\tthis._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {\n\t\t\tleft: event.pageX - offset.left - ( closestHandle.width() / 2 ),\n\t\t\ttop: event.pageY - offset.top -\n\t\t\t\t( closestHandle.height() / 2 ) -\n\t\t\t\t( parseInt( closestHandle.css( \"borderTopWidth\" ), 10 ) || 0 ) -\n\t\t\t\t( parseInt( closestHandle.css( \"borderBottomWidth\" ), 10 ) || 0 ) +\n\t\t\t\t( parseInt( closestHandle.css( \"marginTop\" ), 10 ) || 0 )\n\t\t};\n\n\t\tif ( !this.handles.hasClass( \"ui-state-hover\" ) ) {\n\t\t\tthis._slide( event, index, normValue );\n\t\t}\n\t\tthis._animateOff = true;\n\t\treturn true;\n\t},\n\n\t_mouseStart: function() {\n\t\treturn true;\n\t},\n\n\t_mouseDrag: function( event ) {\n\t\tvar position = { x: event.pageX, y: event.pageY },\n\t\t\tnormValue = this._normValueFromMouse( position );\n\n\t\tthis._slide( event, this._handleIndex, normValue );\n\n\t\treturn false;\n\t},\n\n\t_mouseStop: function( event ) {\n\t\tthis._removeClass( this.handles, null, \"ui-state-active\" );\n\t\tthis._mouseSliding = false;\n\n\t\tthis._stop( event, this._handleIndex );\n\t\tthis._change( event, this._handleIndex );\n\n\t\tthis._handleIndex = null;\n\t\tthis._clickOffset = null;\n\t\tthis._animateOff = false;\n\n\t\treturn false;\n\t},\n\n\t_detectOrientation: function() {\n\t\tthis.orientation = ( this.options.orientation === \"vertical\" ) ? \"vertical\" : \"horizontal\";\n\t},\n\n\t_normValueFromMouse: function( position ) {\n\t\tvar pixelTotal,\n\t\t\tpixelMouse,\n\t\t\tpercentMouse,\n\t\t\tvalueTotal,\n\t\t\tvalueMouse;\n\n\t\tif ( this.orientation === \"horizontal\" ) {\n\t\t\tpixelTotal = this.elementSize.width;\n\t\t\tpixelMouse = position.x - this.elementOffset.left -\n\t\t\t\t( this._clickOffset ? this._clickOffset.left : 0 );\n\t\t} else {\n\t\t\tpixelTotal = this.elementSize.height;\n\t\t\tpixelMouse = position.y - this.elementOffset.top -\n\t\t\t\t( this._clickOffset ? this._clickOffset.top : 0 );\n\t\t}\n\n\t\tpercentMouse = ( pixelMouse / pixelTotal );\n\t\tif ( percentMouse > 1 ) {\n\t\t\tpercentMouse = 1;\n\t\t}\n\t\tif ( percentMouse < 0 ) {\n\t\t\tpercentMouse = 0;\n\t\t}\n\t\tif ( this.orientation === \"vertical\" ) {\n\t\t\tpercentMouse = 1 - percentMouse;\n\t\t}\n\n\t\tvalueTotal = this._valueMax() - this._valueMin();\n\t\tvalueMouse = this._valueMin() + percentMouse * valueTotal;\n\n\t\treturn this._trimAlignValue( valueMouse );\n\t},\n\n\t_uiHash: function( index, value, values ) {\n\t\tvar uiHash = {\n\t\t\thandle: this.handles[ index ],\n\t\t\thandleIndex: index,\n\t\t\tvalue: value !== undefined ? value : this.value()\n\t\t};\n\n\t\tif ( this._hasMultipleValues() ) {\n\t\t\tuiHash.value = value !== undefined ? value : this.values( index );\n\t\t\tuiHash.values = values || this.values();\n\t\t}\n\n\t\treturn uiHash;\n\t},\n\n\t_hasMultipleValues: function() {\n\t\treturn this.options.values && this.options.values.length;\n\t},\n\n\t_start: function( event, index ) {\n\t\treturn this._trigger( \"start\", event, this._uiHash( index ) );\n\t},\n\n\t_slide: function( event, index, newVal ) {\n\t\tvar allowed, otherVal,\n\t\t\tcurrentValue = this.value(),\n\t\t\tnewValues = this.values();\n\n\t\tif ( this._hasMultipleValues() ) {\n\t\t\totherVal = this.values( index ? 0 : 1 );\n\t\t\tcurrentValue = this.values( index );\n\n\t\t\tif ( this.options.values.length === 2 && this.options.range === true ) {\n\t\t\t\tnewVal = index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal );\n\t\t\t}\n\n\t\t\tnewValues[ index ] = newVal;\n\t\t}\n\n\t\tif ( newVal === currentValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\tallowed = this._trigger( \"slide\", event, this._uiHash( index, newVal, newValues ) );\n\n\t\t// A slide can be canceled by returning false from the slide callback\n\t\tif ( allowed === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._hasMultipleValues() ) {\n\t\t\tthis.values( index, newVal );\n\t\t} else {\n\t\t\tthis.value( newVal );\n\t\t}\n\t},\n\n\t_stop: function( event, index ) {\n\t\tthis._trigger( \"stop\", event, this._uiHash( index ) );\n\t},\n\n\t_change: function( event, index ) {\n\t\tif ( !this._keySliding && !this._mouseSliding ) {\n\n\t\t\t//store the last changed value index for reference when handles overlap\n\t\t\tthis._lastChangedValue = index;\n\t\t\tthis._trigger( \"change\", event, this._uiHash( index ) );\n\t\t}\n\t},\n\n\tvalue: function( newValue ) {\n\t\tif ( arguments.length ) {\n\t\t\tthis.options.value = this._trimAlignValue( newValue );\n\t\t\tthis._refreshValue();\n\t\t\tthis._change( null, 0 );\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._value();\n\t},\n\n\tvalues: function( index, newValue ) {\n\t\tvar vals,\n\t\t\tnewValues,\n\t\t\ti;\n\n\t\tif ( arguments.length > 1 ) {\n\t\t\tthis.options.values[ index ] = this._trimAlignValue( newValue );\n\t\t\tthis._refreshValue();\n\t\t\tthis._change( null, index );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( arguments.length ) {\n\t\t\tif ( $.isArray( arguments[ 0 ] ) ) {\n\t\t\t\tvals = this.options.values;\n\t\t\t\tnewValues = arguments[ 0 ];\n\t\t\t\tfor ( i = 0; i < vals.length; i += 1 ) {\n\t\t\t\t\tvals[ i ] = this._trimAlignValue( newValues[ i ] );\n\t\t\t\t\tthis._change( null, i );\n\t\t\t\t}\n\t\t\t\tthis._refreshValue();\n\t\t\t} else {\n\t\t\t\tif ( this._hasMultipleValues() ) {\n\t\t\t\t\treturn this._values( index );\n\t\t\t\t} else {\n\t\t\t\t\treturn this.value();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._values();\n\t\t}\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tvar i,\n\t\t\tvalsLength = 0;\n\n\t\tif ( key === \"range\" && this.options.range === true ) {\n\t\t\tif ( value === \"min\" ) {\n\t\t\t\tthis.options.value = this._values( 0 );\n\t\t\t\tthis.options.values = null;\n\t\t\t} else if ( value === \"max\" ) {\n\t\t\t\tthis.options.value = this._values( this.options.values.length - 1 );\n\t\t\t\tthis.options.values = null;\n\t\t\t}\n\t\t}\n\n\t\tif ( $.isArray( this.options.values ) ) {\n\t\t\tvalsLength = this.options.values.length;\n\t\t}\n\n\t\tthis._super( key, value );\n\n\t\tswitch ( key ) {\n\t\t\tcase \"orientation\":\n\t\t\t\tthis._detectOrientation();\n\t\t\t\tthis._removeClass( \"ui-slider-horizontal ui-slider-vertical\" )\n\t\t\t\t\t._addClass( \"ui-slider-\" + this.orientation );\n\t\t\t\tthis._refreshValue();\n\t\t\t\tif ( this.options.range ) {\n\t\t\t\t\tthis._refreshRange( value );\n\t\t\t\t}\n\n\t\t\t\t// Reset positioning from previous orientation\n\t\t\t\tthis.handles.css( value === \"horizontal\" ? \"bottom\" : \"left\", \"\" );\n\t\t\t\tbreak;\n\t\t\tcase \"value\":\n\t\t\t\tthis._animateOff = true;\n\t\t\t\tthis._refreshValue();\n\t\t\t\tthis._change( null, 0 );\n\t\t\t\tthis._animateOff = false;\n\t\t\t\tbreak;\n\t\t\tcase \"values\":\n\t\t\t\tthis._animateOff = true;\n\t\t\t\tthis._refreshValue();\n\n\t\t\t\t// Start from the last handle to prevent unreachable handles (#9046)\n\t\t\t\tfor ( i = valsLength - 1; i >= 0; i-- ) {\n\t\t\t\t\tthis._change( null, i );\n\t\t\t\t}\n\t\t\t\tthis._animateOff = false;\n\t\t\t\tbreak;\n\t\t\tcase \"step\":\n\t\t\tcase \"min\":\n\t\t\tcase \"max\":\n\t\t\t\tthis._animateOff = true;\n\t\t\t\tthis._calculateNewMax();\n\t\t\t\tthis._refreshValue();\n\t\t\t\tthis._animateOff = false;\n\t\t\t\tbreak;\n\t\t\tcase \"range\":\n\t\t\t\tthis._animateOff = true;\n\t\t\t\tthis._refresh();\n\t\t\t\tthis._animateOff = false;\n\t\t\t\tbreak;\n\t\t}\n\t},\n\n\t_setOptionDisabled: function( value ) {\n\t\tthis._super( value );\n\n\t\tthis._toggleClass( null, \"ui-state-disabled\", !!value );\n\t},\n\n\t//internal value getter\n\t// _value() returns value trimmed by min and max, aligned by step\n\t_value: function() {\n\t\tvar val = this.options.value;\n\t\tval = this._trimAlignValue( val );\n\n\t\treturn val;\n\t},\n\n\t//internal values getter\n\t// _values() returns array of values trimmed by min and max, aligned by step\n\t// _values( index ) returns single value trimmed by min and max, aligned by step\n\t_values: function( index ) {\n\t\tvar val,\n\t\t\tvals,\n\t\t\ti;\n\n\t\tif ( arguments.length ) {\n\t\t\tval = this.options.values[ index ];\n\t\t\tval = this._trimAlignValue( val );\n\n\t\t\treturn val;\n\t\t} else if ( this._hasMultipleValues() ) {\n\n\t\t\t// .slice() creates a copy of the array\n\t\t\t// this copy gets trimmed by min and max and then returned\n\t\t\tvals = this.options.values.slice();\n\t\t\tfor ( i = 0; i < vals.length; i += 1 ) {\n\t\t\t\tvals[ i ] = this._trimAlignValue( vals[ i ] );\n\t\t\t}\n\n\t\t\treturn vals;\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t},\n\n\t// Returns the step-aligned value that val is closest to, between (inclusive) min and max\n\t_trimAlignValue: function( val ) {\n\t\tif ( val <= this._valueMin() ) {\n\t\t\treturn this._valueMin();\n\t\t}\n\t\tif ( val >= this._valueMax() ) {\n\t\t\treturn this._valueMax();\n\t\t}\n\t\tvar step = ( this.options.step > 0 ) ? this.options.step : 1,\n\t\t\tvalModStep = ( val - this._valueMin() ) % step,\n\t\t\talignValue = val - valModStep;\n\n\t\tif ( Math.abs( valModStep ) * 2 >= step ) {\n\t\t\talignValue += ( valModStep > 0 ) ? step : ( -step );\n\t\t}\n\n\t\t// Since JavaScript has problems with large floats, round\n\t\t// the final value to 5 digits after the decimal point (see #4124)\n\t\treturn parseFloat( alignValue.toFixed( 5 ) );\n\t},\n\n\t_calculateNewMax: function() {\n\t\tvar max = this.options.max,\n\t\t\tmin = this._valueMin(),\n\t\t\tstep = this.options.step,\n\t\t\taboveMin = Math.round( ( max - min ) / step ) * step;\n\t\tmax = aboveMin + min;\n\t\tif ( max > this.options.max ) {\n\n\t\t\t//If max is not divisible by step, rounding off may increase its value\n\t\t\tmax -= step;\n\t\t}\n\t\tthis.max = parseFloat( max.toFixed( this._precision() ) );\n\t},\n\n\t_precision: function() {\n\t\tvar precision = this._precisionOf( this.options.step );\n\t\tif ( this.options.min !== null ) {\n\t\t\tprecision = Math.max( precision, this._precisionOf( this.options.min ) );\n\t\t}\n\t\treturn precision;\n\t},\n\n\t_precisionOf: function( num ) {\n\t\tvar str = num.toString(),\n\t\t\tdecimal = str.indexOf( \".\" );\n\t\treturn decimal === -1 ? 0 : str.length - decimal - 1;\n\t},\n\n\t_valueMin: function() {\n\t\treturn this.options.min;\n\t},\n\n\t_valueMax: function() {\n\t\treturn this.max;\n\t},\n\n\t_refreshRange: function( orientation ) {\n\t\tif ( orientation === \"vertical\" ) {\n\t\t\tthis.range.css( { \"width\": \"\", \"left\": \"\" } );\n\t\t}\n\t\tif ( orientation === \"horizontal\" ) {\n\t\t\tthis.range.css( { \"height\": \"\", \"bottom\": \"\" } );\n\t\t}\n\t},\n\n\t_refreshValue: function() {\n\t\tvar lastValPercent, valPercent, value, valueMin, valueMax,\n\t\t\toRange = this.options.range,\n\t\t\to = this.options,\n\t\t\tthat = this,\n\t\t\tanimate = ( !this._animateOff ) ? o.animate : false,\n\t\t\t_set = {};\n\n\t\tif ( this._hasMultipleValues() ) {\n\t\t\tthis.handles.each( function( i ) {\n\t\t\t\tvalPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -\n\t\t\t\t\tthat._valueMin() ) * 100;\n\t\t\t\t_set[ that.orientation === \"horizontal\" ? \"left\" : \"bottom\" ] = valPercent + \"%\";\n\t\t\t\t$( this ).stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( _set, o.animate );\n\t\t\t\tif ( that.options.range === true ) {\n\t\t\t\t\tif ( that.orientation === \"horizontal\" ) {\n\t\t\t\t\t\tif ( i === 0 ) {\n\t\t\t\t\t\t\tthat.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( {\n\t\t\t\t\t\t\t\tleft: valPercent + \"%\"\n\t\t\t\t\t\t\t}, o.animate );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( i === 1 ) {\n\t\t\t\t\t\t\tthat.range[ animate ? \"animate\" : \"css\" ]( {\n\t\t\t\t\t\t\t\twidth: ( valPercent - lastValPercent ) + \"%\"\n\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\tqueue: false,\n\t\t\t\t\t\t\t\tduration: o.animate\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( i === 0 ) {\n\t\t\t\t\t\t\tthat.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( {\n\t\t\t\t\t\t\t\tbottom: ( valPercent ) + \"%\"\n\t\t\t\t\t\t\t}, o.animate );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( i === 1 ) {\n\t\t\t\t\t\t\tthat.range[ animate ? \"animate\" : \"css\" ]( {\n\t\t\t\t\t\t\t\theight: ( valPercent - lastValPercent ) + \"%\"\n\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\tqueue: false,\n\t\t\t\t\t\t\t\tduration: o.animate\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlastValPercent = valPercent;\n\t\t\t} );\n\t\t} else {\n\t\t\tvalue = this.value();\n\t\t\tvalueMin = this._valueMin();\n\t\t\tvalueMax = this._valueMax();\n\t\t\tvalPercent = ( valueMax !== valueMin ) ?\n\t\t\t\t\t( value - valueMin ) / ( valueMax - valueMin ) * 100 :\n\t\t\t\t\t0;\n\t\t\t_set[ this.orientation === \"horizontal\" ? \"left\" : \"bottom\" ] = valPercent + \"%\";\n\t\t\tthis.handle.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( _set, o.animate );\n\n\t\t\tif ( oRange === \"min\" && this.orientation === \"horizontal\" ) {\n\t\t\t\tthis.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( {\n\t\t\t\t\twidth: valPercent + \"%\"\n\t\t\t\t}, o.animate );\n\t\t\t}\n\t\t\tif ( oRange === \"max\" && this.orientation === \"horizontal\" ) {\n\t\t\t\tthis.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( {\n\t\t\t\t\twidth: ( 100 - valPercent ) + \"%\"\n\t\t\t\t}, o.animate );\n\t\t\t}\n\t\t\tif ( oRange === \"min\" && this.orientation === \"vertical\" ) {\n\t\t\t\tthis.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( {\n\t\t\t\t\theight: valPercent + \"%\"\n\t\t\t\t}, o.animate );\n\t\t\t}\n\t\t\tif ( oRange === \"max\" && this.orientation === \"vertical\" ) {\n\t\t\t\tthis.range.stop( 1, 1 )[ animate ? \"animate\" : \"css\" ]( {\n\t\t\t\t\theight: ( 100 - valPercent ) + \"%\"\n\t\t\t\t}, o.animate );\n\t\t\t}\n\t\t}\n\t},\n\n\t_handleEvents: {\n\t\tkeydown: function( event ) {\n\t\t\tvar allowed, curVal, newVal, step,\n\t\t\t\tindex = $( event.target ).data( \"ui-slider-handle-index\" );\n\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\tcase $.ui.keyCode.HOME:\n\t\t\t\tcase $.ui.keyCode.END:\n\t\t\t\tcase $.ui.keyCode.PAGE_UP:\n\t\t\t\tcase $.ui.keyCode.PAGE_DOWN:\n\t\t\t\tcase $.ui.keyCode.UP:\n\t\t\t\tcase $.ui.keyCode.RIGHT:\n\t\t\t\tcase $.ui.keyCode.DOWN:\n\t\t\t\tcase $.ui.keyCode.LEFT:\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif ( !this._keySliding ) {\n\t\t\t\t\t\tthis._keySliding = true;\n\t\t\t\t\t\tthis._addClass( $( event.target ), null, \"ui-state-active\" );\n\t\t\t\t\t\tallowed = this._start( event, index );\n\t\t\t\t\t\tif ( allowed === false ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tstep = this.options.step;\n\t\t\tif ( this._hasMultipleValues() ) {\n\t\t\t\tcurVal = newVal = this.values( index );\n\t\t\t} else {\n\t\t\t\tcurVal = newVal = this.value();\n\t\t\t}\n\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\tcase $.ui.keyCode.HOME:\n\t\t\t\t\tnewVal = this._valueMin();\n\t\t\t\t\tbreak;\n\t\t\t\tcase $.ui.keyCode.END:\n\t\t\t\t\tnewVal = this._valueMax();\n\t\t\t\t\tbreak;\n\t\t\t\tcase $.ui.keyCode.PAGE_UP:\n\t\t\t\t\tnewVal = this._trimAlignValue(\n\t\t\t\t\t\tcurVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase $.ui.keyCode.PAGE_DOWN:\n\t\t\t\t\tnewVal = this._trimAlignValue(\n\t\t\t\t\t\tcurVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase $.ui.keyCode.UP:\n\t\t\t\tcase $.ui.keyCode.RIGHT:\n\t\t\t\t\tif ( curVal === this._valueMax() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tnewVal = this._trimAlignValue( curVal + step );\n\t\t\t\t\tbreak;\n\t\t\t\tcase $.ui.keyCode.DOWN:\n\t\t\t\tcase $.ui.keyCode.LEFT:\n\t\t\t\t\tif ( curVal === this._valueMin() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tnewVal = this._trimAlignValue( curVal - step );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tthis._slide( event, index, newVal );\n\t\t},\n\t\tkeyup: function( event ) {\n\t\t\tvar index = $( event.target ).data( \"ui-slider-handle-index\" );\n\n\t\t\tif ( this._keySliding ) {\n\t\t\t\tthis._keySliding = false;\n\t\t\t\tthis._stop( event, index );\n\t\t\t\tthis._change( event, index );\n\t\t\t\tthis._removeClass( $( event.target ), null, \"ui-state-active\" );\n\t\t\t}\n\t\t}\n\t}\n} );\n","/*!\n * jQuery UI Mouse 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Mouse\n//>>group: Widgets\n//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.\n//>>docs: http://api.jqueryui.com/mouse/\n\nimport $ from \"jquery\";\nimport \"../ie\";\nimport \"../version\";\nimport \"../widget\";\n\nvar mouseHandled = false;\n$( document ).on( \"mouseup\", function() {\n\tmouseHandled = false;\n} );\n\n$.widget( \"ui.mouse\", {\n\tversion: \"1.12.1\",\n\toptions: {\n\t\tcancel: \"input, textarea, button, select, option\",\n\t\tdistance: 1,\n\t\tdelay: 0\n\t},\n\t_mouseInit: function() {\n\t\tvar that = this;\n\n\t\tthis.element\n\t\t\t.on( \"mousedown.\" + this.widgetName, function( event ) {\n\t\t\t\treturn that._mouseDown( event );\n\t\t\t} )\n\t\t\t.on( \"click.\" + this.widgetName, function( event ) {\n\t\t\t\tif ( true === $.data( event.target, that.widgetName + \".preventClickEvent\" ) ) {\n\t\t\t\t\t$.removeData( event.target, that.widgetName + \".preventClickEvent\" );\n\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} );\n\n\t\tthis.started = false;\n\t},\n\n\t// TODO: make sure destroying one instance of mouse doesn't mess with\n\t// other instances of mouse\n\t_mouseDestroy: function() {\n\t\tthis.element.off( \".\" + this.widgetName );\n\t\tif ( this._mouseMoveDelegate ) {\n\t\t\tthis.document\n\t\t\t\t.off( \"mousemove.\" + this.widgetName, this._mouseMoveDelegate )\n\t\t\t\t.off( \"mouseup.\" + this.widgetName, this._mouseUpDelegate );\n\t\t}\n\t},\n\n\t_mouseDown: function( event ) {\n\n\t\t// don't let more than one widget handle mouseStart\n\t\tif ( mouseHandled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseMoved = false;\n\n\t\t// We may have missed mouseup (out of window)\n\t\t( this._mouseStarted && this._mouseUp( event ) );\n\n\t\tthis._mouseDownEvent = event;\n\n\t\tvar that = this,\n\t\t\tbtnIsLeft = ( event.which === 1 ),\n\n\t\t\t// event.target.nodeName works around a bug in IE 8 with\n\t\t\t// disabled inputs (#7620)\n\t\t\telIsCancel = ( typeof this.options.cancel === \"string\" && event.target.nodeName ?\n\t\t\t\t$( event.target ).closest( this.options.cancel ).length : false );\n\t\tif ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.mouseDelayMet = !this.options.delay;\n\t\tif ( !this.mouseDelayMet ) {\n\t\t\tthis._mouseDelayTimer = setTimeout( function() {\n\t\t\t\tthat.mouseDelayMet = true;\n\t\t\t}, this.options.delay );\n\t\t}\n\n\t\tif ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {\n\t\t\tthis._mouseStarted = ( this._mouseStart( event ) !== false );\n\t\t\tif ( !this._mouseStarted ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Click event may never have fired (Gecko & Opera)\n\t\tif ( true === $.data( event.target, this.widgetName + \".preventClickEvent\" ) ) {\n\t\t\t$.removeData( event.target, this.widgetName + \".preventClickEvent\" );\n\t\t}\n\n\t\t// These delegates are required to keep context\n\t\tthis._mouseMoveDelegate = function( event ) {\n\t\t\treturn that._mouseMove( event );\n\t\t};\n\t\tthis._mouseUpDelegate = function( event ) {\n\t\t\treturn that._mouseUp( event );\n\t\t};\n\n\t\tthis.document\n\t\t\t.on( \"mousemove.\" + this.widgetName, this._mouseMoveDelegate )\n\t\t\t.on( \"mouseup.\" + this.widgetName, this._mouseUpDelegate );\n\n\t\tevent.preventDefault();\n\n\t\tmouseHandled = true;\n\t\treturn true;\n\t},\n\n\t_mouseMove: function( event ) {\n\n\t\t// Only check for mouseups outside the document if you've moved inside the document\n\t\t// at least once. This prevents the firing of mouseup in the case of IE<9, which will\n\t\t// fire a mousemove event if content is placed under the cursor. See #7778\n\t\t// Support: IE <9\n\t\tif ( this._mouseMoved ) {\n\n\t\t\t// IE mouseup check - mouseup happened when mouse was out of window\n\t\t\tif ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&\n\t\t\t\t\t!event.button ) {\n\t\t\t\treturn this._mouseUp( event );\n\n\t\t\t// Iframe mouseup check - mouseup occurred in another document\n\t\t\t} else if ( !event.which ) {\n\n\t\t\t\t// Support: Safari <=8 - 9\n\t\t\t\t// Safari sets which to 0 if you press any of the following keys\n\t\t\t\t// during a drag (#14461)\n\t\t\t\tif ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||\n\t\t\t\t\t\tevent.originalEvent.metaKey || event.originalEvent.shiftKey ) {\n\t\t\t\t\tthis.ignoreMissingWhich = true;\n\t\t\t\t} else if ( !this.ignoreMissingWhich ) {\n\t\t\t\t\treturn this._mouseUp( event );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( event.which || event.button ) {\n\t\t\tthis._mouseMoved = true;\n\t\t}\n\n\t\tif ( this._mouseStarted ) {\n\t\t\tthis._mouseDrag( event );\n\t\t\treturn event.preventDefault();\n\t\t}\n\n\t\tif ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {\n\t\t\tthis._mouseStarted =\n\t\t\t\t( this._mouseStart( this._mouseDownEvent, event ) !== false );\n\t\t\t( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );\n\t\t}\n\n\t\treturn !this._mouseStarted;\n\t},\n\n\t_mouseUp: function( event ) {\n\t\tthis.document\n\t\t\t.off( \"mousemove.\" + this.widgetName, this._mouseMoveDelegate )\n\t\t\t.off( \"mouseup.\" + this.widgetName, this._mouseUpDelegate );\n\n\t\tif ( this._mouseStarted ) {\n\t\t\tthis._mouseStarted = false;\n\n\t\t\tif ( event.target === this._mouseDownEvent.target ) {\n\t\t\t\t$.data( event.target, this.widgetName + \".preventClickEvent\", true );\n\t\t\t}\n\n\t\t\tthis._mouseStop( event );\n\t\t}\n\n\t\tif ( this._mouseDelayTimer ) {\n\t\t\tclearTimeout( this._mouseDelayTimer );\n\t\t\tdelete this._mouseDelayTimer;\n\t\t}\n\n\t\tthis.ignoreMissingWhich = false;\n\t\tmouseHandled = false;\n\t\tevent.preventDefault();\n\t},\n\n\t_mouseDistanceMet: function( event ) {\n\t\treturn ( Math.max(\n\t\t\t\tMath.abs( this._mouseDownEvent.pageX - event.pageX ),\n\t\t\t\tMath.abs( this._mouseDownEvent.pageY - event.pageY )\n\t\t\t) >= this.options.distance\n\t\t);\n\t},\n\n\t_mouseDelayMet: function( /* event */ ) {\n\t\treturn this.mouseDelayMet;\n\t},\n\n\t// These are placeholder methods, to be overriden by extending plugin\n\t_mouseStart: function( /* event */ ) {},\n\t_mouseDrag: function( /* event */ ) {},\n\t_mouseStop: function( /* event */ ) {},\n\t_mouseCapture: function( /* event */ ) { return true; }\n} );\n","import $ from \"jquery\";\nimport \"./version\";\n\n// This file is deprecated\n$.ui.ie = !!/msie [\\w.]+/.exec( navigator.userAgent.toLowerCase() );\n","// jscs:disable maximumLineLength\n/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */\n/*!\n * jQuery UI Datepicker 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Datepicker\n//>>group: Widgets\n//>>description: Displays a calendar from an input or inline for selecting dates.\n//>>docs: http://api.jqueryui.com/datepicker/\n//>>demos: http://jqueryui.com/datepicker/\n//>>css.structure: ../../themes/base/core.css\n//>>css.structure: ../../themes/base/datepicker.css\n//>>css.theme: ../../themes/base/theme.css\n\nimport $ from \"jquery\";\nimport \"../keycode\";\nimport \"../version\";\n\n$.extend( $.ui, { datepicker: { version: \"1.12.1\" } } );\n\nvar datepicker_instActive;\n\nfunction datepicker_getZindex( elem ) {\n\tvar position, value;\n\twhile ( elem.length && elem[ 0 ] !== document ) {\n\n\t\t// Ignore z-index if position is set to a value where z-index is ignored by the browser\n\t\t// This makes behavior of this function consistent across browsers\n\t\t// WebKit always returns auto if the element is positioned\n\t\tposition = elem.css( \"position\" );\n\t\tif ( position === \"absolute\" || position === \"relative\" || position === \"fixed\" ) {\n\n\t\t\t// IE returns 0 when zIndex is not specified\n\t\t\t// other browsers return a string\n\t\t\t// we ignore the case of nested elements with an explicit value of 0\n\t\t\t// <div style=\"z-index: -10;\"><div style=\"z-index: 0;\"></div></div>\n\t\t\tvalue = parseInt( elem.css( \"zIndex\" ), 10 );\n\t\t\tif ( !isNaN( value ) && value !== 0 ) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\telem = elem.parent();\n\t}\n\n\treturn 0;\n}\n/* Date picker manager.\n Use the singleton instance of this class, $.datepicker, to interact with the date picker.\n Settings for (groups of) date pickers are maintained in an instance object,\n allowing multiple different settings on the same page. */\n\nfunction Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}\n\n$.extend( Datepicker.prototype, {\n\t/* Class name added to elements to indicate already configured with a date picker. */\n\tmarkerClassName: \"hasDatepicker\",\n\n\t//Keep track of the maximum number of rows displayed (see #7043)\n\tmaxRows: 4,\n\n\t// TODO rename to \"widget\" when switching to widget factory\n\t_widgetDatepicker: function() {\n\t\treturn this.dpDiv;\n\t},\n\n\t/* Override the default settings for all instances of the date picker.\n\t * @param settings object - the new settings to use as defaults (anonymous object)\n\t * @return the manager object\n\t */\n\tsetDefaults: function( settings ) {\n\t\tdatepicker_extendRemove( this._defaults, settings || {} );\n\t\treturn this;\n\t},\n\n\t/* Attach the date picker to a jQuery selection.\n\t * @param target\telement - the target input field or division or span\n\t * @param settings object - the new settings to use for this date picker instance (anonymous)\n\t */\n\t_attachDatepicker: function( target, settings ) {\n\t\tvar nodeName, inline, inst;\n\t\tnodeName = target.nodeName.toLowerCase();\n\t\tinline = ( nodeName === \"div\" || nodeName === \"span\" );\n\t\tif ( !target.id ) {\n\t\t\tthis.uuid += 1;\n\t\t\ttarget.id = \"dp\" + this.uuid;\n\t\t}\n\t\tinst = this._newInst( $( target ), inline );\n\t\tinst.settings = $.extend( {}, settings || {} );\n\t\tif ( nodeName === \"input\" ) {\n\t\t\tthis._connectDatepicker( target, inst );\n\t\t} else if ( inline ) {\n\t\t\tthis._inlineDatepicker( target, inst );\n\t\t}\n\t},\n\n\t/* Create a new instance object. */\n\t_newInst: function( target, inline ) {\n\t\tvar id = target[ 0 ].id.replace( /([^A-Za-z0-9_\\-])/g, \"\\\\\\\\$1\" ); // escape jQuery meta chars\n\t\treturn { id: id, input: target, // associated target\n\t\t\tselectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection\n\t\t\tdrawMonth: 0, drawYear: 0, // month being drawn\n\t\t\tinline: inline, // is datepicker inline or not\n\t\t\tdpDiv: ( !inline ? this.dpDiv : // presentation div\n\t\t\tdatepicker_bindHover( $( \"<div class='\" + this._inlineClass + \" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) ) ) };\n\t},\n\n\t/* Attach the date picker to an input field. */\n\t_connectDatepicker: function( target, inst ) {\n\t\tvar input = $( target );\n\t\tinst.append = $( [] );\n\t\tinst.trigger = $( [] );\n\t\tif ( input.hasClass( this.markerClassName ) ) {\n\t\t\treturn;\n\t\t}\n\t\tthis._attachments( input, inst );\n\t\tinput.addClass( this.markerClassName ).on( \"keydown\", this._doKeyDown ).\n\t\t\ton( \"keypress\", this._doKeyPress ).on( \"keyup\", this._doKeyUp );\n\t\tthis._autoSize( inst );\n\t\t$.data( target, \"datepicker\", inst );\n\n\t\t//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)\n\t\tif ( inst.settings.disabled ) {\n\t\t\tthis._disableDatepicker( target );\n\t\t}\n\t},\n\n\t/* Make attachments based on settings. */\n\t_attachments: function( input, inst ) {\n\t\tvar showOn, buttonText, buttonImage,\n\t\t\tappendText = this._get( inst, \"appendText\" ),\n\t\t\tisRTL = this._get( inst, \"isRTL\" );\n\n\t\tif ( inst.append ) {\n\t\t\tinst.append.remove();\n\t\t}\n\t\tif ( appendText ) {\n\t\t\tinst.append = $( \"<span class='\" + this._appendClass + \"'>\" + appendText + \"</span>\" );\n\t\t\tinput[ isRTL ? \"before\" : \"after\" ]( inst.append );\n\t\t}\n\n\t\tinput.off( \"focus\", this._showDatepicker );\n\n\t\tif ( inst.trigger ) {\n\t\t\tinst.trigger.remove();\n\t\t}\n\n\t\tshowOn = this._get( inst, \"showOn\" );\n\t\tif ( showOn === \"focus\" || showOn === \"both\" ) { // pop-up date picker when in the marked field\n\t\t\tinput.on( \"focus\", this._showDatepicker );\n\t\t}\n\t\tif ( showOn === \"button\" || showOn === \"both\" ) { // pop-up date picker when button clicked\n\t\t\tbuttonText = this._get( inst, \"buttonText\" );\n\t\t\tbuttonImage = this._get( inst, \"buttonImage\" );\n\t\t\tinst.trigger = $( this._get( inst, \"buttonImageOnly\" ) ?\n\t\t\t\t$( \"<img/>\" ).addClass( this._triggerClass ).\n\t\t\t\t\tattr( { src: buttonImage, alt: buttonText, title: buttonText } ) :\n\t\t\t\t$( \"<button type='button'></button>\" ).addClass( this._triggerClass ).\n\t\t\t\t\thtml( !buttonImage ? buttonText : $( \"<img/>\" ).attr(\n\t\t\t\t\t{ src:buttonImage, alt:buttonText, title:buttonText } ) ) );\n\t\t\tinput[ isRTL ? \"before\" : \"after\" ]( inst.trigger );\n\t\t\tinst.trigger.on( \"click\", function() {\n\t\t\t\tif ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {\n\t\t\t\t\t$.datepicker._hideDatepicker();\n\t\t\t\t} else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {\n\t\t\t\t\t$.datepicker._hideDatepicker();\n\t\t\t\t\t$.datepicker._showDatepicker( input[ 0 ] );\n\t\t\t\t} else {\n\t\t\t\t\t$.datepicker._showDatepicker( input[ 0 ] );\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t}\n\t},\n\n\t/* Apply the maximum length for the date format. */\n\t_autoSize: function( inst ) {\n\t\tif ( this._get( inst, \"autoSize\" ) && !inst.inline ) {\n\t\t\tvar findMax, max, maxI, i,\n\t\t\t\tdate = new Date( 2009, 12 - 1, 20 ), // Ensure double digits\n\t\t\t\tdateFormat = this._get( inst, \"dateFormat\" );\n\n\t\t\tif ( dateFormat.match( /[DM]/ ) ) {\n\t\t\t\tfindMax = function( names ) {\n\t\t\t\t\tmax = 0;\n\t\t\t\t\tmaxI = 0;\n\t\t\t\t\tfor ( i = 0; i < names.length; i++ ) {\n\t\t\t\t\t\tif ( names[ i ].length > max ) {\n\t\t\t\t\t\t\tmax = names[ i ].length;\n\t\t\t\t\t\t\tmaxI = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn maxI;\n\t\t\t\t};\n\t\t\t\tdate.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?\n\t\t\t\t\t\"monthNames\" : \"monthNamesShort\" ) ) ) );\n\t\t\t\tdate.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?\n\t\t\t\t\t\"dayNames\" : \"dayNamesShort\" ) ) ) + 20 - date.getDay() );\n\t\t\t}\n\t\t\tinst.input.attr( \"size\", this._formatDate( inst, date ).length );\n\t\t}\n\t},\n\n\t/* Attach an inline date picker to a div. */\n\t_inlineDatepicker: function( target, inst ) {\n\t\tvar divSpan = $( target );\n\t\tif ( divSpan.hasClass( this.markerClassName ) ) {\n\t\t\treturn;\n\t\t}\n\t\tdivSpan.addClass( this.markerClassName ).append( inst.dpDiv );\n\t\t$.data( target, \"datepicker\", inst );\n\t\tthis._setDate( inst, this._getDefaultDate( inst ), true );\n\t\tthis._updateDatepicker( inst );\n\t\tthis._updateAlternate( inst );\n\n\t\t//If disabled option is true, disable the datepicker before showing it (see ticket #5665)\n\t\tif ( inst.settings.disabled ) {\n\t\t\tthis._disableDatepicker( target );\n\t\t}\n\n\t\t// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements\n\t\t// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height\n\t\tinst.dpDiv.css( \"display\", \"block\" );\n\t},\n\n\t/* Pop-up the date picker in a \"dialog\" box.\n\t * @param input element - ignored\n\t * @param date\tstring or Date - the initial date to display\n\t * @param onSelect function - the function to call when a date is selected\n\t * @param settings object - update the dialog date picker instance's settings (anonymous object)\n\t * @param pos int[2] - coordinates for the dialog's position within the screen or\n\t *\t\t\t\t\tevent - with x/y coordinates or\n\t *\t\t\t\t\tleave empty for default (screen centre)\n\t * @return the manager object\n\t */\n\t_dialogDatepicker: function( input, date, onSelect, settings, pos ) {\n\t\tvar id, browserWidth, browserHeight, scrollX, scrollY,\n\t\t\tinst = this._dialogInst; // internal instance\n\n\t\tif ( !inst ) {\n\t\t\tthis.uuid += 1;\n\t\t\tid = \"dp\" + this.uuid;\n\t\t\tthis._dialogInput = $( \"<input type='text' id='\" + id +\n\t\t\t\t\"' style='position: absolute; top: -100px; width: 0px;'/>\" );\n\t\t\tthis._dialogInput.on( \"keydown\", this._doKeyDown );\n\t\t\t$( \"body\" ).append( this._dialogInput );\n\t\t\tinst = this._dialogInst = this._newInst( this._dialogInput, false );\n\t\t\tinst.settings = {};\n\t\t\t$.data( this._dialogInput[ 0 ], \"datepicker\", inst );\n\t\t}\n\t\tdatepicker_extendRemove( inst.settings, settings || {} );\n\t\tdate = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );\n\t\tthis._dialogInput.val( date );\n\n\t\tthis._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );\n\t\tif ( !this._pos ) {\n\t\t\tbrowserWidth = document.documentElement.clientWidth;\n\t\t\tbrowserHeight = document.documentElement.clientHeight;\n\t\t\tscrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\n\t\t\tscrollY = document.documentElement.scrollTop || document.body.scrollTop;\n\t\t\tthis._pos = // should use actual width/height below\n\t\t\t\t[ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];\n\t\t}\n\n\t\t// Move input on screen for focus, but hidden behind dialog\n\t\tthis._dialogInput.css( \"left\", ( this._pos[ 0 ] + 20 ) + \"px\" ).css( \"top\", this._pos[ 1 ] + \"px\" );\n\t\tinst.settings.onSelect = onSelect;\n\t\tthis._inDialog = true;\n\t\tthis.dpDiv.addClass( this._dialogClass );\n\t\tthis._showDatepicker( this._dialogInput[ 0 ] );\n\t\tif ( $.blockUI ) {\n\t\t\t$.blockUI( this.dpDiv );\n\t\t}\n\t\t$.data( this._dialogInput[ 0 ], \"datepicker\", inst );\n\t\treturn this;\n\t},\n\n\t/* Detach a datepicker from its control.\n\t * @param target\telement - the target input field or division or span\n\t */\n\t_destroyDatepicker: function( target ) {\n\t\tvar nodeName,\n\t\t\t$target = $( target ),\n\t\t\tinst = $.data( target, \"datepicker\" );\n\n\t\tif ( !$target.hasClass( this.markerClassName ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnodeName = target.nodeName.toLowerCase();\n\t\t$.removeData( target, \"datepicker\" );\n\t\tif ( nodeName === \"input\" ) {\n\t\t\tinst.append.remove();\n\t\t\tinst.trigger.remove();\n\t\t\t$target.removeClass( this.markerClassName ).\n\t\t\t\toff( \"focus\", this._showDatepicker ).\n\t\t\t\toff( \"keydown\", this._doKeyDown ).\n\t\t\t\toff( \"keypress\", this._doKeyPress ).\n\t\t\t\toff( \"keyup\", this._doKeyUp );\n\t\t} else if ( nodeName === \"div\" || nodeName === \"span\" ) {\n\t\t\t$target.removeClass( this.markerClassName ).empty();\n\t\t}\n\n\t\tif ( datepicker_instActive === inst ) {\n\t\t\tdatepicker_instActive = null;\n\t\t}\n\t},\n\n\t/* Enable the date picker to a jQuery selection.\n\t * @param target\telement - the target input field or division or span\n\t */\n\t_enableDatepicker: function( target ) {\n\t\tvar nodeName, inline,\n\t\t\t$target = $( target ),\n\t\t\tinst = $.data( target, \"datepicker\" );\n\n\t\tif ( !$target.hasClass( this.markerClassName ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnodeName = target.nodeName.toLowerCase();\n\t\tif ( nodeName === \"input\" ) {\n\t\t\ttarget.disabled = false;\n\t\t\tinst.trigger.filter( \"button\" ).\n\t\t\t\teach( function() { this.disabled = false; } ).end().\n\t\t\t\tfilter( \"img\" ).css( { opacity: \"1.0\", cursor: \"\" } );\n\t\t} else if ( nodeName === \"div\" || nodeName === \"span\" ) {\n\t\t\tinline = $target.children( \".\" + this._inlineClass );\n\t\t\tinline.children().removeClass( \"ui-state-disabled\" );\n\t\t\tinline.find( \"select.ui-datepicker-month, select.ui-datepicker-year\" ).\n\t\t\t\tprop( \"disabled\", false );\n\t\t}\n\t\tthis._disabledInputs = $.map( this._disabledInputs,\n\t\t\tfunction( value ) { return ( value === target ? null : value ); } ); // delete entry\n\t},\n\n\t/* Disable the date picker to a jQuery selection.\n\t * @param target\telement - the target input field or division or span\n\t */\n\t_disableDatepicker: function( target ) {\n\t\tvar nodeName, inline,\n\t\t\t$target = $( target ),\n\t\t\tinst = $.data( target, \"datepicker\" );\n\n\t\tif ( !$target.hasClass( this.markerClassName ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnodeName = target.nodeName.toLowerCase();\n\t\tif ( nodeName === \"input\" ) {\n\t\t\ttarget.disabled = true;\n\t\t\tinst.trigger.filter( \"button\" ).\n\t\t\t\teach( function() { this.disabled = true; } ).end().\n\t\t\t\tfilter( \"img\" ).css( { opacity: \"0.5\", cursor: \"default\" } );\n\t\t} else if ( nodeName === \"div\" || nodeName === \"span\" ) {\n\t\t\tinline = $target.children( \".\" + this._inlineClass );\n\t\t\tinline.children().addClass( \"ui-state-disabled\" );\n\t\t\tinline.find( \"select.ui-datepicker-month, select.ui-datepicker-year\" ).\n\t\t\t\tprop( \"disabled\", true );\n\t\t}\n\t\tthis._disabledInputs = $.map( this._disabledInputs,\n\t\t\tfunction( value ) { return ( value === target ? null : value ); } ); // delete entry\n\t\tthis._disabledInputs[ this._disabledInputs.length ] = target;\n\t},\n\n\t/* Is the first field in a jQuery collection disabled as a datepicker?\n\t * @param target\telement - the target input field or division or span\n\t * @return boolean - true if disabled, false if enabled\n\t */\n\t_isDisabledDatepicker: function( target ) {\n\t\tif ( !target ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( var i = 0; i < this._disabledInputs.length; i++ ) {\n\t\t\tif ( this._disabledInputs[ i ] === target ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\n\t/* Retrieve the instance data for the target control.\n\t * @param target element - the target input field or division or span\n\t * @return object - the associated instance data\n\t * @throws error if a jQuery problem getting data\n\t */\n\t_getInst: function( target ) {\n\t\ttry {\n\t\t\treturn $.data( target, \"datepicker\" );\n\t\t}\n\t\tcatch ( err ) {\n\t\t\tthrow \"Missing instance data for this datepicker\";\n\t\t}\n\t},\n\n\t/* Update or retrieve the settings for a date picker attached to an input field or division.\n\t * @param target element - the target input field or division or span\n\t * @param name\tobject - the new settings to update or\n\t *\t\t\t\tstring - the name of the setting to change or retrieve,\n\t *\t\t\t\twhen retrieving also \"all\" for all instance settings or\n\t *\t\t\t\t\"defaults\" for all global defaults\n\t * @param value any - the new value for the setting\n\t *\t\t\t\t(omit if above is an object or to retrieve a value)\n\t */\n\t_optionDatepicker: function( target, name, value ) {\n\t\tvar settings, date, minDate, maxDate,\n\t\t\tinst = this._getInst( target );\n\n\t\tif ( arguments.length === 2 && typeof name === \"string\" ) {\n\t\t\treturn ( name === \"defaults\" ? $.extend( {}, $.datepicker._defaults ) :\n\t\t\t\t( inst ? ( name === \"all\" ? $.extend( {}, inst.settings ) :\n\t\t\t\tthis._get( inst, name ) ) : null ) );\n\t\t}\n\n\t\tsettings = name || {};\n\t\tif ( typeof name === \"string\" ) {\n\t\t\tsettings = {};\n\t\t\tsettings[ name ] = value;\n\t\t}\n\n\t\tif ( inst ) {\n\t\t\tif ( this._curInst === inst ) {\n\t\t\t\tthis._hideDatepicker();\n\t\t\t}\n\n\t\t\tdate = this._getDateDatepicker( target, true );\n\t\t\tminDate = this._getMinMaxDate( inst, \"min\" );\n\t\t\tmaxDate = this._getMinMaxDate( inst, \"max\" );\n\t\t\tdatepicker_extendRemove( inst.settings, settings );\n\n\t\t\t// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided\n\t\t\tif ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {\n\t\t\t\tinst.settings.minDate = this._formatDate( inst, minDate );\n\t\t\t}\n\t\t\tif ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {\n\t\t\t\tinst.settings.maxDate = this._formatDate( inst, maxDate );\n\t\t\t}\n\t\t\tif ( \"disabled\" in settings ) {\n\t\t\t\tif ( settings.disabled ) {\n\t\t\t\t\tthis._disableDatepicker( target );\n\t\t\t\t} else {\n\t\t\t\t\tthis._enableDatepicker( target );\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._attachments( $( target ), inst );\n\t\t\tthis._autoSize( inst );\n\t\t\tthis._setDate( inst, date );\n\t\t\tthis._updateAlternate( inst );\n\t\t\tthis._updateDatepicker( inst );\n\t\t}\n\t},\n\n\t// Change method deprecated\n\t_changeDatepicker: function( target, name, value ) {\n\t\tthis._optionDatepicker( target, name, value );\n\t},\n\n\t/* Redraw the date picker attached to an input field or division.\n\t * @param target element - the target input field or division or span\n\t */\n\t_refreshDatepicker: function( target ) {\n\t\tvar inst = this._getInst( target );\n\t\tif ( inst ) {\n\t\t\tthis._updateDatepicker( inst );\n\t\t}\n\t},\n\n\t/* Set the dates for a jQuery selection.\n\t * @param target element - the target input field or division or span\n\t * @param date\tDate - the new date\n\t */\n\t_setDateDatepicker: function( target, date ) {\n\t\tvar inst = this._getInst( target );\n\t\tif ( inst ) {\n\t\t\tthis._setDate( inst, date );\n\t\t\tthis._updateDatepicker( inst );\n\t\t\tthis._updateAlternate( inst );\n\t\t}\n\t},\n\n\t/* Get the date(s) for the first entry in a jQuery selection.\n\t * @param target element - the target input field or division or span\n\t * @param noDefault boolean - true if no default date is to be used\n\t * @return Date - the current date\n\t */\n\t_getDateDatepicker: function( target, noDefault ) {\n\t\tvar inst = this._getInst( target );\n\t\tif ( inst && !inst.inline ) {\n\t\t\tthis._setDateFromField( inst, noDefault );\n\t\t}\n\t\treturn ( inst ? this._getDate( inst ) : null );\n\t},\n\n\t/* Handle keystrokes. */\n\t_doKeyDown: function( event ) {\n\t\tvar onSelect, dateStr, sel,\n\t\t\tinst = $.datepicker._getInst( event.target ),\n\t\t\thandled = true,\n\t\t\tisRTL = inst.dpDiv.is( \".ui-datepicker-rtl\" );\n\n\t\tinst._keyEvent = true;\n\t\tif ( $.datepicker._datepickerShowing ) {\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\tcase 9: $.datepicker._hideDatepicker();\n\t\t\t\t\t\thandled = false;\n\t\t\t\t\t\tbreak; // hide on tab out\n\t\t\t\tcase 13: sel = $( \"td.\" + $.datepicker._dayOverClass + \":not(.\" +\n\t\t\t\t\t\t\t\t\t$.datepicker._currentClass + \")\", inst.dpDiv );\n\t\t\t\t\t\tif ( sel[ 0 ] ) {\n\t\t\t\t\t\t\t$.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tonSelect = $.datepicker._get( inst, \"onSelect\" );\n\t\t\t\t\t\tif ( onSelect ) {\n\t\t\t\t\t\t\tdateStr = $.datepicker._formatDate( inst );\n\n\t\t\t\t\t\t\t// Trigger custom callback\n\t\t\t\t\t\t\tonSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$.datepicker._hideDatepicker();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn false; // don't submit the form\n\t\t\t\tcase 27: $.datepicker._hideDatepicker();\n\t\t\t\t\t\tbreak; // hide on escape\n\t\t\t\tcase 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?\n\t\t\t\t\t\t\t-$.datepicker._get( inst, \"stepBigMonths\" ) :\n\t\t\t\t\t\t\t-$.datepicker._get( inst, \"stepMonths\" ) ), \"M\" );\n\t\t\t\t\t\tbreak; // previous month/year on page up/+ ctrl\n\t\t\t\tcase 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?\n\t\t\t\t\t\t\t+$.datepicker._get( inst, \"stepBigMonths\" ) :\n\t\t\t\t\t\t\t+$.datepicker._get( inst, \"stepMonths\" ) ), \"M\" );\n\t\t\t\t\t\tbreak; // next month/year on page down/+ ctrl\n\t\t\t\tcase 35: if ( event.ctrlKey || event.metaKey ) {\n\t\t\t\t\t\t\t$.datepicker._clearDate( event.target );\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\tbreak; // clear on ctrl or command +end\n\t\t\t\tcase 36: if ( event.ctrlKey || event.metaKey ) {\n\t\t\t\t\t\t\t$.datepicker._gotoToday( event.target );\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\tbreak; // current on ctrl or command +home\n\t\t\t\tcase 37: if ( event.ctrlKey || event.metaKey ) {\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), \"D\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\n\t\t\t\t\t\t// -1 day on ctrl or command +left\n\t\t\t\t\t\tif ( event.originalEvent.altKey ) {\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, ( event.ctrlKey ?\n\t\t\t\t\t\t\t\t-$.datepicker._get( inst, \"stepBigMonths\" ) :\n\t\t\t\t\t\t\t\t-$.datepicker._get( inst, \"stepMonths\" ) ), \"M\" );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// next month/year on alt +left on Mac\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 38: if ( event.ctrlKey || event.metaKey ) {\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, -7, \"D\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\tbreak; // -1 week on ctrl or command +up\n\t\t\t\tcase 39: if ( event.ctrlKey || event.metaKey ) {\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), \"D\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\n\t\t\t\t\t\t// +1 day on ctrl or command +right\n\t\t\t\t\t\tif ( event.originalEvent.altKey ) {\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, ( event.ctrlKey ?\n\t\t\t\t\t\t\t\t+$.datepicker._get( inst, \"stepBigMonths\" ) :\n\t\t\t\t\t\t\t\t+$.datepicker._get( inst, \"stepMonths\" ) ), \"M\" );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// next month/year on alt +right\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 40: if ( event.ctrlKey || event.metaKey ) {\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, +7, \"D\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\n\t\t\t\t\t\tbreak; // +1 week on ctrl or command +down\n\t\t\t\tdefault: handled = false;\n\t\t\t}\n\t\t} else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home\n\t\t\t$.datepicker._showDatepicker( this );\n\t\t} else {\n\t\t\thandled = false;\n\t\t}\n\n\t\tif ( handled ) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t}\n\t},\n\n\t/* Filter entered characters - based on date format. */\n\t_doKeyPress: function( event ) {\n\t\tvar chars, chr,\n\t\t\tinst = $.datepicker._getInst( event.target );\n\n\t\tif ( $.datepicker._get( inst, \"constrainInput\" ) ) {\n\t\t\tchars = $.datepicker._possibleChars( $.datepicker._get( inst, \"dateFormat\" ) );\n\t\t\tchr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );\n\t\t\treturn event.ctrlKey || event.metaKey || ( chr < \" \" || !chars || chars.indexOf( chr ) > -1 );\n\t\t}\n\t},\n\n\t/* Synchronise manual entry and field/alternate field. */\n\t_doKeyUp: function( event ) {\n\t\tvar date,\n\t\t\tinst = $.datepicker._getInst( event.target );\n\n\t\tif ( inst.input.val() !== inst.lastVal ) {\n\t\t\ttry {\n\t\t\t\tdate = $.datepicker.parseDate( $.datepicker._get( inst, \"dateFormat\" ),\n\t\t\t\t\t( inst.input ? inst.input.val() : null ),\n\t\t\t\t\t$.datepicker._getFormatConfig( inst ) );\n\n\t\t\t\tif ( date ) { // only if valid\n\t\t\t\t\t$.datepicker._setDateFromField( inst );\n\t\t\t\t\t$.datepicker._updateAlternate( inst );\n\t\t\t\t\t$.datepicker._updateDatepicker( inst );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch ( err ) {\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t},\n\n\t/* Pop-up the date picker for a given input field.\n\t * If false returned from beforeShow event handler do not show.\n\t * @param input element - the input field attached to the date picker or\n\t *\t\t\t\t\tevent - if triggered by focus\n\t */\n\t_showDatepicker: function( input ) {\n\t\tinput = input.target || input;\n\t\tif ( input.nodeName.toLowerCase() !== \"input\" ) { // find from button/image trigger\n\t\t\tinput = $( \"input\", input.parentNode )[ 0 ];\n\t\t}\n\n\t\tif ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here\n\t\t\treturn;\n\t\t}\n\n\t\tvar inst, beforeShow, beforeShowSettings, isFixed,\n\t\t\toffset, showAnim, duration;\n\n\t\tinst = $.datepicker._getInst( input );\n\t\tif ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {\n\t\t\t$.datepicker._curInst.dpDiv.stop( true, true );\n\t\t\tif ( inst && $.datepicker._datepickerShowing ) {\n\t\t\t\t$.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );\n\t\t\t}\n\t\t}\n\n\t\tbeforeShow = $.datepicker._get( inst, \"beforeShow\" );\n\t\tbeforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};\n\t\tif ( beforeShowSettings === false ) {\n\t\t\treturn;\n\t\t}\n\t\tdatepicker_extendRemove( inst.settings, beforeShowSettings );\n\n\t\tinst.lastVal = null;\n\t\t$.datepicker._lastInput = input;\n\t\t$.datepicker._setDateFromField( inst );\n\n\t\tif ( $.datepicker._inDialog ) { // hide cursor\n\t\t\tinput.value = \"\";\n\t\t}\n\t\tif ( !$.datepicker._pos ) { // position below input\n\t\t\t$.datepicker._pos = $.datepicker._findPos( input );\n\t\t\t$.datepicker._pos[ 1 ] += input.offsetHeight; // add the height\n\t\t}\n\n\t\tisFixed = false;\n\t\t$( input ).parents().each( function() {\n\t\t\tisFixed |= $( this ).css( \"position\" ) === \"fixed\";\n\t\t\treturn !isFixed;\n\t\t} );\n\n\t\toffset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };\n\t\t$.datepicker._pos = null;\n\n\t\t//to avoid flashes on Firefox\n\t\tinst.dpDiv.empty();\n\n\t\t// determine sizing offscreen\n\t\tinst.dpDiv.css( { position: \"absolute\", display: \"block\", top: \"-1000px\" } );\n\t\t$.datepicker._updateDatepicker( inst );\n\n\t\t// fix width for dynamic number of date pickers\n\t\t// and adjust position before showing\n\t\toffset = $.datepicker._checkOffset( inst, offset, isFixed );\n\t\tinst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?\n\t\t\t\"static\" : ( isFixed ? \"fixed\" : \"absolute\" ) ), display: \"none\",\n\t\t\tleft: offset.left + \"px\", top: offset.top + \"px\" } );\n\n\t\tif ( !inst.inline ) {\n\t\t\tshowAnim = $.datepicker._get( inst, \"showAnim\" );\n\t\t\tduration = $.datepicker._get( inst, \"duration\" );\n\t\t\tinst.dpDiv.css( \"z-index\", datepicker_getZindex( $( input ) ) + 1 );\n\t\t\t$.datepicker._datepickerShowing = true;\n\n\t\t\tif ( $.effects && $.effects.effect[ showAnim ] ) {\n\t\t\t\tinst.dpDiv.show( showAnim, $.datepicker._get( inst, \"showOptions\" ), duration );\n\t\t\t} else {\n\t\t\t\tinst.dpDiv[ showAnim || \"show\" ]( showAnim ? duration : null );\n\t\t\t}\n\n\t\t\tif ( $.datepicker._shouldFocusInput( inst ) ) {\n\t\t\t\tinst.input.trigger( \"focus\" );\n\t\t\t}\n\n\t\t\t$.datepicker._curInst = inst;\n\t\t}\n\t},\n\n\t/* Generate the date picker content. */\n\t_updateDatepicker: function( inst ) {\n\t\tthis.maxRows = 4; //Reset the max number of rows being displayed (see #7043)\n\t\tdatepicker_instActive = inst; // for delegate hover events\n\t\tinst.dpDiv.empty().append( this._generateHTML( inst ) );\n\t\tthis._attachHandlers( inst );\n\n\t\tvar origyearshtml,\n\t\t\tnumMonths = this._getNumberOfMonths( inst ),\n\t\t\tcols = numMonths[ 1 ],\n\t\t\twidth = 17,\n\t\t\tactiveCell = inst.dpDiv.find( \".\" + this._dayOverClass + \" a\" );\n\n\t\tif ( activeCell.length > 0 ) {\n\t\t\tdatepicker_handleMouseover.apply( activeCell.get( 0 ) );\n\t\t}\n\n\t\tinst.dpDiv.removeClass( \"ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4\" ).width( \"\" );\n\t\tif ( cols > 1 ) {\n\t\t\tinst.dpDiv.addClass( \"ui-datepicker-multi-\" + cols ).css( \"width\", ( width * cols ) + \"em\" );\n\t\t}\n\t\tinst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? \"add\" : \"remove\" ) +\n\t\t\t\"Class\" ]( \"ui-datepicker-multi\" );\n\t\tinst.dpDiv[ ( this._get( inst, \"isRTL\" ) ? \"add\" : \"remove\" ) +\n\t\t\t\"Class\" ]( \"ui-datepicker-rtl\" );\n\n\t\tif ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {\n\t\t\tinst.input.trigger( \"focus\" );\n\t\t}\n\n\t\t// Deffered render of the years select (to avoid flashes on Firefox)\n\t\tif ( inst.yearshtml ) {\n\t\t\torigyearshtml = inst.yearshtml;\n\t\t\tsetTimeout( function() {\n\n\t\t\t\t//assure that inst.yearshtml didn't change.\n\t\t\t\tif ( origyearshtml === inst.yearshtml && inst.yearshtml ) {\n\t\t\t\t\tinst.dpDiv.find( \"select.ui-datepicker-year:first\" ).replaceWith( inst.yearshtml );\n\t\t\t\t}\n\t\t\t\torigyearshtml = inst.yearshtml = null;\n\t\t\t}, 0 );\n\t\t}\n\t},\n\n\t// #6694 - don't focus the input if it's already focused\n\t// this breaks the change event in IE\n\t// Support: IE and jQuery <1.9\n\t_shouldFocusInput: function( inst ) {\n\t\treturn inst.input && inst.input.is( \":visible\" ) && !inst.input.is( \":disabled\" ) && !inst.input.is( \":focus\" );\n\t},\n\n\t/* Check positioning to remain on screen. */\n\t_checkOffset: function( inst, offset, isFixed ) {\n\t\tvar dpWidth = inst.dpDiv.outerWidth(),\n\t\t\tdpHeight = inst.dpDiv.outerHeight(),\n\t\t\tinputWidth = inst.input ? inst.input.outerWidth() : 0,\n\t\t\tinputHeight = inst.input ? inst.input.outerHeight() : 0,\n\t\t\tviewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),\n\t\t\tviewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );\n\n\t\toffset.left -= ( this._get( inst, \"isRTL\" ) ? ( dpWidth - inputWidth ) : 0 );\n\t\toffset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;\n\t\toffset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;\n\n\t\t// Now check if datepicker is showing outside window viewport - move to a better place if so.\n\t\toffset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?\n\t\t\tMath.abs( offset.left + dpWidth - viewWidth ) : 0 );\n\t\toffset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?\n\t\t\tMath.abs( dpHeight + inputHeight ) : 0 );\n\n\t\treturn offset;\n\t},\n\n\t/* Find an object's position on the screen. */\n\t_findPos: function( obj ) {\n\t\tvar position,\n\t\t\tinst = this._getInst( obj ),\n\t\t\tisRTL = this._get( inst, \"isRTL\" );\n\n\t\twhile ( obj && ( obj.type === \"hidden\" || obj.nodeType !== 1 || $.expr.filters.hidden( obj ) ) ) {\n\t\t\tobj = obj[ isRTL ? \"previousSibling\" : \"nextSibling\" ];\n\t\t}\n\n\t\tposition = $( obj ).offset();\n\t\treturn [ position.left, position.top ];\n\t},\n\n\t/* Hide the date picker from view.\n\t * @param input element - the input field attached to the date picker\n\t */\n\t_hideDatepicker: function( input ) {\n\t\tvar showAnim, duration, postProcess, onClose,\n\t\t\tinst = this._curInst;\n\n\t\tif ( !inst || ( input && inst !== $.data( input, \"datepicker\" ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._datepickerShowing ) {\n\t\t\tshowAnim = this._get( inst, \"showAnim\" );\n\t\t\tduration = this._get( inst, \"duration\" );\n\t\t\tpostProcess = function() {\n\t\t\t\t$.datepicker._tidyDialog( inst );\n\t\t\t};\n\n\t\t\t// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed\n\t\t\tif ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {\n\t\t\t\tinst.dpDiv.hide( showAnim, $.datepicker._get( inst, \"showOptions\" ), duration, postProcess );\n\t\t\t} else {\n\t\t\t\tinst.dpDiv[ ( showAnim === \"slideDown\" ? \"slideUp\" :\n\t\t\t\t\t( showAnim === \"fadeIn\" ? \"fadeOut\" : \"hide\" ) ) ]( ( showAnim ? duration : null ), postProcess );\n\t\t\t}\n\n\t\t\tif ( !showAnim ) {\n\t\t\t\tpostProcess();\n\t\t\t}\n\t\t\tthis._datepickerShowing = false;\n\n\t\t\tonClose = this._get( inst, \"onClose\" );\n\t\t\tif ( onClose ) {\n\t\t\t\tonClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : \"\" ), inst ] );\n\t\t\t}\n\n\t\t\tthis._lastInput = null;\n\t\t\tif ( this._inDialog ) {\n\t\t\t\tthis._dialogInput.css( { position: \"absolute\", left: \"0\", top: \"-100px\" } );\n\t\t\t\tif ( $.blockUI ) {\n\t\t\t\t\t$.unblockUI();\n\t\t\t\t\t$( \"body\" ).append( this.dpDiv );\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._inDialog = false;\n\t\t}\n\t},\n\n\t/* Tidy up after a dialog display. */\n\t_tidyDialog: function( inst ) {\n\t\tinst.dpDiv.removeClass( this._dialogClass ).off( \".ui-datepicker-calendar\" );\n\t},\n\n\t/* Close date picker if clicked elsewhere. */\n\t_checkExternalClick: function( event ) {\n\t\tif ( !$.datepicker._curInst ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $target = $( event.target ),\n\t\t\tinst = $.datepicker._getInst( $target[ 0 ] );\n\n\t\tif ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&\n\t\t\t\t$target.parents( \"#\" + $.datepicker._mainDivId ).length === 0 &&\n\t\t\t\t!$target.hasClass( $.datepicker.markerClassName ) &&\n\t\t\t\t!$target.closest( \".\" + $.datepicker._triggerClass ).length &&\n\t\t\t\t$.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||\n\t\t\t( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {\n\t\t\t\t$.datepicker._hideDatepicker();\n\t\t}\n\t},\n\n\t/* Adjust one of the date sub-fields. */\n\t_adjustDate: function( id, offset, period ) {\n\t\tvar target = $( id ),\n\t\t\tinst = this._getInst( target[ 0 ] );\n\n\t\tif ( this._isDisabledDatepicker( target[ 0 ] ) ) {\n\t\t\treturn;\n\t\t}\n\t\tthis._adjustInstDate( inst, offset +\n\t\t\t( period === \"M\" ? this._get( inst, \"showCurrentAtPos\" ) : 0 ), // undo positioning\n\t\t\tperiod );\n\t\tthis._updateDatepicker( inst );\n\t},\n\n\t/* Action for current link. */\n\t_gotoToday: function( id ) {\n\t\tvar date,\n\t\t\ttarget = $( id ),\n\t\t\tinst = this._getInst( target[ 0 ] );\n\n\t\tif ( this._get( inst, \"gotoCurrent\" ) && inst.currentDay ) {\n\t\t\tinst.selectedDay = inst.currentDay;\n\t\t\tinst.drawMonth = inst.selectedMonth = inst.currentMonth;\n\t\t\tinst.drawYear = inst.selectedYear = inst.currentYear;\n\t\t} else {\n\t\t\tdate = new Date();\n\t\t\tinst.selectedDay = date.getDate();\n\t\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\n\t\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\n\t\t}\n\t\tthis._notifyChange( inst );\n\t\tthis._adjustDate( target );\n\t},\n\n\t/* Action for selecting a new month/year. */\n\t_selectMonthYear: function( id, select, period ) {\n\t\tvar target = $( id ),\n\t\t\tinst = this._getInst( target[ 0 ] );\n\n\t\tinst[ \"selected\" + ( period === \"M\" ? \"Month\" : \"Year\" ) ] =\n\t\tinst[ \"draw\" + ( period === \"M\" ? \"Month\" : \"Year\" ) ] =\n\t\t\tparseInt( select.options[ select.selectedIndex ].value, 10 );\n\n\t\tthis._notifyChange( inst );\n\t\tthis._adjustDate( target );\n\t},\n\n\t/* Action for selecting a day. */\n\t_selectDay: function( id, month, year, td ) {\n\t\tvar inst,\n\t\t\ttarget = $( id );\n\n\t\tif ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinst = this._getInst( target[ 0 ] );\n\t\tinst.selectedDay = inst.currentDay = $( \"a\", td ).html();\n\t\tinst.selectedMonth = inst.currentMonth = month;\n\t\tinst.selectedYear = inst.currentYear = year;\n\t\tthis._selectDate( id, this._formatDate( inst,\n\t\t\tinst.currentDay, inst.currentMonth, inst.currentYear ) );\n\t},\n\n\t/* Erase the input field and hide the date picker. */\n\t_clearDate: function( id ) {\n\t\tvar target = $( id );\n\t\tthis._selectDate( target, \"\" );\n\t},\n\n\t/* Update the input field with the selected date. */\n\t_selectDate: function( id, dateStr ) {\n\t\tvar onSelect,\n\t\t\ttarget = $( id ),\n\t\t\tinst = this._getInst( target[ 0 ] );\n\n\t\tdateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );\n\t\tif ( inst.input ) {\n\t\t\tinst.input.val( dateStr );\n\t\t}\n\t\tthis._updateAlternate( inst );\n\n\t\tonSelect = this._get( inst, \"onSelect\" );\n\t\tif ( onSelect ) {\n\t\t\tonSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); // trigger custom callback\n\t\t} else if ( inst.input ) {\n\t\t\tinst.input.trigger( \"change\" ); // fire the change event\n\t\t}\n\n\t\tif ( inst.inline ) {\n\t\t\tthis._updateDatepicker( inst );\n\t\t} else {\n\t\t\tthis._hideDatepicker();\n\t\t\tthis._lastInput = inst.input[ 0 ];\n\t\t\tif ( typeof( inst.input[ 0 ] ) !== \"object\" ) {\n\t\t\t\tinst.input.trigger( \"focus\" ); // restore focus\n\t\t\t}\n\t\t\tthis._lastInput = null;\n\t\t}\n\t},\n\n\t/* Update any alternate field to synchronise with the main field. */\n\t_updateAlternate: function( inst ) {\n\t\tvar altFormat, date, dateStr,\n\t\t\taltField = this._get( inst, \"altField\" );\n\n\t\tif ( altField ) { // update alternate field too\n\t\t\taltFormat = this._get( inst, \"altFormat\" ) || this._get( inst, \"dateFormat\" );\n\t\t\tdate = this._getDate( inst );\n\t\t\tdateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );\n\t\t\t$( altField ).val( dateStr );\n\t\t}\n\t},\n\n\t/* Set as beforeShowDay function to prevent selection of weekends.\n\t * @param date Date - the date to customise\n\t * @return [boolean, string] - is this date selectable?, what is its CSS class?\n\t */\n\tnoWeekends: function( date ) {\n\t\tvar day = date.getDay();\n\t\treturn [ ( day > 0 && day < 6 ), \"\" ];\n\t},\n\n\t/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.\n\t * @param date Date - the date to get the week for\n\t * @return number - the number of the week within the year that contains this date\n\t */\n\tiso8601Week: function( date ) {\n\t\tvar time,\n\t\t\tcheckDate = new Date( date.getTime() );\n\n\t\t// Find Thursday of this week starting on Monday\n\t\tcheckDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );\n\n\t\ttime = checkDate.getTime();\n\t\tcheckDate.setMonth( 0 ); // Compare with Jan 1\n\t\tcheckDate.setDate( 1 );\n\t\treturn Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;\n\t},\n\n\t/* Parse a string value into a date object.\n\t * See formatDate below for the possible formats.\n\t *\n\t * @param format string - the expected format of the date\n\t * @param value string - the date in the above format\n\t * @param settings Object - attributes include:\n\t *\t\t\t\t\tshortYearCutoff number - the cutoff year for determining the century (optional)\n\t *\t\t\t\t\tdayNamesShort\tstring[7] - abbreviated names of the days from Sunday (optional)\n\t *\t\t\t\t\tdayNames\t\tstring[7] - names of the days from Sunday (optional)\n\t *\t\t\t\t\tmonthNamesShort string[12] - abbreviated names of the months (optional)\n\t *\t\t\t\t\tmonthNames\t\tstring[12] - names of the months (optional)\n\t * @return Date - the extracted date value or null if value is blank\n\t */\n\tparseDate: function( format, value, settings ) {\n\t\tif ( format == null || value == null ) {\n\t\t\tthrow \"Invalid arguments\";\n\t\t}\n\n\t\tvalue = ( typeof value === \"object\" ? value.toString() : value + \"\" );\n\t\tif ( value === \"\" ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tvar iFormat, dim, extra,\n\t\t\tiValue = 0,\n\t\t\tshortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,\n\t\t\tshortYearCutoff = ( typeof shortYearCutoffTemp !== \"string\" ? shortYearCutoffTemp :\n\t\t\t\tnew Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),\n\t\t\tdayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,\n\t\t\tdayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,\n\t\t\tmonthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,\n\t\t\tmonthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,\n\t\t\tyear = -1,\n\t\t\tmonth = -1,\n\t\t\tday = -1,\n\t\t\tdoy = -1,\n\t\t\tliteral = false,\n\t\t\tdate,\n\n\t\t\t// Check whether a format character is doubled\n\t\t\tlookAhead = function( match ) {\n\t\t\t\tvar matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );\n\t\t\t\tif ( matches ) {\n\t\t\t\t\tiFormat++;\n\t\t\t\t}\n\t\t\t\treturn matches;\n\t\t\t},\n\n\t\t\t// Extract a number from the string value\n\t\t\tgetNumber = function( match ) {\n\t\t\t\tvar isDoubled = lookAhead( match ),\n\t\t\t\t\tsize = ( match === \"@\" ? 14 : ( match === \"!\" ? 20 :\n\t\t\t\t\t( match === \"y\" && isDoubled ? 4 : ( match === \"o\" ? 3 : 2 ) ) ) ),\n\t\t\t\t\tminSize = ( match === \"y\" ? size : 1 ),\n\t\t\t\t\tdigits = new RegExp( \"^\\\\d{\" + minSize + \",\" + size + \"}\" ),\n\t\t\t\t\tnum = value.substring( iValue ).match( digits );\n\t\t\t\tif ( !num ) {\n\t\t\t\t\tthrow \"Missing number at position \" + iValue;\n\t\t\t\t}\n\t\t\t\tiValue += num[ 0 ].length;\n\t\t\t\treturn parseInt( num[ 0 ], 10 );\n\t\t\t},\n\n\t\t\t// Extract a name from the string value and convert to an index\n\t\t\tgetName = function( match, shortNames, longNames ) {\n\t\t\t\tvar index = -1,\n\t\t\t\t\tnames = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {\n\t\t\t\t\t\treturn [ [ k, v ] ];\n\t\t\t\t\t} ).sort( function( a, b ) {\n\t\t\t\t\t\treturn -( a[ 1 ].length - b[ 1 ].length );\n\t\t\t\t\t} );\n\n\t\t\t\t$.each( names, function( i, pair ) {\n\t\t\t\t\tvar name = pair[ 1 ];\n\t\t\t\t\tif ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {\n\t\t\t\t\t\tindex = pair[ 0 ];\n\t\t\t\t\t\tiValue += name.length;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\treturn index + 1;\n\t\t\t\t} else {\n\t\t\t\t\tthrow \"Unknown name at position \" + iValue;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// Confirm that a literal character matches the string value\n\t\t\tcheckLiteral = function() {\n\t\t\t\tif ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {\n\t\t\t\t\tthrow \"Unexpected literal at position \" + iValue;\n\t\t\t\t}\n\t\t\t\tiValue++;\n\t\t\t};\n\n\t\tfor ( iFormat = 0; iFormat < format.length; iFormat++ ) {\n\t\t\tif ( literal ) {\n\t\t\t\tif ( format.charAt( iFormat ) === \"'\" && !lookAhead( \"'\" ) ) {\n\t\t\t\t\tliteral = false;\n\t\t\t\t} else {\n\t\t\t\t\tcheckLiteral();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch ( format.charAt( iFormat ) ) {\n\t\t\t\t\tcase \"d\":\n\t\t\t\t\t\tday = getNumber( \"d\" );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"D\":\n\t\t\t\t\t\tgetName( \"D\", dayNamesShort, dayNames );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"o\":\n\t\t\t\t\t\tdoy = getNumber( \"o\" );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"m\":\n\t\t\t\t\t\tmonth = getNumber( \"m\" );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"M\":\n\t\t\t\t\t\tmonth = getName( \"M\", monthNamesShort, monthNames );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"y\":\n\t\t\t\t\t\tyear = getNumber( \"y\" );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"@\":\n\t\t\t\t\t\tdate = new Date( getNumber( \"@\" ) );\n\t\t\t\t\t\tyear = date.getFullYear();\n\t\t\t\t\t\tmonth = date.getMonth() + 1;\n\t\t\t\t\t\tday = date.getDate();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"!\":\n\t\t\t\t\t\tdate = new Date( ( getNumber( \"!\" ) - this._ticksTo1970 ) / 10000 );\n\t\t\t\t\t\tyear = date.getFullYear();\n\t\t\t\t\t\tmonth = date.getMonth() + 1;\n\t\t\t\t\t\tday = date.getDate();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"'\":\n\t\t\t\t\t\tif ( lookAhead( \"'\" ) ) {\n\t\t\t\t\t\t\tcheckLiteral();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tliteral = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcheckLiteral();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( iValue < value.length ) {\n\t\t\textra = value.substr( iValue );\n\t\t\tif ( !/^\\s+/.test( extra ) ) {\n\t\t\t\tthrow \"Extra/unparsed characters found in date: \" + extra;\n\t\t\t}\n\t\t}\n\n\t\tif ( year === -1 ) {\n\t\t\tyear = new Date().getFullYear();\n\t\t} else if ( year < 100 ) {\n\t\t\tyear += new Date().getFullYear() - new Date().getFullYear() % 100 +\n\t\t\t\t( year <= shortYearCutoff ? 0 : -100 );\n\t\t}\n\n\t\tif ( doy > -1 ) {\n\t\t\tmonth = 1;\n\t\t\tday = doy;\n\t\t\tdo {\n\t\t\t\tdim = this._getDaysInMonth( year, month - 1 );\n\t\t\t\tif ( day <= dim ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmonth++;\n\t\t\t\tday -= dim;\n\t\t\t} while ( true );\n\t\t}\n\n\t\tdate = this._daylightSavingAdjust( new Date( year, month - 1, day ) );\n\t\tif ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {\n\t\t\tthrow \"Invalid date\"; // E.g. 31/02/00\n\t\t}\n\t\treturn date;\n\t},\n\n\t/* Standard date formats. */\n\tATOM: \"yy-mm-dd\", // RFC 3339 (ISO 8601)\n\tCOOKIE: \"D, dd M yy\",\n\tISO_8601: \"yy-mm-dd\",\n\tRFC_822: \"D, d M y\",\n\tRFC_850: \"DD, dd-M-y\",\n\tRFC_1036: \"D, d M y\",\n\tRFC_1123: \"D, d M yy\",\n\tRFC_2822: \"D, d M yy\",\n\tRSS: \"D, d M y\", // RFC 822\n\tTICKS: \"!\",\n\tTIMESTAMP: \"@\",\n\tW3C: \"yy-mm-dd\", // ISO 8601\n\n\t_ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +\n\t\tMath.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),\n\n\t/* Format a date object into a string value.\n\t * The format can be combinations of the following:\n\t * d - day of month (no leading zero)\n\t * dd - day of month (two digit)\n\t * o - day of year (no leading zeros)\n\t * oo - day of year (three digit)\n\t * D - day name short\n\t * DD - day name long\n\t * m - month of year (no leading zero)\n\t * mm - month of year (two digit)\n\t * M - month name short\n\t * MM - month name long\n\t * y - year (two digit)\n\t * yy - year (four digit)\n\t * @ - Unix timestamp (ms since 01/01/1970)\n\t * ! - Windows ticks (100ns since 01/01/0001)\n\t * \"...\" - literal text\n\t * '' - single quote\n\t *\n\t * @param format string - the desired format of the date\n\t * @param date Date - the date value to format\n\t * @param settings Object - attributes include:\n\t *\t\t\t\t\tdayNamesShort\tstring[7] - abbreviated names of the days from Sunday (optional)\n\t *\t\t\t\t\tdayNames\t\tstring[7] - names of the days from Sunday (optional)\n\t *\t\t\t\t\tmonthNamesShort string[12] - abbreviated names of the months (optional)\n\t *\t\t\t\t\tmonthNames\t\tstring[12] - names of the months (optional)\n\t * @return string - the date in the above format\n\t */\n\tformatDate: function( format, date, settings ) {\n\t\tif ( !date ) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tvar iFormat,\n\t\t\tdayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,\n\t\t\tdayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,\n\t\t\tmonthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,\n\t\t\tmonthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,\n\n\t\t\t// Check whether a format character is doubled\n\t\t\tlookAhead = function( match ) {\n\t\t\t\tvar matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );\n\t\t\t\tif ( matches ) {\n\t\t\t\t\tiFormat++;\n\t\t\t\t}\n\t\t\t\treturn matches;\n\t\t\t},\n\n\t\t\t// Format a number, with leading zero if necessary\n\t\t\tformatNumber = function( match, value, len ) {\n\t\t\t\tvar num = \"\" + value;\n\t\t\t\tif ( lookAhead( match ) ) {\n\t\t\t\t\twhile ( num.length < len ) {\n\t\t\t\t\t\tnum = \"0\" + num;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn num;\n\t\t\t},\n\n\t\t\t// Format a name, short or long as requested\n\t\t\tformatName = function( match, value, shortNames, longNames ) {\n\t\t\t\treturn ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );\n\t\t\t},\n\t\t\toutput = \"\",\n\t\t\tliteral = false;\n\n\t\tif ( date ) {\n\t\t\tfor ( iFormat = 0; iFormat < format.length; iFormat++ ) {\n\t\t\t\tif ( literal ) {\n\t\t\t\t\tif ( format.charAt( iFormat ) === \"'\" && !lookAhead( \"'\" ) ) {\n\t\t\t\t\t\tliteral = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput += format.charAt( iFormat );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tswitch ( format.charAt( iFormat ) ) {\n\t\t\t\t\t\tcase \"d\":\n\t\t\t\t\t\t\toutput += formatNumber( \"d\", date.getDate(), 2 );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"D\":\n\t\t\t\t\t\t\toutput += formatName( \"D\", date.getDay(), dayNamesShort, dayNames );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"o\":\n\t\t\t\t\t\t\toutput += formatNumber( \"o\",\n\t\t\t\t\t\t\t\tMath.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"m\":\n\t\t\t\t\t\t\toutput += formatNumber( \"m\", date.getMonth() + 1, 2 );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"M\":\n\t\t\t\t\t\t\toutput += formatName( \"M\", date.getMonth(), monthNamesShort, monthNames );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"y\":\n\t\t\t\t\t\t\toutput += ( lookAhead( \"y\" ) ? date.getFullYear() :\n\t\t\t\t\t\t\t\t( date.getFullYear() % 100 < 10 ? \"0\" : \"\" ) + date.getFullYear() % 100 );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"@\":\n\t\t\t\t\t\t\toutput += date.getTime();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"!\":\n\t\t\t\t\t\t\toutput += date.getTime() * 10000 + this._ticksTo1970;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"'\":\n\t\t\t\t\t\t\tif ( lookAhead( \"'\" ) ) {\n\t\t\t\t\t\t\t\toutput += \"'\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tliteral = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\toutput += format.charAt( iFormat );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t},\n\n\t/* Extract all possible characters from the date format. */\n\t_possibleChars: function( format ) {\n\t\tvar iFormat,\n\t\t\tchars = \"\",\n\t\t\tliteral = false,\n\n\t\t\t// Check whether a format character is doubled\n\t\t\tlookAhead = function( match ) {\n\t\t\t\tvar matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );\n\t\t\t\tif ( matches ) {\n\t\t\t\t\tiFormat++;\n\t\t\t\t}\n\t\t\t\treturn matches;\n\t\t\t};\n\n\t\tfor ( iFormat = 0; iFormat < format.length; iFormat++ ) {\n\t\t\tif ( literal ) {\n\t\t\t\tif ( format.charAt( iFormat ) === \"'\" && !lookAhead( \"'\" ) ) {\n\t\t\t\t\tliteral = false;\n\t\t\t\t} else {\n\t\t\t\t\tchars += format.charAt( iFormat );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch ( format.charAt( iFormat ) ) {\n\t\t\t\t\tcase \"d\": case \"m\": case \"y\": case \"@\":\n\t\t\t\t\t\tchars += \"0123456789\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"D\": case \"M\":\n\t\t\t\t\t\treturn null; // Accept anything\n\t\t\t\t\tcase \"'\":\n\t\t\t\t\t\tif ( lookAhead( \"'\" ) ) {\n\t\t\t\t\t\t\tchars += \"'\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tliteral = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tchars += format.charAt( iFormat );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn chars;\n\t},\n\n\t/* Get a setting value, defaulting if necessary. */\n\t_get: function( inst, name ) {\n\t\treturn inst.settings[ name ] !== undefined ?\n\t\t\tinst.settings[ name ] : this._defaults[ name ];\n\t},\n\n\t/* Parse existing date and initialise date picker. */\n\t_setDateFromField: function( inst, noDefault ) {\n\t\tif ( inst.input.val() === inst.lastVal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar dateFormat = this._get( inst, \"dateFormat\" ),\n\t\t\tdates = inst.lastVal = inst.input ? inst.input.val() : null,\n\t\t\tdefaultDate = this._getDefaultDate( inst ),\n\t\t\tdate = defaultDate,\n\t\t\tsettings = this._getFormatConfig( inst );\n\n\t\ttry {\n\t\t\tdate = this.parseDate( dateFormat, dates, settings ) || defaultDate;\n\t\t} catch ( event ) {\n\t\t\tdates = ( noDefault ? \"\" : dates );\n\t\t}\n\t\tinst.selectedDay = date.getDate();\n\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\n\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\n\t\tinst.currentDay = ( dates ? date.getDate() : 0 );\n\t\tinst.currentMonth = ( dates ? date.getMonth() : 0 );\n\t\tinst.currentYear = ( dates ? date.getFullYear() : 0 );\n\t\tthis._adjustInstDate( inst );\n\t},\n\n\t/* Retrieve the default date shown on opening. */\n\t_getDefaultDate: function( inst ) {\n\t\treturn this._restrictMinMax( inst,\n\t\t\tthis._determineDate( inst, this._get( inst, \"defaultDate\" ), new Date() ) );\n\t},\n\n\t/* A date may be specified as an exact value or a relative one. */\n\t_determineDate: function( inst, date, defaultDate ) {\n\t\tvar offsetNumeric = function( offset ) {\n\t\t\t\tvar date = new Date();\n\t\t\t\tdate.setDate( date.getDate() + offset );\n\t\t\t\treturn date;\n\t\t\t},\n\t\t\toffsetString = function( offset ) {\n\t\t\t\ttry {\n\t\t\t\t\treturn $.datepicker.parseDate( $.datepicker._get( inst, \"dateFormat\" ),\n\t\t\t\t\t\toffset, $.datepicker._getFormatConfig( inst ) );\n\t\t\t\t}\n\t\t\t\tcatch ( e ) {\n\n\t\t\t\t\t// Ignore\n\t\t\t\t}\n\n\t\t\t\tvar date = ( offset.toLowerCase().match( /^c/ ) ?\n\t\t\t\t\t$.datepicker._getDate( inst ) : null ) || new Date(),\n\t\t\t\t\tyear = date.getFullYear(),\n\t\t\t\t\tmonth = date.getMonth(),\n\t\t\t\t\tday = date.getDate(),\n\t\t\t\t\tpattern = /([+\\-]?[0-9]+)\\s*(d|D|w|W|m|M|y|Y)?/g,\n\t\t\t\t\tmatches = pattern.exec( offset );\n\n\t\t\t\twhile ( matches ) {\n\t\t\t\t\tswitch ( matches[ 2 ] || \"d\" ) {\n\t\t\t\t\t\tcase \"d\" : case \"D\" :\n\t\t\t\t\t\t\tday += parseInt( matches[ 1 ], 10 ); break;\n\t\t\t\t\t\tcase \"w\" : case \"W\" :\n\t\t\t\t\t\t\tday += parseInt( matches[ 1 ], 10 ) * 7; break;\n\t\t\t\t\t\tcase \"m\" : case \"M\" :\n\t\t\t\t\t\t\tmonth += parseInt( matches[ 1 ], 10 );\n\t\t\t\t\t\t\tday = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"y\": case \"Y\" :\n\t\t\t\t\t\t\tyear += parseInt( matches[ 1 ], 10 );\n\t\t\t\t\t\t\tday = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmatches = pattern.exec( offset );\n\t\t\t\t}\n\t\t\t\treturn new Date( year, month, day );\n\t\t\t},\n\t\t\tnewDate = ( date == null || date === \"\" ? defaultDate : ( typeof date === \"string\" ? offsetString( date ) :\n\t\t\t\t( typeof date === \"number\" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) );\n\n\t\tnewDate = ( newDate && newDate.toString() === \"Invalid Date\" ? defaultDate : newDate );\n\t\tif ( newDate ) {\n\t\t\tnewDate.setHours( 0 );\n\t\t\tnewDate.setMinutes( 0 );\n\t\t\tnewDate.setSeconds( 0 );\n\t\t\tnewDate.setMilliseconds( 0 );\n\t\t}\n\t\treturn this._daylightSavingAdjust( newDate );\n\t},\n\n\t/* Handle switch to/from daylight saving.\n\t * Hours may be non-zero on daylight saving cut-over:\n\t * > 12 when midnight changeover, but then cannot generate\n\t * midnight datetime, so jump to 1AM, otherwise reset.\n\t * @param date (Date) the date to check\n\t * @return (Date) the corrected date\n\t */\n\t_daylightSavingAdjust: function( date ) {\n\t\tif ( !date ) {\n\t\t\treturn null;\n\t\t}\n\t\tdate.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 );\n\t\treturn date;\n\t},\n\n\t/* Set the date(s) directly. */\n\t_setDate: function( inst, date, noChange ) {\n\t\tvar clear = !date,\n\t\t\torigMonth = inst.selectedMonth,\n\t\t\torigYear = inst.selectedYear,\n\t\t\tnewDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) );\n\n\t\tinst.selectedDay = inst.currentDay = newDate.getDate();\n\t\tinst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();\n\t\tinst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();\n\t\tif ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) {\n\t\t\tthis._notifyChange( inst );\n\t\t}\n\t\tthis._adjustInstDate( inst );\n\t\tif ( inst.input ) {\n\t\t\tinst.input.val( clear ? \"\" : this._formatDate( inst ) );\n\t\t}\n\t},\n\n\t/* Retrieve the date(s) directly. */\n\t_getDate: function( inst ) {\n\t\tvar startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === \"\" ) ? null :\n\t\t\tthis._daylightSavingAdjust( new Date(\n\t\t\tinst.currentYear, inst.currentMonth, inst.currentDay ) ) );\n\t\t\treturn startDate;\n\t},\n\n\t/* Attach the onxxx handlers. These are declared statically so\n\t * they work with static code transformers like Caja.\n\t */\n\t_attachHandlers: function( inst ) {\n\t\tvar stepMonths = this._get( inst, \"stepMonths\" ),\n\t\t\tid = \"#\" + inst.id.replace( /\\\\\\\\/g, \"\\\\\" );\n\t\tinst.dpDiv.find( \"[data-handler]\" ).map( function() {\n\t\t\tvar handler = {\n\t\t\t\tprev: function() {\n\t\t\t\t\t$.datepicker._adjustDate( id, -stepMonths, \"M\" );\n\t\t\t\t},\n\t\t\t\tnext: function() {\n\t\t\t\t\t$.datepicker._adjustDate( id, +stepMonths, \"M\" );\n\t\t\t\t},\n\t\t\t\thide: function() {\n\t\t\t\t\t$.datepicker._hideDatepicker();\n\t\t\t\t},\n\t\t\t\ttoday: function() {\n\t\t\t\t\t$.datepicker._gotoToday( id );\n\t\t\t\t},\n\t\t\t\tselectDay: function() {\n\t\t\t\t\t$.datepicker._selectDay( id, +this.getAttribute( \"data-month\" ), +this.getAttribute( \"data-year\" ), this );\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tselectMonth: function() {\n\t\t\t\t\t$.datepicker._selectMonthYear( id, this, \"M\" );\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tselectYear: function() {\n\t\t\t\t\t$.datepicker._selectMonthYear( id, this, \"Y\" );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\t\t\t$( this ).on( this.getAttribute( \"data-event\" ), handler[ this.getAttribute( \"data-handler\" ) ] );\n\t\t} );\n\t},\n\n\t/* Generate the HTML for the current state of the date picker. */\n\t_generateHTML: function( inst ) {\n\t\tvar maxDraw, prevText, prev, nextText, next, currentText, gotoDate,\n\t\t\tcontrols, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,\n\t\t\tmonthNames, monthNamesShort, beforeShowDay, showOtherMonths,\n\t\t\tselectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,\n\t\t\tcornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,\n\t\t\tprintDate, dRow, tbody, daySettings, otherMonth, unselectable,\n\t\t\ttempDate = new Date(),\n\t\t\ttoday = this._daylightSavingAdjust(\n\t\t\t\tnew Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time\n\t\t\tisRTL = this._get( inst, \"isRTL\" ),\n\t\t\tshowButtonPanel = this._get( inst, \"showButtonPanel\" ),\n\t\t\thideIfNoPrevNext = this._get( inst, \"hideIfNoPrevNext\" ),\n\t\t\tnavigationAsDateFormat = this._get( inst, \"navigationAsDateFormat\" ),\n\t\t\tnumMonths = this._getNumberOfMonths( inst ),\n\t\t\tshowCurrentAtPos = this._get( inst, \"showCurrentAtPos\" ),\n\t\t\tstepMonths = this._get( inst, \"stepMonths\" ),\n\t\t\tisMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ),\n\t\t\tcurrentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) :\n\t\t\t\tnew Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ),\n\t\t\tminDate = this._getMinMaxDate( inst, \"min\" ),\n\t\t\tmaxDate = this._getMinMaxDate( inst, \"max\" ),\n\t\t\tdrawMonth = inst.drawMonth - showCurrentAtPos,\n\t\t\tdrawYear = inst.drawYear;\n\n\t\tif ( drawMonth < 0 ) {\n\t\t\tdrawMonth += 12;\n\t\t\tdrawYear--;\n\t\t}\n\t\tif ( maxDate ) {\n\t\t\tmaxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(),\n\t\t\t\tmaxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) );\n\t\t\tmaxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw );\n\t\t\twhile ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) {\n\t\t\t\tdrawMonth--;\n\t\t\t\tif ( drawMonth < 0 ) {\n\t\t\t\t\tdrawMonth = 11;\n\t\t\t\t\tdrawYear--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tinst.drawMonth = drawMonth;\n\t\tinst.drawYear = drawYear;\n\n\t\tprevText = this._get( inst, \"prevText\" );\n\t\tprevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText,\n\t\t\tthis._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),\n\t\t\tthis._getFormatConfig( inst ) ) );\n\n\t\tprev = ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ?\n\t\t\t\"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'\" +\n\t\t\t\" title='\" + prevText + \"'><span class='ui-icon ui-icon-circle-triangle-\" + ( isRTL ? \"e\" : \"w\" ) + \"'>\" + prevText + \"</span></a>\" :\n\t\t\t( hideIfNoPrevNext ? \"\" : \"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='\" + prevText + \"'><span class='ui-icon ui-icon-circle-triangle-\" + ( isRTL ? \"e\" : \"w\" ) + \"'>\" + prevText + \"</span></a>\" ) );\n\n\t\tnextText = this._get( inst, \"nextText\" );\n\t\tnextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,\n\t\t\tthis._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),\n\t\t\tthis._getFormatConfig( inst ) ) );\n\n\t\tnext = ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ?\n\t\t\t\"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'\" +\n\t\t\t\" title='\" + nextText + \"'><span class='ui-icon ui-icon-circle-triangle-\" + ( isRTL ? \"w\" : \"e\" ) + \"'>\" + nextText + \"</span></a>\" :\n\t\t\t( hideIfNoPrevNext ? \"\" : \"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='\" + nextText + \"'><span class='ui-icon ui-icon-circle-triangle-\" + ( isRTL ? \"w\" : \"e\" ) + \"'>\" + nextText + \"</span></a>\" ) );\n\n\t\tcurrentText = this._get( inst, \"currentText\" );\n\t\tgotoDate = ( this._get( inst, \"gotoCurrent\" ) && inst.currentDay ? currentDate : today );\n\t\tcurrentText = ( !navigationAsDateFormat ? currentText :\n\t\t\tthis.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );\n\n\t\tcontrols = ( !inst.inline ? \"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>\" +\n\t\t\tthis._get( inst, \"closeText\" ) + \"</button>\" : \"\" );\n\n\t\tbuttonPanel = ( showButtonPanel ) ? \"<div class='ui-datepicker-buttonpane ui-widget-content'>\" + ( isRTL ? controls : \"\" ) +\n\t\t\t( this._isInRange( inst, gotoDate ) ? \"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'\" +\n\t\t\t\">\" + currentText + \"</button>\" : \"\" ) + ( isRTL ? \"\" : controls ) + \"</div>\" : \"\";\n\n\t\tfirstDay = parseInt( this._get( inst, \"firstDay\" ), 10 );\n\t\tfirstDay = ( isNaN( firstDay ) ? 0 : firstDay );\n\n\t\tshowWeek = this._get( inst, \"showWeek\" );\n\t\tdayNames = this._get( inst, \"dayNames\" );\n\t\tdayNamesMin = this._get( inst, \"dayNamesMin\" );\n\t\tmonthNames = this._get( inst, \"monthNames\" );\n\t\tmonthNamesShort = this._get( inst, \"monthNamesShort\" );\n\t\tbeforeShowDay = this._get( inst, \"beforeShowDay\" );\n\t\tshowOtherMonths = this._get( inst, \"showOtherMonths\" );\n\t\tselectOtherMonths = this._get( inst, \"selectOtherMonths\" );\n\t\tdefaultDate = this._getDefaultDate( inst );\n\t\thtml = \"\";\n\n\t\tfor ( row = 0; row < numMonths[ 0 ]; row++ ) {\n\t\t\tgroup = \"\";\n\t\t\tthis.maxRows = 4;\n\t\t\tfor ( col = 0; col < numMonths[ 1 ]; col++ ) {\n\t\t\t\tselectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) );\n\t\t\t\tcornerClass = \" ui-corner-all\";\n\t\t\t\tcalender = \"\";\n\t\t\t\tif ( isMultiMonth ) {\n\t\t\t\t\tcalender += \"<div class='ui-datepicker-group\";\n\t\t\t\t\tif ( numMonths[ 1 ] > 1 ) {\n\t\t\t\t\t\tswitch ( col ) {\n\t\t\t\t\t\t\tcase 0: calender += \" ui-datepicker-group-first\";\n\t\t\t\t\t\t\t\tcornerClass = \" ui-corner-\" + ( isRTL ? \"right\" : \"left\" ); break;\n\t\t\t\t\t\t\tcase numMonths[ 1 ] - 1: calender += \" ui-datepicker-group-last\";\n\t\t\t\t\t\t\t\tcornerClass = \" ui-corner-\" + ( isRTL ? \"left\" : \"right\" ); break;\n\t\t\t\t\t\t\tdefault: calender += \" ui-datepicker-group-middle\"; cornerClass = \"\"; break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcalender += \"'>\";\n\t\t\t\t}\n\t\t\t\tcalender += \"<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix\" + cornerClass + \"'>\" +\n\t\t\t\t\t( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : \"\" ) +\n\t\t\t\t\t( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : \"\" ) +\n\t\t\t\t\tthis._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate,\n\t\t\t\t\trow > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers\n\t\t\t\t\t\"</div><table class='ui-datepicker-calendar'><thead>\" +\n\t\t\t\t\t\"<tr>\";\n\t\t\t\tthead = ( showWeek ? \"<th class='ui-datepicker-week-col'>\" + this._get( inst, \"weekHeader\" ) + \"</th>\" : \"\" );\n\t\t\t\tfor ( dow = 0; dow < 7; dow++ ) { // days of the week\n\t\t\t\t\tday = ( dow + firstDay ) % 7;\n\t\t\t\t\tthead += \"<th scope='col'\" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? \" class='ui-datepicker-week-end'\" : \"\" ) + \">\" +\n\t\t\t\t\t\t\"<span title='\" + dayNames[ day ] + \"'>\" + dayNamesMin[ day ] + \"</span></th>\";\n\t\t\t\t}\n\t\t\t\tcalender += thead + \"</tr></thead><tbody>\";\n\t\t\t\tdaysInMonth = this._getDaysInMonth( drawYear, drawMonth );\n\t\t\t\tif ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) {\n\t\t\t\t\tinst.selectedDay = Math.min( inst.selectedDay, daysInMonth );\n\t\t\t\t}\n\t\t\t\tleadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7;\n\t\t\t\tcurRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate\n\t\t\t\tnumRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043)\n\t\t\t\tthis.maxRows = numRows;\n\t\t\t\tprintDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) );\n\t\t\t\tfor ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows\n\t\t\t\t\tcalender += \"<tr>\";\n\t\t\t\t\ttbody = ( !showWeek ? \"\" : \"<td class='ui-datepicker-week-col'>\" +\n\t\t\t\t\t\tthis._get( inst, \"calculateWeek\" )( printDate ) + \"</td>\" );\n\t\t\t\t\tfor ( dow = 0; dow < 7; dow++ ) { // create date picker days\n\t\t\t\t\t\tdaySettings = ( beforeShowDay ?\n\t\t\t\t\t\t\tbeforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, \"\" ] );\n\t\t\t\t\t\totherMonth = ( printDate.getMonth() !== drawMonth );\n\t\t\t\t\t\tunselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] ||\n\t\t\t\t\t\t\t( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate );\n\t\t\t\t\t\ttbody += \"<td class='\" +\n\t\t\t\t\t\t\t( ( dow + firstDay + 6 ) % 7 >= 5 ? \" ui-datepicker-week-end\" : \"\" ) + // highlight weekends\n\t\t\t\t\t\t\t( otherMonth ? \" ui-datepicker-other-month\" : \"\" ) + // highlight days from other months\n\t\t\t\t\t\t\t( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key\n\t\t\t\t\t\t\t( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ?\n\n\t\t\t\t\t\t\t// or defaultDate is current printedDate and defaultDate is selectedDate\n\t\t\t\t\t\t\t\" \" + this._dayOverClass : \"\" ) + // highlight selected day\n\t\t\t\t\t\t\t( unselectable ? \" \" + this._unselectableClass + \" ui-state-disabled\" : \"\" ) + // highlight unselectable days\n\t\t\t\t\t\t\t( otherMonth && !showOtherMonths ? \"\" : \" \" + daySettings[ 1 ] + // highlight custom dates\n\t\t\t\t\t\t\t( printDate.getTime() === currentDate.getTime() ? \" \" + this._currentClass : \"\" ) + // highlight selected day\n\t\t\t\t\t\t\t( printDate.getTime() === today.getTime() ? \" ui-datepicker-today\" : \"\" ) ) + \"'\" + // highlight today (if different)\n\t\t\t\t\t\t\t( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? \" title='\" + daySettings[ 2 ].replace( /'/g, \"'\" ) + \"'\" : \"\" ) + // cell title\n\t\t\t\t\t\t\t( unselectable ? \"\" : \" data-handler='selectDay' data-event='click' data-month='\" + printDate.getMonth() + \"' data-year='\" + printDate.getFullYear() + \"'\" ) + \">\" + // actions\n\t\t\t\t\t\t\t( otherMonth && !showOtherMonths ? \" \" : // display for other months\n\t\t\t\t\t\t\t( unselectable ? \"<span class='ui-state-default'>\" + printDate.getDate() + \"</span>\" : \"<a class='ui-state-default\" +\n\t\t\t\t\t\t\t( printDate.getTime() === today.getTime() ? \" ui-state-highlight\" : \"\" ) +\n\t\t\t\t\t\t\t( printDate.getTime() === currentDate.getTime() ? \" ui-state-active\" : \"\" ) + // highlight selected day\n\t\t\t\t\t\t\t( otherMonth ? \" ui-priority-secondary\" : \"\" ) + // distinguish dates from other months\n\t\t\t\t\t\t\t\"' href='#'>\" + printDate.getDate() + \"</a>\" ) ) + \"</td>\"; // display selectable date\n\t\t\t\t\t\tprintDate.setDate( printDate.getDate() + 1 );\n\t\t\t\t\t\tprintDate = this._daylightSavingAdjust( printDate );\n\t\t\t\t\t}\n\t\t\t\t\tcalender += tbody + \"</tr>\";\n\t\t\t\t}\n\t\t\t\tdrawMonth++;\n\t\t\t\tif ( drawMonth > 11 ) {\n\t\t\t\t\tdrawMonth = 0;\n\t\t\t\t\tdrawYear++;\n\t\t\t\t}\n\t\t\t\tcalender += \"</tbody></table>\" + ( isMultiMonth ? \"</div>\" +\n\t\t\t\t\t\t\t( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? \"<div class='ui-datepicker-row-break'></div>\" : \"\" ) : \"\" );\n\t\t\t\tgroup += calender;\n\t\t\t}\n\t\t\thtml += group;\n\t\t}\n\t\thtml += buttonPanel;\n\t\tinst._keyEvent = false;\n\t\treturn html;\n\t},\n\n\t/* Generate the month and year header. */\n\t_generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate,\n\t\t\tsecondary, monthNames, monthNamesShort ) {\n\n\t\tvar inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,\n\t\t\tchangeMonth = this._get( inst, \"changeMonth\" ),\n\t\t\tchangeYear = this._get( inst, \"changeYear\" ),\n\t\t\tshowMonthAfterYear = this._get( inst, \"showMonthAfterYear\" ),\n\t\t\thtml = \"<div class='ui-datepicker-title'>\",\n\t\t\tmonthHtml = \"\";\n\n\t\t// Month selection\n\t\tif ( secondary || !changeMonth ) {\n\t\t\tmonthHtml += \"<span class='ui-datepicker-month'>\" + monthNames[ drawMonth ] + \"</span>\";\n\t\t} else {\n\t\t\tinMinYear = ( minDate && minDate.getFullYear() === drawYear );\n\t\t\tinMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );\n\t\t\tmonthHtml += \"<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>\";\n\t\t\tfor ( month = 0; month < 12; month++ ) {\n\t\t\t\tif ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) {\n\t\t\t\t\tmonthHtml += \"<option value='\" + month + \"'\" +\n\t\t\t\t\t\t( month === drawMonth ? \" selected='selected'\" : \"\" ) +\n\t\t\t\t\t\t\">\" + monthNamesShort[ month ] + \"</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tmonthHtml += \"</select>\";\n\t\t}\n\n\t\tif ( !showMonthAfterYear ) {\n\t\t\thtml += monthHtml + ( secondary || !( changeMonth && changeYear ) ? \" \" : \"\" );\n\t\t}\n\n\t\t// Year selection\n\t\tif ( !inst.yearshtml ) {\n\t\t\tinst.yearshtml = \"\";\n\t\t\tif ( secondary || !changeYear ) {\n\t\t\t\thtml += \"<span class='ui-datepicker-year'>\" + drawYear + \"</span>\";\n\t\t\t} else {\n\n\t\t\t\t// determine range of years to display\n\t\t\t\tyears = this._get( inst, \"yearRange\" ).split( \":\" );\n\t\t\t\tthisYear = new Date().getFullYear();\n\t\t\t\tdetermineYear = function( value ) {\n\t\t\t\t\tvar year = ( value.match( /c[+\\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) :\n\t\t\t\t\t\t( value.match( /[+\\-].*/ ) ? thisYear + parseInt( value, 10 ) :\n\t\t\t\t\t\tparseInt( value, 10 ) ) );\n\t\t\t\t\treturn ( isNaN( year ) ? thisYear : year );\n\t\t\t\t};\n\t\t\t\tyear = determineYear( years[ 0 ] );\n\t\t\t\tendYear = Math.max( year, determineYear( years[ 1 ] || \"\" ) );\n\t\t\t\tyear = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );\n\t\t\t\tendYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );\n\t\t\t\tinst.yearshtml += \"<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>\";\n\t\t\t\tfor ( ; year <= endYear; year++ ) {\n\t\t\t\t\tinst.yearshtml += \"<option value='\" + year + \"'\" +\n\t\t\t\t\t\t( year === drawYear ? \" selected='selected'\" : \"\" ) +\n\t\t\t\t\t\t\">\" + year + \"</option>\";\n\t\t\t\t}\n\t\t\t\tinst.yearshtml += \"</select>\";\n\n\t\t\t\thtml += inst.yearshtml;\n\t\t\t\tinst.yearshtml = null;\n\t\t\t}\n\t\t}\n\n\t\thtml += this._get( inst, \"yearSuffix\" );\n\t\tif ( showMonthAfterYear ) {\n\t\t\thtml += ( secondary || !( changeMonth && changeYear ) ? \" \" : \"\" ) + monthHtml;\n\t\t}\n\t\thtml += \"</div>\"; // Close datepicker_header\n\t\treturn html;\n\t},\n\n\t/* Adjust one of the date sub-fields. */\n\t_adjustInstDate: function( inst, offset, period ) {\n\t\tvar year = inst.selectedYear + ( period === \"Y\" ? offset : 0 ),\n\t\t\tmonth = inst.selectedMonth + ( period === \"M\" ? offset : 0 ),\n\t\t\tday = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === \"D\" ? offset : 0 ),\n\t\t\tdate = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) );\n\n\t\tinst.selectedDay = date.getDate();\n\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\n\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\n\t\tif ( period === \"M\" || period === \"Y\" ) {\n\t\t\tthis._notifyChange( inst );\n\t\t}\n\t},\n\n\t/* Ensure a date is within any min/max bounds. */\n\t_restrictMinMax: function( inst, date ) {\n\t\tvar minDate = this._getMinMaxDate( inst, \"min\" ),\n\t\t\tmaxDate = this._getMinMaxDate( inst, \"max\" ),\n\t\t\tnewDate = ( minDate && date < minDate ? minDate : date );\n\t\treturn ( maxDate && newDate > maxDate ? maxDate : newDate );\n\t},\n\n\t/* Notify change of month/year. */\n\t_notifyChange: function( inst ) {\n\t\tvar onChange = this._get( inst, \"onChangeMonthYear\" );\n\t\tif ( onChange ) {\n\t\t\tonChange.apply( ( inst.input ? inst.input[ 0 ] : null ),\n\t\t\t\t[ inst.selectedYear, inst.selectedMonth + 1, inst ] );\n\t\t}\n\t},\n\n\t/* Determine the number of months to show. */\n\t_getNumberOfMonths: function( inst ) {\n\t\tvar numMonths = this._get( inst, \"numberOfMonths\" );\n\t\treturn ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === \"number\" ? [ 1, numMonths ] : numMonths ) );\n\t},\n\n\t/* Determine the current maximum date - ensure no time components are set. */\n\t_getMinMaxDate: function( inst, minMax ) {\n\t\treturn this._determineDate( inst, this._get( inst, minMax + \"Date\" ), null );\n\t},\n\n\t/* Find the number of days in a given month. */\n\t_getDaysInMonth: function( year, month ) {\n\t\treturn 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate();\n\t},\n\n\t/* Find the day of the week of the first of a month. */\n\t_getFirstDayOfMonth: function( year, month ) {\n\t\treturn new Date( year, month, 1 ).getDay();\n\t},\n\n\t/* Determines if we should allow a \"next/prev\" month display change. */\n\t_canAdjustMonth: function( inst, offset, curYear, curMonth ) {\n\t\tvar numMonths = this._getNumberOfMonths( inst ),\n\t\t\tdate = this._daylightSavingAdjust( new Date( curYear,\n\t\t\tcurMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) );\n\n\t\tif ( offset < 0 ) {\n\t\t\tdate.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) );\n\t\t}\n\t\treturn this._isInRange( inst, date );\n\t},\n\n\t/* Is the given date in the accepted range? */\n\t_isInRange: function( inst, date ) {\n\t\tvar yearSplit, currentYear,\n\t\t\tminDate = this._getMinMaxDate( inst, \"min\" ),\n\t\t\tmaxDate = this._getMinMaxDate( inst, \"max\" ),\n\t\t\tminYear = null,\n\t\t\tmaxYear = null,\n\t\t\tyears = this._get( inst, \"yearRange\" );\n\t\t\tif ( years ) {\n\t\t\t\tyearSplit = years.split( \":\" );\n\t\t\t\tcurrentYear = new Date().getFullYear();\n\t\t\t\tminYear = parseInt( yearSplit[ 0 ], 10 );\n\t\t\t\tmaxYear = parseInt( yearSplit[ 1 ], 10 );\n\t\t\t\tif ( yearSplit[ 0 ].match( /[+\\-].*/ ) ) {\n\t\t\t\t\tminYear += currentYear;\n\t\t\t\t}\n\t\t\t\tif ( yearSplit[ 1 ].match( /[+\\-].*/ ) ) {\n\t\t\t\t\tmaxYear += currentYear;\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn ( ( !minDate || date.getTime() >= minDate.getTime() ) &&\n\t\t\t( !maxDate || date.getTime() <= maxDate.getTime() ) &&\n\t\t\t( !minYear || date.getFullYear() >= minYear ) &&\n\t\t\t( !maxYear || date.getFullYear() <= maxYear ) );\n\t},\n\n\t/* Provide the configuration settings for formatting/parsing. */\n\t_getFormatConfig: function( inst ) {\n\t\tvar shortYearCutoff = this._get( inst, \"shortYearCutoff\" );\n\t\tshortYearCutoff = ( typeof shortYearCutoff !== \"string\" ? shortYearCutoff :\n\t\t\tnew Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) );\n\t\treturn { shortYearCutoff: shortYearCutoff,\n\t\t\tdayNamesShort: this._get( inst, \"dayNamesShort\" ), dayNames: this._get( inst, \"dayNames\" ),\n\t\t\tmonthNamesShort: this._get( inst, \"monthNamesShort\" ), monthNames: this._get( inst, \"monthNames\" ) };\n\t},\n\n\t/* Format the given date for display. */\n\t_formatDate: function( inst, day, month, year ) {\n\t\tif ( !day ) {\n\t\t\tinst.currentDay = inst.selectedDay;\n\t\t\tinst.currentMonth = inst.selectedMonth;\n\t\t\tinst.currentYear = inst.selectedYear;\n\t\t}\n\t\tvar date = ( day ? ( typeof day === \"object\" ? day :\n\t\t\tthis._daylightSavingAdjust( new Date( year, month, day ) ) ) :\n\t\t\tthis._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) );\n\t\treturn this.formatDate( this._get( inst, \"dateFormat\" ), date, this._getFormatConfig( inst ) );\n\t}\n} );\n\n/*\n * Bind hover events for datepicker elements.\n * Done via delegate so the binding only occurs once in the lifetime of the parent div.\n * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.\n */\nfunction datepicker_bindHover( dpDiv ) {\n\tvar selector = \"button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a\";\n\treturn dpDiv.on( \"mouseout\", selector, function() {\n\t\t\t$( this ).removeClass( \"ui-state-hover\" );\n\t\t\tif ( this.className.indexOf( \"ui-datepicker-prev\" ) !== -1 ) {\n\t\t\t\t$( this ).removeClass( \"ui-datepicker-prev-hover\" );\n\t\t\t}\n\t\t\tif ( this.className.indexOf( \"ui-datepicker-next\" ) !== -1 ) {\n\t\t\t\t$( this ).removeClass( \"ui-datepicker-next-hover\" );\n\t\t\t}\n\t\t} )\n\t\t.on( \"mouseover\", selector, datepicker_handleMouseover );\n}\n\nfunction datepicker_handleMouseover() {\n\tif ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) {\n\t\t$( this ).parents( \".ui-datepicker-calendar\" ).find( \"a\" ).removeClass( \"ui-state-hover\" );\n\t\t$( this ).addClass( \"ui-state-hover\" );\n\t\tif ( this.className.indexOf( \"ui-datepicker-prev\" ) !== -1 ) {\n\t\t\t$( this ).addClass( \"ui-datepicker-prev-hover\" );\n\t\t}\n\t\tif ( this.className.indexOf( \"ui-datepicker-next\" ) !== -1 ) {\n\t\t\t$( this ).addClass( \"ui-datepicker-next-hover\" );\n\t\t}\n\t}\n}\n\n/* jQuery extend now ignores nulls! */\nfunction datepicker_extendRemove( target, props ) {\n\t$.extend( target, props );\n\tfor ( var name in props ) {\n\t\tif ( props[ name ] == null ) {\n\t\t\ttarget[ name ] = props[ name ];\n\t\t}\n\t}\n\treturn target;\n}\n\n/* Invoke the datepicker functionality.\n @param options string - a command, optionally followed by additional parameters or\n\t\t\t\t\tObject - settings for attaching new datepicker functionality\n @return jQuery object */\n$.fn.datepicker = function( options ) {\n\n\t/* Verify an empty collection wasn't passed - Fixes #6976 */\n\tif ( !this.length ) {\n\t\treturn this;\n\t}\n\n\t/* Initialise the date picker. */\n\tif ( !$.datepicker.initialized ) {\n\t\t$( document ).on( \"mousedown\", $.datepicker._checkExternalClick );\n\t\t$.datepicker.initialized = true;\n\t}\n\n\t/* Append datepicker main container to body if not exist. */\n\tif ( $( \"#\" + $.datepicker._mainDivId ).length === 0 ) {\n\t\t$( \"body\" ).append( $.datepicker.dpDiv );\n\t}\n\n\tvar otherArgs = Array.prototype.slice.call( arguments, 1 );\n\tif ( typeof options === \"string\" && ( options === \"isDisabled\" || options === \"getDate\" || options === \"widget\" ) ) {\n\t\treturn $.datepicker[ \"_\" + options + \"Datepicker\" ].\n\t\t\tapply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );\n\t}\n\tif ( options === \"option\" && arguments.length === 2 && typeof arguments[ 1 ] === \"string\" ) {\n\t\treturn $.datepicker[ \"_\" + options + \"Datepicker\" ].\n\t\t\tapply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );\n\t}\n\treturn this.each( function() {\n\t\ttypeof options === \"string\" ?\n\t\t\t$.datepicker[ \"_\" + options + \"Datepicker\" ].\n\t\t\t\tapply( $.datepicker, [ this ].concat( otherArgs ) ) :\n\t\t\t$.datepicker._attachDatepicker( this, options );\n\t} );\n};\n\n$.datepicker = new Datepicker(); // singleton instance\n$.datepicker.initialized = false;\n$.datepicker.uuid = new Date().getTime();\n$.datepicker.version = \"1.12.1\";\n","/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */\n/* Written by Mathias Bynens <http://mathiasbynens.be/> */\nimport $ from \"jquery\";\nimport \"../widgets/datepicker\";\n\n$.datepicker.regional.nl = {\n\tcloseText: \"Sluiten\",\n\tprevText: \"â†\",\n\tnextText: \"→\",\n\tcurrentText: \"Vandaag\",\n\tmonthNames: [ \"januari\", \"februari\", \"maart\", \"april\", \"mei\", \"juni\",\n\t\"juli\", \"augustus\", \"september\", \"oktober\", \"november\", \"december\" ],\n\tmonthNamesShort: [ \"jan\", \"feb\", \"mrt\", \"apr\", \"mei\", \"jun\",\n\t\"jul\", \"aug\", \"sep\", \"okt\", \"nov\", \"dec\" ],\n\tdayNames: [ \"zondag\", \"maandag\", \"dinsdag\", \"woensdag\", \"donderdag\", \"vrijdag\", \"zaterdag\" ],\n\tdayNamesShort: [ \"zon\", \"maa\", \"din\", \"woe\", \"don\", \"vri\", \"zat\" ],\n\tdayNamesMin: [ \"zo\", \"ma\", \"di\", \"wo\", \"do\", \"vr\", \"za\" ],\n\tweekHeader: \"Wk\",\n\tdateFormat: \"dd-mm-yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\n$.datepicker.setDefaults( $.datepicker.regional.nl );\n","/* English (UTF-8) initialisation for the jQuery UI date picker plugin. */\n/* Written by Mathias Bynens <http://mathiasbynens.be/> */\nimport $ from \"jquery\";\nimport \"../widgets/datepicker\";\n\n$.datepicker.regional.en = {\n\tcloseText: \"Close\",\n\tprevText: \"â†\",\n\tnextText: \"→\",\n\tcurrentText: \"Today\",\n\tmonthNames: [ \"january\", \"february\", \"march\", \"april\", \"may\", \"june\",\n\t\"july\", \"august\", \"september\", \"october\", \"november\", \"december\" ],\n\tmonthNamesShort: [ \"jan\", \"feb\", \"mar\", \"apr\", \"may\", \"jun\",\n\t\"jul\", \"aug\", \"sep\", \"oct\", \"nov\", \"dec\" ],\n\tdayNames: [ \"sunday\", \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\" ],\n\tdayNamesShort: [ \"sun\", \"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\" ],\n\tdayNamesMin: [ \"su\", \"mo\", \"tu\", \"we\", \"th\", \"fr\", \"sa\" ],\n\tweekHeader: \"Wk\",\n\tdateFormat: \"dd-mm-yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\n$.datepicker.setDefaults( $.datepicker.regional.en );\n","import $ from \"jquery\";\nimport \"../jquery-ui/widgets/mouse\";\nimport \"../jquery-ui/widgets/slider\";\n\n\n/*!\n * jQuery UI Touch Punch 0.2.3\n *\n * Copyright 2011–2014, Dave Furfero\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Depends:\n * jquery.ui.widget.js\n * jquery.ui.mouse.js\n */\n// Detect touch support\n$.support.touch = 'ontouchend' in document;\n\n// Ignore browsers without touch support\nif ($.support.touch) {\n\n// if (!$.ui.mouse)\n// console.error(\"jQuery UI not loaded yet?\"); // SPELLCODER\n\nvar mouseProto = $.ui.mouse.prototype,\n _mouseInit = mouseProto._mouseInit,\n _mouseDestroy = mouseProto._mouseDestroy,\n touchHandled;\n\n/**\n * Simulate a mouse event based on a corresponding touch event\n * @param {Object} event A touch event\n * @param {String} simulatedType The corresponding mouse event\n */\nfunction simulateMouseEvent (event, simulatedType) {\n\n // Ignore multi-touch events\n if (event.originalEvent.touches.length > 1) {\n return;\n }\n\n event.preventDefault();\n\n var touch = event.originalEvent.changedTouches[0],\n simulatedEvent = document.createEvent('MouseEvents');\n\n // Initialize the simulated mouse event using the touch event's coordinates\n simulatedEvent.initMouseEvent(\n simulatedType, // type\n true, // bubbles\n true, // cancelable\n window, // view\n 1, // detail\n touch.screenX, // screenX\n touch.screenY, // screenY\n touch.clientX, // clientX\n touch.clientY, // clientY\n false, // ctrlKey\n false, // altKey\n false, // shiftKey\n false, // metaKey\n 0, // button\n null // relatedTarget\n );\n\n // Dispatch the simulated event to the target element\n event.target.dispatchEvent(simulatedEvent);\n}\n\n/**\n * Handle the jQuery UI widget's touchstart events\n * @param {Object} event The widget element's touchstart event\n */\nmouseProto._touchStart = function (event) {\n\n var self = this;\n\n // Ignore the event if another widget is already being handled\n if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {\n return;\n }\n\n // Set the flag to prevent other widgets from inheriting the touch event\n touchHandled = true;\n\n // Track movement to determine if interaction was a click\n self._touchMoved = false;\n\n // Simulate the mouseover event\n simulateMouseEvent(event, 'mouseover');\n\n // Simulate the mousemove event\n simulateMouseEvent(event, 'mousemove');\n\n // Simulate the mousedown event\n simulateMouseEvent(event, 'mousedown');\n};\n\n/**\n * Handle the jQuery UI widget's touchmove events\n * @param {Object} event The document's touchmove event\n */\nmouseProto._touchMove = function (event) {\n\n // Ignore event if not handled\n if (!touchHandled) {\n return;\n }\n\n // Interaction was not a click\n this._touchMoved = true;\n\n // Simulate the mousemove event\n simulateMouseEvent(event, 'mousemove');\n};\n\n/**\n * Handle the jQuery UI widget's touchend events\n * @param {Object} event The document's touchend event\n */\nmouseProto._touchEnd = function (event) {\n\n // Ignore event if not handled\n if (!touchHandled) {\n return;\n }\n\n // Simulate the mouseup event\n simulateMouseEvent(event, 'mouseup');\n\n // Simulate the mouseout event\n simulateMouseEvent(event, 'mouseout');\n\n // If the touch interaction did not move, it should trigger a click\n if (!this._touchMoved) {\n\n // Simulate the click event\n simulateMouseEvent(event, 'click');\n }\n\n // Unset the flag to allow other widgets to inherit the touch event\n touchHandled = false;\n};\n\n/**\n * A duck punch of the $.ui.mouse _mouseInit method to support touch events.\n * This method extends the widget with bound touch event handlers that\n * translate touch events to mouse events and pass them to the widget's\n * original mouse event handling methods.\n */\nmouseProto._mouseInit = function () {\n\n var self = this;\n\n // Delegate the touch handlers to the widget's element\n self.element.bind({\n touchstart: $.proxy(self, '_touchStart'),\n touchmove: $.proxy(self, '_touchMove'),\n touchend: $.proxy(self, '_touchEnd')\n });\n\n // Call the original $.ui.mouse init method\n _mouseInit.call(self);\n};\n\n/**\n * Remove the touch event handlers\n */\nmouseProto._mouseDestroy = function () {\n\n var self = this;\n\n // Delegate the touch handlers to the widget's element\n self.element.unbind({\n touchstart: $.proxy(self, '_touchStart'),\n touchmove: $.proxy(self, '_touchMove'),\n touchend: $.proxy(self, '_touchEnd')\n });\n\n // Call the original $.ui.mouse destroy method\n _mouseDestroy.call(self);\n};\n\n}\n","/* eslint-disable */\n/// @ts-nocheck -- Bulk rename to enable TypeScript validation\n\nimport * as dompack from 'dompack';\nimport { getTid } from \"@mod-tollium/js/gettid\";\nimport \"./video.css\";\nimport \"../internal/rtd.lang.json\";\nimport * as consenthandler from '@mod-publisher/js/analytics/consenthandler';\n\n\nconst youtubedomain = 'www.youtube.com';\n\nfunction createMyFrame() {\n const ifrm = document.createElement(\"iframe\");\n ifrm.style.width = \"100%\";\n ifrm.style.height = \"100%\";\n ifrm.setAttribute(\"frameborder\", 0);\n ifrm.setAttribute(\"allowfullscreen\", \"\");\n return ifrm;\n}\n\nfunction initYouTube(node, video, playback) {\n const ifrm = createMyFrame();\n\n // List of embed parameters YouTube supports:\n // https://developers.google.com/youtube/player_parameters\n\n const args = [];\n\n if (playback.autoplay)\n args.push(\"autoplay=1\");\n\n if (video.mute || playback.mute)\n args.push(\"mute=1\");\n\n if (video.starttime)\n args.push(\"start=\" + Math.floor(video.starttime)); // seconds, whole integer (YouTube also uses t= in the shorturl??)\n\n if (video.endtime)\n args.push(\"end=\" + Math.floor(video.endtime));\n\n if (typeof playback.controls !== \"undefined\" && !playback.controls)\n args.push(\"controls=0\");\n\n if (video.loop || playback.loop) {\n /* from the documentation: https://developers.google.com/youtube/player_parameters\n Note: This parameter has limited support in IFrame embeds. To loop a single video,\n set the loop parameter value to 1 and set the playlist parameter value to the\n same video ID already specified in the Player API URL:\n https://www.youtube.com/embed/VIDEO_ID?playlist=VIDEO_ID&loop=1\n */\n args.push(\"loop=1\", \"playlist=\" + video.id);//To enable loop, set same video as playlist\n }\n\n args.push(\"rel=0\", \"enablejsapi=1\", \"origin=\" + location.origin); // disable 'related video's'\n\n let youtube_url = `//${youtubedomain}/embed/${video.id}`;\n if (args.length > 0)\n youtube_url += \"?\" + args.join(\"&\");\n\n ifrm.src = youtube_url;\n ifrm.title = video.title ? \"YouTube video: \" + video.title : \"YouTube video\";\n node.appendChild(ifrm);\n}\n\nfunction initVimeo(node, video, playback) {\n const ifrm = createMyFrame();\n const args = [];\n\n // List of embed parameters Vimeo supports:\n // https://vimeo.zendesk.com/hc/en-us/articles/360001494447-Player-parameters-overview\n\n if (playback.autoplay)\n args.push(\"autoplay=1\");\n\n if (video.mute || playback.mute)\n args.push(\"muted=1\");\n\n if (video.endtime)\n console.warn(\"setting an endtime doesn't work for Vimeo video's\");\n\n // NOTE: actually disabling controls is possible, but ONLY if the video is hosted by a Plus account or higher\n if (typeof playback.controls !== \"undefined\" && !playback.controls)\n console.warn(\"disabling video controls not possible for Vimeo video's\");\n\n if (video.loop || playback.loop)\n args.push(\"loop=1\");\n\n if (playback.background)\n args.push(\"background=1\");\n\n if (playback.api) {\n args.push(\"api=\" + playback.api);\n\n // we need a player_id to distinguish from which iframe a message came.\n // (in cross domain situations we cannot lookup/compare the event source with iframe.contentWindow)\n if (playback.player_id)\n args.push(\"player_id=\" + playback.player_id);\n }\n\n let vimeo_url = \"//player.vimeo.com/video/\" + video.id;\n if (args.length > 0)\n vimeo_url += \"?\" + args.join(\"&\");\n\n if (video.starttime) {\n // #t=3m28s\n const t = video.starttime;\n const minutes = Math.floor(t / 60);\n const seconds = t % 60;\n vimeo_url += \"#t=\" + minutes + \"m\" + seconds + \"s\";\n }\n\n ifrm.src = vimeo_url;\n ifrm.title = video.title ? \"Vimeo video: \" + video.title : \"Vimeo video\";\n node.appendChild(ifrm);\n}\n\nfunction launchVideo(node, video, opts) {\n switch (video.network) {\n case 'youtube':\n initYouTube(node, video, opts || {});\n break;\n case 'vimeo':\n initVimeo(node, video, opts || {});\n break;\n }\n}\n\nfunction initializeVideoElementV1(node) {\n const video = JSON.parse(node.dataset.video);\n const opts = node.dataset.videoOptions ? JSON.parse(node.dataset.videoOptions) : {};\n node.innerHTML = '';\n launchVideo(node, video, opts);\n}\n\nfunction initializeVideoElementV2(node) {\n const video = JSON.parse(node.dataset.whVideo);\n\n const videonodes = dompack.qSA(node, \".wh-video--activate\");\n\n for (const videonode of videonodes) {\n videonode.addEventListener(\"click\", function () {\n activateVideo(videonode, video);\n });\n\n const playbutton = videonode.querySelector(\".wh-video__playbutton\");\n playbutton.setAttribute(\"tabindex\", \"0\");\n playbutton.setAttribute(\"role\", \"button\");\n playbutton.setAttribute(\"aria-label\", getTid(\"publisher:site.rtd.embedvideo.playbutton-aria\"));\n\n playbutton.addEventListener(\"click\", function () {\n activateVideo(videonode, video, { autoplay: true });\n });\n\n // Because we don't use <button> we must implement it's keyboard interaction\n playbutton.addEventListener(\"keypress\", function (evt) {\n // we are only interested in enter and space keypressed\n if (evt.keyCode !== 13 && evt.keyCode !== 32)\n return;\n\n // prevent other code getting the event or the space both triggering the video AND scrolling the page\n evt.preventDefault();\n\n activateVideo(videonode, video, { autoplay: true });\n });\n\n if (video.autoplay) //activate immediately\n if (node.dataset.whConsentRequired)\n consenthandler.onConsent(node.dataset.whConsentRequired, () => activateVideo(videonode, { ...video, mute: true }, { autoplay: true }));\n else\n activateVideo(videonode, { ...video, mute: true }, { autoplay: true });\n }\n}\n\nfunction activateVideo(videonode, video, opts) {\n if (videonode.__initialized)\n return;\n\n videonode.querySelector(\".wh-video__innerframe__preview\").hidden = true;\n videonode.__initialized = true;\n launchVideo(videonode, video, opts);\n}\n\ndompack.register('.wh-video', node => node.dataset.video ? initializeVideoElementV1(node) : initializeVideoElementV2(node));\n","// Auto-generated language file from /opt/wh/whtree/modules/publisher/js/internal/rtd.lang.json\nvar registerTexts = require(\"@mod-tollium/js/gettid\").registerTexts;\nregisterTexts(\"publisher\",\"nl\",{\"site\":{\"rtd\":{\"embedvideo\":{\"playbutton-aria\":\"Speel video af\",\"unrecognized\":\"De URL is niet herkend als een ondersteunde video URL\",\"videourl\":\"Video URL\"}}}});\n// Adding dependency: /opt/wh/whtree/modules/publisher/language/nl.xml\n","import * as dompack from '@webhare/dompack';\nimport { debugFlags } from '@webhare/env/src/envbackend';\n\ndeclare global {\n interface Window {\n whResetConsent: () => void;\n }\n interface GlobalEventHandlersEventMap {\n \"wh:consent-changed\": CustomEvent<ConsentSettings>;\n }\n}\n\nexport interface SetupConsentOptions {\n /** Domain to which to bind the cookie, can be at most one level higher (eg '.example.net' for 'www.example.net') */\n cookiedomain?: string;\n /** Duration to store or extend the consent, in days. Defaults to 365 */\n cookieduration?: number;\n /** The consent tags which are active by default (only use this for anonymous tracking and functional cookies) */\n defaultconsent?: string[];\n}\n\ninterface ConsentStatus {\n /** Version (2) */\n v: 2;\n //** Consent options */\n c?: string[];\n /** Last consent change (ISO8601 date) */\n lc?: string;\n}\n\nlet consentstatus: ConsentStatus | null;\nlet cookiename: string | undefined;\nlet consentoptions: SetupConsentOptions | undefined;\n\nexport type ConsentSettings = {\n isdefault: true;\n consent: string[];\n} | {\n isdefault: false;\n consent: string[] | undefined; //we've explicitly defined no consent-yet-given as 'undefined' (TODO was this a good idea?)\n};\n\n/** Setup the consent handler\n @param usecookiename - Name of the cookie. Should be identical for all sites sharing this consent, set to empty string if you store consent externally\n @param consentrequester - Function to invoke if consent is unknown to eg trigger a cookie bar. This function will be immediately registered for invocation through dompack.onDomReady\n*/\nexport function setup(usecookiename: string, consentrequester?: () => void, options?: SetupConsentOptions) {\n if (typeof usecookiename !== 'string')\n throw new Error(\"Cookiename must be of type 'string'\");\n if (debugFlags.cst)\n console.log(`[cst] consenthandler initialized. cookiename: '${usecookiename}'`);\n\n cookiename = usecookiename;\n consentoptions = {\n cookieduration: 365,\n defaultconsent: [],\n ...options\n };\n\n if (consentrequester)\n try {\n consentstatus = JSON.parse(dompack.getCookie(cookiename)!);\n if (debugFlags.cst)\n console.log(`[cst] initial consent state:`, consentstatus);\n } catch (ignore) {\n }\n\n if (!consentstatus || typeof consentstatus !== \"object\" || consentstatus.v !== 2 || typeof consentstatus.c !== \"object\")\n consentstatus = { v: 2 };\n\n if (!(\"c\" in consentstatus)) { //simple consent flag\n if (consentrequester)\n dompack.onDomReady(consentrequester); //run the request function, but only on domready! it's a safe assumption it should be delayed...\n } else {\n storeConsent(); //renew the status\n }\n updateConsent();\n}\n\n//Test for consent\nexport function hasConsent(consentsetting: string) {\n if (consentsetting === undefined) //generic consent check\n throw new Error(\"hasConsent required a string argument\");\n\n const details = getConsentDetail();\n if (!details // setup() not called yet?\n || !details.consent) // no consent has been given and no defaults are available consent will be undefined?\n return undefined;\n\n return details.consent.includes(consentsetting);\n}\n\n//Set simple consent\nexport function setConsent(newsetting: string[]) {\n if (cookiename === undefined)\n throw new Error(\"Invoke consenthandler.setup before modifying consent state!\");\n if (typeof newsetting !== \"object\" || !Array.isArray(newsetting))\n throw new Error(\"Expecting an array in call to setConsent\");\n\n // Check if there are some consents being revoked\n const details = getConsentDetail(); // get current list of consent tags, including implicit (default) consent\n let consent_revoked = false;\n if (details?.consent) { // if no explicit or default consent, the consent field is undefined\n for (const tag of details.consent) {\n if (!newsetting.includes(tag))\n consent_revoked = true;\n }\n }\n\n if (!consentstatus)\n throw new Error(`Attempting to change consent status before invoking consenthandler.setup`);\n\n consentstatus.c = newsetting.sort();//ensure stable order\n consentstatus.lc = (new Date()).toISOString();\n\n storeConsent();\n\n // Revoked consent may need a reload to take effect.\n // This is because it's not worth the effort for most websites to implement on-the-fly disabling\n // of functionality. It might even be impossible if 3rd party scripts are already loaded.\n if (consent_revoked)\n window.location.reload();\n\n updateConsent();\n}\n\n/** Get a list of consents and whether they are defaults (or explicitly set)\n @returns consent: list all consents\n isdefault: if true then the consents are implicit/defaults (not consent explicitly given by the user)\n*/\nfunction getConsentDetail(): ConsentSettings | null {\n if (!consentstatus) // setup() did not run yet\n return null;\n\n if (!(\"c\" in consentstatus)) { // consent not set yet\n if (consentoptions?.defaultconsent && consentoptions?.defaultconsent.length > 0)\n return { consent: consentoptions!.defaultconsent!, isdefault: true }; // use fallback consent\n else\n return { consent: undefined, isdefault: false }; // no consent given yet (expected to return undefined for consent)\n }\n\n return {\n consent: consentstatus.c,\n isdefault: false\n };\n}\n\nexport function onConsent(type: string, callback: (cs: ConsentSettings) => void) {\n window.addEventListener(\"wh:consent-changed\", evt => {\n if (evt.detail.consent?.includes(type))\n callback(evt.detail);\n });\n\n const details = getConsentDetail();\n\n if (details && details.consent && details.consent.includes(type)) {//already missed it, so invoke\n if (debugFlags.cst)\n console.log(\"[anl] Invoking callback\", details);\n callback(details);\n }\n}\n\n//Register callback for content changes\nexport function onConsentChange(callback: (cs: ConsentSettings) => void): void {\n window.addEventListener(\"wh:consent-changed\", evt => callback(evt.detail));\n\n const details = getConsentDetail();\n\n if (details) { //already missed it, so invoke\n if (debugFlags.cst)\n console.log(\"[cst] Invoking callback\", details);\n callback(details);\n }\n}\n\nfunction updateConsentOverlays() {\n const overlays = dompack.qSA(\".wh-requireconsent__overlay\");\n const consent = getConsentDetail()!.consent; //we are only scheduled when details are set (but we reread them as they may change)\n\n if (debugFlags.cst)\n console.log(`[cst] update ${overlays.length} consent overlay(s). ${consent ? `consent: ${consent.length ? consent.join(', ') : \"<none>\"}` : \"<undefined>\"}`);\n\n overlays.forEach(overlay => {\n const parent = overlay.closest<HTMLElement>(\".wh-requireconsent\");\n if (parent && parent.dataset.whConsentRequired)\n overlay.hidden = consent?.includes(parent.dataset.whConsentRequired) || false;\n });\n}\n\nfunction updateConsent() { //update in DOM, GTM, etc\n const details = getConsentDetail();\n\n if (!details // setup() not called yet?\n || !details.consent) { // no consent has been given and no defaults are available consent will be undefined?\n document.documentElement.dataset.whConsent = \"unknown\"; // unknown - no explicit or explicit (options.defaultconsent) consent\n return;\n }\n\n document.documentElement.dataset.whConsent = details.consent.length ? details.consent.join(\" \") : \"denied\";\n\n if (debugFlags.cst)\n console.log(\"[cst] Firing wh:consent-changed with\", details);\n\n dompack.dispatchCustomEvent(window, \"wh:consent-changed\", { bubbles: false, cancelable: false, detail: details });\n dompack.onDomReady(updateConsentOverlays);\n}\n\nfunction storeConsent() {\n if (cookiename)\n dompack.setCookie(cookiename, JSON.stringify(consentstatus), { duration: consentoptions!.cookieduration, domain: consentoptions!.cookiedomain });\n}\n\nwindow.whResetConsent = function () {\n if (cookiename === undefined)\n throw new Error(\"Consent handler not setup\");\n else if (!cookiename)\n throw new Error(\"Consent handler is not handling storage\");\n\n dompack.deleteCookie(cookiename);\n location.reload();\n};\n","// Auto-generated language file from /opt/whdata/installedmodules/ipkot.20250108T094741.096Z/webdesigns/ipkotsite/ipkotsite.lang.json\nvar registerTexts = require(\"@mod-tollium/js/gettid\").registerTexts;\nregisterTexts(\"ipkot\",\"nl\",{\"webdesigns\":{\"ipkotsite\":{\"frontend\":{\"js\":{\"search\":{\"deletefilter\":[1,\" verwijderen\"],\"doccount\":[\"Gevonden in \",{\"t\":\"ifparam\",\"subs\":[\"meerdere\"],\"subselse\":[1],\"p\":1,\"value\":\"0\"},\" document\",{\"t\":\"ifparam\",\"subs\":[],\"subselse\":[\"en\"],\"p\":1,\"value\":\"1\"}],\"filter-clear\":\"Wis alle filters\",\"filter-department\":[1],\"filter-kind\":[\"Doorzoeken: \",1],\"filter-minister\":[\"Bewindspersoon: \",1],\"filter-publishedafter\":[\"Periode Startdatum: \",1],\"filter-publishedbefore\":[\"Periode Einddatum: \",1],\"filter-subject\":[\"Onderwerp: \",1],\"filter-text\":[\"Trefwoord: \",1],\"hidefilters\":\"Verberg filters\",\"nextpage\":\"Volgende\",\"noresults\":\"Uw zoekopdracht levert geen resultaten op.\",\"pagecount\":[\"Resultaten gevonden op \",{\"t\":\"ifparam\",\"subs\":[\"meerdere\"],\"subselse\":[1],\"p\":1,\"value\":\"0\"},\" pagina\",{\"t\":\"ifparam\",\"subs\":[],\"subselse\":[\"'s\"],\"p\":1,\"value\":\"1\"}],\"previouspage\":\"Vorige\",\"resultcount\":[{\"t\":\"ifparam\",\"subs\":[\"Geen onderdelen gevonden\"],\"subselse\":[{\"t\":\"ifparam\",\"subs\":[\"onderdeel\"],\"subselse\":[\"onderdelen\"],\"p\":1,\"value\":\"1\"},{\"t\":\"ifparam\",\"subs\":[\", gefilterd op\"],\"subselse\":[],\"p\":2,\"value\":\"filtered\"}],\"p\":1,\"value\":\"0\"}],\"rssfeed\":\"Abonneren op de documenten (RSS-feed)\",\"showfilters\":\"Toon filters\",\"sortby\":\"Sorteren op:\",\"sortby-publicationdate\":\"Datum\",\"sortby-publicationdate-aria\":\"Sorteer op datum\",\"sortby-score\":\"Relevantie\",\"sortby-score-aria\":\"Sorteer op relevantie\",\"sortby-title\":\"Titel\",\"sortby-title-aria\":\"Sorteer op titel\"},\"searchbar-arialabel\":\"Type hier uw zoekterm(en)\",\"searchbar-placeholder\":\"Type hier uw zoekterm(en)\"}}}}});\n// Adding dependency: /opt/whdata/installedmodules/ipkot.20250108T094741.096Z/language/default.xml\n","import * as dompack from \"dompack\";\nimport { FormBase, registerHandler } from \"@mod-publisher/js/forms\";\nimport { getTid } from \"@mod-tollium/js/gettid\";\nimport * as woosearch from \"@mod-ipkot/libwoo/js/woosearch\";\nimport \"./search.scss\";\nimport \"./pagenavigation.scss\";\n\nimport \"./firstvisit.es\";\nimport \"./firstvisit.scss\";\n\nimport * as whintegration from '@mod-system/js/wh/integration';\n\n\n/*\n\n.searchpage--searching - RPC call to get new results is in progress\n.searchpage--filtersactive - Filters are active\n.searchpage--showfilters - Filters must be expanded\n.searchpage--noresults - Total amount of results is 0\n\n*/\n\n\n// Default configuration\nconst defaultSortField = whintegration.config.obj.search_defaultsort; // \"title\", \"publicationdate\" or \"score\"\nconst defaultOperator = \"and\";\nconst resultsPerPage = whintegration.config.obj.search_itemsperpage; // Number of results per page\nconst contextPages = 2; // Number of pages to show before and after the crrent page in the navigation\n\nconst scriptServiceVersion = 2;\n\nconst dateFormatter = new Intl.DateTimeFormat(\"nl\", { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" });\nconst numberFormatter = new Intl.NumberFormat(\"nl\", { style: \"decimal\" });\n\nlet headerNode, resultsContainerNode, searchForm, resultsCountNode, filterTagsContainer;\n\n\n\n\nif (!window._paq)\n window._paq = [];\n\n\n\n\nclass SearchForm //extends FormBase\n{\n constructor(node)\n {\n this.node = node;\n this.serverpool = new woosearch.ServerPool(whintegration.config.obj.searchurls);\n\n this.toggleNode = document.body.querySelector(\".searchfilters__toggle\");\n this.toggleNode.addEventListener(\"click\", event => this._toggleFilters(event))\n\n/*\n console.info({ toggleNode: this.toggleNode\n , resultsCountNode: resultsCountNode\n , filterTagsContainer: filterTagsContainer\n });\n*/\n this.pageNode = document.documentElement; //dompack.closest(this.node, \".searchpage\");\n\n this.curPage = 0;\n this.lastPage = 0;\n this.showAll = false;\n this.sortField = defaultSortField;\n\n this.readUrlParameters();\n this.refreshFilterValue();\n this.hideFiltersIfFiltersChosen();\n\n this.doSearch();\n\n // We don't want to use the default submit handler, so just listen for the submit event and cancel that (with useCapture\n // set to true to prevent the default submit handler from being run)\n this.node.addEventListener(\"submit\", event => this._startSearch(event), true);\n\n this.node.departments.addEventListener(\"change\", event => this.onDepartmentChange(event));\n }\n\n refreshFilterValue()\n {\n this.filters = this.getFilterValue();\n }\n\n clearFilters()\n {\n dompack.changeValue(this.node.text, \"\");\n dompack.changeValue(this.node.publishedafter, \"\");\n dompack.changeValue(this.node.publishedbefore, \"\");\n dompack.changeValue(this.node.departments, \"\");\n dompack.changeValue(this.node.subjects, \"\");\n //dompack.changeValue(this.node.ministers, \"\");\n // dompack.changeValue(this.node.kind, \"\");\n this.doSearch();\n }\n\n readUrlParameters()\n {\n const url = new URL(location.href);\n\n this.showAll = url.searchParams.has(\"alle-documenten\");\n\n // Simple texts inputs\n if (url.searchParams.has(\"trefwoord\"))\n dompack.changeValue(this.node.text, url.searchParams.get(\"trefwoord\"));\n\n if (url.searchParams.has(\"startdatum\"))\n dompack.changeValue(this.node.publishedafter, url.searchParams.get(\"startdatum\"));\n\n if (url.searchParams.has(\"einddatum\"))\n dompack.changeValue(this.node.publishedbefore, url.searchParams.get(\"einddatum\"));\n\n // Radiobuttons\n if (url.searchParams.has(\"zoekmodus\"))\n {\n const operator = url.searchParams.get(\"zoekmodus\") == \"of\" ? \"or\" : \"and\";\n for (const input of this.node.operator)\n dompack.changeValue(input, operator == input.value);\n }\n\n // Single-select input, select the option which title is specified\n if (url.searchParams.has(\"onderdeel\"))\n {\n const value = url.searchParams.get(\"onderdeel\");\n const option = Array.from(this.node.departments.options).filter(_ => _.dataset.basetitle == value);\n if (option.length)\n dompack.changeValue(this.node.departments, option[0].value);\n /*\n const values = url.searchParams.getAll(\"onderdeel\");\n for (const option of Array.from(this.node.departments))\n dompack.changeValue(option, values.includes(option.dataset.basetitle));\n */\n }\n\n if (url.searchParams.has(\"categorie\"))\n {\n console.info(\"subjects MOET ZIJN\", url.searchParams.get(\"categorie\"));\n //this.node.subjects.value = url.searchParams.get(\"categorie\");\n\n // Find the option matching the tag\n let value = this.getSubjectValueByTag(url.searchParams.get(\"categorie\"));\n dompack.changeValue(this.node.subjects, value);\n }\n // dompack.changeValue(this.node.subjects, url.searchParams.get(\"subjects\"));\n\n/*\n if (url.searchParams.has(\"bewindspersoon\"))\n {\n const value = url.searchParams.get(\"bewindspersoon\");\n const option = Array.from(this.node.ministers.options).filter(_ => _.dataset.basetitle == value);\n if (option.length)\n dompack.changeValue(this.node.ministers, option[0].value);\n /*\n const values = url.searchParams.getAll(\"bewindspersoon\");\n for (const option of Array.from(this.node.ministers))\n dompack.changeValue(option, values.includes(option.dataset.basetitle));\n * /\n }\n*/\n\n /* Subjects are disabled for now\n // Multi-select input, select the options which title is specified\n if (url.searchParams.has(\"categorie\"))\n {\n const values = url.searchParams.getAll(\"categorie\");\n for (const option of Array.from(this.node.subjects))\n dompack.changeValue(option, values.includes(option.dataset.basetitle));\n }\n */\n\n // Single-select input, select the option which title is specified\n if (url.searchParams.has(\"doorzoeken\"))\n {\n const value = url.searchParams.get(\"doorzoeken\");\n const option = Array.from(this.node.kind.options).filter(_ => _.dataset.basetitle == value);\n if (option.length)\n dompack.changeValue(this.node.kind, option[0].value);\n }\n\n // Go to the specified page (curPage is 0-based, url param is 1-based)\n if (url.searchParams.has(\"pagina\"))\n this.curPage = (parseInt(url.searchParams.get(\"pagina\")) - 1) || 0;\n\n\n // Sort field\n if (url.searchParams.has(\"sorteer\"))\n {\n switch (url.searchParams.get(\"sorteer\"))\n {\n case \"publicatiedatum\":\n this.sortField = \"publicationdate\";\n break;\n case \"relevantie\":\n this.sortField = \"score\";\n break;\n default:\n this.sortField = defaultSortField;\n }\n }\n }\n\n updateUrlParameters()\n {\n const url = new URL(location.href);\n\n // Simple text inputs\n if (this.filters.text != \"\")\n url.searchParams.set(\"trefwoord\", this.filters.text);\n else\n url.searchParams.delete(\"trefwoord\");\n\n if (this.filters.operator && this.filters.operator != defaultOperator)\n url.searchParams.set(\"zoekmodus\", \"of\");\n else\n url.searchParams.delete(\"zoekmodus\");\n\n if (this.filters.publishedafter != \"\")\n url.searchParams.set(\"startdatum\", this.filters.publishedafter);\n else\n url.searchParams.delete(\"startdatum\");\n\n if (this.filters.publishedbefore != \"\")\n url.searchParams.set(\"einddatum\", this.filters.publishedbefore);\n else\n url.searchParams.delete(\"einddatum\");\n\n // Single-select input, show the chosen option's title\n url.searchParams.delete(\"onderdeel\");\n for (const option of Array.from(this.node.departments).filter(_ => this.filters.departments.includes(_.value)))\n url.searchParams.append(\"onderdeel\", option.dataset.basetitle);\n\n/*\n url.searchParams.delete(\"bewindspersoon\");\n for (const option of Array.from(this.node.ministers).filter(_ => this.filters.ministers.includes(_.value)))\n url.searchParams.append(\"bewindspersoon\", option.dataset.basetitle);\n*/\n // Subjects\n // Multi-select inputs, show the chosen options' titles\n url.searchParams.delete(\"categorie\");\n /*\n for (const option of Array.from(this.node.subjects).filter(_ => this.filters.subjects.includes(_.value)))\n url.searchParams.append(\"categorie\", option.dataset.basetitle);\n */\n for (const option of Array.from(this.node.subjects.options))\n {\n // console.log(option, option.value, this.filters.subjects.indexOf(option.value));\n if (this.filters.subjects.indexOf(option.value) > -1)\n url.searchParams.append(\"categorie\", option.dataset.tag);\n }\n\n /*\n url.searchParams.delete(\"doorzoeken\");\n for (const option of Array.from(this.node.kind).filter(_ => this.filters.kinds.includes(_.value)))\n url.searchParams.append(\"doorzoeken\", option.dataset.basetitle);\n */\n\n // For subsequent pages, add the current page (curPage is 0-based, url param is 1-based)\n if (this.curPage > 0)\n url.searchParams.set(\"pagina\", this.curPage + 1);\n else\n url.searchParams.delete(\"pagina\");\n\n // Sort field\n if (this.sortField != defaultSortField)\n {\n switch (this.sortField)\n {\n case \"publicationdate\":\n url.searchParams.set(\"sorteer\", \"publicatiedatum\");\n break;\n case \"score\":\n url.searchParams.set(\"sorteer\", \"relevantie\");\n break;\n case \"titel\":\n url.searchParams.set(\"sorteer\", \"titel\");\n break;\n default:\n url.searchParams.delete(\"pagina\");\n }\n }\n else\n url.searchParams.delete(\"pagina\");\n\n // Update url\n history.replaceState(null, \"\", url.toString());\n\n return url; //searchstring;\n }\n\n hideFiltersIfFiltersChosen()\n {\n const visible = !this.areFiltersActive();\n //console.log(\"Make filters visible\", visible);\n this.setFiltersVisible( visible );\n }\n\n _startSearch(event)\n {\n event.preventDefault();\n dompack.stop(event);\n\n this.curPage = 0; // reset to start at the first page again\n\n this.refreshFilterValue();\n this.hideFiltersIfFiltersChosen();\n\n this.doSearch();\n }\n\n async gotoPage(newPage, event)\n {\n if (event)\n dompack.stop(event);\n\n if (newPage >= 0 && newPage <= this.lastPage && newPage != this.curPage)\n {\n }\n else\n return;\n\n this.curPage = newPage;\n\n let container = document.querySelector(\".resultscontainer\");\n container.scrollIntoView();\n\n await this.doSearch();\n\n let firstresult = container.querySelector(\".searchresult\");\n if (firstresult)\n firstresult.focus();\n }\n\n sortResults(newSortField, event)\n {\n if (event)\n dompack.stop(event);\n\n if ([ \"publicationdate\", \"score\", \"title\" ].includes(newSortField) && newSortField != this.sortField)\n {\n this.sortField = newSortField;\n this.curPage = 0;\n this.doSearch();\n }\n }\n\n\n\n\n areFiltersActive()\n {\n // console.info(\"There are\", Object.keys(this.filters).length, \"filters active\");\n //return Object.keys(this.filters).length > 0;\n\n for (let fieldname of Object.keys(this.filters))\n {\n let value = this.filters[fieldname];\n // Don't consider the 'operator' filter when checking for active filters (if only the operator is set to 'or', we're\n // not actually searching for anything yet)\n if (fieldname != \"operator\" && value !== 0 && value !== \"\" && (!Array.isArray(value) || value.length > 0))\n {\n //console.log(\"field %s is set to %s\", fieldname, value);\n return true;\n }\n }\n\n return false;\n }\n\n onDepartmentChange(event)\n {\n if (!this.node.ministers) // If we don't have a filters\n return;\n\n // Only show the ministers for the chosen department\n const department = this.node.departments.value;\n for (const option of this.node.ministers.options)\n {\n const available = !department || !option.dataset.department || option.dataset.department == department;\n option.hidden = !available;\n option.disabled = !available; // Safari doesn't hide hidden options: https://bugs.webkit.org/show_bug.cgi?id=8351\n }\n }\n\n getMultiSelectValue(formfieldname)\n {\n let nodelist = this.node[formfieldname];\n\n if (!nodelist)\n {\n console.error(\"Missing field\", formfieldname);\n return [];\n }\n\n //console.log(formfieldname, nodelist);\n\n let values = [];\n for(let node of nodelist)\n {\n if (node.checked)\n values.push(node.value);\n }\n return values;\n }\n\n\n getFilterValue()\n {\n let departments = this.node.departments.value ? [ this.node.departments.value ] : [];//this.getMultiSelectValue(\"departments\");\n //let ministers = this.node.ministers.value ? [ this.node.ministers.value ] : [];//this.getMultiSelectValue(\"ministers\");\n //let subjects = this.getMultiSelectValue(\"subjects\");\n //let kinds = this.node.kind.value ? [ this.node.kind.value ] : [];\n\n let subjects = [];\n\n let filters =\n { text: this.node.text.value\n , publishedafter: this.node.publishedafter.value\n , publishedbefore: this.node.publishedbefore.value\n , departments: departments\n //, ministers\n , subjects: this.node.subjects.value != \"\" ? [ this.node.subjects.value ] : []\n //, kinds\n };\n\n for (const option of Array.from(this.node.subjects.options))\n {\n //console.log(option, option.value, filters.subjects.indexOf(option.value));\n if (filters.subjects.indexOf(option.value) > -1)\n {\n subjects.push({ value: option.value\n , urlparam: option.dataset.tag\n , title: option.dataset.basetitle\n });\n }\n }\n\n if (this.node.operator)\n filters.operator = this.node.operator.value;\n\n\n this.filtersrec = { subjects: subjects };\n return filters;\n }\n\n\n createFilter(filterType, filterLabel)\n {\n return (\n <button class=\"searchfilters__filter\"\n onClick={event => this._removeFilter(event, filterType)}\n aria-label={getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.deletefilter\", filterLabel)}>\n {filterLabel}\n </button>\n );\n }\n\n async doSearch(searchoptions)\n {\n if (this.pageNode.classList.contains(\"searchpage--searching\"))\n return; // Already searching\n\n this.pageNode.classList.add(\"searchpage--searching\");\n resultsContainerNode.setAttribute(\"aria-busy\", \"true\");\n\n const query = this.getFilterValue();\n // console.log(\"getFilterValue\", query);\n this.filters = query;\n\n let urlobj = this.updateUrlParameters();\n let searchstring = urlobj.searchParams.toString();\n\n console.log(\"Query\", query);\n\n if (window._paq)\n {\n let urlobj = this.updateUrlParameters();\n let searchstring = urlobj.searchParams.toString();\n\n console.info(\"Sending search:\", searchstring);\n window._paq.push(['trackEvent', 'searchipkot', 'search', searchstring ]);\n }\n\n // When showing all matching documents of all matching publications, set first to 0 and count to 10000\n const options = this.showAll ? { first: 0, count: 10000, orderby: this.sortField } : { first: this.curPage * resultsPerPage, count: resultsPerPage, orderby: this.sortField };\n let result;\n\n if (!this.areFiltersActive() && this.sortField == defaultSortField && this.curPage == 0)\n {\n console.info(\"Using cached list of recent items\");\n result = whintegration.config.obj.initialresults; // the most recent results (with no filters) are cached with the published page\n console.info(\"Using cached list\", result);\n }\n else\n {\n // Initialize parameters\n const queryvars = [];\n if (query.text)\n queryvars.push(`text=${encodeURIComponent(query.text)}`);\n if (query.operator && query.operator != defaultOperator)\n queryvars.push(`operator=${encodeURIComponent(query.operator)}`);\n if (query.publishedafter)\n queryvars.push(`publishedafter=${encodeURIComponent(query.publishedafter)}`);\n if (query.publishedbefore)\n queryvars.push(`publishedbefore=${encodeURIComponent(query.publishedbefore)}`);\n if (query.departments.length)\n queryvars.push(`departments=${query.departments.map(_ => encodeURIComponent(_)).join(\",\")}`);\n\n/*\n if (query.ministers.length)\n queryvars.push(`ministers=${query.ministers.map(_ => encodeURIComponent(_)).join(\",\")}`);\n*/\n\n // Categorieen (Subjects)\n if (query.subjects.length)\n queryvars.push(`subjects=${query.subjects.map(_ => encodeURIComponent(_)).join(\",\")}`);\n\n/*\n if (query.kinds.length)\n queryvars.push(`kinds=${query.kinds.map(_ => encodeURIComponent(_)).join(\",\")}`);\n*/\n\n queryvars.push(`first=${options.first}`);\n queryvars.push(`count=${options.count}`);\n queryvars.push(`orderby=${options.orderby}`);\n queryvars.push(`v=6`);\n\n result = await this.serverpool.request(\"?\" + queryvars.join(\"&\"));\n console.info(\"Got results\", result);\n }\n\n\n // Generate the new filter tags --------------------------------------------------------------\n filterTagsContainer.innerHTML = \"\";\n\n if (query.text)\n {\n filterTagsContainer.append(this.createFilter(\"text\", getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-text\", query.text/*, query.operator*/)));\n }\n\n if (query.publishedafter)\n {\n filterTagsContainer.append(this.createFilter(\"publishedafter\", getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-publishedafter\", dateFormatter.format(Date.parse(query.publishedafter)))));\n }\n\n if (query.publishedbefore)\n {\n filterTagsContainer.append(this.createFilter(\"publishedbefore\", getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-publishedbefore\", dateFormatter.format(Date.parse(query.publishedbefore)))));\n }\n\n if (query.departments.length)\n {\n filterTagsContainer.append(...Array.from(this.node[\"departments\"]).filter(option => option.selected).map(option =>\n this.createFilter(\"departments\", getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-department\", option.dataset.basetitle))));\n }\n\n /*\n if (query.ministers.length)\n {\n filterTagsContainer.append(...Array.from(this.node[\"ministers\"]).filter(option => option.selected).map(option =>\n this.createFilter(\"ministers\", getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-minister\", option.dataset.basetitle))));\n }\n */\n\n if (this.filtersrec.subjects.length)\n {\n filterTagsContainer.append(...this.filtersrec.subjects.map(subject =>\n this.createFilter(\"subjects\", getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-subject\", subject.title)/*, option.value*/)));\n }\n\n /*TODO: Is this still used? - k\n if (query.subjects.length)\n {\n filterTagsContainer.append(...Array.from(this.node[\"subjects\"]).filter(option => option.checked).map(option =>\n this.createFilter(\"subjects\", getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-subject\", option.dataset.basetitle), option.value)));\n }\n */\n\n /*\n if (query.kinds.length)\n {\n filterTagsContainer.append(...Array.from(this.node.kind.options).filter(option => option.selected).map(option =>\n this.createFilter(\"kind\", getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-kind\", option.dataset.basetitle))));\n }\n */\n\n if (filterTagsContainer.children.length > 0)\n {\n let filler = <span class=\"searchfilters__filler\"></span>; // to push the clearbutton to the left\n\n let clearbutton = <button class=\"searchfilters__clearbutton\" onClick={event => this.clearFilters(event)}>\n {getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.filter-clear\")}\n </button>;\n\n filterTagsContainer.append(filler);\n filterTagsContainer.append(clearbutton);\n }\n // -------------------------------------------------------------------------------------------\n\n const filtersVisible = this.areFiltersActive();\n\n document.documentElement.classList.toggle(\"searchpage--filtersactive\", filtersVisible);\n document.documentElement.classList.toggle(\"searchpage--noresults\", result.totalcount == 0);\n\n\n dompack.empty(resultsContainerNode);\n\n if (result.totalcount)\n {\n let newcountnode =\n <div class=\"resultscount\">\n <span class=\"resultscount__num\">{numberFormatter.format(result.totalcount)}</span> {getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.resultcount\", result.totalcount, this.areFiltersActive() ? \"filtered\" : \"\")}\n </div>;\n resultsCountNode.replaceWith(newcountnode);\n resultsCountNode = newcountnode;\n\n // Show the sorting options\n resultsContainerNode.append(\n <div class=\"searchresults__sorting\">\n {[\n getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.sortby\"),\n <button class={\"sortoption\" + (this.sortField == \"publicationdate\" ? \" sortoption--current\" : \"\")}\n aria-label={getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.sortby-publicationdate-aria\")}\n onClick={event => this.sortResults(\"publicationdate\", event)}>\n {getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.sortby-publicationdate\")}\n </button>,\n \"|\",\n <button class={\"sortoption\" + (this.sortField == \"score\" ? \" sortoption--current\" : \"\")}\n aria-label={getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.sortby-score-aria\")}\n onClick={event => this.sortResults(\"score\", event)}>\n {getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.sortby-score\")}\n </button>,\n \"|\",\n <button class={\"sortoption\" + (this.sortField == \"title\" ? \" sortoption--current\" : \"\")}\n aria-label={getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.sortby-title-aria\")}\n onClick={event => this.sortResults(\"title\", event)}>\n {getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.sortby-title\")}\n </button>\n ]}\n </div>\n );\n\n\n // FIXME: might be better to publish this in the page\n const rssFeedUrl = document.querySelector(`head > link[rel=\"alternate\"][type=\"application/rss+xml\"]`).getAttribute(\"href\");\n resultsContainerNode.append(\n <div class=\"searchresults__rssfeed\">\n <a href={rssFeedUrl} target=\"_blank\">\n <span class=\"searchresults__rssfeed-icon\"></span>\n {getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.rssfeed\")}\n </a>\n </div>\n );\n\n\n\n // Show the results\n //console.info(\"RESULTS:\", result.results);\n const resultsNode = <ol class=\"searchresults__results\" />;\n result.results.forEach((res, idx) =>\n {\n let link = res.link;\n if (link.substr(0, 1) == \"#\")\n link = whintegration.config.obj.publicationbaseurl + link.substr(1) + \"/\";\n\n let descNode, docsNode;\n let metadata = dateFormatter.format(Date.parse(res.publication.publicationdate));\n let subjects = res.publication.subjects ? this.translateSubjects(res.publication.subjects) : [];\n if (subjects.length)\n metadata = subjects.join(\", \") + \" | \" + metadata;\n\n if (res.publication.decision || res.publication.inventory || res.publication.documents)\n {\n const docs = [ ...(res.publication.decision || []), ...(res.publication.inventory || []), ...(res.publication.documents || []) ];\n const doccount = docs.length;\n // Only show document count if there are results in the documents (multiple_documents is set if there are matches\n // in the complete text of the document)\n if (doccount || res.publication.multiple_documents)\n metadata += ` | ${getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.doccount\", doccount)}`;\n\n if (doccount)\n {\n docsNode =\n <div id={`searchresult__documents--${idx + 1}`} class=\"searchresult__documents\">\n { docs.map(doc =>\n {\n let titleNode, contentNode;\n const docNode =\n <div class=\"searchresult__document\">\n <a href={`${link}${doc.url}` + (doc.docpages.length && doc.docpages[0].page > 1 ? `#page=${doc.docpages[0].page}` : \"\")} class=\"searchresult__doclink\">\n { titleNode = <h4 class=\"searchresult__doctitle\"></h4> }\n { contentNode = doc.docpages.length || doc.contents ? <p class=\"searchresult__docdescription\"/> : null }\n <p class=\"searchresult__docmetadata\">\n { `${doc.type} | ${ doc.filesize} | ${getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.pagecount\", doc.matchpages)}` }\n </p>\n </a>\n </div>\n titleNode.innerHTML = doc.title;\n if (contentNode)\n contentNode.innerHTML = doc.docpages.length ? doc.docpages[0].contents : doc.contents;\n return docNode;\n }\n )}\n </div>;\n }\n }\n\n const resultNode = <li class={\"searchresult__item\" + (docsNode ? \" searchresult__item--hasdocuments\" : \"\")}/>;\n resultNode.append(\n <a href={link}\n class={\"searchresult\" + (docsNode ? \" searchresult--hasdocuments\" : \"\")}\n data-result-id={res.publication.id}\n data-result-score={res.score}>\n <button class=\"searchresult__toggle\"\n aria-label=\"Gevonden documenten binnen deze publicatie\"\n aria-controls={`searchresult__documents--${idx + 1}`}\n onClick={event => this._toggleResultDocuments(event)}\n tabIndex=\"0\" />\n <h3 class=\"searchresult__title\">{ res.publication.title }</h3>\n { descNode = <p class=\"searchresult__description\" /> }\n <p class=\"searchresult__metadata\">{ metadata }</p>\n </a>\n );\n descNode.innerText = res.publication?.summary ?? '';\n\n if (docsNode)\n resultNode.append(docsNode);\n resultsNode.append(resultNode);\n });\n resultsContainerNode.append(resultsNode);\n\n\n // When showing all results, there is only 1 page\n this.lastPage = this.showAll ? 0 : Math.ceil(result.totalcount / resultsPerPage) - 1;\n if (this.lastPage > 0)\n {\n const pagesNode = <div class=\"searchresults__pages\" />;\n // Add a 'previous' link\n if (this.curPage > 0)\n pagesNode.append(\n <button class=\"pagelink pagelink--previous\"\n aria-label=\"Vorige pagina\"\n onClick={event => this.gotoPage(this.curPage - 1, event)}\n >\n {getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.previouspage\")} <span class=\"assistive\">pagina</span>\n </button>\n );\n // Add an ellipsis for left out pages\n if (this.curPage - contextPages > 0)\n pagesNode.append(<span class=\"pagelink pagelink--ellipsis\"></span>);\n // Add context page links\n for (let page = Math.max(0, this.curPage - contextPages); page <= Math.min(this.curPage + contextPages, this.lastPage); ++page)\n {\n if (page == this.curPage)\n pagesNode.append(<span class=\"pagelink pagelink--page pagelink--current\" aria-current=\"page\">{page + 1}</span>);\n else\n pagesNode.append(<button onClick={event => this.gotoPage(page, event)} class=\"pagelink pagelink--page\" aria-label={\"Pagina \"+(page+1)}>{page + 1}</button>);\n }\n // Add an ellipsis for left out pages\n if (this.curPage + contextPages < this.lastPage)\n pagesNode.append(<span class=\"pagelink pagelink--ellipsis\"></span>);\n // Add a 'next' link\n if (this.curPage < this.lastPage)\n pagesNode.append(\n <button class=\"pagelink pagelink--next\"\n aria-label=\"Volgende pagina\"\n onClick={event => this.gotoPage(this.curPage + 1, event)}\n >\n {getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.nextpage\")}\n </button>\n );\n\n resultsContainerNode.append(pagesNode);\n }\n }\n else\n {\n let newcountnode =\n <div class=\"resultscount\">{getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.resultcount\", result.totalcount)}</div>;\n resultsCountNode.replaceWith(newcountnode);\n resultsCountNode = newcountnode;\n //console.log(\"new count node\", resultsCountNode);\n\n resultsContainerNode.append(<div class=\"resultscontainer__noresults\">{ getTid(\"ipkot:webdesigns.ipkotsite.frontend.js.search.noresults\") }</div>);\n }\n\n this.pageNode.classList.remove(\"searchpage--searching\");\n resultsContainerNode.setAttribute(\"aria-busy\", \"false\");\n }\n\n translateSubjects(subjectguids)\n {\n let subjects = [];\n for (let guid of subjectguids)\n {\n // FIXME: might not be the most performant way to do this\n for (let subject of whintegration.config.obj.subjects)\n {\n if (subject.rowkey == guid)\n {\n subjects.push(subject.title);\n break;\n }\n }\n }\n return subjects;\n }\n\n getSubjectValueByTag(subjecttag)\n {\n // FIXME: might not be the most performant way to do this\n for (let subject of whintegration.config.obj.subjects)\n {\n if (subject.tag == subjecttag)\n return subject.rowkey;\n }\n return \"\";\n }\n\n\n\n _toggleResultDocuments(event)\n {\n dompack.stop(event);\n const node = event.target.parentNode;\n if (node.classList.contains(\"searchresult--hasdocuments\"))\n {\n node.classList.toggle(\"searchresult--showdocuments\");\n event.target.setAttribute(\"aria-expanded\", node.classList.contains(\"searchresult--showdocuments\"));\n }\n }\n\n setFiltersVisible(visible)\n {\n this.pageNode.classList.toggle(\"searchpage--showfilters\", visible);\n this.toggleNode.setAttribute(\"aria-expanded\", visible);\n\n let form = document.querySelector(\".wobsearch__filters__content\");\n form.id = \"wobsearch__filters__content\";\n this.toggleNode.setAttribute(\"aria-controls\", \"wobsearch__filters__content\")\n }\n\n _removeFilter(event, field, value)\n {\n dompack.stop(event);\n\n if (value == undefined)\n dompack.changeValue(this.node[field], \"\");\n else\n Array.from(this.node[field]).filter(option => option.value == value).forEach(option => option.checked = false);\n this.doSearch();\n }\n\n _toggleFilters(event)\n {\n dompack.stop(event);\n this.setFiltersVisible(!this.pageNode.classList.contains(\"searchpage--showfilters\"));\n }\n}\n\n\n// DON'T use dompack.register... We want custom fields (such as datepicker picker / multiselect) to be initialized first to prevent them triggering change events\ndompack.register(\".searchpage\", node =>\n{\n headerNode = node.querySelector(\".resultsheader\");\n resultsContainerNode = node.querySelector(\".resultscontainer\");\n resultsCountNode = document.body.querySelector(\".resultscount\");\n filterTagsContainer = document.body.querySelector(\".wobsearch__filtertags\");\n\n searchForm = new SearchForm(document.getElementById(\"wobsearchform\"));\n});\n","import * as pxl from \"@mod-consilio/js/pxl\";\n\nconst scriptServiceVersion = 2;\n\nexport class ServerPool\n{\n constructor(baseurls, options)\n {\n this.options = { timeout: 15000, ...options }; //5 sec no longer suffices with the huge ipkot uploads\n this.baseurls = baseurls || [];\n this.initBaseUrl();\n }\n\n initBaseUrl()\n {\n if (this.baseurls.length)\n this.curbaseurl = this.baseurls[Math.floor(Math.random() * this.baseurls.length)];\n else\n this.curbaseurl = null;\n }\n\n invalidateBaseUrl(baseurl)\n {\n this.baseurls = this.baseurls.filter(_ => _ != this.curbaseurl);\n this.initBaseUrl();\n }\n\n async request(subpath, fallback, checkresult)\n {\n const pxldata = {};\n const pathparts = subpath.split(\"?\");\n if (pathparts.length > 0)\n {\n for (const urlvar of pathparts[1].split(\"&\"))\n {\n const name = urlvar.substr(0, urlvar.indexOf(\"=\"));\n const value = urlvar.substr(name.length + 1);\n if ([ \"first\", \"count\" ].includes(name))\n pxldata[`dn_${name}`] = parseInt(value) || 0;\n else\n pxldata[`ds_${name}`] = value;\n }\n }\n while (true)\n {\n if (this.curbaseurl)\n {\n pxldata.ds_server = this.curbaseurl;\n const url = this.curbaseurl + subpath;\n try\n {\n console.info(\"Fetching\", url);\n const starttime = Date.now();\n let result = await Promise.race([ fetch(url), this.timeoutPromise() ]);\n result = await result.json();\n\n if (result.v != scriptServiceVersion)\n throw new Error(`Unexpected script service version, got ${result.v}, wanted ${scriptServiceVersion}`);\n\n pxl.sendPxlEvent(\"wobcovid19:searchresult\",\n { ...pxldata\n , dn_time: Date.now() - starttime\n });\n return result;\n }\n catch (e)\n {\n console.error(`Error while fetching`, e);\n pxl.sendPxlEvent(\"wobcovid19:searcherror\",\n { ...pxldata\n });\n this.invalidateBaseUrl();\n }\n }\n else\n {\n throw new Error(\"Could not fetch\");\n }\n }\n }\n\n timeoutPromise()\n {\n return new Promise((resolve, reject) => setTimeout(() => reject(new Error(`timeout after ${this.options.timeout}ms`)), this.options.timeout));\n }\n}\n","import * as dompack from \"dompack\";\n\n\ndompack.register(\".firstvisit\", function()\n {\n if (\"visited\" in sessionStorage)\n return;\n\n document.documentElement.classList.add(\"showfirstvisitpanel\");\n\n let button = document.querySelector(\".firstvisit__button\");\n button.addEventListener(\"click\", closeFirstVisitPanel);\n });\n\nfunction closeFirstVisitPanel()\n{\n document.documentElement.classList.remove(\"showfirstvisitpanel\");\n sessionStorage.visited = true;\n}\n","import * as dompack from \"dompack\";\nimport \"./skiplinks.scss\";\n\n\ndompack.onDomReady(initSkipLinks);\n\nfunction initSkipLinks()\n{\n document.querySelector(\".skiplinks\").addEventListener(\"click\", doSkipLinks);\n}\n\nfunction doSkipLinks(evt)\n{\n evt.preventDefault();\n\n // NOTE: Safari won't take scroll-margin-top into account yet for .scrollIntoView\n let main = document.querySelector(\"main\");\n main.focus(); // NOTE: Chrome and Safari will scroll the element into view when we focus\n main.scrollIntoView({ behavior: \"smooth\" }); // Because of Firefox we need to force scrolling (and also to get smooth scrolling)\n}\n","/* See https://code.webhare.com/publisher/utilities/linkhandler/\n*/\n\ninterface LinkOpenOptions {\n internalhosts?: string[];\n extensions?: string[];\n}\n\nconst linkopenoptions: LinkOpenOptions = {};\n\nfunction onLinkClick(event: MouseEvent) {\n const link = (event.target as HTMLElement)?.closest?.('a');\n if (!link || link.download)\n return;\n\n if (!['http', 'https'].includes(link.href.split(':')[0]))\n return; //not a browser protocol, skip\n\n if (link.target) //never overwrite an explicit target\n return;\n\n const destdomain = (new URL(link.href)).host.toLowerCase();\n if (!linkopenoptions?.internalhosts?.includes(destdomain)) {\n link.target = \"_blank\";\n return;\n }\n\n if (linkopenoptions.extensions) {\n const ext = link.href.split('?')[0].split('#')[0].split('.').at(-1);\n if (ext && linkopenoptions.extensions.find(match => match.toUpperCase() === ext.toUpperCase())) {\n link.target = \"_blank\";\n return;\n }\n }\n}\n\nlet isattached = false;\n\nexport function openLinksInNewWindow(options?: LinkOpenOptions) {\n if (!isattached) {\n isattached = true;\n //IE11 fails sometimes (mostly, when navigating to the page but never when using F5, the back/forward page cache must be involved) to actually attach this element\n window.addEventListener(\"click\", onLinkClick);\n }\n Object.assign(linkopenoptions, options);\n\n if (!linkopenoptions.internalhosts) {\n const ourdomain = (new URL(location.href)).host.toLowerCase();\n if (ourdomain.substr(0, 4) === 'www.')\n linkopenoptions.internalhosts = [ourdomain, ourdomain.substr(4)];\n else\n linkopenoptions.internalhosts = [ourdomain, 'www.' + ourdomain];\n }\n}\n"],"mappings":"+2CAAA,IAAAA,GAAAC,GAAA,oBC2FA,SAASC,IAAuB,CAC9B,MAAO,eAAe,CAAC,GAAG,OAAO,KAAKC,CAAU,CAAC,EAAE,OAAOC,GAAOD,EAAWC,CAAG,CAAC,EAAE,KAAK,IAAI,CAAC,GAC9F,CAwBO,SAASC,GAAmCC,EAAgB,CACjEC,GAAyB,KAAKD,CAAE,CAClC,CAiBO,SAASE,GAAQC,EAAyBC,EAAwB,CACvEC,GAAYF,EACZG,GAASD,mBAAsCA,kBAC/CE,GAAcH,EAEdI,GAAYH,GACZI,GAASH,EACX,CA/IA,IAyBML,GAMAS,GAAmCC,GAGrCC,GAYEC,GAyCOhB,EAmCTQ,GAGAC,GAGAC,GAIAC,GAEAC,GAtIJK,GAAAC,GAAA,kBAEAC,KAuBMf,GAA2B,IAAI,MAM/BS,GAA+B,CAAC,EAAGC,GAA8B,CAAC,EAelEE,GAAN,KAAiE,CACvD,eAA8B,CACpC,MAAO,CAAC,GAAGD,KAAwB,GAAK,CAAC,EAAGD,GAAiBD,EAAgB,CAC/E,CAEA,IAAIO,EAAoBC,EAAW,CACjC,QAAWC,KAAU,KAAK,cAAc,EACtC,GAAID,KAAKC,GAAU,OAAOA,EAAOD,CAAC,EAAM,IACtC,OAAOC,EAAOD,CAAC,CAErB,CACA,IAAID,EAAoBC,EAAoB,CAC1C,OAAO,KAAK,IAAID,EAAQC,CAAC,IAAM,MACjC,CACA,QAAQD,EAA4C,CAClD,IAAMG,EAAO,IAAI,MACjB,QAAWD,KAAU,KAAK,cAAc,EACtC,QAAWrB,KAAO,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BS,CAAO,EAElC,CAACT,GAAgB,cAAe,CAClC,IAAMU,EAAa,IAAI,IAAI,SAAS,IAAI,EAAG,KAAK,YAAY,EACxDA,EAAU,OAAO,EAAG,CAAC,IAAM,OAC7BV,GAAgB,cAAgB,CAACU,EAAWA,EAAU,OAAO,CAAC,CAAC,EAE/DV,GAAgB,cAAgB,CAACU,EAAW,OAASA,CAAS,CAClE,CACF,CpEbAC,GAAqB,CAAE,WAAe,CAAE,MAAO,KAAM,CAEhC,CAAC,EAIdC,GACN,UACA,CACEC,GAAoB,CACtB,CAAC,EAEH,SAASA,IACT,CACE,IAAIC,EAAO,SAAS,cAAc,qBAAqB,EACnDA,IAEF,SAAS,cAAc,yBAAyB,EAAE,iBAAiB,QAASC,EAAQ,EACpFD,EAAK,iBAAiB,WAAYE,EAAU,EAEhD,CAEA,SAASD,GAASE,EAClB,CAGE,GAAI,CAAC,SAAS,gBAAgB,UAAU,SAAS,sBAAsB,EACvE,CACEA,EAAI,eAAe,EACnB,SAAS,gBAAgB,UAAU,IAAI,sBAAsB,EAC7D,SAAS,eAAe,yBAAyB,EAAE,MAAM,EACzD,MACF,CACF,CAEA,SAASD,GAAWC,EACpB,CACSA,EAAI,eAAiB,MACbC,GAAQD,EAAI,cAAe,qBAAqB,GAG/D,SAAS,gBAAgB,UAAU,OAAO,sBAAsB,CAClE","names":["init_concepts","__esmMin","formatForConsoleLogs","debugFlags","key","registerDebugConfigChangedCallback","cb","settingschangedcallbacks","initEnv","setDtapStage","setBackendBase","dtapStage","isLive","backendBase","dtapstage","islive","globalDebugFlags","localDebugFlags","debugFlagsOverridesCB","DebugFlagsProxyHandler","init_envbackend","__esmMin","init_concepts","target","p","record","keys","newValue","toModify","value","init_polyfills","__esmMin","resolve","reject","_resolve","_reject","items","callbackfn","retval","idx","item","key","list","isCrossRealm","value","isDate","isBlob","isError","isPromise","init_quacks","__esmMin","parseMS","ms","parseDuration","duration","matches","addDuration","startingdate","direction","date","modifydays","timeoffset","convertWaitPeriodToDate","wait","relativeTo","isDate","isValidDate","year","month","day","minYear","isleapyear","init_datetime","__esmMin","init_quacks","sleep","duration","options","until","convertWaitPeriodToDate","resolve","timeoutid","wrapSerialized","fn","Coalescer","queue","args","res","init_promises","__esmMin","init_datetime","startpos","currentpos","result","i","e","nameToCamelCase","name","c","nameToSnakeCase","init_types","__esmMin","stripUnneededDecimals","num","decimals","isneg","toText","amount","decimalpoint","mindecimals","isnegative","astext","splitValue","money","split","sign","joinPrice","parts","adjustDecimals","requiredecimals","toadd","multiplier","idx","__add","lhs","rhs","add","amount1","amount2","subtract","tosubtract","__multiply","multiply","cmp","diff","getPercentageOfAmount","perc","result","normalize","formatPrice","__roundIntegerToMultiple","value","roundunit","mode","roundToMultiple","unit","split_value","split_unit","min","amounts","val","max","getNonNegativePowerOf10","exp","retval","running_exp","divide","divisor","mul10exp","mulfactor","test","relation","compareresult","init_finmath","__esmMin","stripUnneededDecimals","num","decimals","isneg","splitValue","money","split","sign","toText","amount","decimalpoint","mindecimals","thousandpoint","isnegative","astext","beforepoint","afterpoint","Money","init_money","__esmMin","init_finmath","_Money","value","intvalue","param","left","right","sum","item","add","subtract","roundto","mode","roundToMultiple","cmp","relation","test","multiply","percentage","getPercentageOfAmount","numerator","divider","divide","amounts","min","max","format","formatPrice","escapeRegExp","text","isHTMLUnrepresentableChar","curch","encodeEntities","str","html","s","char","decodeEntities","_","dec","encodeString","encoding","decodeString","stringify","arg","options","usereplacer","key","value","origvalue","Money","isDate","lhs","rhs","result","isValidEmail","email","init_strings","__esmMin","init_quacks","init_money","generateRandomId","encoding","bytes","u8array","x","init_platformbased","__esmMin","emplace","map","key","handler","current","setvalue","pick","value","keys","elt","ret","omit","val","init_collections","__esmMin","throwError","err","init_std","__esmMin","init_promises","init_types","init_strings","init_platformbased","init_collections","init_money","init_datetime","init_quacks","sanitizeBody","body","view","v","getResponseSummary","response","toks","headersToString","headers","debuggableFetch","originalfetch","input","init","debugFlags","method","url","debugrequestid","generateRandomId","reader","chunks","done","value","fetchresult","ct","responsebody","hookFetch","hookedfetch","init_fetchdebug","__esmMin","init_envbackend","init_std","submitForm","action","values","method","form","item","input","navigateTo","navigation","init_navigation","__esmMin","init_env","__esmMin","init_envbackend","init_fetchdebug","init_concepts","init_navigation","debugFlags","hookFetch","registerDebugConfigChangedCallback","dispatchDomEvent","element","eventtype","options","createtype","evt","fireHTMLEvent","type","dispatchCustomEvent","node","event","params","prop","CustomEvent","defaultaction","changeValue","newvalue","asString","stop","addDocEventListener","listener","init_events","__esmMin","getLockmgr","mylockmgr","getParentLockManager","LockManager","anyModalLocks","locallocks","l","scheduleCheckUIFree","uiwatcher","checkUIFree","modallocked","toggleBusyModal","lockmgr","isDialogElement","el","checkCancelEvent","evt","show","dispatchCustomEvent","installedanticancelhandler","busymodalcontent","currentbusymodaluserdialog","dialog","toembed","currentbusymodaldialog","flagUIBusy","options","BusyLock","debugFlags","locallockmgr","lock","init_busy","__esmMin","init_env","init_events","init_polyfills","pos","lockpos","qS","node_or_selector","selector","qR","matches","qSA","isFormControl","field","isHTMLElement","isElement","node","init_tree","__esmMin","generateInsertList","nodes","frag","node","matches","selector","closest","testNode","append","toggleClass","classname","settoggle","empty","isDomReady","onDomReady","callback","e","setStyles","value","key","propvalue","IS_NON_DIMENSIONAL","init_tree","__esmMin","init_dompack","flattenArray","list","acc","elt","setClassName","node","value","str","key","idx","toDashed","MATCH_UPCASE","attrHasBooleanValue","propname","createElement","elementname","attributes","toattrs","attrname","eventname","setStyles","append","child","create","jsxcreate","element","childNodes","parts","init_create","__esmMin","init_tree","isNodeCompletelyInDom","node","processRegistration","item","reg","domready","map","list","applyRegistration","startnode","isDomReady","items","e","focus","options","dispatchCustomEvent","register","selector","handler","newreg","components","onDomReady","registerMissed","init_components","__esmMin","init_tree","init_events","buildCookieHeader","name","value","options","date","init_cookiebuilder","__esmMin","isIsolated","isolated","setCookie","key","value","options","isolatedcookies","buildCookieHeader","getCookie","escapeRegExp","deleteCookie","isStorageAvailable","_available","init_storage","__esmMin","init_cookiebuilder","init_std","init_preload","__esmMin","parseUserAgent","ua","UA","platform","name","version","device","browser","init_browser","__esmMin","init_dompack","__esmMin","init_busy","init_events","init_tree","init_create","init_components","init_storage","init_preload","init_browser","debugflags","init_dompack","__esmMin","init_std","init_events","init_tree","init_create","init_components","init_env","debugFlags","require_stackframe","__commonJSMin","exports","module","root","factory","_isNumber","n","_capitalize","str","_getter","p","booleanProps","numericProps","stringProps","arrayProps","objectProps","props","StackFrame","obj","i","v","fileName","lineNumber","columnNumber","functionName","argsStartIndex","argsEndIndex","args","locationString","parts","j","k","require_error_stack_parser","__commonJSMin","exports","module","root","factory","StackFrame","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","error","urlLike","regExp","parts","filtered","line","sanitizedLine","location","locationParts","functionName","fileName","functionNameRegex","matches","e","lineRE","lines","result","i","len","match","tokens","functionCall","argsRaw","args","require_stack_generator","__commonJSMin","exports","module","root","factory","StackFrame","opts","stack","maxStackSize","curr","args","i","require_util","__commonJSMin","exports","getArg","aArgs","aName","aDefaultValue","urlRegexp","dataUrlRegexp","urlParse","aUrl","match","urlGenerate","aParsedUrl","url","normalize","aPath","path","isAbsolute","parts","part","up","i","join","aRoot","aPathUrl","aRootUrl","joined","relative","level","index","supportsNullProto","obj","identity","s","toSetString","aStr","isProtoString","fromSetString","length","compareByOriginalPositions","mappingA","mappingB","onlyCompareOriginal","cmp","compareByGeneratedPositionsDeflated","onlyCompareGenerated","strcmp","aStr1","aStr2","compareByGeneratedPositionsInflated","require_binary_search","__commonJSMin","exports","recursiveSearch","aLow","aHigh","aNeedle","aHaystack","aCompare","aBias","mid","cmp","index","require_array_set","__commonJSMin","exports","util","has","ArraySet","aArray","aAllowDuplicates","set","i","len","aStr","sStr","isDuplicate","idx","aIdx","require_base64","__commonJSMin","exports","intToCharMap","number","charCode","bigA","bigZ","littleA","littleZ","zero","nine","plus","slash","littleOffset","numberOffset","require_base64_vlq","__commonJSMin","exports","base64","VLQ_BASE_SHIFT","VLQ_BASE","VLQ_BASE_MASK","VLQ_CONTINUATION_BIT","toVLQSigned","aValue","fromVLQSigned","isNegative","shifted","encoded","digit","vlq","aStr","aIndex","aOutParam","strLen","result","shift","continuation","require_quick_sort","__commonJSMin","exports","swap","ary","x","y","temp","randomIntInRange","low","high","doQuickSort","comparator","p","r","pivotIndex","i","pivot","j","q","require_source_map_consumer","__commonJSMin","exports","util","binarySearch","ArraySet","base64VLQ","quickSort","SourceMapConsumer","aSourceMap","sourceMap","IndexedSourceMapConsumer","BasicSourceMapConsumer","aStr","index","c","aSourceRoot","aCallback","aContext","aOrder","context","order","mappings","sourceRoot","mapping","source","aArgs","line","needle","originalLine","originalColumn","version","sources","names","sourcesContent","file","smc","generatedMappings","destGeneratedMappings","destOriginalMappings","i","length","srcMapping","destMapping","Mapping","s","generatedLine","previousGeneratedColumn","previousOriginalLine","previousOriginalColumn","previousSource","previousName","cachedSegments","temp","originalMappings","str","segment","end","value","aNeedle","aMappings","aLineName","aColumnName","aComparator","aBias","nextMapping","name","sc","aSource","nullOnMissing","url","fileUriAbsPath","sections","lastOffset","offset","offsetLine","offsetColumn","j","sectionIndex","section","cmp","content","generatedPosition","ret","sectionMappings","adjustedMapping","require_stacktrace_gps","__commonJSMin","exports","module","root","factory","SourceMap","StackFrame","_xdr","url","resolve","reject","req","_atob","b64str","_parseJson","string","_findFunctionName","source","lineNumber","syntaxes","lines","code","maxLines","i","line","commentPos","len","index","m","_ensureSupportedEnvironment","_ensureStackFrameIsLegit","stackframe","_findSourceMappingURL","sourceMappingUrlRegExp","lastSourceMappingUrl","matchSourceMappingUrl","_extractLocationInfoFromSourceMapSource","sourceMapConsumer","sourceCache","loc","mappedSource","StackTraceGPS","opts","location","isDataUrl","supportedEncodingRegexp","match","sourceMapStart","encodedSource","xhrPromise","sourceMappingURL","defaultSourceRoot","sourceMapConsumerPromise","sourceMapSource","mappedStackFrame","resolveMappedStackFrame","columnNumber","guessedFunctionName","fileName","require_stacktrace","__commonJSMin","exports","module","root","factory","ErrorStackParser","StackGenerator","StackTraceGPS","_options","stackframe","_generateError","err","_merge","first","second","target","obj","prop","_isShapedLikeParsableError","_filtered","stackframes","filter","opts","stack","error","gps","resolve","sf","resolveOriginal","stackFrames","fn","callback","errback","thisArg","instrumented","e","url","errorMsg","requestOptions","reject","req","headers","header","reportPayload","require_events","__commonJSMin","exports","module","R","ReflectApply","target","receiver","args","ReflectOwnKeys","ProcessEmitWarning","warning","NumberIsNaN","value","EventEmitter","once","defaultMaxListeners","checkListener","listener","arg","n","_getMaxListeners","that","type","doError","events","er","err","handler","len","listeners","arrayClone","_addListener","prepend","m","existing","w","onceWrapper","_onceWrap","state","wrapped","list","position","i","originalListener","spliceOne","keys","key","_listeners","unwrap","evlistener","unwrapListeners","emitter","listenerCount","arr","copy","index","ret","name","resolve","reject","errorListener","resolver","eventTargetAgnosticAddListener","addErrorHandlerIfEventEmitter","flags","wrapListener","require_requester","__commonJSMin","exports","module","init_dompack","EventEmitter","InternetRequester","options","debugflags","method","url","body","async","key","event","datestr","parseddate","evt","require_jsonrpc","__commonJSMin","exports","module","init_env","InternetRequester","rpcscriptid","JSONRPC","_JSONRPC","options","method","params","deferred","req","errorcode","errormsg","rpcid","promise","result","rejection","onsuccess","onfailure","id","url","timeout","waittimeout","synchronous","errortrace","request","Request","isLive","i","el","event","status","json","trace","line","rec","waiting","nextTimeout","now","waitLength","toGo","parent","getGetTidHooks","gotHooks","hookFactory","init_hooks","__esmMin","ensureHooks","hooks","getGetTidHooks","lang","browserSetLanguage","getTidLanguage","defaultLanguage","setTidLanguage","newLanguage","getLanguageFile","module","langCode","langkey","compiled","langFileCache","loader","e","isLive","debugFlags","texts","toHTMLNode","tag","props","node","wrapInFragment","children","fragment","getTidInternal","tid","params","options","decodeString","nodes","calcTIDForLanguage","getTid","p","getHTMLTid","getHTMLTidForLanguage","encodeString","cannotFind","langcode","rawParams","rich","render","getCanonicalTid","getLanguageDatetimeStrings","modsep","lookup","debugtid","match","fallbackMatch","executeCompiledTidText","renderString","tok","part","_","text","parts","get_param","sub","link","flattenRecursiveLanguageTexts","pathsofar","result","name","value","registerTexts","tids","compiledFile","key","init_internal","__esmMin","init_std","init_hooks","init_env","init_gettid","__esmMin","init_internal","gettid_exports","__export","convertElementTids","getTid","getHTMLTid","getTidLanguage","registerTexts","setTidLanguage","scope","node","init_gettid","__esmMin","init_internal","args","require_jquery","__commonJSMin","exports","module","global","factory","w","window","noGlobal","arr","getProto","slice","flat","array","push","indexOf","class2type","toString","hasOwn","fnToString","ObjectFunctionString","support","isFunction","obj","isWindow","document","preservedScriptAttributes","DOMEval","code","node","doc","i","val","script","toType","version","jQuery","selector","context","num","elems","ret","callback","elem","_elem","len","j","options","name","src","copy","copyIsArray","clone","target","length","deep","msg","proto","Ctor","isArrayLike","results","first","second","invert","callbackInverse","matches","callbackExpect","arg","value","_i","type","Sizzle","Expr","getText","isXML","tokenize","compile","select","outermostContext","sortInput","hasDuplicate","setDocument","docElem","documentIsHTML","rbuggyQSA","rbuggyMatches","contains","expando","preferredDoc","dirruns","done","classCache","createCache","tokenCache","compilerCache","nonnativeSelectorCache","sortOrder","a","b","pop","pushNative","list","booleans","whitespace","identifier","attributes","pseudos","rwhitespace","rtrim","rcomma","rcombinators","rdescend","rpseudo","ridentifier","matchExpr","rhtml","rinputs","rheader","rnative","rquickExpr","rsibling","runescape","funescape","escape","nonHex","high","rcssescape","fcssescape","ch","asCodePoint","unloadHandler","inDisabledFieldset","addCombinator","els","seed","m","nid","match","groups","newSelector","newContext","nodeType","testContext","toSelector","keys","cache","key","markFunction","fn","assert","el","addHandle","attrs","handler","siblingCheck","cur","diff","createInputPseudo","createButtonPseudo","createDisabledPseudo","disabled","createPositionalPseudo","argument","matchIndexes","namespace","hasCompare","subWindow","id","attrId","tag","tmp","className","input","adown","bup","compare","aup","ap","bp","expr","elements","sel","duplicates","excess","unquoted","nodeNameSelector","nodeName","pattern","operator","check","result","what","_argument","last","simple","forward","ofType","_context","xml","uniqueCache","outerCache","nodeIndex","start","dir","parent","useCache","pseudo","args","idx","matched","matcher","unmatched","text","lang","elemLang","hash","attr","_matchIndexes","setFilters","parseOnly","tokens","soFar","preFilters","cached","combinator","base","skip","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","multipleContexts","contexts","condense","map","filter","newUnmatched","mapped","setMatcher","preFilter","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","token","find","compiled","_name","until","truncate","siblings","rneedsContext","rsingleTag","winnow","qualifier","not","self","rootjQuery","init","root","rparentsprev","guaranteedUnique","targets","l","selectors","sibling","rnothtmlwhite","createOptions","object","_","flag","firing","memory","fired","locked","queue","firingIndex","fire","add","index","Identity","v","Thrower","ex","adoptValue","resolve","reject","noValue","method","func","tuples","state","promise","deferred","fns","newDefer","tuple","returned","onFulfilled","onRejected","onProgress","maxDepth","depth","special","that","mightThrow","then","process","e","stateString","singleValue","remaining","resolveContexts","resolveValues","primary","updateFunc","rerrorNames","error","stack","readyList","wait","completed","access","chainable","emptyGet","raw","bulk","_key","rmsPrefix","rdashAlpha","fcamelCase","_all","letter","camelCase","string","acceptData","owner","Data","data","prop","dataPriv","dataUser","rbrace","rmultiDash","getData","dataAttr","startLength","hooks","next","setter","count","defer","pnum","rcssNum","cssExpand","documentElement","isAttached","composed","isHiddenWithinTree","adjustCSS","valueParts","tween","adjusted","scale","maxIterations","currentValue","initial","unit","initialInUnit","defaultDisplayMap","getDefaultDisplay","display","showHide","show","values","rcheckableType","rtagName","rscriptType","fragment","div","wrapMap","getAll","setGlobalEval","refElements","buildFragment","scripts","selection","ignored","wrap","attached","nodes","rtypenamespace","returnTrue","returnFalse","expectSync","safeActiveElement","on","types","one","origFn","event","handleObjIn","eventHandle","events","t","handleObj","handlers","namespaces","origType","elemData","mappedTypes","origCount","nativeEvent","handlerQueue","matchedHandlers","matchedSelectors","delegateCount","hook","originalEvent","leverageNative","notAsync","saved","handle","props","delegateType","orig","fix","related","rnoInnerhtml","rchecked","rcleanScript","manipulationTarget","content","disableScript","restoreScript","cloneCopyEvent","dest","pdataOld","udataOld","udataCur","fixInput","domManip","collection","hasScripts","iNoClone","valueIsFunction","remove","keepData","html","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","original","insert","rnumnonpx","getStyles","view","swap","old","rboxStyle","computeStyleTests","container","divStyle","pixelPositionVal","reliableMarginLeftVal","roundPixelMeasures","pixelBoxStylesVal","boxSizingReliableVal","scrollboxSizeVal","measure","reliableTrDimensionsVal","table","tr","trChild","trStyle","curCSS","computed","width","minWidth","maxWidth","style","addGetHookIf","conditionFn","hookFn","cssPrefixes","emptyStyle","vendorProps","vendorPropName","capName","finalPropName","final","rdisplayswap","rcustomProp","cssShow","cssNormalTransform","setPositiveNumber","subtract","boxModelAdjustment","dimension","box","isBorderBox","styles","computedVal","extra","delta","getWidthOrHeight","boxSizingNeeded","valueIsBorderBox","offsetProp","origName","isCustomProp","scrollboxSizeBuggy","prefix","suffix","expanded","parts","Tween","end","easing","percent","eased","p","fxNow","inProgress","rfxtypes","rrun","schedule","createFxNow","genFx","includeWidth","which","createTween","animation","Animation","defaultPrefilter","opts","toggle","oldfire","propTween","restoreDisplay","isBox","anim","hidden","dataShow","propFilter","specialEasing","properties","stopped","tick","currentTime","gotoEnd","prepend","speed","opt","to","empty","optall","doAnimation","clearQueue","stopQueue","stop","dequeue","timers","cssFn","timer","time","timeout","boolHook","attrHandle","nType","attrNames","getter","lowercaseName","rfocusable","rclickable","tabindex","stripAndCollapse","getClass","classesToArray","classes","curValue","clazz","finalValue","stateVal","isValidValue","classNames","rreturn","option","max","optionSet","rfocusMorph","stopPropagationCallback","onlyHandlers","bubbleType","ontype","lastElement","eventPath","attaches","location","nonce","rquery","parserErrorElem","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","traditional","s","valueOrFunction","r20","rhash","rantiCache","rheaders","rlocalProtocol","rnoContent","rprotocol","prefilters","transports","allTypes","originAnchor","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","seekingTransport","inspect","selected","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxHandleResponses","responses","ct","finalDataType","firstDataType","contents","ajaxConvert","response","isSuccess","conv2","current","conv","prev","converters","settings","url","transport","cacheURL","responseHeadersString","responseHeaders","timeoutTimer","urlAnchor","fireGlobals","uncached","callbackContext","globalEventContext","completeDeferred","statusCode","requestHeaders","requestHeadersNames","strAbort","statusText","finalText","status","nativeStatusText","headers","success","modified","htmlIsFunction","xhrSuccessStatus","xhrSupported","errorCallback","complete","xhr","evt","oldCallbacks","rjsonp","originalSettings","callbackName","overwritten","responseContainer","jsonProp","body","keepScripts","parsed","params","off","responseText","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","calculatePosition","position","curElem","rect","win","offsetParent","offset","parentOffset","top","defaultExtra","funcName","margin","fnOver","fnOut","proxy","hold","_jQuery","_$","init_concepts","init_envbackend","getBrowserDebugFlags","varname","flags","urldebugvar","debugcookie","debugcookievalue","flag","config","siteroot","dtapStage","whconfigel","initEnv","flag","getBrowserDebugFlags","debugFlags","frontendConfig","init_polyfills","IteratorPrototype","ArrayIteratorPrototype","OriginalIteratorPrototype","callback","it","value","next_value","real_value","max_count","values","limit","remaining","index","mapper","mapped","reducer","initial_value","acc","count","string","final","first","iterables","others","it_array","e","finished","partition1","partition2","i","max","min","isObject","t","GetIteratorFlattenable","obj","method","iterator","Iterator","WrappedIterator","#iterator","args","returnMethod","Iterator_from","publicconfig_default","forwardPublisherNavigation","event","navaction","desturl","origin","publicconfig_default","init_dompack","init_dompack","init_env","init_env","parseUserAgent","ua","UA","platform","browser","getPlatform","browser","getTriplet","browser","import_stacktrace_js","init_std","JSONRPC","haveerror","mayreport","saved_onerror","root","debugFlags","P","MyPromise","executor","p","installHandlers","handleOnError","event","reportException","resetMayReport","reported","sourceCache","reportPromise","errorobj","options","exception_text","isError","shouldsend","resolve","promise","stackframes","StackTrace","frame","e","data","getTriplet","serviceuri","s","errormsg","url","linenumber","column","shouldIgnoreOnErrorCallback","altstack","debugFlags","installHandlers","init_dompack","evt","doCheckForMultiselectClear","getTitleForCheckbox","elemid","labelnode","updateMultiSelectByNode","multiselect","valuenode","cbnodes","titles","node","title","getTitleForCheckbox","fixedtitle","doCheckForMultiselectClear","evt","closest","cbs","cb","form","dispatchCustomEvent","refreshAll","multiselects","mscontainer","onDomReady","init_dompack","init_dompack","formatters","updaters","mergeNode","node","set","data","parts","isNodeFunc","func","exprpath","callparts","funcrest","value","exprpathparts","i","prop","run","mergenode","filter","nodes","sets","init_dompack","registerTexts","init_env","init_dompack","getISOLocalDate","date","init_dompack","init_dompack","getActiveElement","doc","getToplevelWindow","toplevelwindow","asIframe","node","getCurrentlyFocusedElement","limitdoc","focused","frame","getIframeFocusableNodes","currentnode","recurseframes","subnodes","body","getFocusableComponents","e","canFocusTo","ignoreInertAttribute","startnode","focusable","currentstyle","iframe","init_dompack","init_std","init_env","eventname_regex","datakey_regex","max_sessionid_age","globalOptions","debugFlags","pagesession","useAltRecordURL","seqnr","setPxlOptions","options","pxlFailed","errormessage","params","isLive","makePxlURL","baseurl","eventname","data","generateRandomId","url","getPxlId","getPxlSessionId","browser","name","value","test","type","havelocalstorage","isStorageAvailable","sessionExpireDays","expiration","id","timestampvar","timestamp","getCookie","setCookie","sendPxlEvent","event","finaloptions","dispatchCustomEvent","pingPxlEvent","evt","isaltsample","xhr","promise","error","init_std","init_env","rfSymbol","init_gettid","init_std","init_dompack","fixupConditionRecursive","node","condition","mapping","anychanges","subcondition","newName","ArrayField","handler","items","name","throwError","qS","event","addDocEventListener","rownode","qSA","form","getFormHandler","newrow","addedrow","registerMissed","setup","stop","delNode","row","rowBaseName","rowFields","getFormElementCandidates","_","RecordFieldHandler","rows","n","rowval","valuePromises","rowPromises","field","values","rowValue","value","idx","rowField","firstnode","valueRows","newvalue","fieldnode","rowid","nodeArray","fieldname","getFieldName","cellname","subname","setFieldName","labelnodes","labelnode","type","conditionnode","parseCondition","minRows","maxRows","numRows","getTid","init_std","unmapFieldName","camelCaseName","nameToSnakeCase","mapFieldName","htmlName","nameToCamelCase","mapValue","type","invalue","unmapValue","fieldDescr","isDate","HTMLFormFieldHandler","form","field","selectedrow","newvalue","setvalue","RadioFormFieldHandler","name","rnodes","throwError","node","_","myname","CheckboxGroupHandler","cboxes","toset","missing","cbox","RegisteredFieldHandler","ArrayFieldHandler","items","rfSymbol","ArrayField","getFieldName","FormFieldMap","fieldName","nodes","subpos","groups","fullName","arraygroup","AddressFieldHandler","RecordFieldHandler","options","mapName","match","data","ignoreUnknownFields","key","value","baseName","retval","val","prettyName","omit","FieldMapDataProxy","target","p","prop","submitselector","delayvalidation","validationpendingfor","getPageIdx","state","page","idx","getErrorFields","validationresult","field","getName","value","index","self","hasEverFailed","doValidation","iffailedbefore","releasePendingValidations","debugFlags","form","doDelayValidation","tovalidate","lastfocusout","handleFocusOutEvent","event","handleFocusInEvent","handleValidateAfterEvent","FormBase","FormFieldMap","node","getFormElementCandidates","setup","addDocEventListener","evt","pagestate","generateRandomId","FieldMapDataProxy","name","eventtype","vars","now","isfirst","sendPxlEvent","control","qSA","element","target","ourcondition","parseCondition","searchparams","allvalues","shouldbechecked","tocheck","_","type","getError","fieldgroup","field_with_message","error","create","potentialgroupnode","contextnode","messageid","messagenode","suggestionholder","describedby","describedby_fields","failedfield","getValidationState","stop","extradata","submitter","tempbutton","dispatchCustomEvent","el","queryFormFieldLike","startingpoint","lock","flagUIBusy","result","containingpage","pagenum","actionnode","pages","curpage","pagelist","currentpage","scrollto","origscrollto","pageidx","goingforward","run","direction","pagenode","action","validationstatus","isinit","hiddenPages","mergeNodes","anychanges","formpage","visible","hiddengroups","enabledgroups","requiredgroups","formgroup","groupPage","enabled","required","formline","inputtargets","node_enabled","isFormFieldLike","node_required","isFormControl","option","option_enabled","option_hidden","selectnode","wrapSerialized","nodes","formvalue","mergeNode","conditiontext","fieldname","options","matchfield","isRadioNodeList","currentvalue","conditionfield","fields","attrname","selectedvalue","val","selected","qS","extrafields","condition","subcondition","birthdate","age","matchcase","compareagainst","currentValArray","nextpage","morepages","curpagerole","nextpagerole","richvalues","redirectto","redirectdelay","navigateTo","registerMissed","isLive","getFieldDisplayName","rfSymbol","deferred","file","fieldnode","saveInteractive","changeValue","foundfields","skiparraymembers","addto","isRadioOrCheckbox","resolve","reject","outdata","fieldpromises","e","receivedvalue","isPromise","opts","vals","checker","setupValidator","setFieldError","isFieldNativeErrored","updateFieldError","validator","limitset","defer","item","original","group","subnode","tovalidatelist","validationresults","fld","failed","tofocus","canFocusTo","getFocusableComponents","focus","init_env","init_std","init_env","init_env","UNKNOWN_FUNCTION","parse","stackString","lines","stack","line","parseResult","parseChrome","parseWinjs","parseGecko","parseNode","parseJSC","chromeRe","chromeEvalRe","parts","isNative","isEval","submatch","winjsRe","geckoRe","geckoEvalRe","javaScriptCoreRe","nodeRe","parseTrace","parse","i","prependStackTrace","error","trace","stacklines","tracelines","e","init_std","globalseqnr","getDebugAppend","urldebugvar","ControlledCall","client","method","stack","id","options","callurl","fetchoptions","fetchpromise","requestStack","response","retryafter","resolve","exception","jsonresponse","logitem","err","prependStackTrace","RPCClient","url","debugFlags","error","backendBase","params","parseTrace","ServiceProxy","target","prop","receiver","newoptions","createClient","args","servicename","rpcclient","hsFormService","createClient","tsFormService","formservice_default","lookupcache","verifyHareScriptAddress","address","options","lookupkey","stringify","emplace","formservice_default","init_std","SubField","node","pos","throwError","AddressField","qR","prefixLength","fieldpos","field","qSA","event","fieldname","data","firstfield","key","country","ordering","e","prevgroup","idx","item","fieldgroup","setFieldError","value","visiblefields","anyset","allrequiredset","form","FormBase","curstate","result","lock","flagUIBusy","el","verifyHareScriptAddress","debugFlags","err","anychanges","newvalue","changeValue","init_dompack","init_gettid","registerTexts","captcharegistry","getCaptchaResponse","apikey","settings","finalsettings","getTid","init_dompack","CaptchaField","node","addDocEventListener","evt","stop","metadata","formel","form","FormBase","captchapage","result","getCaptchaResponse","init_gettid","init_std","formatDate","dateformat","year","month","day","isValidDate","output","c","parseDate","format","newdate","options","parts","dayoffset","monthoffset","yearoffset","daypos","monthpos","yearpos","day","month","year","isValidDate","parseISODate","newdate","options","parseDate","init_std","validateCheckboxGroup","groupnode","nodes","qSA","min","max","anyenabled","node","numChecked","getTid","validateRadioGroup","reformatDate","datestr","parsed","parseISODate","formatDate","validateDate","date","dateparts","year","month","day","isValidDate","normalizeddate","validateTime","time","timeparts","hours","minutes","seconds","setup","form","datecontrol","field","datematch","propname","thedate","getISOLocalDate","setupValidator","timecontrol","propvalue","checkboxgroup","radiogroup","addresscontrol","AddressField","captchanode","jsxcreate","CaptchaField","init_gettid","init_dompack","JSFormElement","newname","required","disable","name","oldValue","newValue","init_std","queryFormFieldLike","isInputElement","field","isHTMLElement","isFormFieldLike","control","isFormControl","JSFormElement","isRadioOrCheckbox","isRadioNodeList","el","getFieldName","setFieldName","newname","getFieldDisplayName","downgradeUploadFields","form","uploadfield","qSA","input","attr","getErrorForValidity","validity","getTid","max","reformatDate","min","key","isFieldNativeErrored","getFieldNativeError","parseCondition","conditiontext","getFormElementCandidates","basenode","namePrefix","parentForm","candidates","getFormHandler","node","allowMissing","throwError","setupServerErrorClear","field","group","setFieldError","ComponentValidationState","el","err","getFieldNativeError","validations","getValidationState","state","newstate","error","options","isHTMLElement","debugFlags","getFieldDisplayName","updateFieldError","dispatchCustomEvent","setupValidator","node","checker","init_dompack","init_dompack","init_gettid","init_std","cache","mayValidateField","field","acceptEmailSuggestion","evt","form","suggestion","stop","validateField","setFieldError","checkvalue","isValidEmail","getTid","key","formservice_default","getTidLanguage","result","jsxcreate","init_dompack","init_events","init_env","debugFlags","flagname","IS_MAC_PLATFORM","getPlatform","dialogconstructor","dialogoptions","createDialog","options","dialogconstructor","dialog","runMessageBox","question","choices","choicebuttons","choice","create","dialogoptions","init_env","init_std","init_dompack","MultiFileUploader","files","signal","_","instructions","options","outfiles","uploadedBytes","uploadedFiles","totalBytes","acc","file","totalFiles","start","fireProgressEvent","partialbytes","curUploaded","timeElapsed","idx","offset","data","uploadurl","defer","xmlhttp","ev","doAbort","SingleFileUploader","unpackObject","formvalue","_","FormSubmitter","target","cache","file","completed","uploader","SingleFileUploader","uploadinstructions","tsFormService","uploadedfile","isBlob","result","key","value","RPCFormBase","FormBase","#completedUploads","formnode","isLive","#getSubmitVals","formvalue","FormSubmitter","background","methodname","args","waiter","lock","flagUIBusy","rpc","formservice_default","unpackObject","result","field","prop","value","fieldnode","promise","messages","msg","extradata","insubmitrpc","eventdetail","extraSubmitAwaitable","valsAwaitable","extrasubmit","vals","dispatchCustomEvent","submitparameters","debugFlags","didfirstfocus","globalerrors","error","failednode","focus","setFieldError","run","failedfields","pick","e","errors","create","runMessageBox","navigateTo","getCurrentlyFocusedElement","validation","validateField","init_std","firstWarningMs","warningIntervalMs","handlers","form","FormBase","RPCFormBase","scheduleFormSetup","form","factory","_stack","lock","__using","flagUIBusy","customEls","qSA","_","initPromise","nextWarning","firstWarningMs","timeoutPromise","sleep","missing","tag","downgradeUploadFields","warningIntervalMs","_error","_hasError","__callDispose","register","form","handlers","scheduleFormSetup","init_dompack","init_events","init_gettid","init_env","init_std","isLive","labelcount","formatDate","dateformat","dateparts","output","c","formatISODate","ensureLabelID","inputnode","id","labelnode","mySelectGetValue","mySelectSetValue","newvalue","origsetter","setupMyDateValueProperty","select","MultiInputSubstition","inpnode","isdisabled","isrequired","toggleClass","node","SplitDateField","__hideInput","day_pos","month_pos","year_pos","ordering","__strToIntegerArray","i","frontendConfig","parts","isreadonly","year_min","year_max","jsxcreate","labelid","getTid","ev","nextnode","prev_day","prev_month","prev_year","__validateNumberField","setvalue","isValidDate","hasvalue","fireHTMLEvent","prevval","prevnode","previnp","value","nextinp","SplitTimeField","prev_hours","prev_minutes","prev_seconds","str","ilist","self","fieldname","import_jquery","import_jquery","import_jquery","import_jquery","import_jquery","$","$","import_jquery","cachedScrollbarWidth","max","abs","rhorizontal","rvertical","roffset","rposition","rpercent","_position","$","getOffsets","offsets","width","height","parseCss","element","property","getDimensions","elem","raw","w1","w2","div","innerDiv","within","overflowX","overflowY","hasOverflowX","hasOverflowY","withinElement","isWindow","isDocument","hasOffset","options","atOffset","targetWidth","targetHeight","targetOffset","basePosition","dimensions","target","scrollInfo","collision","pos","horizontalOffset","verticalOffset","collisionPosition","using","elemWidth","elemHeight","marginLeft","marginTop","collisionWidth","collisionHeight","position","myOffset","i","dir","props","left","right","top","bottom","feedback","data","withinOffset","outerWidth","collisionPosLeft","overLeft","overRight","newOverRight","outerHeight","collisionPosTop","overTop","overBottom","newOverBottom","offsetLeft","offset","newOverLeft","offsetTop","newOverTop","import_jquery","$","document","activeElement","import_jquery","$","uuid","import_jquery","widgetUuid","widgetSlice","$","orig","elems","events","elem","i","name","base","prototype","existingConstructor","constructor","basePrototype","proxiedPrototype","namespace","fullName","options","element","prop","value","_super","_superApply","args","__super","__superApply","returnValue","child","childPrototype","target","input","inputIndex","inputLength","key","object","isMethodCall","methodValue","instance","event","that","parts","curOption","classKey","elements","currentElements","full","processClassString","classes","checkOption","current","keys","extra","add","shift","suppressDisabledCheck","handlers","delegateElement","handler","handlerProxy","match","eventName","selector","delay","type","data","callback","method","defaultEffect","hasOptions","effectName","next","$","event","target","active","actualTarget","keepActiveItem","item","notContained","items","submenus","elem","match","prev","character","skip","preventDefault","menus","newSubmenus","newItems","newWrappers","that","icon","menu","submenuCaret","key","value","icons","nested","focused","activeParent","borderTop","paddingTop","offset","scroll","elementHeight","itemHeight","fromFocus","submenu","position","all","currentMenu","startMenu","newItem","direction","filter","next","base","height","ui","escapedCharacter","regex","$","suppressKeyPress","suppressKeyPressRepeat","suppressInput","nodeName","isTextarea","isInput","event","keyCode","ui","label","item","previous","key","value","menuElement","element","array","url","that","request","response","data","equalValues","menuVisible","modifierKey","index","content","items","ul","direction","keyEvent","editable","term","matcher","amount","message","autocomplete_default","import_jquery","import_jquery","$","selectorEscape","selector","import_jquery","import_jquery","$","$","form","instances","import_jquery","$","ancestor","selector","id","labels","ancestors","$","selectmenuId","icon","that","item","event","ui","options","buttonItem","ul","items","currentOptgroup","index","li","wrapper","element","value","direction","next","filter","selection","preventDefault","oldIndex","id","key","width","data","option","optgroup","selectmenu_default","import_jquery","import_jquery","import_jquery","$","mouseHandled","$","that","event","btnIsLeft","elIsCancel","$","i","handleCount","options","existingHandles","handle","handles","event","position","normValue","distance","closestHandle","index","allowed","offset","mouseOverHandle","that","o","thisDistance","pixelTotal","pixelMouse","percentMouse","valueTotal","valueMouse","value","values","uiHash","newVal","otherVal","currentValue","newValues","newValue","vals","key","valsLength","val","step","valModStep","alignValue","max","min","aboveMin","precision","num","str","decimal","orientation","lastValPercent","valPercent","valueMin","valueMax","oRange","animate","_set","curVal","import_jquery","$","datepicker_instActive","datepicker_getZindex","elem","position","value","Datepicker","datepicker_bindHover","settings","datepicker_extendRemove","target","nodeName","inline","inst","id","input","showOn","buttonText","buttonImage","appendText","isRTL","findMax","max","maxI","i","date","dateFormat","names","divSpan","onSelect","pos","browserWidth","browserHeight","scrollX","scrollY","$target","name","minDate","maxDate","noDefault","event","dateStr","sel","handled","chars","chr","beforeShow","beforeShowSettings","isFixed","offset","showAnim","duration","origyearshtml","numMonths","cols","width","activeCell","datepicker_handleMouseover","dpWidth","dpHeight","inputWidth","inputHeight","viewWidth","viewHeight","obj","postProcess","onClose","period","select","month","year","td","altFormat","altField","day","time","checkDate","format","iFormat","dim","extra","iValue","shortYearCutoffTemp","shortYearCutoff","dayNamesShort","dayNames","monthNamesShort","monthNames","doy","literal","lookAhead","match","matches","getNumber","isDoubled","size","minSize","digits","num","getName","shortNames","longNames","index","v","k","a","b","pair","checkLiteral","formatNumber","len","formatName","output","dates","defaultDate","offsetNumeric","offsetString","pattern","newDate","noChange","clear","origMonth","origYear","startDate","stepMonths","handler","maxDraw","prevText","prev","nextText","next","currentText","gotoDate","controls","buttonPanel","firstDay","showWeek","dayNamesMin","beforeShowDay","showOtherMonths","selectOtherMonths","html","dow","row","group","col","selectedDate","cornerClass","calender","thead","daysInMonth","leadDays","curRows","numRows","printDate","dRow","tbody","daySettings","otherMonth","unselectable","tempDate","today","showButtonPanel","hideIfNoPrevNext","navigationAsDateFormat","showCurrentAtPos","isMultiMonth","currentDate","drawMonth","drawYear","secondary","inMinYear","inMaxYear","years","thisYear","determineYear","endYear","changeMonth","changeYear","showMonthAfterYear","monthHtml","onChange","minMax","curYear","curMonth","yearSplit","currentYear","minYear","maxYear","dpDiv","selector","props","options","otherArgs","import_jquery","$","import_jquery","$","import_jquery","$","simulateMouseEvent","event","simulatedType","touch","simulatedEvent","mouseProto","_mouseInit","_mouseDestroy","self","touchHandled","register","node","SplitTimeField","getPlatform","SplitDateField","init_dompack","init_gettid","registerTexts","init_dompack","init_envbackend","consentstatus","cookiename","consentoptions","getConsentDetail","consentstatus","consentoptions","onConsent","type","callback","evt","details","debugFlags","cookiename","deleteCookie","youtubedomain","createMyFrame","ifrm","initYouTube","node","video","playback","args","youtube_url","initVimeo","vimeo_url","t","minutes","seconds","launchVideo","opts","initializeVideoElementV1","initializeVideoElementV2","videonodes","qSA","videonode","activateVideo","playbutton","getTid","evt","onConsent","register","registerTexts","init_dompack","init_gettid","scriptServiceVersion","ServerPool","baseurls","options","baseurl","_","subpath","fallback","checkresult","pxldata","pathparts","urlvar","name","value","url","starttime","result","sendPxlEvent","e","resolve","reject","init_dompack","register","closeFirstVisitPanel","defaultSortField","frontendConfig","defaultOperator","resultsPerPage","contextPages","dateFormatter","numberFormatter","headerNode","resultsContainerNode","searchForm","resultsCountNode","filterTagsContainer","SearchForm","node","ServerPool","frontendConfig","event","defaultSortField","changeValue","url","operator","input","value","option","_","defaultOperator","visible","stop","newPage","container","firstresult","newSortField","fieldname","department","available","formfieldname","nodelist","values","departments","subjects","filters","filterType","filterLabel","jsxcreate","getTid","searchoptions","query","searchstring","options","resultsPerPage","result","queryvars","subject","filler","clearbutton","filtersVisible","empty","newcountnode","rssFeedUrl","resultsNode","res","idx","link","descNode","docsNode","metadata","docs","doccount","doc","titleNode","contentNode","docNode","resultNode","pagesNode","contextPages","page","subjectguids","guid","subjecttag","form","field","register","init_dompack","onDomReady","initSkipLinks","doSkipLinks","evt","main","linkopenoptions","onLinkClick","event","link","destdomain","ext","match","isattached","openLinksInNewWindow","options","ourdomain","openLinksInNewWindow","onDomReady","initHeaderSearchBar","form","onSubmit","hideSearch","evt","closest"]}