├── references.qmd ├── .gitignore ├── cover.png ├── summary.qmd ├── README.md ├── _book ├── site_libs │ ├── bootstrap │ │ └── bootstrap-icons.woff │ ├── quarto-html │ │ ├── tippy.css │ │ ├── quarto-syntax-highlighting.css │ │ ├── anchor.min.js │ │ ├── popper.min.js │ │ ├── tippy.umd.min.js │ │ └── quarto.js │ ├── quarto-nav │ │ ├── headroom.min.js │ │ └── quarto-nav.js │ ├── clipboard │ │ └── clipboard.min.js │ └── quarto-search │ │ ├── fuse.min.js │ │ └── quarto-search.js ├── search.json ├── references.html ├── summary.html ├── index.html └── intro.html ├── index.qmd ├── intro.qmd ├── hello_quarto_book.Rproj ├── _quarto.yml └── references.bib /references.qmd: -------------------------------------------------------------------------------- 1 | # References {.unnumbered} 2 | 3 | ::: {#refs} 4 | ::: 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | 6 | /.quarto/ 7 | -------------------------------------------------------------------------------- /cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/hello_quarto_book/main/cover.png -------------------------------------------------------------------------------- /summary.qmd: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | In summary, this book has no content whatsoever. 4 | 5 | ```{r} 6 | 1 + 1 7 | ``` 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hello_quarto_book 2 | 3 | Just a repo of the quarto template from RStudio so I can get it onto RStudio Cloud 4 | -------------------------------------------------------------------------------- /_book/site_libs/bootstrap/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RVerse-Tutorials/hello_quarto_book/main/_book/site_libs/bootstrap/bootstrap-icons.woff -------------------------------------------------------------------------------- /index.qmd: -------------------------------------------------------------------------------- 1 | # Preface {.unnumbered} 2 | 3 | This is a Quarto book. 4 | 5 | To learn more about Quarto books visit . 6 | 7 | ```{r} 8 | 1 + 1 9 | ``` 10 | -------------------------------------------------------------------------------- /intro.qmd: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | This is a book created from markdown and executable code. 4 | 5 | See @knuth84 for additional discussion of literate programming. 6 | 7 | ```{r} 8 | 1 + 1 9 | ``` 10 | -------------------------------------------------------------------------------- /hello_quarto_book.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /_quarto.yml: -------------------------------------------------------------------------------- 1 | project: 2 | type: book 3 | 4 | book: 5 | title: "hello_quarto_book" 6 | author: "Jane Doe" 7 | date: "8/3/2022" 8 | chapters: 9 | - index.qmd 10 | - intro.qmd 11 | - summary.qmd 12 | - references.qmd 13 | 14 | bibliography: references.bib 15 | 16 | format: 17 | html: 18 | theme: cosmo 19 | pdf: 20 | documentclass: scrreprt 21 | 22 | editor: visual 23 | 24 | -------------------------------------------------------------------------------- /_book/search.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "objectID": "index.html", 4 | "href": "index.html", 5 | "title": "hello_quarto_book", 6 | "section": "", 7 | "text": "This is a Quarto book.\nTo learn more about Quarto books visit https://quarto.org/docs/books.\n\n1 + 1\n\n[1] 2" 8 | }, 9 | { 10 | "objectID": "intro.html", 11 | "href": "intro.html", 12 | "title": "1  Introduction", 13 | "section": "", 14 | "text": "See Knuth (1984) for additional discussion of literate programming.\n\n1 + 1\n\n[1] 2\n\n\n\n\n\n\nKnuth, Donald E. 1984. “Literate Programming.” Comput. J. 27 (2): 97–111. https://doi.org/10.1093/comjnl/27.2.97." 15 | }, 16 | { 17 | "objectID": "summary.html", 18 | "href": "summary.html", 19 | "title": "2  Summary", 20 | "section": "", 21 | "text": "1 + 1\n\n[1] 2" 22 | }, 23 | { 24 | "objectID": "references.html", 25 | "href": "references.html", 26 | "title": "References", 27 | "section": "", 28 | "text": "Knuth, Donald E. 1984. “Literate Programming.” Comput.\nJ. 27 (2): 97–111. https://doi.org/10.1093/comjnl/27.2.97." 29 | } 30 | ] -------------------------------------------------------------------------------- /_book/site_libs/quarto-html/tippy.css: -------------------------------------------------------------------------------- 1 | .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} -------------------------------------------------------------------------------- /references.bib: -------------------------------------------------------------------------------- 1 | @article{knuth84, 2 | author = {Knuth, Donald E.}, 3 | title = {Literate Programming}, 4 | year = {1984}, 5 | issue_date = {May 1984}, 6 | publisher = {Oxford University Press, Inc.}, 7 | address = {USA}, 8 | volume = {27}, 9 | number = {2}, 10 | issn = {0010-4620}, 11 | url = {https://doi.org/10.1093/comjnl/27.2.97}, 12 | doi = {10.1093/comjnl/27.2.97}, 13 | journal = {Comput. J.}, 14 | month = may, 15 | pages = {97–111}, 16 | numpages = {15} 17 | } 18 | 19 | @ARTICLE{smit54, 20 | AUTHOR = {J. G. Smith and H. K. Weston}, 21 | TITLE = {Nothing Particular in this Year's History}, 22 | YEAR = {1954}, 23 | JOURNAL = {J. Geophys. Res.}, 24 | VOLUME = {2}, 25 | PAGES = {14-15} 26 | } 27 | @BOOK{colu92, 28 | AUTHOR = {Christopher Columbus}, 29 | TITLE = {How {I} Discovered {America}}, 30 | YEAR = {1492}, 31 | PUBLISHER = {Hispanic Press}, 32 | ADDRESS = {Barcelona} 33 | } 34 | @ARTICLE{gree00, 35 | AUTHOR = {R. J. Green and U. P. Fred and W. P. Norbert}, 36 | TITLE = {Things that Go Bump in the Night}, 37 | YEAR = {1900}, 38 | JOURNAL = {Psych. Today}, 39 | VOLUME = {46}, 40 | PAGES = {345-678} 41 | } 42 | @ARTICLE{phil99, 43 | AUTHOR = {T. P. Phillips}, 44 | TITLE = {Possible Influence of the Magnetosphere on {American} History}, 45 | YEAR = {1999}, 46 | JOURNAL = {J. Oddball Res.}, 47 | VOLUME = {98}, 48 | PAGES = {1000-1003} 49 | } 50 | @ARTICLE{jame76, 51 | AUTHOR = {Kelly James and Harris, Jr., George and Wilby Wollops}, 52 | TITLE = {{American} Independence and Magnetism}, 53 | YEAR = {1776}, 54 | JOURNAL = {Revol. Tracts}, 55 | VOLUME = {32}, 56 | PAGES = {34-55} 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /_book/site_libs/quarto-html/quarto-syntax-highlighting.css: -------------------------------------------------------------------------------- 1 | /* quarto syntax highlight colors */ 2 | :root { 3 | --quarto-hl-ot-color: #003B4F; 4 | --quarto-hl-at-color: #657422; 5 | --quarto-hl-ss-color: #20794D; 6 | --quarto-hl-an-color: #5E5E5E; 7 | --quarto-hl-fu-color: #4758AB; 8 | --quarto-hl-st-color: #20794D; 9 | --quarto-hl-cf-color: #003B4F; 10 | --quarto-hl-op-color: #5E5E5E; 11 | --quarto-hl-er-color: #AD0000; 12 | --quarto-hl-bn-color: #AD0000; 13 | --quarto-hl-al-color: #AD0000; 14 | --quarto-hl-va-color: #111111; 15 | --quarto-hl-bu-color: inherit; 16 | --quarto-hl-ex-color: inherit; 17 | --quarto-hl-pp-color: #AD0000; 18 | --quarto-hl-in-color: #5E5E5E; 19 | --quarto-hl-vs-color: #20794D; 20 | --quarto-hl-wa-color: #5E5E5E; 21 | --quarto-hl-do-color: #5E5E5E; 22 | --quarto-hl-im-color: #00769E; 23 | --quarto-hl-ch-color: #20794D; 24 | --quarto-hl-dt-color: #AD0000; 25 | --quarto-hl-fl-color: #AD0000; 26 | --quarto-hl-co-color: #5E5E5E; 27 | --quarto-hl-cv-color: #5E5E5E; 28 | --quarto-hl-cn-color: #8f5902; 29 | --quarto-hl-sc-color: #5E5E5E; 30 | --quarto-hl-dv-color: #AD0000; 31 | --quarto-hl-kw-color: #003B4F; 32 | } 33 | 34 | /* other quarto variables */ 35 | :root { 36 | --quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 37 | } 38 | 39 | pre > code.sourceCode > span { 40 | color: #003B4F; 41 | } 42 | 43 | code span { 44 | color: #003B4F; 45 | } 46 | 47 | code.sourceCode > span { 48 | color: #003B4F; 49 | } 50 | 51 | div.sourceCode, 52 | div.sourceCode pre.sourceCode { 53 | color: #003B4F; 54 | } 55 | 56 | code span.ot { 57 | color: #003B4F; 58 | } 59 | 60 | code span.at { 61 | color: #657422; 62 | } 63 | 64 | code span.ss { 65 | color: #20794D; 66 | } 67 | 68 | code span.an { 69 | color: #5E5E5E; 70 | } 71 | 72 | code span.fu { 73 | color: #4758AB; 74 | } 75 | 76 | code span.st { 77 | color: #20794D; 78 | } 79 | 80 | code span.cf { 81 | color: #003B4F; 82 | } 83 | 84 | code span.op { 85 | color: #5E5E5E; 86 | } 87 | 88 | code span.er { 89 | color: #AD0000; 90 | } 91 | 92 | code span.bn { 93 | color: #AD0000; 94 | } 95 | 96 | code span.al { 97 | color: #AD0000; 98 | } 99 | 100 | code span.va { 101 | color: #111111; 102 | } 103 | 104 | code span.pp { 105 | color: #AD0000; 106 | } 107 | 108 | code span.in { 109 | color: #5E5E5E; 110 | } 111 | 112 | code span.vs { 113 | color: #20794D; 114 | } 115 | 116 | code span.wa { 117 | color: #5E5E5E; 118 | font-style: italic; 119 | } 120 | 121 | code span.do { 122 | color: #5E5E5E; 123 | font-style: italic; 124 | } 125 | 126 | code span.im { 127 | color: #00769E; 128 | } 129 | 130 | code span.ch { 131 | color: #20794D; 132 | } 133 | 134 | code span.dt { 135 | color: #AD0000; 136 | } 137 | 138 | code span.fl { 139 | color: #AD0000; 140 | } 141 | 142 | code span.co { 143 | color: #5E5E5E; 144 | } 145 | 146 | code span.cv { 147 | color: #5E5E5E; 148 | font-style: italic; 149 | } 150 | 151 | code span.cn { 152 | color: #8f5902; 153 | } 154 | 155 | code span.sc { 156 | color: #5E5E5E; 157 | } 158 | 159 | code span.dv { 160 | color: #AD0000; 161 | } 162 | 163 | code span.kw { 164 | color: #003B4F; 165 | } 166 | 167 | .prevent-inlining { 168 | content: "s.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t){return t===Object(t)?t:{down:t,up:t}}function s(t,n){n=n||{},Object.assign(this,s.options,n),this.classes=Object.assign({},s.options.classes,n.classes),this.elem=t,this.tolerance=o(this.tolerance),this.offset=o(this.offset),this.initialised=!1,this.frozen=!1}return s.prototype={constructor:s,init:function(){return s.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},s.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},s.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),s}); 8 | -------------------------------------------------------------------------------- /_book/site_libs/quarto-html/anchor.min.js: -------------------------------------------------------------------------------- 1 | // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat 2 | // 3 | // AnchorJS - v4.3.1 - 2021-04-17 4 | // https://www.bryanbraun.com/anchorjs/ 5 | // Copyright (c) 2021 Bryan Braun; Licensed MIT 6 | // 7 | // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat 8 | !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function d(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function w(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],d(this.options),this.isTouchDevice=function(){return Boolean("ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,o,i,n,s,a,c,r,l,h,u,p=[];if(d(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=w(A=A||"h2, h3, h4, h5, h6")).length)return this;for(null===document.head.querySelector("style.anchorjs")&&((u=document.createElement("style")).className="anchorjs",u.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(u):document.head.insertBefore(u,A),u.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",u.sheet.cssRules.length),u.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",u.sheet.cssRules.length),u.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",u.sheet.cssRules.length),u.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',u.sheet.cssRules.length)),u=document.querySelectorAll("[id]"),t=[].map.call(u,function(A){return A.id}),i=0;i\]./()*\\\n\t\b\v\u00A0]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),A=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||A||!1}}}); 9 | // @license-end -------------------------------------------------------------------------------- /_book/site_libs/quarto-nav/quarto-nav.js: -------------------------------------------------------------------------------- 1 | const headroomChanged = new CustomEvent("quarto-hrChanged", { 2 | detail: {}, 3 | bubbles: true, 4 | cancelable: false, 5 | composed: false, 6 | }); 7 | 8 | window.document.addEventListener("DOMContentLoaded", function () { 9 | let init = false; 10 | 11 | function throttle(func, wait) { 12 | var timeout; 13 | return function () { 14 | const context = this; 15 | const args = arguments; 16 | const later = function () { 17 | clearTimeout(timeout); 18 | timeout = null; 19 | func.apply(context, args); 20 | }; 21 | 22 | if (!timeout) { 23 | timeout = setTimeout(later, wait); 24 | } 25 | }; 26 | } 27 | 28 | function headerOffset() { 29 | // Set an offset if there is are fixed top navbar 30 | const headerEl = window.document.querySelector("header.fixed-top"); 31 | if (headerEl) { 32 | return headerEl.clientHeight; 33 | } else { 34 | return 0; 35 | } 36 | } 37 | 38 | function footerOffset() { 39 | const footerEl = window.document.querySelector("footer.footer"); 40 | if (footerEl) { 41 | return footerEl.clientHeight; 42 | } else { 43 | return 0; 44 | } 45 | } 46 | 47 | function updateDocumentOffsetWithoutAnimation() { 48 | updateDocumentOffset(false); 49 | } 50 | 51 | function updateDocumentOffset(animated) { 52 | // set body offset 53 | const topOffset = headerOffset(); 54 | const bodyOffset = topOffset + footerOffset(); 55 | const bodyEl = window.document.body; 56 | bodyEl.setAttribute("data-bs-offset", topOffset); 57 | bodyEl.style.paddingTop = topOffset + "px"; 58 | 59 | // deal with sidebar offsets 60 | const sidebars = window.document.querySelectorAll( 61 | ".sidebar, .headroom-target" 62 | ); 63 | sidebars.forEach((sidebar) => { 64 | if (!animated) { 65 | sidebar.classList.add("notransition"); 66 | // Remove the no transition class after the animation has time to complete 67 | setTimeout(function () { 68 | sidebar.classList.remove("notransition"); 69 | }, 201); 70 | } 71 | 72 | if (window.Headroom && sidebar.classList.contains("sidebar-unpinned")) { 73 | sidebar.style.top = "0"; 74 | sidebar.style.maxHeight = "100vh"; 75 | } else { 76 | sidebar.style.top = topOffset + "px"; 77 | sidebar.style.maxHeight = "calc(100vh - " + topOffset + "px)"; 78 | } 79 | }); 80 | 81 | // allow space for footer 82 | const mainContainer = window.document.querySelector(".quarto-container"); 83 | if (mainContainer) { 84 | mainContainer.style.minHeight = "calc(100vh - " + bodyOffset + "px)"; 85 | } 86 | 87 | // link offset 88 | let linkStyle = window.document.querySelector("#quarto-target-style"); 89 | if (!linkStyle) { 90 | linkStyle = window.document.createElement("style"); 91 | window.document.head.appendChild(linkStyle); 92 | } 93 | while (linkStyle.firstChild) { 94 | linkStyle.removeChild(linkStyle.firstChild); 95 | } 96 | if (topOffset > 0) { 97 | linkStyle.appendChild( 98 | window.document.createTextNode(` 99 | section:target::before { 100 | content: ""; 101 | display: block; 102 | height: ${topOffset}px; 103 | margin: -${topOffset}px 0 0; 104 | }`) 105 | ); 106 | } 107 | if (init) { 108 | window.dispatchEvent(headroomChanged); 109 | } 110 | init = true; 111 | } 112 | 113 | // initialize headroom 114 | var header = window.document.querySelector("#quarto-header"); 115 | if (header && window.Headroom) { 116 | const headroom = new window.Headroom(header, { 117 | tolerance: 5, 118 | onPin: function () { 119 | const sidebars = window.document.querySelectorAll( 120 | ".sidebar, .headroom-target" 121 | ); 122 | sidebars.forEach((sidebar) => { 123 | sidebar.classList.remove("sidebar-unpinned"); 124 | }); 125 | updateDocumentOffset(); 126 | }, 127 | onUnpin: function () { 128 | const sidebars = window.document.querySelectorAll( 129 | ".sidebar, .headroom-target" 130 | ); 131 | sidebars.forEach((sidebar) => { 132 | sidebar.classList.add("sidebar-unpinned"); 133 | }); 134 | updateDocumentOffset(); 135 | }, 136 | }); 137 | headroom.init(); 138 | 139 | let frozen = false; 140 | window.quartoToggleHeadroom = function () { 141 | if (frozen) { 142 | headroom.unfreeze(); 143 | frozen = false; 144 | } else { 145 | headroom.freeze(); 146 | frozen = true; 147 | } 148 | }; 149 | } 150 | 151 | // Observe size changed for the header 152 | const headerEl = window.document.querySelector("header.fixed-top"); 153 | if (headerEl && window.ResizeObserver) { 154 | const observer = new window.ResizeObserver( 155 | throttle(updateDocumentOffsetWithoutAnimation, 50) 156 | ); 157 | observer.observe(headerEl, { 158 | attributes: true, 159 | childList: true, 160 | characterData: true, 161 | }); 162 | } else { 163 | window.addEventListener( 164 | "resize", 165 | throttle(updateDocumentOffsetWithoutAnimation, 50) 166 | ); 167 | setTimeout(updateDocumentOffsetWithoutAnimation, 500); 168 | } 169 | 170 | // fixup index.html links if we aren't on the filesystem 171 | if (window.location.protocol !== "file:") { 172 | const links = window.document.querySelectorAll("a"); 173 | for (let i = 0; i < links.length; i++) { 174 | links[i].href = links[i].href.replace(/\/index\.html/, "/"); 175 | } 176 | 177 | // Fixup any sharing links that require urls 178 | // Append url to any sharing urls 179 | const sharingLinks = window.document.querySelectorAll( 180 | "a.sidebar-tools-main-item" 181 | ); 182 | for (let i = 0; i < sharingLinks.length; i++) { 183 | const sharingLink = sharingLinks[i]; 184 | const href = sharingLink.getAttribute("href"); 185 | if (href) { 186 | sharingLink.setAttribute( 187 | "href", 188 | href.replace("|url|", window.location.href) 189 | ); 190 | } 191 | } 192 | 193 | // Scroll the active navigation item into view, if necessary 194 | const navSidebar = window.document.querySelector("nav#quarto-sidebar"); 195 | if (navSidebar) { 196 | // Find the active item 197 | const activeItem = navSidebar.querySelector("li.sidebar-item a.active"); 198 | if (activeItem) { 199 | // Wait for the scroll height and height to resolve by observing size changes on the 200 | // nav element that is scrollable 201 | const resizeObserver = new ResizeObserver((_entries) => { 202 | // The bottom of the element 203 | const elBottom = activeItem.offsetTop; 204 | const viewBottom = navSidebar.scrollTop + navSidebar.clientHeight; 205 | 206 | // The element height and scroll height are the same, then we are still loading 207 | if (viewBottom !== navSidebar.scrollHeight) { 208 | // Determine if the item isn't visible and scroll to it 209 | if (elBottom >= viewBottom) { 210 | navSidebar.scrollTop = elBottom; 211 | } 212 | 213 | // stop observing now since we've completed the scroll 214 | resizeObserver.unobserve(navSidebar); 215 | } 216 | }); 217 | resizeObserver.observe(navSidebar); 218 | } 219 | } 220 | } 221 | }); 222 | -------------------------------------------------------------------------------- /_book/site_libs/clipboard/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.10 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | hello_quarto_book - References 11 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
83 |
84 | 92 |
93 | 94 |
95 | 96 | 132 | 133 | 136 | 137 |
138 | 139 |
140 |
141 |

