diff --git a/Makefile b/Makefile index 2011e92..ebcee1d 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ client-nocache: templates/html/static/client.js: src/clientjs/* bun build src/clientjs/index.ts --target=browser --outfile=templates/html/static/client.js --minify + bun build src/clientjs/search.ts --target=browser --outfile=templates/html/static/search.js --minify client: templates/html/static/client.js diff --git a/src/clientjs/index.ts b/src/clientjs/index.ts index 9297922..b787711 100644 --- a/src/clientjs/index.ts +++ b/src/clientjs/index.ts @@ -26,4 +26,6 @@ window.onload = () => { }); mermaid.run({ querySelector: ".language-mermaid" }); + + window.dispatchEvent(new Event("dj-onload")); }; diff --git a/src/clientjs/search.ts b/src/clientjs/search.ts new file mode 100644 index 0000000..5cd1067 --- /dev/null +++ b/src/clientjs/search.ts @@ -0,0 +1,71 @@ +import lunr from "lunr"; + +interface MatchData { + metadata: Record< + string, + { + text: Record; + } + >; +} + +function doSearch(l: lunr.Index, query: string, resultEl: HTMLDivElement) { + const results = l.search(query); + + resultEl.innerHTML = results.map((r) => buildResultHTML(r, query)).join("\n"); +} + +function buildResultHTML(result: lunr.Index.Result, query: string): string { + console.log(result.matchData.metadata); + return ` +
+

${result.ref}

+
${JSON.stringify( + (result.matchData as MatchData).metadata[query] + )}
+
`; +} + +window.addEventListener("dj-onload", () => { + const inputEl = document.querySelector( + "#dj-search-input" + ) as HTMLInputElement | null; + if (!inputEl) return; + + const resultEl = document.querySelector( + "#dj-search-menu-results" + )! as HTMLDivElement; + if (!resultEl) return; + + const win = window as { djSearchIndex?: { name: string; text: string }[] }; + if (!win.djSearchIndex) { + console.warn("Search index not found"); + return; + } + const searchIndex = win.djSearchIndex; + + const l = lunr(function () { + this.ref("name"); + this.field("text"); + + for (const doc of searchIndex) { + this.add(doc); + } + }); + + (document.querySelector("#dj-search-menu")! as HTMLDivElement).showPopover(); + + // use 'input' for keystrokes, 'change' for enter or unfocus + inputEl.addEventListener("change", (e) => { + console.log(e); + + doSearch(l, (e.target! as HTMLInputElement).value, resultEl); + }); + + ( + document.querySelector(".DJOpenSearchButton")! as HTMLButtonElement + ).addEventListener("click", () => { + inputEl.focus(); + return true; + }); +}); diff --git a/templates/html/base.njk b/templates/html/base.njk index 3dd2e63..96deae4 100644 --- a/templates/html/base.njk +++ b/templates/html/base.njk @@ -51,6 +51,7 @@ {% endfor %} {% endif -%} + {{ header_project_info() }} @@ -105,6 +106,16 @@ +
+
+
+ +
+
+
+
+
+ {%- for jsURL in urlLists.js %} {%- endfor %} diff --git a/templates/html/static/client.js b/templates/html/static/client.js index 1cb28bd..af9814e 100644 --- a/templates/html/static/client.js +++ b/templates/html/static/client.js @@ -1599,4 +1599,4 @@ ${Z.themeCSS}`;if(Z.fontFamily!==void 0)F+=` ${vH6} `},$07=(Z,M,z,F,W)=>{const G=Z.append("div");if(G.attr("id",z),F)G.attr("style",F);const L=G.append("svg").attr("id",M).attr("width","100%").attr("xmlns",EH6);if(W)L.attr("xmlns:xlink",W);return L.append("g"),Z},fH6=(Z,M,z,F)=>{var W,G,L;(W=Z.getElementById(M))==null||W.remove(),(G=Z.getElementById(z))==null||G.remove(),(L=Z.getElementById(F))==null||L.remove()},hH6=async function(Z,M,z){var F,W,G,L,P,q;mf0();const B=f97(M);M=B.code;const S=UX();if($0.debug(S),M.length>((S==null?void 0:S.maxTextSize)??qH6))M=BH6;const V="#"+Z,A="i"+Z,w="#"+A,R="d"+Z,_="#"+R;let $=E7("body");const D=S.securityLevel===TH6,h=S.securityLevel===SH6,m=S.fontFamily;if(z!==void 0){if(z)z.innerHTML="";if(D){const Y0=D07(E7(z),A);$=E7(Y0.nodes()[0].contentDocument.body),$.node().style.margin=0}else $=E7(z);$07($,Z,R,`font-family: ${m}`,VH6)}else{if(fH6(document,Z,R,A),D){const Y0=D07(E7("body"),A);$=E7(Y0.nodes()[0].contentDocument.body),$.node().style.margin=0}else $=E7("body");$07($,Z,R)}let t,p;try{t=await lf0(M,{title:B.title})}catch(Y0){t=new ff0("error"),p=Y0}const f=$.select(_).node(),i=t.type,s=f.firstChild,g=s.firstChild,d=(W=(F=t.renderer).getClasses)==null?void 0:W.call(F,M,t),y=uH6(S,i,d,V),a=document.createElement("style");a.innerHTML=y,s.insertBefore(a,g);try{await t.renderer.draw(M,Z,S07,t)}catch(Y0){throw bM6.draw(M,Z,S07),Y0}const n=$.select(`${_} svg`),Z0=(L=(G=t.db).getAccTitle)==null?void 0:L.call(G),W0=(q=(P=t.db).getAccDescription)==null?void 0:q.call(P);pH6(i,n,Z0,W0),$.select(`[id="${Z}"]`).selectAll("foreignobject > *").attr("xmlns",CH6);let O0=$.select(_).node().innerHTML;if($0.debug("config.arrowMarkerAbsolute",S.arrowMarkerAbsolute),O0=yH6(O0,D,hZ(S.arrowMarkerAbsolute)),D){const Y0=$.select(_+" svg").node();O0=mH6(O0,Y0)}else if(!h)O0=Rv.default.sanitize(O0,{ADD_TAGS:xH6,ADD_ATTR:_H6});if(TK6(),p)throw p;const r=E7(D?w:_).node();if(r&&"remove"in r)r.remove();return{svg:O0,bindFunctions:t.db.bindFunctions}},lf0=(Z,M={})=>{const{code:z}=m97(Z);return BK6(z,M)},kv,lH6=async()=>{$0.debug("Loading registered diagrams");const M=(await Promise.allSettled(Object.entries(Lm).map(async([z,{detector:F,loader:W}])=>{if(W)try{yf0(z)}catch(G){try{const{diagram:L,id:P}=await W();JK0(P,L,F)}catch(L){throw $0.error(`Failed to load external diagram with key ${z}. Removing from detectors.`),delete Lm[z],L}}}))).filter((z)=>z.status==="rejected");if(M.length>0){$0.error(`Failed to load ${M.length} external diagrams`);for(let z of M)$0.error(z);throw new Error(`Failed to load ${M.length} external diagrams`)}},rH6=(Z,M,z)=>{if($0.warn(Z),c07(Z)){if(z)z(Z.str,Z.hash);M.push({...Z,message:Z.str,error:Z})}else{if(z)z(Z);if(Z instanceof Error)M.push({str:Z.message,message:Z.message,hash:Z.name,error:Z})}},h97=async function(Z={querySelector:".mermaid"}){try{await iH6(Z)}catch(M){if(c07(M))$0.error(M.str);if(JG.parseError)JG.parseError(M);if(!Z.suppressErrors)throw $0.error("Use the suppressErrors option to suppress these errors"),M}},iH6=async function({postRenderCallback:Z,querySelector:M,nodes:z}={querySelector:".mermaid"}){const F=kv.getConfig();$0.debug(`${!Z?"No ":""}Callback function found`);let W;if(z)W=z;else if(M)W=document.querySelectorAll(M);else throw new Error("Nodes and querySelector are both undefined");if($0.debug(`Found ${W.length} diagrams`),(F==null?void 0:F.startOnLoad)!==void 0)$0.debug("Start On Load: "+(F==null?void 0:F.startOnLoad)),kv.updateSiteConfig({startOnLoad:F==null?void 0:F.startOnLoad});const G=new Q5.InitIDGenerator(F.deterministicIds,F.deterministicIDSeed);let L;const P=[];for(let q of Array.from(W)){$0.info("Rendering diagram: "+q.id);/*! Check if previously processed */if(q.getAttribute("data-processed"))continue;q.setAttribute("data-processed","true");const B=`mermaid-${G.next()}`;L=q.innerHTML,L=eU0(Q5.entityDecode(L)).trim().replace(//gi,"
");const S=Q5.detectInit(L);if(S)$0.debug("Detected early reinit: ",S);try{const{svg:V,bindFunctions:A}=await r97(B,L,q);if(q.innerHTML=V,Z)await Z(B);if(A)A(q)}catch(V){rH6(V,P,JG.parseError)}}if(P.length>0)throw P[0]},g97=function(Z){kv.initialize(Z)},nH6=async function(Z,M,z){if($0.warn("mermaid.init is deprecated. Please use run instead."),Z)g97(Z);const F={postRenderCallback:z,querySelector:".mermaid"};if(typeof M==="string")F.querySelector=M;else if(M)if(M instanceof HTMLElement)F.nodes=[M];else F.nodes=M;await h97(F)},sH6=async(Z,{lazyLoad:M=!0}={})=>{if(r07(...Z),M===!1)await lH6()},p97=function(){if(JG.startOnLoad){const{startOnLoad:Z}=kv.getConfig();if(Z)JG.run().catch((M)=>$0.error("Mermaid failed to initialize",M))}},oH6=function(Z){JG.parseError=Z},HK0,Vf0=!1,l97=async()=>{if(Vf0)return;Vf0=!0;while(HK0.length>0){const Z=HK0.shift();if(Z)try{await Z()}catch(M){$0.error("Error executing queue",M)}}Vf0=!1},cH6=async(Z,M)=>{return new Promise((z,F)=>{const W=()=>new Promise((G,L)=>{kv.parse(Z,M).then((P)=>{G(P),z(P)},(P)=>{var q;$0.error("Error parsing",P),(q=JG.parseError)==null||q.call(JG,P),L(P),F(P)})});HK0.push(W),l97().catch(F)})},r97=(Z,M,z)=>{return new Promise((F,W)=>{const G=()=>new Promise((L,P)=>{kv.render(Z,M,z).then((q)=>{L(q),F(q)},(q)=>{var B;$0.error("Error parsing",q),(B=JG.parseError)==null||B.call(JG,q),P(q),W(q)})});HK0.push(G),l97().catch(W)})},JG;var R1=N0(()=>{QX();u07=z8(kX(),1),y07=z8(NX(),1);jU();Rv=z8(_X(),1);Au();L_0();$_0();gy9();f_0();oT={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},$0={trace:(...Z)=>{},debug:(...Z)=>{},info:(...Z)=>{},warn:(...Z)=>{},error:(...Z)=>{},fatal:(...Z)=>{}},hk=//gi,uZ6=(()=>{let Z=!1;return()=>{if(!Z)yZ6(),Z=!0}})(),Af0=/\$\$(.*)\$\$/g,n7={getRows:DZ6,sanitizeText:N2,sanitizeTextOrArray:mZ6,hasBreaks:fZ6,splitBreaks:hZ6,lineBreakRegex:hk,removeScript:m07,getUrl:pZ6,evaluate:hZ,getMax:lZ6,getMin:rZ6};bT={base:{getThemeVariables:oZ6},dark:{getThemeVariables:tZ6},default:{getThemeVariables:io},forest:{getThemeVariables:aZ6},neutral:{getThemeVariables:eZ6}},cT={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:0.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},theme:"default",maxTextSize:50000,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","maxEdges"],legacyMathML:!1,deterministicIds:!1,fontSize:16},g07={...cT,deterministicIDSeed:void 0,themeCSS:void 0,themeVariables:bT.default.getThemeVariables(),sequence:{...cT.sequence,messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},noteFont:function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},actorFont:function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}},gantt:{...cT.gantt,tickInterval:void 0,useWidth:void 0},c4:{...cT.c4,useWidth:void 0,personFont:function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},external_personFont:function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},systemFont:function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},external_systemFont:function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},system_dbFont:function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},external_system_dbFont:function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},system_queueFont:function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},external_system_queueFont:function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},containerFont:function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},external_containerFont:function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},container_dbFont:function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},external_container_dbFont:function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},container_queueFont:function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},external_container_queueFont:function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},componentFont:function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},external_componentFont:function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},component_dbFont:function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},external_component_dbFont:function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},component_queueFont:function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},external_component_queueFont:function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},boundaryFont:function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}},pie:{...cT.pie,useWidth:984},xyChart:{...cT.xyChart,useWidth:void 0},requirement:{...cT.requirement,useWidth:void 0},gitGraph:{...cT.gitGraph,useMaxWidth:!1},sankey:{...cT.sankey,useMaxWidth:!1}},UJ6=new Set(p07(g07,"")),q2=g07,l07=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,bc=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ZJ6=/\s*%%.*\n/gm;kf0=class kf0 extends Error{constructor(Z){super(Z);this.name="UnknownDiagramError"}};Lm={},BM=wf0,MJ6={curveBasis:iQ,curveBasisClosed:K20,curveBasisOpen:z20,curveBumpX:hx0,curveBumpY:gx0,curveBundle:px0,curveCardinalClosed:rx0,curveCardinalOpen:nx0,curveCardinal:lx0,curveCatmullRomClosed:cx0,curveCatmullRomOpen:tx0,curveCatmullRom:ox0,curveLinear:MZ,curveLinearClosed:Y20,curveMonotoneX:dx0,curveMonotoneY:ax0,curveNatural:Q20,curveStep:L20,curveStepAfter:U_0,curveStepBefore:ex0},KJ6=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,_$0=ku((Z,M,z)=>{if(!Z)return Z;if(z=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},z),n7.lineBreakRegex.test(Z))return Z;const F=Z.split(" "),W=[];let G="";return F.forEach((L,P)=>{const q=OP(`${L} `,z),B=OP(G,z);if(q>M){const{hyphenatedStrings:A,remainingWord:w}=qJ6(L,M,"-",z);W.push(G,...A),G=w}else if(B+q>=M)W.push(G),G=L;else G=[G,L].filter(Boolean).join(" ");if(P+1===F.length)W.push(G)}),W.filter((L)=>L!=="").join(z.joinWith)},(Z,M,z)=>`${Z}${M}${z.fontSize}${z.fontWeight}${z.fontFamily}${z.joinWith}`),qJ6=ku((Z,M,z="-",F)=>{F=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},F);const W=[...Z],G=[];let L="";return W.forEach((P,q)=>{const B=`${L}${P}`;if(OP(B,F)>=M){const V=q+1,A=W.length===V,w=`${B}${z}`;G.push(A?B:w),L=""}else L=B}),{hyphenatedStrings:G,remainingWord:L}},(Z,M,z="-",F)=>`${Z}${M}${z}${F.fontSize}${F.fontWeight}${F.fontFamily}`),xf0=ku((Z,M)=>{const{fontSize:z=12,fontFamily:F="Arial",fontWeight:W=400}=M;if(!Z)return{width:0,height:0};const[,G]=nq(z),L=["sans-serif",F],P=Z.split(n7.lineBreakRegex),q=[],B=E7("body");if(!B.remove)return{width:0,height:0,lineHeight:0};const S=B.append("svg");for(let A of L){let w=0;const R={width:0,height:0,lineHeight:0};for(let _ of P){const $=PJ6();$.text=_||Iy0;const D=IJ6(S,$).style("font-size",G).style("font-weight",W).style("font-family",A),h=(D._groups||D)[0][0].getBBox();if(h.width===0&&h.height===0)throw new Error("svg element not in render tree");R.width=Math.round(Math.max(R.width,h.width)),w=Math.round(h.height),R.height+=w,R.lineHeight=Math.round(Math.max(R.lineHeight,w))}q.push(R)}S.remove();const V=isNaN(q[1].height)||isNaN(q[1].width)||isNaN(q[1].lineHeight)||q[0].height>q[1].height&&q[0].width>q[1].width&&q[0].lineHeight>q[1].lineHeight?0:1;return q[V]},(Z,M)=>`${Z}${M.fontSize}${M.fontWeight}${M.fontFamily}`);Q5={assignWithDepth:BM,wrapLabel:_$0,calculateTextHeight:pX0,calculateTextWidth:OP,calculateTextDimensions:xf0,cleanAndMerge:Uv,detectInit:zJ6,detectDirective:n07,isSubstringInArray:FJ6,interpolateToCurve:DH,calcLabelPosition:GJ6,calcCardinalityPosition:QJ6,calcTerminalLabelPosition:NJ6,formatUrl:OJ6,getStylesFromArray:Zz,generateId:uy0,random:Ru0,runFunc:WJ6,entityDecode:BJ6,insertTitle:TJ6,parseFontSize:nq,InitIDGenerator:o07},Pm=Object.freeze(q2),EW=BM({},Pm),Im=[],dc=BM({},Pm),wJ6={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},E07={},vJ6={id:U97,detector:RJ6,loader:kJ6},xJ6=vJ6,DJ6={id:X97,detector:_J6,loader:$J6},uJ6=DJ6,fJ6={id:Z97,detector:yJ6,loader:mJ6},hJ6=fJ6,lJ6={id:J97,detector:gJ6,loader:pJ6},rJ6=lJ6,sJ6={id:M97,detector:iJ6,loader:nJ6},oJ6=sJ6,bJ6={id:K97,detector:cJ6,loader:tJ6},dJ6=bJ6,UM6={id:z97,detector:aJ6,loader:eJ6},JM6={id:H97,detector:XM6,loader:ZM6},zM6={id:F97,detector:MM6,loader:KM6},HM6=zM6,WM6={id:O97,detector:FM6,loader:OM6},YM6=WM6,NM6={id:W97,detector:GM6,loader:QM6},LM6=NM6,qM6={id:Y97,detector:PM6,loader:IM6},BM6=qM6,EM6={id:G97,detector:TM6,loader:SM6},VM6=EM6,wM6={id:Q97,detector:CM6,loader:AM6},jM6=wM6,vM6={id:N97,detector:RM6,loader:kM6},xM6=vM6,DM6={id:L97,detector:_M6,loader:$M6},uM6=DM6,fM6={id:P97,detector:yM6,loader:mM6},hM6=fM6,eM0={},iM6=lM6,by0=Object.freeze(Object.defineProperty({__proto__:null,clear:h1,getAccDescription:I2,getAccTitle:L2,getDiagramTitle:e2,setAccDescription:P2,setAccTitle:e1,setDiagramTitle:uX},Symbol.toStringTag,{value:"Module"})),nM6=$0,sM6=Rf0,N9=UX,Jo9=d07,bX0=Pm,ku0=tF,ZK0={};I97=class I97 extends Error{constructor(Z){super(`Diagram ${Z} not found.`)}};q97={draw:tM6},bM6=q97,dM6={db:{},renderer:q97,parser:{parser:{yy:{}},parse:()=>{return}}},aM6=dM6,XK6={id:B97,detector:eM6,loader:UK6},ZK6=XK6,KK6={id:T97,detector:JK6,loader:MK6},zK6=KK6,OK6={id:S97,detector:HK6,loader:FK6},WK6=OK6,QK6={id:E97,detector:YK6,loader:GK6},NK6=QK6,IK6={id:V97,detector:LK6,loader:PK6},qK6=IK6;C07=[];/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */vK6=C97,xK6=AK6,_K6=wK6,$K6=RK6,DK6=kK6,uK6=jK6,eF={isNothing:vK6,isObject:xK6,toArray:_K6,repeat:$K6,isNegativeZero:DK6,extend:uK6};ac.prototype=Object.create(Error.prototype);ac.prototype.constructor=ac;ac.prototype.toString=function Z(M){return this.name+": "+A97(this,M)};tT=ac,mK6=yK6,fK6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],hK6=["scalar","sequence","mapping"],rH=pK6;jf0.prototype.extend=function Z(M){var z=[],F=[];if(M instanceof rH)F.push(M);else if(Array.isArray(M))F=F.concat(M);else if(M&&(Array.isArray(M.implicit)||Array.isArray(M.explicit))){if(M.implicit)z=z.concat(M.implicit);if(M.explicit)F=F.concat(M.explicit)}else throw new tT("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");z.forEach(function(G){if(!(G instanceof rH))throw new tT("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(G.loadKind&&G.loadKind!=="scalar")throw new tT("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(G.multi)throw new tT("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),F.forEach(function(G){if(!(G instanceof rH))throw new tT("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var W=Object.create(jf0.prototype);return W.implicit=(this.implicit||[]).concat(z),W.explicit=(this.explicit||[]).concat(F),W.compiledImplicit=A07(W,"implicit"),W.compiledExplicit=A07(W,"explicit"),W.compiledTypeMap=lK6(W.compiledImplicit,W.compiledExplicit),W};rK6=jf0,iK6=new rH("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),nK6=new rH("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),sK6=new rH("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),oK6=new rK6({explicit:[iK6,nK6,sK6]}),dK6=new rH("tag:yaml.org,2002:null",{kind:"scalar",resolve:cK6,construct:tK6,predicate:bK6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Xz6=new rH("tag:yaml.org,2002:bool",{kind:"scalar",resolve:aK6,construct:eK6,predicate:Uz6,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"}),Fz6=new rH("tag:yaml.org,2002:int",{kind:"scalar",resolve:Kz6,construct:zz6,predicate:Hz6,represent:{binary:function(Z){return Z>=0?"0b"+Z.toString(2):"-0b"+Z.toString(2).slice(1)},octal:function(Z){return Z>=0?"0o"+Z.toString(8):"-0o"+Z.toString(8).slice(1)},decimal:function(Z){return Z.toString(10)},hexadecimal:function(Z){return Z>=0?"0x"+Z.toString(16).toUpperCase():"-0x"+Z.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Oz6=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Gz6=/^[-+]?[0-9]+e/,Lz6=new rH("tag:yaml.org,2002:float",{kind:"scalar",resolve:Wz6,construct:Yz6,predicate:Nz6,represent:Qz6,defaultStyle:"lowercase"}),w97=oK6.extend({implicit:[dK6,Xz6,Fz6,Lz6]}),Pz6=w97,j97=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),R97=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),Tz6=new rH("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Iz6,construct:qz6,instanceOf:Date,represent:Bz6}),Ez6=new rH("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Sz6}),jz6=new rH("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Vz6,construct:Cz6,predicate:wz6,represent:Az6}),Rz6=Object.prototype.hasOwnProperty,kz6=Object.prototype.toString,_z6=new rH("tag:yaml.org,2002:omap",{kind:"sequence",resolve:vz6,construct:xz6}),$z6=Object.prototype.toString,yz6=new rH("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Dz6,construct:uz6}),mz6=Object.prototype.hasOwnProperty,gz6=new rH("tag:yaml.org,2002:set",{kind:"mapping",resolve:fz6,construct:hz6}),pz6=Pz6.extend({implicit:[Tz6,Ez6],explicit:[jz6,_z6,yz6,gz6]}),NA=Object.prototype.hasOwnProperty,rz6=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,iz6=/[\x85\u2028\u2029]/,nz6=/[,\[\]\{\}]/,x97=/^(?:!|!!|![a-z\-]+!)$/i,_97=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,$97=new Array(256),D97=new Array(256);for(wv=0;wv<256;wv++)$97[wv]=R07(wv)?1:0,D97[wv]=R07(wv);k07={YAML:function Z(M,z,F){var W,G,L;if(M.version!==null)V5(M,"duplication of %YAML directive");if(F.length!==1)V5(M,"YAML directive accepts exactly one argument");if(W=/^([0-9]+)\.([0-9]+)$/.exec(F[0]),W===null)V5(M,"ill-formed argument of the YAML directive");if(G=parseInt(W[1],10),L=parseInt(W[2],10),G!==1)V5(M,"unacceptable YAML version of the document");if(M.version=F[0],M.checkLineBreaks=L<2,L!==1&&L!==2)zK0(M,"unsupported YAML version of the document")},TAG:function Z(M,z,F){var W,G;if(F.length!==2)V5(M,"TAG directive accepts exactly two arguments");if(W=F[0],G=F[1],!x97.test(W))V5(M,"ill-formed tag handle (first argument) of the TAG directive");if(NA.call(M.tagMap,W))V5(M,'there is a previously declared suffix for "'+W+'" tag handle');if(!_97.test(G))V5(M,"ill-formed tag prefix (second argument) of the TAG directive");try{G=decodeURIComponent(G)}catch(L){V5(M,"tag prefix is malformed: "+G)}M.tagMap[W]=G}},OH6=HH6,WH6=FH6,YH6={loadAll:OH6,load:WH6},GH6=w97,QH6=YH6.load,xH6=["foreignobject"],_H6=["dominant-baseline"],kv=Object.freeze({render:hH6,parse:$H6,getDiagramFromText:lf0,initialize:gH6,getConfig:UX,setConfig:d07,getSiteConfig:b07,updateSiteConfig:CJ6,reset:()=>{XK0()},globalReset:()=>{XK0(Pm)},defaultConfig:Pm});Rf0(UX().logLevel);XK0(UX());if(typeof document!=="undefined"){/*! * Wait for document loaded before starting the execution - */window.addEventListener("load",p97,!1)}HK0=[],JG={startOnLoad:!0,mermaidAPI:kv,parse:cH6,render:r97,init:nH6,run:h97,registerExternalDiagrams:sH6,initialize:g97,parseError:void 0,contentLoaded:p97,setParseErrorHandler:oH6,detectType:WK0}});QX();R1();var ZN8=z8(kX(),1),JN8=z8(NX(),1);jU();var KN8=z8(_X(),1);window.onload=()=>{document.querySelectorAll(".dj-tab-heading").forEach((Z)=>{const M=Z.dataset.tabId,z=Z.dataset.tabGroup;Z.addEventListener("click",(F)=>{document.querySelectorAll("."+z).forEach((W)=>{W.classList.remove("m-active")}),document.querySelectorAll("."+M).forEach((W)=>{W.classList.add("m-active")})})}),[...document.querySelectorAll("pre code.language-mermaid")].map((Z)=>{const M=Z.parentElement;M.innerHTML=Z.innerHTML,M.className="language-mermaid"}),JG.run({querySelector:".language-mermaid"})}; + */window.addEventListener("load",p97,!1)}HK0=[],JG={startOnLoad:!0,mermaidAPI:kv,parse:cH6,render:r97,init:nH6,run:h97,registerExternalDiagrams:sH6,initialize:g97,parseError:void 0,contentLoaded:p97,setParseErrorHandler:oH6,detectType:WK0}});QX();R1();var ZN8=z8(kX(),1),JN8=z8(NX(),1);jU();var KN8=z8(_X(),1);window.onload=()=>{document.querySelectorAll(".dj-tab-heading").forEach((Z)=>{const M=Z.dataset.tabId,z=Z.dataset.tabGroup;Z.addEventListener("click",(F)=>{document.querySelectorAll("."+z).forEach((W)=>{W.classList.remove("m-active")}),document.querySelectorAll("."+M).forEach((W)=>{W.classList.add("m-active")})})}),[...document.querySelectorAll("pre code.language-mermaid")].map((Z)=>{const M=Z.parentElement;M.innerHTML=Z.innerHTML,M.className="language-mermaid"}),JG.run({querySelector:".language-mermaid"}),window.dispatchEvent(new Event("dj-onload"))}; diff --git a/templates/html/static/dj-search.css b/templates/html/static/dj-search.css new file mode 100644 index 0000000..814e843 --- /dev/null +++ b/templates/html/static/dj-search.css @@ -0,0 +1,45 @@ +#dj-search-menu { + border: none; + padding: 0; + background-color: var(--color-bg-1); + color: var(--color-fg-1); +} + +#dj-search-menu > div { + width: 100vw; + height: 100vh; + + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; +} + +#dj-search-menu::backdrop { + background-color: rgba(0, 0, 0, 0.15); +} + +.DJSearchMenu_InputContainer { + margin-top: calc(min(20vh, 10rem)); +} + +#dj-search-menu h1 { + font-size: var(--fs-normal); + font-weight: var(--fw-bold); +} + +.DJSearchMenu_Results { + overflow-y: auto; + width: 100%; + max-width: var(--page-max-width); + padding: var(--ms); +} + +.DJSearchResult:first-child { + border-top: var(--border-weak); +} + +.DJSearchResult { + border-bottom: var(--border-weak); + padding: var(--ms) 0; +} diff --git a/templates/html/static/search.js b/templates/html/static/search.js new file mode 100644 index 0000000..8b56bc5 --- /dev/null +++ b/templates/html/static/search.js @@ -0,0 +1,39 @@ +var l=Object.create;var{getPrototypeOf:r,defineProperty:o,getOwnPropertyNames:e}=Object;var GG=Object.prototype.hasOwnProperty;var QG=(Q,G,U)=>{U=Q!=null?l(r(Q)):{};const X=G||!Q||!Q.__esModule?o(U,"default",{value:Q,enumerable:!0}):U;for(let Y of e(Q))if(!GG.call(X,Y))o(X,Y,{get:()=>Q[Y],enumerable:!0});return X};var UG=(Q,G)=>()=>(G||Q((G={exports:{}}).exports,G),G.exports);var d=UG((m,u)=>{(function(){var Q=function(G){var U=new Q.Builder;return U.pipeline.add(Q.trimmer,Q.stopWordFilter,Q.stemmer),U.searchPipeline.add(Q.stemmer),G.call(U,U),U.build()};Q.version="2.3.9";/*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + */Q.utils={},Q.utils.warn=function(G){return function(U){if(G.console&&console.warn)console.warn(U)}}(this),Q.utils.asString=function(G){if(G===void 0||G===null)return"";else return G.toString()},Q.utils.clone=function(G){if(G===null||G===void 0)return G;var U=Object.create(null),X=Object.keys(G);for(var Y=0;Y0){var z=Q.utils.clone(U)||{};z.position=[H,J],z.index=Z.length,Z.push(new Q.Token(X.slice(H,$),z))}H=$+1}}return Z},Q.tokenizer.separator=/[\s\-]+/;/*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + */Q.Pipeline=function(){this._stack=[]},Q.Pipeline.registeredFunctions=Object.create(null),Q.Pipeline.registerFunction=function(G,U){if(U in this.registeredFunctions)Q.utils.warn("Overwriting existing registered function: "+U);G.label=U,Q.Pipeline.registeredFunctions[G.label]=G},Q.Pipeline.warnIfFunctionNotRegistered=function(G){var U=G.label&&G.label in this.registeredFunctions;if(!U)Q.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",G)},Q.Pipeline.load=function(G){var U=new Q.Pipeline;return G.forEach(function(X){var Y=Q.Pipeline.registeredFunctions[X];if(Y)U.add(Y);else throw new Error("Cannot load unregistered function: "+X)}),U},Q.Pipeline.prototype.add=function(){var G=Array.prototype.slice.call(arguments);G.forEach(function(U){Q.Pipeline.warnIfFunctionNotRegistered(U),this._stack.push(U)},this)},Q.Pipeline.prototype.after=function(G,U){Q.Pipeline.warnIfFunctionNotRegistered(U);var X=this._stack.indexOf(G);if(X==-1)throw new Error("Cannot find existingFn");X=X+1,this._stack.splice(X,0,U)},Q.Pipeline.prototype.before=function(G,U){Q.Pipeline.warnIfFunctionNotRegistered(U);var X=this._stack.indexOf(G);if(X==-1)throw new Error("Cannot find existingFn");this._stack.splice(X,0,U)},Q.Pipeline.prototype.remove=function(G){var U=this._stack.indexOf(G);if(U==-1)return;this._stack.splice(U,1)},Q.Pipeline.prototype.run=function(G){var U=this._stack.length;for(var X=0;X1){if($G)X=Z;if($==G)break;Y=X-U,Z=U+Math.floor(Y/2),$=this.elements[Z*2]}if($==G)return Z*2;if($>G)return Z*2;if($O)z+=2;else if(H==O)U+=X[J+1]*Y[z+1],J+=2,z+=2;return U},Q.Vector.prototype.similarity=function(G){return this.dot(G)/this.magnitude()||0},Q.Vector.prototype.toArray=function(){var G=new Array(this.elements.length/2);for(var U=1,X=0;U0){var $=Z.str.charAt(0),H;if($ in Z.node.edges)H=Z.node.edges[$];else H=new Q.TokenSet,Z.node.edges[$]=H;if(Z.str.length==1)H.final=!0;Y.push({node:H,editsRemaining:Z.editsRemaining,str:Z.str.slice(1)})}if(Z.editsRemaining==0)continue;if("*"in Z.node.edges)var O=Z.node.edges["*"];else{var O=new Q.TokenSet;Z.node.edges["*"]=O}if(Z.str.length==0)O.final=!0;if(Y.push({node:O,editsRemaining:Z.editsRemaining-1,str:Z.str}),Z.str.length>1)Y.push({node:Z.node,editsRemaining:Z.editsRemaining-1,str:Z.str.slice(1)});if(Z.str.length==1)Z.node.final=!0;if(Z.str.length>=1){if("*"in Z.node.edges)var J=Z.node.edges["*"];else{var J=new Q.TokenSet;Z.node.edges["*"]=J}if(Z.str.length==1)J.final=!0;Y.push({node:J,editsRemaining:Z.editsRemaining-1,str:Z.str.slice(1)})}if(Z.str.length>1){var z=Z.str.charAt(0),P=Z.str.charAt(1),C;if(P in Z.node.edges)C=Z.node.edges[P];else C=new Q.TokenSet,Z.node.edges[P]=C;if(Z.str.length==1)C.final=!0;Y.push({node:C,editsRemaining:Z.editsRemaining-1,str:z+Z.str.slice(2)})}}return X},Q.TokenSet.fromString=function(G){var U=new Q.TokenSet,X=U;for(var Y=0,Z=G.length;Y=G;U--){var X=this.uncheckedNodes[U],Y=X.child.toString();if(Y in this.minimizedNodes)X.parent.edges[X.char]=this.minimizedNodes[Y];else X.child._str=Y,this.minimizedNodes[Y]=X.child;this.uncheckedNodes.pop()}};/*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + */Q.Index=function(G){this.invertedIndex=G.invertedIndex,this.fieldVectors=G.fieldVectors,this.tokenSet=G.tokenSet,this.fields=G.fields,this.pipeline=G.pipeline},Q.Index.prototype.search=function(G){return this.query(function(U){var X=new Q.QueryParser(G,U);X.parse()})},Q.Index.prototype.query=function(G){var U=new Q.Query(this.fields),X=Object.create(null),Y=Object.create(null),Z=Object.create(null),$=Object.create(null),H=Object.create(null);for(var O=0;O1)this._b=1;else this._b=G},Q.Builder.prototype.k1=function(G){this._k1=G},Q.Builder.prototype.add=function(G,U){var X=G[this._ref],Y=Object.keys(this._fields);this._documents[X]=U||{},this.documentCount+=1;for(var Z=0;Z=this.length)return Q.QueryLexer.EOS;var G=this.str.charAt(this.pos);return this.pos+=1,G},Q.QueryLexer.prototype.width=function(){return this.pos-this.start},Q.QueryLexer.prototype.ignore=function(){if(this.start==this.pos)this.pos+=1;this.start=this.pos},Q.QueryLexer.prototype.backup=function(){this.pos-=1},Q.QueryLexer.prototype.acceptDigitRun=function(){var G,U;do G=this.next(),U=G.charCodeAt(0);while(U>47&&U<58);if(G!=Q.QueryLexer.EOS)this.backup()},Q.QueryLexer.prototype.more=function(){return this.pos1)G.backup(),G.emit(Q.QueryLexer.TERM);if(G.ignore(),G.more())return Q.QueryLexer.lexText},Q.QueryLexer.lexEditDistance=function(G){return G.ignore(),G.acceptDigitRun(),G.emit(Q.QueryLexer.EDIT_DISTANCE),Q.QueryLexer.lexText},Q.QueryLexer.lexBoost=function(G){return G.ignore(),G.acceptDigitRun(),G.emit(Q.QueryLexer.BOOST),Q.QueryLexer.lexText},Q.QueryLexer.lexEOS=function(G){if(G.width()>0)G.emit(Q.QueryLexer.TERM)},Q.QueryLexer.termSeparator=Q.tokenizer.separator,Q.QueryLexer.lexText=function(G){while(!0){var U=G.next();if(U==Q.QueryLexer.EOS)return Q.QueryLexer.lexEOS;if(U.charCodeAt(0)==92){G.escapeCharacter();continue}if(U==":")return Q.QueryLexer.lexField;if(U=="~"){if(G.backup(),G.width()>0)G.emit(Q.QueryLexer.TERM);return Q.QueryLexer.lexEditDistance}if(U=="^"){if(G.backup(),G.width()>0)G.emit(Q.QueryLexer.TERM);return Q.QueryLexer.lexBoost}if(U=="+"&&G.width()===1)return G.emit(Q.QueryLexer.PRESENCE),Q.QueryLexer.lexText;if(U=="-"&&G.width()===1)return G.emit(Q.QueryLexer.PRESENCE),Q.QueryLexer.lexText;if(U.match(Q.QueryLexer.termSeparator))return Q.QueryLexer.lexTerm}},Q.QueryParser=function(G,U){this.lexer=new Q.QueryLexer(G),this.query=U,this.currentClause={},this.lexemeIdx=0},Q.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;var G=Q.QueryParser.parseClause;while(G)G=G(this);return this.query},Q.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},Q.QueryParser.prototype.consumeLexeme=function(){var G=this.peekLexeme();return this.lexemeIdx+=1,G},Q.QueryParser.prototype.nextClause=function(){var G=this.currentClause;this.query.clause(G),this.currentClause={}},Q.QueryParser.parseClause=function(G){var U=G.peekLexeme();if(U==null)return;switch(U.type){case Q.QueryLexer.PRESENCE:return Q.QueryParser.parsePresence;case Q.QueryLexer.FIELD:return Q.QueryParser.parseField;case Q.QueryLexer.TERM:return Q.QueryParser.parseTerm;default:var X="expected either a field or a term, found "+U.type;if(U.str.length>=1)X+=" with value '"+U.str+"'";throw new Q.QueryParseError(X,U.start,U.end)}},Q.QueryParser.parsePresence=function(G){var U=G.consumeLexeme();if(U==null)return;switch(U.str){case"-":G.currentClause.presence=Q.Query.presence.PROHIBITED;break;case"+":G.currentClause.presence=Q.Query.presence.REQUIRED;break;default:var X="unrecognised presence operator'"+U.str+"'";throw new Q.QueryParseError(X,U.start,U.end)}var Y=G.peekLexeme();if(Y==null){var X="expecting term or field, found nothing";throw new Q.QueryParseError(X,U.start,U.end)}switch(Y.type){case Q.QueryLexer.FIELD:return Q.QueryParser.parseField;case Q.QueryLexer.TERM:return Q.QueryParser.parseTerm;default:var X="expecting term or field, found '"+Y.type+"'";throw new Q.QueryParseError(X,Y.start,Y.end)}},Q.QueryParser.parseField=function(G){var U=G.consumeLexeme();if(U==null)return;if(G.query.allFields.indexOf(U.str)==-1){var X=G.query.allFields.map(function($){return"'"+$+"'"}).join(", "),Y="unrecognised field '"+U.str+"', possible fields: "+X;throw new Q.QueryParseError(Y,U.start,U.end)}G.currentClause.fields=[U.str];var Z=G.peekLexeme();if(Z==null){var Y="expecting term, found nothing";throw new Q.QueryParseError(Y,U.start,U.end)}switch(Z.type){case Q.QueryLexer.TERM:return Q.QueryParser.parseTerm;default:var Y="expecting term, found '"+Z.type+"'";throw new Q.QueryParseError(Y,Z.start,Z.end)}},Q.QueryParser.parseTerm=function(G){var U=G.consumeLexeme();if(U==null)return;if(G.currentClause.term=U.str.toLowerCase(),U.str.indexOf("*")!=-1)G.currentClause.usePipeline=!1;var X=G.peekLexeme();if(X==null){G.nextClause();return}switch(X.type){case Q.QueryLexer.TERM:return G.nextClause(),Q.QueryParser.parseTerm;case Q.QueryLexer.FIELD:return G.nextClause(),Q.QueryParser.parseField;case Q.QueryLexer.EDIT_DISTANCE:return Q.QueryParser.parseEditDistance;case Q.QueryLexer.BOOST:return Q.QueryParser.parseBoost;case Q.QueryLexer.PRESENCE:return G.nextClause(),Q.QueryParser.parsePresence;default:var Y="Unexpected lexeme type '"+X.type+"'";throw new Q.QueryParseError(Y,X.start,X.end)}},Q.QueryParser.parseEditDistance=function(G){var U=G.consumeLexeme();if(U==null)return;var X=parseInt(U.str,10);if(isNaN(X)){var Y="edit distance must be numeric";throw new Q.QueryParseError(Y,U.start,U.end)}G.currentClause.editDistance=X;var Z=G.peekLexeme();if(Z==null){G.nextClause();return}switch(Z.type){case Q.QueryLexer.TERM:return G.nextClause(),Q.QueryParser.parseTerm;case Q.QueryLexer.FIELD:return G.nextClause(),Q.QueryParser.parseField;case Q.QueryLexer.EDIT_DISTANCE:return Q.QueryParser.parseEditDistance;case Q.QueryLexer.BOOST:return Q.QueryParser.parseBoost;case Q.QueryLexer.PRESENCE:return G.nextClause(),Q.QueryParser.parsePresence;default:var Y="Unexpected lexeme type '"+Z.type+"'";throw new Q.QueryParseError(Y,Z.start,Z.end)}},Q.QueryParser.parseBoost=function(G){var U=G.consumeLexeme();if(U==null)return;var X=parseInt(U.str,10);if(isNaN(X)){var Y="boost must be numeric";throw new Q.QueryParseError(Y,U.start,U.end)}G.currentClause.boost=X;var Z=G.peekLexeme();if(Z==null){G.nextClause();return}switch(Z.type){case Q.QueryLexer.TERM:return G.nextClause(),Q.QueryParser.parseTerm;case Q.QueryLexer.FIELD:return G.nextClause(),Q.QueryParser.parseField;case Q.QueryLexer.EDIT_DISTANCE:return Q.QueryParser.parseEditDistance;case Q.QueryLexer.BOOST:return Q.QueryParser.parseBoost;case Q.QueryLexer.PRESENCE:return G.nextClause(),Q.QueryParser.parsePresence;default:var Y="Unexpected lexeme type '"+Z.type+"'";throw new Q.QueryParseError(Y,Z.start,Z.end)}},function(G,U){if(typeof define==="function"&&define.amd)define(U);else if(typeof m==="object")u.exports=U();else G.lunr=U()}(this,function(){return Q})})()});var i=QG(d(),1);function XG(Q,G,U){const X=Q.search(G);U.innerHTML=X.map((Y)=>YG(Y,G)).join("\n")}function YG(Q,G){return console.log(Q.matchData.metadata),` +
+

${Q.ref}

+
${JSON.stringify(Q.matchData.metadata[G])}
+
`}window.addEventListener("dj-onload",()=>{const Q=document.querySelector("#dj-search-input");if(!Q)return;const G=document.querySelector("#dj-search-menu-results");if(!G)return;const U=window;if(!U.djSearchIndex){console.warn("Search index not found");return}const X=U.djSearchIndex,Y=i.default(function(){this.ref("name"),this.field("text");for(let Z of X)this.add(Z)});document.querySelector("#dj-search-menu").showPopover(),Q.addEventListener("change",(Z)=>{console.log(Z),XG(Y,Z.target.value,G)}),document.querySelector(".DJOpenSearchButton").addEventListener("click",()=>{return Q.focus(),!0})});