@observablehq/runtime
Advanced tools
Comparing version 4.13.0 to 4.14.0
@@ -1,2 +0,2 @@ | ||
// @observablehq/runtime v4.13.0 Copyright 2021 Observable, Inc. | ||
function e(e,t,n){n=n||{};var r=e.ownerDocument,i=r.defaultView.CustomEvent;"function"==typeof i?i=new i(t,{detail:n}):((i=r.createEvent("Event")).initEvent(t,!1,!1),i.detail=n),e.dispatchEvent(i)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const i=Symbol.prototype.toString;function o(e){return i.call(e)}const{getOwnPropertySymbols:a,prototype:{hasOwnProperty:s}}=Object,{toStringTag:l}=Symbol,u={},c=a;function d(e,t){return s.call(e,t)}function f(e){return e[l]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return u}}const h=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function m(e){try{let t=h.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),i=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:i&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:v,getOwnPropertyDescriptors:b}=Object,_=v({});function w(n,i,o,a){let s,l,u,c,d=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,l=y):(s="Map()",l=j):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,l=g):(s="Set()",l=j):d?(s=`${n.constructor.name}(${n.length})`,l=x):(c=m(n))?(s=`Immutable.${c.name}${"Record"===c.name?"":`(${n.size})`}`,d=c.arrayish,l=c.arrayish?C:c.setish?E:P):a?(s=f(n),l=N):(s=f(n),l=j);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const h=p.appendChild(document.createElement("a"));h.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",h.appendChild(document.createTextNode(`${s}${d?" [":" {"}`)),h.addEventListener("mouseup",(function(e){e.stopPropagation(),ae(p,$(n,null,o,a))})),l=l(n);for(let e=0;!(u=l.next()).done&&e<20;++e)p.appendChild(u.value);if(!u.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(u.value,p.lastChild.previousSibling);for(let e=0;!(u=l.next()).done&&e<19;++e)p.insertBefore(u.value,p.lastChild.previousSibling);u.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(d?"]":"}")),p}function*y(e){for(const[t,n]of e)yield L(t,n);yield*j(e)}function*g(e){for(const t of e)yield O(t);yield*j(e)}function*E(e){for(const t of e)yield O(t)}function*x(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield q(t,p(e,t),"observablehq--index"));for(const t in e)!n(t)&&d(e,t)&&(yield q(t,p(e,t),"observablehq--key"));for(const t of c(e))yield q(o(t),p(e,t),"observablehq--symbol")}function*C(e){let t=0;for(const n=e.size;t<n;++t)yield q(t,e.get(t),!0)}function*N(e){for(const t in b(e))yield q(t,p(e,t),"observablehq--key");for(const t of c(e))yield q(o(t),p(e,t),"observablehq--symbol");const t=v(e);t&&t!==_&&(yield S(t))}function*j(e){for(const t in e)d(e,t)&&(yield q(t,p(e,t),"observablehq--key"));for(const t of c(e))yield q(o(t),p(e,t),"observablehq--symbol");const t=v(e);t&&t!==_&&(yield S(t))}function*P(e){for(const[t,n]of e)yield q(t,n,"observablehq--key")}function S(e){const t=document.createElement("div"),n=t.appendChild(document.createElement("span"));return t.className="observablehq--field",n.className="observablehq--prototype-key",n.textContent=" <prototype>",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function q(e,t,n){const r=document.createElement("div"),i=r.appendChild(document.createElement("span"));return r.className="observablehq--field",i.className=n,i.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function L(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function O(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function M(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function $(e,n,i,o){let a,s,l,u,c=t(e);if(e instanceof Map?e instanceof e.constructor?(a=`Map(${e.size})`,s=A):(a="Map()",s=D):e instanceof Set?e instanceof e.constructor?(a=`Set(${e.size})`,s=k):(a="Set()",s=D):c?(a=`${e.constructor.name}(${e.length})`,s=U):(u=m(e))?(a=`Immutable.${u.name}${"Record"===u.name?"":`(${e.size})`}`,c=u.arrayish,s=u.arrayish?R:u.setish?T:F):(a=f(e),s=D),n){const t=document.createElement("span");return t.className="observablehq--shallow",i&&t.appendChild(r(i)),t.appendChild(document.createTextNode(a)),t.addEventListener("mouseup",(function(n){M(t)||(n.stopPropagation(),ae(t,$(e)))})),t}const d=document.createElement("span");d.className="observablehq--collapsed",i&&d.appendChild(r(i));const p=d.appendChild(document.createElement("a"));p.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",p.appendChild(document.createTextNode(`${a}${c?" [":" {"}`)),d.addEventListener("mouseup",(function(t){M(d)||(t.stopPropagation(),ae(d,w(e,0,i,o)))}),!0),s=s(e);for(let e=0;!(l=s.next()).done&&e<20;++e)e>0&&d.appendChild(document.createTextNode(", ")),d.appendChild(l.value);return l.done||d.appendChild(document.createTextNode(", …")),d.appendChild(document.createTextNode(c?"]":"}")),d}function*A(e){for(const[t,n]of e)yield B(t,n);yield*D(e)}function*k(e){for(const t of e)yield oe(t,!0);yield*D(e)}function*T(e){for(const t of e)yield oe(t,!0)}function*R(e){let t=-1,n=0;for(const r=e.size;n<r;++n)n>t+1&&(yield z(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield z(n-t-1))}function*U(e){let t=-1,r=0;for(const n=e.length;r<n;++r)r in e&&(r>t+1&&(yield z(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield z(r-t-1));for(const t in e)!n(t)&&d(e,t)&&(yield I(t,p(e,t),"observablehq--key"));for(const t of c(e))yield I(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const t in e)d(e,t)&&(yield I(t,p(e,t),"observablehq--key"));for(const t of c(e))yield I(o(t),p(e,t),"observablehq--symbol")}function*F(e){for(const[t,n]of e)yield I(t,n,"observablehq--key")}function z(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function I(e,t,n){const r=document.createDocumentFragment(),i=r.appendChild(document.createElement("span"));return i.className=n,i.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function B(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function H(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function W(e){return e<0?"-"+H(-e,6):e>9999?"+"+H(e,6):H(e,4)}var V=Error.prototype.toString;var Y=RegExp.prototype.toString;function G(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,J)}function J(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function K(e,t){for(var n=0;t.exec(e);)++n;return n}var Q=Function.prototype.toString,X={prefix:"async ƒ"},Z={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var i=document.createElement("span");i.className="observablehq--function",n&&i.appendChild(r(n));var o=i.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,i.appendChild(document.createTextNode(t)),i}const{prototype:{toString:ie}}=Object;function oe(e,t,n,i,a){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,i=Q.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Z;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(i)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(i))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,i);case"string":return function(e,t,n,i){if(!1===t){if(K(e,/["\n]/g)<=K(e,/`|\${/g)){const t=document.createElement("span");i&&t.appendChild(r(i));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");i&&n.appendChild(r(i));const a=n.appendChild(document.createElement("span"));a.className="observablehq--string",a.textContent="`"+G(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),l=o.length-20;return s.textContent=`Show ${l} truncated line${l>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ae(n,oe(e,t,!0,i))})),n}const a=document.createElement("span");i&&a.appendChild(r(i));const s=a.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+G(e)+"`",a}const o=document.createElement("span");i&&o.appendChild(r(i));const a=o.appendChild(document.createElement("span"));return a.className="observablehq--string",a.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,i);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",l=e,e=isNaN(l)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(l)?W(l.getUTCFullYear())+"-"+H(l.getUTCMonth()+1,2)+"-"+H(l.getUTCDate(),2):W(l.getFullYear())+"-"+H(l.getMonth()+1,2)+"-"+H(l.getDate(),2)+"T"+H(l.getHours(),2)+":"+H(l.getMinutes(),2)+(l.getMilliseconds()?":"+H(l.getSeconds(),2)+"."+H(l.getMilliseconds(),3):l.getSeconds()?":"+H(l.getSeconds(),2):"");break}if(e===u){s="forbidden",e="[forbidden]";break}switch(ie.call(e)){case"[object RegExp]":s="regexp",e=function(e){return Y.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?w:$)(e,t,i,a)}}var l;const c=document.createElement("span");i&&c.appendChild(r(i));const d=c.appendChild(document.createElement("span"));return d.className=`observablehq--${s}`,d.textContent=e,c}function ae(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class le{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!(t instanceof Element||t instanceof Text)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:i}=this;for(i.classList.remove("observablehq--running"),i.classList.add("observablehq--error");i.lastChild;)i.removeChild(i.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),i.appendChild(o),e(i,"error",{error:t})}}le.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new le(e.appendChild(document.createElement("div")))}};const ue=new Map,ce=[],de=ce.map,fe=ce.some,pe=ce.hasOwnProperty,he="https://cdn.jsdelivr.net/npm/",me=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,ve=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,be=/\.[^/]*$/,_e=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function we(e){const t=me.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function ye(e){const t=`${he}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=ue.get(t);return n||ue.set(t,n=fetch(t).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!ue.has(e.url)&&ue.set(e.url,n),e.json()}))),n}RequireError.prototype.name=RequireError.name;var ge=Ee((async function(e,t){if(e.startsWith(he)&&(e=e.substring(he.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=we(e);if(!n)return`${he}${e}`;if(!n.version&&null!=t&&t.startsWith(he)){const e=await ye(we(t.substring(he.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!be.test(n.path)&&(n.path+=".js"),n.path&&n.version&&ve.test(n.version))return`${he}${n.name}@${n.version}/${n.path}`;const r=await ye(n);return`${he}${r.name}@${r.version}/${n.path||function(e){for(const t of _e){const n=e[t];if("string"==typeof n)return be.test(n)?n:`${n}.js`}}(r)||"index.js"}`}));function Ee(e){const t=new Map,n=i(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(ce.pop()(i(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=je,document.head.appendChild(r)}))),n}function i(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(de.call(arguments,n)).then(xe):n(e)}return o.alias=function(t){return Ee(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function xe(e){const t={};for(const n of e)for(const e in n)pe.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:Ce(n,e)}):t[e]=n[e]);return t}function Ce(e,t){return()=>e[t]}function Ne(e){return"exports"===(e+="")||"module"===e}function je(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),ce.push(fe.call(t,Ne)?e=>{const r={},i={exports:r};return Promise.all(de.call(t,(t=>"exports"===(t+="")?r:"module"===t?i:e(t)))).then((e=>(n.apply(null,e),i.exports)))}:e=>Promise.all(de.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}function Pe(e,t,n){return{resolve:(r=n)=>`https://cdn.jsdelivr.net/npm/${e}@${t}/${r}`}}je.amd={};const Se=Pe("d3","6.7.0","dist/d3.min.js"),qe=Pe("d3-dsv","2.0.0","dist/d3-dsv.min.js"),Le=Pe("@observablehq/inputs","0.8.0","dist/inputs.umd.min.js"),Oe=Pe("@observablehq/plot","0.1.0","dist/plot.umd.min.js"),Me=Pe("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),$e=Pe("@observablehq/highlight.js","2.0.0","highlight.min.js"),Ae=Pe("@observablehq/katex","0.11.1","dist/katex.min.js"),ke=Pe("lodash","4.17.21","lodash.min.js"),Te=Pe("htl","0.2.5","dist/htl.min.js"),Re=Pe("marked","0.3.12","marked.min.js"),Ue=Pe("sql.js","1.5.0","dist/sql-wasm.js"),De=Pe("vega","5.20.2","build/vega.min.js"),Fe=Pe("vega-lite","5.1.0","build/vega-lite.min.js"),ze=Pe("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Ie=Pe("apache-arrow","4.0.1","Arrow.es2015.min.js");async function Be(e){return(await e(Ue.resolve()))({locateFile:e=>Ue.resolve(`dist/${e}`)})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([Be(ge),Promise.resolve(e).then(He)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:i,values:o}=r,a=o.map((e=>Object.fromEntries(e.map(((e,t)=>[i[t],e])))));return a.columns=i,a}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return We("pre",{className:"observablehq--inspect"},[Ve((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return We("table",{value:t},[We("thead",[We("tr",n.map((e=>We("th",[Ve(e)]))))]),We("tbody",t.map((e=>We("tr",n.map((t=>We("td",[Ve(e[t])])))))))])}}function He(e){return"string"==typeof e?fetch(e).then(He):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(He):e instanceof ArrayBuffer?new Uint8Array(e):e}function We(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function Ve(e){return document.createTextNode(e)}async function Ye(e){return await e("jszip@3.6.0/dist/jszip.min.js")}async function Ge(e){const t=await fetch(await e.url());if(!t.ok)throw new Error(`Unable to load file: ${e.name}`);return t}async function Je(e,t,{array:n=!1,typed:r=!1}={}){const[i,o]=await Promise.all([e.text(),ge(qe.resolve())]);return("\t"===t?n?o.tsvParseRows:o.tsvParse:n?o.csvParseRows:o.csvParse)(i,r&&o.autoType)}class Ke{constructor(e){Object.defineProperty(this,"name",{value:e,enumerable:!0})}async blob(){return(await Ge(this)).blob()}async arrayBuffer(){return(await Ge(this)).arrayBuffer()}async text(){return(await Ge(this)).text()}async json(){return(await Ge(this)).json()}async stream(){return(await Ge(this)).body}async csv(e){return Je(this,",",e)}async tsv(e){return Je(this,"\t",e)}async image(){const e=await this.url();return new Promise(((t,n)=>{const r=new Image;new URL(e,document.baseURI).origin!==new URL(location).origin&&(r.crossOrigin="anonymous"),r.onload=()=>t(r),r.onerror=()=>n(new Error(`Unable to load file: ${this.name}`)),r.src=e}))}async arrow(){const[e,t]=await Promise.all([ge(Ie.resolve()),Ge(this)]);return e.Table.from(t)}async sqlite(){return SQLiteDatabaseClient.open(Ge(this))}async zip(){const[e,t]=await Promise.all([Ye(ge),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}}class FileAttachment extends Ke{constructor(e,t){super(t),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function Qe(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends Ke{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Xe={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Ze=0;function et(e){this.id=e,this.href=new URL(`#${e}`,location)+""}et.prototype.toString=function(){return"url("+this.href+")"};var tt={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var i=r.getContext("2d");return i.scale(n,n),i},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),i=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),i.textContent=n,i.disabled=!1}return i.textContent=n,r.download=t,r.onclick=async t=>{if(i.disabled=!0,r.href)return o();i.textContent="Saving…";try{const t=await("function"==typeof e?e():e);i.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){i.textContent=n}if(t.eventPhase)return o();i.disabled=!1},r},element:function(e,t){var n,r=e+="",i=r.indexOf(":");i>=0&&"xmlns"!==(r=e.slice(0,i))&&(e=e.slice(i+1));var o=Xe.hasOwnProperty(r)?document.createElementNS(Xe[r],e):document.createElement(e);if(t)for(var a in t)i=(r=a).indexOf(":"),n=t[a],i>=0&&"xmlns"!==(r=a.slice(0,i))&&(a=a.slice(i+1)),Xe.hasOwnProperty(r)?o.setAttributeNS(Xe[r],a,n):o.setAttribute(a,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new et("O-"+(null==e?"":e+"-")+ ++Ze)}};var nt={buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}};function rt(){return this}function it(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:rt,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function ot(e){let t,n,r=!1;const i=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=i&&"function"!=typeof i)throw new Error("function"==typeof i.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:rt,throw:()=>({done:!0}),return:()=>(null!=i&&i(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function at(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var st={disposable:it,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return ot((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=at(e);function i(){t(at(e))}return e.addEventListener(n,i),void 0!==r&&t(r),function(){e.removeEventListener(n,i)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:ot,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:rt,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n));++r<i;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return it(n,(()=>{n.terminate(),URL.revokeObjectURL(t)}))}};function lt(e,t){return function(n){var r,i,o,a,s,l,u,c,d=n[0],f=[],p=null,h=-1;for(s=1,l=arguments.length;s<l;++s){if((r=arguments[s])instanceof Node)f[++h]=r,d+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(u=0,c=r.length;u<c;++u)(i=r[u])instanceof Node?(null===p&&(f[++h]=p=document.createDocumentFragment(),d+="\x3c!--o:"+h+"--\x3e"),p.appendChild(i)):(p=null,d+=i);p=null}else d+=r;d+=n[s]}if(p=e(d),++h>0){for(o=new Array(h),a=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)i=a.currentNode,/^o:/.test(i.nodeValue)&&(o[+i.nodeValue.slice(2)]=i);for(s=0;s<h;++s)(i=o[s])&&i.parentNode.replaceChild(f[s],i)}return 1===p.childNodes.length?p.removeChild(p.firstChild):11===p.nodeType?((i=t()).appendChild(p),i):p}}var ut=lt((function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)}),(function(){return document.createElement("span")}));function ct(e){let t;Object.defineProperties(this,{generator:{value:ot((e=>{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*dt(){for(;;)yield Date.now()}var ft=new Map;function pt(e,t){var n;return(n=ft.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){ft.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return ft.set(t,n),n}(n,e).then((()=>t))}var ht={delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return pt(Math.ceil((Date.now()+1)/e)*e,t)},when:pt};function mt(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}function vt(e){return null==e?ge:Ee(e)}var bt=lt((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")})),_t=String.raw;function wt(){return ot((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}var yt=Object.assign((function(e){const t=vt(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>Qe,Arrow:()=>t(Ie.resolve()),Inputs:()=>t(Le.resolve()),Mutable:()=>ct,Plot:()=>t(Oe.resolve()),SQLite:()=>Be(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,_:()=>t(ke.resolve()),d3:()=>t(Se.resolve()),dot:()=>t(Me.resolve()),htl:()=>t(Te.resolve()),html:()=>ut,md:()=>function(e){return e(Re.resolve()).then((function(t){return lt((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var i=r.querySelectorAll("pre code[class]");return i.length>0&&e($e.resolve()).then((function(t){i.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e($e.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e($e.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),now:dt,require:()=>t,resolve:()=>mt,svg:()=>bt,tex:()=>function(e){return Promise.all([e(Ae.resolve()),(t=Ae.resolve("dist/katex.min.css"),new Promise((function(e,n){var r=document.createElement("link");r.rel="stylesheet",r.href=t,r.onerror=n,r.onload=e,document.head.appendChild(r)})))]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(_t.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}));var t}(t),vl:()=>async function(e){const[t,n,r]=await Promise.all([De,Fe,ze].map((t=>e(t.resolve()))));return r.register(t,n)}(t),width:wt,DOM:tt,Files:nt,Generators:st,Promises:ht},Object.fromEntries(Object.entries(n).map(gt))))}),{resolve:ge.resolve});function gt([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}function Et(e,t){this.message=e+"",this.input=t}Et.prototype=Object.create(Error.prototype),Et.prototype.name="RuntimeError",Et.prototype.constructor=Et;var xt=Array.prototype,Ct=xt.map,Nt=xt.forEach;function jt(e){return function(){return e}}function Pt(e){return e}function St(){}var qt={};function Lt(e,t,n){var r;n||(n=qt),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:$t,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:St,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==qt,writable:!0},_rejector:{value:(r=this,function(e){if(e===$t)throw new Et(r._name+" is not defined",r._name);if(e instanceof Error&&e.message)throw new Et(e.message,r._name);throw new Et(r._name+" could not be resolved",r._name)})},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Ot(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function Mt(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function $t(){throw $t}function At(e){return function(){throw new Et(e+" is defined more than once")}}function kt(e,t,n){var r=this._module._scope,i=this._module._runtime;if(this._inputs.forEach(Mt,this),t.forEach(Ot,this),this._inputs=t,this._definition=n,this._value=void 0,n===St?i._variables.delete(this):i._variables.add(this),e!==this._name||r.get(e)!==this){var o,a;if(this._name)if(this._outputs.size)r.delete(this._name),(a=this._module._resolve(this._name))._outputs=this._outputs,this._outputs=new Set,a._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=a}),this),a._outputs.forEach(i._updates.add,i._updates),i._dirty.add(a).add(this),r.set(this._name,a);else if((a=r.get(this._name))===this)r.delete(this._name);else{if(3!==a._type)throw new Error;a._duplicates.delete(this),this._duplicate=void 0,1===a._duplicates.size&&(a=a._duplicates.keys().next().value,o=r.get(this._name),a._outputs=o._outputs,o._outputs=new Set,a._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=a})),a._definition=a._duplicate,a._duplicate=void 0,i._dirty.add(o).add(a),i._updates.add(a),r.set(this._name,a))}if(this._outputs.size)throw new Error;e&&((a=r.get(e))?3===a._type?(this._definition=At(e),this._duplicate=n,a._duplicates.add(this)):2===a._type?(this._outputs=a._outputs,a._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(a)]=this}),this),i._dirty.add(a).add(this),r.set(e,this)):(a._duplicate=a._definition,this._duplicate=n,(o=new Lt(3,this._module))._name=e,o._definition=this._definition=a._definition=At(e),o._outputs=a._outputs,a._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(a)]=o})),o._duplicates=new Set([this,a]),i._dirty.add(a).add(o),i._updates.add(a).add(o),r.set(e,o)):r.set(e,this)),this._name=e}return i._updates.add(this),i._compute(),this}function Tt(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["invalidation",Dt],["visibility",Ft],...t])},_source:{value:null,writable:!0}})}function Rt(e){return e._name}Object.defineProperties(Lt.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return kt.call(this,null==e?null:e+"",null==t?[]:Ct.call(t,this._module._resolve,this._module),"function"==typeof n?n:jt(n))},writable:!0,configurable:!0},delete:{value:function(){return kt.call(this,null,[],St)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return kt.call(this,t+"",[n._resolve(e+"")],Pt)},writable:!0,configurable:!0}}),Object.defineProperties(Tt.prototype,{_copy:{value:function(e,t){e._source=this,t.set(this,e);for(const[o,a]of this._scope){var n=e._scope.get(o);if(!n||1!==n._type)if(a._definition===Pt){var r=a._inputs[0],i=r._module;e.import(r._name,o,t.get(i)||(i._source?i._copy(new Tt(e._runtime,e._builtins),t):i))}else e.define(o,a._inputs.map(Rt),a._definition)}return e},writable:!0,configurable:!0},_resolve:{value:function(e){var t,n=this._scope.get(e);if(!n)if(n=new Lt(2,this),this._builtins.has(e))n.define(e,jt(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,(r=t,function(){throw r}))}void 0===t?this._scope.set(n._name=e,n):n.define(e,jt(t))}var r;return n},writable:!0,configurable:!0},redefine:{value:function(e){var t=this._scope.get(e);if(!t)throw new Et(e+" is not defined");if(3===t._type)throw new Et(e+" is defined more than once");return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){var e=new Lt(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){var n=new Tt(this._runtime,this._builtins);return n._source=this,Nt.call(e,(function(e){"object"!=typeof e&&(e={name:e+""}),null==e.alias&&(e.alias=e.name),n.import(e.name,e.alias,t)})),Promise.resolve().then((()=>{const e=new Set([this]);for(const t of e)for(const n of t._scope.values())if(n._definition===Pt){const t=n._inputs[0]._module,r=t._source||t;if(r===this)return void console.warn("circular module definition; ignoring");e.add(r)}this._copy(n,new Map)})),n},writable:!0,configurable:!0},import:{value:function(){var e=new Lt(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){var t=this._scope.get(e);if(!t)throw new Et(e+" is not defined");t._observer===qt&&(t._observer=!0,this._runtime._dirty.add(t));return await this._runtime._compute(),t._promise},writable:!0,configurable:!0},variable:{value:function(e){return new Lt(1,this,e)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const Ut="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;var Dt={},Ft={};function zt(e=new yt,t=Qt){var n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(var r in e)new Lt(2,n).define(r,[],e[r])}function It(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function Bt(e){++e._indegree}function Ht(e){--e._indegree}function Wt(e){return e._promise.catch(e._rejector)}function Vt(e){return new Promise((function(t){e._invalidate=t}))}function Yt(e,t){let n,r,i="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!i,a=St,s=St;return i&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,a()))),r.observe(i),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(a=e,s=t)))),n.then((()=>e))):Promise.reject()}}function Gt(e){e._invalidate(),e._invalidate=St,e._pending();var t=e._value,n=++e._version,r=null,i=e._promise=Promise.all(e._inputs.map(Wt)).then((function(i){if(e._version===n){for(var o=0,a=i.length;o<a;++o)switch(i[o]){case Dt:i[o]=r=Vt(e);break;case Ft:r||(r=Vt(e)),i[o]=Yt(r,e)}return e._definition.apply(t,i)}})).then((function(t){return function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t)?e._version!==n?void t.return():((r||Vt(e)).then((o=t,function(){o.return()})),function(e,t,n,r){function i(){var n=new Promise((function(e){e(r.next())})).then((function(r){return r.done?void 0:Promise.resolve(r.value).then((function(r){if(e._version===t)return Jt(e,r,n).then(i),e._fulfilled(r),r}))}));n.catch((function(r){e._version===t&&(Jt(e,void 0,n),e._rejected(r))}))}return new Promise((function(e){e(r.next())})).then((function(e){if(!e.done)return n.then(i),e.value}))}(e,n,i,t)):t;var o}));i.then((function(t){e._version===n&&(e._value=t,e._fulfilled(t))}),(function(t){e._version===n&&(e._value=void 0,e._rejected(t))}))}function Jt(e,t,n){var r=e._module._runtime;return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}function Kt(e,t){e._invalidate(),e._invalidate=St,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(St),e._value=void 0,e._rejected(t)}function Qt(e){return window[e]}Object.defineProperties(zt,{load:{value:function(e,t,n){if("function"==typeof t&&(n=t,t=null),"function"!=typeof n)throw new Error("invalid observer");null==t&&(t=new yt);const{modules:r,id:i}=e,o=new Map,a=new zt(t),s=l(i);function l(e){let t=o.get(e);return t||o.set(e,t=a.module()),t}for(const e of r){const t=l(e.id);let r=0;for(const i of e.variables)i.from?t.import(i.remote,i.name,l(i.from)):t===s?t.variable(n(i,r,e.variables)).define(i.name,i.inputs,i.value):t.define(i.name,i.inputs,i.value),++r}return a},writable:!0,configurable:!0}}),Object.defineProperties(zt.prototype,{_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){var e=this;return new Promise((function(t){Ut((function(){t(),e._disposed||e._computeNow()}))}))},writable:!0,configurable:!0},_computeNow:{value:function(){var e,t,n=[];(e=new Set(this._dirty)).forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==qt)return!0;var t=new Set(e._outputs);for(const e of t){if(e._observer!==qt)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n<t._reachable&&t._invalidate(),t._reachable=n}),this),(e=new Set(this._updates)).forEach((function(t){t._reachable?(t._indegree=0,t._outputs.forEach(e.add,e)):(t._indegree=NaN,e.delete(t))})),this._computing=null,this._updates.clear(),this._dirty.clear(),e.forEach((function(e){e._outputs.forEach(Bt)}));do{for(e.forEach((function(e){0===e._indegree&&n.push(e)}));t=n.pop();)Gt(t),t._outputs.forEach(r),e.delete(t);e.forEach((function(t){It(t)&&(Kt(t,new Et("circular definition")),t._outputs.forEach(Ht),e.delete(t))}))}while(e.size);function r(e){0==--e._indegree&&n.push(e)}},writable:!0,configurable:!0},dispose:{value:function(){this._computing=Promise.resolve(),this._disposed=!0,this._variables.forEach((e=>{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=St){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Tt(this);if(n=this._modules.get(e),n)return n;this._init=n=new Tt(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{le as Inspector,yt as Library,zt as Runtime,Et as RuntimeError}; | ||
// @observablehq/runtime v4.14.0 Copyright 2021 Observable, Inc. | ||
function e(e,t,n){n=n||{};var r=e.ownerDocument,i=r.defaultView.CustomEvent;"function"==typeof i?i=new i(t,{detail:n}):((i=r.createEvent("Event")).initEvent(t,!1,!1),i.detail=n),e.dispatchEvent(i)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const i=Symbol.prototype.toString;function o(e){return i.call(e)}const{getOwnPropertySymbols:a,prototype:{hasOwnProperty:s}}=Object,{toStringTag:l}=Symbol,u={},c=a;function d(e,t){return s.call(e,t)}function f(e){return e[l]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return u}}const h=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function m(e){try{let t=h.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),i=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:i&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:v,getOwnPropertyDescriptors:b}=Object,_=v({});function w(n,i,o,a){let s,l,u,c,d=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,l=y):(s="Map()",l=N):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,l=g):(s="Set()",l=N):d?(s=`${n.constructor.name}(${n.length})`,l=x):(c=m(n))?(s=`Immutable.${c.name}${"Record"===c.name?"":`(${n.size})`}`,d=c.arrayish,l=c.arrayish?C:c.setish?E:P):a?(s=f(n),l=j):(s=f(n),l=N);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const h=p.appendChild(document.createElement("a"));h.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",h.appendChild(document.createTextNode(`${s}${d?" [":" {"}`)),h.addEventListener("mouseup",(function(e){e.stopPropagation(),ae(p,$(n,null,o,a))})),l=l(n);for(let e=0;!(u=l.next()).done&&e<20;++e)p.appendChild(u.value);if(!u.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(u.value,p.lastChild.previousSibling);for(let e=0;!(u=l.next()).done&&e<19;++e)p.insertBefore(u.value,p.lastChild.previousSibling);u.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(d?"]":"}")),p}function*y(e){for(const[t,n]of e)yield L(t,n);yield*N(e)}function*g(e){for(const t of e)yield O(t);yield*N(e)}function*E(e){for(const t of e)yield O(t)}function*x(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield q(t,p(e,t),"observablehq--index"));for(const t in e)!n(t)&&d(e,t)&&(yield q(t,p(e,t),"observablehq--key"));for(const t of c(e))yield q(o(t),p(e,t),"observablehq--symbol")}function*C(e){let t=0;for(const n=e.size;t<n;++t)yield q(t,e.get(t),!0)}function*j(e){for(const t in b(e))yield q(t,p(e,t),"observablehq--key");for(const t of c(e))yield q(o(t),p(e,t),"observablehq--symbol");const t=v(e);t&&t!==_&&(yield S(t))}function*N(e){for(const t in e)d(e,t)&&(yield q(t,p(e,t),"observablehq--key"));for(const t of c(e))yield q(o(t),p(e,t),"observablehq--symbol");const t=v(e);t&&t!==_&&(yield S(t))}function*P(e){for(const[t,n]of e)yield q(t,n,"observablehq--key")}function S(e){const t=document.createElement("div"),n=t.appendChild(document.createElement("span"));return t.className="observablehq--field",n.className="observablehq--prototype-key",n.textContent=" <prototype>",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function q(e,t,n){const r=document.createElement("div"),i=r.appendChild(document.createElement("span"));return r.className="observablehq--field",i.className=n,i.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function L(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function O(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function M(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function $(e,n,i,o){let a,s,l,u,c=t(e);if(e instanceof Map?e instanceof e.constructor?(a=`Map(${e.size})`,s=A):(a="Map()",s=D):e instanceof Set?e instanceof e.constructor?(a=`Set(${e.size})`,s=k):(a="Set()",s=D):c?(a=`${e.constructor.name}(${e.length})`,s=U):(u=m(e))?(a=`Immutable.${u.name}${"Record"===u.name?"":`(${e.size})`}`,c=u.arrayish,s=u.arrayish?R:u.setish?T:F):(a=f(e),s=D),n){const t=document.createElement("span");return t.className="observablehq--shallow",i&&t.appendChild(r(i)),t.appendChild(document.createTextNode(a)),t.addEventListener("mouseup",(function(n){M(t)||(n.stopPropagation(),ae(t,$(e)))})),t}const d=document.createElement("span");d.className="observablehq--collapsed",i&&d.appendChild(r(i));const p=d.appendChild(document.createElement("a"));p.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",p.appendChild(document.createTextNode(`${a}${c?" [":" {"}`)),d.addEventListener("mouseup",(function(t){M(d)||(t.stopPropagation(),ae(d,w(e,0,i,o)))}),!0),s=s(e);for(let e=0;!(l=s.next()).done&&e<20;++e)e>0&&d.appendChild(document.createTextNode(", ")),d.appendChild(l.value);return l.done||d.appendChild(document.createTextNode(", …")),d.appendChild(document.createTextNode(c?"]":"}")),d}function*A(e){for(const[t,n]of e)yield B(t,n);yield*D(e)}function*k(e){for(const t of e)yield oe(t,!0);yield*D(e)}function*T(e){for(const t of e)yield oe(t,!0)}function*R(e){let t=-1,n=0;for(const r=e.size;n<r;++n)n>t+1&&(yield z(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield z(n-t-1))}function*U(e){let t=-1,r=0;for(const n=e.length;r<n;++r)r in e&&(r>t+1&&(yield z(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield z(r-t-1));for(const t in e)!n(t)&&d(e,t)&&(yield I(t,p(e,t),"observablehq--key"));for(const t of c(e))yield I(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const t in e)d(e,t)&&(yield I(t,p(e,t),"observablehq--key"));for(const t of c(e))yield I(o(t),p(e,t),"observablehq--symbol")}function*F(e){for(const[t,n]of e)yield I(t,n,"observablehq--key")}function z(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function I(e,t,n){const r=document.createDocumentFragment(),i=r.appendChild(document.createElement("span"));return i.className=n,i.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function B(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function H(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function W(e){return e<0?"-"+H(-e,6):e>9999?"+"+H(e,6):H(e,4)}var V=Error.prototype.toString;var Y=RegExp.prototype.toString;function G(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,J)}function J(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function K(e,t){for(var n=0;t.exec(e);)++n;return n}var Q=Function.prototype.toString,X={prefix:"async ƒ"},Z={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var i=document.createElement("span");i.className="observablehq--function",n&&i.appendChild(r(n));var o=i.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,i.appendChild(document.createTextNode(t)),i}const{prototype:{toString:ie}}=Object;function oe(e,t,n,i,a){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,i=Q.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Z;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(i)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(i))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,i);case"string":return function(e,t,n,i){if(!1===t){if(K(e,/["\n]/g)<=K(e,/`|\${/g)){const t=document.createElement("span");i&&t.appendChild(r(i));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");i&&n.appendChild(r(i));const a=n.appendChild(document.createElement("span"));a.className="observablehq--string",a.textContent="`"+G(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),l=o.length-20;return s.textContent=`Show ${l} truncated line${l>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ae(n,oe(e,t,!0,i))})),n}const a=document.createElement("span");i&&a.appendChild(r(i));const s=a.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+G(e)+"`",a}const o=document.createElement("span");i&&o.appendChild(r(i));const a=o.appendChild(document.createElement("span"));return a.className="observablehq--string",a.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,i);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",l=e,e=isNaN(l)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(l)?W(l.getUTCFullYear())+"-"+H(l.getUTCMonth()+1,2)+"-"+H(l.getUTCDate(),2):W(l.getFullYear())+"-"+H(l.getMonth()+1,2)+"-"+H(l.getDate(),2)+"T"+H(l.getHours(),2)+":"+H(l.getMinutes(),2)+(l.getMilliseconds()?":"+H(l.getSeconds(),2)+"."+H(l.getMilliseconds(),3):l.getSeconds()?":"+H(l.getSeconds(),2):"");break}if(e===u){s="forbidden",e="[forbidden]";break}switch(ie.call(e)){case"[object RegExp]":s="regexp",e=function(e){return Y.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?w:$)(e,t,i,a)}}var l;const c=document.createElement("span");i&&c.appendChild(r(i));const d=c.appendChild(document.createElement("span"));return d.className=`observablehq--${s}`,d.textContent=e,c}function ae(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class le{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!(t instanceof Element||t instanceof Text)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:i}=this;for(i.classList.remove("observablehq--running"),i.classList.add("observablehq--error");i.lastChild;)i.removeChild(i.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),i.appendChild(o),e(i,"error",{error:t})}}le.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new le(e.appendChild(document.createElement("div")))}};const ue=new Map,ce=[],de=ce.map,fe=ce.some,pe=ce.hasOwnProperty,he="https://cdn.jsdelivr.net/npm/",me=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,ve=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,be=/\.[^/]*$/,_e=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function we(e){const t=me.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function ye(e){const t=`${he}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=ue.get(t);return n||ue.set(t,n=fetch(t).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!ue.has(e.url)&&ue.set(e.url,n),e.json()}))),n}RequireError.prototype.name=RequireError.name;var ge=Ee((async function(e,t){if(e.startsWith(he)&&(e=e.substring(he.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=we(e);if(!n)return`${he}${e}`;if(!n.version&&null!=t&&t.startsWith(he)){const e=await ye(we(t.substring(he.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!be.test(n.path)&&(n.path+=".js"),n.path&&n.version&&ve.test(n.version))return`${he}${n.name}@${n.version}/${n.path}`;const r=await ye(n);return`${he}${r.name}@${r.version}/${n.path||function(e){for(const t of _e){const n=e[t];if("string"==typeof n)return be.test(n)?n:`${n}.js`}}(r)||"index.js"}`}));function Ee(e){const t=new Map,n=i(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(ce.pop()(i(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=Ne,document.head.appendChild(r)}))),n}function i(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(de.call(arguments,n)).then(xe):n(e)}return o.alias=function(t){return Ee(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function xe(e){const t={};for(const n of e)for(const e in n)pe.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:Ce(n,e)}):t[e]=n[e]);return t}function Ce(e,t){return()=>e[t]}function je(e){return"exports"===(e+="")||"module"===e}function Ne(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),ce.push(fe.call(t,je)?e=>{const r={},i={exports:r};return Promise.all(de.call(t,(t=>"exports"===(t+="")?r:"module"===t?i:e(t)))).then((e=>(n.apply(null,e),i.exports)))}:e=>Promise.all(de.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}function Pe(e,t,n){return{resolve:(r=n)=>`https://cdn.jsdelivr.net/npm/${e}@${t}/${r}`}}Ne.amd={};const Se=Pe("d3","7.0.1","dist/d3.min.js"),qe=Pe("d3-dsv","3.0.1","dist/d3-dsv.min.js"),Le=Pe("@observablehq/inputs","0.9.0","dist/inputs.min.js"),Oe=Pe("@observablehq/plot","0.2.0","dist/plot.umd.min.js"),Me=Pe("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),$e=Pe("@observablehq/highlight.js","2.0.0","highlight.min.js"),Ae=Pe("@observablehq/katex","0.11.1","dist/katex.min.js"),ke=Pe("lodash","4.17.21","lodash.min.js"),Te=Pe("htl","0.3.0","dist/htl.min.js"),Re=Pe("jszip","3.7.1","dist/jszip.min.js"),Ue=Pe("marked","0.3.12","marked.min.js"),De=Pe("sql.js","1.6.1","dist/sql-wasm.js"),Fe=Pe("vega","5.20.2","build/vega.min.js"),ze=Pe("vega-lite","5.1.0","build/vega-lite.min.js"),Ie=Pe("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Be=Pe("apache-arrow","4.0.1","Arrow.es2015.min.js"),He=Pe("topojson-client","3.1.0","dist/topojson-client.min.js");async function We(e){return(await e(De.resolve()))({locateFile:e=>De.resolve(`dist/${e}`)})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([We(ge),Promise.resolve(e).then(Ve)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:i,values:o}=r,a=o.map((e=>Object.fromEntries(e.map(((e,t)=>[i[t],e])))));return a.columns=i,a}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return Ye("pre",{className:"observablehq--inspect"},[Ge((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return Ye("table",{value:t},[Ye("thead",[Ye("tr",n.map((e=>Ye("th",[Ge(e)]))))]),Ye("tbody",t.map((e=>Ye("tr",n.map((t=>Ye("td",[Ge(e[t])])))))))])}}function Ve(e){return"string"==typeof e?fetch(e).then(Ve):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(Ve):e instanceof ArrayBuffer?new Uint8Array(e):e}function Ye(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function Ge(e){return document.createTextNode(e)}async function Je(e){const t=await fetch(await e.url());if(!t.ok)throw new Error(`Unable to load file: ${e.name}`);return t}async function Ke(e,t,{array:n=!1,typed:r=!1}={}){const[i,o]=await Promise.all([e.text(),ge(qe.resolve())]);return("\t"===t?n?o.tsvParseRows:o.tsvParse:n?o.csvParseRows:o.csvParse)(i,r&&o.autoType)}class Qe{constructor(e){Object.defineProperty(this,"name",{value:e,enumerable:!0})}async blob(){return(await Je(this)).blob()}async arrayBuffer(){return(await Je(this)).arrayBuffer()}async text(){return(await Je(this)).text()}async json(){return(await Je(this)).json()}async stream(){return(await Je(this)).body}async csv(e){return Ke(this,",",e)}async tsv(e){return Ke(this,"\t",e)}async image(){const e=await this.url();return new Promise(((t,n)=>{const r=new Image;new URL(e,document.baseURI).origin!==new URL(location).origin&&(r.crossOrigin="anonymous"),r.onload=()=>t(r),r.onerror=()=>n(new Error(`Unable to load file: ${this.name}`)),r.src=e}))}async arrow(){const[e,t]=await Promise.all([ge(Be.resolve()),Je(this)]);return e.Table.from(t)}async sqlite(){return SQLiteDatabaseClient.open(Je(this))}async zip(){const[e,t]=await Promise.all([ge(Re.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}}class FileAttachment extends Qe{constructor(e,t){super(t),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function Xe(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends Qe{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Ze={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var et=0;function tt(e){this.id=e,this.href=new URL(`#${e}`,location)+""}tt.prototype.toString=function(){return"url("+this.href+")"};var nt={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var i=r.getContext("2d");return i.scale(n,n),i},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),i=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),i.textContent=n,i.disabled=!1}return i.textContent=n,r.download=t,r.onclick=async t=>{if(i.disabled=!0,r.href)return o();i.textContent="Saving…";try{const t=await("function"==typeof e?e():e);i.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){i.textContent=n}if(t.eventPhase)return o();i.disabled=!1},r},element:function(e,t){var n,r=e+="",i=r.indexOf(":");i>=0&&"xmlns"!==(r=e.slice(0,i))&&(e=e.slice(i+1));var o=Ze.hasOwnProperty(r)?document.createElementNS(Ze[r],e):document.createElement(e);if(t)for(var a in t)i=(r=a).indexOf(":"),n=t[a],i>=0&&"xmlns"!==(r=a.slice(0,i))&&(a=a.slice(i+1)),Ze.hasOwnProperty(r)?o.setAttributeNS(Ze[r],a,n):o.setAttribute(a,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new tt("O-"+(null==e?"":e+"-")+ ++et)}};var rt={buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}};function it(){return this}function ot(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:it,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function at(e){let t,n,r=!1;const i=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=i&&"function"!=typeof i)throw new Error("function"==typeof i.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:it,throw:()=>({done:!0}),return:()=>(null!=i&&i(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function st(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var lt={disposable:ot,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return at((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=st(e);function i(){t(st(e))}return e.addEventListener(n,i),void 0!==r&&t(r),function(){e.removeEventListener(n,i)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:at,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:it,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n));++r<i;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return ot(n,(()=>{n.terminate(),URL.revokeObjectURL(t)}))}};function ut(e,t){return function(n){var r,i,o,a,s,l,u,c,d=n[0],f=[],p=null,h=-1;for(s=1,l=arguments.length;s<l;++s){if((r=arguments[s])instanceof Node)f[++h]=r,d+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(u=0,c=r.length;u<c;++u)(i=r[u])instanceof Node?(null===p&&(f[++h]=p=document.createDocumentFragment(),d+="\x3c!--o:"+h+"--\x3e"),p.appendChild(i)):(p=null,d+=i);p=null}else d+=r;d+=n[s]}if(p=e(d),++h>0){for(o=new Array(h),a=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)i=a.currentNode,/^o:/.test(i.nodeValue)&&(o[+i.nodeValue.slice(2)]=i);for(s=0;s<h;++s)(i=o[s])&&i.parentNode.replaceChild(f[s],i)}return 1===p.childNodes.length?p.removeChild(p.firstChild):11===p.nodeType?((i=t()).appendChild(p),i):p}}var ct=ut((function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)}),(function(){return document.createElement("span")}));function dt(e){let t;Object.defineProperties(this,{generator:{value:at((e=>{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*ft(){for(;;)yield Date.now()}var pt=new Map;function ht(e,t){var n;return(n=pt.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){pt.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return pt.set(t,n),n}(n,e).then((()=>t))}var mt={delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return ht(Math.ceil((Date.now()+1)/e)*e,t)},when:ht};function vt(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}function bt(e){return null==e?ge:Ee(e)}var _t=ut((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")})),wt=String.raw;function yt(){return at((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}var gt=Object.assign((function(e){const t=bt(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>Xe,Arrow:()=>t(Be.resolve()),Inputs:()=>t(Le.resolve()),Mutable:()=>dt,Plot:()=>t(Oe.resolve()),SQLite:()=>We(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,_:()=>t(ke.resolve()),d3:()=>t(Se.resolve()),dot:()=>t(Me.resolve()),htl:()=>t(Te.resolve()),html:()=>ct,md:()=>function(e){return e(Ue.resolve()).then((function(t){return ut((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var i=r.querySelectorAll("pre code[class]");return i.length>0&&e($e.resolve()).then((function(t){i.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e($e.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e($e.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),now:ft,require:()=>t,resolve:()=>vt,svg:()=>_t,tex:()=>function(e){return Promise.all([e(Ae.resolve()),(t=Ae.resolve("dist/katex.min.css"),new Promise((function(e,n){var r=document.createElement("link");r.rel="stylesheet",r.href=t,r.onerror=n,r.onload=e,document.head.appendChild(r)})))]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(wt.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}));var t}(t),topojson:()=>t(He.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Fe,ze,Ie].map((t=>e(t.resolve()))));return r.register(t,n)}(t),width:yt,DOM:nt,Files:rt,Generators:lt,Promises:mt},Object.fromEntries(Object.entries(n).map(Et))))}),{resolve:ge.resolve});function Et([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}function xt(e,t){this.message=e+"",this.input=t}xt.prototype=Object.create(Error.prototype),xt.prototype.name="RuntimeError",xt.prototype.constructor=xt;var Ct=Array.prototype,jt=Ct.map,Nt=Ct.forEach;function Pt(e){return function(){return e}}function St(e){return e}function qt(){}var Lt={};function Ot(e,t,n){var r;n||(n=Lt),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:At,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:qt,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Lt,writable:!0},_rejector:{value:(r=this,function(e){if(e===At)throw new xt(r._name+" is not defined",r._name);if(e instanceof Error&&e.message)throw new xt(e.message,r._name);throw new xt(r._name+" could not be resolved",r._name)})},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Mt(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function $t(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function At(){throw At}function kt(e){return function(){throw new xt(e+" is defined more than once")}}function Tt(e,t,n){var r=this._module._scope,i=this._module._runtime;if(this._inputs.forEach($t,this),t.forEach(Mt,this),this._inputs=t,this._definition=n,this._value=void 0,n===qt?i._variables.delete(this):i._variables.add(this),e!==this._name||r.get(e)!==this){var o,a;if(this._name)if(this._outputs.size)r.delete(this._name),(a=this._module._resolve(this._name))._outputs=this._outputs,this._outputs=new Set,a._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=a}),this),a._outputs.forEach(i._updates.add,i._updates),i._dirty.add(a).add(this),r.set(this._name,a);else if((a=r.get(this._name))===this)r.delete(this._name);else{if(3!==a._type)throw new Error;a._duplicates.delete(this),this._duplicate=void 0,1===a._duplicates.size&&(a=a._duplicates.keys().next().value,o=r.get(this._name),a._outputs=o._outputs,o._outputs=new Set,a._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=a})),a._definition=a._duplicate,a._duplicate=void 0,i._dirty.add(o).add(a),i._updates.add(a),r.set(this._name,a))}if(this._outputs.size)throw new Error;e&&((a=r.get(e))?3===a._type?(this._definition=kt(e),this._duplicate=n,a._duplicates.add(this)):2===a._type?(this._outputs=a._outputs,a._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(a)]=this}),this),i._dirty.add(a).add(this),r.set(e,this)):(a._duplicate=a._definition,this._duplicate=n,(o=new Ot(3,this._module))._name=e,o._definition=this._definition=a._definition=kt(e),o._outputs=a._outputs,a._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(a)]=o})),o._duplicates=new Set([this,a]),i._dirty.add(a).add(o),i._updates.add(a).add(o),r.set(e,o)):r.set(e,this)),this._name=e}return i._updates.add(this),i._compute(),this}function Rt(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["invalidation",Ft],["visibility",zt],...t])},_source:{value:null,writable:!0}})}function Ut(e){return e._name}Object.defineProperties(Ot.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return Tt.call(this,null==e?null:e+"",null==t?[]:jt.call(t,this._module._resolve,this._module),"function"==typeof n?n:Pt(n))},writable:!0,configurable:!0},delete:{value:function(){return Tt.call(this,null,[],qt)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return Tt.call(this,t+"",[n._resolve(e+"")],St)},writable:!0,configurable:!0}}),Object.defineProperties(Rt.prototype,{_copy:{value:function(e,t){e._source=this,t.set(this,e);for(const[o,a]of this._scope){var n=e._scope.get(o);if(!n||1!==n._type)if(a._definition===St){var r=a._inputs[0],i=r._module;e.import(r._name,o,t.get(i)||(i._source?i._copy(new Rt(e._runtime,e._builtins),t):i))}else e.define(o,a._inputs.map(Ut),a._definition)}return e},writable:!0,configurable:!0},_resolve:{value:function(e){var t,n=this._scope.get(e);if(!n)if(n=new Ot(2,this),this._builtins.has(e))n.define(e,Pt(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,(r=t,function(){throw r}))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Pt(t))}var r;return n},writable:!0,configurable:!0},redefine:{value:function(e){var t=this._scope.get(e);if(!t)throw new xt(e+" is not defined");if(3===t._type)throw new xt(e+" is defined more than once");return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){var e=new Ot(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){var n=new Rt(this._runtime,this._builtins);return n._source=this,Nt.call(e,(function(e){"object"!=typeof e&&(e={name:e+""}),null==e.alias&&(e.alias=e.name),n.import(e.name,e.alias,t)})),Promise.resolve().then((()=>{const e=new Set([this]);for(const t of e)for(const n of t._scope.values())if(n._definition===St){const t=n._inputs[0]._module,r=t._source||t;if(r===this)return void console.warn("circular module definition; ignoring");e.add(r)}this._copy(n,new Map)})),n},writable:!0,configurable:!0},import:{value:function(){var e=new Ot(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){var t=this._scope.get(e);if(!t)throw new xt(e+" is not defined");t._observer===Lt&&(t._observer=!0,this._runtime._dirty.add(t));return await this._runtime._compute(),t._promise},writable:!0,configurable:!0},variable:{value:function(e){return new Ot(1,this,e)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const Dt="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;var Ft={},zt={};function It(e=new gt,t=Xt){var n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(var r in e)new Ot(2,n).define(r,[],e[r])}function Bt(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function Ht(e){++e._indegree}function Wt(e){--e._indegree}function Vt(e){return e._promise.catch(e._rejector)}function Yt(e){return new Promise((function(t){e._invalidate=t}))}function Gt(e,t){let n,r,i="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!i,a=qt,s=qt;return i&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,a()))),r.observe(i),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(a=e,s=t)))),n.then((()=>e))):Promise.reject()}}function Jt(e){e._invalidate(),e._invalidate=qt,e._pending();var t=e._value,n=++e._version,r=null,i=e._promise=Promise.all(e._inputs.map(Vt)).then((function(i){if(e._version===n){for(var o=0,a=i.length;o<a;++o)switch(i[o]){case Ft:i[o]=r=Yt(e);break;case zt:r||(r=Yt(e)),i[o]=Gt(r,e)}return e._definition.apply(t,i)}})).then((function(t){return function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t)?e._version!==n?void t.return():((r||Yt(e)).then((o=t,function(){o.return()})),function(e,t,n,r){function i(){var n=new Promise((function(e){e(r.next())})).then((function(r){return r.done?void 0:Promise.resolve(r.value).then((function(r){if(e._version===t)return Kt(e,r,n).then(i),e._fulfilled(r),r}))}));n.catch((function(r){e._version===t&&(Kt(e,void 0,n),e._rejected(r))}))}return new Promise((function(e){e(r.next())})).then((function(e){if(!e.done)return n.then(i),e.value}))}(e,n,i,t)):t;var o}));i.then((function(t){e._version===n&&(e._value=t,e._fulfilled(t))}),(function(t){e._version===n&&(e._value=void 0,e._rejected(t))}))}function Kt(e,t,n){var r=e._module._runtime;return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}function Qt(e,t){e._invalidate(),e._invalidate=qt,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(qt),e._value=void 0,e._rejected(t)}function Xt(e){return window[e]}Object.defineProperties(It,{load:{value:function(e,t,n){if("function"==typeof t&&(n=t,t=null),"function"!=typeof n)throw new Error("invalid observer");null==t&&(t=new gt);const{modules:r,id:i}=e,o=new Map,a=new It(t),s=l(i);function l(e){let t=o.get(e);return t||o.set(e,t=a.module()),t}for(const e of r){const t=l(e.id);let r=0;for(const i of e.variables)i.from?t.import(i.remote,i.name,l(i.from)):t===s?t.variable(n(i,r,e.variables)).define(i.name,i.inputs,i.value):t.define(i.name,i.inputs,i.value),++r}return a},writable:!0,configurable:!0}}),Object.defineProperties(It.prototype,{_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){var e=this;return new Promise((function(t){Dt((function(){t(),e._disposed||e._computeNow()}))}))},writable:!0,configurable:!0},_computeNow:{value:function(){var e,t,n=[];(e=new Set(this._dirty)).forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Lt)return!0;var t=new Set(e._outputs);for(const e of t){if(e._observer!==Lt)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n<t._reachable&&t._invalidate(),t._reachable=n}),this),(e=new Set(this._updates)).forEach((function(t){t._reachable?(t._indegree=0,t._outputs.forEach(e.add,e)):(t._indegree=NaN,e.delete(t))})),this._computing=null,this._updates.clear(),this._dirty.clear(),e.forEach((function(e){e._outputs.forEach(Ht)}));do{for(e.forEach((function(e){0===e._indegree&&n.push(e)}));t=n.pop();)Jt(t),t._outputs.forEach(r),e.delete(t);e.forEach((function(t){Bt(t)&&(Qt(t,new xt("circular definition")),t._outputs.forEach(Wt),e.delete(t))}))}while(e.size);function r(e){0==--e._indegree&&n.push(e)}},writable:!0,configurable:!0},dispose:{value:function(){this._computing=Promise.resolve(),this._disposed=!0,this._variables.forEach((e=>{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=qt){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Rt(this);if(n=this._modules.get(e),n)return n;this._init=n=new Rt(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{le as Inspector,gt as Library,It as Runtime,xt as RuntimeError}; |
@@ -1,2 +0,2 @@ | ||
// @observablehq/runtime v4.13.0 Copyright 2021 Observable, Inc. | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).observablehq=e.observablehq||{})}(this,(function(e){"use strict";function t(e,t,n){n=n||{};var r=e.ownerDocument,i=r.defaultView.CustomEvent;"function"==typeof i?i=new i(t,{detail:n}):((i=r.createEvent("Event")).initEvent(t,!1,!1),i.detail=n),e.dispatchEvent(i)}function n(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function r(e){return e===(0|e)+""}function i(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const o=Symbol.prototype.toString;function a(e){return o.call(e)}const{getOwnPropertySymbols:s,prototype:{hasOwnProperty:l}}=Object,{toStringTag:u}=Symbol,c={},d=s;function f(e,t){return l.call(e,t)}function p(e){return e[u]||e.constructor&&e.constructor.name||"Object"}function h(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return c}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function v(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),i=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:i&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:_}=Object,w=b({});function y(e,r,o,a){let s,l,u,c,d=n(e);e instanceof Map?e instanceof e.constructor?(s=`Map(${e.size})`,l=g):(s="Map()",l=P):e instanceof Set?e instanceof e.constructor?(s=`Set(${e.size})`,l=E):(s="Set()",l=P):d?(s=`${e.constructor.name}(${e.length})`,l=C):(c=v(e))?(s=`Immutable.${c.name}${"Record"===c.name?"":`(${e.size})`}`,d=c.arrayish,l=c.arrayish?N:c.setish?x:q):a?(s=p(e),l=j):(s=p(e),l=P);const f=document.createElement("span");f.className="observablehq--expanded",o&&f.appendChild(i(o));const h=f.appendChild(document.createElement("a"));h.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",h.appendChild(document.createTextNode(`${s}${d?" [":" {"}`)),h.addEventListener("mouseup",(function(t){t.stopPropagation(),se(f,A(e,null,o,a))})),l=l(e);for(let e=0;!(u=l.next()).done&&e<20;++e)f.appendChild(u.value);if(!u.done){const e=f.appendChild(document.createElement("a"));e.className="observablehq--field",e.style.display="block",e.appendChild(document.createTextNode(" … more")),e.addEventListener("mouseup",(function(e){e.stopPropagation(),f.insertBefore(u.value,f.lastChild.previousSibling);for(let e=0;!(u=l.next()).done&&e<19;++e)f.insertBefore(u.value,f.lastChild.previousSibling);u.done&&f.removeChild(f.lastChild.previousSibling),t(f,"load")}))}return f.appendChild(document.createTextNode(d?"]":"}")),f}function*g(e){for(const[t,n]of e)yield O(t,n);yield*P(e)}function*E(e){for(const t of e)yield M(t);yield*P(e)}function*x(e){for(const t of e)yield M(t)}function*C(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield L(t,h(e,t),"observablehq--index"));for(const t in e)!r(t)&&f(e,t)&&(yield L(t,h(e,t),"observablehq--key"));for(const t of d(e))yield L(a(t),h(e,t),"observablehq--symbol")}function*N(e){let t=0;for(const n=e.size;t<n;++t)yield L(t,e.get(t),!0)}function*j(e){for(const t in _(e))yield L(t,h(e,t),"observablehq--key");for(const t of d(e))yield L(a(t),h(e,t),"observablehq--symbol");const t=b(e);t&&t!==w&&(yield S(t))}function*P(e){for(const t in e)f(e,t)&&(yield L(t,h(e,t),"observablehq--key"));for(const t of d(e))yield L(a(t),h(e,t),"observablehq--symbol");const t=b(e);t&&t!==w&&(yield S(t))}function*q(e){for(const[t,n]of e)yield L(t,n,"observablehq--key")}function S(e){const t=document.createElement("div"),n=t.appendChild(document.createElement("span"));return t.className="observablehq--field",n.className="observablehq--prototype-key",n.textContent=" <prototype>",t.appendChild(document.createTextNode(": ")),t.appendChild(ae(e,void 0,void 0,void 0,!0)),t}function L(e,t,n){const r=document.createElement("div"),i=r.appendChild(document.createElement("span"));return r.className="observablehq--field",i.className=n,i.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(ae(t)),r}function O(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(ae(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(ae(t)),n}function M(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(ae(e)),t}function $(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function A(e,t,r,o){let a,s,l,u,c=n(e);if(e instanceof Map?e instanceof e.constructor?(a=`Map(${e.size})`,s=T):(a="Map()",s=F):e instanceof Set?e instanceof e.constructor?(a=`Set(${e.size})`,s=k):(a="Set()",s=F):c?(a=`${e.constructor.name}(${e.length})`,s=D):(u=v(e))?(a=`Immutable.${u.name}${"Record"===u.name?"":`(${e.size})`}`,c=u.arrayish,s=u.arrayish?U:u.setish?R:I):(a=p(e),s=F),t){const t=document.createElement("span");return t.className="observablehq--shallow",r&&t.appendChild(i(r)),t.appendChild(document.createTextNode(a)),t.addEventListener("mouseup",(function(n){$(t)||(n.stopPropagation(),se(t,A(e)))})),t}const d=document.createElement("span");d.className="observablehq--collapsed",r&&d.appendChild(i(r));const f=d.appendChild(document.createElement("a"));f.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",f.appendChild(document.createTextNode(`${a}${c?" [":" {"}`)),d.addEventListener("mouseup",(function(t){$(d)||(t.stopPropagation(),se(d,y(e,0,r,o)))}),!0),s=s(e);for(let e=0;!(l=s.next()).done&&e<20;++e)e>0&&d.appendChild(document.createTextNode(", ")),d.appendChild(l.value);return l.done||d.appendChild(document.createTextNode(", …")),d.appendChild(document.createTextNode(c?"]":"}")),d}function*T(e){for(const[t,n]of e)yield H(t,n);yield*F(e)}function*k(e){for(const t of e)yield ae(t,!0);yield*F(e)}function*R(e){for(const t of e)yield ae(t,!0)}function*U(e){let t=-1,n=0;for(const r=e.size;n<r;++n)n>t+1&&(yield z(n-t-1)),yield ae(e.get(n),!0),t=n;n>t+1&&(yield z(n-t-1))}function*D(e){let t=-1,n=0;for(const r=e.length;n<r;++n)n in e&&(n>t+1&&(yield z(n-t-1)),yield ae(h(e,n),!0),t=n);n>t+1&&(yield z(n-t-1));for(const t in e)!r(t)&&f(e,t)&&(yield B(t,h(e,t),"observablehq--key"));for(const t of d(e))yield B(a(t),h(e,t),"observablehq--symbol")}function*F(e){for(const t in e)f(e,t)&&(yield B(t,h(e,t),"observablehq--key"));for(const t of d(e))yield B(a(t),h(e,t),"observablehq--symbol")}function*I(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function z(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),i=r.appendChild(document.createElement("span"));return i.className=n,i.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(ae(t,!0)),r}function H(e,t){const n=document.createDocumentFragment();return n.appendChild(ae(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(ae(t,!0)),n}function W(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function V(e){return e<0?"-"+W(-e,6):e>9999?"+"+W(e,6):W(e,4)}var Y=Error.prototype.toString;var G=RegExp.prototype.toString;function J(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,K)}function K(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function Q(e,t){for(var n=0;t.exec(e);)++n;return n}var X=Function.prototype.toString,Z={prefix:"async ƒ"},ee={prefix:"async ƒ*"},te={prefix:"class"},ne={prefix:"ƒ"},re={prefix:"ƒ*"};function ie(e,t,n){var r=document.createElement("span");r.className="observablehq--function",n&&r.appendChild(i(n));var o=r.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,r.appendChild(document.createTextNode(t)),r}const{prototype:{toString:oe}}=Object;function ae(e,t,n,r,o){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=a(e);break;case"function":return function(e,t){var n,r,i=X.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=Z;break;case"AsyncGeneratorFunction":n=ee;break;case"GeneratorFunction":n=re;break;default:n=/^class\b/.test(i)?te:ne}return n===te?ie(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(i))?ie(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i))?ie(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):ie(n,"(…)",t)}(e,r);case"string":return function(e,t,n,r){if(!1===t){if(Q(e,/["\n]/g)<=Q(e,/`|\${/g)){const t=document.createElement("span");r&&t.appendChild(i(r));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");r&&n.appendChild(i(r));const a=n.appendChild(document.createElement("span"));a.className="observablehq--string",a.textContent="`"+J(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),l=o.length-20;return s.textContent=`Show ${l} truncated line${l>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(i){i.stopPropagation(),se(n,ae(e,t,!0,r))})),n}const a=document.createElement("span");r&&a.appendChild(i(r));const s=a.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+J(e)+"`",a}const o=document.createElement("span");r&&o.appendChild(i(r));const a=o.appendChild(document.createElement("span"));return a.className="observablehq--string",a.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,r);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",l=e,e=isNaN(l)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(l)?V(l.getUTCFullYear())+"-"+W(l.getUTCMonth()+1,2)+"-"+W(l.getUTCDate(),2):V(l.getFullYear())+"-"+W(l.getMonth()+1,2)+"-"+W(l.getDate(),2)+"T"+W(l.getHours(),2)+":"+W(l.getMinutes(),2)+(l.getMilliseconds()?":"+W(l.getSeconds(),2)+"."+W(l.getMilliseconds(),3):l.getSeconds()?":"+W(l.getSeconds(),2):"");break}if(e===c){s="forbidden",e="[forbidden]";break}switch(oe.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||Y.call(e)}(e);break;default:return(n?y:A)(e,t,r,o)}}var l;const u=document.createElement("span");r&&u.appendChild(i(r));const d=u.appendChild(document.createElement("span"));return d.className=`observablehq--${s}`,d.textContent=e,u}function se(e,n){e.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),e.parentNode.replaceChild(n,e),t(n,"load")}const le=/\s+\(\d+:\d+\)$/m;class ue{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(e,n){const{_node:r}=this;if((!(e instanceof Element||e instanceof Text)||e.parentNode&&e.parentNode!==r)&&(e=ae(e,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==e)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(e,r.firstChild)}else r.appendChild(e);t(r,"update")}rejected(e,n){const{_node:r}=this;for(r.classList.remove("observablehq--running"),r.classList.add("observablehq--error");r.lastChild;)r.removeChild(r.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(i(n)),o.appendChild(document.createTextNode((e+"").replace(le,""))),r.appendChild(o),t(r,"error",{error:e})}}ue.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new ue(e.appendChild(document.createElement("div")))}};const ce=new Map,de=[],fe=de.map,pe=de.some,he=de.hasOwnProperty,me="https://cdn.jsdelivr.net/npm/",ve=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,be=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,_e=/\.[^/]*$/,we=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function ye(e){const t=ve.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function ge(e){const t=`${me}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=ce.get(t);return n||ce.set(t,n=fetch(t).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!ce.has(e.url)&&ce.set(e.url,n),e.json()}))),n}RequireError.prototype.name=RequireError.name;var Ee=xe((async function(e,t){if(e.startsWith(me)&&(e=e.substring(me.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=ye(e);if(!n)return`${me}${e}`;if(!n.version&&null!=t&&t.startsWith(me)){const e=await ge(ye(t.substring(me.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!_e.test(n.path)&&(n.path+=".js"),n.path&&n.version&&be.test(n.version))return`${me}${n.name}@${n.version}/${n.path}`;const r=await ge(n);return`${me}${r.name}@${r.version}/${n.path||function(e){for(const t of we){const n=e[t];if("string"==typeof n)return _e.test(n)?n:`${n}.js`}}(r)||"index.js"}`}));function xe(e){const t=new Map,n=i(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(de.pop()(i(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=Pe,document.head.appendChild(r)}))),n}function i(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(fe.call(arguments,n)).then(Ce):n(e)}return o.alias=function(t){return xe(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function Ce(e){const t={};for(const n of e)for(const e in n)he.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:Ne(n,e)}):t[e]=n[e]);return t}function Ne(e,t){return()=>e[t]}function je(e){return"exports"===(e+="")||"module"===e}function Pe(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),de.push(pe.call(t,je)?e=>{const r={},i={exports:r};return Promise.all(fe.call(t,(t=>"exports"===(t+="")?r:"module"===t?i:e(t)))).then((e=>(n.apply(null,e),i.exports)))}:e=>Promise.all(fe.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}function qe(e,t,n){return{resolve:(r=n)=>`https://cdn.jsdelivr.net/npm/${e}@${t}/${r}`}}Pe.amd={};const Se=qe("d3","6.7.0","dist/d3.min.js"),Le=qe("d3-dsv","2.0.0","dist/d3-dsv.min.js"),Oe=qe("@observablehq/inputs","0.8.0","dist/inputs.umd.min.js"),Me=qe("@observablehq/plot","0.1.0","dist/plot.umd.min.js"),$e=qe("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),Ae=qe("@observablehq/highlight.js","2.0.0","highlight.min.js"),Te=qe("@observablehq/katex","0.11.1","dist/katex.min.js"),ke=qe("lodash","4.17.21","lodash.min.js"),Re=qe("htl","0.2.5","dist/htl.min.js"),Ue=qe("marked","0.3.12","marked.min.js"),De=qe("sql.js","1.5.0","dist/sql-wasm.js"),Fe=qe("vega","5.20.2","build/vega.min.js"),Ie=qe("vega-lite","5.1.0","build/vega-lite.min.js"),ze=qe("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Be=qe("apache-arrow","4.0.1","Arrow.es2015.min.js");async function He(e){return(await e(De.resolve()))({locateFile:e=>De.resolve(`dist/${e}`)})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([He(Ee),Promise.resolve(e).then(We)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:i,values:o}=r,a=o.map((e=>Object.fromEntries(e.map(((e,t)=>[i[t],e])))));return a.columns=i,a}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return Ve("pre",{className:"observablehq--inspect"},[Ye((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return Ve("table",{value:t},[Ve("thead",[Ve("tr",n.map((e=>Ve("th",[Ye(e)]))))]),Ve("tbody",t.map((e=>Ve("tr",n.map((t=>Ve("td",[Ye(e[t])])))))))])}}function We(e){return"string"==typeof e?fetch(e).then(We):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(We):e instanceof ArrayBuffer?new Uint8Array(e):e}function Ve(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function Ye(e){return document.createTextNode(e)}async function Ge(e){return await e("jszip@3.6.0/dist/jszip.min.js")}async function Je(e){const t=await fetch(await e.url());if(!t.ok)throw new Error(`Unable to load file: ${e.name}`);return t}async function Ke(e,t,{array:n=!1,typed:r=!1}={}){const[i,o]=await Promise.all([e.text(),Ee(Le.resolve())]);return("\t"===t?n?o.tsvParseRows:o.tsvParse:n?o.csvParseRows:o.csvParse)(i,r&&o.autoType)}class Qe{constructor(e){Object.defineProperty(this,"name",{value:e,enumerable:!0})}async blob(){return(await Je(this)).blob()}async arrayBuffer(){return(await Je(this)).arrayBuffer()}async text(){return(await Je(this)).text()}async json(){return(await Je(this)).json()}async stream(){return(await Je(this)).body}async csv(e){return Ke(this,",",e)}async tsv(e){return Ke(this,"\t",e)}async image(){const e=await this.url();return new Promise(((t,n)=>{const r=new Image;new URL(e,document.baseURI).origin!==new URL(location).origin&&(r.crossOrigin="anonymous"),r.onload=()=>t(r),r.onerror=()=>n(new Error(`Unable to load file: ${this.name}`)),r.src=e}))}async arrow(){const[e,t]=await Promise.all([Ee(Be.resolve()),Je(this)]);return e.Table.from(t)}async sqlite(){return SQLiteDatabaseClient.open(Je(this))}async zip(){const[e,t]=await Promise.all([Ge(Ee),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}}class FileAttachment extends Qe{constructor(e,t){super(t),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function Xe(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends Qe{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Ze={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var et=0;function tt(e){this.id=e,this.href=new URL(`#${e}`,location)+""}tt.prototype.toString=function(){return"url("+this.href+")"};var nt={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var i=r.getContext("2d");return i.scale(n,n),i},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),i=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),i.textContent=n,i.disabled=!1}return i.textContent=n,r.download=t,r.onclick=async t=>{if(i.disabled=!0,r.href)return o();i.textContent="Saving…";try{const t=await("function"==typeof e?e():e);i.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){i.textContent=n}if(t.eventPhase)return o();i.disabled=!1},r},element:function(e,t){var n,r=e+="",i=r.indexOf(":");i>=0&&"xmlns"!==(r=e.slice(0,i))&&(e=e.slice(i+1));var o=Ze.hasOwnProperty(r)?document.createElementNS(Ze[r],e):document.createElement(e);if(t)for(var a in t)i=(r=a).indexOf(":"),n=t[a],i>=0&&"xmlns"!==(r=a.slice(0,i))&&(a=a.slice(i+1)),Ze.hasOwnProperty(r)?o.setAttributeNS(Ze[r],a,n):o.setAttribute(a,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new tt("O-"+(null==e?"":e+"-")+ ++et)}};var rt={buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}};function it(){return this}function ot(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:it,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function at(e){let t,n,r=!1;const i=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=i&&"function"!=typeof i)throw new Error("function"==typeof i.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:it,throw:()=>({done:!0}),return:()=>(null!=i&&i(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function st(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var lt={disposable:ot,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return at((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=st(e);function i(){t(st(e))}return e.addEventListener(n,i),void 0!==r&&t(r),function(){e.removeEventListener(n,i)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:at,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:it,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n));++r<i;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return ot(n,(()=>{n.terminate(),URL.revokeObjectURL(t)}))}};function ut(e,t){return function(n){var r,i,o,a,s,l,u,c,d=n[0],f=[],p=null,h=-1;for(s=1,l=arguments.length;s<l;++s){if((r=arguments[s])instanceof Node)f[++h]=r,d+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(u=0,c=r.length;u<c;++u)(i=r[u])instanceof Node?(null===p&&(f[++h]=p=document.createDocumentFragment(),d+="\x3c!--o:"+h+"--\x3e"),p.appendChild(i)):(p=null,d+=i);p=null}else d+=r;d+=n[s]}if(p=e(d),++h>0){for(o=new Array(h),a=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)i=a.currentNode,/^o:/.test(i.nodeValue)&&(o[+i.nodeValue.slice(2)]=i);for(s=0;s<h;++s)(i=o[s])&&i.parentNode.replaceChild(f[s],i)}return 1===p.childNodes.length?p.removeChild(p.firstChild):11===p.nodeType?((i=t()).appendChild(p),i):p}}var ct=ut((function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)}),(function(){return document.createElement("span")}));function dt(e){let t;Object.defineProperties(this,{generator:{value:at((e=>{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*ft(){for(;;)yield Date.now()}var pt=new Map;function ht(e,t){var n;return(n=pt.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){pt.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return pt.set(t,n),n}(n,e).then((()=>t))}var mt={delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return ht(Math.ceil((Date.now()+1)/e)*e,t)},when:ht};function vt(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}function bt(e){return null==e?Ee:xe(e)}var _t=ut((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")})),wt=String.raw;function yt(){return at((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}var gt=Object.assign((function(e){const t=bt(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>Xe,Arrow:()=>t(Be.resolve()),Inputs:()=>t(Oe.resolve()),Mutable:()=>dt,Plot:()=>t(Me.resolve()),SQLite:()=>He(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,_:()=>t(ke.resolve()),d3:()=>t(Se.resolve()),dot:()=>t($e.resolve()),htl:()=>t(Re.resolve()),html:()=>ct,md:()=>function(e){return e(Ue.resolve()).then((function(t){return ut((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var i=r.querySelectorAll("pre code[class]");return i.length>0&&e(Ae.resolve()).then((function(t){i.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(Ae.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(Ae.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),now:ft,require:()=>t,resolve:()=>vt,svg:()=>_t,tex:()=>function(e){return Promise.all([e(Te.resolve()),(t=Te.resolve("dist/katex.min.css"),new Promise((function(e,n){var r=document.createElement("link");r.rel="stylesheet",r.href=t,r.onerror=n,r.onload=e,document.head.appendChild(r)})))]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(wt.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}));var t}(t),vl:()=>async function(e){const[t,n,r]=await Promise.all([Fe,Ie,ze].map((t=>e(t.resolve()))));return r.register(t,n)}(t),width:yt,DOM:nt,Files:rt,Generators:lt,Promises:mt},Object.fromEntries(Object.entries(n).map(Et))))}),{resolve:Ee.resolve});function Et([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}function xt(e,t){this.message=e+"",this.input=t}xt.prototype=Object.create(Error.prototype),xt.prototype.name="RuntimeError",xt.prototype.constructor=xt;var Ct=Array.prototype,Nt=Ct.map,jt=Ct.forEach;function Pt(e){return function(){return e}}function qt(e){return e}function St(){}var Lt={};function Ot(e,t,n){var r;n||(n=Lt),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:At,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:St,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Lt,writable:!0},_rejector:{value:(r=this,function(e){if(e===At)throw new xt(r._name+" is not defined",r._name);if(e instanceof Error&&e.message)throw new xt(e.message,r._name);throw new xt(r._name+" could not be resolved",r._name)})},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Mt(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function $t(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function At(){throw At}function Tt(e){return function(){throw new xt(e+" is defined more than once")}}function kt(e,t,n){var r=this._module._scope,i=this._module._runtime;if(this._inputs.forEach($t,this),t.forEach(Mt,this),this._inputs=t,this._definition=n,this._value=void 0,n===St?i._variables.delete(this):i._variables.add(this),e!==this._name||r.get(e)!==this){var o,a;if(this._name)if(this._outputs.size)r.delete(this._name),(a=this._module._resolve(this._name))._outputs=this._outputs,this._outputs=new Set,a._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=a}),this),a._outputs.forEach(i._updates.add,i._updates),i._dirty.add(a).add(this),r.set(this._name,a);else if((a=r.get(this._name))===this)r.delete(this._name);else{if(3!==a._type)throw new Error;a._duplicates.delete(this),this._duplicate=void 0,1===a._duplicates.size&&(a=a._duplicates.keys().next().value,o=r.get(this._name),a._outputs=o._outputs,o._outputs=new Set,a._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=a})),a._definition=a._duplicate,a._duplicate=void 0,i._dirty.add(o).add(a),i._updates.add(a),r.set(this._name,a))}if(this._outputs.size)throw new Error;e&&((a=r.get(e))?3===a._type?(this._definition=Tt(e),this._duplicate=n,a._duplicates.add(this)):2===a._type?(this._outputs=a._outputs,a._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(a)]=this}),this),i._dirty.add(a).add(this),r.set(e,this)):(a._duplicate=a._definition,this._duplicate=n,(o=new Ot(3,this._module))._name=e,o._definition=this._definition=a._definition=Tt(e),o._outputs=a._outputs,a._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(a)]=o})),o._duplicates=new Set([this,a]),i._dirty.add(a).add(o),i._updates.add(a).add(o),r.set(e,o)):r.set(e,this)),this._name=e}return i._updates.add(this),i._compute(),this}function Rt(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["invalidation",Ft],["visibility",It],...t])},_source:{value:null,writable:!0}})}function Ut(e){return e._name}Object.defineProperties(Ot.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return kt.call(this,null==e?null:e+"",null==t?[]:Nt.call(t,this._module._resolve,this._module),"function"==typeof n?n:Pt(n))},writable:!0,configurable:!0},delete:{value:function(){return kt.call(this,null,[],St)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return kt.call(this,t+"",[n._resolve(e+"")],qt)},writable:!0,configurable:!0}}),Object.defineProperties(Rt.prototype,{_copy:{value:function(e,t){e._source=this,t.set(this,e);for(const[o,a]of this._scope){var n=e._scope.get(o);if(!n||1!==n._type)if(a._definition===qt){var r=a._inputs[0],i=r._module;e.import(r._name,o,t.get(i)||(i._source?i._copy(new Rt(e._runtime,e._builtins),t):i))}else e.define(o,a._inputs.map(Ut),a._definition)}return e},writable:!0,configurable:!0},_resolve:{value:function(e){var t,n=this._scope.get(e);if(!n)if(n=new Ot(2,this),this._builtins.has(e))n.define(e,Pt(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,(r=t,function(){throw r}))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Pt(t))}var r;return n},writable:!0,configurable:!0},redefine:{value:function(e){var t=this._scope.get(e);if(!t)throw new xt(e+" is not defined");if(3===t._type)throw new xt(e+" is defined more than once");return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){var e=new Ot(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){var n=new Rt(this._runtime,this._builtins);return n._source=this,jt.call(e,(function(e){"object"!=typeof e&&(e={name:e+""}),null==e.alias&&(e.alias=e.name),n.import(e.name,e.alias,t)})),Promise.resolve().then((()=>{const e=new Set([this]);for(const t of e)for(const n of t._scope.values())if(n._definition===qt){const t=n._inputs[0]._module,r=t._source||t;if(r===this)return void console.warn("circular module definition; ignoring");e.add(r)}this._copy(n,new Map)})),n},writable:!0,configurable:!0},import:{value:function(){var e=new Ot(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){var t=this._scope.get(e);if(!t)throw new xt(e+" is not defined");t._observer===Lt&&(t._observer=!0,this._runtime._dirty.add(t));return await this._runtime._compute(),t._promise},writable:!0,configurable:!0},variable:{value:function(e){return new Ot(1,this,e)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const Dt="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;var Ft={},It={};function zt(e=new gt,t=Xt){var n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(var r in e)new Ot(2,n).define(r,[],e[r])}function Bt(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function Ht(e){++e._indegree}function Wt(e){--e._indegree}function Vt(e){return e._promise.catch(e._rejector)}function Yt(e){return new Promise((function(t){e._invalidate=t}))}function Gt(e,t){let n,r,i="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!i,a=St,s=St;return i&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,a()))),r.observe(i),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(a=e,s=t)))),n.then((()=>e))):Promise.reject()}}function Jt(e){e._invalidate(),e._invalidate=St,e._pending();var t=e._value,n=++e._version,r=null,i=e._promise=Promise.all(e._inputs.map(Vt)).then((function(i){if(e._version===n){for(var o=0,a=i.length;o<a;++o)switch(i[o]){case Ft:i[o]=r=Yt(e);break;case It:r||(r=Yt(e)),i[o]=Gt(r,e)}return e._definition.apply(t,i)}})).then((function(t){return function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t)?e._version!==n?void t.return():((r||Yt(e)).then((o=t,function(){o.return()})),function(e,t,n,r){function i(){var n=new Promise((function(e){e(r.next())})).then((function(r){return r.done?void 0:Promise.resolve(r.value).then((function(r){if(e._version===t)return Kt(e,r,n).then(i),e._fulfilled(r),r}))}));n.catch((function(r){e._version===t&&(Kt(e,void 0,n),e._rejected(r))}))}return new Promise((function(e){e(r.next())})).then((function(e){if(!e.done)return n.then(i),e.value}))}(e,n,i,t)):t;var o}));i.then((function(t){e._version===n&&(e._value=t,e._fulfilled(t))}),(function(t){e._version===n&&(e._value=void 0,e._rejected(t))}))}function Kt(e,t,n){var r=e._module._runtime;return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}function Qt(e,t){e._invalidate(),e._invalidate=St,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(St),e._value=void 0,e._rejected(t)}function Xt(e){return window[e]}Object.defineProperties(zt,{load:{value:function(e,t,n){if("function"==typeof t&&(n=t,t=null),"function"!=typeof n)throw new Error("invalid observer");null==t&&(t=new gt);const{modules:r,id:i}=e,o=new Map,a=new zt(t),s=l(i);function l(e){let t=o.get(e);return t||o.set(e,t=a.module()),t}for(const e of r){const t=l(e.id);let r=0;for(const i of e.variables)i.from?t.import(i.remote,i.name,l(i.from)):t===s?t.variable(n(i,r,e.variables)).define(i.name,i.inputs,i.value):t.define(i.name,i.inputs,i.value),++r}return a},writable:!0,configurable:!0}}),Object.defineProperties(zt.prototype,{_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){var e=this;return new Promise((function(t){Dt((function(){t(),e._disposed||e._computeNow()}))}))},writable:!0,configurable:!0},_computeNow:{value:function(){var e,t,n=[];(e=new Set(this._dirty)).forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Lt)return!0;var t=new Set(e._outputs);for(const e of t){if(e._observer!==Lt)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n<t._reachable&&t._invalidate(),t._reachable=n}),this),(e=new Set(this._updates)).forEach((function(t){t._reachable?(t._indegree=0,t._outputs.forEach(e.add,e)):(t._indegree=NaN,e.delete(t))})),this._computing=null,this._updates.clear(),this._dirty.clear(),e.forEach((function(e){e._outputs.forEach(Ht)}));do{for(e.forEach((function(e){0===e._indegree&&n.push(e)}));t=n.pop();)Jt(t),t._outputs.forEach(r),e.delete(t);e.forEach((function(t){Bt(t)&&(Qt(t,new xt("circular definition")),t._outputs.forEach(Wt),e.delete(t))}))}while(e.size);function r(e){0==--e._indegree&&n.push(e)}},writable:!0,configurable:!0},dispose:{value:function(){this._computing=Promise.resolve(),this._disposed=!0,this._variables.forEach((e=>{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=St){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Rt(this);if(n=this._modules.get(e),n)return n;this._init=n=new Rt(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}}),e.Inspector=ue,e.Library=gt,e.Runtime=zt,e.RuntimeError=xt,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
// @observablehq/runtime v4.14.0 Copyright 2021 Observable, Inc. | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).observablehq=e.observablehq||{})}(this,(function(e){"use strict";function t(e,t,n){n=n||{};var r=e.ownerDocument,i=r.defaultView.CustomEvent;"function"==typeof i?i=new i(t,{detail:n}):((i=r.createEvent("Event")).initEvent(t,!1,!1),i.detail=n),e.dispatchEvent(i)}function n(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function r(e){return e===(0|e)+""}function i(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const o=Symbol.prototype.toString;function a(e){return o.call(e)}const{getOwnPropertySymbols:s,prototype:{hasOwnProperty:l}}=Object,{toStringTag:u}=Symbol,c={},d=s;function f(e,t){return l.call(e,t)}function p(e){return e[u]||e.constructor&&e.constructor.name||"Object"}function h(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return c}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function v(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),i=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:i&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:_}=Object,w=b({});function y(e,r,o,a){let s,l,u,c,d=n(e);e instanceof Map?e instanceof e.constructor?(s=`Map(${e.size})`,l=g):(s="Map()",l=P):e instanceof Set?e instanceof e.constructor?(s=`Set(${e.size})`,l=E):(s="Set()",l=P):d?(s=`${e.constructor.name}(${e.length})`,l=C):(c=v(e))?(s=`Immutable.${c.name}${"Record"===c.name?"":`(${e.size})`}`,d=c.arrayish,l=c.arrayish?j:c.setish?x:q):a?(s=p(e),l=N):(s=p(e),l=P);const f=document.createElement("span");f.className="observablehq--expanded",o&&f.appendChild(i(o));const h=f.appendChild(document.createElement("a"));h.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",h.appendChild(document.createTextNode(`${s}${d?" [":" {"}`)),h.addEventListener("mouseup",(function(t){t.stopPropagation(),se(f,A(e,null,o,a))})),l=l(e);for(let e=0;!(u=l.next()).done&&e<20;++e)f.appendChild(u.value);if(!u.done){const e=f.appendChild(document.createElement("a"));e.className="observablehq--field",e.style.display="block",e.appendChild(document.createTextNode(" … more")),e.addEventListener("mouseup",(function(e){e.stopPropagation(),f.insertBefore(u.value,f.lastChild.previousSibling);for(let e=0;!(u=l.next()).done&&e<19;++e)f.insertBefore(u.value,f.lastChild.previousSibling);u.done&&f.removeChild(f.lastChild.previousSibling),t(f,"load")}))}return f.appendChild(document.createTextNode(d?"]":"}")),f}function*g(e){for(const[t,n]of e)yield O(t,n);yield*P(e)}function*E(e){for(const t of e)yield M(t);yield*P(e)}function*x(e){for(const t of e)yield M(t)}function*C(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield L(t,h(e,t),"observablehq--index"));for(const t in e)!r(t)&&f(e,t)&&(yield L(t,h(e,t),"observablehq--key"));for(const t of d(e))yield L(a(t),h(e,t),"observablehq--symbol")}function*j(e){let t=0;for(const n=e.size;t<n;++t)yield L(t,e.get(t),!0)}function*N(e){for(const t in _(e))yield L(t,h(e,t),"observablehq--key");for(const t of d(e))yield L(a(t),h(e,t),"observablehq--symbol");const t=b(e);t&&t!==w&&(yield S(t))}function*P(e){for(const t in e)f(e,t)&&(yield L(t,h(e,t),"observablehq--key"));for(const t of d(e))yield L(a(t),h(e,t),"observablehq--symbol");const t=b(e);t&&t!==w&&(yield S(t))}function*q(e){for(const[t,n]of e)yield L(t,n,"observablehq--key")}function S(e){const t=document.createElement("div"),n=t.appendChild(document.createElement("span"));return t.className="observablehq--field",n.className="observablehq--prototype-key",n.textContent=" <prototype>",t.appendChild(document.createTextNode(": ")),t.appendChild(ae(e,void 0,void 0,void 0,!0)),t}function L(e,t,n){const r=document.createElement("div"),i=r.appendChild(document.createElement("span"));return r.className="observablehq--field",i.className=n,i.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(ae(t)),r}function O(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(ae(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(ae(t)),n}function M(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(ae(e)),t}function $(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function A(e,t,r,o){let a,s,l,u,c=n(e);if(e instanceof Map?e instanceof e.constructor?(a=`Map(${e.size})`,s=T):(a="Map()",s=F):e instanceof Set?e instanceof e.constructor?(a=`Set(${e.size})`,s=k):(a="Set()",s=F):c?(a=`${e.constructor.name}(${e.length})`,s=D):(u=v(e))?(a=`Immutable.${u.name}${"Record"===u.name?"":`(${e.size})`}`,c=u.arrayish,s=u.arrayish?U:u.setish?R:I):(a=p(e),s=F),t){const t=document.createElement("span");return t.className="observablehq--shallow",r&&t.appendChild(i(r)),t.appendChild(document.createTextNode(a)),t.addEventListener("mouseup",(function(n){$(t)||(n.stopPropagation(),se(t,A(e)))})),t}const d=document.createElement("span");d.className="observablehq--collapsed",r&&d.appendChild(i(r));const f=d.appendChild(document.createElement("a"));f.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",f.appendChild(document.createTextNode(`${a}${c?" [":" {"}`)),d.addEventListener("mouseup",(function(t){$(d)||(t.stopPropagation(),se(d,y(e,0,r,o)))}),!0),s=s(e);for(let e=0;!(l=s.next()).done&&e<20;++e)e>0&&d.appendChild(document.createTextNode(", ")),d.appendChild(l.value);return l.done||d.appendChild(document.createTextNode(", …")),d.appendChild(document.createTextNode(c?"]":"}")),d}function*T(e){for(const[t,n]of e)yield H(t,n);yield*F(e)}function*k(e){for(const t of e)yield ae(t,!0);yield*F(e)}function*R(e){for(const t of e)yield ae(t,!0)}function*U(e){let t=-1,n=0;for(const r=e.size;n<r;++n)n>t+1&&(yield z(n-t-1)),yield ae(e.get(n),!0),t=n;n>t+1&&(yield z(n-t-1))}function*D(e){let t=-1,n=0;for(const r=e.length;n<r;++n)n in e&&(n>t+1&&(yield z(n-t-1)),yield ae(h(e,n),!0),t=n);n>t+1&&(yield z(n-t-1));for(const t in e)!r(t)&&f(e,t)&&(yield B(t,h(e,t),"observablehq--key"));for(const t of d(e))yield B(a(t),h(e,t),"observablehq--symbol")}function*F(e){for(const t in e)f(e,t)&&(yield B(t,h(e,t),"observablehq--key"));for(const t of d(e))yield B(a(t),h(e,t),"observablehq--symbol")}function*I(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function z(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),i=r.appendChild(document.createElement("span"));return i.className=n,i.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(ae(t,!0)),r}function H(e,t){const n=document.createDocumentFragment();return n.appendChild(ae(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(ae(t,!0)),n}function W(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function V(e){return e<0?"-"+W(-e,6):e>9999?"+"+W(e,6):W(e,4)}var Y=Error.prototype.toString;var G=RegExp.prototype.toString;function J(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,K)}function K(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function Q(e,t){for(var n=0;t.exec(e);)++n;return n}var X=Function.prototype.toString,Z={prefix:"async ƒ"},ee={prefix:"async ƒ*"},te={prefix:"class"},ne={prefix:"ƒ"},re={prefix:"ƒ*"};function ie(e,t,n){var r=document.createElement("span");r.className="observablehq--function",n&&r.appendChild(i(n));var o=r.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,r.appendChild(document.createTextNode(t)),r}const{prototype:{toString:oe}}=Object;function ae(e,t,n,r,o){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=a(e);break;case"function":return function(e,t){var n,r,i=X.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=Z;break;case"AsyncGeneratorFunction":n=ee;break;case"GeneratorFunction":n=re;break;default:n=/^class\b/.test(i)?te:ne}return n===te?ie(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(i))?ie(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i))?ie(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):ie(n,"(…)",t)}(e,r);case"string":return function(e,t,n,r){if(!1===t){if(Q(e,/["\n]/g)<=Q(e,/`|\${/g)){const t=document.createElement("span");r&&t.appendChild(i(r));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");r&&n.appendChild(i(r));const a=n.appendChild(document.createElement("span"));a.className="observablehq--string",a.textContent="`"+J(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),l=o.length-20;return s.textContent=`Show ${l} truncated line${l>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(i){i.stopPropagation(),se(n,ae(e,t,!0,r))})),n}const a=document.createElement("span");r&&a.appendChild(i(r));const s=a.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+J(e)+"`",a}const o=document.createElement("span");r&&o.appendChild(i(r));const a=o.appendChild(document.createElement("span"));return a.className="observablehq--string",a.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,r);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",l=e,e=isNaN(l)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(l)?V(l.getUTCFullYear())+"-"+W(l.getUTCMonth()+1,2)+"-"+W(l.getUTCDate(),2):V(l.getFullYear())+"-"+W(l.getMonth()+1,2)+"-"+W(l.getDate(),2)+"T"+W(l.getHours(),2)+":"+W(l.getMinutes(),2)+(l.getMilliseconds()?":"+W(l.getSeconds(),2)+"."+W(l.getMilliseconds(),3):l.getSeconds()?":"+W(l.getSeconds(),2):"");break}if(e===c){s="forbidden",e="[forbidden]";break}switch(oe.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||Y.call(e)}(e);break;default:return(n?y:A)(e,t,r,o)}}var l;const u=document.createElement("span");r&&u.appendChild(i(r));const d=u.appendChild(document.createElement("span"));return d.className=`observablehq--${s}`,d.textContent=e,u}function se(e,n){e.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),e.parentNode.replaceChild(n,e),t(n,"load")}const le=/\s+\(\d+:\d+\)$/m;class ue{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(e,n){const{_node:r}=this;if((!(e instanceof Element||e instanceof Text)||e.parentNode&&e.parentNode!==r)&&(e=ae(e,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==e)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(e,r.firstChild)}else r.appendChild(e);t(r,"update")}rejected(e,n){const{_node:r}=this;for(r.classList.remove("observablehq--running"),r.classList.add("observablehq--error");r.lastChild;)r.removeChild(r.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(i(n)),o.appendChild(document.createTextNode((e+"").replace(le,""))),r.appendChild(o),t(r,"error",{error:e})}}ue.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new ue(e.appendChild(document.createElement("div")))}};const ce=new Map,de=[],fe=de.map,pe=de.some,he=de.hasOwnProperty,me="https://cdn.jsdelivr.net/npm/",ve=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,be=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,_e=/\.[^/]*$/,we=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function ye(e){const t=ve.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function ge(e){const t=`${me}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=ce.get(t);return n||ce.set(t,n=fetch(t).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!ce.has(e.url)&&ce.set(e.url,n),e.json()}))),n}RequireError.prototype.name=RequireError.name;var Ee=xe((async function(e,t){if(e.startsWith(me)&&(e=e.substring(me.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=ye(e);if(!n)return`${me}${e}`;if(!n.version&&null!=t&&t.startsWith(me)){const e=await ge(ye(t.substring(me.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!_e.test(n.path)&&(n.path+=".js"),n.path&&n.version&&be.test(n.version))return`${me}${n.name}@${n.version}/${n.path}`;const r=await ge(n);return`${me}${r.name}@${r.version}/${n.path||function(e){for(const t of we){const n=e[t];if("string"==typeof n)return _e.test(n)?n:`${n}.js`}}(r)||"index.js"}`}));function xe(e){const t=new Map,n=i(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(de.pop()(i(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=Pe,document.head.appendChild(r)}))),n}function i(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(fe.call(arguments,n)).then(Ce):n(e)}return o.alias=function(t){return xe(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function Ce(e){const t={};for(const n of e)for(const e in n)he.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:je(n,e)}):t[e]=n[e]);return t}function je(e,t){return()=>e[t]}function Ne(e){return"exports"===(e+="")||"module"===e}function Pe(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),de.push(pe.call(t,Ne)?e=>{const r={},i={exports:r};return Promise.all(fe.call(t,(t=>"exports"===(t+="")?r:"module"===t?i:e(t)))).then((e=>(n.apply(null,e),i.exports)))}:e=>Promise.all(fe.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}function qe(e,t,n){return{resolve:(r=n)=>`https://cdn.jsdelivr.net/npm/${e}@${t}/${r}`}}Pe.amd={};const Se=qe("d3","7.0.1","dist/d3.min.js"),Le=qe("d3-dsv","3.0.1","dist/d3-dsv.min.js"),Oe=qe("@observablehq/inputs","0.9.0","dist/inputs.min.js"),Me=qe("@observablehq/plot","0.2.0","dist/plot.umd.min.js"),$e=qe("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),Ae=qe("@observablehq/highlight.js","2.0.0","highlight.min.js"),Te=qe("@observablehq/katex","0.11.1","dist/katex.min.js"),ke=qe("lodash","4.17.21","lodash.min.js"),Re=qe("htl","0.3.0","dist/htl.min.js"),Ue=qe("jszip","3.7.1","dist/jszip.min.js"),De=qe("marked","0.3.12","marked.min.js"),Fe=qe("sql.js","1.6.1","dist/sql-wasm.js"),Ie=qe("vega","5.20.2","build/vega.min.js"),ze=qe("vega-lite","5.1.0","build/vega-lite.min.js"),Be=qe("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),He=qe("apache-arrow","4.0.1","Arrow.es2015.min.js"),We=qe("topojson-client","3.1.0","dist/topojson-client.min.js");async function Ve(e){return(await e(Fe.resolve()))({locateFile:e=>Fe.resolve(`dist/${e}`)})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([Ve(Ee),Promise.resolve(e).then(Ye)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:i,values:o}=r,a=o.map((e=>Object.fromEntries(e.map(((e,t)=>[i[t],e])))));return a.columns=i,a}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return Ge("pre",{className:"observablehq--inspect"},[Je((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return Ge("table",{value:t},[Ge("thead",[Ge("tr",n.map((e=>Ge("th",[Je(e)]))))]),Ge("tbody",t.map((e=>Ge("tr",n.map((t=>Ge("td",[Je(e[t])])))))))])}}function Ye(e){return"string"==typeof e?fetch(e).then(Ye):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(Ye):e instanceof ArrayBuffer?new Uint8Array(e):e}function Ge(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function Je(e){return document.createTextNode(e)}async function Ke(e){const t=await fetch(await e.url());if(!t.ok)throw new Error(`Unable to load file: ${e.name}`);return t}async function Qe(e,t,{array:n=!1,typed:r=!1}={}){const[i,o]=await Promise.all([e.text(),Ee(Le.resolve())]);return("\t"===t?n?o.tsvParseRows:o.tsvParse:n?o.csvParseRows:o.csvParse)(i,r&&o.autoType)}class Xe{constructor(e){Object.defineProperty(this,"name",{value:e,enumerable:!0})}async blob(){return(await Ke(this)).blob()}async arrayBuffer(){return(await Ke(this)).arrayBuffer()}async text(){return(await Ke(this)).text()}async json(){return(await Ke(this)).json()}async stream(){return(await Ke(this)).body}async csv(e){return Qe(this,",",e)}async tsv(e){return Qe(this,"\t",e)}async image(){const e=await this.url();return new Promise(((t,n)=>{const r=new Image;new URL(e,document.baseURI).origin!==new URL(location).origin&&(r.crossOrigin="anonymous"),r.onload=()=>t(r),r.onerror=()=>n(new Error(`Unable to load file: ${this.name}`)),r.src=e}))}async arrow(){const[e,t]=await Promise.all([Ee(He.resolve()),Ke(this)]);return e.Table.from(t)}async sqlite(){return SQLiteDatabaseClient.open(Ke(this))}async zip(){const[e,t]=await Promise.all([Ee(Ue.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}}class FileAttachment extends Xe{constructor(e,t){super(t),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function Ze(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends Xe{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var et={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var tt=0;function nt(e){this.id=e,this.href=new URL(`#${e}`,location)+""}nt.prototype.toString=function(){return"url("+this.href+")"};var rt={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var i=r.getContext("2d");return i.scale(n,n),i},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),i=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),i.textContent=n,i.disabled=!1}return i.textContent=n,r.download=t,r.onclick=async t=>{if(i.disabled=!0,r.href)return o();i.textContent="Saving…";try{const t=await("function"==typeof e?e():e);i.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){i.textContent=n}if(t.eventPhase)return o();i.disabled=!1},r},element:function(e,t){var n,r=e+="",i=r.indexOf(":");i>=0&&"xmlns"!==(r=e.slice(0,i))&&(e=e.slice(i+1));var o=et.hasOwnProperty(r)?document.createElementNS(et[r],e):document.createElement(e);if(t)for(var a in t)i=(r=a).indexOf(":"),n=t[a],i>=0&&"xmlns"!==(r=a.slice(0,i))&&(a=a.slice(i+1)),et.hasOwnProperty(r)?o.setAttributeNS(et[r],a,n):o.setAttribute(a,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new nt("O-"+(null==e?"":e+"-")+ ++tt)}};var it={buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}};function ot(){return this}function at(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:ot,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function st(e){let t,n,r=!1;const i=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=i&&"function"!=typeof i)throw new Error("function"==typeof i.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:ot,throw:()=>({done:!0}),return:()=>(null!=i&&i(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function lt(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var ut={disposable:at,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return st((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=lt(e);function i(){t(lt(e))}return e.addEventListener(n,i),void 0!==r&&t(r),function(){e.removeEventListener(n,i)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:st,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:ot,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n));++r<i;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return at(n,(()=>{n.terminate(),URL.revokeObjectURL(t)}))}};function ct(e,t){return function(n){var r,i,o,a,s,l,u,c,d=n[0],f=[],p=null,h=-1;for(s=1,l=arguments.length;s<l;++s){if((r=arguments[s])instanceof Node)f[++h]=r,d+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(u=0,c=r.length;u<c;++u)(i=r[u])instanceof Node?(null===p&&(f[++h]=p=document.createDocumentFragment(),d+="\x3c!--o:"+h+"--\x3e"),p.appendChild(i)):(p=null,d+=i);p=null}else d+=r;d+=n[s]}if(p=e(d),++h>0){for(o=new Array(h),a=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)i=a.currentNode,/^o:/.test(i.nodeValue)&&(o[+i.nodeValue.slice(2)]=i);for(s=0;s<h;++s)(i=o[s])&&i.parentNode.replaceChild(f[s],i)}return 1===p.childNodes.length?p.removeChild(p.firstChild):11===p.nodeType?((i=t()).appendChild(p),i):p}}var dt=ct((function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)}),(function(){return document.createElement("span")}));function ft(e){let t;Object.defineProperties(this,{generator:{value:st((e=>{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*pt(){for(;;)yield Date.now()}var ht=new Map;function mt(e,t){var n;return(n=ht.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){ht.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return ht.set(t,n),n}(n,e).then((()=>t))}var vt={delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return mt(Math.ceil((Date.now()+1)/e)*e,t)},when:mt};function bt(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}function _t(e){return null==e?Ee:xe(e)}var wt=ct((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")})),yt=String.raw;function gt(){return st((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}var Et=Object.assign((function(e){const t=_t(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>Ze,Arrow:()=>t(He.resolve()),Inputs:()=>t(Oe.resolve()),Mutable:()=>ft,Plot:()=>t(Me.resolve()),SQLite:()=>Ve(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,_:()=>t(ke.resolve()),d3:()=>t(Se.resolve()),dot:()=>t($e.resolve()),htl:()=>t(Re.resolve()),html:()=>dt,md:()=>function(e){return e(De.resolve()).then((function(t){return ct((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var i=r.querySelectorAll("pre code[class]");return i.length>0&&e(Ae.resolve()).then((function(t){i.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(Ae.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(Ae.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),now:pt,require:()=>t,resolve:()=>bt,svg:()=>wt,tex:()=>function(e){return Promise.all([e(Te.resolve()),(t=Te.resolve("dist/katex.min.css"),new Promise((function(e,n){var r=document.createElement("link");r.rel="stylesheet",r.href=t,r.onerror=n,r.onload=e,document.head.appendChild(r)})))]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(yt.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}));var t}(t),topojson:()=>t(We.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Ie,ze,Be].map((t=>e(t.resolve()))));return r.register(t,n)}(t),width:gt,DOM:rt,Files:it,Generators:ut,Promises:vt},Object.fromEntries(Object.entries(n).map(xt))))}),{resolve:Ee.resolve});function xt([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}function Ct(e,t){this.message=e+"",this.input=t}Ct.prototype=Object.create(Error.prototype),Ct.prototype.name="RuntimeError",Ct.prototype.constructor=Ct;var jt=Array.prototype,Nt=jt.map,Pt=jt.forEach;function qt(e){return function(){return e}}function St(e){return e}function Lt(){}var Ot={};function Mt(e,t,n){var r;n||(n=Ot),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:Tt,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Lt,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Ot,writable:!0},_rejector:{value:(r=this,function(e){if(e===Tt)throw new Ct(r._name+" is not defined",r._name);if(e instanceof Error&&e.message)throw new Ct(e.message,r._name);throw new Ct(r._name+" could not be resolved",r._name)})},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function $t(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function At(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function Tt(){throw Tt}function kt(e){return function(){throw new Ct(e+" is defined more than once")}}function Rt(e,t,n){var r=this._module._scope,i=this._module._runtime;if(this._inputs.forEach(At,this),t.forEach($t,this),this._inputs=t,this._definition=n,this._value=void 0,n===Lt?i._variables.delete(this):i._variables.add(this),e!==this._name||r.get(e)!==this){var o,a;if(this._name)if(this._outputs.size)r.delete(this._name),(a=this._module._resolve(this._name))._outputs=this._outputs,this._outputs=new Set,a._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=a}),this),a._outputs.forEach(i._updates.add,i._updates),i._dirty.add(a).add(this),r.set(this._name,a);else if((a=r.get(this._name))===this)r.delete(this._name);else{if(3!==a._type)throw new Error;a._duplicates.delete(this),this._duplicate=void 0,1===a._duplicates.size&&(a=a._duplicates.keys().next().value,o=r.get(this._name),a._outputs=o._outputs,o._outputs=new Set,a._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=a})),a._definition=a._duplicate,a._duplicate=void 0,i._dirty.add(o).add(a),i._updates.add(a),r.set(this._name,a))}if(this._outputs.size)throw new Error;e&&((a=r.get(e))?3===a._type?(this._definition=kt(e),this._duplicate=n,a._duplicates.add(this)):2===a._type?(this._outputs=a._outputs,a._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(a)]=this}),this),i._dirty.add(a).add(this),r.set(e,this)):(a._duplicate=a._definition,this._duplicate=n,(o=new Mt(3,this._module))._name=e,o._definition=this._definition=a._definition=kt(e),o._outputs=a._outputs,a._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(a)]=o})),o._duplicates=new Set([this,a]),i._dirty.add(a).add(o),i._updates.add(a).add(o),r.set(e,o)):r.set(e,this)),this._name=e}return i._updates.add(this),i._compute(),this}function Ut(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["invalidation",It],["visibility",zt],...t])},_source:{value:null,writable:!0}})}function Dt(e){return e._name}Object.defineProperties(Mt.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return Rt.call(this,null==e?null:e+"",null==t?[]:Nt.call(t,this._module._resolve,this._module),"function"==typeof n?n:qt(n))},writable:!0,configurable:!0},delete:{value:function(){return Rt.call(this,null,[],Lt)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return Rt.call(this,t+"",[n._resolve(e+"")],St)},writable:!0,configurable:!0}}),Object.defineProperties(Ut.prototype,{_copy:{value:function(e,t){e._source=this,t.set(this,e);for(const[o,a]of this._scope){var n=e._scope.get(o);if(!n||1!==n._type)if(a._definition===St){var r=a._inputs[0],i=r._module;e.import(r._name,o,t.get(i)||(i._source?i._copy(new Ut(e._runtime,e._builtins),t):i))}else e.define(o,a._inputs.map(Dt),a._definition)}return e},writable:!0,configurable:!0},_resolve:{value:function(e){var t,n=this._scope.get(e);if(!n)if(n=new Mt(2,this),this._builtins.has(e))n.define(e,qt(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,(r=t,function(){throw r}))}void 0===t?this._scope.set(n._name=e,n):n.define(e,qt(t))}var r;return n},writable:!0,configurable:!0},redefine:{value:function(e){var t=this._scope.get(e);if(!t)throw new Ct(e+" is not defined");if(3===t._type)throw new Ct(e+" is defined more than once");return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){var e=new Mt(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){var n=new Ut(this._runtime,this._builtins);return n._source=this,Pt.call(e,(function(e){"object"!=typeof e&&(e={name:e+""}),null==e.alias&&(e.alias=e.name),n.import(e.name,e.alias,t)})),Promise.resolve().then((()=>{const e=new Set([this]);for(const t of e)for(const n of t._scope.values())if(n._definition===St){const t=n._inputs[0]._module,r=t._source||t;if(r===this)return void console.warn("circular module definition; ignoring");e.add(r)}this._copy(n,new Map)})),n},writable:!0,configurable:!0},import:{value:function(){var e=new Mt(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){var t=this._scope.get(e);if(!t)throw new Ct(e+" is not defined");t._observer===Ot&&(t._observer=!0,this._runtime._dirty.add(t));return await this._runtime._compute(),t._promise},writable:!0,configurable:!0},variable:{value:function(e){return new Mt(1,this,e)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const Ft="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;var It={},zt={};function Bt(e=new Et,t=Zt){var n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(var r in e)new Mt(2,n).define(r,[],e[r])}function Ht(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function Wt(e){++e._indegree}function Vt(e){--e._indegree}function Yt(e){return e._promise.catch(e._rejector)}function Gt(e){return new Promise((function(t){e._invalidate=t}))}function Jt(e,t){let n,r,i="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!i,a=Lt,s=Lt;return i&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,a()))),r.observe(i),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(a=e,s=t)))),n.then((()=>e))):Promise.reject()}}function Kt(e){e._invalidate(),e._invalidate=Lt,e._pending();var t=e._value,n=++e._version,r=null,i=e._promise=Promise.all(e._inputs.map(Yt)).then((function(i){if(e._version===n){for(var o=0,a=i.length;o<a;++o)switch(i[o]){case It:i[o]=r=Gt(e);break;case zt:r||(r=Gt(e)),i[o]=Jt(r,e)}return e._definition.apply(t,i)}})).then((function(t){return function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t)?e._version!==n?void t.return():((r||Gt(e)).then((o=t,function(){o.return()})),function(e,t,n,r){function i(){var n=new Promise((function(e){e(r.next())})).then((function(r){return r.done?void 0:Promise.resolve(r.value).then((function(r){if(e._version===t)return Qt(e,r,n).then(i),e._fulfilled(r),r}))}));n.catch((function(r){e._version===t&&(Qt(e,void 0,n),e._rejected(r))}))}return new Promise((function(e){e(r.next())})).then((function(e){if(!e.done)return n.then(i),e.value}))}(e,n,i,t)):t;var o}));i.then((function(t){e._version===n&&(e._value=t,e._fulfilled(t))}),(function(t){e._version===n&&(e._value=void 0,e._rejected(t))}))}function Qt(e,t,n){var r=e._module._runtime;return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}function Xt(e,t){e._invalidate(),e._invalidate=Lt,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Lt),e._value=void 0,e._rejected(t)}function Zt(e){return window[e]}Object.defineProperties(Bt,{load:{value:function(e,t,n){if("function"==typeof t&&(n=t,t=null),"function"!=typeof n)throw new Error("invalid observer");null==t&&(t=new Et);const{modules:r,id:i}=e,o=new Map,a=new Bt(t),s=l(i);function l(e){let t=o.get(e);return t||o.set(e,t=a.module()),t}for(const e of r){const t=l(e.id);let r=0;for(const i of e.variables)i.from?t.import(i.remote,i.name,l(i.from)):t===s?t.variable(n(i,r,e.variables)).define(i.name,i.inputs,i.value):t.define(i.name,i.inputs,i.value),++r}return a},writable:!0,configurable:!0}}),Object.defineProperties(Bt.prototype,{_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){var e=this;return new Promise((function(t){Ft((function(){t(),e._disposed||e._computeNow()}))}))},writable:!0,configurable:!0},_computeNow:{value:function(){var e,t,n=[];(e=new Set(this._dirty)).forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Ot)return!0;var t=new Set(e._outputs);for(const e of t){if(e._observer!==Ot)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n<t._reachable&&t._invalidate(),t._reachable=n}),this),(e=new Set(this._updates)).forEach((function(t){t._reachable?(t._indegree=0,t._outputs.forEach(e.add,e)):(t._indegree=NaN,e.delete(t))})),this._computing=null,this._updates.clear(),this._dirty.clear(),e.forEach((function(e){e._outputs.forEach(Wt)}));do{for(e.forEach((function(e){0===e._indegree&&n.push(e)}));t=n.pop();)Kt(t),t._outputs.forEach(r),e.delete(t);e.forEach((function(t){Ht(t)&&(Xt(t,new Ct("circular definition")),t._outputs.forEach(Vt),e.delete(t))}))}while(e.size);function r(e){0==--e._indegree&&n.push(e)}},writable:!0,configurable:!0},dispose:{value:function(){this._computing=Promise.resolve(),this._disposed=!0,this._variables.forEach((e=>{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Lt){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Ut(this);if(n=this._modules.get(e),n)return n;this._init=n=new Ut(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}}),e.Inspector=ue,e.Library=Et,e.Runtime=Bt,e.RuntimeError=Ct,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@observablehq/runtime", | ||
"version": "4.13.0", | ||
"version": "4.14.0", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "main": "dist/runtime.umd.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126201