@xiee/utils 1.14.157 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/css/article.css +1 -0
- package/css/article.min.css +1 -1
- package/css/article.min.css.map +1 -1
- package/css/lt-interactive.css +7 -1
- package/css/lt-interactive.min.css +1 -1
- package/css/lt-interactive.min.css.map +1 -1
- package/js/link-functions.js +51 -0
- package/js/link-functions.min.js +2 -0
- package/js/link-functions.min.js.map +1 -0
- package/js/lt-interactive.js +4 -3
- package/js/lt-interactive.min.js +1 -1
- package/js/lt-interactive.min.js.map +1 -1
- package/js/lt.js +20 -17
- package/js/lt.min.js +1 -1
- package/js/lt.min.js.map +1 -1
- package/js/pages.js +14 -5
- package/js/pages.min.js +1 -1
- package/js/pages.min.js.map +1 -1
- package/js/prism-lite.js +165 -0
- package/js/prism-lite.min.js +2 -0
- package/js/prism-lite.min.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,6 +164,13 @@ a list item. This makes it possible to reference or locate a specific item on a
|
|
|
164
164
|
page by a hash in the URL. If you hold `Alt` and click on an item, you will get
|
|
165
165
|
the URL with the hash in the address bar of your browser.
|
|
166
166
|
|
|
167
|
+
## prism-lite.js
|
|
168
|
+
|
|
169
|
+
Minimal syntax highlighter for `<pre><code class="language-*">` blocks, emitting
|
|
170
|
+
the `token` classes of `prism-xcode.css`. Built-in rules for R, JS, CSS, HTML,
|
|
171
|
+
Markdown, YAML, TeX, Bash, JSON, SQL, and diff; other languages get generic
|
|
172
|
+
highlighting (strings, numbers, operators, comments). Replaces prism.js.
|
|
173
|
+
|
|
167
174
|
## render-katex.js
|
|
168
175
|
|
|
169
176
|
Simply run `renderMathInElement(document.body)` to render math expression using
|
package/css/article.css
CHANGED
|
@@ -8,6 +8,7 @@ body {
|
|
|
8
8
|
--side-margin: calc(0px - var(--side-width) - var(--side-gap));
|
|
9
9
|
}
|
|
10
10
|
body, blockquote, .side { background: #fafafa; }
|
|
11
|
+
code a:not(:hover) { text-decoration: none; }
|
|
11
12
|
/* a card: an article, except in pages.js pages */
|
|
12
13
|
article:not(.pagesjs *), .frontmatter, .fullwidth, .embed-left, .embed-right {
|
|
13
14
|
margin-top: 2em;
|
package/css/article.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root,.pagesjs{--side-width:12.5rem;--side-gap:2em;--article-bg:#fff}@media (width>=93.75em){:root{--side-width:18.75rem}}body{--side-margin:calc(0px - var(--side-width) - var(--side-gap))}body,blockquote,.side{background:#fafafa}article:not(.pagesjs *),.frontmatter,.fullwidth,.embed-left,.embed-right{background:var(--article-bg);margin-top:2em;padding:1em;box-shadow:0 0 4px #ccc}.side{font-size:.85em}#TOC{top:0}.bg-number{color:#fff;background:#789;border-radius:5px;padding:1px 5px}div:has(>table){overflow-x:auto}.side{width:var(--side-width);max-height:100vh;margin-top:-1em;padding-top:1em;overflow:auto}.side-left{float:left;clear:left;margin-left:var(--side-margin);position:sticky;&:not(article>*){margin-left:calc(var(--side-margin) + 1em)}}.side-right{float:right;clear:right;margin-right:var(--side-margin)}.quote-left,.quote-right{width:45%}.embed-left,.embed-right{margin-top:auto;padding:0}.quote-left,.embed-left{float:left;margin-right:1em}.quote-right,.embed-right{float:right;margin-left:1em}.embed-left{margin-left:var(--side-margin)}.embed-right{margin-right:var(--side-margin)}:is(.side,.embed-left,.embed-right)>:first-child{margin-top:0}:is(.embed-left,.embed-right)>:last-child{margin-bottom:0}:is(.quote-left,.quote-right){&>:first-child{padding-top:.1px}&>:last-child{padding-bottom:.1px}}.fullwidth{float:left;background:var(--article-bg);min-width:100%;max-width:calc(100vw - 2em);margin:1em 0 1em 50%;transform:translate(-50%);& *{max-width:calc(100vw - 4em);margin:auto 0}& :is(figcaption,.caption){width:50rem;margin-left:calc(50% - 25rem);padding:1em 1em 0}}.fullscroll{& *{max-width:initial}&,& figure,& .figure{overflow-x:auto}}.sidenotes{height:0;position:relative}.note-pop{display:none}.side-note{right:var(--side-margin);position:absolute}@media (width>=79.002em){.note-ref:hover+.note-pop{z-index:1;box-sizing:content-box;background:#f8f8f8;margin-left:1em;padding:.5em;display:inline-block;position:absolute}#TOC.side{& .active{color:#32cd32}&>ul>li:has(.active){background:var(--article-bg);padding:4px 2px 4px 0}& li li .active{border-left:3px solid;margin-left:calc(-1em - 3px);padding-left:1em}&:has(.active) li:not(:has(.active)) ul{display:none}}}@media (width<=79em){body:not(.pagesjs){& #TOC{position:initial;float:none;border:1px solid #eee;border-radius:5px;padding:1em}& .side{width:100%;max-height:none}& main .side{color:#2f4f4f;padding:0 2em}& .side-left,& .side-right{clear:both;background:0 0;margin:1em auto}& .side{float:none}& .sidenotes{height:auto}& .side-note{margin:1em auto;position:static}& .side>:last-child{margin-bottom:0}& .embed-left,& .embed-right{float:inherit;margin:auto;padding:1em}}}@media (width<=50em){body:not(.pagesjs){padding:initial;& article{padding:0 .5em}& :not(pre)>code{word-break:break-word}& .quote-left,& .quote-right{width:inherit;float:inherit;margin:auto}& .fullwidth{margin:initial;transform:initial;float:none;min-width:initial;background:0 0;border:none;& :is(figcaption,.caption){margin:initial;padding:initial}&:not(.fullscroll) *{max-width:100%}}}}@media print{body{background:0 0}}
|
|
1
|
+
:root,.pagesjs{--side-width:12.5rem;--side-gap:2em;--article-bg:#fff}@media (width>=93.75em){:root{--side-width:18.75rem}}body{--side-margin:calc(0px - var(--side-width) - var(--side-gap))}body,blockquote,.side{background:#fafafa}code a:not(:hover){text-decoration:none}article:not(.pagesjs *),.frontmatter,.fullwidth,.embed-left,.embed-right{background:var(--article-bg);margin-top:2em;padding:1em;box-shadow:0 0 4px #ccc}.side{font-size:.85em}#TOC{top:0}.bg-number{color:#fff;background:#789;border-radius:5px;padding:1px 5px}div:has(>table){overflow-x:auto}.side{width:var(--side-width);max-height:100vh;margin-top:-1em;padding-top:1em;overflow:auto}.side-left{float:left;clear:left;margin-left:var(--side-margin);position:sticky;&:not(article>*){margin-left:calc(var(--side-margin) + 1em)}}.side-right{float:right;clear:right;margin-right:var(--side-margin)}.quote-left,.quote-right{width:45%}.embed-left,.embed-right{margin-top:auto;padding:0}.quote-left,.embed-left{float:left;margin-right:1em}.quote-right,.embed-right{float:right;margin-left:1em}.embed-left{margin-left:var(--side-margin)}.embed-right{margin-right:var(--side-margin)}:is(.side,.embed-left,.embed-right)>:first-child{margin-top:0}:is(.embed-left,.embed-right)>:last-child{margin-bottom:0}:is(.quote-left,.quote-right){&>:first-child{padding-top:.1px}&>:last-child{padding-bottom:.1px}}.fullwidth{float:left;background:var(--article-bg);min-width:100%;max-width:calc(100vw - 2em);margin:1em 0 1em 50%;transform:translate(-50%);& *{max-width:calc(100vw - 4em);margin:auto 0}& :is(figcaption,.caption){width:50rem;margin-left:calc(50% - 25rem);padding:1em 1em 0}}.fullscroll{& *{max-width:initial}&,& figure,& .figure{overflow-x:auto}}.sidenotes{height:0;position:relative}.note-pop{display:none}.side-note{right:var(--side-margin);position:absolute}@media (width>=79.002em){.note-ref:hover+.note-pop{z-index:1;box-sizing:content-box;background:#f8f8f8;margin-left:1em;padding:.5em;display:inline-block;position:absolute}#TOC.side{& .active{color:#32cd32}&>ul>li:has(.active){background:var(--article-bg);padding:4px 2px 4px 0}& li li .active{border-left:3px solid;margin-left:calc(-1em - 3px);padding-left:1em}&:has(.active) li:not(:has(.active)) ul{display:none}}}@media (width<=79em){body:not(.pagesjs){& #TOC{position:initial;float:none;border:1px solid #eee;border-radius:5px;padding:1em}& .side{width:100%;max-height:none}& main .side{color:#2f4f4f;padding:0 2em}& .side-left,& .side-right{clear:both;background:0 0;margin:1em auto}& .side{float:none}& .sidenotes{height:auto}& .side-note{margin:1em auto;position:static}& .side>:last-child{margin-bottom:0}& .embed-left,& .embed-right{float:inherit;margin:auto;padding:1em}}}@media (width<=50em){body:not(.pagesjs){padding:initial;& article{padding:0 .5em}& :not(pre)>code{word-break:break-word}& .quote-left,& .quote-right{width:inherit;float:inherit;margin:auto}& .fullwidth{margin:initial;transform:initial;float:none;min-width:initial;background:0 0;border:none;& :is(figcaption,.caption){margin:initial;padding:initial}&:not(.fullscroll) *{max-width:100%}}}}@media print{body{background:0 0}}
|
|
2
2
|
/*# sourceMappingURL=article.min.css.map */
|
package/css/article.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,qEAKA,wBAA8B,6BAC9B,mEAGA,
|
|
1
|
+
{"version":3,"mappings":"AAAA,qEAKA,wBAA8B,6BAC9B,mEAGA,yCACA,wCAEA,yJAMA,sBACA,WACA,wEAMA,gCAGA,6FAOA,gFAKE,6DAIF,oEAKA,mCACA,mDAIA,oDAIA,sDAIA,2CACA,6CACA,8DACA,0DACA,8BACE,gCACA,mCAIF,6IAOE,8CAIA,wFAMF,YACE,sBACA,sCAIF,sCACA,uBACA,sDAKA,yBACE,kJASA,UACE,wBAGA,wEAIA,oFAKA,uDAKJ,qBACE,mBACE,uFAOA,mCACA,yCAIA,qEAKA,mBACA,yBACA,6CACA,oCACA,qEAOJ,qBACE,mCAEE,yBACA,uCACA,qEAKA,sGAOE,0DAIA,uCAKN,aACE","sources":["article.css"],"sourcesContent":[":root, .pagesjs {\n --side-width: 12.5rem;\n --side-gap: 2em;\n --article-bg: #fff;\n}\n@media (min-width: 93.75em) { :root { --side-width: 18.75rem; } }\nbody {\n --side-margin: calc(0px - var(--side-width) - var(--side-gap));\n}\nbody, blockquote, .side { background: #fafafa; }\ncode a:not(:hover) { text-decoration: none; }\n/* a card: an article, except in pages.js pages */\narticle:not(.pagesjs *), .frontmatter, .fullwidth, .embed-left, .embed-right {\n margin-top: 2em;\n padding: 1em;\n box-shadow: 0 0 4px #ccc;\n background: var(--article-bg);\n}\n.side { font-size: .85em; }\n#TOC { top: 0; }\n.bg-number {\n padding: 1px 5px;\n border-radius: 5px;\n background: lightslategray;\n color: #fff;\n}\ndiv:has(> table) { overflow-x: auto; }\n\n/* left/right elements*/\n.side {\n width: var(--side-width);\n margin-top: -1em;\n padding-top: 1em;\n max-height: 100vh;\n overflow: auto;\n}\n.side-left {\n float: left;\n clear: left;\n margin-left: var(--side-margin);\n position: sticky;\n &:not(article > *) {\n margin-left: calc(var(--side-margin) + 1em);\n }\n}\n.side-right {\n float: right;\n clear: right;\n margin-right: var(--side-margin);\n}\n.quote-left, .quote-right { width: 45%; }\n.embed-left, .embed-right {\n margin-top: auto;\n padding: 0;\n}\n.quote-left, .embed-left {\n float: left;\n margin-right: 1em;\n}\n.quote-right, .embed-right {\n float: right;\n margin-left: 1em;\n}\n.embed-left { margin-left: var(--side-margin); }\n.embed-right { margin-right: var(--side-margin); }\n:is(.side, .embed-left, .embed-right) > :first-child { margin-top: 0; }\n:is(.embed-left, .embed-right) > :last-child { margin-bottom: 0; }\n:is(.quote-left, .quote-right) {\n & > :first-child { padding-top: .1px; }\n & > :last-child { padding-bottom: .1px; }\n}\n\n/* wide elements */\n.fullwidth {\n max-width: calc(100vw - 2em);\n margin: 1em 0 1em 50%;\n transform: translateX(-50%);\n float: left;\n min-width: 100%;\n background: var(--article-bg);\n & * {\n max-width: calc(100vw - 4em);\n margin: auto 0;\n }\n & :is(figcaption, .caption) {\n margin-left: calc(50% - 25rem);\n width: 50rem;\n padding: 1em 1em 0;\n }\n}\n.fullscroll {\n & * { max-width: initial; }\n &, & figure, & .figure { overflow-x: auto; }\n}\n\n/* notes: positioned by sidenotes.js in a layer that has the content edges of the article */\n.sidenotes { position: relative; height: 0; }\n.note-pop { display: none; }\n.side-note {\n position: absolute;\n right: var(--side-margin);\n}\n\n@media (min-width: 79.002em) {\n .note-ref:hover + .note-pop {\n display: inline-block;\n position: absolute;\n z-index: 1;\n background: #f8f8f8;\n margin-left: 1em;\n padding: .5em;\n box-sizing: content-box;\n }\n #TOC.side {\n .active {\n color: limegreen;\n }\n & > ul > li:has(.active) {\n background: var(--article-bg);\n padding: 4px 2px 4px 0;\n }\n li li .active {\n border-left: 3px solid;\n margin-left: calc(-1em - 3px);\n padding-left: 1em;\n }\n &:has(.active) li:not(:has(.active)) ul {\n display: none;\n }\n }\n}\n@media (max-width: 79em) {\n body:not(.pagesjs) {\n #TOC {\n border: 1px solid #eee;\n border-radius: 5px;\n padding: 1em;\n position: initial;\n float: none;\n }\n .side { width: 100%; max-height: none; }\n main .side {\n padding: 0 2em;\n color: darkslategray;\n }\n .side-left, .side-right {\n clear: both;\n margin: 1em auto;\n background: none;\n }\n .side { float: none; }\n .sidenotes { height: auto; }\n .side-note { position: static; margin: 1em auto; }\n .side > :last-child { margin-bottom: 0; }\n .embed-left, .embed-right {\n float: inherit;\n margin: auto;\n padding: 1em;\n }\n }\n}\n@media (max-width: 50em) {\n body:not(.pagesjs) {\n padding: initial;\n article { padding: 0 .5em; }\n :not(pre) > code { word-break: break-word; }\n .quote-left, .quote-right {\n width: inherit;\n float: inherit;\n margin: auto;\n }\n .fullwidth {\n margin: initial;\n transform: initial;\n float: none;\n min-width: initial;\n background: none;\n border: none;\n & :is(figcaption, .caption) {\n margin: initial;\n padding: initial;\n }\n &:not(.fullscroll) * { max-width: 100%; }\n }\n }\n}\n\n@media print {\n body {\n background: none;\n }\n}\n"],"names":[]}
|
package/css/lt-interactive.css
CHANGED
|
@@ -47,7 +47,13 @@
|
|
|
47
47
|
height: 1.5em;
|
|
48
48
|
min-width: 4em;
|
|
49
49
|
fill: currentColor;
|
|
50
|
-
|
|
50
|
+
overflow: visible;
|
|
51
|
+
rect, line { opacity: 0.25; }
|
|
52
|
+
line {
|
|
53
|
+
stroke: currentColor;
|
|
54
|
+
stroke-dasharray: 2 1;
|
|
55
|
+
vector-effect: non-scaling-stroke;
|
|
56
|
+
}
|
|
51
57
|
rect.s { fill: var(--lti-accent); opacity: 1; }
|
|
52
58
|
}
|
|
53
59
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.lt-table{--lti-accent:#ffc800;& :is(.lti-head,.lti-pager-row) td{padding-left:0;padding-right:0}& .lti-search{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"2\"><circle cx=\"6.5\" cy=\"6.5\" r=\"4.5\"/><path d=\"M10 10l5 5\"/></svg>") .4em/1em no-repeat;width:100%;padding:.5em 0 .5em 1.6em;&:focus{background-image:none;padding-left:.5em}}& .lti-nl{color:#555;font-size:.85em;&:empty{display:none}}& .lti-sortable .lti-label{cursor:pointer;user-select:none}& .lti-sort{margin-left:.3em;font-size:.8em}& .lti-prof svg{fill:currentColor;width:100%;min-width:4em;height:1.5em;& rect{opacity:.25}& rect.s{fill:var(--lti-accent);opacity:1}}& .lti-empty td{text-align:center}& .lti-expand{cursor:pointer;background:0 0;border:none;margin-right:.4em;padding:0}& .lti-detail>td{padding-left:1.5em}& th:has(.lti-resizer){position:relative}& .lti-resizer{cursor:col-resize;user-select:none;touch-action:none;width:5px;height:100%;position:absolute;top:0;right:0;&:hover{opacity:.3;background:currentColor}}&.lti-resizing{cursor:col-resize;user-select:none}&.lti-fixed{table-layout:fixed;& tbody tr:not(.lti-detail) td,& thead .lti-label{overflow:hidden}& thead .lti-label{vertical-align:bottom;max-width:100%;display:inline-block}}& .lti-bar{align-items:center;gap:1.2em;display:flex;& .lti-icons,& .lti-chips{flex:none;align-items:center;gap:.3em;display:flex}& .lti-chips{gap:.5em;&:empty{display:none}}&>.lti-search{flex:8em;min-width:6em}}& .lti-cols>button,& .lti-download{border:none;width:1.2em;height:1.2em;padding:0}& .lti-cols,& .lti-dl{position:relative;&>button:not(.lti-download){background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>") 50%/contain no-repeat}& .lti-menu{z-index:1;background:canvas;border:1px solid;padding:.3em .6em;position:absolute;top:100%;left:0;& label{white-space:nowrap;cursor:pointer;display:block}& .lti-group{white-space:nowrap;font-weight:600}& .lti-sub{padding-left:1em}}& .lti-chip+.lti-menu,&.lti-dl .lti-menu{left:auto;right:0}}& .lti-download{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5\"/><path d=\"M2 11v3h12v-3\"/></svg>") 50%/contain no-repeat}& .lti-chip{cursor:pointer;background:#f7f7f7;border:1px solid #ccc;border-radius:4px;align-items:center;gap:.3em;padding:.05em .5em;display:inline-flex;position:relative;&.lti-on{border-color:#999;& .lti-chip-name{font-weight:600}}& .lti-chip-cur{color:#555;font-variant-numeric:tabular-nums}& .lti-pop{position:static}}& .lti-pop{position:relative;& .lti-funnel{opacity:.4;background:currentColor;border:none;width:1.1em;height:1.1em;padding:0;mask:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>") 50%/contain no-repeat}& .lti-off{mask:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>") 50%/contain no-repeat}&.lti-on .lti-funnel{background:var(--lti-accent);opacity:1}& .lti-pop-panel{z-index:1;background:canvas;border:1px solid;flex-direction:column;gap:.5em;min-width:14em;max-width:90vw;padding:.6em;display:flex;position:absolute;top:100%;left:0;& .lti-widget{display:contents}&[hidden],& [hidden]{display:none}& .lti-check{white-space:nowrap;cursor:pointer;align-items:center;gap:.4em;display:flex}}}& .lti-slider{height:1.2em;margin:.4em .6em;position:relative;&:before{content:"";background:#c8c8c8;border-radius:3px;height:3px;position:absolute;inset:50% 0 auto;transform:translateY(-50%)}& .lti-slider-fill{background:#4a90d9;height:3px;position:absolute;inset:50% 0;transform:translateY(-50%)}& .lti-thumb{cursor:pointer;touch-action:none;background:#4a90d9;border:2px solid #fff;border-radius:50%;width:14px;height:14px;padding:0;position:absolute;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 2px #0006}}& .lti-slider-out{text-align:center;font-variant-numeric:tabular-nums}& .lti-pager{align-items:center;gap:.3em;display:flex}& button,& select{font:inherit;cursor:pointer}& .lti-pos{margin:0 auto 0 .3em}}.lti-busy{&,& *{cursor:wait!important}& tbody{opacity:.5}}
|
|
1
|
+
.lt-table{--lti-accent:#ffc800;& :is(.lti-head,.lti-pager-row) td{padding-left:0;padding-right:0}& .lti-search{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"2\"><circle cx=\"6.5\" cy=\"6.5\" r=\"4.5\"/><path d=\"M10 10l5 5\"/></svg>") .4em/1em no-repeat;width:100%;padding:.5em 0 .5em 1.6em;&:focus{background-image:none;padding-left:.5em}}& .lti-nl{color:#555;font-size:.85em;&:empty{display:none}}& .lti-sortable .lti-label{cursor:pointer;user-select:none}& .lti-sort{margin-left:.3em;font-size:.8em}& .lti-prof svg{fill:currentColor;width:100%;min-width:4em;height:1.5em;overflow:visible;& rect,& line{opacity:.25}& line{stroke:currentColor;stroke-dasharray:2 1;vector-effect:non-scaling-stroke}& rect.s{fill:var(--lti-accent);opacity:1}}& .lti-empty td{text-align:center}& .lti-expand{cursor:pointer;background:0 0;border:none;margin-right:.4em;padding:0}& .lti-detail>td{padding-left:1.5em}& th:has(.lti-resizer){position:relative}& .lti-resizer{cursor:col-resize;user-select:none;touch-action:none;width:5px;height:100%;position:absolute;top:0;right:0;&:hover{opacity:.3;background:currentColor}}&.lti-resizing{cursor:col-resize;user-select:none}&.lti-fixed{table-layout:fixed;& tbody tr:not(.lti-detail) td,& thead .lti-label{overflow:hidden}& thead .lti-label{vertical-align:bottom;max-width:100%;display:inline-block}}& .lti-bar{align-items:center;gap:1.2em;display:flex;& .lti-icons,& .lti-chips{flex:none;align-items:center;gap:.3em;display:flex}& .lti-chips{gap:.5em;&:empty{display:none}}&>.lti-search{flex:8em;min-width:6em}}& .lti-cols>button,& .lti-download{border:none;width:1.2em;height:1.2em;padding:0}& .lti-cols,& .lti-dl{position:relative;&>button:not(.lti-download){background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>") 50%/contain no-repeat}& .lti-menu{z-index:1;background:canvas;border:1px solid;padding:.3em .6em;position:absolute;top:100%;left:0;& label{white-space:nowrap;cursor:pointer;display:block}& .lti-group{white-space:nowrap;font-weight:600}& .lti-sub{padding-left:1em}}& .lti-chip+.lti-menu,&.lti-dl .lti-menu{left:auto;right:0}}& .lti-download{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5\"/><path d=\"M2 11v3h12v-3\"/></svg>") 50%/contain no-repeat}& .lti-chip{cursor:pointer;background:#f7f7f7;border:1px solid #ccc;border-radius:4px;align-items:center;gap:.3em;padding:.05em .5em;display:inline-flex;position:relative;&.lti-on{border-color:#999;& .lti-chip-name{font-weight:600}}& .lti-chip-cur{color:#555;font-variant-numeric:tabular-nums}& .lti-pop{position:static}}& .lti-pop{position:relative;& .lti-funnel{opacity:.4;background:currentColor;border:none;width:1.1em;height:1.1em;padding:0;mask:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>") 50%/contain no-repeat}& .lti-off{mask:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>") 50%/contain no-repeat}&.lti-on .lti-funnel{background:var(--lti-accent);opacity:1}& .lti-pop-panel{z-index:1;background:canvas;border:1px solid;flex-direction:column;gap:.5em;min-width:14em;max-width:90vw;padding:.6em;display:flex;position:absolute;top:100%;left:0;& .lti-widget{display:contents}&[hidden],& [hidden]{display:none}& .lti-check{white-space:nowrap;cursor:pointer;align-items:center;gap:.4em;display:flex}}}& .lti-slider{height:1.2em;margin:.4em .6em;position:relative;&:before{content:"";background:#c8c8c8;border-radius:3px;height:3px;position:absolute;inset:50% 0 auto;transform:translateY(-50%)}& .lti-slider-fill{background:#4a90d9;height:3px;position:absolute;inset:50% 0;transform:translateY(-50%)}& .lti-thumb{cursor:pointer;touch-action:none;background:#4a90d9;border:2px solid #fff;border-radius:50%;width:14px;height:14px;padding:0;position:absolute;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 2px #0006}}& .lti-slider-out{text-align:center;font-variant-numeric:tabular-nums}& .lti-pager{align-items:center;gap:.3em;display:flex}& button,& select{font:inherit;cursor:pointer}& .lti-pos{margin:0 auto 0 .3em}}.lti-busy{&,& *{cursor:wait!important}& tbody{opacity:.5}}
|
|
2
2
|
/*# sourceMappingURL=lt-interactive.min.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAGA,+BAIE,kEAOA,oSAKE,iDAOF,qCAGE,sBAIF,2DAKA,4CAMA,
|
|
1
|
+
{"version":3,"mappings":"AAGA,+BAIE,kEAOA,oSAKE,iDAOF,qCAGE,sBAIF,2DAKA,4CAMA,yFAME,0BACA,iFAKA,2CAGF,kCAKA,oFAQA,oCAKA,yCAGA,0HASE,4CAMF,kDAKA,+BAIE,kEAGA,8EASF,qDAKE,6EAOA,sBAIE,sBAGF,sCAOF,kFAQA,wCAEE,2TAGA,6GAQE,wDAMA,gDAIA,6BAIF,4DAIF,6QAKA,2KAYE,2BAEE,kCAEF,6DAKA,4BAEF,6BAEE,uQAUA,gQAIA,4DAIA,uLAaE,+BACA,kCAEA,0FAWJ,8DAIE,kIASA,0GAOA,6NAeF,sEAKA,sDAKA,8CAKA,iCAMF,UAEE,4BAGA","sources":["lt-interactive.css"],"sourcesContent":["/* Controls for lt-interactive.js. `lti-*` classes avoid clashing with core\n * `lt-*`. Declare only properties that change a default. */\n\n.lt-table {\n /* accent for active filter and profile highlight */\n --lti-accent: #ffc800;\n /* full-width rows: align with table edges, not cell text */\n :is(.lti-head, .lti-pager-row) td {\n padding-left: 0;\n padding-right: 0;\n }\n\n /* Box fills its cell. Faded magnifier replaces a (translatable) placeholder;\n * hidden on focus. */\n .lti-search {\n width: 100%;\n padding: .5em 0 .5em 1.6em;\n background: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"2\"><circle cx=\"6.5\" cy=\"6.5\" r=\"4.5\"/><path d=\"M10 10l5 5\"/></svg>') 0.4em center / 1em no-repeat;\n /* no icon on focus: smaller left pad so caret sits near the edge */\n &:focus {\n padding-left: .5em;\n background-image: none;\n }\n }\n\n /* how a query was read: shown only when conditions were recognized */\n .lti-nl {\n font-size: .85em;\n color: #555;\n &:empty { display: none; }\n }\n\n /* click target is the label, not the cell (keeps resize grip separate) */\n .lti-sortable .lti-label {\n cursor: pointer;\n user-select: none;\n }\n /* ▲/▼ indicator */\n .lti-sort {\n margin-left: 0.3em;\n font-size: 0.8em;\n }\n\n /* column profile: mini histogram in the header */\n .lti-prof svg {\n width: 100%;\n height: 1.5em;\n min-width: 4em;\n fill: currentColor;\n overflow: visible;\n rect, line { opacity: 0.25; }\n line {\n stroke: currentColor;\n stroke-dasharray: 2 1;\n vector-effect: non-scaling-stroke;\n }\n rect.s { fill: var(--lti-accent); opacity: 1; }\n }\n\n .lti-empty td {\n text-align: center;\n }\n\n /* expand caret: glyph is its own (▸ / ▾), so strip button chrome */\n .lti-expand {\n border: none;\n background: none;\n padding: 0;\n margin-right: 0.4em;\n cursor: pointer;\n }\n /* inset ties the detail to the row above */\n .lti-detail > td {\n padding-left: 1.5em;\n }\n\n /* drag grip on a column's right edge */\n th:has(.lti-resizer) {\n position: relative;\n }\n .lti-resizer {\n position: absolute;\n top: 0;\n right: 0;\n width: 5px;\n height: 100%;\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n &:hover {\n background: currentColor;\n opacity: 0.3;\n }\n }\n /* keep resize cursor and block text selection during drag */\n &.lti-resizing {\n cursor: col-resize;\n user-select: none;\n }\n /* frozen widths are authoritative: a drag moves one edge only */\n &.lti-fixed {\n table-layout: fixed;\n /* clip a shrunk column's cells and labels so the grip can shrink it freely;\n * header cells (holding filter popovers) and the detail row must overflow */\n tbody tr:not(.lti-detail) td, thead .lti-label {\n overflow: hidden;\n }\n thead .lti-label {\n display: inline-block;\n max-width: 100%;\n vertical-align: bottom;\n }\n }\n\n /* control bar: search, chips, icons. Only search grows, taking free space; it\n * fills the bar when alone. */\n .lti-bar {\n display: flex;\n align-items: center;\n /* wide gap between parts ... */\n gap: 1.2em;\n .lti-icons, .lti-chips {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n /* ... tight within a part */\n gap: 0.3em;\n }\n .lti-chips {\n gap: 0.5em;\n /* always present as a drop target for caller chips (el._lt.chips);\n collapse when empty to avoid a stray gap */\n &:empty { display: none; }\n }\n /* direct child only: chip popovers hold their own `.lti-search` */\n & > .lti-search {\n flex: 1 1 8em;\n min-width: 6em;\n }\n }\n\n /* shared size of eye and download buttons */\n .lti-cols > button, .lti-download {\n border: none;\n padding: 0;\n width: 1.2em;\n height: 1.2em;\n }\n\n /* popup menus: column-visibility checklist (eye button) and download formats */\n .lti-cols, .lti-dl {\n position: relative;\n & > button:not(.lti-download) {\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>');\n }\n .lti-menu {\n position: absolute;\n z-index: 1;\n top: 100%;\n left: 0;\n background: Canvas;\n border: 1px solid;\n padding: 0.3em 0.6em;\n label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n }\n /* spanner label above its indented columns */\n .lti-group {\n font-weight: 600;\n white-space: nowrap;\n }\n .lti-sub { padding-left: 1em; }\n }\n /* a labeled chip sits at the bar's end, as does the download button: open\n leftward, inside the table */\n .lti-chip + .lti-menu, &.lti-dl .lti-menu { left: auto; right: 0; }\n }\n\n /* download icon button */\n .lti-download {\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5\"/><path d=\"M2 11v3h12v-3\"/></svg>');\n }\n\n /* typed filter chip: label, filter summary, funnel opening widget + box */\n .lti-chip {\n /* whole chip is the click target and panel anchor (panel flush with chip) */\n position: relative;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 0.3em;\n /* pill look separates chips */\n padding: 0.05em 0.5em;\n border: 1px solid #ccc;\n border-radius: 4px;\n background: #f7f7f7;\n &.lti-on {\n border-color: #999;\n .lti-chip-name { font-weight: 600; }\n }\n .lti-chip-cur {\n color: #555;\n font-variant-numeric: tabular-nums;\n }\n /* panel positions against the chip, not the funnel wrap */\n .lti-pop { position: static; }\n }\n .lti-pop {\n position: relative;\n .lti-funnel {\n border: none;\n padding: 0;\n width: 1.1em;\n height: 1.1em;\n background: currentColor;\n opacity: 0.4;\n mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>');\n }\n /* disabled column filter: outline funnel (stroke, no fill), inert */\n .lti-off {\n mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>');\n }\n /* active when the column has a live term: accent funnel */\n &.lti-on .lti-funnel {\n background: var(--lti-accent);\n opacity: 1;\n }\n .lti-pop-panel {\n position: absolute;\n z-index: 1;\n top: 100%;\n left: 0;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n min-width: 14em;\n max-width: 90vw;\n padding: 0.6em;\n background: Canvas;\n border: 1px solid;\n .lti-widget { display: contents; }\n &[hidden], [hidden] { display: none; }\n /* checklist row: checkbox + label */\n .lti-check {\n display: flex;\n align-items: center;\n gap: 0.4em;\n white-space: nowrap;\n cursor: pointer;\n }\n }\n }\n\n /* range slider: track, fill band, two button thumbs */\n .lti-slider {\n position: relative;\n height: 1.2em;\n margin: 0.4em 0.6em;\n &::before {\n content: \"\";\n position: absolute;\n inset: 50% 0 auto;\n height: 3px;\n transform: translateY(-50%);\n background: #c8c8c8;\n border-radius: 3px;\n }\n .lti-slider-fill {\n position: absolute;\n inset: 50% 0;\n height: 3px;\n transform: translateY(-50%);\n background: #4a90d9;\n }\n .lti-thumb {\n position: absolute;\n top: 50%;\n width: 14px;\n height: 14px;\n padding: 0;\n transform: translate(-50%, -50%);\n border: 2px solid #fff;\n border-radius: 50%;\n background: #4a90d9;\n box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n touch-action: none;\n }\n }\n .lti-slider-out {\n text-align: center;\n font-variant-numeric: tabular-nums;\n }\n\n .lti-pager {\n display: flex;\n align-items: center;\n gap: 0.3em;\n }\n button, select {\n font: inherit;\n cursor: pointer;\n }\n /* row count away from arrows; page size pushed to far end */\n .lti-pos {\n margin: 0 auto 0 0.3em;\n }\n}\n\n/* Busy state during a page-freezing recompute (see lt-interactive.js). */\n.lti-busy {\n /* beat controls' own cursors */\n &, & * {\n cursor: wait !important;\n }\n & tbody {\n opacity: 0.5;\n }\n}\n"],"names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// link function calls like `fn(` or `pkg::fn(` in <code> to their help pages, using
|
|
2
|
+
// the package name and the map (function -> URL) at the URL in
|
|
3
|
+
// <meta name="function-index" content="...">
|
|
4
|
+
(d => {
|
|
5
|
+
const url = d.querySelector('meta[name=function-index]')?.content;
|
|
6
|
+
if (!url) return;
|
|
7
|
+
const base = new URL(url, location.href), here = location.origin + location.pathname,
|
|
8
|
+
// optional pkg:: prefix (which must be the package itself), then the name, which
|
|
9
|
+
// must be followed by `(`
|
|
10
|
+
re = /(?<![\w.$@])(?:([A-Za-z][\w.]*)::)?([A-Za-z.][\w.]*)(?=\()/g;
|
|
11
|
+
|
|
12
|
+
const link = (code, {package: pkg, functions: map}) => {
|
|
13
|
+
// in <pre>, only R code (prism.js marks it with language-r or span.language-r)
|
|
14
|
+
if (code.closest('pre') && !code.classList.contains('language-r') &&
|
|
15
|
+
!code.querySelector('span.language-r')) return;
|
|
16
|
+
if (code.closest('a')) return;
|
|
17
|
+
// collect non-empty text nodes with their offsets in the whole text; elements
|
|
18
|
+
// (e.g., highlighting spans) are left intact, only text is wrapped
|
|
19
|
+
const nodes = [], w = d.createTreeWalker(code, NodeFilter.SHOW_TEXT);
|
|
20
|
+
let text = '', n;
|
|
21
|
+
while (n = w.nextNode()) if (n.length) nodes.push([n, text.length]), text += n.data;
|
|
22
|
+
const hits = [...text.matchAll(re)].filter(
|
|
23
|
+
m => (!m[1] || m[1] === pkg) && Object.hasOwn(map, m[2])
|
|
24
|
+
);
|
|
25
|
+
// go backwards so that splitting a node doesn't shift earlier offsets
|
|
26
|
+
hits.reverse().forEach(m => {
|
|
27
|
+
// only the function name is linked, not the `pkg::` prefix
|
|
28
|
+
const u = new URL(map[m[2]], base), e = m.index + m[0].length, s = e - m[2].length;
|
|
29
|
+
// no self-links to the page being read (but keep links to its sections)
|
|
30
|
+
if (u.origin + u.pathname === here && !u.hash) return;
|
|
31
|
+
// the name may span several text nodes in highlighted code, so wrap the part
|
|
32
|
+
// in each node with a link to the same URL
|
|
33
|
+
nodes.filter(([t, o]) => o < e && o + t.length > s).reverse().forEach(([t, o]) => {
|
|
34
|
+
if (t.parentElement.closest('a')) return;
|
|
35
|
+
const a = d.createElement('a'), r = d.createRange();
|
|
36
|
+
a.href = u; a.target = '_blank';
|
|
37
|
+
r.setStart(t, Math.max(s, o) - o); r.setEnd(t, Math.min(e, o + t.length) - o);
|
|
38
|
+
r.surroundContents(a);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const idx = fetch(base).then(r => r.json()).catch(() => {}),
|
|
44
|
+
run = els => idx.then(x => x && els.forEach(code => link(code, x)));
|
|
45
|
+
// prism.js (loaded before this script) highlights blocks later, e.g., after its
|
|
46
|
+
// autoloader fetches a language, which drops links; so link a block after it is
|
|
47
|
+
// highlighted, and link the rest (not to be highlighted) now
|
|
48
|
+
const P = window.Prism;
|
|
49
|
+
P?.hooks.add('after-highlight', env => run([env.element]));
|
|
50
|
+
run([...d.querySelectorAll(P ? 'code:not([class*=language-])' : 'code')]);
|
|
51
|
+
})(document);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(e=>{const t=e.querySelector("meta[name=function-index]")?.content;if(!t)return;const n=new URL(t,location.href),a=location.origin+location.pathname,r=/(?<![\w.$@])(?:([A-Za-z][\w.]*)::)?([A-Za-z.][\w.]*)(?=\()/g,o=fetch(n).then(e=>e.json()).catch(()=>{}),c=t=>o.then(o=>o&&t.forEach(t=>((t,{package:o,functions:c})=>{if(t.closest("pre")&&!t.classList.contains("language-r")&&!t.querySelector("span.language-r"))return;if(t.closest("a"))return;const l=[],s=e.createTreeWalker(t,NodeFilter.SHOW_TEXT);let h,i="";for(;h=s.nextNode();)h.length&&(l.push([h,i.length]),i+=h.data);[...i.matchAll(r)].filter(e=>(!e[1]||e[1]===o)&&Object.hasOwn(c,e[2])).reverse().forEach(t=>{const r=new URL(c[t[2]],n),o=t.index+t[0].length,s=o-t[2].length;(r.origin+r.pathname!==a||r.hash)&&l.filter(([e,t])=>t<o&&t+e.length>s).reverse().forEach(([t,n])=>{if(t.parentElement.closest("a"))return;const a=e.createElement("a"),c=e.createRange();a.href=r,a.target="_blank",c.setStart(t,Math.max(s,n)-n),c.setEnd(t,Math.min(o,n+t.length)-n),c.surroundContents(a)})})})(t,o))),l=window.Prism;l?.hooks.add("after-highlight",e=>c([e.element])),c([...e.querySelectorAll(l?"code:not([class*=language-])":"code")])})(document);
|
|
2
|
+
//# sourceMappingURL=link-functions.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["d","url","querySelector","content","base","URL","location","href","here","origin","pathname","re","idx","fetch","then","r","json","catch","run","els","x","forEach","code","package","pkg","functions","map","closest","classList","contains","nodes","w","createTreeWalker","NodeFilter","SHOW_TEXT","n","text","nextNode","length","push","data","matchAll","filter","m","Object","hasOwn","reverse","u","e","index","s","hash","t","o","parentElement","a","createElement","createRange","target","setStart","Math","max","setEnd","min","surroundContents","link","P","window","Prism","hooks","add","env","element","querySelectorAll","document"],"sources":["link-functions.js"],"mappings":"AAGA,CAACA,IACC,MAAMC,EAAMD,EAAEE,cAAc,8BAA8BC,QAC1D,IAAKF,EAAK,OACV,MAAMG,EAAO,IAAIC,IAAIJ,EAAKK,SAASC,MAAOC,EAAOF,SAASG,OAASH,SAASI,SAG1EC,EAAK,8DAiCDC,EAAMC,MAAMT,GAAMU,KAAKC,GAAKA,EAAEC,QAAQC,MAAM,QAChDC,EAAMC,GAAOP,EAAIE,KAAKM,GAAKA,GAAKD,EAAIE,QAAQC,GAhCjC,EAACA,GAAOC,QAASC,EAAKC,UAAWC,MAE5C,GAAIJ,EAAKK,QAAQ,SAAWL,EAAKM,UAAUC,SAAS,gBAC/CP,EAAKpB,cAAc,mBAAoB,OAC5C,GAAIoB,EAAKK,QAAQ,KAAM,OAGvB,MAAMG,EAAQ,GAAIC,EAAI/B,EAAEgC,iBAAiBV,EAAMW,WAAWC,WAC1D,IAAeC,EAAXC,EAAO,GACX,KAAOD,EAAIJ,EAAEM,YAAgBF,EAAEG,SAAQR,EAAMS,KAAK,CAACJ,EAAGC,EAAKE,SAAUF,GAAQD,EAAEK,MAClE,IAAIJ,EAAKK,SAAS9B,IAAK+B,OAClCC,KAAOA,EAAE,IAAMA,EAAE,KAAOnB,IAAQoB,OAAOC,OAAOnB,EAAKiB,EAAE,KAGlDG,UAAUzB,QAAQsB,IAErB,MAAMI,EAAI,IAAI1C,IAAIqB,EAAIiB,EAAE,IAAKvC,GAAO4C,EAAIL,EAAEM,MAAQN,EAAE,GAAGL,OAAQY,EAAIF,EAAIL,EAAE,GAAGL,QAExES,EAAEtC,OAASsC,EAAErC,WAAaF,GAASuC,EAAEI,OAGzCrB,EAAMY,OAAO,EAAEU,EAAGC,KAAOA,EAAIL,GAAKK,EAAID,EAAEd,OAASY,GAAGJ,UAAUzB,QAAQ,EAAE+B,EAAGC,MACzE,GAAID,EAAEE,cAAc3B,QAAQ,KAAM,OAClC,MAAM4B,EAAIvD,EAAEwD,cAAc,KAAMzC,EAAIf,EAAEyD,cACtCF,EAAEhD,KAAOwC,EAAGQ,EAAEG,OAAS,SACvB3C,EAAE4C,SAASP,EAAGQ,KAAKC,IAAIX,EAAGG,GAAKA,GAAItC,EAAE+C,OAAOV,EAAGQ,KAAKG,IAAIf,EAAGK,EAAID,EAAEd,QAAUe,GAC3EtC,EAAEiD,iBAAiBT,QAM6BU,CAAK3C,EAAMF,KAI3D8C,EAAIC,OAAOC,MACjBF,GAAGG,MAAMC,IAAI,kBAAmBC,GAAOrD,EAAI,CAACqD,EAAIC,WAChDtD,EAAI,IAAIlB,EAAEyE,iBAAiBP,EAAI,+BAAiC,SACjE,EA/CD,CA+CGQ","ignoreList":[]}
|
package/js/lt-interactive.js
CHANGED
|
@@ -563,7 +563,7 @@
|
|
|
563
563
|
queryExamples = (vals, cols, labelOf) => {
|
|
564
564
|
const filled = cols.filter(c => hasData(vals[c])),
|
|
565
565
|
ncs = filled.filter(c => numCol(vals[c])), tcs = filled.filter(c => !numCol(vals[c])),
|
|
566
|
-
one = cs => { const c = rnd(cs); return colExample(vals[c],
|
|
566
|
+
one = cs => { const c = rnd(cs); return colExample(vals[c], `"${labelOf(c)}" `); },
|
|
567
567
|
gens = [ncs.length && (() => one(ncs)), tcs.length && (() => one(tcs)),
|
|
568
568
|
ncs.length && tcs.length && (() => `${one(ncs)}${rnd([", ", " and "])}${one(tcs)}`)].filter(Boolean);
|
|
569
569
|
return gens.length ? sample(i => gens[i % gens.length]()) : [];
|
|
@@ -809,8 +809,9 @@
|
|
|
809
809
|
] : S.kind === "date" ? [`min ${S.lo}`, `max ${S.hi}`, S.na && `${Math.round(100 * S.na / S.len)}% NA`]
|
|
810
810
|
: [`min ${sig(S.lo, 6)}`, `max ${sig(S.hi, 6)}`, `mean ${sig(S.mean, 4)}`,
|
|
811
811
|
S.na && `${Math.round(100 * S.na / S.len)}% NA`],
|
|
812
|
-
|
|
813
|
-
|
|
812
|
+
// empty bars of the light layer: a dashed baseline segment, so no gaps
|
|
813
|
+
rects = (c, cls) => c.map((k, i) => k || cls ? `<rect${cls} x="${i}" y="${1 - k / max}" width=".9" height="${k / max}"/>` :
|
|
814
|
+
`<line x1="${i}" x2="${i + .9}" y1="1" y2="1"/>`).join(""),
|
|
814
815
|
paint = (view, counts) => {
|
|
815
816
|
const c = counts?.[name] || (view?.length < S.len && S.count?.(view));
|
|
816
817
|
p.innerHTML = `<svg viewBox="0 0 ${full.length || 1} 1" preserveAspectRatio="none">${rects(full, "")}${c ? rects(c, ' class="s"') : ""}</svg>`;
|
package/js/lt-interactive.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(t=>{"use strict";const e=t.LT;if(!e?.onMount||e.plugins.interactive)return;const n=e.plugins.query;let s;const l=t=>"string"!=typeof t?{...t}:"-"===t[0]?{col:t.slice(1),dir:"desc"}:{col:t,dir:"asc"},o=(t,e,n)=>(s||=new Intl.Collator,n?t-e:s.compare(String(t),String(e))),{$:r,$$:a,on:i,off:c,numCol:u,dateFmt:d}=e,p=t=>{const e=t.data||{};if(t._txt?.d!==e){const n={...e};for(const s in e){const l=d(e[s]);(l||t.dates?.includes(s))&&(n[s]=Object.assign(e[s].map(t=>null!=t&&l?l(t):t),{date:!0}))}t._txt={d:e,t:n}}return t._txt.t},f=t=>[...t.children].filter(t=>!t.classList.contains("lt-row-group")),h=t=>{const e=[...t.childNodes],n=e.findIndex(t=>"BR"===t.nodeName);return n<0?e:e.slice(0,n)};function m(t,e,n={},s){const l=t.createElement(e);for(const t in n)t.includes("-")?l.setAttribute(t,n[t]):l[t]=n[t];return s?s.appendChild(l):l}function g(t,e,n){t.preventDefault();const s=t.target.ownerDocument||document,l=t=>e(t);i(s,"pointermove",l),i(s,"pointerup",()=>{c(s,"pointermove",l),n&&n()},{once:!0})}function w(t){const e=String(t??"").trim();if(""===e)return null;if(/(^|[^\w$])x([^\w$]|$)/.test(e)){let t;try{t=new Function("x",`return (${e});`)}catch(t){}if(t){const n=/^\s*!|!=/.test(e),s=e=>{try{if(null==e)return n||!!t(void 0);const s=Number(e);return!!t(String(e))||""!==e&&isFinite(s)&&!!t(s)}catch(t){return!1}};return t=>t[n?"every":"some"](t=>s(t.raw))}}const n="!"===e[0],s=(n?e.slice(1).trim():e).toLowerCase();return""===s?null:t=>n!==t.some(t=>null!=t.disp&&String(t.disp).toLowerCase().includes(s))}function b(t,e,n){const s=t._cols||[],l=t.data||{},r=p(t),a=(l[s[0]]||[]).length,i=(t,n)=>({raw:r[t]?.[n-1]??null,disp:e[t]?.[n-1]??""}),c=[],d=t=>{if(t.op){const e=t.items.map(d);return"and"===t.op?t=>e.every(e=>e(t)):t=>e.some(e=>e(t))}const e=w(t.term);return e?null!=t.col?n=>e([i(t.col,n)]):t=>e(s.map(e=>i(e,t))):()=>!0};for(const t in n.filters||{}){const e=n.filters[t];c.push(d("string"==typeof e?{col:t,term:e}:e))}n.where&&c.push(d(n.where));const f=w(n.term);f&&c.push(t=>f(s.map(e=>i(e,t))));const h=Object.values(n.predicates||{});if(h.length){const t=Object.keys(l),e=e=>Object.fromEntries(t.map(t=>[t,l[t]?.[e-1]??null]));c.push(t=>{const n=e(t);return h.every(t=>t(n))})}const m=t=>c.every(e=>e(t)),g=t=>{const e=t.map(t=>{const e=r[t.col];return e&&{col:e,num:u(e),dir:"desc"===t.dir?-1:1}}).filter(Boolean);return e.length?(t,n)=>{for(const{col:s,num:l,dir:r}of e){const e=s[t-1],a=s[n-1],i=null==e,c=null==a;if(i||c){if(i!==c)return i?1:-1;continue}const u=o(e,a,l);if(u)return r*u}return 0}:null},b=t._indent,y=(t,e)=>{if(!b){const n=t.filter(m);return e?n.sort(e):n}const n=[],s=[];for(const e of t){const t={r:e,kids:[]},l=b[e-1]||0;for(;s.length&&s[s.length-1].lv>=l;)s.pop();(s.length?s[s.length-1].node.kids:n).push(t),s.push({node:t,lv:l})}const l=t=>t.map(t=>{const e=l(t.kids);return m(t.r)||e.length?{r:t.r,kids:e}:null}).filter(Boolean),o=t=>(e&&t.sort((t,n)=>e(t.r,n.r)),t.forEach(t=>o(t.kids)),t),r=[],a=t=>t.forEach(t=>{r.push(t.r),a(t.kids)});return a(o(l(n))),r},x=()=>Array.from({length:a},(t,e)=>e+1),v=t._rowspan;if(v){const t={},e=[];for(const s of n.sort||[])v.includes(s.col)?t[s.col]=s.dir:e.push(s);const s=g(e),l=(e,n)=>{if(n===v.length)return y(e,s);const a=r[v[n]],i=new Map;for(const t of e){const e=a[t-1],n=null==e?"\0":String(e);(i.get(n)||i.set(n,{v:e,rows:[]}).get(n)).rows.push(t)}let c=[...i.values()];if(t[v[n]]){const e=u(a),s="desc"===t[v[n]]?-1:1;c.sort((t,n)=>{const l=null==t.v,r=null==n.v;return l||r?l===r?0:l?1:-1:s*o(t.v,n.v,e)})}return c.flatMap(t=>l(t.rows,n+1))};return l(x(),0)}const $=g(n.sort||[]),k=t._groups;if(!k)return y(x(),$);const N=new Set,M=[];for(const t of k)t.rows.forEach(t=>N.add(t)),M.push(...y(t.rows,$));const S=[];for(let t=1;t<=a;t++)N.has(t)||S.push(t);return[...M,...y(S,$)]}function y(t,e){const n=e.pageSize;if(!n)return e.page=0,t;const s=Math.max(0,Math.ceil(t.length/n)-1);return e.page=Math.min(Math.max(e.page||0,0),s),t.slice(e.page*n,(e.page+1)*n)}function x(s,o){const i=o.interactive,c=o._cols||[],u=o.data||{},d=i.data_url&&e.plugins.server?.(i,o),w=d?i.data_n||0:(u[c[0]]||[]).length,x={},N=d?d.sum:t=>x[t]||=function(t,e){const n=t.filter(t=>null!=t),s=new Map,l={len:t.length,na:t.length-n.length,some:n.some(t=>""!==t),kind:t.date?"date":n.every(t=>"number"==typeof t)?"num":n.every(t=>"string"==typeof t)?"str":"mix"};for(const t of n)s.set(t,(s.get(t)||0)+1);l.m=s.size;const o=n.map(Number).filter(Number.isFinite),r=o.reduce((t,e)=>t+e,0);l.int=o.every(Number.isInteger),o.length&&(l.lo=o.reduce((t,e)=>Math.min(t,e)),l.hi=o.reduce((t,e)=>Math.max(t,e)),l.mean=r/o.length);let a;Object.defineProperty(l,"vals",{get:()=>a||=[...s.keys()].sort((t,e)=>"number"==typeof t&&"number"==typeof e?t-e:String(t).localeCompare(String(e)))}),t.date&&(l.lo=l.vals[0],l.hi=l.vals.at(-1),delete l.mean);if(!e)return l;const i=e=>t.date?Date.parse(e.replace(" ","T")):e,c=n.map(i),u=n.length&&c.every(Number.isFinite);let d=0,p=()=>-1;if(u){const t=c.reduce((t,e)=>Math.min(t,e)),e=c.reduce((t,e)=>Math.max(t,e));d=Math.min(T,s.size),p=n=>Math.min(d-1,Math.floor((i(n)-t)/(e-t||1)*d))}else if(n.length&&s.size<=n.length/2){const t=[...s].sort((t,e)=>e[1]-t[1]),e=new Map(t.map((t,e)=>[t[0],e]));l.top=t.slice(0,5),d=t.length,p=t=>e.get(t)??-1}return l.bar=d?t.map(t=>null==t?-1:p(t)):[],l.count=t=>{const e=Array(d).fill(0);for(const n of t)l.bar[n-1]>=0&&e[l.bar[n-1]]++;return e},l.bins=l.count(t.map((t,e)=>e+1)),l}(p(o)[t]||[],!0),E=o._groups,_={},C=E?[]:null;if(E){const t=new Set;E.forEach(e=>e.rows.forEach(n=>{_[n]=e,C.push(n),t.add(n)}));for(let e=1;e<=w;e++)t.has(e)||C.push(e)}const L=o._rowspan?o._rowspan.length:0,D=L?[...o._rowspan,...c]:c,A=L+c.length,F=o._display||function(t,e,n){const s={};e.forEach(t=>s[t]=[]);let l=0;return a(t,"tbody tr").forEach(t=>{if(t.classList.contains("lt-row-group"))return;const o=n?n[l]:l+1,r=f(t);e.forEach((t,e)=>s[t][o-1]=r[e]?.textContent??""),l++}),s}(s,c,C),I=[...a(s,"thead tr")].pop(),P={filters:{},predicates:{},paints:[],page:0,pageSize:0,sort:Array.isArray(i.sort)?i.sort.map(l):[]};let U,q=()=>{};const W=[],V=(t=!0)=>{if(d)return t&&(P.page=0),(()=>{const t=s.closest(".lt-wrap");return t?.classList.add("lti-busy"),d.load(P).then(e=>{e&&(t?.classList.remove("lti-busy"),o.data=e.data,P.page=e.page,P.paints.forEach(t=>t(null,P.prof=e.prof)),s._lt.clearDetail?.(),X(Array.from({length:Object.values(e.data)[0]?.length??0},(t,e)=>e+1),e.n))},e=>{t?.classList.remove("lti-busy"),console.error(e)})})();t&&(U=P.view=b(o,F,P),P.page=0,P.paints.forEach(t=>t(U,P.prof))),X(y(U,P),U.length)},X=(t,n)=>{const l=(t=>{if(!E)return t;const e=[];let n;for(const s of t){const t=_[s];t!==n&&(t&&e.push({label:t.label,raw:t.raw}),n=t),e.push(s)}return e})(t),a={...o,_viewRows:l},i=m(s.ownerDocument,"template",{innerHTML:e.buildHtml(a)});d&&(o._display=a._display);const c=r(i.content,"tbody");t.length?W.forEach(t=>t(c,l)):c.innerHTML=`<tr class="lti-empty"><td colspan="${A}">—</td></tr>`,r(s,"tbody").replaceWith(c),q(n)},K=M(s.closest(".lt-wrap"),(t=!0)=>V(t));let G=!0,Q=!1;const Z=(t=!0)=>{G?Q=!0:K(t)};s._lt={spec:o,state:P,server:d,refresh:(t=!0)=>K(t),view:()=>U||b(o,F,P),filter(t,e){e?P.predicates[t]=e:delete P.predicates[t],K()}};const tt=i.filter,et=tt?.cols?Object.keys(tt.cols).filter(t=>tt.cols[t]?.type&&"auto"!==tt.cols[t].type&&!c.includes(t)):[],st=!1!==i.search||i.hide||et.length||i.download?m(s.ownerDocument,"div",{className:"lti-bar"},k(s.tHead||s.createTHead(),"lti-head",A,0)):null,lt=f(I).map(t=>h(t).map(t=>t.textContent).join("")),ot=t=>lt[c.indexOf(t)]||t,rt=Object.fromEntries(c.flatMap(t=>null==t?[]:[[t,t],[ot(t),t]]));!1!==i.sort&&function(t,e,n,s){const l=t.ownerDocument,o={},r=()=>{for(const t in o)o[t].th.removeAttribute("aria-sort"),o[t].ind.textContent="";const t=n.sort||[];t.forEach(({col:e,dir:n},s)=>{const l=o[e];l&&(l.th.setAttribute("aria-sort","desc"===n?"descending":"ascending"),l.ind.textContent=("desc"===n?"▼":"▲")+(t.length>1?String(s+1).replace(/\d/g,t=>"₀₁₂₃₄₅₆₇₈₉"[t]):""))})};a(t,"th").forEach((t,a)=>{const i=e[a];if(null==i)return;t.classList.add("lti-sortable");const c=h(t),u=m(l,"span",{className:"lti-label"}),d=m(l,"span",{className:"lti-sort"});t.prepend(u,d),u.append(...c),o[i]={th:t,ind:d},u.onclick=d.onclick=t=>{!function(t,e,n){const s=(t.sort||[]).slice(),l=s.findIndex(t=>t.col===e),o=l<0?"asc":"asc"===s[l].dir?"desc":null;if(!n)return void(t.sort=o?[{col:e,dir:o}]:[]);l<0?s.push({col:e,dir:o}):o?s[l]={col:e,dir:o}:s.splice(l,1);t.sort=s}(n,i,t.shiftKey),r(),s()}}),r()}(I,D,P,Z),"header"===i.profile&&function(t,e,n,s){const l=f(t);e.forEach((e,o)=>{l[o].append(m(t.ownerDocument,"br"),B(t.ownerDocument,n(e),s,e))})}(I,c,N,P),tt&&(tt.default||tt.cols&&Object.keys(tt.cols).some(t=>tt.cols[t]&&c.includes(t)))&&function(t,e,s,l,o,r,a){const i=t.ownerDocument,c=f(t),u=s.default,d=s.cols||{};e.forEach((t,e)=>{const s=c[e],p=t in d,f=H(p?d[t]:u,l(t));if(null!=f&&(!1!==f||p)&&J(l(t))){if(m(i,"br",{},s),!1===f)return m(i,"button",{type:"button",className:"lti-funnel lti-off",disabled:!0},m(i,"span",{className:"lti-pop"},s));if(!0===f){const e=s.appendChild(v(i,`Filter ${t}`,$)),a=m(i,"div",{className:"lti-nl"});e.after(a),z(e,()=>j(l(t).vals),a),S(e,e=>{const s=n.parse(e,{},t);s?o.filters[t]=s:delete o.filters[t],a.textContent=n.parsed(s)?n.text(s,()=>null):"",r()})}else s.append(nt(i,t,f,l,o,r,null,a))}})}(I,c,tt,N,P,Z,"filter"===i.profile);const at=i.resize?function(t,e,n,s=0){const l=[...a(e,"th")],o=function(t,e,n=0){let s=r(t,"colgroup");if(!s){const l=t.ownerDocument;s=m(l,"colgroup");for(let t=0;t<n+e;t++)m(l,"col",{},s);t.caption?t.caption.after(s):t.prepend(s)}return[...s.children]}(t,n,s),i=t=>t.getBoundingClientRect().width,c=()=>{if(t.classList.contains("lti-fixed"))return;const e=l.map(i);t.style.width=i(t)+"px",o.forEach((t,n)=>t.style.width=e[n]+"px"),t.classList.add("lti-fixed")},u=e=>{const n=o.map(t=>t.style.width),s=t.style.width;o.forEach(t=>t.style.width=""),t.style.width="",t.classList.remove("lti-fixed");const r=i(l[e]);return o.forEach((t,e)=>t.style.width=n[e]),t.style.width=s,t.classList.add("lti-fixed"),r},d=(e,n,s=24)=>{const l=parseFloat(o[e].style.width);o[e].style.width=Math.max(n,s)+"px",t.style.width=parseFloat(t.style.width)+parseFloat(o[e].style.width)-l+"px"};return{ths:l,cs:o,dataCs:o.slice(s),freeze:c,natural:u,setWidth:d}}(s,I,c.length,L):null;i.resize&&function(t,e){const n=t.ownerDocument,{ths:s,cs:l,freeze:o,natural:r,setWidth:a}=e;s.forEach((e,s)=>{const i=m(n,"div",{className:"lti-resizer"},e);i.ondblclick=t=>{t.stopPropagation(),o(),a(s,r(s))},i.onpointerdown=e=>{e.stopPropagation(),o();const n=e.clientX,r=parseFloat(l[s].style.width);t.classList.add("lti-resizing"),g(e,t=>a(s,r+t.clientX-n),()=>t.classList.remove("lti-resizing"))}})}(s,at),!1!==i.search&&function(t,e,s,l,o,r,a){const i=e.ownerDocument,c=t.appendChild(v(i,"Search")),u=m(i,"div",{className:"lti-nl"});t.after(u),z(c,a,u),S(c,t=>{const e=n.parse(t,o);s.where=e,u.textContent=n.parsed(e)?n.text(e,r):"",l()})}(st,s,P,Z,rt,ot,()=>O(p(o),c,ot));const it=st?m(s.ownerDocument,"div",{className:"lti-chips"},st):null;et.length&&function(t,e,n,s,l,o,r){const a=t.ownerDocument;for(const i of e)t.append(nt(a,i,n[i],s,l,o,n[i].label||i,r))}(it,et,tt.cols,N,P,Z,"filter"===i.profile);const ct=i.hide||i.download?m(s.ownerDocument,"div",{className:"lti-icons"},st):null;if(i.hide&&function(t,e,n,s,l,o,r,a){const i=e.ownerDocument,c=o&&o.hidden||[],u=new Set,d=(t,e,n)=>{const s=f(t)[e];s&&1===s.colSpan&&(s.hidden=n)};a.push(t=>u.forEach(e=>{for(const n of t.rows)d(n,e,!0)}));const p=[...n.children].length-f(n).length,h=[...e.rows].find(t=>t.classList.contains("lt-spanner-row")),g=h?f(h).slice(p):[];let w=0;g.forEach(t=>{t._span=t.colSpan,t._start=w,w+=t._span});const b=()=>{for(const t of g){let e=0;for(let n=t._start;n<t._start+t._span;n++)u.has(n)&&e++;t.colSpan=Math.max(1,t._span-e),t.hidden=e>=t._span}},y=t=>{const n=u.has(t);r?.dataCs[t]&&(r.dataCs[t].hidden=n);for(const s of e.rows)s.classList.contains("lt-spanner-row")||d(s,t,n);b()},x=m(i,"span",{className:"lti-cols"},t),v=o?.label?Object.assign(Y(i,o.label).el,{role:"button",tabIndex:0}):m(i,"button",{type:"button",title:"Show/Hide columns","aria-label":"Show/Hide columns"});x.append(v);const $=m(i,"div",{className:"lti-menu",hidden:!0},x),k=(t,e)=>{const n=s[t];if(null==n)return;const o=m(i,"label",e?{className:"lti-sub"}:{},$),r=m(i,"input",{type:"checkbox",checked:!0},o);o.append(l[t]??n),c.includes(n)&&(r.checked=!1,u.add(t)),r.onchange=()=>{r.checked?u.delete(t):u.add(t),y(t)}};if(g.length)for(const t of g){const e=t.classList.contains("lt-spanner");e&&m(i,"div",{className:"lti-group",textContent:t.textContent},$);for(let n=t._start;n<t._start+t._span;n++)k(n,e)}else s.forEach((t,e)=>k(e));s.forEach((t,e)=>y(e)),R(i,x,v,$)}(ct,s,I,c,lt,i.hide,at,W),i.download&&function(t,n,s,l){const o=n.ownerDocument,r=e.plugins.export,a="object"==typeof l?l:{file:l},i=a.formats?[].concat(a.formats):Object.keys(r.formats),c=("string"==typeof a.file&&a.file?a.file:"lt-table").replace(new RegExp(`\\.(${Object.keys(r.formats).join("|")})$`,"i"),""),u=1===i.length,d=r.formats[i[0]].label,f=m(o,"span",{className:"lti-dl"},t),h=m(o,"button",{type:"button",className:"lti-download",title:u?`Download ${d}`:"Download","aria-label":u?`Download table as ${d}`:"Download table"},f),g=async t=>{const l=await(n._lt.server?.load(n._lt.state,!0)),i=l?{...s,data:l.data}:s;l&&e.buildHtml(i);const u=l?Array.from({length:l.rows},(t,e)=>e+1):n._lt.view(),d=URL.createObjectURL(new Blob([r.text(t,i,u,"raw"===a.mode?p(i):void 0)],{type:r.formats[t].mime}));m(o,"a",{href:d,download:`${c}.${t}`}).click(),URL.revokeObjectURL(d)};if(u)return h.onclick=()=>g(i[0]);const w=m(o,"div",{className:"lti-menu",hidden:!0,role:"menu"},f),b=R(o,f,h,w);for(const t of i){const e=m(o,"label",{textContent:r.formats[t].label,role:"menuitem",tabIndex:0},w);e.onclick=()=>{b(),g(t)},e.onkeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.click())}}}(ct,s,o,i.download),s._lt.bar=st,s._lt.chips=it,i.detail){const n=function(n,s,l,o,a,i){const c=n.ownerDocument,u={};o.expanded=new Set;const d=(t,e)=>{const n={};for(const s in t)n[s]=t[s]?.[e-1]??null;return n},p=e=>{if(e in u)return u[e];const n=d(s._display||{},e);let l=null;if(Array.isArray(a)){const t={};for(const e of a)t[e]=[n[e]??null];l={data:t}}else{const o="function"==typeof a?a:t[a];"function"==typeof o&&(l=o(d(s.data||{},e),e,n))}return u[e]=l},h=n.closest(".lt-wrap"),g=M(h,t=>t()),w=(t,e)=>{t.textContent=e?"▾":"▸",t.setAttribute("aria-expanded",String(e))},b=(t,n)=>{const s=p(n);if(!s)return null;const o=m(c,"tr",{className:"lti-detail",hidden:!0});return t.after(o),e.render(m(c,"div",{},m(c,"td",{colSpan:l},o)),s),o},y=(t,e)=>{const n=t.nextElementSibling;return n?.classList.contains("lti-detail")?n:b(t,e)};let x=0;const v=()=>{const t=Math.ceil(n.getBoundingClientRect().width);t>x&&t>(parseFloat(n.style.width)||0)&&(n.style.width=t+"px")},$=(t,e,n)=>{const s=o.expanded.has(n);s?o.expanded.delete(n):o.expanded.add(n),w(e,!s);const l=y(t,n);l&&(l.hidden=s,s||v())},k=c.defaultView,N=k.requestIdleCallback||k.setTimeout,S=t=>N(()=>{if(!t.isConnected)return;n.style.width="",x=n.getBoundingClientRect().width;const e=r(t,".lti-expand[aria-expanded='false']");e&&(e.click(),v(),e.click())}),E=(t,e)=>{[...t.rows].forEach((t,n)=>{const s=e[n];if("number"!=typeof s)return;const l=f(t)[0],r=o.expanded.has(s);if(!l)return;const a=m(c,"button",{type:"button",className:"lti-expand","aria-label":"Toggle detail"});if(w(a,r),a.onclick=()=>$(t,a,s),l.prepend(a),r){const e=y(t,s);e&&(e.hidden=!1)}}),S(t)};return E.clear=()=>{o.expanded.clear();for(const t in u)delete u[t]},E.reset=t=>{if(null==t)for(const t in u)delete u[t];else delete u[t];g(i)},E}(s,o,A,P,i.detail,()=>V(!1));W.push(n),s._lt.resetDetail=n.reset,s._lt.clearDetail=n.clear}if(G=!1,i.pager){const t=Array.isArray(i.pager)?i.pager:[10,25,50,100];q=function(t,e,n,s,l,o){const r=t.ownerDocument;let a=t.tFoot;a||((a=t.createTFoot()).className="lt-footer");const i=m(r,"div",{className:"lti-pager"},k(a,"lti-pager-row",e,-1)),c=m(r,"span",{className:"lti-pos"});l.pageSize=n[0];const u=[()=>0,t=>t-1,t=>t+1,()=>1e9],d=["«","‹","›","»"].map((t,e)=>{const n=m(r,"button",{type:"button",textContent:t,"aria-label":["First","Previous","Next","Last"][e]},i);return n.onclick=()=>{l.page=u[e](l.page),o()},n});if(i.append(c),n.length>1&&s>Math.min(...n.filter(t=>t>0))){const t=m(r,"select",{"aria-label":"Rows per page"},i);n.forEach(e=>m(r,"option",{value:e,textContent:e||"∞"},t)),t.onchange=()=>{l.pageSize=+t.value,l.page=0,o()}}return t=>{const e=l.pageSize||t||1,n=Math.max(0,Math.ceil(t/e)-1),o=t<s?` (${s})`:"";c.textContent=(t?`${l.page*e+1}–${Math.min(t,(l.page+1)*e)} / ${t}`:"0 / 0")+o,d.forEach((t,e)=>t.disabled=e<2?!l.page:l.page===n)}}(s,A,t,w,P,()=>V(!1)),V()}else(P.sort.length||i.detail||Q)&&V()}function v(t,e,n=""){return m(t,"input",{type:"search",className:"lti-search","aria-label":e,title:n})}const $="Type a condition, or an expression where x stands for each value in this column, e.g. x > 5 && x < 9";function k(t,e,n,s){const l=t.insertRow(s);return l.className=e,m(t.ownerDocument,"td",{colSpan:n},l)}function N(t,e=400){let n;const s=()=>{clearTimeout(n),n=setTimeout(t,e)};return s.now=()=>{clearTimeout(n),t()},s}function M(t,e){let n,s=0;const l=t=>{const n=performance.now();e(t),s=performance.now()-n};return e=>{if(!t||s<120)return l(e);t.classList.add("lti-busy"),cancelAnimationFrame(n),n=requestAnimationFrame(()=>requestAnimationFrame(()=>{try{l(e)}finally{t.classList.remove("lti-busy")}}))}}function S(t,e){const n=N(()=>e(t.value),1e3);t.oninput=t=>t.inputType&&"insertReplacementText"!==t.inputType?n():n.now(),t.onchange=n.now}const E=t=>/[\s,;:"]/.test(t)?`"${t}"`:String(t),_=t=>t[Math.floor(Math.random()*t.length)],C=t=>t?.some(t=>null!=t&&""!==t),L=t=>{const e=t.filter(t=>null!=t).sort((t,e)=>t-e);return t=>+e[Math.floor((e.length-1)*t)].toPrecision(3)},D=t=>{const e=new Set;for(let n=0;n<30&&e.size<6;n++)e.add(t(n));return[...e]},A=(t,e)=>{if(u(t)){const n=L(t);return _([`${e}over ${n(.5)}`,`${e}under ${n(.5)}`,`${e}at least ${n(.75)}`,`${e}between ${n(.25)} and ${n(.75)}`,`${e}> ${n(.5)}`,`${e}<= ${n(.25)}`,`${e}!= ${n(.5)}`])}const n=[...new Set(t.filter(Boolean))],s=E(_(n)),l=E(_(n));return _([`${e}is ${s}`,`${e}is not ${s}`,`${e}contains ${s}`,`${e}does not contain ${s}`,`${e}is ${s} or ${e}is ${l}`,`${e}== ${s}`,`${e}!= ${s}`])},O=(t,e,n)=>{const s=e.filter(e=>C(t[e])),l=s.filter(e=>u(t[e])),o=s.filter(e=>!u(t[e])),r=e=>{const s=_(e);return A(t[s],`${E(n(s))} `)},a=[l.length&&(()=>r(l)),o.length&&(()=>r(o)),l.length&&o.length&&(()=>`${r(l)}${_([", "," and "])}${r(o)}`)].filter(Boolean);return a.length?D(t=>a[t%a.length]()):[]},j=t=>C(t)?D(e=>e%3==2?(t=>{if(u(t)){const e=L(t);return _([`x > ${e(.25)} && x < ${e(.75)}`,`x < ${e(.25)} || x > ${e(.75)}`])}const e=[...new Set(t.filter(Boolean))],n=JSON.stringify(_(e)),s=JSON.stringify(_(e));return _([`x == ${n} || x == ${s}`,`x != ${n} && x != ${s}`])})(t):A(t,"")):[];let F=0;function z(t,e,n=t){const s=t.ownerDocument,l=m(s,"datalist",{id:"lti-tips-"+ ++F});t.setAttribute("list",l.id),n.after(l);const o=()=>{const t=e();return l.replaceChildren(...t.map(t=>m(s,"option",{value:t}))),t},[r]=o();r&&(t.placeholder=`e.g. ${r}`),t.addEventListener("focus",o)}function R(t,e,n,s){const l=t=>{s.hidden=!t,n.setAttribute("aria-expanded",String(t))};return l(!1),n.onclick=t=>{t.stopPropagation(),l(s.hidden)},n.onkeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n.click())},i(t,"click",t=>{e.contains(t.target)||l(!1)}),i(t,"keydown",t=>{"Escape"===t.key&&l(!1)}),()=>l(!1)}const T=10;function B(t,e,n,s){const l=(t,e)=>+t.toPrecision(e),o=e.bins,r=Math.max(...o),a=m(t,"span",{className:"lti-prof"}),i=o.length?e.top?[e.m>5&&`${e.m+(e.na>0)} distinct`,(e.m>5?"top ":"")+e.top.map(([t,e])=>`${t} (${e})`).join(", "),e.na&&`${e.na} NA`]:"date"===e.kind?[`min ${e.lo}`,`max ${e.hi}`,e.na&&`${Math.round(100*e.na/e.len)}% NA`]:[`min ${l(e.lo,6)}`,`max ${l(e.hi,6)}`,`mean ${l(e.mean,4)}`,e.na&&`${Math.round(100*e.na/e.len)}% NA`]:[],c=(t,e)=>t.map((t,n)=>`<rect${e} x="${n}" y="${1-t/r}" width=".9" height="${t/r}"/>`).join(""),u=(t,n)=>{const l=n?.[s]||t?.length<e.len&&e.count?.(t);a.innerHTML=`<svg viewBox="0 0 ${o.length||1} 1" preserveAspectRatio="none">${c(o,"")}${l?c(l,' class="s"'):""}</svg>`};return a.title=i.filter(Boolean).join("; "),n.paints.push(u),u(n.view,n.prof),a}const H=(t,e)=>{if("auto"!==t?.type)return t;return("num"===e.kind||"date"===e.kind?e.m>1&&{type:"range"}:"str"===e.kind&&e.m<=10&&{type:"checklist"})||{type:"text"}},J=t=>t.some;const I="\0NA",P=t=>""===t?"":t===I?"x == null":`x == ${JSON.stringify(String(t))}`,U=t=>{const e=/^\s*x\s*==\s*(?:(['"])([\s\S]*)\1|null)\s*$/.exec(t||"");return e?e[1]?e[2]:I:null},q=(t,e,n,s,l)=>t<=n&&e>=s?"":l?`x >= ${JSON.stringify(l[t])} && x <= ${JSON.stringify(l[e])}`:`x >= ${t} && x <= ${e}`,W=(t,e)=>{const n=/^\s*x\s*>=\s*("[^"]*"|-?[\d.]+)\s*&&\s*x\s*<=\s*("[^"]*"|-?[\d.]+)\s*$/.exec(t||"");if(!n)return null;const s=t=>'"'!==t[0]?parseFloat(t):e?e.indexOf(JSON.parse(t)):NaN,l=[s(n[1]),s(n[2])];return l.some(t=>!isFinite(t)||e&&t<0)?null:l},V=(t,e)=>e.labels?`${e.labels[t[0]]} – ${e.labels[t[1]]}`:`${t[0]} – ${t[1]}`,X=(t,e)=>{if(t.length===e.length)return"";const n=t.map(t=>t===I?null:String(t));return`${JSON.stringify(n)}.includes(x${n.includes(null)?" ?? null":""})`},K=t=>{const e=/^\s*(\[[\s\S]*\])\.includes\(\s*x\s*(?:\?\?\s*null\s*)?\)\s*$/.exec(t||"");if(!e)return null;try{return JSON.parse(e[1]).map(t=>null===t?I:t)}catch(t){return null}};function G(t,e){if("select"===t.type||"checklist"===t.type){let n=t.choices??e.vals.map(t=>({value:String(t),label:String(t)}));return e.na&&(n=[...n,{value:I,label:"NA"}]),"select"!==t.type||n.some(t=>""===t.value)||(n=[{value:"",label:""},...n]),{...t,choices:n}}if("range"===t.type&&"date"===e.kind){const n=e.vals;return{...t,labels:n,min:0,max:n.length-1,step:1}}let{min:n,max:s,step:l}=t;const o=e.lo??0,r=e.hi??1;null==l&&(l=function(t,e){if(!(t>0&&isFinite(t)))return e?1:.1;const n=t/100,s=Math.pow(10,Math.floor(Math.log10(n))),l=[1,2,5,10].find(t=>t*s>=n)*s;return e?Math.max(1,Math.round(l)):l}((s??r)-(n??o),e.int));const a=t=>Math.round(1e9*t)/1e9;return null==n&&(n=a(Math.floor(o/l)*l)),null==s&&(s=a(Math.ceil(r/l)*l)),{...t,min:n,max:s,step:l}}function Q(t,e,n){const s=e.map(e=>{const n=m(t,"label",{className:"lti-check"}),s=m(t,"input",{type:"checkbox",checked:!0,value:e.value},n);return n.append(e.label),{o:e,box:s,label:n}}),l=()=>n(s.filter(t=>t.box.checked).map(t=>t.o.value));return s.forEach(t=>t.box.onchange=l),{el:s.map(t=>t.label),set:t=>s.forEach(e=>e.box.checked=t.includes(e.o.value))}}function Y(t,e,n){const s=m(t,"span",{className:"lti-chip"});m(t,"span",{className:"lti-chip-name",textContent:e},s);const l=m(t,"span",{className:"lti-chip-cur"},s);return n&&s.append(n),{el:s,mark:t=>s.classList.toggle("lti-on",!!t),summarize:t=>l.textContent=t}}function Z(t,e,n,s){const l=e.min,o=e.max,r=o-l||1,a=e.step||r/100,i=m(t,"div",{className:"lti-slider"}),c=m(t,"div",{className:"lti-slider-fill"},i),u=e=>m(t,"button",{type:"button",className:"lti-thumb",role:"slider","aria-label":e,"aria-valuemin":l,"aria-valuemax":o},i),d=[u("Minimum"),u("Maximum")];let p=[l,o];const f=N(()=>n(p.slice())),h=t=>p[0]!==t[0]||p[1]!==t[1],w=t=>(t-l)/r*100,b=()=>{d.forEach((t,e)=>{t.style.left=w(p[e])+"%",t.setAttribute("aria-valuenow",p[e])}),c.style.left=w(p[0])+"%",c.style.right=100-w(p[1])+"%"},y=(t,e)=>{p[t]=(t=>{const e=Math.round((t-l)/a)*a+l;return Math.min(o,Math.max(l,Math.round(1e6*e)/1e6))})(e),p[0]>p[1]&&(p=[Math.min(...p),Math.max(...p)]),b(),s&&s(p.slice())};return d.forEach((t,e)=>{t.onpointerdown=n=>{t.focus();const s=p.slice();g(n,t=>y(e,(t=>{const e=i.getBoundingClientRect();return l+r*Math.min(1,Math.max(0,(t-e.left)/e.width))})(t.clientX)),()=>h(s)&&f.now())},t.onkeydown=t=>{const n={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1}[t.key],s=p.slice();if(n)y(e,p[e]+n*a);else if("Home"===t.key)y(e,l);else{if("End"!==t.key)return;y(e,o)}h(s)&&f(),t.preventDefault()}}),b(),{el:i,set:t=>{p=t.slice(),b()}}}function tt(t,e,n,s,l){const o=m(t,"span",{className:"lti-pop"}),r=m(t,"button",{type:"button",className:"lti-funnel",title:e,"aria-label":e,"aria-expanded":"false"},o),a=m(t,"div",{className:"lti-pop-panel",hidden:!0},o);n(a);const c=e=>{const n=!a.hidden;a.hidden=!e,r.setAttribute("aria-expanded",String(e)),e?(()=>{a.style.left=a.style.right="";const e=(t.defaultView||window).innerWidth,n=o.closest(".lt-wrap"),s=Math.min(e,n?n.getBoundingClientRect().right:e);a.getBoundingClientRect().right>s-4&&(a.style.left="auto",a.style.right="0")})():n&&s&&s()},u=l||o;return u.onclick=t=>{a.contains(t.target)||c(a.hidden)},i(t,"pointerdown",t=>{u.contains(t.target)||c(!1)}),i(t,"keydown",t=>{"Escape"===t.key&&c(!1)}),o}const et={select:{describe:(t,e)=>{const n=U(t);if(null==n)return t?"⋯":"";const s=e.choices.find(t=>t.value===n);return s?s.label:n},init:t=>P(t.selected??""),parse:U,build:(t,e,n)=>{const s=function(t,e,n){const s=m(t,"select",{className:"lti-filter-pick"});return e.forEach(e=>m(t,"option",{value:e.value,textContent:e.label},s)),s.onchange=()=>n(s.value),{el:s,set:t=>s.value=t}}(t,e.choices,t=>n(P(t),l)),l={el:s.el,reflect:t=>{const e=U(t);s.set(null==e?"":e)}};return l}},range:{describe:(t,e)=>{const n=W(t,e.labels);return n?V(n,e):t?"⋯":""},init:t=>t.value?q(t.value[0],t.value[1],t.min,t.max,t.labels):"",parse:(t,e)=>W(t,e.labels),build:(t,e,n)=>{const s=m(t,"span",{className:"lti-slider-out"}),l=t=>s.textContent=V(t,e),o=Z(t,e,t=>{l(t),(t=>{n(q(t[0],t[1],e.min,e.max,e.labels),r)})(t)},l),r={el:[o.el,s],reflect:t=>{const n=W(t,e.labels)||[e.min,e.max];o.set(n),l(n)}};return r}},text:{describe:t=>t,init:()=>"",parse:t=>t,build:()=>({el:[],reflect:()=>{}})},checklist:{describe:(t,e)=>{const n=K(t);if(null==n)return t?"⋯":"";const s=e.choices.filter(t=>n.includes(t.value)).map(t=>t.label);return s.length<=2?s.join(", "):`${s.length} selected`},init:t=>X([].concat(t.selected??t.choices.map(t=>t.value)),t.choices),parse:K,build:(t,e,n)=>{const s=e.choices.map(t=>t.value),l=Q(t,e.choices,t=>n(X(t,e.choices),o)),o={el:l.el,reflect:t=>{const e=K(t);l.set(null==e?s:e)}};return o}}};function nt(t,e,s,l,o,r,a,i){const c=G(s,l(e)),u=et[c.type],d=[];let p=()=>{},f=()=>{},h=null;const g=(t,n)=>{t?o.filters[e]=t:delete o.filters[e],r();const s=o.filters[e]||"";d.forEach(t=>t!==n&&t.reflect(s)),h&&(h.hidden=!!s&&null==u.parse(s,c)),p(s)},w=a&&Y(t,a),b=tt(t,`Filter ${c.label||e}`,s=>{const r=i&&B(t,l(e),o,e);if(r&&s.append(r),!1!==c.box){const o=s.appendChild(v(t,`${c.label||e} filter expression`,$)),r={reflect:e=>{t.activeElement!==o&&(o.value=e)}},a=m(t,"div",{className:"lti-nl"},s);d.push(r),z(o,()=>j(l(e).vals)),S(o,t=>{const s=n.parse(t,{},e),l=n.expr(s);a.textContent=l&&n.parsed(s)?n.text(s,()=>null):"",g(l??t.trim(),r)})}const a=u.build(t,c,g);d.push(a),h=m(t,"div",{className:"lti-widget"},s),h.append(...[].concat(a.el)),g(u.init(c),null)},()=>f(),w&&w.el);let y=b;return w?(w.el.append(b),y=w.el,p=w.mark,f=()=>w.summarize(u.describe(o.filters[e]||"",c))):p=t=>y.classList.toggle("lti-on",!!t),p(o.filters[e]||""),f(),y}const st=(t,e)=>{e?.interactive&&!t.dataset.ltiOn&&(t.dataset.ltiOn="1",x(t,e))};e.plugins.interactive={matcher:w,computeView:b,pageSlice:y,enhance:x},e.ui=Object.assign(e.ui||{},{popover:tt,checklist:Q,chip:Y}),e.onMount.push(st),"undefined"!=typeof document&&a(document,".lt-table").forEach(t=>st(t,t._ltSpec))})("undefined"!=typeof window?window:globalThis);
|
|
1
|
+
(t=>{"use strict";const e=t.LT;if(!e?.onMount||e.plugins.interactive)return;const n=e.plugins.query;let s;const l=t=>"string"!=typeof t?{...t}:"-"===t[0]?{col:t.slice(1),dir:"desc"}:{col:t,dir:"asc"},o=(t,e,n)=>(s||=new Intl.Collator,n?t-e:s.compare(String(t),String(e))),{$:r,$$:a,on:i,off:c,numCol:u,dateFmt:d}=e,p=t=>{const e=t.data||{};if(t._txt?.d!==e){const n={...e};for(const s in e){const l=d(e[s]);(l||t.dates?.includes(s))&&(n[s]=Object.assign(e[s].map(t=>null!=t&&l?l(t):t),{date:!0}))}t._txt={d:e,t:n}}return t._txt.t},f=t=>[...t.children].filter(t=>!t.classList.contains("lt-row-group")),h=t=>{const e=[...t.childNodes],n=e.findIndex(t=>"BR"===t.nodeName);return n<0?e:e.slice(0,n)};function m(t,e,n={},s){const l=t.createElement(e);for(const t in n)t.includes("-")?l.setAttribute(t,n[t]):l[t]=n[t];return s?s.appendChild(l):l}function g(t,e,n){t.preventDefault();const s=t.target.ownerDocument||document,l=t=>e(t);i(s,"pointermove",l),i(s,"pointerup",()=>{c(s,"pointermove",l),n&&n()},{once:!0})}function w(t){const e=String(t??"").trim();if(""===e)return null;if(/(^|[^\w$])x([^\w$]|$)/.test(e)){let t;try{t=new Function("x",`return (${e});`)}catch(t){}if(t){const n=/^\s*!|!=/.test(e),s=e=>{try{if(null==e)return n||!!t(void 0);const s=Number(e);return!!t(String(e))||""!==e&&isFinite(s)&&!!t(s)}catch(t){return!1}};return t=>t[n?"every":"some"](t=>s(t.raw))}}const n="!"===e[0],s=(n?e.slice(1).trim():e).toLowerCase();return""===s?null:t=>n!==t.some(t=>null!=t.disp&&String(t.disp).toLowerCase().includes(s))}function b(t,e,n){const s=t._cols||[],l=t.data||{},r=p(t),a=(l[s[0]]||[]).length,i=(t,n)=>({raw:r[t]?.[n-1]??null,disp:e[t]?.[n-1]??""}),c=[],d=t=>{if(t.op){const e=t.items.map(d);return"and"===t.op?t=>e.every(e=>e(t)):t=>e.some(e=>e(t))}const e=w(t.term);return e?null!=t.col?n=>e([i(t.col,n)]):t=>e(s.map(e=>i(e,t))):()=>!0};for(const t in n.filters||{}){const e=n.filters[t];c.push(d("string"==typeof e?{col:t,term:e}:e))}n.where&&c.push(d(n.where));const f=w(n.term);f&&c.push(t=>f(s.map(e=>i(e,t))));const h=Object.values(n.predicates||{});if(h.length){const t=Object.keys(l),e=e=>Object.fromEntries(t.map(t=>[t,l[t]?.[e-1]??null]));c.push(t=>{const n=e(t);return h.every(t=>t(n))})}const m=t=>c.every(e=>e(t)),g=t=>{const e=t.map(t=>{const e=r[t.col];return e&&{col:e,num:u(e),dir:"desc"===t.dir?-1:1}}).filter(Boolean);return e.length?(t,n)=>{for(const{col:s,num:l,dir:r}of e){const e=s[t-1],a=s[n-1],i=null==e,c=null==a;if(i||c){if(i!==c)return i?1:-1;continue}const u=o(e,a,l);if(u)return r*u}return 0}:null},b=t._indent,y=(t,e)=>{if(!b){const n=t.filter(m);return e?n.sort(e):n}const n=[],s=[];for(const e of t){const t={r:e,kids:[]},l=b[e-1]||0;for(;s.length&&s[s.length-1].lv>=l;)s.pop();(s.length?s[s.length-1].node.kids:n).push(t),s.push({node:t,lv:l})}const l=t=>t.map(t=>{const e=l(t.kids);return m(t.r)||e.length?{r:t.r,kids:e}:null}).filter(Boolean),o=t=>(e&&t.sort((t,n)=>e(t.r,n.r)),t.forEach(t=>o(t.kids)),t),r=[],a=t=>t.forEach(t=>{r.push(t.r),a(t.kids)});return a(o(l(n))),r},x=()=>Array.from({length:a},(t,e)=>e+1),v=t._rowspan;if(v){const t={},e=[];for(const s of n.sort||[])v.includes(s.col)?t[s.col]=s.dir:e.push(s);const s=g(e),l=(e,n)=>{if(n===v.length)return y(e,s);const a=r[v[n]],i=new Map;for(const t of e){const e=a[t-1],n=null==e?"\0":String(e);(i.get(n)||i.set(n,{v:e,rows:[]}).get(n)).rows.push(t)}let c=[...i.values()];if(t[v[n]]){const e=u(a),s="desc"===t[v[n]]?-1:1;c.sort((t,n)=>{const l=null==t.v,r=null==n.v;return l||r?l===r?0:l?1:-1:s*o(t.v,n.v,e)})}return c.flatMap(t=>l(t.rows,n+1))};return l(x(),0)}const $=g(n.sort||[]),k=t._groups;if(!k)return y(x(),$);const N=new Set,M=[];for(const t of k)t.rows.forEach(t=>N.add(t)),M.push(...y(t.rows,$));const S=[];for(let t=1;t<=a;t++)N.has(t)||S.push(t);return[...M,...y(S,$)]}function y(t,e){const n=e.pageSize;if(!n)return e.page=0,t;const s=Math.max(0,Math.ceil(t.length/n)-1);return e.page=Math.min(Math.max(e.page||0,0),s),t.slice(e.page*n,(e.page+1)*n)}function x(s,o){const i=o.interactive,c=o._cols||[],u=o.data||{},d=i.data_url&&e.plugins.server?.(i,o),w=d?i.data_n||0:(u[c[0]]||[]).length,x={},N=d?d.sum:t=>x[t]||=function(t,e){const n=t.filter(t=>null!=t),s=new Map,l={len:t.length,na:t.length-n.length,some:n.some(t=>""!==t),kind:t.date?"date":n.every(t=>"number"==typeof t)?"num":n.every(t=>"string"==typeof t)?"str":"mix"};for(const t of n)s.set(t,(s.get(t)||0)+1);l.m=s.size;const o=n.map(Number).filter(Number.isFinite),r=o.reduce((t,e)=>t+e,0);l.int=o.every(Number.isInteger),o.length&&(l.lo=o.reduce((t,e)=>Math.min(t,e)),l.hi=o.reduce((t,e)=>Math.max(t,e)),l.mean=r/o.length);let a;Object.defineProperty(l,"vals",{get:()=>a||=[...s.keys()].sort((t,e)=>"number"==typeof t&&"number"==typeof e?t-e:String(t).localeCompare(String(e)))}),t.date&&(l.lo=l.vals[0],l.hi=l.vals.at(-1),delete l.mean);if(!e)return l;const i=e=>t.date?Date.parse(e.replace(" ","T")):e,c=n.map(i),u=n.length&&c.every(Number.isFinite);let d=0,p=()=>-1;if(u){const t=c.reduce((t,e)=>Math.min(t,e)),e=c.reduce((t,e)=>Math.max(t,e));d=Math.min(T,s.size),p=n=>Math.min(d-1,Math.floor((i(n)-t)/(e-t||1)*d))}else if(n.length&&s.size<=n.length/2){const t=[...s].sort((t,e)=>e[1]-t[1]),e=new Map(t.map((t,e)=>[t[0],e]));l.top=t.slice(0,5),d=t.length,p=t=>e.get(t)??-1}return l.bar=d?t.map(t=>null==t?-1:p(t)):[],l.count=t=>{const e=Array(d).fill(0);for(const n of t)l.bar[n-1]>=0&&e[l.bar[n-1]]++;return e},l.bins=l.count(t.map((t,e)=>e+1)),l}(p(o)[t]||[],!0),E=o._groups,_={},C=E?[]:null;if(E){const t=new Set;E.forEach(e=>e.rows.forEach(n=>{_[n]=e,C.push(n),t.add(n)}));for(let e=1;e<=w;e++)t.has(e)||C.push(e)}const L=o._rowspan?o._rowspan.length:0,D=L?[...o._rowspan,...c]:c,A=L+c.length,F=o._display||function(t,e,n){const s={};e.forEach(t=>s[t]=[]);let l=0;return a(t,"tbody tr").forEach(t=>{if(t.classList.contains("lt-row-group"))return;const o=n?n[l]:l+1,r=f(t);e.forEach((t,e)=>s[t][o-1]=r[e]?.textContent??""),l++}),s}(s,c,C),I=[...a(s,"thead tr")].pop(),P={filters:{},predicates:{},paints:[],page:0,pageSize:0,sort:Array.isArray(i.sort)?i.sort.map(l):[]};let U,q=()=>{};const W=[],V=(t=!0)=>{if(d)return t&&(P.page=0),(()=>{const t=s.closest(".lt-wrap");return t?.classList.add("lti-busy"),d.load(P).then(e=>{e&&(t?.classList.remove("lti-busy"),o.data=e.data,P.page=e.page,P.paints.forEach(t=>t(null,P.prof=e.prof)),s._lt.clearDetail?.(),X(Array.from({length:Object.values(e.data)[0]?.length??0},(t,e)=>e+1),e.n))},e=>{t?.classList.remove("lti-busy"),console.error(e)})})();t&&(U=P.view=b(o,F,P),P.page=0,P.paints.forEach(t=>t(U,P.prof))),X(y(U,P),U.length)},X=(t,n)=>{const l=(t=>{if(!E)return t;const e=[];let n;for(const s of t){const t=_[s];t!==n&&(t&&e.push({label:t.label,raw:t.raw}),n=t),e.push(s)}return e})(t),a={...o,_viewRows:l},i=m(s.ownerDocument,"template",{innerHTML:e.buildHtml(a)});d&&(o._display=a._display);const c=r(i.content,"tbody");t.length?W.forEach(t=>t(c,l)):c.innerHTML=`<tr class="lti-empty"><td colspan="${A}">—</td></tr>`,r(s,"tbody").replaceWith(c),q(n)},K=M(s.closest(".lt-wrap"),(t=!0)=>V(t));let G=!0,Q=!1;const Z=(t=!0)=>{G?Q=!0:K(t)};s._lt={spec:o,state:P,server:d,refresh:(t=!0)=>K(t),view:()=>U||b(o,F,P),filter(t,e){e?P.predicates[t]=e:delete P.predicates[t],K()}};const tt=i.filter,et=tt?.cols?Object.keys(tt.cols).filter(t=>tt.cols[t]?.type&&"auto"!==tt.cols[t].type&&!c.includes(t)):[],st=!1!==i.search||i.hide||et.length||i.download?m(s.ownerDocument,"div",{className:"lti-bar"},k(s.tHead||s.createTHead(),"lti-head",A,0)):null,lt=f(I).map(t=>h(t).map(t=>t.textContent).join("")),ot=t=>lt[c.indexOf(t)]||t,rt=Object.fromEntries(c.flatMap(t=>null==t?[]:[[t,t],[ot(t),t]]));!1!==i.sort&&function(t,e,n,s){const l=t.ownerDocument,o={},r=()=>{for(const t in o)o[t].th.removeAttribute("aria-sort"),o[t].ind.textContent="";const t=n.sort||[];t.forEach(({col:e,dir:n},s)=>{const l=o[e];l&&(l.th.setAttribute("aria-sort","desc"===n?"descending":"ascending"),l.ind.textContent=("desc"===n?"▼":"▲")+(t.length>1?String(s+1).replace(/\d/g,t=>"₀₁₂₃₄₅₆₇₈₉"[t]):""))})};a(t,"th").forEach((t,a)=>{const i=e[a];if(null==i)return;t.classList.add("lti-sortable");const c=h(t),u=m(l,"span",{className:"lti-label"}),d=m(l,"span",{className:"lti-sort"});t.prepend(u,d),u.append(...c),o[i]={th:t,ind:d},u.onclick=d.onclick=t=>{!function(t,e,n){const s=(t.sort||[]).slice(),l=s.findIndex(t=>t.col===e),o=l<0?"asc":"asc"===s[l].dir?"desc":null;if(!n)return void(t.sort=o?[{col:e,dir:o}]:[]);l<0?s.push({col:e,dir:o}):o?s[l]={col:e,dir:o}:s.splice(l,1);t.sort=s}(n,i,t.shiftKey),r(),s()}}),r()}(I,D,P,Z),"header"===i.profile&&function(t,e,n,s){const l=f(t);e.forEach((e,o)=>{l[o].append(m(t.ownerDocument,"br"),B(t.ownerDocument,n(e),s,e))})}(I,c,N,P),tt&&(tt.default||tt.cols&&Object.keys(tt.cols).some(t=>tt.cols[t]&&c.includes(t)))&&function(t,e,s,l,o,r,a){const i=t.ownerDocument,c=f(t),u=s.default,d=s.cols||{};e.forEach((t,e)=>{const s=c[e],p=t in d,f=H(p?d[t]:u,l(t));if(null!=f&&(!1!==f||p)&&J(l(t))){if(m(i,"br",{},s),!1===f)return m(i,"button",{type:"button",className:"lti-funnel lti-off",disabled:!0},m(i,"span",{className:"lti-pop"},s));if(!0===f){const e=s.appendChild(v(i,`Filter ${t}`,$)),a=m(i,"div",{className:"lti-nl"});e.after(a),z(e,()=>j(l(t).vals),a),S(e,e=>{const s=n.parse(e,{},t);s?o.filters[t]=s:delete o.filters[t],a.textContent=n.parsed(s)?n.text(s,()=>null):"",r()})}else s.append(nt(i,t,f,l,o,r,null,a))}})}(I,c,tt,N,P,Z,"filter"===i.profile);const at=i.resize?function(t,e,n,s=0){const l=[...a(e,"th")],o=function(t,e,n=0){let s=r(t,"colgroup");if(!s){const l=t.ownerDocument;s=m(l,"colgroup");for(let t=0;t<n+e;t++)m(l,"col",{},s);t.caption?t.caption.after(s):t.prepend(s)}return[...s.children]}(t,n,s),i=t=>t.getBoundingClientRect().width,c=()=>{if(t.classList.contains("lti-fixed"))return;const e=l.map(i);t.style.width=i(t)+"px",o.forEach((t,n)=>t.style.width=e[n]+"px"),t.classList.add("lti-fixed")},u=e=>{const n=o.map(t=>t.style.width),s=t.style.width;o.forEach(t=>t.style.width=""),t.style.width="",t.classList.remove("lti-fixed");const r=i(l[e]);return o.forEach((t,e)=>t.style.width=n[e]),t.style.width=s,t.classList.add("lti-fixed"),r},d=(e,n,s=24)=>{const l=parseFloat(o[e].style.width);o[e].style.width=Math.max(n,s)+"px",t.style.width=parseFloat(t.style.width)+parseFloat(o[e].style.width)-l+"px"};return{ths:l,cs:o,dataCs:o.slice(s),freeze:c,natural:u,setWidth:d}}(s,I,c.length,L):null;i.resize&&function(t,e){const n=t.ownerDocument,{ths:s,cs:l,freeze:o,natural:r,setWidth:a}=e;s.forEach((e,s)=>{const i=m(n,"div",{className:"lti-resizer"},e);i.ondblclick=t=>{t.stopPropagation(),o(),a(s,r(s))},i.onpointerdown=e=>{e.stopPropagation(),o();const n=e.clientX,r=parseFloat(l[s].style.width);t.classList.add("lti-resizing"),g(e,t=>a(s,r+t.clientX-n),()=>t.classList.remove("lti-resizing"))}})}(s,at),!1!==i.search&&function(t,e,s,l,o,r,a){const i=e.ownerDocument,c=t.appendChild(v(i,"Search")),u=m(i,"div",{className:"lti-nl"});t.after(u),z(c,a,u),S(c,t=>{const e=n.parse(t,o);s.where=e,u.textContent=n.parsed(e)?n.text(e,r):"",l()})}(st,s,P,Z,rt,ot,()=>O(p(o),c,ot));const it=st?m(s.ownerDocument,"div",{className:"lti-chips"},st):null;et.length&&function(t,e,n,s,l,o,r){const a=t.ownerDocument;for(const i of e)t.append(nt(a,i,n[i],s,l,o,n[i].label||i,r))}(it,et,tt.cols,N,P,Z,"filter"===i.profile);const ct=i.hide||i.download?m(s.ownerDocument,"div",{className:"lti-icons"},st):null;if(i.hide&&function(t,e,n,s,l,o,r,a){const i=e.ownerDocument,c=o&&o.hidden||[],u=new Set,d=(t,e,n)=>{const s=f(t)[e];s&&1===s.colSpan&&(s.hidden=n)};a.push(t=>u.forEach(e=>{for(const n of t.rows)d(n,e,!0)}));const p=[...n.children].length-f(n).length,h=[...e.rows].find(t=>t.classList.contains("lt-spanner-row")),g=h?f(h).slice(p):[];let w=0;g.forEach(t=>{t._span=t.colSpan,t._start=w,w+=t._span});const b=()=>{for(const t of g){let e=0;for(let n=t._start;n<t._start+t._span;n++)u.has(n)&&e++;t.colSpan=Math.max(1,t._span-e),t.hidden=e>=t._span}},y=t=>{const n=u.has(t);r?.dataCs[t]&&(r.dataCs[t].hidden=n);for(const s of e.rows)s.classList.contains("lt-spanner-row")||d(s,t,n);b()},x=m(i,"span",{className:"lti-cols"},t),v=o?.label?Object.assign(Y(i,o.label).el,{role:"button",tabIndex:0}):m(i,"button",{type:"button",title:"Show/Hide columns","aria-label":"Show/Hide columns"});x.append(v);const $=m(i,"div",{className:"lti-menu",hidden:!0},x),k=(t,e)=>{const n=s[t];if(null==n)return;const o=m(i,"label",e?{className:"lti-sub"}:{},$),r=m(i,"input",{type:"checkbox",checked:!0},o);o.append(l[t]??n),c.includes(n)&&(r.checked=!1,u.add(t)),r.onchange=()=>{r.checked?u.delete(t):u.add(t),y(t)}};if(g.length)for(const t of g){const e=t.classList.contains("lt-spanner");e&&m(i,"div",{className:"lti-group",textContent:t.textContent},$);for(let n=t._start;n<t._start+t._span;n++)k(n,e)}else s.forEach((t,e)=>k(e));s.forEach((t,e)=>y(e)),R(i,x,v,$)}(ct,s,I,c,lt,i.hide,at,W),i.download&&function(t,n,s,l){const o=n.ownerDocument,r=e.plugins.export,a="object"==typeof l?l:{file:l},i=a.formats?[].concat(a.formats):Object.keys(r.formats),c=("string"==typeof a.file&&a.file?a.file:"lt-table").replace(new RegExp(`\\.(${Object.keys(r.formats).join("|")})$`,"i"),""),u=1===i.length,d=r.formats[i[0]].label,f=m(o,"span",{className:"lti-dl"},t),h=m(o,"button",{type:"button",className:"lti-download",title:u?`Download ${d}`:"Download","aria-label":u?`Download table as ${d}`:"Download table"},f),g=async t=>{const l=await(n._lt.server?.load(n._lt.state,!0)),i=l?{...s,data:l.data}:s;l&&e.buildHtml(i);const u=l?Array.from({length:l.rows},(t,e)=>e+1):n._lt.view(),d=URL.createObjectURL(new Blob([r.text(t,i,u,"raw"===a.mode?p(i):void 0)],{type:r.formats[t].mime}));m(o,"a",{href:d,download:`${c}.${t}`}).click(),URL.revokeObjectURL(d)};if(u)return h.onclick=()=>g(i[0]);const w=m(o,"div",{className:"lti-menu",hidden:!0,role:"menu"},f),b=R(o,f,h,w);for(const t of i){const e=m(o,"label",{textContent:r.formats[t].label,role:"menuitem",tabIndex:0},w);e.onclick=()=>{b(),g(t)},e.onkeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.click())}}}(ct,s,o,i.download),s._lt.bar=st,s._lt.chips=it,i.detail){const n=function(n,s,l,o,a,i){const c=n.ownerDocument,u={};o.expanded=new Set;const d=(t,e)=>{const n={};for(const s in t)n[s]=t[s]?.[e-1]??null;return n},p=e=>{if(e in u)return u[e];const n=d(s._display||{},e);let l=null;if(Array.isArray(a)){const t={};for(const e of a)t[e]=[n[e]??null];l={data:t}}else{const o="function"==typeof a?a:t[a];"function"==typeof o&&(l=o(d(s.data||{},e),e,n))}return u[e]=l},h=n.closest(".lt-wrap"),g=M(h,t=>t()),w=(t,e)=>{t.textContent=e?"▾":"▸",t.setAttribute("aria-expanded",String(e))},b=(t,n)=>{const s=p(n);if(!s)return null;const o=m(c,"tr",{className:"lti-detail",hidden:!0});return t.after(o),e.render(m(c,"div",{},m(c,"td",{colSpan:l},o)),s),o},y=(t,e)=>{const n=t.nextElementSibling;return n?.classList.contains("lti-detail")?n:b(t,e)};let x=0;const v=()=>{const t=Math.ceil(n.getBoundingClientRect().width);t>x&&t>(parseFloat(n.style.width)||0)&&(n.style.width=t+"px")},$=(t,e,n)=>{const s=o.expanded.has(n);s?o.expanded.delete(n):o.expanded.add(n),w(e,!s);const l=y(t,n);l&&(l.hidden=s,s||v())},k=c.defaultView,N=k.requestIdleCallback||k.setTimeout,S=t=>N(()=>{if(!t.isConnected)return;n.style.width="",x=n.getBoundingClientRect().width;const e=r(t,".lti-expand[aria-expanded='false']");e&&(e.click(),v(),e.click())}),E=(t,e)=>{[...t.rows].forEach((t,n)=>{const s=e[n];if("number"!=typeof s)return;const l=f(t)[0],r=o.expanded.has(s);if(!l)return;const a=m(c,"button",{type:"button",className:"lti-expand","aria-label":"Toggle detail"});if(w(a,r),a.onclick=()=>$(t,a,s),l.prepend(a),r){const e=y(t,s);e&&(e.hidden=!1)}}),S(t)};return E.clear=()=>{o.expanded.clear();for(const t in u)delete u[t]},E.reset=t=>{if(null==t)for(const t in u)delete u[t];else delete u[t];g(i)},E}(s,o,A,P,i.detail,()=>V(!1));W.push(n),s._lt.resetDetail=n.reset,s._lt.clearDetail=n.clear}if(G=!1,i.pager){const t=Array.isArray(i.pager)?i.pager:[10,25,50,100];q=function(t,e,n,s,l,o){const r=t.ownerDocument;let a=t.tFoot;a||((a=t.createTFoot()).className="lt-footer");const i=m(r,"div",{className:"lti-pager"},k(a,"lti-pager-row",e,-1)),c=m(r,"span",{className:"lti-pos"});l.pageSize=n[0];const u=[()=>0,t=>t-1,t=>t+1,()=>1e9],d=["«","‹","›","»"].map((t,e)=>{const n=m(r,"button",{type:"button",textContent:t,"aria-label":["First","Previous","Next","Last"][e]},i);return n.onclick=()=>{l.page=u[e](l.page),o()},n});if(i.append(c),n.length>1&&s>Math.min(...n.filter(t=>t>0))){const t=m(r,"select",{"aria-label":"Rows per page"},i);n.forEach(e=>m(r,"option",{value:e,textContent:e||"∞"},t)),t.onchange=()=>{l.pageSize=+t.value,l.page=0,o()}}return t=>{const e=l.pageSize||t||1,n=Math.max(0,Math.ceil(t/e)-1),o=t<s?` (${s})`:"";c.textContent=(t?`${l.page*e+1}–${Math.min(t,(l.page+1)*e)} / ${t}`:"0 / 0")+o,d.forEach((t,e)=>t.disabled=e<2?!l.page:l.page===n)}}(s,A,t,w,P,()=>V(!1)),V()}else(P.sort.length||i.detail||Q)&&V()}function v(t,e,n=""){return m(t,"input",{type:"search",className:"lti-search","aria-label":e,title:n})}const $="Type a condition, or an expression where x stands for each value in this column, e.g. x > 5 && x < 9";function k(t,e,n,s){const l=t.insertRow(s);return l.className=e,m(t.ownerDocument,"td",{colSpan:n},l)}function N(t,e=400){let n;const s=()=>{clearTimeout(n),n=setTimeout(t,e)};return s.now=()=>{clearTimeout(n),t()},s}function M(t,e){let n,s=0;const l=t=>{const n=performance.now();e(t),s=performance.now()-n};return e=>{if(!t||s<120)return l(e);t.classList.add("lti-busy"),cancelAnimationFrame(n),n=requestAnimationFrame(()=>requestAnimationFrame(()=>{try{l(e)}finally{t.classList.remove("lti-busy")}}))}}function S(t,e){const n=N(()=>e(t.value),1e3);t.oninput=t=>t.inputType&&"insertReplacementText"!==t.inputType?n():n.now(),t.onchange=n.now}const E=t=>/[\s,;:"]/.test(t)?`"${t}"`:String(t),_=t=>t[Math.floor(Math.random()*t.length)],C=t=>t?.some(t=>null!=t&&""!==t),L=t=>{const e=t.filter(t=>null!=t).sort((t,e)=>t-e);return t=>+e[Math.floor((e.length-1)*t)].toPrecision(3)},D=t=>{const e=new Set;for(let n=0;n<30&&e.size<6;n++)e.add(t(n));return[...e]},A=(t,e)=>{if(u(t)){const n=L(t);return _([`${e}over ${n(.5)}`,`${e}under ${n(.5)}`,`${e}at least ${n(.75)}`,`${e}between ${n(.25)} and ${n(.75)}`,`${e}> ${n(.5)}`,`${e}<= ${n(.25)}`,`${e}!= ${n(.5)}`])}const n=[...new Set(t.filter(Boolean))],s=E(_(n)),l=E(_(n));return _([`${e}is ${s}`,`${e}is not ${s}`,`${e}contains ${s}`,`${e}does not contain ${s}`,`${e}is ${s} or ${e}is ${l}`,`${e}== ${s}`,`${e}!= ${s}`])},O=(t,e,n)=>{const s=e.filter(e=>C(t[e])),l=s.filter(e=>u(t[e])),o=s.filter(e=>!u(t[e])),r=e=>{const s=_(e);return A(t[s],`"${n(s)}" `)},a=[l.length&&(()=>r(l)),o.length&&(()=>r(o)),l.length&&o.length&&(()=>`${r(l)}${_([", "," and "])}${r(o)}`)].filter(Boolean);return a.length?D(t=>a[t%a.length]()):[]},j=t=>C(t)?D(e=>e%3==2?(t=>{if(u(t)){const e=L(t);return _([`x > ${e(.25)} && x < ${e(.75)}`,`x < ${e(.25)} || x > ${e(.75)}`])}const e=[...new Set(t.filter(Boolean))],n=JSON.stringify(_(e)),s=JSON.stringify(_(e));return _([`x == ${n} || x == ${s}`,`x != ${n} && x != ${s}`])})(t):A(t,"")):[];let F=0;function z(t,e,n=t){const s=t.ownerDocument,l=m(s,"datalist",{id:"lti-tips-"+ ++F});t.setAttribute("list",l.id),n.after(l);const o=()=>{const t=e();return l.replaceChildren(...t.map(t=>m(s,"option",{value:t}))),t},[r]=o();r&&(t.placeholder=`e.g. ${r}`),t.addEventListener("focus",o)}function R(t,e,n,s){const l=t=>{s.hidden=!t,n.setAttribute("aria-expanded",String(t))};return l(!1),n.onclick=t=>{t.stopPropagation(),l(s.hidden)},n.onkeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n.click())},i(t,"click",t=>{e.contains(t.target)||l(!1)}),i(t,"keydown",t=>{"Escape"===t.key&&l(!1)}),()=>l(!1)}const T=10;function B(t,e,n,s){const l=(t,e)=>+t.toPrecision(e),o=e.bins,r=Math.max(...o),a=m(t,"span",{className:"lti-prof"}),i=o.length?e.top?[e.m>5&&`${e.m+(e.na>0)} distinct`,(e.m>5?"top ":"")+e.top.map(([t,e])=>`${t} (${e})`).join(", "),e.na&&`${e.na} NA`]:"date"===e.kind?[`min ${e.lo}`,`max ${e.hi}`,e.na&&`${Math.round(100*e.na/e.len)}% NA`]:[`min ${l(e.lo,6)}`,`max ${l(e.hi,6)}`,`mean ${l(e.mean,4)}`,e.na&&`${Math.round(100*e.na/e.len)}% NA`]:[],c=(t,e)=>t.map((t,n)=>t||e?`<rect${e} x="${n}" y="${1-t/r}" width=".9" height="${t/r}"/>`:`<line x1="${n}" x2="${n+.9}" y1="1" y2="1"/>`).join(""),u=(t,n)=>{const l=n?.[s]||t?.length<e.len&&e.count?.(t);a.innerHTML=`<svg viewBox="0 0 ${o.length||1} 1" preserveAspectRatio="none">${c(o,"")}${l?c(l,' class="s"'):""}</svg>`};return a.title=i.filter(Boolean).join("; "),n.paints.push(u),u(n.view,n.prof),a}const H=(t,e)=>{if("auto"!==t?.type)return t;return("num"===e.kind||"date"===e.kind?e.m>1&&{type:"range"}:"str"===e.kind&&e.m<=10&&{type:"checklist"})||{type:"text"}},J=t=>t.some;const I="\0NA",P=t=>""===t?"":t===I?"x == null":`x == ${JSON.stringify(String(t))}`,U=t=>{const e=/^\s*x\s*==\s*(?:(['"])([\s\S]*)\1|null)\s*$/.exec(t||"");return e?e[1]?e[2]:I:null},q=(t,e,n,s,l)=>t<=n&&e>=s?"":l?`x >= ${JSON.stringify(l[t])} && x <= ${JSON.stringify(l[e])}`:`x >= ${t} && x <= ${e}`,W=(t,e)=>{const n=/^\s*x\s*>=\s*("[^"]*"|-?[\d.]+)\s*&&\s*x\s*<=\s*("[^"]*"|-?[\d.]+)\s*$/.exec(t||"");if(!n)return null;const s=t=>'"'!==t[0]?parseFloat(t):e?e.indexOf(JSON.parse(t)):NaN,l=[s(n[1]),s(n[2])];return l.some(t=>!isFinite(t)||e&&t<0)?null:l},V=(t,e)=>e.labels?`${e.labels[t[0]]} – ${e.labels[t[1]]}`:`${t[0]} – ${t[1]}`,X=(t,e)=>{if(t.length===e.length)return"";const n=t.map(t=>t===I?null:String(t));return`${JSON.stringify(n)}.includes(x${n.includes(null)?" ?? null":""})`},K=t=>{const e=/^\s*(\[[\s\S]*\])\.includes\(\s*x\s*(?:\?\?\s*null\s*)?\)\s*$/.exec(t||"");if(!e)return null;try{return JSON.parse(e[1]).map(t=>null===t?I:t)}catch(t){return null}};function G(t,e){if("select"===t.type||"checklist"===t.type){let n=t.choices??e.vals.map(t=>({value:String(t),label:String(t)}));return e.na&&(n=[...n,{value:I,label:"NA"}]),"select"!==t.type||n.some(t=>""===t.value)||(n=[{value:"",label:""},...n]),{...t,choices:n}}if("range"===t.type&&"date"===e.kind){const n=e.vals;return{...t,labels:n,min:0,max:n.length-1,step:1}}let{min:n,max:s,step:l}=t;const o=e.lo??0,r=e.hi??1;null==l&&(l=function(t,e){if(!(t>0&&isFinite(t)))return e?1:.1;const n=t/100,s=Math.pow(10,Math.floor(Math.log10(n))),l=[1,2,5,10].find(t=>t*s>=n)*s;return e?Math.max(1,Math.round(l)):l}((s??r)-(n??o),e.int));const a=t=>Math.round(1e9*t)/1e9;return null==n&&(n=a(Math.floor(o/l)*l)),null==s&&(s=a(Math.ceil(r/l)*l)),{...t,min:n,max:s,step:l}}function Q(t,e,n){const s=e.map(e=>{const n=m(t,"label",{className:"lti-check"}),s=m(t,"input",{type:"checkbox",checked:!0,value:e.value},n);return n.append(e.label),{o:e,box:s,label:n}}),l=()=>n(s.filter(t=>t.box.checked).map(t=>t.o.value));return s.forEach(t=>t.box.onchange=l),{el:s.map(t=>t.label),set:t=>s.forEach(e=>e.box.checked=t.includes(e.o.value))}}function Y(t,e,n){const s=m(t,"span",{className:"lti-chip"});m(t,"span",{className:"lti-chip-name",textContent:e},s);const l=m(t,"span",{className:"lti-chip-cur"},s);return n&&s.append(n),{el:s,mark:t=>s.classList.toggle("lti-on",!!t),summarize:t=>l.textContent=t}}function Z(t,e,n,s){const l=e.min,o=e.max,r=o-l||1,a=e.step||r/100,i=m(t,"div",{className:"lti-slider"}),c=m(t,"div",{className:"lti-slider-fill"},i),u=e=>m(t,"button",{type:"button",className:"lti-thumb",role:"slider","aria-label":e,"aria-valuemin":l,"aria-valuemax":o},i),d=[u("Minimum"),u("Maximum")];let p=[l,o];const f=N(()=>n(p.slice())),h=t=>p[0]!==t[0]||p[1]!==t[1],w=t=>(t-l)/r*100,b=()=>{d.forEach((t,e)=>{t.style.left=w(p[e])+"%",t.setAttribute("aria-valuenow",p[e])}),c.style.left=w(p[0])+"%",c.style.right=100-w(p[1])+"%"},y=(t,e)=>{p[t]=(t=>{const e=Math.round((t-l)/a)*a+l;return Math.min(o,Math.max(l,Math.round(1e6*e)/1e6))})(e),p[0]>p[1]&&(p=[Math.min(...p),Math.max(...p)]),b(),s&&s(p.slice())};return d.forEach((t,e)=>{t.onpointerdown=n=>{t.focus();const s=p.slice();g(n,t=>y(e,(t=>{const e=i.getBoundingClientRect();return l+r*Math.min(1,Math.max(0,(t-e.left)/e.width))})(t.clientX)),()=>h(s)&&f.now())},t.onkeydown=t=>{const n={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1}[t.key],s=p.slice();if(n)y(e,p[e]+n*a);else if("Home"===t.key)y(e,l);else{if("End"!==t.key)return;y(e,o)}h(s)&&f(),t.preventDefault()}}),b(),{el:i,set:t=>{p=t.slice(),b()}}}function tt(t,e,n,s,l){const o=m(t,"span",{className:"lti-pop"}),r=m(t,"button",{type:"button",className:"lti-funnel",title:e,"aria-label":e,"aria-expanded":"false"},o),a=m(t,"div",{className:"lti-pop-panel",hidden:!0},o);n(a);const c=e=>{const n=!a.hidden;a.hidden=!e,r.setAttribute("aria-expanded",String(e)),e?(()=>{a.style.left=a.style.right="";const e=(t.defaultView||window).innerWidth,n=o.closest(".lt-wrap"),s=Math.min(e,n?n.getBoundingClientRect().right:e);a.getBoundingClientRect().right>s-4&&(a.style.left="auto",a.style.right="0")})():n&&s&&s()},u=l||o;return u.onclick=t=>{a.contains(t.target)||c(a.hidden)},i(t,"pointerdown",t=>{u.contains(t.target)||c(!1)}),i(t,"keydown",t=>{"Escape"===t.key&&c(!1)}),o}const et={select:{describe:(t,e)=>{const n=U(t);if(null==n)return t?"⋯":"";const s=e.choices.find(t=>t.value===n);return s?s.label:n},init:t=>P(t.selected??""),parse:U,build:(t,e,n)=>{const s=function(t,e,n){const s=m(t,"select",{className:"lti-filter-pick"});return e.forEach(e=>m(t,"option",{value:e.value,textContent:e.label},s)),s.onchange=()=>n(s.value),{el:s,set:t=>s.value=t}}(t,e.choices,t=>n(P(t),l)),l={el:s.el,reflect:t=>{const e=U(t);s.set(null==e?"":e)}};return l}},range:{describe:(t,e)=>{const n=W(t,e.labels);return n?V(n,e):t?"⋯":""},init:t=>t.value?q(t.value[0],t.value[1],t.min,t.max,t.labels):"",parse:(t,e)=>W(t,e.labels),build:(t,e,n)=>{const s=m(t,"span",{className:"lti-slider-out"}),l=t=>s.textContent=V(t,e),o=Z(t,e,t=>{l(t),(t=>{n(q(t[0],t[1],e.min,e.max,e.labels),r)})(t)},l),r={el:[o.el,s],reflect:t=>{const n=W(t,e.labels)||[e.min,e.max];o.set(n),l(n)}};return r}},text:{describe:t=>t,init:()=>"",parse:t=>t,build:()=>({el:[],reflect:()=>{}})},checklist:{describe:(t,e)=>{const n=K(t);if(null==n)return t?"⋯":"";const s=e.choices.filter(t=>n.includes(t.value)).map(t=>t.label);return s.length<=2?s.join(", "):`${s.length} selected`},init:t=>X([].concat(t.selected??t.choices.map(t=>t.value)),t.choices),parse:K,build:(t,e,n)=>{const s=e.choices.map(t=>t.value),l=Q(t,e.choices,t=>n(X(t,e.choices),o)),o={el:l.el,reflect:t=>{const e=K(t);l.set(null==e?s:e)}};return o}}};function nt(t,e,s,l,o,r,a,i){const c=G(s,l(e)),u=et[c.type],d=[];let p=()=>{},f=()=>{},h=null;const g=(t,n)=>{t?o.filters[e]=t:delete o.filters[e],r();const s=o.filters[e]||"";d.forEach(t=>t!==n&&t.reflect(s)),h&&(h.hidden=!!s&&null==u.parse(s,c)),p(s)},w=a&&Y(t,a),b=tt(t,`Filter ${c.label||e}`,s=>{const r=i&&B(t,l(e),o,e);if(r&&s.append(r),!1!==c.box){const o=s.appendChild(v(t,`${c.label||e} filter expression`,$)),r={reflect:e=>{t.activeElement!==o&&(o.value=e)}},a=m(t,"div",{className:"lti-nl"},s);d.push(r),z(o,()=>j(l(e).vals)),S(o,t=>{const s=n.parse(t,{},e),l=n.expr(s);a.textContent=l&&n.parsed(s)?n.text(s,()=>null):"",g(l??t.trim(),r)})}const a=u.build(t,c,g);d.push(a),h=m(t,"div",{className:"lti-widget"},s),h.append(...[].concat(a.el)),g(u.init(c),null)},()=>f(),w&&w.el);let y=b;return w?(w.el.append(b),y=w.el,p=w.mark,f=()=>w.summarize(u.describe(o.filters[e]||"",c))):p=t=>y.classList.toggle("lti-on",!!t),p(o.filters[e]||""),f(),y}const st=(t,e)=>{e?.interactive&&!t.dataset.ltiOn&&(t.dataset.ltiOn="1",x(t,e))};e.plugins.interactive={matcher:w,computeView:b,pageSlice:y,enhance:x},e.ui=Object.assign(e.ui||{},{popover:tt,checklist:Q,chip:Y}),e.onMount.push(st),"undefined"!=typeof document&&a(document,".lt-table").forEach(t=>st(t,t._ltSpec))})("undefined"!=typeof window?window:globalThis);
|
|
2
2
|
//# sourceMappingURL=lt-interactive.min.js.map
|