References

142 |
143 | 144 | 145 | 146 |
147 | 148 | 149 | 150 |
151 | 152 | 153 |
154 | 155 |
156 |
157 | Knuth, Donald E. 1984. “Literate Programming.” Comput. 158 | J. 27 (2): 97–111. https://doi.org/10.1093/comjnl/27.2.97. 159 |
160 |
161 | 162 | 163 | 164 |
165 | 262 | 271 |
272 | 273 | 274 | 275 | -------------------------------------------------------------------------------- /_book/summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | hello_quarto_book - 2  Summary 11 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 121 | 122 | 123 | 124 | 125 | 126 | 127 |
128 |
129 | 137 |
138 | 139 |
140 | 141 | 177 | 178 | 181 | 182 |
183 | 184 |
185 |
186 |

2  Summary

187 |
188 | 189 | 190 | 191 |
192 | 193 | 194 | 195 |
196 | 197 | 198 |
199 | 200 |

In summary, this book has no content whatsoever.

201 |
202 |
1 + 1
203 |
204 |
[1] 2
205 |
206 |
207 | 208 | 209 | 210 |
211 | 308 | 320 |
321 | 322 | 323 | 324 | -------------------------------------------------------------------------------- /_book/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | hello_quarto_book 13 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 122 | 123 | 124 | 125 | 126 | 127 | 128 |
129 |
130 | 138 |
139 | 140 |
141 | 142 | 178 | 179 | 188 | 189 |
190 | 191 |
192 |
193 |

hello_quarto_book

194 |
195 | 196 | 197 | 198 |
199 | 200 |
201 |
Author
202 |
203 |

Jane Doe

204 |
205 |
206 | 207 |
208 |
Published
209 |
210 |

August 3, 2022

211 |
212 |
213 | 214 |
215 | 216 | 217 |
218 | 219 |
220 |

Preface

221 |

This is a Quarto book.

222 |

To learn more about Quarto books visit https://quarto.org/docs/books.

223 |
224 |
1 + 1
225 |
226 |
[1] 2
227 |
228 |
229 | 230 | 231 |
232 | 233 |
234 | 331 | 340 |
341 | 342 | 343 | 344 | -------------------------------------------------------------------------------- /_book/intro.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | hello_quarto_book - 1  Introduction 11 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 140 | 141 | 142 | 143 | 144 | 145 | 146 |
147 |
148 | 156 |
157 | 158 |
159 | 160 | 196 | 197 | 200 | 201 |
202 | 203 |
204 |
205 |

1  Introduction

206 |
207 | 208 | 209 | 210 |
211 | 212 | 213 | 214 |
215 | 216 | 217 |
218 | 219 |

This is a book created from markdown and executable code.

220 |

See Knuth (1984) for additional discussion of literate programming.

