application.js 130 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540
  1. ! function(e, t) {
  2. for (var n in t) e[n] = t[n]
  3. }(window, function(n) {
  4. var r = {};
  5. function i(e) {
  6. if (r[e]) return r[e].exports;
  7. var t = r[e] = {
  8. i: e,
  9. l: !1,
  10. exports: {}
  11. };
  12. return n[e].call(t.exports, t, t.exports, i), t.l = !0, t.exports
  13. }
  14. return i.m = n, i.c = r, i.d = function(e, t, n) {
  15. i.o(e, t) || Object.defineProperty(e, t, {
  16. enumerable: !0,
  17. get: n
  18. })
  19. }, i.r = function(e) {
  20. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
  21. value: "Module"
  22. }), Object.defineProperty(e, "__esModule", {
  23. value: !0
  24. })
  25. }, i.t = function(t, e) {
  26. if (1 & e && (t = i(t)), 8 & e) return t;
  27. if (4 & e && "object" == typeof t && t && t.__esModule) return t;
  28. var n = Object.create(null);
  29. if (i.r(n), Object.defineProperty(n, "default", {
  30. enumerable: !0,
  31. value: t
  32. }), 2 & e && "string" != typeof t)
  33. for (var r in t) i.d(n, r, function(e) {
  34. return t[e]
  35. }.bind(null, r));
  36. return n
  37. }, i.n = function(e) {
  38. var t = e && e.__esModule ? function() {
  39. return e.default
  40. } : function() {
  41. return e
  42. };
  43. return i.d(t, "a", t), t
  44. }, i.o = function(e, t) {
  45. return Object.prototype.hasOwnProperty.call(e, t)
  46. }, i.p = "", i(i.s = 13)
  47. }([function(e, t, n) {
  48. "use strict";
  49. var r = {
  50. Listener: function() {
  51. function e(e, t, n) {
  52. var r = this;
  53. this.els_ = Array.prototype.slice.call("string" == typeof e ? document.querySelectorAll(e) : [].concat(e)), this.handler_ = "function" == typeof n ? {
  54. update: n
  55. } : n, this.events_ = [].concat(t), this.update_ = function(e) {
  56. return r.handler_.update(e)
  57. }
  58. }
  59. var t = e.prototype;
  60. return t.listen = function() {
  61. var n = this;
  62. this.els_.forEach(function(t) {
  63. n.events_.forEach(function(e) {
  64. t.addEventListener(e, n.update_, !1)
  65. })
  66. }), "function" == typeof this.handler_.setup && this.handler_.setup()
  67. }, t.unlisten = function() {
  68. var n = this;
  69. this.els_.forEach(function(t) {
  70. n.events_.forEach(function(e) {
  71. t.removeEventListener(e, n.update_)
  72. })
  73. }), "function" == typeof this.handler_.reset && this.handler_.reset()
  74. }, e
  75. }(),
  76. MatchMedia: function(e, t) {
  77. this.handler_ = function(e) {
  78. e.matches ? t.listen() : t.unlisten()
  79. };
  80. var n = window.matchMedia(e);
  81. n.addListener(this.handler_), this.handler_(n)
  82. }
  83. },
  84. i = {
  85. Shadow: function() {
  86. function e(e, t) {
  87. var n = "string" == typeof e ? document.querySelector(e) : e;
  88. if (!(n instanceof HTMLElement && n.parentNode instanceof HTMLElement)) throw new ReferenceError;
  89. if (this.el_ = n.parentNode, !((n = "string" == typeof t ? document.querySelector(t) : t) instanceof HTMLElement)) throw new ReferenceError;
  90. this.header_ = n, this.height_ = 0, this.active_ = !1
  91. }
  92. var t = e.prototype;
  93. return t.setup = function() {
  94. for (var e = this.el_; e = e.previousElementSibling;) {
  95. if (!(e instanceof HTMLElement)) throw new ReferenceError;
  96. this.height_ += e.offsetHeight
  97. }
  98. this.update()
  99. }, t.update = function(e) {
  100. if (!e || "resize" !== e.type && "orientationchange" !== e.type) {
  101. var t = window.pageYOffset >= this.height_;
  102. t !== this.active_ && (this.header_.dataset.mdState = (this.active_ = t) ? "shadow" : "")
  103. } else this.height_ = 0, this.setup()
  104. }, t.reset = function() {
  105. this.header_.dataset.mdState = "", this.height_ = 0, this.active_ = !1
  106. }, e
  107. }(),
  108. Title: function() {
  109. function e(e, t) {
  110. var n = "string" == typeof e ? document.querySelector(e) : e;
  111. if (!(n instanceof HTMLElement)) throw new ReferenceError;
  112. if (this.el_ = n, !((n = "string" == typeof t ? document.querySelector(t) : t) instanceof HTMLHeadingElement)) throw new ReferenceError;
  113. this.header_ = n, this.active_ = !1
  114. }
  115. var t = e.prototype;
  116. return t.setup = function() {
  117. var t = this;
  118. Array.prototype.forEach.call(this.el_.children, function(e) {
  119. e.style.width = t.el_.offsetWidth - 20 + "px"
  120. })
  121. }, t.update = function(e) {
  122. var t = this,
  123. n = window.pageYOffset >= this.header_.offsetTop;
  124. n !== this.active_ && (this.el_.dataset.mdState = (this.active_ = n) ? "active" : ""), "resize" !== e.type && "orientationchange" !== e.type || Array.prototype.forEach.call(this.el_.children, function(e) {
  125. e.style.width = t.el_.offsetWidth - 20 + "px"
  126. })
  127. }, t.reset = function() {
  128. this.el_.dataset.mdState = "", this.el_.style.width = "", this.active_ = !1
  129. }, e
  130. }()
  131. },
  132. o = {
  133. Blur: function() {
  134. function e(e) {
  135. this.els_ = "string" == typeof e ? document.querySelectorAll(e) : e, this.index_ = 0, this.offset_ = window.pageYOffset, this.dir_ = !1, this.anchors_ = [].reduce.call(this.els_, function(e, t) {
  136. var n = decodeURIComponent(t.hash);
  137. return e.concat(document.getElementById(n.substring(1)) || [])
  138. }, [])
  139. }
  140. var t = e.prototype;
  141. return t.setup = function() {
  142. this.update()
  143. }, t.update = function() {
  144. var e = window.pageYOffset,
  145. t = this.offset_ - e < 0;
  146. if (this.dir_ !== t && (this.index_ = this.index_ = t ? 0 : this.els_.length - 1), 0 !== this.anchors_.length) {
  147. if (this.offset_ <= e)
  148. for (var n = this.index_ + 1; n < this.els_.length && this.anchors_[n].offsetTop - 80 <= e; n++) 0 < n && (this.els_[n - 1].dataset.mdState = "blur"), this.index_ = n;
  149. else
  150. for (var r = this.index_; 0 <= r; r--) {
  151. if (!(this.anchors_[r].offsetTop - 80 > e)) {
  152. this.index_ = r;
  153. break
  154. }
  155. 0 < r && (this.els_[r - 1].dataset.mdState = "")
  156. }
  157. this.offset_ = e, this.dir_ = t
  158. }
  159. }, t.reset = function() {
  160. Array.prototype.forEach.call(this.els_, function(e) {
  161. e.dataset.mdState = ""
  162. }), this.index_ = 0, this.offset_ = window.pageYOffset
  163. }, e
  164. }(),
  165. Collapse: function() {
  166. function e(e) {
  167. var t = "string" == typeof e ? document.querySelector(e) : e;
  168. if (!(t instanceof HTMLElement)) throw new ReferenceError;
  169. this.el_ = t
  170. }
  171. var t = e.prototype;
  172. return t.setup = function() {
  173. var e = this.el_.getBoundingClientRect().height;
  174. this.el_.style.display = e ? "block" : "none", this.el_.style.overflow = e ? "visible" : "hidden"
  175. }, t.update = function() {
  176. var e = this,
  177. t = this.el_.getBoundingClientRect().height;
  178. this.el_.style.display = "block", this.el_.style.overflow = "";
  179. var r = this.el_.previousElementSibling.previousElementSibling.checked;
  180. if (r) this.el_.style.maxHeight = t + "px", requestAnimationFrame(function() {
  181. e.el_.setAttribute("data-md-state", "animate"), e.el_.style.maxHeight = "0px"
  182. });
  183. else {
  184. this.el_.setAttribute("data-md-state", "expand"), this.el_.style.maxHeight = "";
  185. var n = this.el_.getBoundingClientRect().height;
  186. this.el_.removeAttribute("data-md-state"), this.el_.style.maxHeight = "0px", requestAnimationFrame(function() {
  187. e.el_.setAttribute("data-md-state", "animate"), e.el_.style.maxHeight = n + "px"
  188. })
  189. }
  190. this.el_.addEventListener("transitionend", function e(t) {
  191. var n = t.target;
  192. if (!(n instanceof HTMLElement)) throw new ReferenceError;
  193. n.removeAttribute("data-md-state"), n.style.maxHeight = "", n.style.display = r ? "none" : "block", n.style.overflow = r ? "hidden" : "visible", n.removeEventListener("transitionend", e)
  194. }, !1)
  195. }, t.reset = function() {
  196. this.el_.dataset.mdState = "", this.el_.style.maxHeight = "", this.el_.style.display = "", this.el_.style.overflow = ""
  197. }, e
  198. }(),
  199. Scrolling: function() {
  200. function e(e) {
  201. var t = "string" == typeof e ? document.querySelector(e) : e;
  202. if (!(t instanceof HTMLElement)) throw new ReferenceError;
  203. this.el_ = t
  204. }
  205. var t = e.prototype;
  206. return t.setup = function() {
  207. this.el_.children[this.el_.children.length - 1].style.webkitOverflowScrolling = "touch";
  208. var e = this.el_.querySelectorAll("[data-md-toggle]");
  209. Array.prototype.forEach.call(e, function(e) {
  210. if (!(e instanceof HTMLInputElement)) throw new ReferenceError;
  211. if (e.checked) {
  212. var t = e.nextElementSibling;
  213. if (!(t instanceof HTMLElement)) throw new ReferenceError;
  214. for (;
  215. "NAV" !== t.tagName && t.nextElementSibling;) t = t.nextElementSibling;
  216. if (!(e.parentNode instanceof HTMLElement && e.parentNode.parentNode instanceof HTMLElement)) throw new ReferenceError;
  217. var n = e.parentNode.parentNode,
  218. r = t.children[t.children.length - 1];
  219. n.style.webkitOverflowScrolling = "", r.style.webkitOverflowScrolling = "touch"
  220. }
  221. })
  222. }, t.update = function(e) {
  223. var t = e.target;
  224. if (!(t instanceof HTMLElement)) throw new ReferenceError;
  225. var n = t.nextElementSibling;
  226. if (!(n instanceof HTMLElement)) throw new ReferenceError;
  227. for (;
  228. "NAV" !== n.tagName && n.nextElementSibling;) n = n.nextElementSibling;
  229. if (!(t.parentNode instanceof HTMLElement && t.parentNode.parentNode instanceof HTMLElement)) throw new ReferenceError;
  230. var r = t.parentNode.parentNode,
  231. i = n.children[n.children.length - 1];
  232. if (r.style.webkitOverflowScrolling = "", i.style.webkitOverflowScrolling = "", !t.checked) {
  233. n.addEventListener("transitionend", function e() {
  234. n instanceof HTMLElement && (r.style.webkitOverflowScrolling = "touch", n.removeEventListener("transitionend", e))
  235. }, !1)
  236. }
  237. if (t.checked) {
  238. n.addEventListener("transitionend", function e() {
  239. n instanceof HTMLElement && (i.style.webkitOverflowScrolling = "touch", n.removeEventListener("transitionend", e))
  240. }, !1)
  241. }
  242. }, t.reset = function() {
  243. this.el_.children[1].style.webkitOverflowScrolling = "";
  244. var e = this.el_.querySelectorAll("[data-md-toggle]");
  245. Array.prototype.forEach.call(e, function(e) {
  246. if (!(e instanceof HTMLInputElement)) throw new ReferenceError;
  247. if (e.checked) {
  248. var t = e.nextElementSibling;
  249. if (!(t instanceof HTMLElement)) throw new ReferenceError;
  250. for (;
  251. "NAV" !== t.tagName && t.nextElementSibling;) t = t.nextElementSibling;
  252. if (!(e.parentNode instanceof HTMLElement && e.parentNode.parentNode instanceof HTMLElement)) throw new ReferenceError;
  253. var n = e.parentNode.parentNode,
  254. r = t.children[t.children.length - 1];
  255. n.style.webkitOverflowScrolling = "", r.style.webkitOverflowScrolling = ""
  256. }
  257. })
  258. }, e
  259. }()
  260. },
  261. a = {
  262. Lock: function() {
  263. function e(e) {
  264. var t = "string" == typeof e ? document.querySelector(e) : e;
  265. if (!(t instanceof HTMLInputElement)) throw new ReferenceError;
  266. if (this.el_ = t, !document.body) throw new ReferenceError;
  267. this.lock_ = document.body
  268. }
  269. var t = e.prototype;
  270. return t.setup = function() {
  271. this.update()
  272. }, t.update = function() {
  273. var e = this;
  274. this.el_.checked ? (this.offset_ = window.pageYOffset, setTimeout(function() {
  275. window.scrollTo(0, 0), e.el_.checked && (e.lock_.dataset.mdState = "lock")
  276. }, 400)) : (this.lock_.dataset.mdState = "", setTimeout(function() {
  277. void 0 !== e.offset_ && window.scrollTo(0, e.offset_)
  278. }, 100))
  279. }, t.reset = function() {
  280. "lock" === this.lock_.dataset.mdState && window.scrollTo(0, this.offset_), this.lock_.dataset.mdState = ""
  281. }, e
  282. }(),
  283. Result: n(9).a
  284. },
  285. s = {
  286. Position: function() {
  287. function e(e, t) {
  288. var n = "string" == typeof e ? document.querySelector(e) : e;
  289. if (!(n instanceof HTMLElement && n.parentNode instanceof HTMLElement)) throw new ReferenceError;
  290. if (this.el_ = n, this.parent_ = n.parentNode, !((n = "string" == typeof t ? document.querySelector(t) : t) instanceof HTMLElement)) throw new ReferenceError;
  291. this.header_ = n, this.height_ = 0, this.pad_ = "fixed" === window.getComputedStyle(this.header_).position
  292. }
  293. var t = e.prototype;
  294. return t.setup = function() {
  295. var e = Array.prototype.reduce.call(this.parent_.children, function(e, t) {
  296. return Math.max(e, t.offsetTop)
  297. }, 0);
  298. this.offset_ = e - (this.pad_ ? this.header_.offsetHeight : 0), this.update()
  299. }, t.update = function(e) {
  300. var t = window.pageYOffset,
  301. n = window.innerHeight;
  302. e && "resize" === e.type && this.setup();
  303. var r = this.pad_ ? this.header_.offsetHeight : 0,
  304. i = this.parent_.offsetTop + this.parent_.offsetHeight,
  305. o = n - r - Math.max(0, this.offset_ - t) - Math.max(0, t + n - i);
  306. o !== this.height_ && (this.el_.style.height = (this.height_ = o) + "px"), t >= this.offset_ ? "lock" !== this.el_.dataset.mdState && (this.el_.dataset.mdState = "lock") : "lock" === this.el_.dataset.mdState && (this.el_.dataset.mdState = "")
  307. }, t.reset = function() {
  308. this.el_.dataset.mdState = "", this.el_.style.height = "", this.height_ = 0
  309. }, e
  310. }()
  311. },
  312. c = n(6),
  313. l = n.n(c);
  314. var u = {
  315. Adapter: {
  316. GitHub: function(o) {
  317. var e, t;
  318. function n(e) {
  319. var t;
  320. t = o.call(this, e) || this;
  321. var n = /^.+github\.com\/([^/]+)\/?([^/]+)?.*$/.exec(t.base_);
  322. if (n && 3 === n.length) {
  323. var r = n[1],
  324. i = n[2];
  325. t.base_ = "https://api.github.com/users/" + r + "/repos", t.name_ = i
  326. }
  327. return t
  328. }
  329. return t = o, (e = n).prototype = Object.create(t.prototype), (e.prototype.constructor = e).__proto__ = t, n.prototype.fetch_ = function() {
  330. var i = this;
  331. return function n(r) {
  332. return void 0 === r && (r = 0), fetch(i.base_ + "?per_page=30&page=" + r).then(function(e) {
  333. return e.json()
  334. }).then(function(e) {
  335. if (!(e instanceof Array)) throw new TypeError;
  336. if (i.name_) {
  337. var t = e.find(function(e) {
  338. return e.name === i.name_
  339. });
  340. return t || 30 !== e.length ? t ? [i.format_(t.stargazers_count) + " Stars", i.format_(t.forks_count) + " Forks"] : [] : n(r + 1)
  341. }
  342. return [e.length + " Repositories"]
  343. })
  344. }()
  345. }, n
  346. }(function() {
  347. function e(e) {
  348. var t = "string" == typeof e ? document.querySelector(e) : e;
  349. if (!(t instanceof HTMLAnchorElement)) throw new ReferenceError;
  350. this.el_ = t, this.base_ = this.el_.href, this.salt_ = this.hash_(this.base_)
  351. }
  352. var t = e.prototype;
  353. return t.fetch = function() {
  354. var n = this;
  355. return new Promise(function(t) {
  356. var e = l.a.getJSON(n.salt_ + ".cache-source");
  357. void 0 !== e ? t(e) : n.fetch_().then(function(e) {
  358. l.a.set(n.salt_ + ".cache-source", e, {
  359. expires: 1 / 96
  360. }), t(e)
  361. })
  362. })
  363. }, t.fetch_ = function() {
  364. throw new Error("fetch_(): Not implemented")
  365. }, t.format_ = function(e) {
  366. return 1e4 < e ? (e / 1e3).toFixed(0) + "k" : 1e3 < e ? (e / 1e3).toFixed(1) + "k" : "" + e
  367. }, t.hash_ = function(e) {
  368. var t = 0;
  369. if (0 === e.length) return t;
  370. for (var n = 0, r = e.length; n < r; n++) t = (t << 5) - t + e.charCodeAt(n), t |= 0;
  371. return t
  372. }, e
  373. }())
  374. },
  375. Repository: n(10).a
  376. },
  377. f = {
  378. Toggle: function() {
  379. function e(e) {
  380. var t = "string" == typeof e ? document.querySelector(e) : e;
  381. if (!(t instanceof Node)) throw new ReferenceError;
  382. this.el_ = t;
  383. var n = document.querySelector("[data-md-component=header]");
  384. this.height_ = n.offsetHeight, this.active_ = !1
  385. }
  386. var t = e.prototype;
  387. return t.update = function() {
  388. var e = window.pageYOffset >= this.el_.children[0].offsetTop + (5 - this.height_);
  389. e !== this.active_ && (this.el_.dataset.mdState = (this.active_ = e) ? "hidden" : "")
  390. }, t.reset = function() {
  391. this.el_.dataset.mdState = "", this.active_ = !1
  392. }, e
  393. }()
  394. };
  395. t.a = {
  396. Event: r,
  397. Header: i,
  398. Nav: o,
  399. Search: a,
  400. Sidebar: s,
  401. Source: u,
  402. Tabs: f
  403. }
  404. }, function(t, e, n) {
  405. (function(e) {
  406. t.exports = e.lunr = n(24)
  407. }).call(this, n(4))
  408. }, function(e, f, d) {
  409. "use strict";
  410. (function(t) {
  411. var e = d(8),
  412. n = setTimeout;
  413. function r() {}
  414. function o(e) {
  415. if (!(this instanceof o)) throw new TypeError("Promises must be constructed via new");
  416. if ("function" != typeof e) throw new TypeError("not a function");
  417. this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], u(e, this)
  418. }
  419. function i(n, r) {
  420. for (; 3 === n._state;) n = n._value;
  421. 0 !== n._state ? (n._handled = !0, o._immediateFn(function() {
  422. var e = 1 === n._state ? r.onFulfilled : r.onRejected;
  423. if (null !== e) {
  424. var t;
  425. try {
  426. t = e(n._value)
  427. } catch (e) {
  428. return void s(r.promise, e)
  429. }
  430. a(r.promise, t)
  431. } else(1 === n._state ? a : s)(r.promise, n._value)
  432. })) : n._deferreds.push(r)
  433. }
  434. function a(t, e) {
  435. try {
  436. if (e === t) throw new TypeError("A promise cannot be resolved with itself.");
  437. if (e && ("object" == typeof e || "function" == typeof e)) {
  438. var n = e.then;
  439. if (e instanceof o) return t._state = 3, t._value = e, void c(t);
  440. if ("function" == typeof n) return void u((r = n, i = e, function() {
  441. r.apply(i, arguments)
  442. }), t)
  443. }
  444. t._state = 1, t._value = e, c(t)
  445. } catch (e) {
  446. s(t, e)
  447. }
  448. var r, i
  449. }
  450. function s(e, t) {
  451. e._state = 2, e._value = t, c(e)
  452. }
  453. function c(e) {
  454. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  455. e._handled || o._unhandledRejectionFn(e._value)
  456. });
  457. for (var t = 0, n = e._deferreds.length; t < n; t++) i(e, e._deferreds[t]);
  458. e._deferreds = null
  459. }
  460. function l(e, t, n) {
  461. this.onFulfilled = "function" == typeof e ? e : null, this.onRejected = "function" == typeof t ? t : null, this.promise = n
  462. }
  463. function u(e, t) {
  464. var n = !1;
  465. try {
  466. e(function(e) {
  467. n || (n = !0, a(t, e))
  468. }, function(e) {
  469. n || (n = !0, s(t, e))
  470. })
  471. } catch (e) {
  472. if (n) return;
  473. n = !0, s(t, e)
  474. }
  475. }
  476. o.prototype.catch = function(e) {
  477. return this.then(null, e)
  478. }, o.prototype.then = function(e, t) {
  479. var n = new this.constructor(r);
  480. return i(this, new l(e, t, n)), n
  481. }, o.prototype.finally = e.a, o.all = function(t) {
  482. return new o(function(r, i) {
  483. if (!t || void 0 === t.length) throw new TypeError("Promise.all accepts an array");
  484. var o = Array.prototype.slice.call(t);
  485. if (0 === o.length) return r([]);
  486. var a = o.length;
  487. function s(t, e) {
  488. try {
  489. if (e && ("object" == typeof e || "function" == typeof e)) {
  490. var n = e.then;
  491. if ("function" == typeof n) return void n.call(e, function(e) {
  492. s(t, e)
  493. }, i)
  494. }
  495. o[t] = e, 0 == --a && r(o)
  496. } catch (e) {
  497. i(e)
  498. }
  499. }
  500. for (var e = 0; e < o.length; e++) s(e, o[e])
  501. })
  502. }, o.resolve = function(t) {
  503. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  504. e(t)
  505. })
  506. }, o.reject = function(n) {
  507. return new o(function(e, t) {
  508. t(n)
  509. })
  510. }, o.race = function(i) {
  511. return new o(function(e, t) {
  512. for (var n = 0, r = i.length; n < r; n++) i[n].then(e, t)
  513. })
  514. }, o._immediateFn = "function" == typeof t && function(e) {
  515. t(e)
  516. } || function(e) {
  517. n(e, 0)
  518. }, o._unhandledRejectionFn = function(e) {
  519. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  520. }, f.a = o
  521. }).call(this, d(21).setImmediate)
  522. }, function(e, t, n) {
  523. "use strict";
  524. function r(e, t) {
  525. var n = document.createElement(e);
  526. t && Array.prototype.forEach.call(Object.keys(t), function(e) {
  527. n.setAttribute(e, t[e])
  528. });
  529. for (var r = arguments.length, i = new Array(2 < r ? r - 2 : 0), o = 2; o < r; o++) i[o - 2] = arguments[o];
  530. return function t(e) {
  531. Array.prototype.forEach.call(e, function(e) {
  532. "string" == typeof e || "number" == typeof e ? n.textContent += e : Array.isArray(e) ? t(e) : void 0 !== e.__html ? n.innerHTML += e.__html : e instanceof Node && n.appendChild(e)
  533. })
  534. }(i), n
  535. }
  536. n.r(t), n.d(t, "createElement", function() {
  537. return r
  538. })
  539. }, function(e, t) {
  540. var n;
  541. n = function() {
  542. return this
  543. }();
  544. try {
  545. n = n || new Function("return this")()
  546. } catch (e) {
  547. "object" == typeof window && (n = window)
  548. }
  549. e.exports = n
  550. }, function(e, t, n) {
  551. var r;
  552. r = function() {
  553. return function(n) {
  554. var r = {};
  555. function i(e) {
  556. if (r[e]) return r[e].exports;
  557. var t = r[e] = {
  558. i: e,
  559. l: !1,
  560. exports: {}
  561. };
  562. return n[e].call(t.exports, t, t.exports, i), t.l = !0, t.exports
  563. }
  564. return i.m = n, i.c = r, i.d = function(e, t, n) {
  565. i.o(e, t) || Object.defineProperty(e, t, {
  566. enumerable: !0,
  567. get: n
  568. })
  569. }, i.r = function(e) {
  570. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
  571. value: "Module"
  572. }), Object.defineProperty(e, "__esModule", {
  573. value: !0
  574. })
  575. }, i.t = function(t, e) {
  576. if (1 & e && (t = i(t)), 8 & e) return t;
  577. if (4 & e && "object" == typeof t && t && t.__esModule) return t;
  578. var n = Object.create(null);
  579. if (i.r(n), Object.defineProperty(n, "default", {
  580. enumerable: !0,
  581. value: t
  582. }), 2 & e && "string" != typeof t)
  583. for (var r in t) i.d(n, r, function(e) {
  584. return t[e]
  585. }.bind(null, r));
  586. return n
  587. }, i.n = function(e) {
  588. var t = e && e.__esModule ? function() {
  589. return e.default
  590. } : function() {
  591. return e
  592. };
  593. return i.d(t, "a", t), t
  594. }, i.o = function(e, t) {
  595. return Object.prototype.hasOwnProperty.call(e, t)
  596. }, i.p = "", i(i.s = 0)
  597. }([function(e, t, n) {
  598. "use strict";
  599. var i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
  600. return typeof e
  601. } : function(e) {
  602. return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
  603. },
  604. o = function() {
  605. function r(e, t) {
  606. for (var n = 0; n < t.length; n++) {
  607. var r = t[n];
  608. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  609. }
  610. }
  611. return function(e, t, n) {
  612. return t && r(e.prototype, t), n && r(e, n), e
  613. }
  614. }(),
  615. a = r(n(1)),
  616. s = r(n(3)),
  617. c = r(n(4));
  618. function r(e) {
  619. return e && e.__esModule ? e : {
  620. default: e
  621. }
  622. }
  623. var l = function(e) {
  624. function r(e, t) {
  625. ! function(e, t) {
  626. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  627. }(this, r);
  628. var n = function(e, t) {
  629. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  630. return !t || "object" != typeof t && "function" != typeof t ? e : t
  631. }(this, (r.__proto__ || Object.getPrototypeOf(r)).call(this));
  632. return n.resolveOptions(t), n.listenClick(e), n
  633. }
  634. return function(e, t) {
  635. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  636. e.prototype = Object.create(t && t.prototype, {
  637. constructor: {
  638. value: e,
  639. enumerable: !1,
  640. writable: !0,
  641. configurable: !0
  642. }
  643. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  644. }(r, s.default), o(r, [{
  645. key: "resolveOptions",
  646. value: function() {
  647. var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
  648. this.action = "function" == typeof e.action ? e.action : this.defaultAction, this.target = "function" == typeof e.target ? e.target : this.defaultTarget, this.text = "function" == typeof e.text ? e.text : this.defaultText, this.container = "object" === i(e.container) ? e.container : document.body
  649. }
  650. }, {
  651. key: "listenClick",
  652. value: function(e) {
  653. var t = this;
  654. this.listener = (0, c.default)(e, "click", function(e) {
  655. return t.onClick(e)
  656. })
  657. }
  658. }, {
  659. key: "onClick",
  660. value: function(e) {
  661. var t = e.delegateTarget || e.currentTarget;
  662. this.clipboardAction && (this.clipboardAction = null), this.clipboardAction = new a.default({
  663. action: this.action(t),
  664. target: this.target(t),
  665. text: this.text(t),
  666. container: this.container,
  667. trigger: t,
  668. emitter: this
  669. })
  670. }
  671. }, {
  672. key: "defaultAction",
  673. value: function(e) {
  674. return u("action", e)
  675. }
  676. }, {
  677. key: "defaultTarget",
  678. value: function(e) {
  679. var t = u("target", e);
  680. if (t) return document.querySelector(t)
  681. }
  682. }, {
  683. key: "defaultText",
  684. value: function(e) {
  685. return u("text", e)
  686. }
  687. }, {
  688. key: "destroy",
  689. value: function() {
  690. this.listener.destroy(), this.clipboardAction && (this.clipboardAction.destroy(), this.clipboardAction = null)
  691. }
  692. }], [{
  693. key: "isSupported",
  694. value: function() {
  695. var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ["copy", "cut"],
  696. t = "string" == typeof e ? [e] : e,
  697. n = !!document.queryCommandSupported;
  698. return t.forEach(function(e) {
  699. n = n && !!document.queryCommandSupported(e)
  700. }), n
  701. }
  702. }]), r
  703. }();
  704. function u(e, t) {
  705. var n = "data-clipboard-" + e;
  706. if (t.hasAttribute(n)) return t.getAttribute(n)
  707. }
  708. e.exports = l
  709. }, function(e, t, n) {
  710. "use strict";
  711. var r, i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
  712. return typeof e
  713. } : function(e) {
  714. return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
  715. },
  716. o = function() {
  717. function r(e, t) {
  718. for (var n = 0; n < t.length; n++) {
  719. var r = t[n];
  720. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  721. }
  722. }
  723. return function(e, t, n) {
  724. return t && r(e.prototype, t), n && r(e, n), e
  725. }
  726. }(),
  727. a = n(2),
  728. s = (r = a) && r.__esModule ? r : {
  729. default: r
  730. };
  731. var c = function() {
  732. function t(e) {
  733. ! function(e, t) {
  734. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  735. }(this, t), this.resolveOptions(e), this.initSelection()
  736. }
  737. return o(t, [{
  738. key: "resolveOptions",
  739. value: function() {
  740. var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
  741. this.action = e.action, this.container = e.container, this.emitter = e.emitter, this.target = e.target, this.text = e.text, this.trigger = e.trigger, this.selectedText = ""
  742. }
  743. }, {
  744. key: "initSelection",
  745. value: function() {
  746. this.text ? this.selectFake() : this.target && this.selectTarget()
  747. }
  748. }, {
  749. key: "selectFake",
  750. value: function() {
  751. var e = this,
  752. t = "rtl" == document.documentElement.getAttribute("dir");
  753. this.removeFake(), this.fakeHandlerCallback = function() {
  754. return e.removeFake()
  755. }, this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || !0, this.fakeElem = document.createElement("textarea"), this.fakeElem.style.fontSize = "12pt", this.fakeElem.style.border = "0", this.fakeElem.style.padding = "0", this.fakeElem.style.margin = "0", this.fakeElem.style.position = "absolute", this.fakeElem.style[t ? "right" : "left"] = "-9999px";
  756. var n = window.pageYOffset || document.documentElement.scrollTop;
  757. this.fakeElem.style.top = n + "px", this.fakeElem.setAttribute("readonly", ""), this.fakeElem.value = this.text, this.container.appendChild(this.fakeElem), this.selectedText = (0, s.default)(this.fakeElem), this.copyText()
  758. }
  759. }, {
  760. key: "removeFake",
  761. value: function() {
  762. this.fakeHandler && (this.container.removeEventListener("click", this.fakeHandlerCallback), this.fakeHandler = null, this.fakeHandlerCallback = null), this.fakeElem && (this.container.removeChild(this.fakeElem), this.fakeElem = null)
  763. }
  764. }, {
  765. key: "selectTarget",
  766. value: function() {
  767. this.selectedText = (0, s.default)(this.target), this.copyText()
  768. }
  769. }, {
  770. key: "copyText",
  771. value: function() {
  772. var t = void 0;
  773. try {
  774. t = document.execCommand(this.action)
  775. } catch (e) {
  776. t = !1
  777. }
  778. this.handleResult(t)
  779. }
  780. }, {
  781. key: "handleResult",
  782. value: function(e) {
  783. this.emitter.emit(e ? "success" : "error", {
  784. action: this.action,
  785. text: this.selectedText,
  786. trigger: this.trigger,
  787. clearSelection: this.clearSelection.bind(this)
  788. })
  789. }
  790. }, {
  791. key: "clearSelection",
  792. value: function() {
  793. this.trigger && this.trigger.focus(), window.getSelection().removeAllRanges()
  794. }
  795. }, {
  796. key: "destroy",
  797. value: function() {
  798. this.removeFake()
  799. }
  800. }, {
  801. key: "action",
  802. set: function() {
  803. var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "copy";
  804. if (this._action = e, "copy" !== this._action && "cut" !== this._action) throw new Error('Invalid "action" value, use either "copy" or "cut"')
  805. },
  806. get: function() {
  807. return this._action
  808. }
  809. }, {
  810. key: "target",
  811. set: function(e) {
  812. if (void 0 !== e) {
  813. if (!e || "object" !== (void 0 === e ? "undefined" : i(e)) || 1 !== e.nodeType) throw new Error('Invalid "target" value, use a valid Element');
  814. if ("copy" === this.action && e.hasAttribute("disabled")) throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
  815. if ("cut" === this.action && (e.hasAttribute("readonly") || e.hasAttribute("disabled"))) throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
  816. this._target = e
  817. }
  818. },
  819. get: function() {
  820. return this._target
  821. }
  822. }]), t
  823. }();
  824. e.exports = c
  825. }, function(e, t) {
  826. e.exports = function(e) {
  827. var t;
  828. if ("SELECT" === e.nodeName) e.focus(), t = e.value;
  829. else if ("INPUT" === e.nodeName || "TEXTAREA" === e.nodeName) {
  830. var n = e.hasAttribute("readonly");
  831. n || e.setAttribute("readonly", ""), e.select(), e.setSelectionRange(0, e.value.length), n || e.removeAttribute("readonly"), t = e.value
  832. } else {
  833. e.hasAttribute("contenteditable") && e.focus();
  834. var r = window.getSelection(),
  835. i = document.createRange();
  836. i.selectNodeContents(e), r.removeAllRanges(), r.addRange(i), t = r.toString()
  837. }
  838. return t
  839. }
  840. }, function(e, t) {
  841. function n() {}
  842. n.prototype = {
  843. on: function(e, t, n) {
  844. var r = this.e || (this.e = {});
  845. return (r[e] || (r[e] = [])).push({
  846. fn: t,
  847. ctx: n
  848. }), this
  849. },
  850. once: function(e, t, n) {
  851. var r = this;
  852. function i() {
  853. r.off(e, i), t.apply(n, arguments)
  854. }
  855. return i._ = t, this.on(e, i, n)
  856. },
  857. emit: function(e) {
  858. for (var t = [].slice.call(arguments, 1), n = ((this.e || (this.e = {}))[e] || []).slice(), r = 0, i = n.length; r < i; r++) n[r].fn.apply(n[r].ctx, t);
  859. return this
  860. },
  861. off: function(e, t) {
  862. var n = this.e || (this.e = {}),
  863. r = n[e],
  864. i = [];
  865. if (r && t)
  866. for (var o = 0, a = r.length; o < a; o++) r[o].fn !== t && r[o].fn._ !== t && i.push(r[o]);
  867. return i.length ? n[e] = i : delete n[e], this
  868. }
  869. }, e.exports = n
  870. }, function(e, t, n) {
  871. var d = n(5),
  872. h = n(6);
  873. e.exports = function(e, t, n) {
  874. if (!e && !t && !n) throw new Error("Missing required arguments");
  875. if (!d.string(t)) throw new TypeError("Second argument must be a String");
  876. if (!d.fn(n)) throw new TypeError("Third argument must be a Function");
  877. if (d.node(e)) return u = t, f = n, (l = e).addEventListener(u, f), {
  878. destroy: function() {
  879. l.removeEventListener(u, f)
  880. }
  881. };
  882. if (d.nodeList(e)) return a = e, s = t, c = n, Array.prototype.forEach.call(a, function(e) {
  883. e.addEventListener(s, c)
  884. }), {
  885. destroy: function() {
  886. Array.prototype.forEach.call(a, function(e) {
  887. e.removeEventListener(s, c)
  888. })
  889. }
  890. };
  891. if (d.string(e)) return r = e, i = t, o = n, h(document.body, r, i, o);
  892. throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
  893. var r, i, o, a, s, c, l, u, f
  894. }
  895. }, function(e, n) {
  896. n.node = function(e) {
  897. return void 0 !== e && e instanceof HTMLElement && 1 === e.nodeType
  898. }, n.nodeList = function(e) {
  899. var t = Object.prototype.toString.call(e);
  900. return void 0 !== e && ("[object NodeList]" === t || "[object HTMLCollection]" === t) && "length" in e && (0 === e.length || n.node(e[0]))
  901. }, n.string = function(e) {
  902. return "string" == typeof e || e instanceof String
  903. }, n.fn = function(e) {
  904. return "[object Function]" === Object.prototype.toString.call(e)
  905. }
  906. }, function(e, t, n) {
  907. var a = n(7);
  908. function o(e, t, n, r, i) {
  909. var o = function(t, n, e, r) {
  910. return function(e) {
  911. e.delegateTarget = a(e.target, n), e.delegateTarget && r.call(t, e)
  912. }
  913. }.apply(this, arguments);
  914. return e.addEventListener(n, o, i), {
  915. destroy: function() {
  916. e.removeEventListener(n, o, i)
  917. }
  918. }
  919. }
  920. e.exports = function(e, t, n, r, i) {
  921. return "function" == typeof e.addEventListener ? o.apply(null, arguments) : "function" == typeof n ? o.bind(null, document).apply(null, arguments) : ("string" == typeof e && (e = document.querySelectorAll(e)), Array.prototype.map.call(e, function(e) {
  922. return o(e, t, n, r, i)
  923. }))
  924. }
  925. }, function(e, t) {
  926. if ("undefined" != typeof Element && !Element.prototype.matches) {
  927. var n = Element.prototype;
  928. n.matches = n.matchesSelector || n.mozMatchesSelector || n.msMatchesSelector || n.oMatchesSelector || n.webkitMatchesSelector
  929. }
  930. e.exports = function(e, t) {
  931. for (; e && 9 !== e.nodeType;) {
  932. if ("function" == typeof e.matches && e.matches(t)) return e;
  933. e = e.parentNode
  934. }
  935. }
  936. }])
  937. }, e.exports = r()
  938. }, function(r, i, o) {
  939. var a, s;
  940. ! function(e) {
  941. if (void 0 === (s = "function" == typeof(a = e) ? a.call(i, o, i, r) : a) || (r.exports = s), !0, r.exports = e(), !!0) {
  942. var t = window.Cookies,
  943. n = window.Cookies = e();
  944. n.noConflict = function() {
  945. return window.Cookies = t, n
  946. }
  947. }
  948. }(function() {
  949. function m() {
  950. for (var e = 0, t = {}; e < arguments.length; e++) {
  951. var n = arguments[e];
  952. for (var r in n) t[r] = n[r]
  953. }
  954. return t
  955. }
  956. return function e(h) {
  957. function p(e, t, n) {
  958. var r;
  959. if ("undefined" != typeof document) {
  960. if (1 < arguments.length) {
  961. if ("number" == typeof(n = m({
  962. path: "/"
  963. }, p.defaults, n)).expires) {
  964. var i = new Date;
  965. i.setMilliseconds(i.getMilliseconds() + 864e5 * n.expires), n.expires = i
  966. }
  967. n.expires = n.expires ? n.expires.toUTCString() : "";
  968. try {
  969. r = JSON.stringify(t), /^[\{\[]/.test(r) && (t = r)
  970. } catch (e) {}
  971. t = h.write ? h.write(t, e) : encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), e = (e = (e = encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)).replace(/[\(\)]/g, escape);
  972. var o = "";
  973. for (var a in n) n[a] && (o += "; " + a, !0 !== n[a] && (o += "=" + n[a]));
  974. return document.cookie = e + "=" + t + o
  975. }
  976. e || (r = {});
  977. for (var s = document.cookie ? document.cookie.split("; ") : [], c = /(%[0-9A-Z]{2})+/g, l = 0; l < s.length; l++) {
  978. var u = s[l].split("="),
  979. f = u.slice(1).join("=");
  980. this.json || '"' !== f.charAt(0) || (f = f.slice(1, -1));
  981. try {
  982. var d = u[0].replace(c, decodeURIComponent);
  983. if (f = h.read ? h.read(f, d) : h(f, d) || f.replace(c, decodeURIComponent), this.json) try {
  984. f = JSON.parse(f)
  985. } catch (e) {}
  986. if (e === d) {
  987. r = f;
  988. break
  989. }
  990. e || (r[d] = f)
  991. } catch (e) {}
  992. }
  993. return r
  994. }
  995. }
  996. return (p.set = p).get = function(e) {
  997. return p.call(p, e)
  998. }, p.getJSON = function() {
  999. return p.apply({
  1000. json: !0
  1001. }, [].slice.call(arguments))
  1002. }, p.defaults = {}, p.remove = function(e, t) {
  1003. p(e, "", m(t, {
  1004. expires: -1
  1005. }))
  1006. }, p.withConverter = e, p
  1007. }(function() {})
  1008. })
  1009. }, function(e, t, n) {
  1010. "use strict";
  1011. n.r(t);
  1012. var r = "function" == typeof fetch ? fetch.bind() : function(i, o) {
  1013. return o = o || {}, new Promise(function(e, t) {
  1014. var n = new XMLHttpRequest;
  1015. for (var r in n.open(o.method || "get", i, !0), o.headers) n.setRequestHeader(r, o.headers[r]);
  1016. function s() {
  1017. var r, i = [],
  1018. o = [],
  1019. a = {};
  1020. return n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(e, t, n) {
  1021. i.push(t = t.toLowerCase()), o.push([t, n]), r = a[t], a[t] = r ? r + "," + n : n
  1022. }), {
  1023. ok: 2 == (n.status / 100 | 0),
  1024. status: n.status,
  1025. statusText: n.statusText,
  1026. url: n.responseURL,
  1027. clone: s,
  1028. text: function() {
  1029. return Promise.resolve(n.responseText)
  1030. },
  1031. json: function() {
  1032. return Promise.resolve(n.responseText).then(JSON.parse)
  1033. },
  1034. blob: function() {
  1035. return Promise.resolve(new Blob([n.response]))
  1036. },
  1037. headers: {
  1038. keys: function() {
  1039. return i
  1040. },
  1041. entries: function() {
  1042. return o
  1043. },
  1044. get: function(e) {
  1045. return a[e.toLowerCase()]
  1046. },
  1047. has: function(e) {
  1048. return e.toLowerCase() in a
  1049. }
  1050. }
  1051. }
  1052. }
  1053. n.withCredentials = "include" == o.credentials, n.onload = function() {
  1054. e(s())
  1055. }, n.onerror = t, n.send(o.body || null)
  1056. })
  1057. };
  1058. t.default = r
  1059. }, function(e, t, n) {
  1060. "use strict";
  1061. t.a = function(t) {
  1062. var n = this.constructor;
  1063. return this.then(function(e) {
  1064. return n.resolve(t()).then(function() {
  1065. return e
  1066. })
  1067. }, function(e) {
  1068. return n.resolve(t()).then(function() {
  1069. return n.reject(e)
  1070. })
  1071. })
  1072. }
  1073. }, function(e, n, r) {
  1074. "use strict";
  1075. (function(f) {
  1076. r.d(n, "a", function() {
  1077. return t
  1078. });
  1079. var e = r(1),
  1080. d = r.n(e),
  1081. h = function(e) {
  1082. var t = document.getElementsByName("lang:" + e)[0];
  1083. if (!(t instanceof HTMLMetaElement)) throw new ReferenceError;
  1084. return t.content
  1085. },
  1086. t = function() {
  1087. function e(e, t) {
  1088. var n = "string" == typeof e ? document.querySelector(e) : e;
  1089. if (!(n instanceof HTMLElement)) throw new ReferenceError;
  1090. this.el_ = n;
  1091. var r = Array.prototype.slice.call(this.el_.children),
  1092. i = r[0],
  1093. o = r[1];
  1094. this.data_ = t, this.meta_ = i, this.list_ = o, this.message_ = {
  1095. placeholder: this.meta_.textContent,
  1096. none: h("search.result.none"),
  1097. one: h("search.result.one"),
  1098. other: h("search.result.other")
  1099. };
  1100. var a = h("search.tokenizer");
  1101. a.length && (d.a.tokenizer.separator = a), this.lang_ = h("search.language").split(",").filter(Boolean).map(function(e) {
  1102. return e.trim()
  1103. })
  1104. }
  1105. return e.prototype.update = function(e) {
  1106. var t, a = this;
  1107. if ("focus" !== e.type || this.index_) {
  1108. if ("focus" === e.type || "keyup" === e.type) {
  1109. var n = e.target;
  1110. if (!(n instanceof HTMLInputElement)) throw new ReferenceError;
  1111. if (!this.index_ || n.value === this.value_) return;
  1112. for (; this.list_.firstChild;) this.list_.removeChild(this.list_.firstChild);
  1113. if (this.value_ = n.value, 0 === this.value_.length) return void(this.meta_.textContent = this.message_.placeholder);
  1114. var r = this.index_.query(function(t) {
  1115. a.value_.toLowerCase().split(" ").filter(Boolean).forEach(function(e) {
  1116. t.term(e, {
  1117. wildcard: d.a.Query.wildcard.TRAILING
  1118. })
  1119. })
  1120. }).reduce(function(e, t) {
  1121. var n = a.docs_.get(t.ref);
  1122. if (n.parent) {
  1123. var r = n.parent.location;
  1124. e.set(r, (e.get(r) || []).concat(t))
  1125. } else {
  1126. var i = n.location;
  1127. e.set(i, e.get(i) || [])
  1128. }
  1129. return e
  1130. }, new Map),
  1131. i = (t = this.value_.trim(), t.replace(/[|\\{}()[\]^$+*?.-]/g, "\\$&")).replace(new RegExp(d.a.tokenizer.separator, "img"), "|"),
  1132. s = new RegExp("(^|" + d.a.tokenizer.separator + ")(" + i + ")", "img"),
  1133. c = function(e, t, n) {
  1134. return t + "<em>" + n + "</em>"
  1135. };
  1136. this.stack_ = [], r.forEach(function(e, t) {
  1137. var n, r = a.docs_.get(t),
  1138. i = f.createElement("li", {
  1139. class: "md-search-result__item"
  1140. }, f.createElement("a", {
  1141. href: r.location,
  1142. title: r.title,
  1143. class: "md-search-result__link",
  1144. tabindex: "-1"
  1145. }, f.createElement("article", {
  1146. class: "md-search-result__article md-search-result__article--document"
  1147. }, f.createElement("h1", {
  1148. class: "md-search-result__title"
  1149. }, {
  1150. __html: r.title.replace(s, c)
  1151. }), r.text.length ? f.createElement("p", {
  1152. class: "md-search-result__teaser"
  1153. }, {
  1154. __html: r.text.replace(s, c)
  1155. }) : {}))),
  1156. o = e.map(function(t) {
  1157. return function() {
  1158. var e = a.docs_.get(t.ref);
  1159. i.appendChild(f.createElement("a", {
  1160. href: e.location,
  1161. title: e.title,
  1162. class: "md-search-result__link",
  1163. "data-md-rel": "anchor",
  1164. tabindex: "-1"
  1165. }, f.createElement("article", {
  1166. class: "md-search-result__article"
  1167. }, f.createElement("h1", {
  1168. class: "md-search-result__title"
  1169. }, {
  1170. __html: e.title.replace(s, c)
  1171. }), e.text.length ? f.createElement("p", {
  1172. class: "md-search-result__teaser"
  1173. }, {
  1174. __html: function(e, t) {
  1175. var n = t;
  1176. if (e.length > n) {
  1177. for (;
  1178. " " !== e[n] && 0 < --n;);
  1179. return e.substring(0, n) + "..."
  1180. }
  1181. return e
  1182. }(e.text.replace(s, c), 400)
  1183. }) : {})))
  1184. }
  1185. });
  1186. (n = a.stack_).push.apply(n, [function() {
  1187. return a.list_.appendChild(i)
  1188. }].concat(o))
  1189. });
  1190. var o = this.el_.parentNode;
  1191. if (!(o instanceof HTMLElement)) throw new ReferenceError;
  1192. for (; this.stack_.length && o.offsetHeight >= o.scrollHeight - 16;) this.stack_.shift()();
  1193. var l = this.list_.querySelectorAll("[data-md-rel=anchor]");
  1194. switch (Array.prototype.forEach.call(l, function(r) {
  1195. ["click", "keydown"].forEach(function(n) {
  1196. r.addEventListener(n, function(e) {
  1197. if ("keydown" !== n || 13 === e.keyCode) {
  1198. var t = document.querySelector("[data-md-toggle=search]");
  1199. if (!(t instanceof HTMLInputElement)) throw new ReferenceError;
  1200. t.checked && (t.checked = !1, t.dispatchEvent(new CustomEvent("change"))), e.preventDefault(), setTimeout(function() {
  1201. document.location.href = r.href
  1202. }, 100)
  1203. }
  1204. })
  1205. })
  1206. }), r.size) {
  1207. case 0:
  1208. this.meta_.textContent = this.message_.none;
  1209. break;
  1210. case 1:
  1211. this.meta_.textContent = this.message_.one;
  1212. break;
  1213. default:
  1214. this.meta_.textContent = this.message_.other.replace("#", r.size)
  1215. }
  1216. }
  1217. } else {
  1218. var u = function(e) {
  1219. a.docs_ = e.reduce(function(e, t) {
  1220. var n, r, i, o = t.location.split("#"),
  1221. a = o[0],
  1222. s = o[1];
  1223. return t.text = (n = t.text, r = document.createTextNode(n), (i = document.createElement("p")).appendChild(r), i.innerHTML), s && (t.parent = e.get(a), t.parent && !t.parent.done && (t.parent.title = t.title, t.parent.text = t.text, t.parent.done = !0)), t.text = t.text.replace(/\n/g, " ").replace(/\s+/g, " ").replace(/\s+([,.:;!?])/g, function(e, t) {
  1224. return t
  1225. }), t.parent && t.parent.title === t.title || e.set(t.location, t), e
  1226. }, new Map);
  1227. var i = a.docs_,
  1228. o = a.lang_;
  1229. a.stack_ = [], a.index_ = d()(function() {
  1230. var e, t = this,
  1231. n = {
  1232. "search.pipeline.trimmer": d.a.trimmer,
  1233. "search.pipeline.stopwords": d.a.stopWordFilter
  1234. },
  1235. r = Object.keys(n).reduce(function(e, t) {
  1236. return h(t).match(/^false$/i) || e.push(n[t]), e
  1237. }, []);
  1238. this.pipeline.reset(), r && (e = this.pipeline).add.apply(e, r), 1 === o.length && "en" !== o[0] && d.a[o[0]] ? this.use(d.a[o[0]]) : 1 < o.length && this.use(d.a.multiLanguage.apply(d.a, o)), this.field("title", {
  1239. boost: 10
  1240. }), this.field("text"), this.ref("location"), i.forEach(function(e) {
  1241. return t.add(e)
  1242. })
  1243. });
  1244. var t = a.el_.parentNode;
  1245. if (!(t instanceof HTMLElement)) throw new ReferenceError;
  1246. t.addEventListener("scroll", function() {
  1247. for (; a.stack_.length && t.scrollTop + t.offsetHeight >= t.scrollHeight - 16;) a.stack_.splice(0, 10).forEach(function(e) {
  1248. return e()
  1249. })
  1250. })
  1251. };
  1252. setTimeout(function() {
  1253. return "function" == typeof a.data_ ? a.data_().then(u) : u(a.data_)
  1254. }, 250)
  1255. }
  1256. }, e
  1257. }()
  1258. }).call(this, r(3))
  1259. }, function(e, n, r) {
  1260. "use strict";
  1261. (function(t) {
  1262. r.d(n, "a", function() {
  1263. return e
  1264. });
  1265. var e = function() {
  1266. function e(e) {
  1267. var t = "string" == typeof e ? document.querySelector(e) : e;
  1268. if (!(t instanceof HTMLElement)) throw new ReferenceError;
  1269. this.el_ = t
  1270. }
  1271. return e.prototype.initialize = function(e) {
  1272. e.length && this.el_.children.length && this.el_.children[this.el_.children.length - 1].appendChild(t.createElement("ul", {
  1273. class: "md-source__facts"
  1274. }, e.map(function(e) {
  1275. return t.createElement("li", {
  1276. class: "md-source__fact"
  1277. }, e)
  1278. }))), this.el_.dataset.mdState = "done"
  1279. }, e
  1280. }()
  1281. }).call(this, r(3))
  1282. }, , , function(e, n, c) {
  1283. "use strict";
  1284. c.r(n),
  1285. function(o) {
  1286. c.d(n, "app", function() {
  1287. return t
  1288. });
  1289. c(14), c(15), c(16), c(17), c(18), c(19), c(20);
  1290. var r = c(2),
  1291. e = c(5),
  1292. a = c.n(e),
  1293. i = c(0);
  1294. window.Promise = window.Promise || r.a;
  1295. var s = function(e) {
  1296. var t = document.getElementsByName("lang:" + e)[0];
  1297. if (!(t instanceof HTMLMetaElement)) throw new ReferenceError;
  1298. return t.content
  1299. };
  1300. var t = {
  1301. initialize: function(t) {
  1302. new i.a.Event.Listener(document, "DOMContentLoaded", function() {
  1303. if (!(document.body instanceof HTMLElement)) throw new ReferenceError;
  1304. Modernizr.addTest("ios", function() {
  1305. return !!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)
  1306. });
  1307. var e = document.querySelectorAll("table:not([class])");
  1308. if (Array.prototype.forEach.call(e, function(e) {
  1309. var t = o.createElement("div", {
  1310. class: "md-typeset__scrollwrap"
  1311. }, o.createElement("div", {
  1312. class: "md-typeset__table"
  1313. }));
  1314. e.nextSibling ? e.parentNode.insertBefore(t, e.nextSibling) : e.parentNode.appendChild(t), t.children[0].appendChild(e)
  1315. }), a.a.isSupported()) {
  1316. var t = document.querySelectorAll(".codehilite > pre, pre > code");
  1317. Array.prototype.forEach.call(t, function(e, t) {
  1318. var n = "__code_" + t,
  1319. r = o.createElement("button", {
  1320. class: "md-clipboard",
  1321. title: s("clipboard.copy"),
  1322. "data-clipboard-target": "#" + n + " pre, #" + n + " code"
  1323. }, o.createElement("span", {
  1324. class: "md-clipboard__message"
  1325. })),
  1326. i = e.parentNode;
  1327. i.id = n, i.insertBefore(r, e)
  1328. }), new a.a(".md-clipboard").on("success", function(e) {
  1329. var t = e.trigger.querySelector(".md-clipboard__message");
  1330. if (!(t instanceof HTMLElement)) throw new ReferenceError;
  1331. e.clearSelection(), t.dataset.mdTimer && clearTimeout(parseInt(t.dataset.mdTimer, 10)), t.classList.add("md-clipboard__message--active"), t.innerHTML = s("clipboard.copied"), t.dataset.mdTimer = setTimeout(function() {
  1332. t.classList.remove("md-clipboard__message--active"), t.dataset.mdTimer = ""
  1333. }, 2e3).toString()
  1334. })
  1335. }
  1336. if (!Modernizr.details) {
  1337. var n = document.querySelectorAll("details > summary");
  1338. Array.prototype.forEach.call(n, function(e) {
  1339. e.addEventListener("click", function(e) {
  1340. var t = e.target.parentNode;
  1341. t.hasAttribute("open") ? t.removeAttribute("open") : t.setAttribute("open", "")
  1342. })
  1343. })
  1344. }
  1345. var r = function() {
  1346. if (document.location.hash) {
  1347. var e = document.getElementById(document.location.hash.substring(1));
  1348. if (!e) return;
  1349. for (var t = e.parentNode; t && !(t instanceof HTMLDetailsElement);) t = t.parentNode;
  1350. if (t && !t.open) {
  1351. t.open = !0;
  1352. var n = location.hash;
  1353. location.hash = " ", location.hash = n
  1354. }
  1355. }
  1356. };
  1357. if (window.addEventListener("hashchange", r), r(), Modernizr.ios) {
  1358. var i = document.querySelectorAll("[data-md-scrollfix]");
  1359. Array.prototype.forEach.call(i, function(t) {
  1360. t.addEventListener("touchstart", function() {
  1361. var e = t.scrollTop;
  1362. 0 === e ? t.scrollTop = 1 : e + t.offsetHeight === t.scrollHeight && (t.scrollTop = e - 1)
  1363. })
  1364. })
  1365. }
  1366. }).listen(), new i.a.Event.Listener(window, ["scroll", "resize", "orientationchange"], new i.a.Header.Shadow("[data-md-component=container]", "[data-md-component=header]")).listen(), new i.a.Event.Listener(window, ["scroll", "resize", "orientationchange"], new i.a.Header.Title("[data-md-component=title]", ".md-typeset h1")).listen(), document.querySelector("[data-md-component=hero]") && new i.a.Event.Listener(window, ["scroll", "resize", "orientationchange"], new i.a.Tabs.Toggle("[data-md-component=hero]")).listen(), document.querySelector("[data-md-component=tabs]") && new i.a.Event.Listener(window, ["scroll", "resize", "orientationchange"], new i.a.Tabs.Toggle("[data-md-component=tabs]")).listen(), new i.a.Event.MatchMedia("(min-width: 1220px)", new i.a.Event.Listener(window, ["scroll", "resize", "orientationchange"], new i.a.Sidebar.Position("[data-md-component=navigation]", "[data-md-component=header]"))), document.querySelector("[data-md-component=toc]") && new i.a.Event.MatchMedia("(min-width: 960px)", new i.a.Event.Listener(window, ["scroll", "resize", "orientationchange"], new i.a.Sidebar.Position("[data-md-component=toc]", "[data-md-component=header]"))), new i.a.Event.MatchMedia("(min-width: 960px)", new i.a.Event.Listener(window, "scroll", new i.a.Nav.Blur("[data-md-component=toc] .md-nav__link")));
  1367. var e = document.querySelectorAll("[data-md-component=collapsible]");
  1368. Array.prototype.forEach.call(e, function(e) {
  1369. new i.a.Event.MatchMedia("(min-width: 1220px)", new i.a.Event.Listener(e.previousElementSibling, "click", new i.a.Nav.Collapse(e)))
  1370. }), new i.a.Event.MatchMedia("(max-width: 1219px)", new i.a.Event.Listener("[data-md-component=navigation] [data-md-toggle]", "change", new i.a.Nav.Scrolling("[data-md-component=navigation] nav"))), document.querySelector("[data-md-component=search]") && (new i.a.Event.MatchMedia("(max-width: 959px)", new i.a.Event.Listener("[data-md-toggle=search]", "change", new i.a.Search.Lock("[data-md-toggle=search]")))),
  1371. new i.a.Event.Listener(document.body, "keydown", function(e) {
  1372. if (9 === e.keyCode) {
  1373. var t = document.querySelectorAll("[data-md-component=navigation] .md-nav__link[for]:not([tabindex])");
  1374. Array.prototype.forEach.call(t, function(e) {
  1375. e.offsetHeight && (e.tabIndex = 0)
  1376. })
  1377. }
  1378. }).listen(), new i.a.Event.Listener(document.body, "mousedown", function() {
  1379. var e = document.querySelectorAll("[data-md-component=navigation] .md-nav__link[tabindex]");
  1380. Array.prototype.forEach.call(e, function(e) {
  1381. e.removeAttribute("tabIndex")
  1382. })
  1383. }).listen(), document.body.addEventListener("click", function() {
  1384. "tabbing" === document.body.dataset.mdState && (document.body.dataset.mdState = "")
  1385. }), new i.a.Event.MatchMedia("(max-width: 959px)", new i.a.Event.Listener("[data-md-component=navigation] [href^='#']", "click", function() {
  1386. var e = document.querySelector("[data-md-toggle=drawer]");
  1387. if (!(e instanceof HTMLInputElement)) throw new ReferenceError;
  1388. e.checked && (e.checked = !1, e.dispatchEvent(new CustomEvent("change")))
  1389. })),
  1390. function() {
  1391. var e = document.querySelector("[data-md-source]");
  1392. if (!e) return r.a.resolve([]);
  1393. if (!(e instanceof HTMLAnchorElement)) throw new ReferenceError;
  1394. switch (e.dataset.mdSource) {
  1395. case "github":
  1396. return new i.a.Source.Adapter.GitHub(e).fetch();
  1397. default:
  1398. return r.a.resolve([])
  1399. }
  1400. }().then(function(t) {
  1401. var e = document.querySelectorAll("[data-md-source]");
  1402. Array.prototype.forEach.call(e, function(e) {
  1403. new i.a.Source.Repository(e).initialize(t)
  1404. })
  1405. });
  1406. var n = function() {
  1407. var e = document.querySelectorAll("details");
  1408. Array.prototype.forEach.call(e, function(e) {
  1409. e.setAttribute("open", "")
  1410. })
  1411. };
  1412. new i.a.Event.MatchMedia("print", {
  1413. listen: n,
  1414. unlisten: function() {}
  1415. }), window.onbeforeprint = n
  1416. }
  1417. }
  1418. }.call(this, c(3))
  1419. }, function(e, t, n) {
  1420. e.exports = n.p + "assets/images/icons/bitbucket.1b09e088.svg"
  1421. }, function(e, t, n) {
  1422. e.exports = n.p + "assets/images/icons/github.f0b8504a.svg"
  1423. }, function(e, t, n) {
  1424. e.exports = n.p + "assets/images/icons/gitlab.6dd19c00.svg"
  1425. }, function(e, t) {
  1426. e.exports = "/Users/squidfunk/Desktop/General/Sources/mkdocs-material/material/application.4031d38b.css"
  1427. }, function(e, t) {
  1428. e.exports = "/Users/squidfunk/Desktop/General/Sources/mkdocs-material/material/application-palette.224b79ff.css"
  1429. }, function(e, t) {
  1430. ! function() {
  1431. if ("undefined" != typeof window) try {
  1432. var e = new window.CustomEvent("test", {
  1433. cancelable: !0
  1434. });
  1435. if (e.preventDefault(), !0 !== e.defaultPrevented) throw new Error("Could not prevent default")
  1436. } catch (e) {
  1437. var t = function(e, t) {
  1438. var n, r;
  1439. return (t = t || {}).bubbles = !!t.bubbles, t.cancelable = !!t.cancelable, (n = document.createEvent("CustomEvent")).initCustomEvent(e, t.bubbles, t.cancelable, t.detail), r = n.preventDefault, n.preventDefault = function() {
  1440. r.call(this);
  1441. try {
  1442. Object.defineProperty(this, "defaultPrevented", {
  1443. get: function() {
  1444. return !0
  1445. }
  1446. })
  1447. } catch (e) {
  1448. this.defaultPrevented = !0
  1449. }
  1450. }, n
  1451. };
  1452. t.prototype = window.Event.prototype, window.CustomEvent = t
  1453. }
  1454. }()
  1455. }, function(e, t, n) {
  1456. window.fetch || (window.fetch = n(7).default || n(7))
  1457. }, function(e, i, o) {
  1458. (function(e) {
  1459. var t = void 0 !== e && e || "undefined" != typeof self && self || window,
  1460. n = Function.prototype.apply;
  1461. function r(e, t) {
  1462. this._id = e, this._clearFn = t
  1463. }
  1464. i.setTimeout = function() {
  1465. return new r(n.call(setTimeout, t, arguments), clearTimeout)
  1466. }, i.setInterval = function() {
  1467. return new r(n.call(setInterval, t, arguments), clearInterval)
  1468. }, i.clearTimeout = i.clearInterval = function(e) {
  1469. e && e.close()
  1470. }, r.prototype.unref = r.prototype.ref = function() {}, r.prototype.close = function() {
  1471. this._clearFn.call(t, this._id)
  1472. }, i.enroll = function(e, t) {
  1473. clearTimeout(e._idleTimeoutId), e._idleTimeout = t
  1474. }, i.unenroll = function(e) {
  1475. clearTimeout(e._idleTimeoutId), e._idleTimeout = -1
  1476. }, i._unrefActive = i.active = function(e) {
  1477. clearTimeout(e._idleTimeoutId);
  1478. var t = e._idleTimeout;
  1479. 0 <= t && (e._idleTimeoutId = setTimeout(function() {
  1480. e._onTimeout && e._onTimeout()
  1481. }, t))
  1482. }, o(22), i.setImmediate = "undefined" != typeof self && self.setImmediate || void 0 !== e && e.setImmediate || this && this.setImmediate, i.clearImmediate = "undefined" != typeof self && self.clearImmediate || void 0 !== e && e.clearImmediate || this && this.clearImmediate
  1483. }).call(this, o(4))
  1484. }, function(e, t, n) {
  1485. (function(e, p) {
  1486. ! function(n, r) {
  1487. "use strict";
  1488. if (!n.setImmediate) {
  1489. var i, o, t, a, e, s = 1,
  1490. c = {},
  1491. l = !1,
  1492. u = n.document,
  1493. f = Object.getPrototypeOf && Object.getPrototypeOf(n);
  1494. f = f && f.setTimeout ? f : n, i = "[object process]" === {}.toString.call(n.process) ? function(e) {
  1495. p.nextTick(function() {
  1496. h(e)
  1497. })
  1498. } : function() {
  1499. if (n.postMessage && !n.importScripts) {
  1500. var e = !0,
  1501. t = n.onmessage;
  1502. return n.onmessage = function() {
  1503. e = !1
  1504. }, n.postMessage("", "*"), n.onmessage = t, e
  1505. }
  1506. }() ? (a = "setImmediate$" + Math.random() + "$", e = function(e) {
  1507. e.source === n && "string" == typeof e.data && 0 === e.data.indexOf(a) && h(+e.data.slice(a.length))
  1508. }, n.addEventListener ? n.addEventListener("message", e, !1) : n.attachEvent("onmessage", e), function(e) {
  1509. n.postMessage(a + e, "*")
  1510. }) : n.MessageChannel ? ((t = new MessageChannel).port1.onmessage = function(e) {
  1511. h(e.data)
  1512. }, function(e) {
  1513. t.port2.postMessage(e)
  1514. }) : u && "onreadystatechange" in u.createElement("script") ? (o = u.documentElement, function(e) {
  1515. var t = u.createElement("script");
  1516. t.onreadystatechange = function() {
  1517. h(e), t.onreadystatechange = null, o.removeChild(t), t = null
  1518. }, o.appendChild(t)
  1519. }) : function(e) {
  1520. setTimeout(h, 0, e)
  1521. }, f.setImmediate = function(e) {
  1522. "function" != typeof e && (e = new Function("" + e));
  1523. for (var t = new Array(arguments.length - 1), n = 0; n < t.length; n++) t[n] = arguments[n + 1];
  1524. var r = {
  1525. callback: e,
  1526. args: t
  1527. };
  1528. return c[s] = r, i(s), s++
  1529. }, f.clearImmediate = d
  1530. }
  1531. function d(e) {
  1532. delete c[e]
  1533. }
  1534. function h(e) {
  1535. if (l) setTimeout(h, 0, e);
  1536. else {
  1537. var t = c[e];
  1538. if (t) {
  1539. l = !0;
  1540. try {
  1541. ! function(e) {
  1542. var t = e.callback,
  1543. n = e.args;
  1544. switch (n.length) {
  1545. case 0:
  1546. t();
  1547. break;
  1548. case 1:
  1549. t(n[0]);
  1550. break;
  1551. case 2:
  1552. t(n[0], n[1]);
  1553. break;
  1554. case 3:
  1555. t(n[0], n[1], n[2]);
  1556. break;
  1557. default:
  1558. t.apply(r, n)
  1559. }
  1560. }(t)
  1561. } finally {
  1562. d(e), l = !1
  1563. }
  1564. }
  1565. }
  1566. }
  1567. }("undefined" == typeof self ? void 0 === e ? this : e : self)
  1568. }).call(this, n(4), n(23))
  1569. }, function(e, t) {
  1570. var n, r, i = e.exports = {};
  1571. function o() {
  1572. throw new Error("setTimeout has not been defined")
  1573. }
  1574. function a() {
  1575. throw new Error("clearTimeout has not been defined")
  1576. }
  1577. function s(t) {
  1578. if (n === setTimeout) return setTimeout(t, 0);
  1579. if ((n === o || !n) && setTimeout) return n = setTimeout, setTimeout(t, 0);
  1580. try {
  1581. return n(t, 0)
  1582. } catch (e) {
  1583. try {
  1584. return n.call(null, t, 0)
  1585. } catch (e) {
  1586. return n.call(this, t, 0)
  1587. }
  1588. }
  1589. }! function() {
  1590. try {
  1591. n = "function" == typeof setTimeout ? setTimeout : o
  1592. } catch (e) {
  1593. n = o
  1594. }
  1595. try {
  1596. r = "function" == typeof clearTimeout ? clearTimeout : a
  1597. } catch (e) {
  1598. r = a
  1599. }
  1600. }();
  1601. var c, l = [],
  1602. u = !1,
  1603. f = -1;
  1604. function d() {
  1605. u && c && (u = !1, c.length ? l = c.concat(l) : f = -1, l.length && h())
  1606. }
  1607. function h() {
  1608. if (!u) {
  1609. var e = s(d);
  1610. u = !0;
  1611. for (var t = l.length; t;) {
  1612. for (c = l, l = []; ++f < t;) c && c[f].run();
  1613. f = -1, t = l.length
  1614. }
  1615. c = null, u = !1,
  1616. function(t) {
  1617. if (r === clearTimeout) return clearTimeout(t);
  1618. if ((r === a || !r) && clearTimeout) return r = clearTimeout, clearTimeout(t);
  1619. try {
  1620. r(t)
  1621. } catch (e) {
  1622. try {
  1623. return r.call(null, t)
  1624. } catch (e) {
  1625. return r.call(this, t)
  1626. }
  1627. }
  1628. }(e)
  1629. }
  1630. }
  1631. function p(e, t) {
  1632. this.fun = e, this.array = t
  1633. }
  1634. function m() {}
  1635. i.nextTick = function(e) {
  1636. var t = new Array(arguments.length - 1);
  1637. if (1 < arguments.length)
  1638. for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
  1639. l.push(new p(e, t)), 1 !== l.length || u || s(h)
  1640. }, p.prototype.run = function() {
  1641. this.fun.apply(null, this.array)
  1642. }, i.title = "browser", i.browser = !0, i.env = {}, i.argv = [], i.version = "", i.versions = {}, i.on = m, i.addListener = m, i.once = m, i.off = m, i.removeListener = m, i.removeAllListeners = m, i.emit = m, i.prependListener = m, i.prependOnceListener = m, i.listeners = function(e) {
  1643. return []
  1644. }, i.binding = function(e) {
  1645. throw new Error("process.binding is not supported")
  1646. }, i.cwd = function() {
  1647. return "/"
  1648. }, i.chdir = function(e) {
  1649. throw new Error("process.chdir is not supported")
  1650. }, i.umask = function() {
  1651. return 0
  1652. }
  1653. }, function(i, o, a) {
  1654. var s, c;
  1655. /**
  1656. * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.6
  1657. * Copyright (C) 2019 Oliver Nightingale
  1658. * @license MIT
  1659. */
  1660. ! function() {
  1661. var t, l, u, e, n, f, d, h, p, m, y, v, g, w, _, E, x, b, k, S, T, L, R, O, C, r, D = function(e) {
  1662. var t = new D.Builder;
  1663. return t.pipeline.add(D.trimmer, D.stopWordFilter, D.stemmer), t.searchPipeline.add(D.stemmer), e.call(t, t), t.build()
  1664. };
  1665. D.version = "2.3.6", D.utils = {}, D.utils.warn = (t = this, function(e) {
  1666. t.console && console.warn && console.warn(e)
  1667. }), D.utils.asString = function(e) {
  1668. return null == e ? "" : e.toString()
  1669. }, D.utils.clone = function(e) {
  1670. if (null == e) return e;
  1671. for (var t = Object.create(null), n = Object.keys(e), r = 0; r < n.length; r++) {
  1672. var i = n[r],
  1673. o = e[i];
  1674. if (Array.isArray(o)) t[i] = o.slice();
  1675. else {
  1676. if ("string" != typeof o && "number" != typeof o && "boolean" != typeof o) throw new TypeError("clone is not deep and does not support nested objects");
  1677. t[i] = o
  1678. }
  1679. }
  1680. return t
  1681. }, D.FieldRef = function(e, t, n) {
  1682. this.docRef = e, this.fieldName = t, this._stringValue = n
  1683. }, D.FieldRef.joiner = "/", D.FieldRef.fromString = function(e) {
  1684. var t = e.indexOf(D.FieldRef.joiner);
  1685. if (-1 === t) throw "malformed field ref string";
  1686. var n = e.slice(0, t),
  1687. r = e.slice(t + 1);
  1688. return new D.FieldRef(r, n, e)
  1689. }, D.FieldRef.prototype.toString = function() {
  1690. return null == this._stringValue && (this._stringValue = this.fieldName + D.FieldRef.joiner + this.docRef), this._stringValue
  1691. }, D.Set = function(e) {
  1692. if (this.elements = Object.create(null), e) {
  1693. this.length = e.length;
  1694. for (var t = 0; t < this.length; t++) this.elements[e[t]] = !0
  1695. } else this.length = 0
  1696. }, D.Set.complete = {
  1697. intersect: function(e) {
  1698. return e
  1699. },
  1700. union: function(e) {
  1701. return e
  1702. },
  1703. contains: function() {
  1704. return !0
  1705. }
  1706. }, D.Set.empty = {
  1707. intersect: function() {
  1708. return this
  1709. },
  1710. union: function(e) {
  1711. return e
  1712. },
  1713. contains: function() {
  1714. return !1
  1715. }
  1716. }, D.Set.prototype.contains = function(e) {
  1717. return !!this.elements[e]
  1718. }, D.Set.prototype.intersect = function(e) {
  1719. var t, n, r, i = [];
  1720. if (e === D.Set.complete) return this;
  1721. if (e === D.Set.empty) return e;
  1722. n = this.length < e.length ? (t = this, e) : (t = e, this), r = Object.keys(t.elements);
  1723. for (var o = 0; o < r.length; o++) {
  1724. var a = r[o];
  1725. a in n.elements && i.push(a)
  1726. }
  1727. return new D.Set(i)
  1728. }, D.Set.prototype.union = function(e) {
  1729. return e === D.Set.complete ? D.Set.complete : e === D.Set.empty ? this : new D.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))
  1730. }, D.idf = function(e, t) {
  1731. var n = 0;
  1732. for (var r in e) "_index" != r && (n += Object.keys(e[r]).length);
  1733. var i = (t - n + .5) / (n + .5);
  1734. return Math.log(1 + Math.abs(i))
  1735. }, D.Token = function(e, t) {
  1736. this.str = e || "", this.metadata = t || {}
  1737. }, D.Token.prototype.toString = function() {
  1738. return this.str
  1739. }, D.Token.prototype.update = function(e) {
  1740. return this.str = e(this.str, this.metadata), this
  1741. }, D.Token.prototype.clone = function(e) {
  1742. return e = e || function(e) {
  1743. return e
  1744. }, new D.Token(e(this.str, this.metadata), this.metadata)
  1745. }, D.tokenizer = function(e, t) {
  1746. if (null == e || null == e) return [];
  1747. if (Array.isArray(e)) return e.map(function(e) {
  1748. return new D.Token(D.utils.asString(e).toLowerCase(), D.utils.clone(t))
  1749. });
  1750. for (var n = e.toString().trim().toLowerCase(), r = n.length, i = [], o = 0, a = 0; o <= r; o++) {
  1751. var s = o - a;
  1752. if (n.charAt(o).match(D.tokenizer.separator) || o == r) {
  1753. if (0 < s) {
  1754. var c = D.utils.clone(t) || {};
  1755. c.position = [a, s], c.index = i.length, i.push(new D.Token(n.slice(a, o), c))
  1756. }
  1757. a = o + 1
  1758. }
  1759. }
  1760. return i
  1761. }, D.tokenizer.separator = /[\s\-]+/, D.Pipeline = function() {
  1762. this._stack = []
  1763. }, D.Pipeline.registeredFunctions = Object.create(null), D.Pipeline.registerFunction = function(e, t) {
  1764. t in this.registeredFunctions && D.utils.warn("Overwriting existing registered function: " + t), e.label = t, D.Pipeline.registeredFunctions[e.label] = e
  1765. }, D.Pipeline.warnIfFunctionNotRegistered = function(e) {
  1766. e.label && e.label in this.registeredFunctions || D.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n", e)
  1767. }, D.Pipeline.load = function(e) {
  1768. var n = new D.Pipeline;
  1769. return e.forEach(function(e) {
  1770. var t = D.Pipeline.registeredFunctions[e];
  1771. if (!t) throw new Error("Cannot load unregistered function: " + e);
  1772. n.add(t)
  1773. }), n
  1774. }, D.Pipeline.prototype.add = function() {
  1775. Array.prototype.slice.call(arguments).forEach(function(e) {
  1776. D.Pipeline.warnIfFunctionNotRegistered(e), this._stack.push(e)
  1777. }, this)
  1778. }, D.Pipeline.prototype.after = function(e, t) {
  1779. D.Pipeline.warnIfFunctionNotRegistered(t);
  1780. var n = this._stack.indexOf(e);
  1781. if (-1 == n) throw new Error("Cannot find existingFn");
  1782. n += 1, this._stack.splice(n, 0, t)
  1783. }, D.Pipeline.prototype.before = function(e, t) {
  1784. D.Pipeline.warnIfFunctionNotRegistered(t);
  1785. var n = this._stack.indexOf(e);
  1786. if (-1 == n) throw new Error("Cannot find existingFn");
  1787. this._stack.splice(n, 0, t)
  1788. }, D.Pipeline.prototype.remove = function(e) {
  1789. var t = this._stack.indexOf(e); - 1 != t && this._stack.splice(t, 1)
  1790. }, D.Pipeline.prototype.run = function(e) {
  1791. for (var t = this._stack.length, n = 0; n < t; n++) {
  1792. for (var r = this._stack[n], i = [], o = 0; o < e.length; o++) {
  1793. var a = r(e[o], o, e);
  1794. if (void 0 !== a && "" !== a)
  1795. if (Array.isArray(a))
  1796. for (var s = 0; s < a.length; s++) i.push(a[s]);
  1797. else i.push(a)
  1798. }
  1799. e = i
  1800. }
  1801. return e
  1802. }, D.Pipeline.prototype.runString = function(e, t) {
  1803. var n = new D.Token(e, t);
  1804. return this.run([n]).map(function(e) {
  1805. return e.toString()
  1806. })
  1807. }, D.Pipeline.prototype.reset = function() {
  1808. this._stack = []
  1809. }, D.Pipeline.prototype.toJSON = function() {
  1810. return this._stack.map(function(e) {
  1811. return D.Pipeline.warnIfFunctionNotRegistered(e), e.label
  1812. })
  1813. }, D.Vector = function(e) {
  1814. this._magnitude = 0, this.elements = e || []
  1815. }, D.Vector.prototype.positionForIndex = function(e) {
  1816. if (0 == this.elements.length) return 0;
  1817. for (var t = 0, n = this.elements.length / 2, r = n - t, i = Math.floor(r / 2), o = this.elements[2 * i]; 1 < r && (o < e && (t = i), e < o && (n = i), o != e);) r = n - t, i = t + Math.floor(r / 2), o = this.elements[2 * i];
  1818. return o == e ? 2 * i : e < o ? 2 * i : o < e ? 2 * (i + 1) : void 0
  1819. }, D.Vector.prototype.insert = function(e, t) {
  1820. this.upsert(e, t, function() {
  1821. throw "duplicate index"
  1822. })
  1823. }, D.Vector.prototype.upsert = function(e, t, n) {
  1824. this._magnitude = 0;
  1825. var r = this.positionForIndex(e);
  1826. this.elements[r] == e ? this.elements[r + 1] = n(this.elements[r + 1], t) : this.elements.splice(r, 0, e, t)
  1827. }, D.Vector.prototype.magnitude = function() {
  1828. if (this._magnitude) return this._magnitude;
  1829. for (var e = 0, t = this.elements.length, n = 1; n < t; n += 2) {
  1830. var r = this.elements[n];
  1831. e += r * r
  1832. }
  1833. return this._magnitude = Math.sqrt(e)
  1834. }, D.Vector.prototype.dot = function(e) {
  1835. for (var t = 0, n = this.elements, r = e.elements, i = n.length, o = r.length, a = 0, s = 0, c = 0, l = 0; c < i && l < o;)(a = n[c]) < (s = r[l]) ? c += 2 : s < a ? l += 2 : a == s && (t += n[c + 1] * r[l + 1], c += 2, l += 2);
  1836. return t
  1837. }, D.Vector.prototype.similarity = function(e) {
  1838. return this.dot(e) / this.magnitude() || 0
  1839. }, D.Vector.prototype.toArray = function() {
  1840. for (var e = new Array(this.elements.length / 2), t = 1, n = 0; t < this.elements.length; t += 2, n++) e[n] = this.elements[t];
  1841. return e
  1842. }, D.Vector.prototype.toJSON = function() {
  1843. return this.elements
  1844. }, D.stemmer = (l = {
  1845. ational: "ate",
  1846. tional: "tion",
  1847. enci: "ence",
  1848. anci: "ance",
  1849. izer: "ize",
  1850. bli: "ble",
  1851. alli: "al",
  1852. entli: "ent",
  1853. eli: "e",
  1854. ousli: "ous",
  1855. ization: "ize",
  1856. ation: "ate",
  1857. ator: "ate",
  1858. alism: "al",
  1859. iveness: "ive",
  1860. fulness: "ful",
  1861. ousness: "ous",
  1862. aliti: "al",
  1863. iviti: "ive",
  1864. biliti: "ble",
  1865. logi: "log"
  1866. }, u = {
  1867. icate: "ic",
  1868. ative: "",
  1869. alize: "al",
  1870. iciti: "ic",
  1871. ical: "ic",
  1872. ful: "",
  1873. ness: ""
  1874. }, e = "[aeiouy]", n = "[^aeiou][^aeiouy]*", f = new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"), d = new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"), h = new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"), p = new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"), m = /^(.+?)(ss|i)es$/, y = /^(.+?)([^s])s$/, v = /^(.+?)eed$/, g = /^(.+?)(ed|ing)$/, w = /.$/, _ = /(at|bl|iz)$/, E = new RegExp("([^aeiouylsz])\\1$"), x = new RegExp("^" + n + e + "[^aeiouwxy]$"), b = /^(.+?[^aeiou])y$/, k = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/, S = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/, T = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/, L = /^(.+?)(s|t)(ion)$/, R = /^(.+?)e$/, O = /ll$/, C = new RegExp("^" + n + e + "[^aeiouwxy]$"), r = function(e) {
  1875. var t, n, r, i, o, a, s;
  1876. if (e.length < 3) return e;
  1877. if ("y" == (r = e.substr(0, 1)) && (e = r.toUpperCase() + e.substr(1)), o = y, (i = m).test(e) ? e = e.replace(i, "$1$2") : o.test(e) && (e = e.replace(o, "$1$2")), o = g, (i = v).test(e)) {
  1878. var c = i.exec(e);
  1879. (i = f).test(c[1]) && (i = w, e = e.replace(i, ""))
  1880. } else if (o.test(e)) {
  1881. t = (c = o.exec(e))[1], (o = p).test(t) && (a = E, s = x, (o = _).test(e = t) ? e += "e" : a.test(e) ? (i = w, e = e.replace(i, "")) : s.test(e) && (e += "e"))
  1882. }(i = b).test(e) && (e = (t = (c = i.exec(e))[1]) + "i");
  1883. (i = k).test(e) && (t = (c = i.exec(e))[1], n = c[2], (i = f).test(t) && (e = t + l[n]));
  1884. (i = S).test(e) && (t = (c = i.exec(e))[1], n = c[2], (i = f).test(t) && (e = t + u[n]));
  1885. if (o = L, (i = T).test(e)) t = (c = i.exec(e))[1], (i = d).test(t) && (e = t);
  1886. else if (o.test(e)) {
  1887. t = (c = o.exec(e))[1] + c[2], (o = d).test(t) && (e = t)
  1888. }(i = R).test(e) && (t = (c = i.exec(e))[1], o = h, a = C, ((i = d).test(t) || o.test(t) && !a.test(t)) && (e = t));
  1889. return o = d, (i = O).test(e) && o.test(e) && (i = w, e = e.replace(i, "")), "y" == r && (e = r.toLowerCase() + e.substr(1)), e
  1890. }, function(e) {
  1891. return e.update(r)
  1892. }), D.Pipeline.registerFunction(D.stemmer, "stemmer"), D.generateStopWordFilter = function(e) {
  1893. var t = e.reduce(function(e, t) {
  1894. return e[t] = t, e
  1895. }, {});
  1896. return function(e) {
  1897. if (e && t[e.toString()] !== e.toString()) return e
  1898. }
  1899. }, D.stopWordFilter = D.generateStopWordFilter(["a", "able", "about", "across", "after", "all", "almost", "also", "am", "among", "an", "and", "any", "are", "as", "at", "be", "because", "been", "but", "by", "can", "cannot", "could", "dear", "did", "do", "does", "either", "else", "ever", "every", "for", "from", "get", "got", "had", "has", "have", "he", "her", "hers", "him", "his", "how", "however", "i", "if", "in", "into", "is", "it", "its", "just", "least", "let", "like", "likely", "may", "me", "might", "most", "must", "my", "neither", "no", "nor", "not", "of", "off", "often", "on", "only", "or", "other", "our", "own", "rather", "said", "say", "says", "she", "should", "since", "so", "some", "than", "that", "the", "their", "them", "then", "there", "these", "they", "this", "tis", "to", "too", "twas", "us", "wants", "was", "we", "were", "what", "when", "where", "which", "while", "who", "whom", "why", "will", "with", "would", "yet", "you", "your"]), D.Pipeline.registerFunction(D.stopWordFilter, "stopWordFilter"), D.trimmer = function(e) {
  1900. return e.update(function(e) {
  1901. return e.replace(/^\W+/, "").replace(/\W+$/, "")
  1902. })
  1903. }, D.Pipeline.registerFunction(D.trimmer, "trimmer"), D.TokenSet = function() {
  1904. this.final = !1, this.edges = {}, this.id = D.TokenSet._nextId, D.TokenSet._nextId += 1
  1905. }, D.TokenSet._nextId = 1, D.TokenSet.fromArray = function(e) {
  1906. for (var t = new D.TokenSet.Builder, n = 0, r = e.length; n < r; n++) t.insert(e[n]);
  1907. return t.finish(), t.root
  1908. }, D.TokenSet.fromClause = function(e) {
  1909. return "editDistance" in e ? D.TokenSet.fromFuzzyString(e.term, e.editDistance) : D.TokenSet.fromString(e.term)
  1910. }, D.TokenSet.fromFuzzyString = function(e, t) {
  1911. for (var n = new D.TokenSet, r = [{
  1912. node: n,
  1913. editsRemaining: t,
  1914. str: e
  1915. }]; r.length;) {
  1916. var i = r.pop();
  1917. if (0 < i.str.length) {
  1918. var o, a = i.str.charAt(0);
  1919. a in i.node.edges ? o = i.node.edges[a] : (o = new D.TokenSet, i.node.edges[a] = o), 1 == i.str.length && (o.final = !0), r.push({
  1920. node: o,
  1921. editsRemaining: i.editsRemaining,
  1922. str: i.str.slice(1)
  1923. })
  1924. }
  1925. if (0 != i.editsRemaining) {
  1926. if ("*" in i.node.edges) var s = i.node.edges["*"];
  1927. else {
  1928. s = new D.TokenSet;
  1929. i.node.edges["*"] = s
  1930. }
  1931. if (0 == i.str.length && (s.final = !0), r.push({
  1932. node: s,
  1933. editsRemaining: i.editsRemaining - 1,
  1934. str: i.str
  1935. }), 1 < i.str.length && r.push({
  1936. node: i.node,
  1937. editsRemaining: i.editsRemaining - 1,
  1938. str: i.str.slice(1)
  1939. }), 1 == i.str.length && (i.node.final = !0), 1 <= i.str.length) {
  1940. if ("*" in i.node.edges) var c = i.node.edges["*"];
  1941. else {
  1942. c = new D.TokenSet;
  1943. i.node.edges["*"] = c
  1944. }
  1945. 1 == i.str.length && (c.final = !0), r.push({
  1946. node: c,
  1947. editsRemaining: i.editsRemaining - 1,
  1948. str: i.str.slice(1)
  1949. })
  1950. }
  1951. if (1 < i.str.length) {
  1952. var l, u = i.str.charAt(0),
  1953. f = i.str.charAt(1);
  1954. f in i.node.edges ? l = i.node.edges[f] : (l = new D.TokenSet, i.node.edges[f] = l), 1 == i.str.length && (l.final = !0), r.push({
  1955. node: l,
  1956. editsRemaining: i.editsRemaining - 1,
  1957. str: u + i.str.slice(2)
  1958. })
  1959. }
  1960. }
  1961. }
  1962. return n
  1963. }, D.TokenSet.fromString = function(e) {
  1964. for (var t = new D.TokenSet, n = t, r = 0, i = e.length; r < i; r++) {
  1965. var o = e[r],
  1966. a = r == i - 1;
  1967. if ("*" == o)(t.edges[o] = t).final = a;
  1968. else {
  1969. var s = new D.TokenSet;
  1970. s.final = a, t.edges[o] = s, t = s
  1971. }
  1972. }
  1973. return n
  1974. }, D.TokenSet.prototype.toArray = function() {
  1975. for (var e = [], t = [{
  1976. prefix: "",
  1977. node: this
  1978. }]; t.length;) {
  1979. var n = t.pop(),
  1980. r = Object.keys(n.node.edges),
  1981. i = r.length;
  1982. n.node.final && (n.prefix.charAt(0), e.push(n.prefix));
  1983. for (var o = 0; o < i; o++) {
  1984. var a = r[o];
  1985. t.push({
  1986. prefix: n.prefix.concat(a),
  1987. node: n.node.edges[a]
  1988. })
  1989. }
  1990. }
  1991. return e
  1992. }, D.TokenSet.prototype.toString = function() {
  1993. if (this._str) return this._str;
  1994. for (var e = this.final ? "1" : "0", t = Object.keys(this.edges).sort(), n = t.length, r = 0; r < n; r++) {
  1995. var i = t[r];
  1996. e = e + i + this.edges[i].id
  1997. }
  1998. return e
  1999. }, D.TokenSet.prototype.intersect = function(e) {
  2000. for (var t = new D.TokenSet, n = void 0, r = [{
  2001. qNode: e,
  2002. output: t,
  2003. node: this
  2004. }]; r.length;) {
  2005. n = r.pop();
  2006. for (var i = Object.keys(n.qNode.edges), o = i.length, a = Object.keys(n.node.edges), s = a.length, c = 0; c < o; c++)
  2007. for (var l = i[c], u = 0; u < s; u++) {
  2008. var f = a[u];
  2009. if (f == l || "*" == l) {
  2010. var d = n.node.edges[f],
  2011. h = n.qNode.edges[l],
  2012. p = d.final && h.final,
  2013. m = void 0;
  2014. f in n.output.edges ? (m = n.output.edges[f]).final = m.final || p : ((m = new D.TokenSet).final = p, n.output.edges[f] = m), r.push({
  2015. qNode: h,
  2016. output: m,
  2017. node: d
  2018. })
  2019. }
  2020. }
  2021. }
  2022. return t
  2023. }, D.TokenSet.Builder = function() {
  2024. this.previousWord = "", this.root = new D.TokenSet, this.uncheckedNodes = [], this.minimizedNodes = {}
  2025. }, D.TokenSet.Builder.prototype.insert = function(e) {
  2026. var t, n = 0;
  2027. if (e < this.previousWord) throw new Error("Out of order word insertion");
  2028. for (var r = 0; r < e.length && r < this.previousWord.length && e[r] == this.previousWord[r]; r++) n++;
  2029. this.minimize(n), t = 0 == this.uncheckedNodes.length ? this.root : this.uncheckedNodes[this.uncheckedNodes.length - 1].child;
  2030. for (r = n; r < e.length; r++) {
  2031. var i = new D.TokenSet,
  2032. o = e[r];
  2033. t.edges[o] = i, this.uncheckedNodes.push({
  2034. parent: t,
  2035. char: o,
  2036. child: i
  2037. }), t = i
  2038. }
  2039. t.final = !0, this.previousWord = e
  2040. }, D.TokenSet.Builder.prototype.finish = function() {
  2041. this.minimize(0)
  2042. }, D.TokenSet.Builder.prototype.minimize = function(e) {
  2043. for (var t = this.uncheckedNodes.length - 1; e <= t; t--) {
  2044. var n = this.uncheckedNodes[t],
  2045. r = n.child.toString();
  2046. r in this.minimizedNodes ? n.parent.edges[n.char] = this.minimizedNodes[r] : (n.child._str = r, this.minimizedNodes[r] = n.child), this.uncheckedNodes.pop()
  2047. }
  2048. }, D.Index = function(e) {
  2049. this.invertedIndex = e.invertedIndex, this.fieldVectors = e.fieldVectors, this.tokenSet = e.tokenSet, this.fields = e.fields, this.pipeline = e.pipeline
  2050. }, D.Index.prototype.search = function(t) {
  2051. return this.query(function(e) {
  2052. new D.QueryParser(t, e).parse()
  2053. })
  2054. }, D.Index.prototype.query = function(e) {
  2055. for (var t = new D.Query(this.fields), n = Object.create(null), r = Object.create(null), i = Object.create(null), o = Object.create(null), a = Object.create(null), s = 0; s < this.fields.length; s++) r[this.fields[s]] = new D.Vector;
  2056. e.call(t, t);
  2057. for (s = 0; s < t.clauses.length; s++) {
  2058. var c = t.clauses[s],
  2059. l = null,
  2060. u = D.Set.complete;
  2061. l = c.usePipeline ? this.pipeline.runString(c.term, {
  2062. fields: c.fields
  2063. }) : [c.term];
  2064. for (var f = 0; f < l.length; f++) {
  2065. var d = l[f];
  2066. c.term = d;
  2067. var h = D.TokenSet.fromClause(c),
  2068. p = this.tokenSet.intersect(h).toArray();
  2069. if (0 === p.length && c.presence === D.Query.presence.REQUIRED) {
  2070. for (var m = 0; m < c.fields.length; m++) {
  2071. o[Q = c.fields[m]] = D.Set.empty
  2072. }
  2073. break
  2074. }
  2075. for (var y = 0; y < p.length; y++) {
  2076. var v = p[y],
  2077. g = this.invertedIndex[v],
  2078. w = g._index;
  2079. for (m = 0; m < c.fields.length; m++) {
  2080. var _ = g[Q = c.fields[m]],
  2081. E = Object.keys(_),
  2082. x = v + "/" + Q,
  2083. b = new D.Set(E);
  2084. if (c.presence == D.Query.presence.REQUIRED && (u = u.union(b), void 0 === o[Q] && (o[Q] = D.Set.complete)), c.presence != D.Query.presence.PROHIBITED) {
  2085. if (r[Q].upsert(w, c.boost, function(e, t) {
  2086. return e + t
  2087. }), !i[x]) {
  2088. for (var k = 0; k < E.length; k++) {
  2089. var S, T = E[k],
  2090. L = new D.FieldRef(T, Q),
  2091. R = _[T];
  2092. void 0 === (S = n[L]) ? n[L] = new D.MatchData(v, Q, R) : S.add(v, Q, R)
  2093. }
  2094. i[x] = !0
  2095. }
  2096. } else void 0 === a[Q] && (a[Q] = D.Set.empty), a[Q] = a[Q].union(b)
  2097. }
  2098. }
  2099. }
  2100. if (c.presence === D.Query.presence.REQUIRED)
  2101. for (m = 0; m < c.fields.length; m++) {
  2102. o[Q = c.fields[m]] = o[Q].intersect(u)
  2103. }
  2104. }
  2105. var O = D.Set.complete,
  2106. C = D.Set.empty;
  2107. for (s = 0; s < this.fields.length; s++) {
  2108. var Q;
  2109. o[Q = this.fields[s]] && (O = O.intersect(o[Q])), a[Q] && (C = C.union(a[Q]))
  2110. }
  2111. var P = Object.keys(n),
  2112. A = [],
  2113. I = Object.create(null);
  2114. if (t.isNegated()) {
  2115. P = Object.keys(this.fieldVectors);
  2116. for (s = 0; s < P.length; s++) {
  2117. L = P[s];
  2118. var M = D.FieldRef.fromString(L);
  2119. n[L] = new D.MatchData
  2120. }
  2121. }
  2122. for (s = 0; s < P.length; s++) {
  2123. var N = (M = D.FieldRef.fromString(P[s])).docRef;
  2124. if (O.contains(N) && !C.contains(N)) {
  2125. var j, F = this.fieldVectors[M],
  2126. H = r[M.fieldName].similarity(F);
  2127. if (void 0 !== (j = I[N])) j.score += H, j.matchData.combine(n[M]);
  2128. else {
  2129. var q = {
  2130. ref: N,
  2131. score: H,
  2132. matchData: n[M]
  2133. };
  2134. I[N] = q, A.push(q)
  2135. }
  2136. }
  2137. }
  2138. return A.sort(function(e, t) {
  2139. return t.score - e.score
  2140. })
  2141. }, D.Index.prototype.toJSON = function() {
  2142. var e = Object.keys(this.invertedIndex).sort().map(function(e) {
  2143. return [e, this.invertedIndex[e]]
  2144. }, this),
  2145. t = Object.keys(this.fieldVectors).map(function(e) {
  2146. return [e, this.fieldVectors[e].toJSON()]
  2147. }, this);
  2148. return {
  2149. version: D.version,
  2150. fields: this.fields,
  2151. fieldVectors: t,
  2152. invertedIndex: e,
  2153. pipeline: this.pipeline.toJSON()
  2154. }
  2155. }, D.Index.load = function(e) {
  2156. var t = {},
  2157. n = {},
  2158. r = e.fieldVectors,
  2159. i = Object.create(null),
  2160. o = e.invertedIndex,
  2161. a = new D.TokenSet.Builder,
  2162. s = D.Pipeline.load(e.pipeline);
  2163. e.version != D.version && D.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + D.version + "' does not match serialized index '" + e.version + "'");
  2164. for (var c = 0; c < r.length; c++) {
  2165. var l = (f = r[c])[0],
  2166. u = f[1];
  2167. n[l] = new D.Vector(u)
  2168. }
  2169. for (c = 0; c < o.length; c++) {
  2170. var f, d = (f = o[c])[0],
  2171. h = f[1];
  2172. a.insert(d), i[d] = h
  2173. }
  2174. return a.finish(), t.fields = e.fields, t.fieldVectors = n, t.invertedIndex = i, t.tokenSet = a.root, t.pipeline = s, new D.Index(t)
  2175. }, D.Builder = function() {
  2176. this._ref = "id", this._fields = Object.create(null), this._documents = Object.create(null), this.invertedIndex = Object.create(null), this.fieldTermFrequencies = {}, this.fieldLengths = {}, this.tokenizer = D.tokenizer, this.pipeline = new D.Pipeline, this.searchPipeline = new D.Pipeline, this.documentCount = 0, this._b = .75, this._k1 = 1.2, this.termIndex = 0, this.metadataWhitelist = []
  2177. }, D.Builder.prototype.ref = function(e) {
  2178. this._ref = e
  2179. }, D.Builder.prototype.field = function(e, t) {
  2180. if (/\//.test(e)) throw new RangeError("Field '" + e + "' contains illegal character '/'");
  2181. this._fields[e] = t || {}
  2182. }, D.Builder.prototype.b = function(e) {
  2183. this._b = e < 0 ? 0 : 1 < e ? 1 : e
  2184. }, D.Builder.prototype.k1 = function(e) {
  2185. this._k1 = e
  2186. }, D.Builder.prototype.add = function(e, t) {
  2187. var n = e[this._ref],
  2188. r = Object.keys(this._fields);
  2189. this._documents[n] = t || {}, this.documentCount += 1;
  2190. for (var i = 0; i < r.length; i++) {
  2191. var o = r[i],
  2192. a = this._fields[o].extractor,
  2193. s = a ? a(e) : e[o],
  2194. c = this.tokenizer(s, {
  2195. fields: [o]
  2196. }),
  2197. l = this.pipeline.run(c),
  2198. u = new D.FieldRef(n, o),
  2199. f = Object.create(null);
  2200. this.fieldTermFrequencies[u] = f, this.fieldLengths[u] = 0, this.fieldLengths[u] += l.length;
  2201. for (var d = 0; d < l.length; d++) {
  2202. var h = l[d];
  2203. if (null == f[h] && (f[h] = 0), f[h] += 1, null == this.invertedIndex[h]) {
  2204. var p = Object.create(null);
  2205. p._index = this.termIndex, this.termIndex += 1;
  2206. for (var m = 0; m < r.length; m++) p[r[m]] = Object.create(null);
  2207. this.invertedIndex[h] = p
  2208. }
  2209. null == this.invertedIndex[h][o][n] && (this.invertedIndex[h][o][n] = Object.create(null));
  2210. for (var y = 0; y < this.metadataWhitelist.length; y++) {
  2211. var v = this.metadataWhitelist[y],
  2212. g = h.metadata[v];
  2213. null == this.invertedIndex[h][o][n][v] && (this.invertedIndex[h][o][n][v] = []), this.invertedIndex[h][o][n][v].push(g)
  2214. }
  2215. }
  2216. }
  2217. }, D.Builder.prototype.calculateAverageFieldLengths = function() {
  2218. for (var e = Object.keys(this.fieldLengths), t = e.length, n = {}, r = {}, i = 0; i < t; i++) {
  2219. var o = D.FieldRef.fromString(e[i]),
  2220. a = o.fieldName;
  2221. r[a] || (r[a] = 0), r[a] += 1, n[a] || (n[a] = 0), n[a] += this.fieldLengths[o]
  2222. }
  2223. var s = Object.keys(this._fields);
  2224. for (i = 0; i < s.length; i++) {
  2225. var c = s[i];
  2226. n[c] = n[c] / r[c]
  2227. }
  2228. this.averageFieldLength = n
  2229. }, D.Builder.prototype.createFieldVectors = function() {
  2230. for (var e = {}, t = Object.keys(this.fieldTermFrequencies), n = t.length, r = Object.create(null), i = 0; i < n; i++) {
  2231. for (var o = D.FieldRef.fromString(t[i]), a = o.fieldName, s = this.fieldLengths[o], c = new D.Vector, l = this.fieldTermFrequencies[o], u = Object.keys(l), f = u.length, d = this._fields[a].boost || 1, h = this._documents[o.docRef].boost || 1, p = 0; p < f; p++) {
  2232. var m, y, v, g = u[p],
  2233. w = l[g],
  2234. _ = this.invertedIndex[g]._index;
  2235. void 0 === r[g] ? (m = D.idf(this.invertedIndex[g], this.documentCount), r[g] = m) : m = r[g], y = m * ((this._k1 + 1) * w) / (this._k1 * (1 - this._b + this._b * (s / this.averageFieldLength[a])) + w), y *= d, y *= h, v = Math.round(1e3 * y) / 1e3, c.insert(_, v)
  2236. }
  2237. e[o] = c
  2238. }
  2239. this.fieldVectors = e
  2240. }, D.Builder.prototype.createTokenSet = function() {
  2241. this.tokenSet = D.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())
  2242. }, D.Builder.prototype.build = function() {
  2243. return this.calculateAverageFieldLengths(), this.createFieldVectors(), this.createTokenSet(), new D.Index({
  2244. invertedIndex: this.invertedIndex,
  2245. fieldVectors: this.fieldVectors,
  2246. tokenSet: this.tokenSet,
  2247. fields: Object.keys(this._fields),
  2248. pipeline: this.searchPipeline
  2249. })
  2250. }, D.Builder.prototype.use = function(e) {
  2251. var t = Array.prototype.slice.call(arguments, 1);
  2252. t.unshift(this), e.apply(this, t)
  2253. }, D.MatchData = function(e, t, n) {
  2254. for (var r = Object.create(null), i = Object.keys(n || {}), o = 0; o < i.length; o++) {
  2255. var a = i[o];
  2256. r[a] = n[a].slice()
  2257. }
  2258. this.metadata = Object.create(null), void 0 !== e && (this.metadata[e] = Object.create(null), this.metadata[e][t] = r)
  2259. }, D.MatchData.prototype.combine = function(e) {
  2260. for (var t = Object.keys(e.metadata), n = 0; n < t.length; n++) {
  2261. var r = t[n],
  2262. i = Object.keys(e.metadata[r]);
  2263. null == this.metadata[r] && (this.metadata[r] = Object.create(null));
  2264. for (var o = 0; o < i.length; o++) {
  2265. var a = i[o],
  2266. s = Object.keys(e.metadata[r][a]);
  2267. null == this.metadata[r][a] && (this.metadata[r][a] = Object.create(null));
  2268. for (var c = 0; c < s.length; c++) {
  2269. var l = s[c];
  2270. null == this.metadata[r][a][l] ? this.metadata[r][a][l] = e.metadata[r][a][l] : this.metadata[r][a][l] = this.metadata[r][a][l].concat(e.metadata[r][a][l])
  2271. }
  2272. }
  2273. }
  2274. }, D.MatchData.prototype.add = function(e, t, n) {
  2275. if (!(e in this.metadata)) return this.metadata[e] = Object.create(null), void(this.metadata[e][t] = n);
  2276. if (t in this.metadata[e])
  2277. for (var r = Object.keys(n), i = 0; i < r.length; i++) {
  2278. var o = r[i];
  2279. o in this.metadata[e][t] ? this.metadata[e][t][o] = this.metadata[e][t][o].concat(n[o]) : this.metadata[e][t][o] = n[o]
  2280. } else this.metadata[e][t] = n
  2281. }, D.Query = function(e) {
  2282. this.clauses = [], this.allFields = e
  2283. }, D.Query.wildcard = new String("*"), D.Query.wildcard.NONE = 0, D.Query.wildcard.LEADING = 1, D.Query.wildcard.TRAILING = 2, D.Query.presence = {
  2284. OPTIONAL: 1,
  2285. REQUIRED: 2,
  2286. PROHIBITED: 3
  2287. }, D.Query.prototype.clause = function(e) {
  2288. return "fields" in e || (e.fields = this.allFields), "boost" in e || (e.boost = 1), "usePipeline" in e || (e.usePipeline = !0), "wildcard" in e || (e.wildcard = D.Query.wildcard.NONE), e.wildcard & D.Query.wildcard.LEADING && e.term.charAt(0) != D.Query.wildcard && (e.term = "*" + e.term), e.wildcard & D.Query.wildcard.TRAILING && e.term.slice(-1) != D.Query.wildcard && (e.term = e.term + "*"), "presence" in e || (e.presence = D.Query.presence.OPTIONAL), this.clauses.push(e), this
  2289. }, D.Query.prototype.isNegated = function() {
  2290. for (var e = 0; e < this.clauses.length; e++)
  2291. if (this.clauses[e].presence != D.Query.presence.PROHIBITED) return !1;
  2292. return !0
  2293. }, D.Query.prototype.term = function(e, t) {
  2294. if (Array.isArray(e)) return e.forEach(function(e) {
  2295. this.term(e, D.utils.clone(t))
  2296. }, this), this;
  2297. var n = t || {};
  2298. return n.term = e.toString(), this.clause(n), this
  2299. }, D.QueryParseError = function(e, t, n) {
  2300. this.name = "QueryParseError", this.message = e, this.start = t, this.end = n
  2301. }, D.QueryParseError.prototype = new Error, D.QueryLexer = function(e) {
  2302. this.lexemes = [], this.str = e, this.length = e.length, this.pos = 0, this.start = 0, this.escapeCharPositions = []
  2303. }, D.QueryLexer.prototype.run = function() {
  2304. for (var e = D.QueryLexer.lexText; e;) e = e(this)
  2305. }, D.QueryLexer.prototype.sliceString = function() {
  2306. for (var e = [], t = this.start, n = this.pos, r = 0; r < this.escapeCharPositions.length; r++) n = this.escapeCharPositions[r], e.push(this.str.slice(t, n)), t = n + 1;
  2307. return e.push(this.str.slice(t, this.pos)), this.escapeCharPositions.length = 0, e.join("")
  2308. }, D.QueryLexer.prototype.emit = function(e) {
  2309. this.lexemes.push({
  2310. type: e,
  2311. str: this.sliceString(),
  2312. start: this.start,
  2313. end: this.pos
  2314. }), this.start = this.pos
  2315. }, D.QueryLexer.prototype.escapeCharacter = function() {
  2316. this.escapeCharPositions.push(this.pos - 1), this.pos += 1
  2317. }, D.QueryLexer.prototype.next = function() {
  2318. if (this.pos >= this.length) return D.QueryLexer.EOS;
  2319. var e = this.str.charAt(this.pos);
  2320. return this.pos += 1, e
  2321. }, D.QueryLexer.prototype.width = function() {
  2322. return this.pos - this.start
  2323. }, D.QueryLexer.prototype.ignore = function() {
  2324. this.start == this.pos && (this.pos += 1), this.start = this.pos
  2325. }, D.QueryLexer.prototype.backup = function() {
  2326. this.pos -= 1
  2327. }, D.QueryLexer.prototype.acceptDigitRun = function() {
  2328. for (var e, t; 47 < (t = (e = this.next()).charCodeAt(0)) && t < 58;);
  2329. e != D.QueryLexer.EOS && this.backup()
  2330. }, D.QueryLexer.prototype.more = function() {
  2331. return this.pos < this.length
  2332. }, D.QueryLexer.EOS = "EOS", D.QueryLexer.FIELD = "FIELD", D.QueryLexer.TERM = "TERM", D.QueryLexer.EDIT_DISTANCE = "EDIT_DISTANCE", D.QueryLexer.BOOST = "BOOST", D.QueryLexer.PRESENCE = "PRESENCE", D.QueryLexer.lexField = function(e) {
  2333. return e.backup(), e.emit(D.QueryLexer.FIELD), e.ignore(), D.QueryLexer.lexText
  2334. }, D.QueryLexer.lexTerm = function(e) {
  2335. if (1 < e.width() && (e.backup(), e.emit(D.QueryLexer.TERM)), e.ignore(), e.more()) return D.QueryLexer.lexText
  2336. }, D.QueryLexer.lexEditDistance = function(e) {
  2337. return e.ignore(), e.acceptDigitRun(), e.emit(D.QueryLexer.EDIT_DISTANCE), D.QueryLexer.lexText
  2338. }, D.QueryLexer.lexBoost = function(e) {
  2339. return e.ignore(), e.acceptDigitRun(), e.emit(D.QueryLexer.BOOST), D.QueryLexer.lexText
  2340. }, D.QueryLexer.lexEOS = function(e) {
  2341. 0 < e.width() && e.emit(D.QueryLexer.TERM)
  2342. }, D.QueryLexer.termSeparator = D.tokenizer.separator, D.QueryLexer.lexText = function(e) {
  2343. for (;;) {
  2344. var t = e.next();
  2345. if (t == D.QueryLexer.EOS) return D.QueryLexer.lexEOS;
  2346. if (92 != t.charCodeAt(0)) {
  2347. if (":" == t) return D.QueryLexer.lexField;
  2348. if ("~" == t) return e.backup(), 0 < e.width() && e.emit(D.QueryLexer.TERM), D.QueryLexer.lexEditDistance;
  2349. if ("^" == t) return e.backup(), 0 < e.width() && e.emit(D.QueryLexer.TERM), D.QueryLexer.lexBoost;
  2350. if ("+" == t && 1 === e.width()) return e.emit(D.QueryLexer.PRESENCE), D.QueryLexer.lexText;
  2351. if ("-" == t && 1 === e.width()) return e.emit(D.QueryLexer.PRESENCE), D.QueryLexer.lexText;
  2352. if (t.match(D.QueryLexer.termSeparator)) return D.QueryLexer.lexTerm
  2353. } else e.escapeCharacter()
  2354. }
  2355. }, D.QueryParser = function(e, t) {
  2356. this.lexer = new D.QueryLexer(e), this.query = t, this.currentClause = {}, this.lexemeIdx = 0
  2357. }, D.QueryParser.prototype.parse = function() {
  2358. this.lexer.run(), this.lexemes = this.lexer.lexemes;
  2359. for (var e = D.QueryParser.parseClause; e;) e = e(this);
  2360. return this.query
  2361. }, D.QueryParser.prototype.peekLexeme = function() {
  2362. return this.lexemes[this.lexemeIdx]
  2363. }, D.QueryParser.prototype.consumeLexeme = function() {
  2364. var e = this.peekLexeme();
  2365. return this.lexemeIdx += 1, e
  2366. }, D.QueryParser.prototype.nextClause = function() {
  2367. var e = this.currentClause;
  2368. this.query.clause(e), this.currentClause = {}
  2369. }, D.QueryParser.parseClause = function(e) {
  2370. var t = e.peekLexeme();
  2371. if (null != t) switch (t.type) {
  2372. case D.QueryLexer.PRESENCE:
  2373. return D.QueryParser.parsePresence;
  2374. case D.QueryLexer.FIELD:
  2375. return D.QueryParser.parseField;
  2376. case D.QueryLexer.TERM:
  2377. return D.QueryParser.parseTerm;
  2378. default:
  2379. var n = "expected either a field or a term, found " + t.type;
  2380. throw 1 <= t.str.length && (n += " with value '" + t.str + "'"), new D.QueryParseError(n, t.start, t.end)
  2381. }
  2382. }, D.QueryParser.parsePresence = function(e) {
  2383. var t = e.consumeLexeme();
  2384. if (null != t) {
  2385. switch (t.str) {
  2386. case "-":
  2387. e.currentClause.presence = D.Query.presence.PROHIBITED;
  2388. break;
  2389. case "+":
  2390. e.currentClause.presence = D.Query.presence.REQUIRED;
  2391. break;
  2392. default:
  2393. var n = "unrecognised presence operator'" + t.str + "'";
  2394. throw new D.QueryParseError(n, t.start, t.end)
  2395. }
  2396. var r = e.peekLexeme();
  2397. if (null == r) {
  2398. n = "expecting term or field, found nothing";
  2399. throw new D.QueryParseError(n, t.start, t.end)
  2400. }
  2401. switch (r.type) {
  2402. case D.QueryLexer.FIELD:
  2403. return D.QueryParser.parseField;
  2404. case D.QueryLexer.TERM:
  2405. return D.QueryParser.parseTerm;
  2406. default:
  2407. n = "expecting term or field, found '" + r.type + "'";
  2408. throw new D.QueryParseError(n, r.start, r.end)
  2409. }
  2410. }
  2411. }, D.QueryParser.parseField = function(e) {
  2412. var t = e.consumeLexeme();
  2413. if (null != t) {
  2414. if (-1 == e.query.allFields.indexOf(t.str)) {
  2415. var n = e.query.allFields.map(function(e) {
  2416. return "'" + e + "'"
  2417. }).join(", "),
  2418. r = "unrecognised field '" + t.str + "', possible fields: " + n;
  2419. throw new D.QueryParseError(r, t.start, t.end)
  2420. }
  2421. e.currentClause.fields = [t.str];
  2422. var i = e.peekLexeme();
  2423. if (null == i) {
  2424. r = "expecting term, found nothing";
  2425. throw new D.QueryParseError(r, t.start, t.end)
  2426. }
  2427. switch (i.type) {
  2428. case D.QueryLexer.TERM:
  2429. return D.QueryParser.parseTerm;
  2430. default:
  2431. r = "expecting term, found '" + i.type + "'";
  2432. throw new D.QueryParseError(r, i.start, i.end)
  2433. }
  2434. }
  2435. }, D.QueryParser.parseTerm = function(e) {
  2436. var t = e.consumeLexeme();
  2437. if (null != t) {
  2438. e.currentClause.term = t.str.toLowerCase(), -1 != t.str.indexOf("*") && (e.currentClause.usePipeline = !1);
  2439. var n = e.peekLexeme();
  2440. if (null != n) switch (n.type) {
  2441. case D.QueryLexer.TERM:
  2442. return e.nextClause(), D.QueryParser.parseTerm;
  2443. case D.QueryLexer.FIELD:
  2444. return e.nextClause(), D.QueryParser.parseField;
  2445. case D.QueryLexer.EDIT_DISTANCE:
  2446. return D.QueryParser.parseEditDistance;
  2447. case D.QueryLexer.BOOST:
  2448. return D.QueryParser.parseBoost;
  2449. case D.QueryLexer.PRESENCE:
  2450. return e.nextClause(), D.QueryParser.parsePresence;
  2451. default:
  2452. var r = "Unexpected lexeme type '" + n.type + "'";
  2453. throw new D.QueryParseError(r, n.start, n.end)
  2454. } else e.nextClause()
  2455. }
  2456. }, D.QueryParser.parseEditDistance = function(e) {
  2457. var t = e.consumeLexeme();
  2458. if (null != t) {
  2459. var n = parseInt(t.str, 10);
  2460. if (isNaN(n)) {
  2461. var r = "edit distance must be numeric";
  2462. throw new D.QueryParseError(r, t.start, t.end)
  2463. }
  2464. e.currentClause.editDistance = n;
  2465. var i = e.peekLexeme();
  2466. if (null != i) switch (i.type) {
  2467. case D.QueryLexer.TERM:
  2468. return e.nextClause(), D.QueryParser.parseTerm;
  2469. case D.QueryLexer.FIELD:
  2470. return e.nextClause(), D.QueryParser.parseField;
  2471. case D.QueryLexer.EDIT_DISTANCE:
  2472. return D.QueryParser.parseEditDistance;
  2473. case D.QueryLexer.BOOST:
  2474. return D.QueryParser.parseBoost;
  2475. case D.QueryLexer.PRESENCE:
  2476. return e.nextClause(), D.QueryParser.parsePresence;
  2477. default:
  2478. r = "Unexpected lexeme type '" + i.type + "'";
  2479. throw new D.QueryParseError(r, i.start, i.end)
  2480. } else e.nextClause()
  2481. }
  2482. }, D.QueryParser.parseBoost = function(e) {
  2483. var t = e.consumeLexeme();
  2484. if (null != t) {
  2485. var n = parseInt(t.str, 10);
  2486. if (isNaN(n)) {
  2487. var r = "boost must be numeric";
  2488. throw new D.QueryParseError(r, t.start, t.end)
  2489. }
  2490. e.currentClause.boost = n;
  2491. var i = e.peekLexeme();
  2492. if (null != i) switch (i.type) {
  2493. case D.QueryLexer.TERM:
  2494. return e.nextClause(), D.QueryParser.parseTerm;
  2495. case D.QueryLexer.FIELD:
  2496. return e.nextClause(), D.QueryParser.parseField;
  2497. case D.QueryLexer.EDIT_DISTANCE:
  2498. return D.QueryParser.parseEditDistance;
  2499. case D.QueryLexer.BOOST:
  2500. return D.QueryParser.parseBoost;
  2501. case D.QueryLexer.PRESENCE:
  2502. return e.nextClause(), D.QueryParser.parsePresence;
  2503. default:
  2504. r = "Unexpected lexeme type '" + i.type + "'";
  2505. throw new D.QueryParseError(r, i.start, i.end)
  2506. } else e.nextClause()
  2507. }
  2508. }, void 0 === (c = "function" == typeof(s = function() {
  2509. return D
  2510. }) ? s.call(o, a, o, i) : s) || (i.exports = c)
  2511. }()
  2512. }]));