mirror of
https://github.com/plausible/analytics.git
synced 2024-12-25 10:33:01 +03:00
57 lines
59 KiB
JavaScript
57 lines
59 KiB
JavaScript
(()=>{var An=Object.create;var et=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var Nn=Object.getOwnPropertyNames;var Hn=Object.getPrototypeOf,Dn=Object.prototype.hasOwnProperty;var tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fn=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Nn(t))!Dn.call(e,r)&&r!==n&&et(e,r,{get:()=>t[r],enumerable:!(i=Qn(t,r))||i.enumerable});return e};var nt=(e,t,n)=>(n=e!=null?An(Hn(e)):{},Fn(t||!e||!e.__esModule?et(n,"default",{value:e,enumerable:!0}):n,e));var gt=tt((ms,mt)=>{var pt="Expected a function",ft=NaN,Gn="[object Symbol]",Kn=/^\s+|\s+$/g,Yn=/^[-+]0x[0-9a-f]+$/i,Jn=/^0b[01]+$/i,Xn=/^0o[0-7]+$/i,Zn=parseInt,ei=typeof global=="object"&&global&&global.Object===Object&&global,ti=typeof self=="object"&&self&&self.Object===Object&&self,ni=ei||ti||Function("return this")(),ii=Object.prototype,ri=ii.toString,si=Math.max,oi=Math.min,Oe=function(){return ni.Date.now()};function ai(e,t,n){var i,r,s,o,a,u,l=0,f=!1,y=!1,g=!0;if(typeof e!="function")throw new TypeError(pt);t=ht(t)||0,pe(n)&&(f=!!n.leading,y="maxWait"in n,s=y?si(ht(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g);function L(x){var C=i,H=r;return i=r=void 0,l=x,o=e.apply(H,C),o}function S(x){return l=x,a=setTimeout(p,t),f?L(x):o}function T(x){var C=x-u,H=x-l,z=t-C;return y?oi(z,s-H):z}function m(x){var C=x-u,H=x-l;return u===void 0||C>=t||C<0||y&&H>=s}function p(){var x=Oe();if(m(x))return _(x);a=setTimeout(p,T(x))}function _(x){return a=void 0,g&&i?L(x):(i=r=void 0,o)}function w(){a!==void 0&&clearTimeout(a),l=0,i=u=r=a=void 0}function Q(){return a===void 0?o:_(Oe())}function N(){var x=Oe(),C=m(x);if(i=arguments,r=this,u=x,C){if(a===void 0)return S(u);if(y)return a=setTimeout(p,t),L(u)}return a===void 0&&(a=setTimeout(p,t)),o}return N.cancel=w,N.flush=Q,N}function ci(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(pt);return pe(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),ai(e,t,{leading:i,maxWait:t,trailing:r})}function pe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function li(e){return!!e&&typeof e=="object"}function ui(e){return typeof e=="symbol"||li(e)&&ri.call(e)==Gn}function ht(e){if(typeof e=="number")return e;if(ui(e))return ft;if(pe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=pe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Kn,"");var n=Jn.test(e);return n||Xn.test(e)?Zn(e.slice(2),n?2:8):Yn.test(e)?ft:+e}mt.exports=ci});var $t=tt((Vt,zt)=>{(function(){var e=function(t){var n=new e.Builder;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),n.searchPipeline.add(e.stemmer),t.call(n,n),n.build()};e.version="2.3.9";e.utils={},e.utils.warn=function(t){return function(n){t.console&&console.warn&&console.warn(n)}}(this),e.utils.asString=function(t){return t==null?"":t.toString()},e.utils.clone=function(t){if(t==null)return t;for(var n=Object.create(null),i=Object.keys(t),r=0;r<i.length;r++){var s=i[r],o=t[s];if(Array.isArray(o)){n[s]=o.slice();continue}if(typeof o=="string"||typeof o=="number"||typeof o=="boolean"){n[s]=o;continue}throw new TypeError("clone is not deep and does not support nested objects")}return n},e.FieldRef=function(t,n,i){this.docRef=t,this.fieldName=n,this._stringValue=i},e.FieldRef.joiner="/",e.FieldRef.fromString=function(t){var n=t.indexOf(e.FieldRef.joiner);if(n===-1)throw"malformed field ref string";var i=t.slice(0,n),r=t.slice(n+1);return new e.FieldRef(r,i,t)},e.FieldRef.prototype.toString=function(){return this._stringValue==null&&(this._stringValue=this.fieldName+e.FieldRef.joiner+this.docRef),this._stringValue};e.Set=function(t){if(this.elements=Object.create(null),t){this.length=t.length;for(var n=0;n<this.length;n++)this.elements[t[n]]=!0}else this.length=0},e.Set.complete={intersect:function(t){return t},union:function(){return this},contains:function(){return!0}},e.Set.empty={intersect:function(){return this},union:function(t){return t},contains:function(){return!1}},e.Set.prototype.contains=function(t){return!!this.elements[t]},e.Set.prototype.intersect=function(t){var n,i,r,s=[];if(t===e.Set.complete)return this;if(t===e.Set.empty)return t;this.length<t.length?(n=this,i=t):(n=t,i=this),r=Object.keys(n.elements);for(var o=0;o<r.length;o++){var a=r[o];a in i.elements&&s.push(a)}return new e.Set(s)},e.Set.prototype.union=function(t){return t===e.Set.complete?e.Set.complete:t===e.Set.empty?this:new e.Set(Object.keys(this.elements).concat(Object.keys(t.elements)))},e.idf=function(t,n){var i=0;for(var r in t)r!="_index"&&(i+=Object.keys(t[r]).length);var s=(n-i+.5)/(i+.5);return Math.log(1+Math.abs(s))},e.Token=function(t,n){this.str=t||"",this.metadata=n||{}},e.Token.prototype.toString=function(){return this.str},e.Token.prototype.update=function(t){return this.str=t(this.str,this.metadata),this},e.Token.prototype.clone=function(t){return t=t||function(n){return n},new e.Token(t(this.str,this.metadata),this.metadata)};e.tokenizer=function(t,n){if(t==null||t==null)return[];if(Array.isArray(t))return t.map(function(y){return new e.Token(e.utils.asString(y).toLowerCase(),e.utils.clone(n))});for(var i=t.toString().toLowerCase(),r=i.length,s=[],o=0,a=0;o<=r;o++){var u=i.charAt(o),l=o-a;if(u.match(e.tokenizer.separator)||o==r){if(l>0){var f=e.utils.clone(n)||{};f.position=[a,l],f.index=s.length,s.push(new e.Token(i.slice(a,o),f))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/;e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index.
|
|
`,t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(i){var r=e.Pipeline.registeredFunctions[i];if(r)n.add(r);else throw new Error("Cannot load unregistered function: "+i)}),n},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(n){e.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i=i+1,this._stack.splice(i,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},e.Pipeline.prototype.remove=function(t){var n=this._stack.indexOf(t);n!=-1&&this._stack.splice(n,1)},e.Pipeline.prototype.run=function(t){for(var n=this._stack.length,i=0;i<n;i++){for(var r=this._stack[i],s=[],o=0;o<t.length;o++){var a=r(t[o],o,t);if(!(a==null||a===""))if(Array.isArray(a))for(var u=0;u<a.length;u++)s.push(a[u]);else s.push(a)}t=s}return t},e.Pipeline.prototype.runString=function(t,n){var i=new e.Token(t,n);return this.run([i]).map(function(r){return r.toString()})},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return e.Pipeline.warnIfFunctionNotRegistered(t),t.label})};e.Vector=function(t){this._magnitude=0,this.elements=t||[]},e.Vector.prototype.positionForIndex=function(t){if(this.elements.length==0)return 0;for(var n=0,i=this.elements.length/2,r=i-n,s=Math.floor(r/2),o=this.elements[s*2];r>1&&(o<t&&(n=s),o>t&&(i=s),o!=t);)r=i-n,s=n+Math.floor(r/2),o=this.elements[s*2];if(o==t||o>t)return s*2;if(o<t)return(s+1)*2},e.Vector.prototype.insert=function(t,n){this.upsert(t,n,function(){throw"duplicate index"})},e.Vector.prototype.upsert=function(t,n,i){this._magnitude=0;var r=this.positionForIndex(t);this.elements[r]==t?this.elements[r+1]=i(this.elements[r+1],n):this.elements.splice(r,0,t,n)},e.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var t=0,n=this.elements.length,i=1;i<n;i+=2){var r=this.elements[i];t+=r*r}return this._magnitude=Math.sqrt(t)},e.Vector.prototype.dot=function(t){for(var n=0,i=this.elements,r=t.elements,s=i.length,o=r.length,a=0,u=0,l=0,f=0;l<s&&f<o;)a=i[l],u=r[f],a<u?l+=2:a>u?f+=2:a==u&&(n+=i[l+1]*r[f+1],l+=2,f+=2);return n},e.Vector.prototype.similarity=function(t){return this.dot(t)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var t=new Array(this.elements.length/2),n=1,i=0;n<this.elements.length;n+=2,i++)t[i]=this.elements[n];return t},e.Vector.prototype.toJSON=function(){return this.elements};e.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},i="[^aeiou]",r="[aeiouy]",s=i+"[^aeiouy]*",o=r+"[aeiou]*",a="^("+s+")?"+o+s,u="^("+s+")?"+o+s+"("+o+")?$",l="^("+s+")?"+o+s+o+s,f="^("+s+")?"+r,y=new RegExp(a),g=new RegExp(l),L=new RegExp(u),S=new RegExp(f),T=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,p=/^(.+?)eed$/,_=/^(.+?)(ed|ing)$/,w=/.$/,Q=/(at|bl|iz)$/,N=new RegExp("([^aeiouylsz])\\1$"),x=new RegExp("^"+s+r+"[^aeiouwxy]$"),C=/^(.+?[^aeiou])y$/,H=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,z=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,ne=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,ce=/^(.+?)(s|t)(ion)$/,$=/^(.+?)e$/,le=/ll$/,ue=new RegExp("^"+s+r+"[^aeiouwxy]$"),ie=function(d){var v,j,A,h,E,U,G;if(d.length<3)return d;if(A=d.substr(0,1),A=="y"&&(d=A.toUpperCase()+d.substr(1)),h=T,E=m,h.test(d)?d=d.replace(h,"$1$2"):E.test(d)&&(d=d.replace(E,"$1$2")),h=p,E=_,h.test(d)){var b=h.exec(d);h=y,h.test(b[1])&&(h=w,d=d.replace(h,""))}else if(E.test(d)){var b=E.exec(d);v=b[1],E=S,E.test(v)&&(d=v,E=Q,U=N,G=x,E.test(d)?d=d+"e":U.test(d)?(h=w,d=d.replace(h,"")):G.test(d)&&(d=d+"e"))}if(h=C,h.test(d)){var b=h.exec(d);v=b[1],d=v+"i"}if(h=H,h.test(d)){var b=h.exec(d);v=b[1],j=b[2],h=y,h.test(v)&&(d=v+t[j])}if(h=z,h.test(d)){var b=h.exec(d);v=b[1],j=b[2],h=y,h.test(v)&&(d=v+n[j])}if(h=ne,E=ce,h.test(d)){var b=h.exec(d);v=b[1],h=g,h.test(v)&&(d=v)}else if(E.test(d)){var b=E.exec(d);v=b[1]+b[2],E=g,E.test(v)&&(d=v)}if(h=$,h.test(d)){var b=h.exec(d);v=b[1],h=g,E=L,U=ue,(h.test(v)||E.test(v)&&!U.test(v))&&(d=v)}return h=le,E=g,h.test(d)&&E.test(d)&&(h=w,d=d.replace(h,"")),A=="y"&&(d=A.toLowerCase()+d.substr(1)),d};return function(W){return W.update(ie)}}(),e.Pipeline.registerFunction(e.stemmer,"stemmer");e.generateStopWordFilter=function(t){var n=t.reduce(function(i,r){return i[r]=r,i},{});return function(i){if(i&&n[i.toString()]!==i.toString())return i}},e.stopWordFilter=e.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"]),e.Pipeline.registerFunction(e.stopWordFilter,"stopWordFilter");e.trimmer=function(t){return t.update(function(n){return n.replace(/^\W+/,"").replace(/\W+$/,"")})},e.Pipeline.registerFunction(e.trimmer,"trimmer");e.TokenSet=function(){this.final=!1,this.edges={},this.id=e.TokenSet._nextId,e.TokenSet._nextId+=1},e.TokenSet._nextId=1,e.TokenSet.fromArray=function(t){for(var n=new e.TokenSet.Builder,i=0,r=t.length;i<r;i++)n.insert(t[i]);return n.finish(),n.root},e.TokenSet.fromClause=function(t){return"editDistance"in t?e.TokenSet.fromFuzzyString(t.term,t.editDistance):e.TokenSet.fromString(t.term)},e.TokenSet.fromFuzzyString=function(t,n){for(var i=new e.TokenSet,r=[{node:i,editsRemaining:n,str:t}];r.length;){var s=r.pop();if(s.str.length>0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new e.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),r.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(s.str.length==0&&(u.final=!0),r.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&r.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),r.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var f=s.str.charAt(0),y=s.str.charAt(1),g;y in s.node.edges?g=s.node.edges[y]:(g=new e.TokenSet,s.node.edges[y]=g),s.str.length==1&&(g.final=!0),r.push({node:g,editsRemaining:s.editsRemaining-1,str:f+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,i=n,r=0,s=t.length;r<s;r++){var o=t[r],a=r==s-1;if(o=="*")n.edges[o]=n,n.final=a;else{var u=new e.TokenSet;u.final=a,n.edges[o]=u,n=u}}return i},e.TokenSet.prototype.toArray=function(){for(var t=[],n=[{prefix:"",node:this}];n.length;){var i=n.pop(),r=Object.keys(i.node.edges),s=r.length;i.node.final&&(i.prefix.charAt(0),t.push(i.prefix));for(var o=0;o<s;o++){var a=r[o];n.push({prefix:i.prefix.concat(a),node:i.node.edges[a]})}}return t},e.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var t=this.final?"1":"0",n=Object.keys(this.edges).sort(),i=n.length,r=0;r<i;r++){var s=n[r],o=this.edges[s];t=t+s+o.id}return t},e.TokenSet.prototype.intersect=function(t){for(var n=new e.TokenSet,i=void 0,r=[{qNode:t,output:n,node:this}];r.length;){i=r.pop();for(var s=Object.keys(i.qNode.edges),o=s.length,a=Object.keys(i.node.edges),u=a.length,l=0;l<o;l++)for(var f=s[l],y=0;y<u;y++){var g=a[y];if(g==f||f=="*"){var L=i.node.edges[g],S=i.qNode.edges[f],T=L.final&&S.final,m=void 0;g in i.output.edges?(m=i.output.edges[g],m.final=m.final||T):(m=new e.TokenSet,m.final=T,i.output.edges[g]=m),r.push({qNode:S,output:m,node:L})}}}return n},e.TokenSet.Builder=function(){this.previousWord="",this.root=new e.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},e.TokenSet.Builder.prototype.insert=function(t){var n,i=0;if(t<this.previousWord)throw new Error("Out of order word insertion");for(var r=0;r<t.length&&r<this.previousWord.length&&t[r]==this.previousWord[r];r++)i++;this.minimize(i),this.uncheckedNodes.length==0?n=this.root:n=this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(var r=i;r<t.length;r++){var s=new e.TokenSet,o=t[r];n.edges[o]=s,this.uncheckedNodes.push({parent:n,char:o,child:s}),n=s}n.final=!0,this.previousWord=t},e.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},e.TokenSet.Builder.prototype.minimize=function(t){for(var n=this.uncheckedNodes.length-1;n>=t;n--){var i=this.uncheckedNodes[n],r=i.child.toString();r in this.minimizedNodes?i.parent.edges[i.char]=this.minimizedNodes[r]:(i.child._str=r,this.minimizedNodes[r]=i.child),this.uncheckedNodes.pop()}};e.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},e.Index.prototype.search=function(t){return this.query(function(n){var i=new e.QueryParser(t,n);i.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),i=Object.create(null),r=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u<this.fields.length;u++)r[this.fields[u]]=new e.Vector;t.call(n,n);for(var u=0;u<n.clauses.length;u++){var l=n.clauses[u],f=null,y=e.Set.empty;l.usePipeline?f=this.pipeline.runString(l.term,{fields:l.fields}):f=[l.term];for(var g=0;g<f.length;g++){var L=f[g];l.term=L;var S=e.TokenSet.fromClause(l),T=this.tokenSet.intersect(S).toArray();if(T.length===0&&l.presence===e.Query.presence.REQUIRED){for(var m=0;m<l.fields.length;m++){var p=l.fields[m];o[p]=e.Set.empty}break}for(var _=0;_<T.length;_++)for(var w=T[_],Q=this.invertedIndex[w],N=Q._index,m=0;m<l.fields.length;m++){var p=l.fields[m],x=Q[p],C=Object.keys(x),H=w+"/"+p,z=new e.Set(C);if(l.presence==e.Query.presence.REQUIRED&&(y=y.union(z),o[p]===void 0&&(o[p]=e.Set.complete)),l.presence==e.Query.presence.PROHIBITED){a[p]===void 0&&(a[p]=e.Set.empty),a[p]=a[p].union(z);continue}if(r[p].upsert(N,l.boost,function(Pn,Rn){return Pn+Rn}),!s[H]){for(var ne=0;ne<C.length;ne++){var ce=C[ne],$=new e.FieldRef(ce,p),le=x[ce],ue;(ue=i[$])===void 0?i[$]=new e.MatchData(w,p,le):ue.add(w,p,le)}s[H]=!0}}}if(l.presence===e.Query.presence.REQUIRED)for(var m=0;m<l.fields.length;m++){var p=l.fields[m];o[p]=o[p].intersect(y)}}for(var ie=e.Set.complete,W=e.Set.empty,u=0;u<this.fields.length;u++){var p=this.fields[u];o[p]&&(ie=ie.intersect(o[p])),a[p]&&(W=W.union(a[p]))}var d=Object.keys(i),v=[],j=Object.create(null);if(n.isNegated()){d=Object.keys(this.fieldVectors);for(var u=0;u<d.length;u++){var $=d[u],A=e.FieldRef.fromString($);i[$]=new e.MatchData}}for(var u=0;u<d.length;u++){var A=e.FieldRef.fromString(d[u]),h=A.docRef;if(ie.contains(h)&&!W.contains(h)){var E=this.fieldVectors[A],U=r[A.fieldName].similarity(E),G;if((G=j[h])!==void 0)G.score+=U,G.matchData.combine(i[A]);else{var b={ref:h,score:U,matchData:i[A]};j[h]=b,v.push(b)}}}return v.sort(function(In,Cn){return Cn.score-In.score})},e.Index.prototype.toJSON=function(){var t=Object.keys(this.invertedIndex).sort().map(function(i){return[i,this.invertedIndex[i]]},this),n=Object.keys(this.fieldVectors).map(function(i){return[i,this.fieldVectors[i].toJSON()]},this);return{version:e.version,fields:this.fields,fieldVectors:n,invertedIndex:t,pipeline:this.pipeline.toJSON()}},e.Index.load=function(t){var n={},i={},r=t.fieldVectors,s=Object.create(null),o=t.invertedIndex,a=new e.TokenSet.Builder,u=e.Pipeline.load(t.pipeline);t.version!=e.version&&e.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+e.version+"' does not match serialized index '"+t.version+"'");for(var l=0;l<r.length;l++){var f=r[l],y=f[0],g=f[1];i[y]=new e.Vector(g)}for(var l=0;l<o.length;l++){var f=o[l],L=f[0],S=f[1];a.insert(L),s[L]=S}return a.finish(),n.fields=t.fields,n.fieldVectors=i,n.invertedIndex=s,n.tokenSet=a.root,n.pipeline=u,new e.Index(n)};e.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=e.tokenizer,this.pipeline=new e.Pipeline,this.searchPipeline=new e.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},e.Builder.prototype.ref=function(t){this._ref=t},e.Builder.prototype.field=function(t,n){if(/\//.test(t))throw new RangeError("Field '"+t+"' contains illegal character '/'");this._fields[t]=n||{}},e.Builder.prototype.b=function(t){t<0?this._b=0:t>1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var i=t[this._ref],r=Object.keys(this._fields);this._documents[i]=n||{},this.documentCount+=1;for(var s=0;s<r.length;s++){var o=r[s],a=this._fields[o].extractor,u=a?a(t):t[o],l=this.tokenizer(u,{fields:[o]}),f=this.pipeline.run(l),y=new e.FieldRef(i,o),g=Object.create(null);this.fieldTermFrequencies[y]=g,this.fieldLengths[y]=0,this.fieldLengths[y]+=f.length;for(var L=0;L<f.length;L++){var S=f[L];if(g[S]==null&&(g[S]=0),g[S]+=1,this.invertedIndex[S]==null){var T=Object.create(null);T._index=this.termIndex,this.termIndex+=1;for(var m=0;m<r.length;m++)T[r[m]]=Object.create(null);this.invertedIndex[S]=T}this.invertedIndex[S][o][i]==null&&(this.invertedIndex[S][o][i]=Object.create(null));for(var p=0;p<this.metadataWhitelist.length;p++){var _=this.metadataWhitelist[p],w=S.metadata[_];this.invertedIndex[S][o][i][_]==null&&(this.invertedIndex[S][o][i][_]=[]),this.invertedIndex[S][o][i][_].push(w)}}}},e.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),n=t.length,i={},r={},s=0;s<n;s++){var o=e.FieldRef.fromString(t[s]),a=o.fieldName;r[a]||(r[a]=0),r[a]+=1,i[a]||(i[a]=0),i[a]+=this.fieldLengths[o]}for(var u=Object.keys(this._fields),s=0;s<u.length;s++){var l=u[s];i[l]=i[l]/r[l]}this.averageFieldLength=i},e.Builder.prototype.createFieldVectors=function(){for(var t={},n=Object.keys(this.fieldTermFrequencies),i=n.length,r=Object.create(null),s=0;s<i;s++){for(var o=e.FieldRef.fromString(n[s]),a=o.fieldName,u=this.fieldLengths[o],l=new e.Vector,f=this.fieldTermFrequencies[o],y=Object.keys(f),g=y.length,L=this._fields[a].boost||1,S=this._documents[o.docRef].boost||1,T=0;T<g;T++){var m=y[T],p=f[m],_=this.invertedIndex[m]._index,w,Q,N;r[m]===void 0?(w=e.idf(this.invertedIndex[m],this.documentCount),r[m]=w):w=r[m],Q=w*((this._k1+1)*p)/(this._k1*(1-this._b+this._b*(u/this.averageFieldLength[a]))+p),Q*=L,Q*=S,N=Math.round(Q*1e3)/1e3,l.insert(_,N)}t[o]=l}this.fieldVectors=t},e.Builder.prototype.createTokenSet=function(){this.tokenSet=e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},e.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new e.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},e.Builder.prototype.use=function(t){var n=Array.prototype.slice.call(arguments,1);n.unshift(this),t.apply(this,n)},e.MatchData=function(t,n,i){for(var r=Object.create(null),s=Object.keys(i||{}),o=0;o<s.length;o++){var a=s[o];r[a]=i[a].slice()}this.metadata=Object.create(null),t!==void 0&&(this.metadata[t]=Object.create(null),this.metadata[t][n]=r)},e.MatchData.prototype.combine=function(t){for(var n=Object.keys(t.metadata),i=0;i<n.length;i++){var r=n[i],s=Object.keys(t.metadata[r]);this.metadata[r]==null&&(this.metadata[r]=Object.create(null));for(var o=0;o<s.length;o++){var a=s[o],u=Object.keys(t.metadata[r][a]);this.metadata[r][a]==null&&(this.metadata[r][a]=Object.create(null));for(var l=0;l<u.length;l++){var f=u[l];this.metadata[r][a][f]==null?this.metadata[r][a][f]=t.metadata[r][a][f]:this.metadata[r][a][f]=this.metadata[r][a][f].concat(t.metadata[r][a][f])}}}},e.MatchData.prototype.add=function(t,n,i){if(!(t in this.metadata)){this.metadata[t]=Object.create(null),this.metadata[t][n]=i;return}if(!(n in this.metadata[t])){this.metadata[t][n]=i;return}for(var r=Object.keys(i),s=0;s<r.length;s++){var o=r[s];o in this.metadata[t][n]?this.metadata[t][n][o]=this.metadata[t][n][o].concat(i[o]):this.metadata[t][n][o]=i[o]}},e.Query=function(t){this.clauses=[],this.allFields=t},e.Query.wildcard=new String("*"),e.Query.wildcard.NONE=0,e.Query.wildcard.LEADING=1,e.Query.wildcard.TRAILING=2,e.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},e.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=e.Query.wildcard.NONE),t.wildcard&e.Query.wildcard.LEADING&&t.term.charAt(0)!=e.Query.wildcard&&(t.term="*"+t.term),t.wildcard&e.Query.wildcard.TRAILING&&t.term.slice(-1)!=e.Query.wildcard&&(t.term=""+t.term+"*"),"presence"in t||(t.presence=e.Query.presence.OPTIONAL),this.clauses.push(t),this},e.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=e.Query.presence.PROHIBITED)return!1;return!0},e.Query.prototype.term=function(t,n){if(Array.isArray(t))return t.forEach(function(r){this.term(r,e.utils.clone(n))},this),this;var i=n||{};return i.term=t.toString(),this.clause(i),this},e.QueryParseError=function(t,n,i){this.name="QueryParseError",this.message=t,this.start=n,this.end=i},e.QueryParseError.prototype=new Error,e.QueryLexer=function(t){this.lexemes=[],this.str=t,this.length=t.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},e.QueryLexer.prototype.run=function(){for(var t=e.QueryLexer.lexText;t;)t=t(this)},e.QueryLexer.prototype.sliceString=function(){for(var t=[],n=this.start,i=this.pos,r=0;r<this.escapeCharPositions.length;r++)i=this.escapeCharPositions[r],t.push(this.str.slice(n,i)),n=i+1;return t.push(this.str.slice(n,this.pos)),this.escapeCharPositions.length=0,t.join("")},e.QueryLexer.prototype.emit=function(t){this.lexemes.push({type:t,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},e.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},e.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,n;do t=this.next(),n=t.charCodeAt(0);while(n>47&&n<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos<this.length},e.QueryLexer.EOS="EOS",e.QueryLexer.FIELD="FIELD",e.QueryLexer.TERM="TERM",e.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",e.QueryLexer.BOOST="BOOST",e.QueryLexer.PRESENCE="PRESENCE",e.QueryLexer.lexField=function(t){return t.backup(),t.emit(e.QueryLexer.FIELD),t.ignore(),e.QueryLexer.lexText},e.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var n=t.next();if(n==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){t.escapeCharacter();continue}if(n==":")return e.QueryLexer.lexField;if(n=="~")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if(n=="^")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if(n=="+"&&t.width()===1||n=="-"&&t.width()===1)return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(n.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}},e.QueryParser=function(t,n){this.lexer=new e.QueryLexer(t),this.query=n,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},e.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},e.QueryParser.parseClause=function(t){var n=t.peekLexeme();if(n!=null)switch(n.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(i+=" with value '"+n.str+"'"),new e.QueryParseError(i,n.start,n.end)}},e.QueryParser.parsePresence=function(t){var n=t.consumeLexeme();if(n!=null){switch(n.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(i,n.start,n.end)}var r=t.peekLexeme();if(r==null){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,n.start,n.end)}switch(r.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var i=t.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),r="unrecognised field '"+n.str+"', possible fields: "+i;throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.fields=[n.str];var s=t.peekLexeme();if(s==null){var r="expecting term, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term, found '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var n=t.consumeLexeme();if(n!=null){t.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(i==null){t.nextClause();return}switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var i=parseInt(n.str,10);if(isNaN(i)){var r="edit distance must be numeric";throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(s==null){t.nextClause();return}switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var i=parseInt(n.str,10);if(isNaN(i)){var r="boost must be numeric";throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(s==null){t.nextClause();return}switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},function(t,n){typeof define=="function"&&define.amd?define(n):typeof Vt=="object"?zt.exports=n():t.lunr=n()}(this,function(){return e})})()});Handlebars.registerHelper("groupChanged",function(e,t,n){let i=t||"";if(e.group!==i)return delete e.nestedContext,e.group=i,n.fn(this)});Handlebars.registerHelper("nestingChanged",function(e,t,n){if(t.nested_context&&t.nested_context!==e.nestedContext){if(e.nestedContext=t.nested_context,e.lastModuleSeenInGroup!==t.nested_context)return n.fn(this)}else e.lastModuleSeenInGroup=t.title});Handlebars.registerHelper("showSections",function(e,t){if(e.sections.length>0)return t.fn(this)});Handlebars.registerHelper("showSummary",function(e,t){if(e.nodeGroups)return t.fn(this)});Handlebars.registerHelper("isArray",function(e,t){return Array.isArray(e)?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isNonEmptyArray",function(e,t){return Array.isArray(e)&&e.length>0?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isEmptyArray",function(e,t){return Array.isArray(e)&&e.length===0?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isLocal",function(e,t){let n=window.location.pathname.split("/").pop();return e+".html"===n?t.fn(this):t.inverse(this)});var c=document.querySelector.bind(document),k=document.querySelectorAll.bind(document);function it(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function de(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function re(){return document.body.dataset.type}function rt(e,t){if(e){for(let n of e){let i=n.nodeGroups&&n.nodeGroups.find(r=>r.nodes.some(s=>s.anchor===t));if(i)return i.key}return null}}function fe(){return window.location.hash.replace(/^#/,"")}function st(e){return new URLSearchParams(window.location.search).get(e)}function ot(e){return fetch(e).then(t=>t.ok).catch(()=>!1)}function at(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}function K(e){return!e||e.trim()===""}function ct(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{n=null,e(...r)},t)}}function he(){return document.head.querySelector("meta[name=project][content]").content}var lt="ex_doc:settings",Mn={tooltips:!0,theme:null,livebookUrl:null},_e=class{constructor(){this._subscribers=[],this._settings=Mn,this._loadSettings()}get(){return this._settings}update(t){let n=this._settings;this._settings={...this._settings,...t},this._subscribers.forEach(i=>i(this._settings,n)),this._storeSettings()}getAndSubscribe(t){this._subscribers.push(t),t(this._settings)}_loadSettings(){try{let t=localStorage.getItem(lt);if(t){let n=JSON.parse(t);this._settings={...this._settings,...n}}this._loadSettingsLegacy()}catch(t){console.error(`Failed to load settings: ${t}`)}}_storeSettings(){try{this._storeSettingsLegacy(),localStorage.setItem(lt,JSON.stringify(this._settings))}catch(t){console.error(`Failed to persist settings: ${t}`)}}_loadSettingsLegacy(){localStorage.getItem("tooltipsDisabled")!==null&&(this._settings={...this._settings,tooltips:!1}),localStorage.getItem("night-mode")==="true"&&(this._settings={...this._settings,nightMode:!0}),this._settings.nightMode===!0&&(this._settings={...this._settings,theme:"dark"})}_storeSettingsLegacy(){this._settings.tooltips?localStorage.removeItem("tooltipsDisabled"):localStorage.setItem("tooltipsDisabled","true"),this._settings.nightMode!==null?localStorage.setItem("night-mode",this._settings.nightMode===!0?"true":"false"):localStorage.removeItem("night-mode"),this._settings.theme!==null?(localStorage.setItem("night-mode",this._settings.theme==="dark"?"true":"false"),this._settings.nightMode=this._settings.theme==="dark"):(delete this._settings.nightMode,localStorage.removeItem("night-mode"))}},O=new _e;var Bn=".content",ut=".content-inner",Vn=".livebook-badge";function dt(){zn(),jn(),Un(),$n()}function zn(){c(Bn).querySelectorAll("a").forEach(e=>{e.querySelector("code, img")&&e.classList.add("no-underline")})}function $n(){["warning","info","error","neutral","tip"].forEach(t=>{k(`blockquote h3.${t}, blockquote h4.${t}`).forEach(n=>{n.closest("blockquote").classList.add(t)})})}function jn(){c(ut).setAttribute("tabindex",-1),c(ut).focus()}function Un(){let t=window.location.pathname.replace(/\.html$/,".livemd"),n=new URL(t,window.location.href).toString();O.getAndSubscribe(i=>{let r=i.livebookUrl?Wn(i.livebookUrl,n):qn(n);for(let s of k(Vn))s.href=r})}function qn(e){return`https://livebook.dev/run?url=${encodeURIComponent(e)}`}function Wn(e,t){return`${e}/import?url=${encodeURIComponent(t)}`}var yt=nt(gt());var di=768,vt=300,fi=".sidebar-toggle",hi=".content",D={CLOSED:"closed",OPEN:"open",NO_PREF:"no_pref"},F={opened:"sidebar-opened",opening:"sidebar-opening",closed:"sidebar-closed",closing:"sidebar-closing"},pi=Object.values(F),P={togglingTimeout:null,lastWindowWidth:window.innerWidth,sidebarPreference:D.NO_PREF};function St(){xt(),mi()}function xt(){if(sessionStorage.getItem("sidebar_state")==="closed")return Y(F.closed);Y(Et()?F.closed:F.opened)}function Et(){return window.matchMedia(`screen and (max-width: ${di}px)`).matches}function Y(...e){document.body.classList.remove(...pi),document.body.classList.add(...e)}function mi(){c(fi).addEventListener("click",e=>{Ie(),vi()}),c(hi).addEventListener("click",e=>{yi()}),window.addEventListener("resize",(0,yt.default)(e=>{gi()},100))}function Ie(){return Ce()?bt():Pe()}function Ce(){return document.body.classList.contains(F.opened)||document.body.classList.contains(F.opening)}function Pe(){return Lt(),Y(F.opening),sessionStorage.setItem("sidebar_state","opened"),new Promise((e,t)=>{P.togglingTimeout=setTimeout(()=>{Y(F.opened),e()},vt)})}function bt(){return Lt(),Y(F.closing),sessionStorage.setItem("sidebar_state","closed"),new Promise((e,t)=>{P.togglingTimeout=setTimeout(()=>{Y(F.closed),e()},vt)})}function Lt(){P.togglingTimeout&&(clearTimeout(P.togglingTimeout),P.togglingTimeout=null)}function gi(){P.lastWindowWidth!==window.innerWidth&&(P.lastWindowWidth=window.innerWidth,(P.sidebarPreference===D.OPEN||P.sidebarPreference===D.NO_PREF)&&xt())}function yi(){Et()&&Ce()&&bt()}function vi(){switch(P.sidebarPreference){case D.OPEN:P.sidebarPreference=D.CLOSED;break;case D.CLOSED:P.sidebarPreference=D.OPEN;break;case D.NO_PREF:Ce()?P.sidebarPreference=D.OPEN:P.sidebarPreference=D.CLOSED}}function J(){return window.sidebarNodes||{}}function Tt(){return window.versionNodes||[]}var Re={search:"search",extras:"extras",modules:"modules",tasks:"tasks"},wt=[Re.extras,Re.modules,Re.tasks],me="#full-list";function kt(){_t(J(),re()),It(),Ot(),xi()}function _t(e,t){let n=e[t]||[],i=c(me),r=Handlebars.templates["sidebar-items"]({nodes:n,group:""});i.innerHTML=r,Si(t),i.querySelectorAll("ul").forEach(s=>{if(s.innerHTML.trim()===""){let o=s.previousElementSibling;o.classList.contains("expand")&&o.classList.remove("expand"),s.remove()}}),i.querySelectorAll("li a").forEach(s=>{s.addEventListener("click",o=>{let a=o.target,u=a.closest("li"),l=i.querySelector(".current-section");if(a.matches(".icon-expand")){o.preventDefault(),u.classList.toggle("open");return}l&&l.classList.remove("current-section"),s.matches(".expand")&&s.pathname===window.location.pathname&&u.classList.add("open")})})}function Si(e){wt.forEach(t=>{let n=c(`#${t}-list-link`);n&&n.parentElement.classList.toggle("selected",t===e)})}function Ot(){let e=c(me),t=e.querySelector("li.current-page");t&&(t.scrollIntoView(),e.scrollTop-=40)}function It(){let e=fe()||"content",n=J()[re()]||[],i=rt(n,e),r=c(me),s=r.querySelector(`li.current-page a.expand[href$="#${i}"]`);s&&s.closest("li").classList.add("open");let o=r.querySelector(`li.current-page a[href$="#${e}"]`);if(o){let a=o.closest("ul");a.classList.contains("deflist")&&a.closest("li").classList.add("current-section"),o.closest("li").classList.add("current-hash")}}function xi(){wt.forEach(e=>{let t=c(`#${e}-list-link`);t&&t.addEventListener("click",n=>{n.preventDefault(),_t(J(),e),Ot()})}),window.addEventListener("hashchange",e=>{let n=c(me).querySelector("li.current-page li.current-hash");n&&n.classList.remove("current-hash"),It()})}var M={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function Pt(e,t=5){if(K(e))return[];let n=J(),i=[...Ae(n.modules,e,M.module),...Ei(n.modules,e,M.moduleChild),...Ae(n.tasks,e,M.mixTask),...Ae(n.extras,e,M.extra),...Qe(n.modules,e,M.section),...Qe(n.tasks,e,M.section),...Qe(n.extras,e,M.section)].filter(r=>r!==null);return Oi(i).slice(0,t)}function Ae(e,t,n){return e.map(i=>Li(i,t,n))}function Ei(e,t,n){return e.filter(i=>i.nodeGroups).flatMap(i=>i.nodeGroups.flatMap(({key:r,nodes:s})=>{let o=_i(r);return s.map(a=>Ti(a,i.id,t,n,o)||ki(a,i.id,t,n,o))}))}function Qe(e,t,n){return e.flatMap(i=>bi(i).map(r=>wi(i,r,t,n)))}function bi(e){return(e.sections||[]).concat(e.headers||[])}function Li(e,t,n){return Ne(e.title,t)?{link:`${e.id}.html`,title:Se(e.title,t),label:null,description:null,matchQuality:ye(e.title,t),category:n}:null}function Ti(e,t,n,i,r){return Ne(e.id,n)?{link:`${t}.html#${e.anchor}`,title:Se(e.id,n),label:r,description:t,matchQuality:ye(e.id,n),category:i}:null}function wi(e,t,n,i){return Rt(t.id,n)?{link:`${e.id}.html#${t.anchor}`,title:Se(t.id,n),label:null,description:e.title,matchQuality:ye(t.id,n),category:i}:null}function ki(e,t,n,i,r){let s=`${t}.${e.id}`;if(!Ne(s,n))return null;let o=n.replace(/\./g," ");return Rt(e.id,o)?{link:`${t}.html#${e.anchor}`,title:Se(e.id,o),label:r,description:t,matchQuality:ye(s,n),category:i}:null}function _i(e){switch(e){case"callbacks":return"callback";case"types":return"type";default:return null}}function Oi(e){return e.slice().sort((t,n)=>t.matchQuality!==n.matchQuality?n.matchQuality-t.matchQuality:Ct(t.category)-Ct(n.category))}function Ct(e){switch(e){case M.module:return 1;case M.moduleChild:return 2;case M.mixTask:return 3;default:return 4}}function Rt(e,t){return ve(t).some(i=>At(e,i))}function Ne(e,t){return ve(t).every(i=>At(e,i))}function At(e,t){return e.toLowerCase().includes(t.toLowerCase())}function ye(e,t){let n=ve(t),r=n.map(o=>o.length).reduce((o,a)=>o+a,0)/e.length,s=Ii(e,n[0])?1:0;return r+s}function Ii(e,t){return e.toLowerCase().startsWith(t.toLowerCase())}function ve(e){return e.trim().split(/\s+/)}function Se(e,t){let n=ve(t).sort((i,r)=>r.length-i.length);return ge(e,n)}function ge(e,t){if(t.length===0)return e;let[n,...i]=t,r=e.match(new RegExp(`(.*)(${it(n)})(.*)`,"i"));if(r){let[,s,o,a]=r;return ge(s,t)+"<em>"+de(o)+"</em>"+ge(a,t)}else return ge(e,i)}var X=".autocomplete",xe=".autocomplete-suggestion",B={autocompleteSuggestions:[],selectedIdx:-1};function Ci(){c(X).classList.add("shown")}function He(){c(X).classList.remove("shown")}function Qt(){return c(X).classList.contains("shown")}function De(e){B.autocompleteSuggestions=Pt(e),B.selectedIdx=-1,K(e)?He():(Pi({term:e,suggestions:B.autocompleteSuggestions}),Ee(0),Ci())}function Pi({term:e,suggestions:t}){let n=Handlebars.templates["autocomplete-suggestions"]({suggestions:t,term:e}),i=c(X);i.innerHTML=n}function Nt(){return B.selectedIdx===-1?null:B.autocompleteSuggestions[B.selectedIdx]}function Ee(e){B.selectedIdx=Ri(e);let t=c(`${xe}.selected`),n=c(`${xe}[data-index="${B.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function Ri(e){let t=B.autocompleteSuggestions.length+1;return(B.selectedIdx+e+1+t)%t-1}var se="form.sidebar-search input",Ai="form.sidebar-search .search-close-button";function Ht(){Qi()}function Dt(e){let t=c(se);t.value=e}function Ft(){c(se).focus()}function Qi(){let e=c(se);e.addEventListener("keydown",t=>{t.key==="Escape"?(be(),e.blur()):t.key==="Enter"?Ni(t):t.key==="ArrowUp"?(Ee(-1),t.preventDefault()):t.key==="ArrowDown"&&(Ee(1),t.preventDefault())}),e.addEventListener("input",t=>{De(t.target.value)}),e.addEventListener("focus",t=>{document.body.classList.add("search-focused"),De(t.target.value)}),e.addEventListener("blur",t=>{let n=t.relatedTarget;if(n){if(n.matches(xe))return setTimeout(()=>{Qt()&&e.focus()},1e3),null;n.matches(Ai)&&be()}Fe()}),c(X).addEventListener("click",t=>{t.shiftKey||t.ctrlKey?e.focus():(be(),Fe())})}function Ni(e){let t=c(se),n=e.shiftKey||e.ctrlKey,i=Nt();e.preventDefault();let r=n?"_blank":"_self",s=document.createElement("a");s.setAttribute("target",r),i?s.setAttribute("href",i.link):s.setAttribute("href",`search.html?q=${encodeURIComponent(t.value)}`),s.click(),n||(be(),Fe())}function be(){let e=c(se);e.value=""}function Fe(){document.body.classList.remove("search-focused"),He()}var Mt=".sidebar-projectVersion",Hi=".sidebar-projectVersionsDropdown";function Bt(){let e=Tt();if(e.length>0){let n=c(Mt).textContent.trim(),i=Fi(e,n);Di({nodes:i})}}function Di({nodes:e}){let t=c(Mt),n=Handlebars.templates["versions-dropdown"]({nodes:e});t.innerHTML=n,c(Hi).addEventListener("change",Bi)}function Fi(e,t){return Mi(e,t).map(i=>({...i,isCurrentVersion:i.version===t}))}function Mi(e,t){return e.some(i=>i.version===t)?e:[{version:t,url:"#"},...e]}function Bi(e){let t=e.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,i=`${t}/${n}`;ot(i).then(r=>{r?window.location.href=i:window.location.href=t})}var I=nt($t());var Le=80,Vi="#search";function Ut(){if(window.location.pathname.endsWith("/search.html")){let e=st("q");zi(e)}}function zi(e){if(K(e))Me({value:e});else{Dt(e);let t=$i();try{let n=Yi(t.search(e));Me({value:e,results:n})}catch(n){Me({value:e,errorMessage:n.message})}}}function Me({value:e,results:t,errorMessage:n}){let i=c(Vi),r=Handlebars.templates["search-results"]({value:e,results:t,errorMessage:n});i.innerHTML=r}function $i(){I.default.QueryLexer.termSeparator=/\s+/,I.default.Pipeline.registerFunction(Be,"elixirTokenSplitter"),I.default.Pipeline.registerFunction(Ve,"elixirTrimmer"),I.default.Pipeline.registerFunction(ze,"hyphenSearch");let e=ji();if(e)return e;let t=qi();return Ui(t),t}function ji(){try{let e=sessionStorage.getItem(qt());return e?I.default.Index.load(JSON.parse(e)):null}catch(e){return console.error("Failed to load index: ",e),null}}function Ui(e){try{let t=JSON.stringify(e);sessionStorage.setItem(qt(),t)}catch(t){console.error("Failed to save index: ",t)}}function qt(){return`index:${he()}`}function qi(){return(0,I.default)(function(){this.tokenizer.separator=/\s+/,this.ref("ref"),this.field("title",{boost:3}),this.field("doc"),this.metadataWhitelist=["position"],this.pipeline.remove(I.default.stopWordFilter),this.use(Ki),this.use(Wi),this.pipeline.remove(I.default.trimmer),this.use(Gi),searchNodes.forEach(e=>{this.add(e)})})}function Wi(e){e.pipeline.before(I.default.stemmer,Be),e.searchPipeline.before(I.default.stemmer,Be)}function Be(e){let t=e.toString().split(/\.|\/|_/).map(n=>e.clone().update(()=>n));return t.length>1?[...t,e]:t}function Gi(e){e.pipeline.after(I.default.stemmer,Ve),e.searchPipeline.after(I.default.stemmer,Ve)}function Ve(e){return e.update(function(t){return t.replace(/^@?\W+/,"").replace(/\W+$/,"")})}function ze(e){if(e.toString().indexOf("-")<0)return e;let n=[];return n.push(e.clone(function(i){return i.replace("-","")})),n.push(e),n}function Ki(e){e.pipeline.before(I.default.stemmer,ze),e.searchPipeline.before(I.default.stemmer,ze)}function Yi(e){return e.filter(t=>jt(t.ref)).map(t=>{let n=jt(t.ref),i=t.matchData.metadata;return{...n,metadata:i,excerpts:Ji(n,i)}})}function jt(e){return searchNodes.find(t=>t.ref===e)||null}function Ji(e,t){let{doc:n}=e,r=Object.keys(t).filter(s=>"doc"in t[s]).map(s=>t[s].doc.position.map(([o,a])=>Xi(n,o,a))).reduce((s,o)=>s.concat(o),[]);return r.length===0?[n.slice(0,Le*2)+(Le*2<n.length?"...":"")]:r.slice(0,1)}function Xi(e,t,n){let i=Math.max(t-Le,0),r=Math.min(t+n+Le,e.length);return[i>0?"...":"",e.slice(i,t),"<em>"+de(e.slice(t,t+n))+"</em>",e.slice(t+n,r),r<e.length?"...":""].join("")}var Te=null,Z=document.getElementById("toast");Z.addEventListener("click",e=>{clearTimeout(Te),e.target.classList.remove("show")});function $e(e){Z&&(clearTimeout(Te),Z.innerText=e,Z.classList.add("show"),Te=setTimeout(()=>{Z.classList.remove("show"),Te=setTimeout(function(){Z.innerText=""},1e3)},5e3))}var Wt="dark",je=["system","dark","light"];function Gt(){O.getAndSubscribe(e=>{document.body.classList.toggle(Wt,Yt(e))}),er()}function Kt(){let t=O.get().theme||"system",n=je[je.indexOf(t)+1]||je[0];O.update({theme:n}),$e(`Set theme to "${n}"`)}function Yt(e){return e.theme==="dark"||Zi()&&(e.theme==null||e.theme==="system")}function Zi(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function er(){window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{let t=O.get(),n=Yt(t);(t.theme==null||t.theme==="system")&&(document.body.classList.toggle(Wt,n),$e(`Browser changed theme to "${n?"dark":"light"}"`))})}var tr="hll";function Xt(){nr()}function nr(){k("[data-group-id]").forEach(t=>{let n=t.getAttribute("data-group-id");t.addEventListener("mouseenter",i=>{Jt(n,!0)}),t.addEventListener("mouseleave",i=>{Jt(n,!1)})})}function Jt(e,t){k(`[data-group-id="${e}"]`).forEach(i=>{i.classList.toggle(tr,t)})}var ee="#modal",ir="#modal .modal-close",rr="#modal .modal-title",sr="#modal .modal-body",Zt='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',V={prevFocus:null,lastFocus:null,ignoreFocusChanges:!1};function en(){or()}function or(){let e=Handlebars.templates["modal-layout"]();document.body.insertAdjacentHTML("beforeend",e),c(ee).addEventListener("keydown",t=>{t.key==="Escape"&&oe()}),c(ir).addEventListener("click",t=>{oe()})}function tn(e){if(V.ignoreFocusChanges)return;let t=c(ee);if(t.contains(e.target))V.lastFocus=e.target;else{V.ignoreFocusChanges=!0;let n=ar(t);V.lastFocus===n?cr(t).focus():n.focus(),V.ignoreFocusChanges=!1,V.lastFocus=document.activeElement}}function ar(e){return e.querySelector(Zt)}function cr(e){let t=e.querySelectorAll(Zt);return t[t.length-1]}function we({title:e,body:t}){V.prevFocus=document.activeElement,document.addEventListener("focus",tn,!0),c(rr).innerHTML=e,c(sr).innerHTML=t,c(ee).classList.add("shown"),c(ee).focus()}function oe(){c(ee).classList.remove("shown"),document.addEventListener("focus",tn,!0),V.prevFocus&&V.prevFocus.focus(),V.prevFocus=null}function nn(){return c(ee).classList.contains("shown")}var lr="https://hexdocs.pm/%%",ur="https://hex.pm/api/packages?search=name:%%*",dr=".display-quick-switch",Ue="#quick-switch-input",sn="#quick-switch-results",fr=".quick-switch-result",hr=300,pr=9,mr=["elixir","eex","ex_unit","hex","iex","logger","mix"].map(e=>({name:e})),on=2,R={autocompleteResults:[],selectedIdx:null};function an(){gr()}function gr(){k(dr).forEach(e=>{e.addEventListener("click",t=>{We()})})}function yr(e){if(e.key==="Enter"){let t=e.target.value;Sr(t),e.preventDefault()}else e.key==="ArrowUp"?(rn(-1),e.preventDefault()):e.key==="ArrowDown"&&(rn(1),e.preventDefault())}function vr(e){let t=e.target.value;if(t.length<on){let n=c(sn);n.innerHTML=""}else xr(t)}function We(){we({title:"Search HexDocs package",body:Handlebars.templates["quick-switch-modal-body"]()}),c(Ue).focus();let e=c(Ue);e.addEventListener("keydown",yr),e.addEventListener("input",vr),R.autocompleteResults=[],R.selectedIdx=null}function Sr(e){if(R.selectedIdx===null)qe(e);else{let t=R.autocompleteResults[R.selectedIdx];qe(t.name)}}function qe(e){window.location=lr.replace("%%",e.toLowerCase())}var xr=ct(Er,hr);function Er(e){let t=ur.replace("%%",e);fetch(t).then(n=>n.json()).then(n=>{Array.isArray(n)&&(R.autocompleteResults=Lr(e,n),R.selectedIdx=null,c(Ue).value.length>=on&&br({results:R.autocompleteResults}))})}function br({results:e}){let t=c(sn),n=Handlebars.templates["quick-switch-results"]({results:e});t.innerHTML=n,k(fr).forEach(i=>{i.addEventListener("click",r=>{let s=i.getAttribute("data-index"),o=R.autocompleteResults[s];qe(o.name)})})}function Lr(e,t){return mr.concat(t).filter(n=>n.name.toLowerCase().includes(e.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,pr)}function rn(e){R.selectedIdx=Tr(e);let t=c(".quick-switch-result.selected"),n=c(`.quick-switch-result[data-index="${R.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function Tr(e){let t=R.autocompleteResults.length;if(R.selectedIdx===null){if(e>=0)return 0;if(e<0)return t-1}return(R.selectedIdx+e+t)%t}var wr=".display-settings",kr="#settings-modal-content",Ge="#modal-settings-tab",Ke="#modal-keyboard-shortcuts-tab",ln="#settings-content",un="#keyboard-shortcuts-content",_r=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];function dn(){Or()}function Or(){k(wr).forEach(e=>{e.addEventListener("click",t=>{Ye()})})}function cn(){c(Ke).classList.remove("active"),c(Ge).classList.add("active"),c(ln).classList.remove("hidden"),c(un).classList.add("hidden")}function Ir(){c(Ke).classList.add("active"),c(Ge).classList.remove("active"),c(un).classList.remove("hidden"),c(ln).classList.add("hidden")}function Ye(){we({title:_r.map(({id:s,title:o})=>`<button id="${s}">${o}</button>`).join(""),body:Handlebars.templates["settings-modal-body"]({shortcuts:Je})});let e=c(kr),t=e.querySelector('[name="theme"]'),n=e.querySelector('[name="tooltips"]'),i=e.querySelector('[name="direct_livebook_url"]'),r=e.querySelector('[name="livebook_url"]');O.getAndSubscribe(s=>{t.value=s.theme||"system",n.checked=s.tooltips,s.livebookUrl===null?(i.checked=!1,r.classList.add("hidden"),r.tabIndex=-1):(i.checked=!0,r.classList.remove("hidden"),r.tabIndex=0,r.value=s.livebookUrl)}),t.addEventListener("change",s=>{O.update({theme:s.target.value})}),n.addEventListener("change",s=>{O.update({tooltips:s.target.checked})}),i.addEventListener("change",s=>{let o=s.target.checked?r.value:null;O.update({livebookUrl:o})}),r.addEventListener("input",s=>{O.update({livebookUrl:s.target.value})}),c(Ge).addEventListener("click",s=>{cn()}),c(Ke).addEventListener("click",s=>{Ir()}),cn()}var Cr="#settings-modal-content",Je=[{key:"c",description:"Toggle sidebar",action:Ie},{key:"n",description:"Cycle themes",action:Kt},{key:"s",description:"Focus search bar",displayAs:"<kbd><kbd>/</kbd></kbd> or <kbd><kbd>s</kdb></kdb>",action:fn},{key:"/",action:fn},{key:"g",description:"Search HexDocs package",displayAs:"<kbd><kbd>g</kdb></kdb>",action:We},{key:"?",displayAs:"<kbd><kbd>?</kbd></kbd>",description:"Bring up this modal",action:Qr}],Xe={shortcutBeingPressed:null};function hn(){Pr()}function Pr(){document.addEventListener("keydown",Rr),document.addEventListener("keyup",Ar)}function Rr(e){if(Xe.shortcutBeingPressed||e.target.matches("input, textarea")||e.ctrlKey||e.metaKey||e.altKey)return;let t=Je.find(n=>n.key===e.key);t&&(Xe.shortcutBeingPressed=t,e.preventDefault(),t.action(e))}function Ar(e){Xe.shortcutBeingPressed=null}function fn(e){oe(),Pe(),Ft()}function Qr(){Nr()?oe():Ye()}function Nr(){return nn()&&c(Cr)}var q={plain:"plain",function:"function",module:"module"},Hr=[{href:"typespecs.html#basic-types",hint:{kind:q.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:q.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:q.plain,description:"Built-in type"}}],ke={cancelHintFetching:null};function pn(e){if(gn(e))return!0;let t=/#.*\//;return e.includes("#")&&!t.test(e)?!1:e.includes(".html")}function mn(e){let t=gn(e);return t?Promise.resolve(t):Dr(e)}function gn(e){let t=Hr.find(n=>e.includes(n.href));return t?t.hint:null}function Dr(e){let t=e.replace(".html",".html?hint=true");return new Promise((n,i)=>{let r=document.createElement("iframe");r.setAttribute("sandbox","allow-scripts allow-same-origin"),r.setAttribute("src",t),r.style.display="none";function s(a){let{href:u,hint:l}=a.data;t===u&&(o(),n(l))}ke.cancelHintFetching=()=>{o(),i(new Error("cancelled"))};function o(){r.remove(),window.removeEventListener("message",s),ke.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(r)})}function yn(){ke.cancelHintFetching&&ke.cancelHintFetching()}function vn(e){let n=e.querySelector("h1").textContent,i=e.querySelector(".docstring > p"),r=i?i.innerHTML:"";return{kind:q.function,title:n.trim(),description:r.trim()}}function Sn(e){let n=e.querySelector("h1 > span").textContent,i=e.querySelector("#moduledoc p"),r=i?i.innerHTML:"";return{kind:q.module,title:n.trim(),description:r.trim()}}var Fr=".content a",Ze="#tooltip",Mr="#tooltip .tooltip-body",En="body .content-inner",Br="#content",bn="tooltip-shown",ae=10,Vr=ae*4,xn={height:450,width:768},zr=100,te={currentLinkElement:null,hoverDelayTimeout:null};function Ln(){$r(),jr()}function $r(){let e=Handlebars.templates["tooltip-layout"]();c(En).insertAdjacentHTML("beforeend",e)}function jr(){k(Fr).forEach(e=>{Ur(e)&&(e.addEventListener("mouseenter",t=>{Wr(e)}),e.addEventListener("mouseleave",t=>{Jr(e)}))})}function Ur(e){return!(e.classList.contains("detail-link")||qr(e.href)||!pn(e.href))}function qr(e){let t=e.replace(Br,"");return window.location.href.split("#")[0]===t}function Wr(e){Gr()&&(te.currentLinkElement=e,te.hoverDelayTimeout=setTimeout(()=>{mn(e.href).then(t=>{Kr(t),Yr()}).catch(()=>{})},zr))}function Gr(){let e=window.innerWidth<xn.width||window.innerHeight<xn.height;return Tn()&&!e}function Kr(e){let t=Handlebars.templates["tooltip-body"]({isPlain:e.kind===q.plain,hint:e});c(Mr).innerHTML=t,Zr()}function Yr(){c(Ze).classList.add(bn)}function Jr(e){Tn()&&(clearTimeout(te.hoverDelayTimeout),yn(),te.currentLinkElement=null,Xr())}function Xr(){c(Ze).classList.remove(bn)}function Zr(){if(!te.currentLinkElement)return;let e=c(Ze),t=te.currentLinkElement.getBoundingClientRect(),n=c(En).getBoundingClientRect(),i=e.getBoundingClientRect(),r=es(t,n);if(t.left+i.width+ae<window.innerWidth)e.style.left=`${r.left}px`,e.style.right="auto";else{let s=Math.max(r.right-i.width,ae);e.style.left=`${s}px`,e.style.right="auto"}t.bottom+i.height+Vr<window.innerHeight?e.style.top=`${r.bottom+ae}px`:e.style.top=`${r.top-i.height-ae}px`}function es(e,t){return{top:e.top-t.top,bottom:e.bottom-t.top,left:e.left-t.left,right:e.right-t.left,x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Tn(){return O.get().tooltips}var ts=".content-inner";function kn(){if(ns()){let e=rs();e&&is(e)}}function ns(){return new URLSearchParams(window.location.search).has("hint")&&window.self!==window.parent}function is(e){let t=window.location.href,n={hint:e,href:t};window.parent.postMessage(n,"*")}function rs(){let e=os(fe()),t=c(ts);if(e){let n=vn(e);return wn(n)}else if(ss()){let n=Sn(t);return wn(n)}return null}function wn(e){let t=he();return{...e,version:t}}function ss(){return["modules","tasks"].includes(re())}function os(e){if(!e)return null;let t=document.getElementById(e);return t?t.matches(".detail")?t:t.matches("span")?t.parentElement:null:null}var as='<button class="copy-button" aria-label="copy"><svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg></button>';function _n(){"clipboard"in navigator&&cs()}function cs(){Array.from(k("pre")).filter(e=>e.firstElementChild&&e.firstElementChild.tagName==="CODE").forEach(e=>e.insertAdjacentHTML("beforeend",as)),Array.from(k(".copy-button")).forEach(e=>{let t;e.addEventListener("click",()=>{t&&clearTimeout(t);let n=Array.from(e.parentElement.querySelector("code").childNodes).filter(i=>!(i.tagName==="SPAN"&&i.classList.contains("unselectable"))).map(i=>i.textContent).join("");navigator.clipboard.writeText(n),e.classList.add("clicked"),t=setTimeout(()=>e.classList.remove("clicked"),3e3)})})}function On(){let t=/(Macintosh|iPhone|iPad|iPod)/.test(window.navigator.userAgent)?"apple-os":"non-apple-os";document.documentElement.classList.add(t)}at(()=>{Gt(),St(),kt(),Ht(),Bt(),dt(),Xt(),en(),hn(),an(),Ln(),kn(),Ut(),_n(),dn(),On()});})();
|
|
/*! Bundled license information:
|
|
|
|
lunr/lunr.js:
|
|
(**
|
|
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
* @license MIT
|
|
*)
|
|
(*!
|
|
* lunr.utils
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.Set
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.tokenizer
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.Pipeline
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.Vector
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.stemmer
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
|
*)
|
|
(*!
|
|
* lunr.stopWordFilter
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.trimmer
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.TokenSet
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.Index
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
(*!
|
|
* lunr.Builder
|
|
* Copyright (C) 2020 Oliver Nightingale
|
|
*)
|
|
*/
|