221 |
222 |
1 + 1
223 |
224 |
[1] 2
225 |
226 |
227 | 228 | 229 | 234 | 235 |
236 | 333 | 345 |
346 | 347 | 348 | 349 | -------------------------------------------------------------------------------- /_book/site_libs/quarto-html/popper.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @popperjs/core v2.11.4 - MIT License 3 | */ 4 | 5 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),o=1,i=1;if(r(e)&&t){var a=e.offsetHeight,f=e.offsetWidth;f>0&&(o=s(n.width)/f||1),a>0&&(i=s(n.height)/a||1)}return{width:n.width/o,height:n.height/i,top:n.top/i,right:n.right/o,bottom:n.bottom/i,left:n.left/o,x:n.left/o,y:n.top/i}}function c(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function p(e){return e?(e.nodeName||"").toLowerCase():null}function u(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function l(e){return f(u(e)).left+c(e).scrollLeft}function d(e){return t(e).getComputedStyle(e)}function h(e){var t=d(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function m(e,n,o){void 0===o&&(o=!1);var i,a,d=r(n),m=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),v=u(n),g=f(e,m),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(d||!d&&!o)&&(("body"!==p(n)||h(v))&&(y=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:c(i)),r(n)?((b=f(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):v&&(b.x=l(v))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function v(e){var t=f(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function g(e){return"html"===p(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||u(e)}function y(e){return["html","body","#document"].indexOf(p(e))>=0?e.ownerDocument.body:r(e)&&h(e)?e:y(g(e))}function b(e,n){var r;void 0===n&&(n=[]);var o=y(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],h(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(b(g(s)))}function x(e){return["table","td","th"].indexOf(p(e))>=0}function w(e){return r(e)&&"fixed"!==d(e).position?e.offsetParent:null}function O(e){for(var n=t(e),i=w(e);i&&x(i)&&"static"===d(i).position;)i=w(i);return i&&("html"===p(i)||"body"===p(i)&&"static"===d(i).position)?n:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&r(e)&&"fixed"===d(e).position)return null;var n=g(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(p(n))<0;){var i=d(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var j="top",E="bottom",D="right",A="left",L="auto",P=[j,E,D,A],M="start",k="end",W="viewport",B="popper",H=P.reduce((function(e,t){return e.concat([t+"-"+M,t+"-"+k])}),[]),T=[].concat(P,[L]).reduce((function(e,t){return e.concat([t,t+"-"+M,t+"-"+k])}),[]),R=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function S(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function V(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function N(e,r){return r===W?V(function(e){var n=t(e),r=u(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,f=0;return o&&(i=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=o.offsetLeft,f=o.offsetTop)),{width:i,height:a,x:s+l(e),y:f}}(e)):n(r)?function(e){var t=f(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(r):V(function(e){var t,n=u(e),r=c(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+l(e),p=-r.scrollTop;return"rtl"===d(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:p}}(u(e)))}function I(e,t,o){var s="clippingParents"===t?function(e){var t=b(g(e)),o=["absolute","fixed"].indexOf(d(e).position)>=0&&r(e)?O(e):e;return n(o)?t.filter((function(e){return n(e)&&q(e,o)&&"body"!==p(e)})):[]}(e):[].concat(t),f=[].concat(s,[o]),c=f[0],u=f.reduce((function(t,n){var r=N(e,n);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),N(e,c));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function _(e){return e.split("-")[1]}function F(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function U(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?C(o):null,a=o?_(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case j:t={x:s,y:n.y-r.height};break;case E:t={x:s,y:n.y+n.height};break;case D:t={x:n.x+n.width,y:f};break;case A:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?F(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case M:t[c]=t[c]-(n[p]/2-r[p]/2);break;case k:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Y(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.boundary,s=void 0===a?"clippingParents":a,c=r.rootBoundary,p=void 0===c?W:c,l=r.elementContext,d=void 0===l?B:l,h=r.altBoundary,m=void 0!==h&&h,v=r.padding,g=void 0===v?0:v,y=z("number"!=typeof g?g:X(g,P)),b=d===B?"reference":B,x=e.rects.popper,w=e.elements[m?b:d],O=I(n(w)?w:w.contextElement||u(e.elements.popper),s,p),A=f(e.elements.reference),L=U({reference:A,element:x,strategy:"absolute",placement:i}),M=V(Object.assign({},x,L)),k=d===B?M:A,H={top:O.top-k.top+y.top,bottom:k.bottom-O.bottom+y.bottom,left:O.left-k.left+y.left,right:k.right-O.right+y.right},T=e.modifiersData.offset;if(d===B&&T){var R=T[i];Object.keys(H).forEach((function(e){var t=[D,E].indexOf(e)>=0?1:-1,n=[j,E].indexOf(e)>=0?"y":"x";H[e]+=R[n]*t}))}return H}var G={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[A,D].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},ie={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var se={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function ce(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?T:f,p=_(r),u=p?s?H:H.filter((function(e){return _(e)===p})):P,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=Y(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[C(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var pe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,g=C(v),y=f||(g===v||!h?[ae(v)]:function(e){if(C(e)===L)return[];var t=ae(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(C(n)===L?ce(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,P=!0,k=b[0],W=0;W=0,S=R?"width":"height",q=Y(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),V=R?T?D:A:T?E:j;x[S]>w[S]&&(V=ae(V));var N=ae(V),I=[];if(i&&I.push(q[H]<=0),s&&I.push(q[V]<=0,q[N]<=0),I.every((function(e){return e}))){k=B,P=!1;break}O.set(B,I)}if(P)for(var F=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},U=h?3:1;U>0;U--){if("break"===F(U))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ue(e,t,n){return i(e,a(t,n))}var le={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,g=n.tetherOffset,y=void 0===g?0:g,b=Y(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=C(t.placement),w=_(t.placement),L=!w,P=F(x),k="x"===P?"y":"x",W=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,q={x:0,y:0};if(W){if(s){var V,N="y"===P?j:A,I="y"===P?E:D,U="y"===P?"height":"width",z=W[P],X=z+b[N],G=z-b[I],J=m?-H[U]/2:0,K=w===M?B[U]:H[U],Q=w===M?-H[U]:-B[U],Z=t.elements.arrow,$=m&&Z?v(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[N],ne=ee[I],re=ue(0,B[U],$[U]),oe=L?B[U]/2-J-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=L?-B[U]/2+J+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&O(t.elements.arrow),se=ae?"y"===P?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(V=null==S?void 0:S[P])?V:0,ce=z+ie-fe,pe=ue(m?a(X,z+oe-fe-se):X,z,m?i(G,ce):G);W[P]=pe,q[P]=pe-z}if(c){var le,de="x"===P?j:A,he="x"===P?E:D,me=W[k],ve="y"===k?"height":"width",ge=me+b[de],ye=me-b[he],be=-1!==[j,A].indexOf(x),xe=null!=(le=null==S?void 0:S[k])?le:0,we=be?ge:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ye,je=m&&be?function(e,t,n){var r=ue(e,t,n);return r>n?n:r}(we,me,Oe):ue(m?we:ge,me,m?Oe:ye);W[k]=je,q[k]=je-me}t.modifiersData[r]=q}},requiresIfExists:["offset"]};var de={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=C(n.placement),f=F(s),c=[A,D].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,P))}(o.padding,n),u=v(i),l="y"===f?j:A,d="y"===f?E:D,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],g=O(i),y=g?"y"===f?g.clientHeight||0:g.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],L=y/2-u[c]/2+b,M=ue(x,L,w),k=f;n.modifiersData[r]=((t={})[k]=M,t.centerOffset=M-L,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function he(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[j,D,E,A].some((function(t){return e[t]>=0}))}var ve={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Y(t,{elementContext:"reference"}),s=Y(t,{altBoundary:!0}),f=he(a,r),c=he(s,o,i),p=me(f),u=me(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},ge=K({defaultModifiers:[Z,$,ne,re]}),ye=[Z,$,ne,re,oe,pe,le,de,ve],be=K({defaultModifiers:ye});e.applyStyles=re,e.arrow=de,e.computeStyles=ne,e.createPopper=be,e.createPopperLite=ge,e.defaultModifiers=ye,e.detectOverflow=Y,e.eventListeners=Z,e.flip=pe,e.hide=ve,e.offset=oe,e.popperGenerator=K,e.popperOffsets=$,e.preventOverflow=le,Object.defineProperty(e,"__esModule",{value:!0})})); 6 | 7 | -------------------------------------------------------------------------------- /_book/site_libs/quarto-search/fuse.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Fuse.js v6.5.3 - Lightweight fuzzy-search (http://fusejs.io) 3 | * 4 | * Copyright (c) 2021 Kiro Risk (http://kiro.me) 5 | * All Rights Reserved. Apache Software License 2.0 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | */ 9 | var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(C).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),c=parseFloat(Math.round(o*r)/r);return n.set(i,c),c},clear:function(){n.clear()}}}var $=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?I.getFn:n,o=t.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o;r(this,e),this.norm=E(c,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?I.getFn:r,o=n.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o,a=new $({getFn:i,fieldNormWeight:c});return a.setKeys(e.map(_)),a.setSources(t),a.create(),a}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?I.distance:s,h=t.ignoreLocation,f=void 0===h?I.ignoreLocation:h,l=r/e.length;if(f)return l;var d=Math.abs(a-o);return u?l+d/u:d?1:l}function N(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var P=32;function W(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?I.location:o,a=i.threshold,s=void 0===a?I.threshold:a,u=i.distance,h=void 0===u?I.distance:u,f=i.includeMatches,l=void 0===f?I.includeMatches:f,d=i.findAllMatches,v=void 0===d?I.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?I.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?I.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?I.ignoreLocation:k;if(r(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:l,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var b=function(e,t){n.chunks.push({pattern:e,alphabet:W(e),startIndex:t})},x=this.pattern.length;if(x>P){for(var w=0,L=x%P,S=x-L;w3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?I.location:i,c=r.distance,a=void 0===c?I.distance:c,s=r.threshold,u=void 0===s?I.threshold:s,h=r.findAllMatches,f=void 0===h?I.findAllMatches:h,l=r.minMatchCharLength,d=void 0===l?I.minMatchCharLength:l,v=r.includeMatches,g=void 0===v?I.includeMatches:v,y=r.ignoreLocation,p=void 0===y?I.ignoreLocation:y;if(t.length>P)throw new Error(w(P));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,L=b,S=d>1||g,_=S?Array(M):[];(m=e.indexOf(t,L))>-1;){var O=F(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(O,x),L=m+k,S)for(var j=0;j=z;q-=1){var B=q-1,J=n[e.charAt(B)];if(S&&(_[B]=+!!J),K[q]=(K[q+1]<<1|1)&J,R&&(K[q]|=(A[q+1]|A[q])<<1|1|A[q+1]),K[q]&$&&(C=F(t,{errors:R,currentLocation:B,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=C,(L=B)<=b)break;z=Math.max(1,2*b-L)}}if(F(t,{errors:R+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p})>x)break;A=K}var U={isMatch:L>=0,score:Math.max(.001,C)};if(S){var V=N(_,d);V.length?g&&(U.indices=V):U.isMatch=!1}return U}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:f}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(l(d),l(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),z=function(){function e(t){r(this,e),this.pattern=t}return o(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return D(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return D(e,this.singleRegex)}}]),e}();function D(e,t){var n=e.match(t);return n?n[1]:null}var K=function(e){a(n,e);var t=f(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),n}(z),q=function(e){a(n,e);var t=f(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),n}(z),B=function(e){a(n,e);var t=f(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),n}(z),J=function(e){a(n,e);var t=f(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),n}(z),U=function(e){a(n,e);var t=f(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),n}(z),V=function(e){a(n,e);var t=f(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),n}(z),G=function(e){a(n,e);var t=f(n);function n(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?I.location:c,s=o.threshold,u=void 0===s?I.threshold:s,h=o.distance,f=void 0===h?I.distance:h,l=o.includeMatches,d=void 0===l?I.includeMatches:l,v=o.findAllMatches,g=void 0===v?I.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?I.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?I.isCaseSensitive:m,M=o.ignoreLocation,b=void 0===M?I.ignoreLocation:M;return r(this,n),(i=t.call(this,e))._bitapSearch=new T(e,{location:a,threshold:u,distance:f,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),i}return o(n,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),n}(z),H=function(e){a(n,e);var t=f(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),n}(z),Q=[K,H,B,J,V,U,q,G],X=Q.length,Y=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Y).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i1&&void 0!==arguments[1]?arguments[1]:{},i=n.isCaseSensitive,o=void 0===i?I.isCaseSensitive:i,c=n.includeMatches,a=void 0===c?I.includeMatches:c,s=n.minMatchCharLength,u=void 0===s?I.minMatchCharLength:s,h=n.ignoreLocation,f=void 0===h?I.ignoreLocation:h,l=n.findAllMatches,d=void 0===l?I.findAllMatches:l,v=n.location,g=void 0===v?I.location:v,y=n.threshold,p=void 0===y?I.threshold:y,m=n.distance,k=void 0===m?I.distance:m;r(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:d,ignoreLocation:f,location:g,threshold:p,distance:k},this.pattern=o?t:t.toLowerCase(),this.query=Z(this.pattern,this.options)}return o(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function ve(e,t){t.score=e.score}function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?I.includeMatches:r,o=n.includeScore,c=void 0===o?I.includeScore:o,a=[];return i&&a.push(de),c&&a.push(ve),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}var ye=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;r(this,e),this.options=t(t({},I),i),this.options.useExtendedSearch,this._keyStore=new S(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof $))throw new Error("Incorrect 'index' type");this._myIndex=t||R(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){k(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=g(e)?g(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return le(h,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),ge(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=re(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(k(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,r=void 0===n||n,i=function e(n){var i=Object.keys(n),o=ue(n);if(!o&&i.length>1&&!se(n))return e(fe(n));if(he(n)){var c=o?n[ce]:i[0],a=o?n[ae]:n[c];if(!g(a))throw new Error(x(c));var s={keyId:j(c),pattern:a};return r&&(s.searcher=re(a,t)),s}var u={children:[],operator:i[0]};return i.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return se(e)||(e=fe(e)),i(e)}(e,this.options),r=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return a&&a.length?[{idx:i,item:r,matches:a}]:[]}for(var s=[],u=0,h=n.children.length;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?I.getFn:n,i=t.fieldNormWeight,o=void 0===i?I.fieldNormWeight:i,c=e.keys,a=e.records,s=new $({getFn:r,fieldNormWeight:o});return s.setKeys(c),s.setIndexRecords(a),s},ye.config=I,function(){ne.push.apply(ne,arguments)}(te),ye},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); -------------------------------------------------------------------------------- /_book/site_libs/quarto-html/tippy.umd.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||I(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(V(r.arrow))):i.appendChild(V(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),I(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}N.$$tippy=!0;var B=1,H=[],U=[];function _(o,s){var v,g,h,C,T,A,L,k,M=j(o,Object.assign({},R,P(l(s)))),V=!1,I=!1,N=!1,_=!1,F=[],W=a(we,M.interactiveDebounce),X=B++,Y=(k=M.plugins).filter((function(e,t){return k.indexOf(e)===t})),$={id:X,reference:o,popper:d(),popperInstance:null,props:M,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:Y,clearDelayTimeouts:function(){clearTimeout(v),clearTimeout(g),cancelAnimationFrame(h)},setProps:function(e){if($.state.isDestroyed)return;ae("onBeforeUpdate",[$,e]),be();var t=$.props,n=j(o,Object.assign({},t,l(e),{ignoreAttributes:!0}));$.props=n,he(),t.interactiveDebounce!==n.interactiveDebounce&&(ce(),W=a(we,n.interactiveDebounce));t.triggerTarget&&!n.triggerTarget?u(t.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):n.triggerTarget&&o.removeAttribute("aria-expanded");ue(),ie(),J&&J(t,n);$.popperInstance&&(Ce(),Ae().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[$,e])},setContent:function(e){$.setProps({content:e})},show:function(){var e=$.state.isVisible,t=$.state.isDestroyed,o=!$.state.isEnabled,a=x.isTouch&&!$.props.touch,s=r($.props.duration,0,R.duration);if(e||t||o||a)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[$],!1),!1===$.props.onShow($))return;$.state.isVisible=!0,ee()&&(z.style.visibility="visible");ie(),de(),$.state.isMounted||(z.style.transition="none");if(ee()){var u=re(),p=u.box,f=u.content;b([p,f],0)}A=function(){var e;if($.state.isVisible&&!_){if(_=!0,z.offsetHeight,z.style.transition=$.props.moveTransition,ee()&&$.props.animation){var t=re(),n=t.box,r=t.content;b([n,r],s),y([n,r],"visible")}se(),ue(),c(U,$),null==(e=$.popperInstance)||e.forceUpdate(),ae("onMount",[$]),$.props.animation&&ee()&&function(e,t){me(e,t)}(s,(function(){$.state.isShown=!0,ae("onShown",[$])}))}},function(){var e,t=$.props.appendTo,r=te();e=$.props.interactive&&t===n||"parent"===t?r.parentNode:i(t,[r]);e.contains(z)||e.appendChild(z);$.state.isMounted=!0,Ce()}()},hide:function(){var e=!$.state.isVisible,t=$.state.isDestroyed,n=!$.state.isEnabled,o=r($.props.duration,1,R.duration);if(e||t||n)return;if(ae("onHide",[$],!1),!1===$.props.onHide($))return;$.state.isVisible=!1,$.state.isShown=!1,_=!1,V=!1,ee()&&(z.style.visibility="hidden");if(ce(),ve(),ie(!0),ee()){var i=re(),a=i.box,s=i.content;$.props.animation&&(b([a,s],o),y([a,s],"hidden"))}se(),ue(),$.props.animation?ee()&&function(e,t){me(e,(function(){!$.state.isVisible&&z.parentNode&&z.parentNode.contains(z)&&t()}))}(o,$.unmount):$.unmount()},hideWithInteractivity:function(e){ne().addEventListener("mousemove",W),c(H,W),W(e)},enable:function(){$.state.isEnabled=!0},disable:function(){$.hide(),$.state.isEnabled=!1},unmount:function(){$.state.isVisible&&$.hide();if(!$.state.isMounted)return;Te(),Ae().forEach((function(e){e._tippy.unmount()})),z.parentNode&&z.parentNode.removeChild(z);U=U.filter((function(e){return e!==$})),$.state.isMounted=!1,ae("onHidden",[$])},destroy:function(){if($.state.isDestroyed)return;$.clearDelayTimeouts(),$.unmount(),be(),delete o._tippy,$.state.isDestroyed=!0,ae("onDestroy",[$])}};if(!M.render)return $;var q=M.render($),z=q.popper,J=q.onUpdate;z.setAttribute("data-tippy-root",""),z.id="tippy-"+$.id,$.popper=z,o._tippy=$,z._tippy=$;var G=Y.map((function(e){return e.fn($)})),K=o.hasAttribute("aria-expanded");return he(),ue(),ie(),ae("onCreate",[$]),M.showOnCreate&&Le(),z.addEventListener("mouseenter",(function(){$.props.interactive&&$.state.isVisible&&$.clearDelayTimeouts()})),z.addEventListener("mouseleave",(function(){$.props.interactive&&$.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",W)})),$;function Q(){var e=$.props.touch;return Array.isArray(e)?e:[e,0]}function Z(){return"hold"===Q()[0]}function ee(){var e;return!(null==(e=$.props.render)||!e.$$tippy)}function te(){return L||o}function ne(){var e=te().parentNode;return e?w(e):document}function re(){return S(z)}function oe(e){return $.state.isMounted&&!$.state.isVisible||x.isTouch||C&&"focus"===C.type?0:r($.props.delay,e?0:1,R.delay)}function ie(e){void 0===e&&(e=!1),z.style.pointerEvents=$.props.interactive&&!e?"":"none",z.style.zIndex=""+$.props.zIndex}function ae(e,t,n){var r;(void 0===n&&(n=!0),G.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=$.props)[e].apply(r,t)}function se(){var e=$.props.aria;if(e.content){var t="aria-"+e.content,n=z.id;u($.props.triggerTarget||o).forEach((function(e){var r=e.getAttribute(t);if($.state.isVisible)e.setAttribute(t,r?r+" "+n:n);else{var o=r&&r.replace(n,"").trim();o?e.setAttribute(t,o):e.removeAttribute(t)}}))}}function ue(){!K&&$.props.aria.expanded&&u($.props.triggerTarget||o).forEach((function(e){$.props.interactive?e.setAttribute("aria-expanded",$.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function ce(){ne().removeEventListener("mousemove",W),H=H.filter((function(e){return e!==W}))}function pe(e){if(!x.isTouch||!N&&"mousedown"!==e.type){var t=e.composedPath&&e.composedPath()[0]||e.target;if(!$.props.interactive||!O(z,t)){if(u($.props.triggerTarget||o).some((function(e){return O(e,t)}))){if(x.isTouch)return;if($.state.isVisible&&$.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[$,e]);!0===$.props.hideOnClick&&($.clearDelayTimeouts(),$.hide(),I=!0,setTimeout((function(){I=!1})),$.state.isMounted||ve())}}}function fe(){N=!0}function le(){N=!1}function de(){var e=ne();e.addEventListener("mousedown",pe,!0),e.addEventListener("touchend",pe,t),e.addEventListener("touchstart",le,t),e.addEventListener("touchmove",fe,t)}function ve(){var e=ne();e.removeEventListener("mousedown",pe,!0),e.removeEventListener("touchend",pe,t),e.removeEventListener("touchstart",le,t),e.removeEventListener("touchmove",fe,t)}function me(e,t){var n=re().box;function r(e){e.target===n&&(E(n,"remove",r),t())}if(0===e)return t();E(n,"remove",T),E(n,"add",r),T=r}function ge(e,t,n){void 0===n&&(n=!1),u($.props.triggerTarget||o).forEach((function(r){r.addEventListener(e,t,n),F.push({node:r,eventType:e,handler:t,options:n})}))}function he(){var e;Z()&&(ge("touchstart",ye,{passive:!0}),ge("touchend",Ee,{passive:!0})),(e=$.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ge(e,ye),e){case"mouseenter":ge("mouseleave",Ee);break;case"focus":ge(D?"focusout":"blur",Oe);break;case"focusin":ge("focusout",Oe)}}))}function be(){F.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),F=[]}function ye(e){var t,n=!1;if($.state.isEnabled&&!xe(e)&&!I){var r="focus"===(null==(t=C)?void 0:t.type);C=e,L=e.currentTarget,ue(),!$.state.isVisible&&m(e)&&H.forEach((function(t){return t(e)})),"click"===e.type&&($.props.trigger.indexOf("mouseenter")<0||V)&&!1!==$.props.hideOnClick&&$.state.isVisible?n=!0:Le(e),"click"===e.type&&(V=!n),n&&!r&&De(e)}}function we(e){var t=e.target,n=te().contains(t)||z.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=p(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,f="right"===a?s.left.x:0,l="left"===a?s.right.x:0,d=t.top-r+u>i,v=r-t.bottom-c>i,m=t.left-n+f>i,g=n-t.right-l>i;return d||v||m||g}))}(Ae().concat(z).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:M}:null})).filter(Boolean),e)&&(ce(),De(e))}function Ee(e){xe(e)||$.props.trigger.indexOf("click")>=0&&V||($.props.interactive?$.hideWithInteractivity(e):De(e))}function Oe(e){$.props.trigger.indexOf("focusin")<0&&e.target!==te()||$.props.interactive&&e.relatedTarget&&z.contains(e.relatedTarget)||De(e)}function xe(e){return!!x.isTouch&&Z()!==e.type.indexOf("touch")>=0}function Ce(){Te();var t=$.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,u=ee()?S(z).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:o,p=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ee()){var n=re().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];ee()&&u&&p.push({name:"arrow",options:{element:u,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),$.popperInstance=e.createPopper(c,z,Object.assign({},n,{placement:r,onFirstUpdate:A,modifiers:p}))}function Te(){$.popperInstance&&($.popperInstance.destroy(),$.popperInstance=null)}function Ae(){return f(z.querySelectorAll("[data-tippy-root]"))}function Le(e){$.clearDelayTimeouts(),e&&ae("onTrigger",[$,e]),de();var t=oe(!0),n=Q(),r=n[0],o=n[1];x.isTouch&&"hold"===r&&o&&(t=o),t?v=setTimeout((function(){$.show()}),t):$.show()}function De(e){if($.clearDelayTimeouts(),ae("onUntrigger",[$,e]),$.state.isVisible){if(!($.props.trigger.indexOf("mouseenter")>=0&&$.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&V)){var t=oe(!1);t?g=setTimeout((function(){$.state.isVisible&&$.hide()}),t):h=requestAnimationFrame((function(){$.hide()}))}}else ve()}}function F(e,n){void 0===n&&(n={});var r=R.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",T,t),window.addEventListener("blur",L);var o=Object.assign({},n,{plugins:r}),i=h(e).reduce((function(e,t){var n=t&&_(t,o);return n&&e.push(n),e}),[]);return v(e)?i[0]:i}F.defaultProps=R,F.setDefaultProps=function(e){Object.keys(e).forEach((function(t){R[t]=e[t]}))},F.currentInput=x;var W=Object.assign({},e.applyStyles,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),X={mouseover:"mouseenter",focusin:"focus",click:"click"};var Y={name:"animateFill",defaultValue:!1,fn:function(e){var t;if(null==(t=e.props.render)||!t.$$tippy)return{};var n=S(e.popper),r=n.box,o=n.content,i=e.props.animateFill?function(){var e=d();return e.className="tippy-backdrop",y([e],"hidden"),e}():null;return{onCreate:function(){i&&(r.insertBefore(i,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(i){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms",i.style.transitionDuration=e,y([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&y([i],"hidden")}}}};var $={clientX:0,clientY:0},q=[];function z(e){var t=e.clientX,n=e.clientY;$={clientX:t,clientY:n}}var J={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=w(e.props.triggerTarget||t),r=!1,o=!1,i=!0,a=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function u(){n.addEventListener("mousemove",f)}function c(){n.removeEventListener("mousemove",f)}function p(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||t.contains(n.target),o=e.props.followCursor,i=n.clientX,a=n.clientY,s=t.getBoundingClientRect(),u=i-s.left,c=a-s.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=i,r=a;"initial"===o&&(n=e.left+u,r=e.top+c);var s="horizontal"===o?e.top:r,p="vertical"===o?e.right:n,f="horizontal"===o?e.bottom:r,l="vertical"===o?e.left:n;return{width:p-l,height:f-s,top:s,right:p,bottom:f,left:l}}})}function l(){e.props.followCursor&&(q.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",z)}(n))}function d(){0===(q=q.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",z)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,n){var i=n.followCursor;r||void 0!==i&&a.followCursor!==i&&(d(),i?(l(),!e.state.isMounted||o||s()||u()):(c(),p()))},onMount:function(){e.props.followCursor&&!o&&(i&&(f($),i=!1),s()||u())},onTrigger:function(e,t){m(t)&&($={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(p(),c(),i=!0)}}}};var G={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,n=e.reference;var r=-1,o=!1,i=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(o){var a=o.state;e.props.inlinePositioning&&(-1!==i.indexOf(a.placement)&&(i=[]),t!==a.placement&&-1===i.indexOf(a.placement)&&(i.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,n,r){if(n.length<2||null===e)return t;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||t;switch(e){case"top":case"bottom":var o=n[0],i=n[n.length-1],a="top"===e,s=o.top,u=i.bottom,c=a?o.left:i.left,p=a?o.right:i.right;return{top:s,bottom:u,left:c,right:p,width:p-c,height:u-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(e){return e.left}))),l=Math.max.apply(Math,n.map((function(e){return e.right}))),d=n.filter((function(t){return"left"===e?t.left===f:t.right===l})),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return t}}(p(e),n.getBoundingClientRect(),f(n.getClientRects()),r)}(a.placement)}})),t=a.placement)}};function s(){var t;o||(t=function(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),o=!0,e.setProps(t),o=!1)}return{onCreate:s,onAfterUpdate:s,onTrigger:function(t,n){if(m(n)){var o=f(e.reference.getClientRects()),i=o.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY})),a=o.indexOf(i);r=a>-1?a:r}},onHidden:function(){r=-1}}}};var K={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function r(t){return!0===e.props.sticky||e.props.sticky===t}var o=null,i=null;function a(){var s=r("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,u=r("popper")?n.getBoundingClientRect():null;(s&&Q(o,s)||u&&Q(i,u))&&e.popperInstance&&e.popperInstance.update(),o=s,i=u,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function Q(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}return F.setDefaultProps({plugins:[Y,J,G,K],render:N}),F.createSingleton=function(e,t){var n;void 0===t&&(t={});var r,o=e,i=[],a=[],c=t.overrides,p=[],f=!1;function l(){a=o.map((function(e){return u(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function v(){i=o.map((function(e){return e.reference}))}function m(e){o.forEach((function(t){e?t.enable():t.disable()}))}function g(e){return o.map((function(t){var n=t.setProps;return t.setProps=function(o){n(o),t.reference===r&&e.setProps(o)},function(){t.setProps=n}}))}function h(e,t){var n=a.indexOf(t);if(t!==r){r=t;var s=(c||[]).concat("content").reduce((function(e,t){return e[t]=o[n].props[t],e}),{});e.setProps(Object.assign({},s,{getReferenceClientRect:"function"==typeof s.getReferenceClientRect?s.getReferenceClientRect:function(){var e;return null==(e=i[n])?void 0:e.getBoundingClientRect()}}))}}m(!1),v(),l();var b={fn:function(){return{onDestroy:function(){m(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!f&&(f=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!f&&(f=!0,h(e,i[0]))},onTrigger:function(e,t){h(e,t.currentTarget)}}}},y=F(d(),Object.assign({},s(t,["overrides"]),{plugins:[b].concat(t.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(n=t.popperOptions)?void 0:n.modifiers)||[],[W])})})),w=y.show;y.show=function(e){if(w(),!r&&null==e)return h(y,i[0]);if(!r||null!=e){if("number"==typeof e)return i[e]&&h(y,i[e]);if(o.indexOf(e)>=0){var t=e.reference;return h(y,t)}return i.indexOf(e)>=0?h(y,e):void 0}},y.showNext=function(){var e=i[0];if(!r)return y.show(0);var t=i.indexOf(r);y.show(i[t+1]||e)},y.showPrevious=function(){var e=i[i.length-1];if(!r)return y.show(e);var t=i.indexOf(r),n=i[t-1]||e;y.show(n)};var E=y.setProps;return y.setProps=function(e){c=e.overrides||c,E(e)},y.setInstances=function(e){m(!0),p.forEach((function(e){return e()})),o=e,m(!1),v(),l(),p=g(y),y.setProps({triggerTarget:a})},p=g(y),y},F.delegate=function(e,n){var r=[],o=[],i=!1,a=n.target,c=s(n,["target"]),p=Object.assign({},c,{trigger:"manual",touch:!1}),f=Object.assign({touch:R.touch},c,{showOnCreate:!0}),l=F(e,p);function d(e){if(e.target&&!i){var t=e.target.closest(a);if(t){var r=t.getAttribute("data-tippy-trigger")||n.trigger||R.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof f.touch||"touchstart"!==e.type&&r.indexOf(X[e.type])<0)){var s=F(t,f);s&&(o=o.concat(s))}}}}function v(e,t,n,o){void 0===o&&(o=!1),e.addEventListener(t,n,o),r.push({node:e,eventType:t,handler:n,options:o})}return u(l).forEach((function(e){var n=e.destroy,a=e.enable,s=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&o.forEach((function(e){e.destroy()})),o=[],r.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),r=[],n()},e.enable=function(){a(),o.forEach((function(e){return e.enable()})),i=!1},e.disable=function(){s(),o.forEach((function(e){return e.disable()})),i=!0},function(e){var n=e.reference;v(n,"touchstart",d,t),v(n,"mouseover",d),v(n,"focusin",d),v(n,"click",d)}(e)})),l},F.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;U.forEach((function(e){var t=!1;if(n&&(t=g(n)?e.reference===n:e.popper===n.popper),!t){var o=e.props.duration;e.setProps({duration:r}),e.hide(),e.state.isDestroyed||e.setProps({duration:o})}}))},F.roundArrow='',F})); 2 | 3 | -------------------------------------------------------------------------------- /_book/site_libs/quarto-html/quarto.js: -------------------------------------------------------------------------------- 1 | const sectionChanged = new CustomEvent("quarto-sectionChanged", { 2 | detail: {}, 3 | bubbles: true, 4 | cancelable: false, 5 | composed: false, 6 | }); 7 | 8 | window.document.addEventListener("DOMContentLoaded", function (_event) { 9 | const tocEl = window.document.querySelector('nav[role="doc-toc"]'); 10 | const sidebarEl = window.document.getElementById("quarto-sidebar"); 11 | const leftTocEl = window.document.getElementById("quarto-sidebar-toc-left"); 12 | const marginSidebarEl = window.document.getElementById( 13 | "quarto-margin-sidebar" 14 | ); 15 | // function to determine whether the element has a previous sibling that is active 16 | const prevSiblingIsActiveLink = (el) => { 17 | const sibling = el.previousElementSibling; 18 | if (sibling && sibling.tagName === "A") { 19 | return sibling.classList.contains("active"); 20 | } else { 21 | return false; 22 | } 23 | }; 24 | 25 | // fire slideEnter for bootstrap tab activations (for htmlwidget resize behavior) 26 | function fireSlideEnter(e) { 27 | const event = window.document.createEvent("Event"); 28 | event.initEvent("slideenter", true, true); 29 | window.document.dispatchEvent(event); 30 | } 31 | const tabs = window.document.querySelectorAll('a[data-bs-toggle="tab"]'); 32 | tabs.forEach((tab) => { 33 | tab.addEventListener("shown.bs.tab", fireSlideEnter); 34 | }); 35 | 36 | // Track scrolling and mark TOC links as active 37 | // get table of contents and sidebar (bail if we don't have at least one) 38 | const tocLinks = tocEl 39 | ? [...tocEl.querySelectorAll("a[data-scroll-target]")] 40 | : []; 41 | const makeActive = (link) => tocLinks[link].classList.add("active"); 42 | const removeActive = (link) => tocLinks[link].classList.remove("active"); 43 | const removeAllActive = () => 44 | [...Array(tocLinks.length).keys()].forEach((link) => removeActive(link)); 45 | 46 | // activate the anchor for a section associated with this TOC entry 47 | tocLinks.forEach((link) => { 48 | link.addEventListener("click", () => { 49 | if (link.href.indexOf("#") !== -1) { 50 | const anchor = link.href.split("#")[1]; 51 | const heading = window.document.querySelector( 52 | `[data-anchor-id=${anchor}]` 53 | ); 54 | if (heading) { 55 | // Add the class 56 | heading.classList.add("reveal-anchorjs-link"); 57 | 58 | // function to show the anchor 59 | const handleMouseout = () => { 60 | heading.classList.remove("reveal-anchorjs-link"); 61 | heading.removeEventListener("mouseout", handleMouseout); 62 | }; 63 | 64 | // add a function to clear the anchor when the user mouses out of it 65 | heading.addEventListener("mouseout", handleMouseout); 66 | } 67 | } 68 | }); 69 | }); 70 | 71 | const sections = tocLinks.map((link) => { 72 | const target = link.getAttribute("data-scroll-target"); 73 | if (target.startsWith("#")) { 74 | return window.document.getElementById(decodeURI(`${target.slice(1)}`)); 75 | } else { 76 | return window.document.querySelector(decodeURI(`${target}`)); 77 | } 78 | }); 79 | 80 | const sectionMargin = 200; 81 | let currentActive = 0; 82 | // track whether we've initialized state the first time 83 | let init = false; 84 | 85 | const updateActiveLink = () => { 86 | // The index from bottom to top (e.g. reversed list) 87 | let sectionIndex = -1; 88 | if ( 89 | window.innerHeight + window.pageYOffset >= 90 | window.document.body.offsetHeight 91 | ) { 92 | sectionIndex = 0; 93 | } else { 94 | sectionIndex = [...sections].reverse().findIndex((section) => { 95 | if (section) { 96 | return window.pageYOffset >= section.offsetTop - sectionMargin; 97 | } else { 98 | return false; 99 | } 100 | }); 101 | } 102 | if (sectionIndex > -1) { 103 | const current = sections.length - sectionIndex - 1; 104 | if (current !== currentActive) { 105 | removeAllActive(); 106 | currentActive = current; 107 | makeActive(current); 108 | if (init) { 109 | window.dispatchEvent(sectionChanged); 110 | } 111 | init = true; 112 | } 113 | } 114 | }; 115 | 116 | const inHiddenRegion = (top, bottom, hiddenRegions) => { 117 | for (const region of hiddenRegions) { 118 | if (top <= region.bottom && bottom >= region.top) { 119 | return true; 120 | } 121 | } 122 | return false; 123 | }; 124 | 125 | const categorySelector = "header.quarto-title-block .quarto-category"; 126 | const activateCategories = (href) => { 127 | // Find any categories 128 | // Surround them with a link pointing back to: 129 | // #category=Authoring 130 | try { 131 | const categoryEls = window.document.querySelectorAll(categorySelector); 132 | for (const categoryEl of categoryEls) { 133 | const categoryText = categoryEl.textContent; 134 | if (categoryText) { 135 | const link = `${href}#category=${encodeURIComponent(categoryText)}`; 136 | const linkEl = window.document.createElement("a"); 137 | linkEl.setAttribute("href", link); 138 | for (const child of categoryEl.childNodes) { 139 | linkEl.append(child); 140 | } 141 | categoryEl.appendChild(linkEl); 142 | } 143 | } 144 | } catch { 145 | // Ignore errors 146 | } 147 | }; 148 | function hasTitleCategories() { 149 | return window.document.querySelector(categorySelector) !== null; 150 | } 151 | 152 | function offsetRelativeUrl(url) { 153 | const offset = getMeta("quarto:offset"); 154 | return offset ? offset + url : url; 155 | } 156 | 157 | function offsetAbsoluteUrl(url) { 158 | const offset = getMeta("quarto:offset"); 159 | const baseUrl = new URL(offset, window.location); 160 | 161 | const projRelativeUrl = url.replace(baseUrl, ""); 162 | if (projRelativeUrl.startsWith("/")) { 163 | return projRelativeUrl; 164 | } else { 165 | return "/" + projRelativeUrl; 166 | } 167 | } 168 | 169 | // read a meta tag value 170 | function getMeta(metaName) { 171 | const metas = window.document.getElementsByTagName("meta"); 172 | for (let i = 0; i < metas.length; i++) { 173 | if (metas[i].getAttribute("name") === metaName) { 174 | return metas[i].getAttribute("content"); 175 | } 176 | } 177 | return ""; 178 | } 179 | 180 | async function findAndActivateCategories() { 181 | const currentPagePath = offsetAbsoluteUrl(window.location.href); 182 | const response = await fetch(offsetRelativeUrl("listings.json")); 183 | if (response.status == 200) { 184 | return response.json().then(function (listingPaths) { 185 | const listingHrefs = []; 186 | for (const listingPath of listingPaths) { 187 | const pathWithoutLeadingSlash = listingPath.listing.substring(1); 188 | for (const item of listingPath.items) { 189 | if ( 190 | item === currentPagePath || 191 | item === currentPagePath + "index.html" 192 | ) { 193 | // Resolve this path against the offset to be sure 194 | // we already are using the correct path to the listing 195 | // (this adjusts the listing urls to be rooted against 196 | // whatever root the page is actually running against) 197 | const relative = offsetRelativeUrl(pathWithoutLeadingSlash); 198 | const baseUrl = window.location; 199 | const resolvedPath = new URL(relative, baseUrl); 200 | listingHrefs.push(resolvedPath.pathname); 201 | break; 202 | } 203 | } 204 | } 205 | 206 | // Look up the tree for a nearby linting and use that if we find one 207 | const nearestListing = findNearestParentListing( 208 | offsetAbsoluteUrl(window.location.pathname), 209 | listingHrefs 210 | ); 211 | if (nearestListing) { 212 | activateCategories(nearestListing); 213 | } else { 214 | // See if the referrer is a listing page for this item 215 | const referredRelativePath = offsetAbsoluteUrl(document.referrer); 216 | const referrerListing = listingHrefs.find((listingHref) => { 217 | const isListingReferrer = 218 | listingHref === referredRelativePath || 219 | listingHref === referredRelativePath + "index.html"; 220 | return isListingReferrer; 221 | }); 222 | 223 | if (referrerListing) { 224 | // Try to use the referrer if possible 225 | activateCategories(referrerListing); 226 | } else if (listingHrefs.length > 0) { 227 | // Otherwise, just fall back to the first listing 228 | activateCategories(listingHrefs[0]); 229 | } 230 | } 231 | }); 232 | } 233 | } 234 | if (hasTitleCategories()) { 235 | findAndActivateCategories(); 236 | } 237 | 238 | const findNearestParentListing = (href, listingHrefs) => { 239 | if (!href || !listingHrefs) { 240 | return undefined; 241 | } 242 | // Look up the tree for a nearby linting and use that if we find one 243 | const relativeParts = href.substring(1).split("/"); 244 | while (relativeParts.length > 0) { 245 | const path = relativeParts.join("/"); 246 | for (const listingHref of listingHrefs) { 247 | if (listingHref.startsWith(path)) { 248 | return listingHref; 249 | } 250 | } 251 | relativeParts.pop(); 252 | } 253 | 254 | return undefined; 255 | }; 256 | 257 | const manageSidebarVisiblity = (el, placeholderDescriptor) => { 258 | let isVisible = true; 259 | 260 | return (hiddenRegions) => { 261 | if (el === null) { 262 | return; 263 | } 264 | 265 | // Find the last element of the TOC 266 | const lastChildEl = el.lastElementChild; 267 | 268 | if (lastChildEl) { 269 | // Find the top and bottom o the element that is being managed 270 | const elTop = el.offsetTop; 271 | const elBottom = 272 | elTop + lastChildEl.offsetTop + lastChildEl.offsetHeight; 273 | 274 | // Converts the sidebar to a menu 275 | const convertToMenu = () => { 276 | for (const child of el.children) { 277 | child.style.opacity = 0; 278 | child.style.display = "none"; 279 | } 280 | 281 | const toggleContainer = window.document.createElement("div"); 282 | toggleContainer.style.width = "100%"; 283 | toggleContainer.classList.add("zindex-over-content"); 284 | toggleContainer.classList.add("quarto-sidebar-toggle"); 285 | toggleContainer.classList.add("headroom-target"); // Marks this to be managed by headeroom 286 | toggleContainer.id = placeholderDescriptor.id; 287 | toggleContainer.style.position = "fixed"; 288 | 289 | const toggleIcon = window.document.createElement("i"); 290 | toggleIcon.classList.add("quarto-sidebar-toggle-icon"); 291 | toggleIcon.classList.add("bi"); 292 | toggleIcon.classList.add("bi-caret-down-fill"); 293 | 294 | const toggleTitle = window.document.createElement("div"); 295 | const titleEl = window.document.body.querySelector( 296 | placeholderDescriptor.titleSelector 297 | ); 298 | if (titleEl) { 299 | toggleTitle.append(titleEl.innerText, toggleIcon); 300 | } 301 | toggleTitle.classList.add("zindex-over-content"); 302 | toggleTitle.classList.add("quarto-sidebar-toggle-title"); 303 | toggleContainer.append(toggleTitle); 304 | 305 | const toggleContents = window.document.createElement("div"); 306 | toggleContents.classList = el.classList; 307 | toggleContents.classList.add("zindex-over-content"); 308 | toggleContents.classList.add("quarto-sidebar-toggle-contents"); 309 | for (const child of el.children) { 310 | if (child.id === "toc-title") { 311 | continue; 312 | } 313 | 314 | const clone = child.cloneNode(true); 315 | clone.style.opacity = 1; 316 | clone.style.display = null; 317 | toggleContents.append(clone); 318 | } 319 | toggleContents.style.height = "0px"; 320 | toggleContainer.append(toggleContents); 321 | el.parentElement.prepend(toggleContainer); 322 | 323 | // Process clicks 324 | let tocShowing = false; 325 | // Allow the caller to control whether this is dismissed 326 | // when it is clicked (e.g. sidebar navigation supports 327 | // opening and closing the nav tree, so don't dismiss on click) 328 | const clickEl = placeholderDescriptor.dismissOnClick 329 | ? toggleContainer 330 | : toggleTitle; 331 | 332 | const closeToggle = () => { 333 | if (tocShowing) { 334 | toggleContainer.classList.remove("expanded"); 335 | toggleContents.style.height = "0px"; 336 | tocShowing = false; 337 | } 338 | }; 339 | 340 | const positionToggle = () => { 341 | // position the element (top left of parent, same width as parent) 342 | const elRect = el.getBoundingClientRect(); 343 | toggleContainer.style.left = `${elRect.left}px`; 344 | toggleContainer.style.top = `${elRect.top}px`; 345 | toggleContainer.style.width = `${elRect.width}px`; 346 | }; 347 | 348 | // Get rid of any expanded toggle if the user scrolls 349 | window.document.addEventListener( 350 | "scroll", 351 | throttle(() => { 352 | closeToggle(); 353 | }, 50) 354 | ); 355 | 356 | // Handle positioning of the toggle 357 | window.addEventListener( 358 | "resize", 359 | throttle(() => { 360 | positionToggle(); 361 | }, 50) 362 | ); 363 | positionToggle(); 364 | 365 | // Process the click 366 | clickEl.onclick = () => { 367 | if (!tocShowing) { 368 | toggleContainer.classList.add("expanded"); 369 | toggleContents.style.height = null; 370 | tocShowing = true; 371 | } else { 372 | closeToggle(); 373 | } 374 | }; 375 | }; 376 | 377 | // Converts a sidebar from a menu back to a sidebar 378 | const convertToSidebar = () => { 379 | for (const child of el.children) { 380 | child.style.opacity = 1; 381 | clone.style.display = null; 382 | } 383 | 384 | const placeholderEl = window.document.getElementById( 385 | placeholderDescriptor.id 386 | ); 387 | if (placeholderEl) { 388 | placeholderEl.remove(); 389 | } 390 | 391 | el.classList.remove("rollup"); 392 | }; 393 | 394 | if (isReaderMode()) { 395 | convertToMenu(); 396 | isVisible = false; 397 | } else { 398 | if (!isVisible) { 399 | // If the element is current not visible reveal if there are 400 | // no conflicts with overlay regions 401 | if (!inHiddenRegion(elTop, elBottom, hiddenRegions)) { 402 | convertToSidebar(); 403 | isVisible = true; 404 | } 405 | } else { 406 | // If the element is visible, hide it if it conflicts with overlay regions 407 | // and insert a placeholder toggle (or if we're in reader mode) 408 | if (inHiddenRegion(elTop, elBottom, hiddenRegions)) { 409 | convertToMenu(); 410 | isVisible = false; 411 | } 412 | } 413 | } 414 | } 415 | }; 416 | }; 417 | 418 | // Find any conflicting margin elements and add margins to the 419 | // top to prevent overlap 420 | const marginChildren = window.document.querySelectorAll( 421 | ".column-margin.column-container > * " 422 | ); 423 | let lastBottom = 0; 424 | for (const marginChild of marginChildren) { 425 | const top = marginChild.getBoundingClientRect().top; 426 | if (top < lastBottom) { 427 | const margin = lastBottom - top; 428 | marginChild.style.marginTop = `${margin}px`; 429 | } 430 | const styles = window.getComputedStyle(marginChild); 431 | const marginTop = parseFloat(styles["marginTop"]); 432 | 433 | lastBottom = top + marginChild.getBoundingClientRect().height + marginTop; 434 | } 435 | 436 | // Manage the visibility of the toc and the sidebar 437 | const marginScrollVisibility = manageSidebarVisiblity(marginSidebarEl, { 438 | id: "quarto-toc-toggle", 439 | titleSelector: "#toc-title", 440 | dismissOnClick: true, 441 | }); 442 | const sidebarScrollVisiblity = manageSidebarVisiblity(sidebarEl, { 443 | id: "quarto-sidebarnav-toggle", 444 | titleSelector: ".title", 445 | dismissOnClick: false, 446 | }); 447 | let tocLeftScrollVisibility; 448 | if (leftTocEl) { 449 | tocLeftScrollVisibility = manageSidebarVisiblity(leftTocEl, { 450 | id: "quarto-lefttoc-toggle", 451 | titleSelector: "#toc-title", 452 | dismissOnClick: true, 453 | }); 454 | } 455 | 456 | // Find the first element that uses formatting in special columns 457 | const conflictingEls = window.document.body.querySelectorAll( 458 | '[class^="column-"], [class*=" column-"], aside, [class*="margin-caption"], [class*=" margin-caption"], [class*="margin-ref"], [class*=" margin-ref"]' 459 | ); 460 | 461 | // Filter all the possibly conflicting elements into ones 462 | // the do conflict on the left or ride side 463 | const arrConflictingEls = Array.from(conflictingEls); 464 | const leftSideConflictEls = arrConflictingEls.filter((el) => { 465 | if (el.tagName === "ASIDE") { 466 | return false; 467 | } 468 | return Array.from(el.classList).find((className) => { 469 | return ( 470 | className !== "column-body" && 471 | className.startsWith("column-") && 472 | !className.endsWith("right") && 473 | !className.endsWith("container") && 474 | className !== "column-margin" 475 | ); 476 | }); 477 | }); 478 | const rightSideConflictEls = arrConflictingEls.filter((el) => { 479 | if (el.tagName === "ASIDE") { 480 | return true; 481 | } 482 | 483 | const hasMarginCaption = Array.from(el.classList).find((className) => { 484 | return className == "margin-caption"; 485 | }); 486 | if (hasMarginCaption) { 487 | return true; 488 | } 489 | 490 | return Array.from(el.classList).find((className) => { 491 | return ( 492 | className !== "column-body" && 493 | !className.endsWith("container") && 494 | className.startsWith("column-") && 495 | !className.endsWith("left") 496 | ); 497 | }); 498 | }); 499 | 500 | const kOverlapPaddingSize = 10; 501 | function toRegions(els) { 502 | return els.map((el) => { 503 | const top = 504 | el.getBoundingClientRect().top + 505 | document.documentElement.scrollTop - 506 | kOverlapPaddingSize; 507 | return { 508 | top, 509 | bottom: top + el.scrollHeight + 2 * kOverlapPaddingSize, 510 | }; 511 | }); 512 | } 513 | 514 | const hideOverlappedSidebars = () => { 515 | marginScrollVisibility(toRegions(rightSideConflictEls)); 516 | sidebarScrollVisiblity(toRegions(leftSideConflictEls)); 517 | if (tocLeftScrollVisibility) { 518 | tocLeftScrollVisibility(toRegions(leftSideConflictEls)); 519 | } 520 | }; 521 | 522 | window.quartoToggleReader = () => { 523 | // Applies a slow class (or removes it) 524 | // to update the transition speed 525 | const slowTransition = (slow) => { 526 | const manageTransition = (id, slow) => { 527 | const el = document.getElementById(id); 528 | if (el) { 529 | if (slow) { 530 | el.classList.add("slow"); 531 | } else { 532 | el.classList.remove("slow"); 533 | } 534 | } 535 | }; 536 | 537 | manageTransition("TOC", slow); 538 | manageTransition("quarto-sidebar", slow); 539 | }; 540 | 541 | const readerMode = !isReaderMode(); 542 | setReaderModeValue(readerMode); 543 | 544 | // If we're entering reader mode, slow the transition 545 | if (readerMode) { 546 | slowTransition(readerMode); 547 | } 548 | highlightReaderToggle(readerMode); 549 | hideOverlappedSidebars(); 550 | 551 | // If we're exiting reader mode, restore the non-slow transition 552 | if (!readerMode) { 553 | slowTransition(!readerMode); 554 | } 555 | }; 556 | 557 | const highlightReaderToggle = (readerMode) => { 558 | const els = document.querySelectorAll(".quarto-reader-toggle"); 559 | if (els) { 560 | els.forEach((el) => { 561 | if (readerMode) { 562 | el.classList.add("reader"); 563 | } else { 564 | el.classList.remove("reader"); 565 | } 566 | }); 567 | } 568 | }; 569 | 570 | const setReaderModeValue = (val) => { 571 | if (window.location.protocol !== "file:") { 572 | window.localStorage.setItem("quarto-reader-mode", val); 573 | } else { 574 | localReaderMode = val; 575 | } 576 | }; 577 | 578 | const isReaderMode = () => { 579 | if (window.location.protocol !== "file:") { 580 | return window.localStorage.getItem("quarto-reader-mode") === "true"; 581 | } else { 582 | return localReaderMode; 583 | } 584 | }; 585 | let localReaderMode = null; 586 | 587 | // Walk the TOC and collapse/expand nodes 588 | // Nodes are expanded if: 589 | // - they are top level 590 | // - they have children that are 'active' links 591 | // - they are directly below an link that is 'active' 592 | const walk = (el, depth) => { 593 | // Tick depth when we enter a UL 594 | if (el.tagName === "UL") { 595 | depth = depth + 1; 596 | } 597 | 598 | // It this is active link 599 | let isActiveNode = false; 600 | if (el.tagName === "A" && el.classList.contains("active")) { 601 | isActiveNode = true; 602 | } 603 | 604 | // See if there is an active child to this element 605 | let hasActiveChild = false; 606 | for (child of el.children) { 607 | hasActiveChild = walk(child, depth) || hasActiveChild; 608 | } 609 | 610 | // Process the collapse state if this is an UL 611 | if (el.tagName === "UL") { 612 | if (depth === 1 || hasActiveChild || prevSiblingIsActiveLink(el)) { 613 | el.classList.remove("collapse"); 614 | } else { 615 | el.classList.add("collapse"); 616 | } 617 | 618 | // untick depth when we leave a UL 619 | depth = depth - 1; 620 | } 621 | return hasActiveChild || isActiveNode; 622 | }; 623 | 624 | // walk the TOC and expand / collapse any items that should be shown 625 | 626 | if (tocEl) { 627 | walk(tocEl, 0); 628 | updateActiveLink(); 629 | } 630 | 631 | // Throttle the scroll event and walk peridiocally 632 | window.document.addEventListener( 633 | "scroll", 634 | throttle(() => { 635 | if (tocEl) { 636 | updateActiveLink(); 637 | walk(tocEl, 0); 638 | } 639 | if (!isReaderMode()) { 640 | hideOverlappedSidebars(); 641 | } 642 | }, 5) 643 | ); 644 | window.addEventListener( 645 | "resize", 646 | throttle(() => { 647 | if (!isReaderMode()) { 648 | hideOverlappedSidebars(); 649 | } 650 | }, 10) 651 | ); 652 | hideOverlappedSidebars(); 653 | highlightReaderToggle(isReaderMode()); 654 | }); 655 | 656 | function throttle(func, wait) { 657 | let waiting = false; 658 | return function () { 659 | if (!waiting) { 660 | func.apply(this, arguments); 661 | waiting = true; 662 | setTimeout(function () { 663 | waiting = false; 664 | }, wait); 665 | } 666 | }; 667 | } 668 | -------------------------------------------------------------------------------- /_book/site_libs/quarto-search/quarto-search.js: -------------------------------------------------------------------------------- 1 | const kQueryArg = "q"; 2 | const kResultsArg = "show-results"; 3 | 4 | // If items don't provide a URL, then both the navigator and the onSelect 5 | // function aren't called (and therefore, the default implementation is used) 6 | // 7 | // We're using this sentinel URL to signal to those handlers that this 8 | // item is a more item (along with the type) and can be handled appropriately 9 | const kItemTypeMoreHref = "0767FDFD-0422-4E5A-BC8A-3BE11E5BBA05"; 10 | 11 | window.document.addEventListener("DOMContentLoaded", function (_event) { 12 | // Ensure that search is available on this page. If it isn't, 13 | // should return early and not do anything 14 | var searchEl = window.document.getElementById("quarto-search"); 15 | if (!searchEl) return; 16 | 17 | const { autocomplete } = window["@algolia/autocomplete-js"]; 18 | 19 | let quartoSearchOptions = {}; 20 | let language = {}; 21 | const searchOptionEl = window.document.getElementById( 22 | "quarto-search-options" 23 | ); 24 | if (searchOptionEl) { 25 | const jsonStr = searchOptionEl.textContent; 26 | quartoSearchOptions = JSON.parse(jsonStr); 27 | language = quartoSearchOptions.language; 28 | } 29 | 30 | // note the search mode 31 | if (quartoSearchOptions.type === "overlay") { 32 | searchEl.classList.add("type-overlay"); 33 | } else { 34 | searchEl.classList.add("type-textbox"); 35 | } 36 | 37 | // Used to determine highlighting behavior for this page 38 | // A `q` query param is expected when the user follows a search 39 | // to this page 40 | const currentUrl = new URL(window.location); 41 | const query = currentUrl.searchParams.get(kQueryArg); 42 | const showSearchResults = currentUrl.searchParams.get(kResultsArg); 43 | const mainEl = window.document.querySelector("main"); 44 | 45 | // highlight matches on the page 46 | if (query !== null && mainEl) { 47 | // perform any highlighting 48 | highlight(query, mainEl); 49 | 50 | // fix up the URL to remove the q query param 51 | const replacementUrl = new URL(window.location); 52 | replacementUrl.searchParams.delete(kQueryArg); 53 | window.history.replaceState({}, "", replacementUrl); 54 | } 55 | 56 | // function to clear highlighting on the page when the search query changes 57 | // (e.g. if the user edits the query or clears it) 58 | let highlighting = true; 59 | const resetHighlighting = (searchTerm) => { 60 | if (mainEl && highlighting && query !== null && searchTerm !== query) { 61 | clearHighlight(query, mainEl); 62 | highlighting = false; 63 | } 64 | }; 65 | 66 | // Clear search highlighting when the user scrolls sufficiently 67 | const resetFn = () => { 68 | resetHighlighting(""); 69 | window.removeEventListener("quarto-hrChanged", resetFn); 70 | window.removeEventListener("quarto-sectionChanged", resetFn); 71 | }; 72 | 73 | // Register this event after the initial scrolling and settling of events 74 | // on the page 75 | window.addEventListener("quarto-hrChanged", resetFn); 76 | window.addEventListener("quarto-sectionChanged", resetFn); 77 | 78 | // Responsively switch to overlay mode if the search is present on the navbar 79 | // Note that switching the sidebar to overlay mode requires more coordinate (not just 80 | // the media query since we generate different HTML for sidebar overlays than we do 81 | // for sidebar input UI) 82 | const detachedMediaQuery = 83 | quartoSearchOptions.type === "overlay" 84 | ? "all" 85 | : quartoSearchOptions.location === "navbar" 86 | ? "(max-width: 991px)" 87 | : "none"; 88 | 89 | // If configured, include the analytics client to send insights 90 | const plugins = configurePlugins(quartoSearchOptions); 91 | 92 | let lastState = null; 93 | const { setIsOpen } = autocomplete({ 94 | container: searchEl, 95 | detachedMediaQuery: detachedMediaQuery, 96 | defaultActiveItemId: 0, 97 | panelContainer: "#quarto-search-results", 98 | panelPlacement: quartoSearchOptions["panel-placement"], 99 | debug: false, 100 | plugins, 101 | classNames: { 102 | form: "d-flex", 103 | }, 104 | translations: { 105 | clearButtonTitle: language["search-clear-button-title"], 106 | detachedCancelButtonText: language["search-detached-cancel-button-title"], 107 | submitButtonTitle: language["search-submit-button-title"], 108 | }, 109 | initialState: { 110 | query, 111 | }, 112 | getItemUrl({ item }) { 113 | return item.href; 114 | }, 115 | onStateChange({ state }) { 116 | // Perhaps reset highlighting 117 | resetHighlighting(state.query); 118 | 119 | // If the panel just opened, ensure the panel is positioned properly 120 | if (state.isOpen) { 121 | if (lastState && !lastState.isOpen) { 122 | setTimeout(() => { 123 | positionPanel(quartoSearchOptions["panel-placement"]); 124 | }, 150); 125 | } 126 | } 127 | 128 | // Perhaps show the copy link 129 | showCopyLink(state.query, quartoSearchOptions); 130 | 131 | lastState = state; 132 | }, 133 | reshape({ sources, state }) { 134 | return sources.map((source) => { 135 | try { 136 | const items = source.getItems(); 137 | 138 | // Validate the items 139 | validateItems(items); 140 | 141 | // group the items by document 142 | const groupedItems = new Map(); 143 | items.forEach((item) => { 144 | const hrefParts = item.href.split("#"); 145 | const baseHref = hrefParts[0]; 146 | const isDocumentItem = hrefParts.length === 1; 147 | 148 | const items = groupedItems.get(baseHref); 149 | if (!items) { 150 | groupedItems.set(baseHref, [item]); 151 | } else { 152 | // If the href for this item matches the document 153 | // exactly, place this item first as it is the item that represents 154 | // the document itself 155 | if (isDocumentItem) { 156 | items.unshift(item); 157 | } else { 158 | items.push(item); 159 | } 160 | groupedItems.set(baseHref, items); 161 | } 162 | }); 163 | 164 | const reshapedItems = []; 165 | let count = 1; 166 | for (const [_key, value] of groupedItems) { 167 | const firstItem = value[0]; 168 | reshapedItems.push({ 169 | ...firstItem, 170 | type: kItemTypeDoc, 171 | }); 172 | 173 | const collapseMatches = quartoSearchOptions["collapse-after"]; 174 | const collapseCount = 175 | typeof collapseMatches === "number" ? collapseMatches : 1; 176 | 177 | if (value.length > 1) { 178 | const target = `search-more-${count}`; 179 | const isExpanded = 180 | state.context.expanded && 181 | state.context.expanded.includes(target); 182 | 183 | const remainingCount = value.length - collapseCount; 184 | 185 | for (let i = 1; i < value.length; i++) { 186 | if (collapseMatches && i === collapseCount) { 187 | reshapedItems.push({ 188 | target, 189 | title: isExpanded 190 | ? language["search-hide-matches-text"] 191 | : remainingCount === 1 192 | ? `${remainingCount} ${language["search-more-match-text"]}` 193 | : `${remainingCount} ${language["search-more-matches-text"]}`, 194 | type: kItemTypeMore, 195 | href: kItemTypeMoreHref, 196 | }); 197 | } 198 | 199 | if (isExpanded || !collapseMatches || i < collapseCount) { 200 | reshapedItems.push({ 201 | ...value[i], 202 | type: kItemTypeItem, 203 | target, 204 | }); 205 | } 206 | } 207 | } 208 | count += 1; 209 | } 210 | 211 | return { 212 | ...source, 213 | getItems() { 214 | return reshapedItems; 215 | }, 216 | }; 217 | } catch (error) { 218 | // Some form of error occurred 219 | return { 220 | ...source, 221 | getItems() { 222 | return [ 223 | { 224 | title: error.name || "An Error Occurred While Searching", 225 | text: 226 | error.message || 227 | "An unknown error occurred while attempting to perform the requested search.", 228 | type: kItemTypeError, 229 | }, 230 | ]; 231 | }, 232 | }; 233 | } 234 | }); 235 | }, 236 | navigator: { 237 | navigate({ itemUrl }) { 238 | if (itemUrl !== offsetURL(kItemTypeMoreHref)) { 239 | window.location.assign(itemUrl); 240 | } 241 | }, 242 | navigateNewTab({ itemUrl }) { 243 | if (itemUrl !== offsetURL(kItemTypeMoreHref)) { 244 | const windowReference = window.open(itemUrl, "_blank", "noopener"); 245 | if (windowReference) { 246 | windowReference.focus(); 247 | } 248 | } 249 | }, 250 | navigateNewWindow({ itemUrl }) { 251 | if (itemUrl !== offsetURL(kItemTypeMoreHref)) { 252 | window.open(itemUrl, "_blank", "noopener"); 253 | } 254 | }, 255 | }, 256 | getSources({ state, setContext, setActiveItemId, refresh }) { 257 | return [ 258 | { 259 | sourceId: "documents", 260 | getItemUrl({ item }) { 261 | if (item.href) { 262 | return offsetURL(item.href); 263 | } else { 264 | return undefined; 265 | } 266 | }, 267 | onSelect({ 268 | item, 269 | state, 270 | setContext, 271 | setIsOpen, 272 | setActiveItemId, 273 | refresh, 274 | }) { 275 | if (item.type === kItemTypeMore) { 276 | toggleExpanded(item, state, setContext, setActiveItemId, refresh); 277 | 278 | // Toggle more 279 | setIsOpen(true); 280 | } 281 | }, 282 | getItems({ query }) { 283 | const limit = quartoSearchOptions.limit; 284 | if (quartoSearchOptions.algolia) { 285 | return algoliaSearch(query, limit, quartoSearchOptions.algolia); 286 | } else { 287 | // Fuse search options 288 | const fuseSearchOptions = { 289 | isCaseSensitive: false, 290 | shouldSort: true, 291 | minMatchCharLength: 2, 292 | limit: limit, 293 | }; 294 | 295 | return readSearchData().then(function (fuse) { 296 | return fuseSearch(query, fuse, fuseSearchOptions); 297 | }); 298 | } 299 | }, 300 | templates: { 301 | noResults({ createElement }) { 302 | return createElement( 303 | "div", 304 | { class: "quarto-search-no-results" }, 305 | language["search-no-results-text"] 306 | ); 307 | }, 308 | header({ items, createElement }) { 309 | // count the documents 310 | const count = items.filter((item) => { 311 | return item.type === kItemTypeDoc; 312 | }).length; 313 | 314 | if (count > 0) { 315 | return createElement( 316 | "div", 317 | { class: "search-result-header" }, 318 | `${count} ${language["search-matching-documents-text"]}` 319 | ); 320 | } else { 321 | return createElement( 322 | "div", 323 | { class: "search-result-header-no-results" }, 324 | `` 325 | ); 326 | } 327 | }, 328 | footer({ _items, createElement }) { 329 | if ( 330 | quartoSearchOptions.algolia && 331 | quartoSearchOptions.algolia["show-logo"] 332 | ) { 333 | const libDir = quartoSearchOptions.algolia["libDir"]; 334 | const logo = createElement("img", { 335 | src: offsetURL( 336 | `${libDir}/quarto-search/search-by-algolia.svg` 337 | ), 338 | class: "algolia-search-logo", 339 | }); 340 | return createElement( 341 | "a", 342 | { href: "http://www.algolia.com/" }, 343 | logo 344 | ); 345 | } 346 | }, 347 | 348 | item({ item, createElement }) { 349 | return renderItem( 350 | item, 351 | createElement, 352 | state, 353 | setActiveItemId, 354 | setContext, 355 | refresh 356 | ); 357 | }, 358 | }, 359 | }, 360 | ]; 361 | }, 362 | }); 363 | 364 | // Remove the labeleledby attribute since it is pointing 365 | // to a non-existent label 366 | if (quartoSearchOptions.type === "overlay") { 367 | const inputEl = window.document.querySelector( 368 | "#quarto-search .aa-Autocomplete" 369 | ); 370 | if (inputEl) { 371 | inputEl.removeAttribute("aria-labelledby"); 372 | } 373 | } 374 | 375 | // If the main document scrolls dismiss the search results 376 | // (otherwise, since they're floating in the document they can scroll with the document) 377 | window.document.body.onscroll = () => { 378 | setIsOpen(false); 379 | }; 380 | 381 | if (showSearchResults) { 382 | setIsOpen(true); 383 | focusSearchInput(); 384 | } 385 | }); 386 | 387 | function configurePlugins(quartoSearchOptions) { 388 | const autocompletePlugins = []; 389 | const algoliaOptions = quartoSearchOptions.algolia; 390 | if ( 391 | algoliaOptions && 392 | algoliaOptions["analytics-events"] && 393 | algoliaOptions["search-only-api-key"] && 394 | algoliaOptions["application-id"] 395 | ) { 396 | const apiKey = algoliaOptions["search-only-api-key"]; 397 | const appId = algoliaOptions["application-id"]; 398 | 399 | // Aloglia insights may not be loaded because they require cookie consent 400 | // Use deferred loading so events will start being recorded when/if consent 401 | // is granted. 402 | const algoliaInsightsDeferredPlugin = deferredLoadPlugin(() => { 403 | if ( 404 | window.aa && 405 | window["@algolia/autocomplete-plugin-algolia-insights"] 406 | ) { 407 | window.aa("init", { 408 | appId, 409 | apiKey, 410 | useCookie: true, 411 | }); 412 | 413 | const { createAlgoliaInsightsPlugin } = 414 | window["@algolia/autocomplete-plugin-algolia-insights"]; 415 | // Register the insights client 416 | const algoliaInsightsPlugin = createAlgoliaInsightsPlugin({ 417 | insightsClient: window.aa, 418 | onItemsChange({ insights, insightsEvents }) { 419 | const events = insightsEvents.map((event) => { 420 | const maxEvents = event.objectIDs.slice(0, 20); 421 | return { 422 | ...event, 423 | objectIDs: maxEvents, 424 | }; 425 | }); 426 | 427 | insights.viewedObjectIDs(...events); 428 | }, 429 | }); 430 | return algoliaInsightsPlugin; 431 | } 432 | }); 433 | 434 | // Add the plugin 435 | autocompletePlugins.push(algoliaInsightsDeferredPlugin); 436 | return autocompletePlugins; 437 | } 438 | } 439 | 440 | // For plugins that may not load immediately, create a wrapper 441 | // plugin and forward events and plugin data once the plugin 442 | // is initialized. This is useful for cases like cookie consent 443 | // which may prevent the analytics insights event plugin from initializing 444 | // immediately. 445 | function deferredLoadPlugin(createPlugin) { 446 | let plugin = undefined; 447 | let subscribeObj = undefined; 448 | const wrappedPlugin = () => { 449 | if (!plugin && subscribeObj) { 450 | plugin = createPlugin(); 451 | if (plugin && plugin.subscribe) { 452 | plugin.subscribe(subscribeObj); 453 | } 454 | } 455 | return plugin; 456 | }; 457 | 458 | return { 459 | subscribe: (obj) => { 460 | subscribeObj = obj; 461 | }, 462 | onStateChange: (obj) => { 463 | const plugin = wrappedPlugin(); 464 | if (plugin && plugin.onStateChange) { 465 | plugin.onStateChange(obj); 466 | } 467 | }, 468 | onSubmit: (obj) => { 469 | const plugin = wrappedPlugin(); 470 | if (plugin && plugin.onSubmit) { 471 | plugin.onSubmit(obj); 472 | } 473 | }, 474 | onReset: (obj) => { 475 | const plugin = wrappedPlugin(); 476 | if (plugin && plugin.onReset) { 477 | plugin.onReset(obj); 478 | } 479 | }, 480 | getSources: (obj) => { 481 | const plugin = wrappedPlugin(); 482 | if (plugin && plugin.getSources) { 483 | return plugin.getSources(obj); 484 | } else { 485 | return Promise.resolve([]); 486 | } 487 | }, 488 | data: (obj) => { 489 | const plugin = wrappedPlugin(); 490 | if (plugin && plugin.data) { 491 | plugin.data(obj); 492 | } 493 | }, 494 | }; 495 | } 496 | 497 | function validateItems(items) { 498 | // Validate the first item 499 | if (items.length > 0) { 500 | const item = items[0]; 501 | const missingFields = []; 502 | if (item.href == undefined) { 503 | missingFields.push("href"); 504 | } 505 | if (!item.title == undefined) { 506 | missingFields.push("title"); 507 | } 508 | if (!item.text == undefined) { 509 | missingFields.push("text"); 510 | } 511 | 512 | if (missingFields.length === 1) { 513 | throw { 514 | name: `Error: Search index is missing the ${missingFields[0]} field.`, 515 | message: `The items being returned for this search do not include all the required fields. Please ensure that your index items include the ${missingFields[0]} field or use index-fields in your _quarto.yml file to specify the field names.`, 516 | }; 517 | } else if (missingFields.length > 1) { 518 | const missingFieldList = missingFields 519 | .map((field) => { 520 | return `${field}`; 521 | }) 522 | .join(", "); 523 | 524 | throw { 525 | name: `Error: Search index is missing the following fields: ${missingFieldList}.`, 526 | message: `The items being returned for this search do not include all the required fields. Please ensure that your index items includes the following fields: ${missingFieldList}, or use index-fields in your _quarto.yml file to specify the field names.`, 527 | }; 528 | } 529 | } 530 | } 531 | 532 | let lastQuery = null; 533 | function showCopyLink(query, options) { 534 | const language = options.language; 535 | lastQuery = query; 536 | // Insert share icon 537 | const inputSuffixEl = window.document.body.querySelector( 538 | ".aa-Form .aa-InputWrapperSuffix" 539 | ); 540 | 541 | if (inputSuffixEl) { 542 | let copyButtonEl = window.document.body.querySelector( 543 | ".aa-Form .aa-InputWrapperSuffix .aa-CopyButton" 544 | ); 545 | 546 | if (copyButtonEl === null) { 547 | copyButtonEl = window.document.createElement("button"); 548 | copyButtonEl.setAttribute("class", "aa-CopyButton"); 549 | copyButtonEl.setAttribute("type", "button"); 550 | copyButtonEl.setAttribute("title", language["search-copy-link-title"]); 551 | copyButtonEl.onmousedown = (e) => { 552 | e.preventDefault(); 553 | e.stopPropagation(); 554 | }; 555 | 556 | const linkIcon = "bi-clipboard"; 557 | const checkIcon = "bi-check2"; 558 | 559 | const shareIconEl = window.document.createElement("i"); 560 | shareIconEl.setAttribute("class", `bi ${linkIcon}`); 561 | copyButtonEl.appendChild(shareIconEl); 562 | inputSuffixEl.prepend(copyButtonEl); 563 | 564 | const clipboard = new window.ClipboardJS(".aa-CopyButton", { 565 | text: function (_trigger) { 566 | const copyUrl = new URL(window.location); 567 | copyUrl.searchParams.set(kQueryArg, lastQuery); 568 | copyUrl.searchParams.set(kResultsArg, "1"); 569 | return copyUrl.toString(); 570 | }, 571 | }); 572 | clipboard.on("success", function (e) { 573 | // Focus the input 574 | 575 | // button target 576 | const button = e.trigger; 577 | const icon = button.querySelector("i.bi"); 578 | 579 | // flash "checked" 580 | icon.classList.add(checkIcon); 581 | icon.classList.remove(linkIcon); 582 | setTimeout(function () { 583 | icon.classList.remove(checkIcon); 584 | icon.classList.add(linkIcon); 585 | }, 1000); 586 | }); 587 | } 588 | 589 | // If there is a query, show the link icon 590 | if (copyButtonEl) { 591 | if (lastQuery && options["copy-button"]) { 592 | copyButtonEl.style.display = "flex"; 593 | } else { 594 | copyButtonEl.style.display = "none"; 595 | } 596 | } 597 | } 598 | } 599 | 600 | /* Search Index Handling */ 601 | // create the index 602 | var fuseIndex = undefined; 603 | async function readSearchData() { 604 | // Initialize the search index on demand 605 | if (fuseIndex === undefined) { 606 | // create fuse index 607 | const options = { 608 | keys: [ 609 | { name: "title", weight: 20 }, 610 | { name: "section", weight: 20 }, 611 | { name: "text", weight: 10 }, 612 | ], 613 | ignoreLocation: true, 614 | threshold: 0.1, 615 | }; 616 | const fuse = new window.Fuse([], options); 617 | 618 | // fetch the main search.json 619 | const response = await fetch(offsetURL("search.json")); 620 | if (response.status == 200) { 621 | return response.json().then(function (searchDocs) { 622 | searchDocs.forEach(function (searchDoc) { 623 | fuse.add(searchDoc); 624 | }); 625 | fuseIndex = fuse; 626 | return fuseIndex; 627 | }); 628 | } else { 629 | return Promise.reject( 630 | new Error( 631 | "Unexpected status from search index request: " + response.status 632 | ) 633 | ); 634 | } 635 | } 636 | return fuseIndex; 637 | } 638 | 639 | function inputElement() { 640 | return window.document.body.querySelector(".aa-Form .aa-Input"); 641 | } 642 | 643 | function focusSearchInput() { 644 | setTimeout(() => { 645 | const inputEl = inputElement(); 646 | if (inputEl) { 647 | inputEl.focus(); 648 | } 649 | }, 50); 650 | } 651 | 652 | /* Panels */ 653 | const kItemTypeDoc = "document"; 654 | const kItemTypeMore = "document-more"; 655 | const kItemTypeItem = "document-item"; 656 | const kItemTypeError = "error"; 657 | 658 | function renderItem( 659 | item, 660 | createElement, 661 | state, 662 | setActiveItemId, 663 | setContext, 664 | refresh 665 | ) { 666 | switch (item.type) { 667 | case kItemTypeDoc: 668 | return createDocumentCard( 669 | createElement, 670 | "file-richtext", 671 | item.title, 672 | item.section, 673 | item.text, 674 | item.href 675 | ); 676 | case kItemTypeMore: 677 | return createMoreCard( 678 | createElement, 679 | item, 680 | state, 681 | setActiveItemId, 682 | setContext, 683 | refresh 684 | ); 685 | case kItemTypeItem: 686 | return createSectionCard( 687 | createElement, 688 | item.section, 689 | item.text, 690 | item.href 691 | ); 692 | case kItemTypeError: 693 | return createErrorCard(createElement, item.title, item.text); 694 | default: 695 | return undefined; 696 | } 697 | } 698 | 699 | function createDocumentCard(createElement, icon, title, section, text, href) { 700 | const iconEl = createElement("i", { 701 | class: `bi bi-${icon} search-result-icon`, 702 | }); 703 | const titleEl = createElement("p", { class: "search-result-title" }, title); 704 | const titleContainerEl = createElement( 705 | "div", 706 | { class: "search-result-title-container" }, 707 | [iconEl, titleEl] 708 | ); 709 | 710 | const textEls = []; 711 | if (section) { 712 | const sectionEl = createElement( 713 | "p", 714 | { class: "search-result-section" }, 715 | section 716 | ); 717 | textEls.push(sectionEl); 718 | } 719 | const descEl = createElement("p", { 720 | class: "search-result-text", 721 | dangerouslySetInnerHTML: { 722 | __html: text, 723 | }, 724 | }); 725 | textEls.push(descEl); 726 | 727 | const textContainerEl = createElement( 728 | "div", 729 | { class: "search-result-text-container" }, 730 | textEls 731 | ); 732 | 733 | const containerEl = createElement( 734 | "div", 735 | { 736 | class: "search-result-container", 737 | }, 738 | [titleContainerEl, textContainerEl] 739 | ); 740 | 741 | const linkEl = createElement( 742 | "a", 743 | { 744 | href: offsetURL(href), 745 | class: "search-result-link", 746 | }, 747 | containerEl 748 | ); 749 | 750 | const classes = ["search-result-doc", "search-item"]; 751 | if (!section) { 752 | classes.push("document-selectable"); 753 | } 754 | 755 | return createElement( 756 | "div", 757 | { 758 | class: classes.join(" "), 759 | }, 760 | linkEl 761 | ); 762 | } 763 | 764 | function createMoreCard( 765 | createElement, 766 | item, 767 | state, 768 | setActiveItemId, 769 | setContext, 770 | refresh 771 | ) { 772 | const moreCardEl = createElement( 773 | "div", 774 | { 775 | class: "search-result-more search-item", 776 | onClick: (e) => { 777 | // Handle expanding the sections by adding the expanded 778 | // section to the list of expanded sections 779 | toggleExpanded(item, state, setContext, setActiveItemId, refresh); 780 | e.stopPropagation(); 781 | }, 782 | }, 783 | item.title 784 | ); 785 | 786 | return moreCardEl; 787 | } 788 | 789 | function toggleExpanded(item, state, setContext, setActiveItemId, refresh) { 790 | const expanded = state.context.expanded || []; 791 | if (expanded.includes(item.target)) { 792 | setContext({ 793 | expanded: expanded.filter((target) => target !== item.target), 794 | }); 795 | } else { 796 | setContext({ expanded: [...expanded, item.target] }); 797 | } 798 | 799 | refresh(); 800 | setActiveItemId(item.__autocomplete_id); 801 | } 802 | 803 | function createSectionCard(createElement, section, text, href) { 804 | const sectionEl = createSection(createElement, section, text, href); 805 | return createElement( 806 | "div", 807 | { 808 | class: "search-result-doc-section search-item", 809 | }, 810 | sectionEl 811 | ); 812 | } 813 | 814 | function createSection(createElement, title, text, href) { 815 | const descEl = createElement("p", { 816 | class: "search-result-text", 817 | dangerouslySetInnerHTML: { 818 | __html: text, 819 | }, 820 | }); 821 | 822 | const titleEl = createElement("p", { class: "search-result-section" }, title); 823 | const linkEl = createElement( 824 | "a", 825 | { 826 | href: offsetURL(href), 827 | class: "search-result-link", 828 | }, 829 | [titleEl, descEl] 830 | ); 831 | return linkEl; 832 | } 833 | 834 | function createErrorCard(createElement, title, text) { 835 | const descEl = createElement("p", { 836 | class: "search-error-text", 837 | dangerouslySetInnerHTML: { 838 | __html: text, 839 | }, 840 | }); 841 | 842 | const titleEl = createElement("p", { 843 | class: "search-error-title", 844 | dangerouslySetInnerHTML: { 845 | __html: ` ${title}`, 846 | }, 847 | }); 848 | const errorEl = createElement("div", { class: "search-error" }, [ 849 | titleEl, 850 | descEl, 851 | ]); 852 | return errorEl; 853 | } 854 | 855 | function positionPanel(pos) { 856 | const panelEl = window.document.querySelector( 857 | "#quarto-search-results .aa-Panel" 858 | ); 859 | const inputEl = window.document.querySelector( 860 | "#quarto-search .aa-Autocomplete" 861 | ); 862 | 863 | if (panelEl && inputEl) { 864 | panelEl.style.top = `${Math.round(panelEl.offsetTop)}px`; 865 | if (pos === "start") { 866 | panelEl.style.left = `${Math.round(inputEl.left)}px`; 867 | } else { 868 | panelEl.style.right = `${Math.round(inputEl.offsetRight)}px`; 869 | } 870 | } 871 | } 872 | 873 | /* Highlighting */ 874 | // highlighting functions 875 | function highlightMatch(query, text) { 876 | if (text) { 877 | const start = text.toLowerCase().indexOf(query.toLowerCase()); 878 | if (start !== -1) { 879 | const startMark = ""; 880 | const endMark = ""; 881 | 882 | const end = start + query.length; 883 | text = 884 | text.slice(0, start) + 885 | startMark + 886 | text.slice(start, end) + 887 | endMark + 888 | text.slice(end); 889 | const startInfo = clipStart(text, start); 890 | const endInfo = clipEnd( 891 | text, 892 | startInfo.position + startMark.length + endMark.length 893 | ); 894 | text = 895 | startInfo.prefix + 896 | text.slice(startInfo.position, endInfo.position) + 897 | endInfo.suffix; 898 | 899 | return text; 900 | } else { 901 | return text; 902 | } 903 | } else { 904 | return text; 905 | } 906 | } 907 | 908 | function clipStart(text, pos) { 909 | const clipStart = pos - 50; 910 | if (clipStart < 0) { 911 | // This will just return the start of the string 912 | return { 913 | position: 0, 914 | prefix: "", 915 | }; 916 | } else { 917 | // We're clipping before the start of the string, walk backwards to the first space. 918 | const spacePos = findSpace(text, pos, -1); 919 | return { 920 | position: spacePos.position, 921 | prefix: "", 922 | }; 923 | } 924 | } 925 | 926 | function clipEnd(text, pos) { 927 | const clipEnd = pos + 200; 928 | if (clipEnd > text.length) { 929 | return { 930 | position: text.length, 931 | suffix: "", 932 | }; 933 | } else { 934 | const spacePos = findSpace(text, clipEnd, 1); 935 | return { 936 | position: spacePos.position, 937 | suffix: spacePos.clipped ? "…" : "", 938 | }; 939 | } 940 | } 941 | 942 | function findSpace(text, start, step) { 943 | let stepPos = start; 944 | while (stepPos > -1 && stepPos < text.length) { 945 | const char = text[stepPos]; 946 | if (char === " " || char === "," || char === ":") { 947 | return { 948 | position: step === 1 ? stepPos : stepPos - step, 949 | clipped: stepPos > 1 && stepPos < text.length, 950 | }; 951 | } 952 | stepPos = stepPos + step; 953 | } 954 | 955 | return { 956 | position: stepPos - step, 957 | clipped: false, 958 | }; 959 | } 960 | 961 | // removes highlighting as implemented by the mark tag 962 | function clearHighlight(searchterm, el) { 963 | const childNodes = el.childNodes; 964 | for (let i = childNodes.length - 1; i >= 0; i--) { 965 | const node = childNodes[i]; 966 | if (node.nodeType === Node.ELEMENT_NODE) { 967 | if ( 968 | node.tagName === "MARK" && 969 | node.innerText.toLowerCase() === searchterm.toLowerCase() 970 | ) { 971 | el.replaceChild(document.createTextNode(node.innerText), node); 972 | } else { 973 | clearHighlight(searchterm, node); 974 | } 975 | } 976 | } 977 | } 978 | 979 | // highlight matches 980 | function highlight(term, el) { 981 | const termRegex = new RegExp(term, "ig"); 982 | const childNodes = el.childNodes; 983 | 984 | // walk back to front avoid mutating elements in front of us 985 | for (let i = childNodes.length - 1; i >= 0; i--) { 986 | const node = childNodes[i]; 987 | 988 | if (node.nodeType === Node.TEXT_NODE) { 989 | // Search text nodes for text to highlight 990 | const text = node.nodeValue; 991 | 992 | let startIndex = 0; 993 | let matchIndex = text.search(termRegex); 994 | if (matchIndex > -1) { 995 | const markFragment = document.createDocumentFragment(); 996 | while (matchIndex > -1) { 997 | const prefix = text.slice(startIndex, matchIndex); 998 | markFragment.appendChild(document.createTextNode(prefix)); 999 | 1000 | const mark = document.createElement("mark"); 1001 | mark.appendChild( 1002 | document.createTextNode( 1003 | text.slice(matchIndex, matchIndex + term.length) 1004 | ) 1005 | ); 1006 | markFragment.appendChild(mark); 1007 | 1008 | startIndex = matchIndex + term.length; 1009 | matchIndex = text.slice(startIndex).search(new RegExp(term, "ig")); 1010 | if (matchIndex > -1) { 1011 | matchIndex = startIndex + matchIndex; 1012 | } 1013 | } 1014 | if (startIndex < text.length) { 1015 | markFragment.appendChild( 1016 | document.createTextNode(text.slice(startIndex, text.length)) 1017 | ); 1018 | } 1019 | 1020 | el.replaceChild(markFragment, node); 1021 | } 1022 | } else if (node.nodeType === Node.ELEMENT_NODE) { 1023 | // recurse through elements 1024 | highlight(term, node); 1025 | } 1026 | } 1027 | } 1028 | 1029 | /* Link Handling */ 1030 | // get the offset from this page for a given site root relative url 1031 | function offsetURL(url) { 1032 | var offset = getMeta("quarto:offset"); 1033 | return offset ? offset + url : url; 1034 | } 1035 | 1036 | // read a meta tag value 1037 | function getMeta(metaName) { 1038 | var metas = window.document.getElementsByTagName("meta"); 1039 | for (let i = 0; i < metas.length; i++) { 1040 | if (metas[i].getAttribute("name") === metaName) { 1041 | return metas[i].getAttribute("content"); 1042 | } 1043 | } 1044 | return ""; 1045 | } 1046 | 1047 | function algoliaSearch(query, limit, algoliaOptions) { 1048 | const { getAlgoliaResults } = window["@algolia/autocomplete-preset-algolia"]; 1049 | 1050 | const applicationId = algoliaOptions["application-id"]; 1051 | const searchOnlyApiKey = algoliaOptions["search-only-api-key"]; 1052 | const indexName = algoliaOptions["index-name"]; 1053 | const indexFields = algoliaOptions["index-fields"]; 1054 | const searchClient = window.algoliasearch(applicationId, searchOnlyApiKey); 1055 | const searchParams = algoliaOptions["params"]; 1056 | const searchAnalytics = !!algoliaOptions["analytics-events"]; 1057 | 1058 | return getAlgoliaResults({ 1059 | searchClient, 1060 | queries: [ 1061 | { 1062 | indexName: indexName, 1063 | query, 1064 | params: { 1065 | hitsPerPage: limit, 1066 | clickAnalytics: searchAnalytics, 1067 | ...searchParams, 1068 | }, 1069 | }, 1070 | ], 1071 | transformResponse: (response) => { 1072 | if (!indexFields) { 1073 | return response.hits.map((hit) => { 1074 | return hit.map((item) => { 1075 | return { 1076 | ...item, 1077 | text: highlightMatch(query, item.text), 1078 | }; 1079 | }); 1080 | }); 1081 | } else { 1082 | const remappedHits = response.hits.map((hit) => { 1083 | return hit.map((item) => { 1084 | const newItem = { ...item }; 1085 | ["href", "section", "title", "text"].forEach((keyName) => { 1086 | const mappedName = indexFields[keyName]; 1087 | if ( 1088 | mappedName && 1089 | item[mappedName] !== undefined && 1090 | mappedName !== keyName 1091 | ) { 1092 | newItem[keyName] = item[mappedName]; 1093 | delete newItem[mappedName]; 1094 | } 1095 | }); 1096 | newItem.text = highlightMatch(query, newItem.text); 1097 | return newItem; 1098 | }); 1099 | }); 1100 | return remappedHits; 1101 | } 1102 | }, 1103 | }); 1104 | } 1105 | 1106 | function fuseSearch(query, fuse, fuseOptions) { 1107 | return fuse.search(query, fuseOptions).map((result) => { 1108 | const addParam = (url, name, value) => { 1109 | const anchorParts = url.split("#"); 1110 | const baseUrl = anchorParts[0]; 1111 | const sep = baseUrl.search("\\?") > 0 ? "&" : "?"; 1112 | anchorParts[0] = baseUrl + sep + name + "=" + value; 1113 | return anchorParts.join("#"); 1114 | }; 1115 | 1116 | return { 1117 | title: result.item.title, 1118 | section: result.item.section, 1119 | href: addParam(result.item.href, kQueryArg, query), 1120 | text: highlightMatch(query, result.item.text), 1121 | }; 1122 | }); 1123 | } 1124 | --------------------------------------------------------------------------------