@devframes/plugin-data-inspector--assets 0.9.7 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,952 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function u(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var d={},f=[],p=()=>{},m=()=>!1,h=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),g=e=>e.startsWith(`onUpdate:`),_=Object.assign,v=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},y=Object.prototype.hasOwnProperty,b=(e,t)=>y.call(e,t),x=Array.isArray,S=e=>j(e)===`[object Map]`,C=e=>j(e)===`[object Set]`,w=e=>j(e)===`[object Date]`,T=e=>j(e)===`[object RegExp]`,E=e=>typeof e==`function`,D=e=>typeof e==`string`,O=e=>typeof e==`symbol`,k=e=>typeof e==`object`&&!!e,A=e=>(k(e)||E(e))&&E(e.then)&&E(e.catch),ee=Object.prototype.toString,j=e=>ee.call(e),te=e=>j(e).slice(8,-1),ne=e=>j(e)===`[object Object]`,M=e=>D(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,re=u(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ie=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ae=/-\w/g,N=ie(e=>e.replace(ae,e=>e.slice(1).toUpperCase())),P=/\B([A-Z])/g,F=ie(e=>e.replace(P,`-$1`).toLowerCase()),I=ie(e=>e.charAt(0).toUpperCase()+e.slice(1)),oe=ie(e=>e?`on${I(e)}`:``),se=(e,t)=>!Object.is(e,t),L=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ce=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},le=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ue=e=>{let t=D(e)?Number(e):NaN;return isNaN(t)?e:t},de,fe=()=>de||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof globalThis<`u`?globalThis:{},pe=u(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function me(e){if(x(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=D(r)?ve(r):me(r);if(i)for(let e in i)t[e]=i[e]}return t}if(D(e)||k(e))return e}var he=/;(?![^(]*\))/g,ge=/:([^]+)/,_e=/\/\*[^]*?\*\//g;function ve(e){let t={};return e.replace(_e,``).split(he).forEach(e=>{if(e){let n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ye(e){let t=``;if(D(e))t=e;else if(x(e))for(let n=0;n<e.length;n++){let r=ye(e[n]);r&&(t+=r+` `)}else if(k(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function be(e){if(!e)return null;let{class:t,style:n}=e;return t&&!D(t)&&(e.class=ye(t)),n&&(e.style=me(n)),e}var xe=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Se=u(xe);xe+``;function Ce(e){return!!e||e===``}function we(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ee(e[r],t[r]);return n}function Te(e,t){if(e.size!==t.size)return!1;let n=Array.from(t),r=new Uint8Array(n.length);for(let t of e){let e=-1;for(let i=0;i<n.length;i++)if(!r[i]&&Ee(t,n[i])){e=i;break}if(e<0)return!1;r[e]=1}return!0}function Ee(e,t){if(e===t)return!0;let n=w(e),r=w(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=O(e),r=O(t),n||r)return e===t;if(n=x(e),r=x(t),n||r)return n&&r?we(e,t):!1;if(n=k(e),r=k(t),n||r){if(!n||!r)return!1;if(n=S(e),r=S(t),n||r||(n=C(e),r=C(t),n||r))return n&&r?Te(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!Ee(e[n],t[n]))return!1}}return String(e)===String(t)}function De(e,t){return e.findIndex(e=>Ee(e,t))}var Oe=e=>!!(e&&e.__v_isRef===!0),ke=e=>D(e)?e:e==null?``:x(e)||k(e)&&(e.toString===ee||!E(e.toString))?Oe(e)?ke(e.value):JSON.stringify(e,Ae,2):String(e),Ae=(e,t)=>Oe(t)?Ae(e,t.value):S(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[je(t,r)+` =>`]=n,e),{})}:C(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>je(e))}:O(t)?je(t):k(t)&&!x(t)&&!ne(t)?String(t):t,je=(e,t=``)=>O(e)?`Symbol(${e.description??t})`:e;function Me(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var Ne,Pe=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Ne&&(Ne.active?(this.parent=Ne,this.index=(Ne.scopes||(Ne.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=Ne;try{return Ne=this,e()}finally{Ne=t}}}on(){++this._on===1&&(this.prevScope=Ne,Ne=this)}off(){if(this._on>0&&--this._on===0){if(Ne===this)Ne=this.prevScope;else{let e=Ne;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function R(e){return new Pe(e)}function Fe(){return Ne}function Ie(e,t=!1){Ne&&Ne.cleanups.push(e)}var Le,Re=new WeakSet,ze=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ne&&(Ne.active?Ne.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Re.has(this)&&(Re.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ue(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,it(this),Ke(this);let e=Le,t=et;Le=this,et=!0;try{return this.fn()}finally{qe(this),Le=e,et=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Xe(e);this.deps=this.depsTail=void 0,it(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Re.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Je(this)&&this.run()}get dirty(){return Je(this)}},Be=0,Ve,He;function Ue(e,t=!1){if(e.flags|=8,t){e.next=He,He=e;return}e.next=Ve,Ve=e}function We(){Be++}function Ge(){if(--Be>0)return;if(He){let e=He;for(He=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ve;){let t=Ve;for(Ve=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Ke(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function qe(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Xe(r),Ze(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Je(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ye(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ye(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===at)||(e.globalVersion=at,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Je(e))))return;e.flags|=2;let t=e.dep,n=Le,r=et;Le=e,et=!0;try{Ke(e);let n=e.fn(e._value);(t.version===0||se(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Le=n,et=r,qe(e),e.flags&=-3}}function Xe(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Xe(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ze(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Qe(e,t){e.effect instanceof ze&&(e=e.effect.fn);let n=new ze(e);t&&_(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r}function $e(e){e.effect.stop()}var et=!0,tt=[];function nt(){tt.push(et),et=!1}function rt(){let e=tt.pop();et=e===void 0||e}function it(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Le;Le=void 0;try{t()}finally{Le=e}}}var at=0,ot=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},st=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Le||!et||Le===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Le)t=this.activeLink=new ot(Le,this),Le.deps?(t.prevDep=Le.depsTail,Le.depsTail.nextDep=t,Le.depsTail=t):Le.deps=Le.depsTail=t,ct(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Le.depsTail,t.nextDep=void 0,Le.depsTail.nextDep=t,Le.depsTail=t,Le.deps===t&&(Le.deps=e)}return t}trigger(e){this.version++,at++,this.notify(e)}notify(e){We();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ge()}}};function ct(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)ct(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var lt=new WeakMap,ut=Symbol(``),dt=Symbol(``),ft=Symbol(``);function pt(e,t,n){if(et&&Le){let t=lt.get(e);t||lt.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new st),r.map=t,r.key=n),r.track()}}function mt(e,t,n,r,i,a){let o=lt.get(e);if(!o){at++;return}let s=e=>{e&&e.trigger()};if(We(),t===`clear`)o.forEach(s);else{let i=x(e),a=i&&M(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===ft||!O(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(ft)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(ut)),S(e)&&s(o.get(dt)));break;case`delete`:i||(s(o.get(ut)),S(e)&&s(o.get(dt)));break;case`set`:S(e)&&s(o.get(ut))}}Ge()}function ht(e,t){let n=lt.get(e);return n&&n.get(t)}function z(e){let t=an(e);return t===e?t:(pt(t,`iterate`,ft),nn(e)?t:t.map(sn))}function gt(e){return pt(e=an(e),`iterate`,ft),e}function _t(e,t){return tn(e)?cn(en(e)?sn(t):t):sn(t)}var vt={__proto__:null,[Symbol.iterator](){return yt(this,Symbol.iterator,e=>_t(this,e))},concat(...e){return z(this).concat(...e.map(e=>x(e)?z(e):e))},entries(){return yt(this,`entries`,e=>(e[1]=_t(this,e[1]),e))},every(e,t){return xt(this,`every`,e,t,void 0,arguments)},filter(e,t){return xt(this,`filter`,e,t,e=>e.map(e=>_t(this,e)),arguments)},find(e,t){return xt(this,`find`,e,t,e=>_t(this,e),arguments)},findIndex(e,t){return xt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return xt(this,`findLast`,e,t,e=>_t(this,e),arguments)},findLastIndex(e,t){return xt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return xt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return B(this,`includes`,e)},indexOf(...e){return B(this,`indexOf`,e)},join(e){return z(this).join(e)},lastIndexOf(...e){return B(this,`lastIndexOf`,e)},map(e,t){return xt(this,`map`,e,t,void 0,arguments)},pop(){return Ct(this,`pop`)},push(...e){return Ct(this,`push`,e)},reduce(e,...t){return St(this,`reduce`,e,t)},reduceRight(e,...t){return St(this,`reduceRight`,e,t)},shift(){return Ct(this,`shift`)},some(e,t){return xt(this,`some`,e,t,void 0,arguments)},splice(...e){return Ct(this,`splice`,e)},toReversed(){return z(this).toReversed()},toSorted(e){return z(this).toSorted(e)},toSpliced(...e){return z(this).toSpliced(...e)},unshift(...e){return Ct(this,`unshift`,e)},values(){return yt(this,`values`,e=>_t(this,e))}};function yt(e,t,n){let r=gt(e),i=r[t]();return r!==e&&!nn(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var bt=Array.prototype;function xt(e,t,n,r,i,a){let o=gt(e),s=o!==e&&!nn(e),c=o[t];if(c!==bt[t]){let t=c.apply(e,a);return s?sn(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,_t(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function St(e,t,n,r){let i=gt(e),a=i!==e&&!nn(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=_t(e,t)),n.call(this,t,_t(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?_t(e,c):c}function B(e,t,n){let r=an(e);pt(r,`iterate`,ft);let i=r[t](...n);return(i===-1||i===!1)&&rn(n[0])?(n[0]=an(n[0]),r[t](...n)):i}function Ct(e,t,n=[]){nt(),We();let r=an(e)[t].apply(e,n);return Ge(),rt(),r}var wt=u(`__proto__,__v_isRef,__isVue`),Tt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(O));function Et(e){O(e)||(e=String(e));let t=an(this);return pt(t,`has`,e),t.hasOwnProperty(e)}var Dt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?qt:Kt:i?Gt:Wt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=x(e);if(!r){let e;if(a&&(e=vt[t]))return e;if(t===`hasOwnProperty`)return Et}let o=Reflect.get(e,t,ln(e)?e:n);if((O(t)?Tt.has(t):wt(t))||(r||pt(e,`get`,t),i))return o;if(ln(o)){let e=a&&M(t)?o:o.value;return r&&k(e)?Zt(e):e}return k(o)?r?Zt(o):Yt(o):o}},Ot=class extends Dt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=x(e)&&M(t);if(!this._isShallow){let e=tn(i);if(!nn(n)&&!tn(n)&&(i=an(i),n=an(n)),!a&&ln(i)&&!ln(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:b(e,t),s=Reflect.set(e,t,n,ln(e)?e:r);return e===an(r)&&s&&(o?se(n,i)&&mt(e,`set`,t,n,i):mt(e,`add`,t,n)),s}deleteProperty(e,t){let n=b(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&mt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!O(t)||!Tt.has(t))&&pt(e,`has`,t),n}ownKeys(e){return pt(e,`iterate`,x(e)?`length`:ut),Reflect.ownKeys(e)}},kt=class extends Dt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},At=new Ot,jt=new kt,Mt=new Ot(!0),Nt=new kt(!0),Pt=e=>e,Ft=e=>Reflect.getPrototypeOf(e);function It(e,t,n){return function(...r){let i=this.__v_raw,a=an(i),o=S(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Pt:t?cn:sn;return!t&&pt(a,`iterate`,c?dt:ut),_(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Lt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Rt(e,t){let n={get(n){let r=this.__v_raw,i=an(r),a=an(n);e||(se(n,a)&&pt(i,`get`,n),pt(i,`get`,a));let{has:o}=Ft(i),s=t?Pt:e?cn:sn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&pt(an(t),`iterate`,ut),t.size},has(t){let n=this.__v_raw,r=an(n),i=an(t);return e||(se(t,i)&&pt(r,`has`,t),pt(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=an(a),s=t?Pt:e?cn:sn;return!e&&pt(o,`iterate`,ut),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return _(n,e?{add:Lt(`add`),set:Lt(`set`),delete:Lt(`delete`),clear:Lt(`clear`)}:{add(e){let n=an(this),r=Ft(n),i=an(e),a=!t&&!nn(e)&&!tn(e)?i:e;return r.has.call(n,a)||se(e,a)&&r.has.call(n,e)||se(i,a)&&r.has.call(n,i)||(n.add(a),mt(n,`add`,a,a)),this},set(e,n){!t&&!nn(n)&&!tn(n)&&(n=an(n));let r=an(this),{has:i,get:a}=Ft(r),o=i.call(r,e);o||=(e=an(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?se(n,s)&&mt(r,`set`,e,n,s):mt(r,`add`,e,n),this},delete(e){let t=an(this),{has:n,get:r}=Ft(t),i=n.call(t,e);i||=(e=an(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&mt(t,`delete`,e,void 0,a),o},clear(){let e=an(this),t=e.size!==0,n=e.clear();return t&&mt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=It(r,e,t)}),n}function zt(e,t){let n=Rt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(b(n,r)&&r in t?n:t,r,i)}var Bt={get:zt(!1,!1)},Vt={get:zt(!1,!0)},Ht={get:zt(!0,!1)},Ut={get:zt(!0,!0)},Wt=new WeakMap,Gt=new WeakMap,Kt=new WeakMap,qt=new WeakMap;function Jt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Yt(e){return tn(e)?e:$t(e,!1,At,Bt,Wt)}function Xt(e){return $t(e,!1,Mt,Vt,Gt)}function Zt(e){return $t(e,!0,jt,Ht,Kt)}function Qt(e){return $t(e,!0,Nt,Ut,qt)}function $t(e,t,n,r,i){if(!k(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Jt(te(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function en(e){return tn(e)?en(e.__v_raw):!!(e&&e.__v_isReactive)}function tn(e){return!!(e&&e.__v_isReadonly)}function nn(e){return!!(e&&e.__v_isShallow)}function rn(e){return e?!!e.__v_raw:!1}function an(e){let t=e&&e.__v_raw;return t?an(t):e}function on(e){return!b(e,`__v_skip`)&&Object.isExtensible(e)&&ce(e,`__v_skip`,!0),e}var sn=e=>k(e)?Yt(e):e,cn=e=>k(e)?Zt(e):e;function ln(e){return e?e.__v_isRef===!0:!1}function V(e){return dn(e,!1)}function un(e){return dn(e,!0)}function dn(e,t){return ln(e)?e:new fn(e,t)}var fn=class{constructor(e,t){this.dep=new st,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:an(e),this._value=t?e:sn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||nn(e)||tn(e);e=n?e:an(e),se(e,t)&&(this._rawValue=e,this._value=n?e:sn(e),this.dep.trigger())}};function pn(e){e.dep&&e.dep.trigger()}function H(e){return ln(e)?e.value:e}function mn(e){return E(e)?e():H(e)}var hn={get:(e,t,n)=>t===`__v_raw`?e:H(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return ln(i)&&!ln(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function gn(e){return en(e)?e:new Proxy(e,hn)}var _n=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new st,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function vn(e){return new _n(e)}function yn(e){let t=x(e)?Array(e.length):{};for(let n in e)t[n]=Cn(e,n);return t}var bn=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=O(t)?t:String(t),this._raw=an(e);let r=!0,i=e;if(!x(e)||O(this._key)||!M(this._key))do r=!rn(i)||nn(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=H(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&ln(this._raw[this._key])){let t=this._object[this._key];if(ln(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return ht(this._raw,this._key)}},xn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function Sn(e,t,n){return ln(e)?e:E(e)?new xn(e):k(e)&&arguments.length>1?Cn(e,t,n):V(e)}function Cn(e,t,n){return new bn(e,t,n)}var wn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new st(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=at-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Le!==this)return Ue(this,!0),!0}get value(){let e=this.dep.track();return Ye(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Tn(e,t,n=!1){let r,i;return E(e)?r=e:(r=e.get,i=e.set),new wn(r,i,n)}var En={GET:`get`,HAS:`has`,ITERATE:`iterate`},Dn={SET:`set`,ADD:`add`,DELETE:`delete`,CLEAR:`clear`},On={},kn=new WeakMap,An=void 0;function jn(){return An}function Mn(e,t=!1,n=An){if(n){let t=kn.get(n);t||kn.set(n,t=[]),t.push(e)}}function Nn(e,t,n=d){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:nn(e)||i===!1||i===0?Pn(e,1):Pn(e),u,f,m,h,g=!1,_=!1;if(ln(e)?(f=()=>e.value,g=nn(e)):en(e)?(f=()=>l(e),g=!0):x(e)?(_=!0,g=e.some(e=>en(e)||nn(e)),f=()=>e.map(e=>{if(ln(e))return e.value;if(en(e))return l(e);if(E(e))return c?c(e,2):e()})):f=E(e)?t?c?()=>c(e,2):e:()=>{if(m){nt();try{m()}finally{rt()}}let t=An;An=u;try{return c?c(e,3,[h]):e(h)}finally{An=t}}:p,t&&i){let e=f,t=i===!0?1/0:i;f=()=>Pn(e(),t)}let y=Fe(),b=()=>{u.stop(),y&&y.active&&v(y.effects,u)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return b(),n}}let S=_?Array(e.length).fill(On):On,C=e=>{if(!(!(u.flags&1)||!u.dirty&&!e)){if(t){let n=u.run();if(e||i||g||(_?n.some((e,t)=>se(e,S[t])):se(n,S))){m&&m();let e=An;An=u;try{let e=[n,S===On?void 0:_&&S[0]===On?[]:S,h];S=n,c?c(t,3,e):t(...e)}finally{An=e}}}else u.run()}};return s&&s(C),u=new ze(f),u.scheduler=o?()=>o(C,!1):C,h=e=>Mn(e,!1,u),m=u.onStop=()=>{let e=kn.get(u);if(e){if(c)c(e,4);else for(let t of e)t();kn.delete(u)}},t?r?C(!0):S=u.run():o?o(C.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function Pn(e,t=1/0,n){if(t<=0||!k(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ln(e))Pn(e.value,t,n);else if(x(e))for(let r=0;r<e.length;r++)Pn(e[r],t,n);else if(C(e)||S(e))e.forEach(e=>{Pn(e,t,n)});else if(ne(e)){for(let r in e)Pn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Pn(e[r],t,n)}return e}var Fn=[];function In(e){Fn.push(e)}function Ln(){Fn.pop()}function Rn(e,t){}var zn={SETUP_FUNCTION:0,0:`SETUP_FUNCTION`,RENDER_FUNCTION:1,1:`RENDER_FUNCTION`,NATIVE_EVENT_HANDLER:5,5:`NATIVE_EVENT_HANDLER`,COMPONENT_EVENT_HANDLER:6,6:`COMPONENT_EVENT_HANDLER`,VNODE_HOOK:7,7:`VNODE_HOOK`,DIRECTIVE_HOOK:8,8:`DIRECTIVE_HOOK`,TRANSITION_HOOK:9,9:`TRANSITION_HOOK`,APP_ERROR_HANDLER:10,10:`APP_ERROR_HANDLER`,APP_WARN_HANDLER:11,11:`APP_WARN_HANDLER`,FUNCTION_REF:12,12:`FUNCTION_REF`,ASYNC_COMPONENT_LOADER:13,13:`ASYNC_COMPONENT_LOADER`,SCHEDULER:14,14:`SCHEDULER`,COMPONENT_UPDATE:15,15:`COMPONENT_UPDATE`,APP_UNMOUNT_CLEANUP:16,16:`APP_UNMOUNT_CLEANUP`},Bn={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function Vn(e,t,n,r){try{return r?e(...r):e()}catch(e){Un(e,t,n)}}function Hn(e,t,n,r){if(E(e)){let i=Vn(e,t,n,r);return i&&A(i)&&i.catch(e=>{Un(e,t,n)}),i}if(x(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Hn(e[a],t,n,r));return i}}function Un(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||d;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){nt(),Vn(a,null,10,[e,i,o]),rt();return}}Wn(e,n,i,r,o)}function Wn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var Gn=[],Kn=-1,qn=[],Jn=null,Yn=0,Xn=Promise.resolve(),Zn=null;function Qn(e){let t=Zn||Xn;return e?t.then(this?e.bind(this):e):t}function $n(e){let t=Kn+1,n=Gn.length;for(;t<n;){let r=t+n>>>1,i=Gn[r],a=ar(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function er(e){if(!(e.flags&1)){let t=ar(e),n=Gn[Gn.length-1];!n||!(e.flags&2)&&t>=ar(n)?Gn.push(e):Gn.splice($n(t),0,e),e.flags|=1,tr()}}function tr(){Zn||=Xn.then(or)}function nr(e){if(!x(e))Jn&&e.id===-1?Jn.splice(Yn+1,0,e):e.flags&1||(qn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)qn.push(e[t]);tr()}function rr(e,t,n=Kn+1){for(;n<Gn.length;n++){let t=Gn[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;Gn.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function ir(e){if(qn.length){let e=[...new Set(qn)].sort((e,t)=>ar(e)-ar(t));if(qn.length=0,Jn){for(let t=0;t<e.length;t++)Jn.push(e[t]);return}for(Jn=e,Yn=0;Yn<Jn.length;Yn++){let e=Jn[Yn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Jn=null,Yn=0}}var ar=e=>e.id==null?e.flags&2?-1:1/0:e.id;function or(e){try{for(Kn=0;Kn<Gn.length;Kn++){let e=Gn[Kn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Vn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Kn<Gn.length;Kn++){let e=Gn[Kn];e&&(e.flags&=-2)}Kn=-1,Gn.length=0,ir(e),Zn=null,(Gn.length||qn.length)&&or(e)}}var sr,cr=[];function lr(e,t){sr=e,sr?(sr.enabled=!0,cr.forEach(({event:e,args:t})=>sr.emit(e,...t)),cr=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{lr(e,t)}),setTimeout(()=>{sr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,cr=[])},3e3)):cr=[]}var ur=null,dr=null;function fr(e){let t=ur;return ur=e,dr=e&&e.type.__scopeId||null,t}function pr(e){dr=e}function mr(){dr=null}var hr=e=>U;function U(e,t=ur,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&hs(-1);let i=fr(t),a=ds.length,o;try{o=e(...n)}finally{for(let e=ds.length;e>a;e--)ps();fr(i),r._d&&hs(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function gr(e,t){if(ur===null)return e;let n=$s(ur),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=d]=t[e];i&&(E(i)&&(i={mounted:i,updated:i}),i.deep&&Pn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function _r(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(nt(),Hn(c,n,8,[e.el,s,e,t]),rt())}}function vr(e,t){if(Fs){let n=Fs.provides,r=Fs.parent&&Fs.parent.provides;r===n&&(n=Fs.provides=Object.create(r)),n[e]=t}}function yr(e,t,n=!1){let r=Is();if(r||no){let i=no?no._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&E(t)?t.call(r&&r.proxy):t}}function br(){return!!(Is()||no)}var xr=Symbol.for(`v-scx`),Sr=()=>yr(xr);function Cr(e,t){return Dr(e,null,t)}function wr(e,t){return Dr(e,null,{flush:`post`})}function Tr(e,t){return Dr(e,null,{flush:`sync`})}function Er(e,t,n){return Dr(e,t,n)}function Dr(e,t,n=d){let{immediate:r,deep:i,flush:a,once:o}=n,s=_({},n),c=t&&r||!t&&a!==`post`,l;if(Hs){if(a===`sync`){let e=Sr();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=p,e.resume=p,e.pause=p,e}}let u=Fs;s.call=(e,t,n)=>Hn(e,u,t,n);let f=!1;a===`post`?s.scheduler=e=>{Io(e,u&&u.suspense)}:a!==`sync`&&(f=!0,s.scheduler=(e,t)=>{t?e():er(e)}),s.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let m=Nn(e,t,s);return Hs&&(l?l.push(m):c&&m()),m}function Or(e,t,n){let r=this.proxy,i=D(e)?e.includes(`.`)?kr(r,e):()=>r[e]:e.bind(r,r),a;E(t)?a=t:(a=t.handler,n=t);let o=zs(this),s=Dr(i,a.bind(r),n);return o(),s}function kr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Ar=new WeakMap,jr=Symbol(`_vte`),Mr=e=>e.__isTeleport,Nr=e=>e&&(e.disabled||e.disabled===``),Pr=e=>e&&(e.defer||e.defer===``),Fr=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Ir=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Lr=(e,t)=>{let n=e&&e.to;return D(n)?t?t(n):null:n},Rr={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Nr(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Nr(e.props),r=e.target=Lr(e.props,m),a=Ur(r,e,h,p);r&&(o!==`svg`&&Fr(r)?o=`svg`:o!==`mathml`&&Ir(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),Hr(e,!1)))},S=e=>{let t=()=>{if(Ar.get(e)===t){if(Ar.delete(e),Nr(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),Hr(e,!0)}x(e)}};Ar.set(e,t),Io(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Pr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),Hr(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Ar.get(e);if(u){u.flags|=8,Ar.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Nr(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Fr(p)?o=`svg`:(o===`mathml`||Ir(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Uo(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):zr(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=Lr(t.props,m);e&&(t.target=e,zr(t,e,null,l,0))}else g&&zr(t,p,h,l,1);Hr(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Nr(f),m=a||!p,h=Ar.get(e);if(h&&(h.flags|=8,Ar.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:zr,hydrate:Br};function zr(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!Ar.has(e)&&(!d||Nr(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function Br(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=Lr(t.props,c),h=Nr(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||Ur(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||Ur(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),Hr(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var Vr=Rr;function Hr(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function Ur(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[jr]=o,e&&(r(a,e,i),r(o,e,i)),o}var Wr=Symbol(`_leaveCb`),Gr=Symbol(`_enterCb`);function Kr(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Zi(()=>{e.isMounted=!0}),ea(()=>{e.isUnmounting=!0}),e}var qr=[Function,Array],Jr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:qr,onEnter:qr,onAfterEnter:qr,onEnterCancelled:qr,onBeforeLeave:qr,onLeave:qr,onAfterLeave:qr,onLeaveCancelled:qr,onBeforeAppear:qr,onAppear:qr,onAfterAppear:qr,onAppearCancelled:qr},Yr=e=>{let t=e.subTree;return t.component?Yr(t.component):t},Xr={name:`BaseTransition`,props:Jr,setup(e,{slots:t}){let n=Is(),r=Kr();return()=>{let i=t.default&&ii(t.default(),!0),a=i&&i.length?Zr(i):n.subTree?Z():void 0;if(!a)return;let o=an(e),{mode:s}=o;if(r.isLeaving)return ti(a);let c=ni(a);if(!c)return ti(a);let l=ei(c,o,r,n,e=>l=e);c.type!==ls&&ri(c,l);let u=n.subTree&&ni(n.subTree);if(u&&u.type!==ls&&!vs(u,c)&&Yr(n).type!==ls){let e=ei(u,o,r,n);if(ri(u,e),s===`out-in`&&c.type!==ls)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},ti(a);s===`in-out`&&c.type!==ls?e.delayLeave=(e,t,n)=>{let i=$r(r,u);i[String(u.key)]=u,e[Wr]=()=>{t(),e[Wr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function Zr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==ls){t=n;break}}return t}var Qr=Xr;function $r(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function ei(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),S=$r(n,e),C=(e,t)=>{e&&Hn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),x(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted){if(a)r=g||c;else return}t[Wr]&&t[Wr](!0);let i=S[b];i&&vs(e,i)&&i.el[Wr]&&i.el[Wr](),C(r,[t])},enter(t){if(S[b]===e)return;let r=l,i=u,o=d;if(!n.isMounted){if(a)r=_||l,i=v||u,o=y||d;else return}let s=!1;t[Gr]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[Gr]=void 0)};let c=t[Gr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[Gr]&&t[Gr](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[Wr]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[Wr]=void 0,S[i]===e&&delete S[i])};let o=t[Wr].bind(null,!1);S[i]=e,p?w(p,[t,o]):o()},clone(e){let a=ei(e,t,n,r,i);return i&&i(a),a}};return T}function ti(e){if(zi(e))return e=ws(e),e.children=null,e}function ni(e){if(!zi(e))return Mr(e.type)&&e.children?Zr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&E(n.default))return n.default()}}function ri(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;ri(Mr(n.type)&&ni(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ii(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===ss?(o.patchFlag&128&&i++,r=r.concat(ii(o.children,t,s))):(t||o.type!==ls)&&r.push(s==null?o:ws(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function W(e,t){return E(e)?_({name:e.name},t,{setup:e}):e}function ai(){let e=Is();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function oi(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function si(e){let t=Is(),n=un(null);if(t){let r=t.refs===d?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function ci(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var li=new WeakMap;function ui(e,t,n,r,i=!1){if(x(e)){e.forEach((e,a)=>ui(e,t&&(x(t)?t[a]:t),n,r,i));return}if(Ii(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ui(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?$s(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===d?s.refs={}:s.refs,f=s.setupState,p=an(f),h=f===d?m:e=>!ci(u,e)&&b(p,e),g=(e,t)=>!(t&&ci(u,t));if(l!=null&&l!==c){if(di(t),D(l))u[l]=null,h(l)&&(f[l]=null);else if(ln(l)){let e=t;g(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(E(c))Vn(c,s,12,[o,u]);else{let t=D(c),r=ln(c);if(t||r){let s=()=>{if(e.f){let n=t?h(c)?f[c]:u[c]:g(c)||!e.k?c.value:u[e.k];if(i)x(n)&&v(n,a);else if(x(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],h(c)&&(f[c]=u[c]);else{let t=[a];g(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,h(c)&&(f[c]=o)):r&&(g(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),li.delete(e)};t.id=-1,li.set(e,t),Io(t,n)}else di(e),s()}}}function di(e){let t=li.get(e);t&&(t.flags|=8,li.delete(e))}var fi=!1,pi=()=>{fi||=(console.error(`Hydration completed but contains mismatches.`),!0)},mi=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,hi=e=>e.namespaceURI.includes(`MathML`),gi=e=>{if(e.nodeType===1){if(mi(e))return`svg`;if(hi(e))return`mathml`}},_i=e=>e.nodeType===8;function vi(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:s,insert:c,createComment:l}}=e,u=(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),ir(),t._vnode=e;return}d(t.firstChild,e,null,null,null),ir(),t._vnode=e},d=(n,r,s,l,u,h=!1)=>{h||=!!r.dynamicChildren;let b=_i(n)&&n.data===`[`,x=()=>g(n,r,s,l,u,b),{type:S,ref:C,shapeFlag:w,patchFlag:T}=r,E=n.nodeType;r.el=n,T===-2&&(h=!1,r.dynamicChildren=null);let D=null;switch(S){case cs:E===3?(n.data!==r.children&&(pi(),n.data=r.children),D=a(n)):r.children===``?(c(r.el=i(``),o(n),n),D=n):D=x();break;case ls:y(n)?(D=a(n),v(r.el=n.content.firstChild,n,s)):D=E!==8||b?x():a(n);break;case us:if(b&&(n=a(n),E=n.nodeType),E===1||E===3){D=n;let e=!r.children.length;for(let t=0;t<r.staticCount;t++)e&&(r.children+=D.nodeType===1?D.outerHTML:D.data),t===r.staticCount-1&&(r.anchor=D),D=a(D);return b?a(D):D}x();break;case ss:D=b?m(n,r,s,l,u,h):x();break;default:if(w&1)D=(E!==1||r.type.toLowerCase()!==n.tagName.toLowerCase())&&!y(n)?x():f(n,r,s,l,u,h);else if(w&6){r.slotScopeIds=u;let e=o(n);if(D=b?_(n):_i(n)&&n.data===`teleport start`?_(n,n.data,`teleport end`):a(n),t(r,e,null,s,l,gi(e),h),Ii(r)&&!r.component.subTree){let t;b?(t=X(us),t.anchor=D?D.previousSibling:e.lastChild):t=n.nodeType===3?Ts(``):X(`div`),t.el=n,r.component.subTree=t}}else w&64?D=E===8?r.type.hydrate(n,r,s,l,u,h,e,p):x():w&128&&(D=r.type.hydrate(n,r,s,l,gi(o(n)),u,h,e,d))}return C!=null&&ui(C,null,l,r),D},f=(e,t,n,i,a,o)=>{o||=!!t.dynamicChildren;let{type:c,dynamicProps:l,props:u,patchFlag:d,shapeFlag:f,dirs:m,transition:g}=t,_=c===`input`||c===`option`,b=!!l;if(_||b||d!==-1){m&&_r(t,null,n,`created`);let c=!1;if(y(e)){c=Ho(null,g)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(c){let e=r.getAttribute(`class`);e&&(r.$cls=e),g.beforeEnter(r)}v(r,e,n),t.el=e=r}if(f&16&&!(u&&(u.innerHTML||u.textContent))){let r=p(e.firstChild,t,e,n,i,a,o);for(r&&!Ci(e,1)&&pi();r;){let e=r;r=r.nextSibling,s(e)}}else if(f&8){let n=t.children;n[0]===`
|
|
2
|
+
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
|
|
3
|
+
`)&&(Ci(e,0)||pi(),e.textContent=t.children)}if(u){if(_||b||!o||d&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in u)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||h(a)&&!re(a)||a[0]===`.`||t&&!re(a)||l&&l.includes(a)){if(bi(e,a,u[a]))continue;r(e,a,null,u[a],i,n)}}else if(u.onClick)r(e,`onClick`,null,u.onClick,void 0,n);else if(d&4&&en(u.style))for(let e in u.style)u.style[e]}let x;(x=u&&u.onVnodeBeforeMount)&&js(x,n,t),m&&_r(t,null,n,`beforeMount`),((x=u&&u.onVnodeMounted)||m||c)&&is(()=>{x&&js(x,n,t),c&&g.enter(e),m&&_r(t,null,n,`mounted`)},i)}return e.nextSibling},p=(e,t,r,o,s,l,u)=>{u||=!!t.dynamicChildren;let f=t.children,p=f.length,m=!1;for(let t=0;t<p;t++){let h=u?f[t]:f[t]=Ds(f[t]),g=h.type===cs;e?(g&&!u&&t+1<p&&Ds(f[t+1]).type===cs&&(c(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=d(e,h,o,s,l,u)):g&&!h.children?c(h.el=i(``),r):(m||(m=!0,Ci(r,1)||pi()),n(null,h,r,null,o,s,gi(r),l))}return e},m=(e,t,n,r,i,s)=>{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=o(e),f=p(a(e),t,d,n,r,i,s);return f&&_i(f)&&f.data===`]`?a(t.anchor=f):(pi(),c(t.anchor=l(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(Ti(e,t)||pi(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,gi(d),c),r&&(r.vnode.el=t.el,_o(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&_i(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[u,d]}var yi=new Set([`src`,`srcset`,`href`,`poster`]);function bi(e,t,n){return yi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var xi=`data-allow-mismatch`,Si={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Ci(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(xi);)e=e.parentElement;return wi(e&&e.getAttribute(xi),t)}function wi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Si[t])}}function Ti(e,t){return Ci(e.parentElement,1)||Ei(e)||Di(t)}function Ei(e){return e.nodeType===1&&wi(e.getAttribute(xi),1)}function Di({props:e}){let t=e&&e[xi];return typeof t==`string`&&wi(t,1)}var Oi=fe().requestIdleCallback||(e=>setTimeout(e,1)),ki=fe().cancelIdleCallback||(e=>clearTimeout(e)),Ai=(e=1e4)=>t=>{let n=Oi(t,{timeout:e});return()=>ki(n)};function ji(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Mi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(ji(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ni=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Pi=(e=[])=>(t,n)=>{D(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Fi(e,t){if(_i(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(_i(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ii=e=>!!e.type.__asyncLoader;function Li(e){E(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return W({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Fi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Fs;if(oi(e),u)return()=>Ri(u,e);let t=t=>{l=null,Un(t,e,13,!r)};if(s&&e.suspense||Hs)return p().then(t=>()=>Ri(t,e)).catch(e=>(t(e),()=>r?X(r,{error:e}):null));let a=V(!1),c=V(),d=V(!!i),f,m;return ta(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&zi(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Ri(u,e);if(c.value&&r)return X(r,{error:c.value});if(n&&!d.value)return Ri(n,e)}}})}function Ri(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=X(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var zi=e=>e.type.__isKeepAlive,Bi={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=Is(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),Io(()=>{a.isDeactivated=!1,a.a&&L(a.a);let t=e.props&&e.props.onVnodeMounted;t&&js(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;Ko(t.m),Ko(t.a),l(e,f,null,1,s),Io(()=>{t.da&&L(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&js(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){Ki(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=ec(Ii(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!vs(t,o))?p(t):o&&Ki(o),i.delete(e),a.delete(e)}Er(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Vi(e,t)),t&&m(e=>!Vi(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(Jo(n.subTree.type)?Io(()=>{let e=qi(n.subTree);e.component&&i.set(g,e)},n.subTree.suspense):i.set(g,qi(n.subTree)))};return Zi(_),$i(_),ea(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=qi(t);if(e.type===i.type&&e.key===i.key){Ki(i);let e=i.component.da;e&&Io(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!_s(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=qi(r);if(s.type===ls)return o=null,s;let c=s.type,l=ec(Ii(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Vi(u,l))||d&&l&&Vi(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=ws(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&ri(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,Jo(r.type)?r:s}}};function Vi(e,t){return x(e)?e.some(e=>Vi(e,t)):D(e)?e.split(`,`).includes(t):T(e)?(e.lastIndex=0,e.test(t)):!1}function Hi(e,t){Wi(e,`a`,t)}function Ui(e,t){Wi(e,`da`,t)}function Wi(e,t,n=Fs){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Ji(t,r,n),n){let e=n.parent;for(;e&&e.parent;)zi(e.parent.vnode)&&Gi(r,t,n,e),e=e.parent}}function Gi(e,t,n,r){let i=Ji(t,e,r,!0);ta(()=>{v(r[t],i)},n)}function Ki(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function qi(e){return e.shapeFlag&128?e.ssContent:e}function Ji(e,t,n=Fs,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{nt();let i=zs(n),a=Hn(t,n,e,r);return i(),rt(),a};return r?i.unshift(a):i.push(a),a}}var Yi=e=>(t,n=Fs)=>{(!Hs||e===`sp`)&&Ji(e,(...e)=>t(...e),n)},Xi=Yi(`bm`),Zi=Yi(`m`),Qi=Yi(`bu`),$i=Yi(`u`),ea=Yi(`bum`),ta=Yi(`um`),na=Yi(`sp`),ra=Yi(`rtg`),ia=Yi(`rtc`);function aa(e,t=Fs){Ji(`ec`,e,t)}var oa=`components`,sa=`directives`;function ca(e,t){return fa(oa,e,!0,t)||e}var la=Symbol.for(`v-ndc`);function ua(e){return D(e)?fa(oa,e,!1)||e:e||la}function da(e){return fa(sa,e)}function fa(e,t,n=!0,r=!1){let i=ur||Fs;if(i){let n=i.type;if(e===oa){let e=ec(n,!1);if(e&&(e===t||e===N(t)||e===I(N(t))))return n}let a=pa(i[e]||n[e],t)||pa(i.appContext[e],t);return!a&&r?n:a}}function pa(e,t){return e&&(e[t]||e[N(t)]||e[I(N(t))])}function ma(e,t,n,r){let i,a=n&&n[r],o=x(e);if(o||D(e)){let n=o&&en(e),r=!1,s=!1;n&&(r=!nn(e),s=tn(e),e=gt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?cn(sn(e[n])):sn(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(k(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function ha(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(x(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function G(e,t,n,r,i,a){if(n??={},ur.ce||ur.parent&&Ii(ur.parent)&&ur.parent.ce){let e=a!=null&&n.key==null?_({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),K(),J(ss,null,[X(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=ds.length;K();let c;try{let i=o&&ga(o(n)),s=n.key||a||i&&i.key;c=J(ss,{key:(s&&!O(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=ds.length;e>s;e--)ps();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function ga(e){return e.some(e=>!_s(e)||!(e.type===ls||e.type===ss&&!ga(e.children)))?e:null}function _a(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:oe(r)]=e[r];return n}var va=e=>e?Vs(e)?$s(e):va(e.parent):null,ya=_(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>va(e.parent),$root:e=>va(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ua(e),$forceUpdate:e=>e.f||=()=>{er(e.update)},$nextTick:e=>e.n||=Qn.bind(e.proxy),$watch:e=>Or.bind(e)}),ba=(e,t)=>e!==d&&!e.__isScriptSetup&&b(e,t),xa={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(ba(r,t))return o[t]=1,r[t];else if(i!==d&&b(i,t))return o[t]=2,i[t];else if(b(a,t))return o[t]=3,a[t];else if(n!==d&&b(n,t))return o[t]=4,n[t];else Ra&&(o[t]=0)}let l=ya[t],u,f;if(l)return t===`$attrs`&&pt(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==d&&b(n,t))return o[t]=4,n[t];if(f=c.config.globalProperties,b(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return ba(i,t)?(i[t]=n,!0):r!==d&&b(r,t)?(r[t]=n,!0):b(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==d&&s[0]!==`$`&&b(e,s)||ba(t,s)||b(a,s)||b(r,s)||b(ya,s)||b(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?b(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},Sa=_({},xa,{get(e,t){if(t!==Symbol.unscopables)return xa.get(e,t,e)},has(e,t){return t[0]!==`_`&&!pe(t)}});function Ca(){return null}function wa(){return null}function Ta(e){}function Ea(e){}function Da(){return null}function Oa(){}function ka(e,t){return null}function Aa(){return Ma(`useSlots`).slots}function ja(){return Ma(`useAttrs`).attrs}function Ma(e){let t=Is();return t.setupContext||=Qs(t)}function Na(e){return x(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Pa(e,t){let n=Na(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?x(r)||E(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Fa(e,t){return!e||!t?e||t:x(e)&&x(t)?e.concat(t):_({},Na(e),Na(t))}function Ia(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function La(e){let t=Is(),n=Hs,r=e();Bs(),n&&Rs(!1);let i=()=>{zs(t),n&&Rs(!0)},a=()=>{Is()!==t&&t.scope.off(),Bs(),n&&Rs(!1)};return A(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var Ra=!0;function za(e){let t=Ua(e),n=e.proxy,r=e.ctx;Ra=!1,t.beforeCreate&&Va(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:m,updated:h,activated:g,deactivated:_,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:S,render:C,renderTracked:w,renderTriggered:T,errorCaptured:D,serverPrefetch:O,expose:A,inheritAttrs:ee,components:j,directives:te,filters:ne}=t;if(l&&Ba(l,r,null),o)for(let e in o){let t=o[e];E(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);k(t)&&(e.data=Yt(t))}if(Ra=!0,a)for(let e in a){let t=a[e],i=Q({get:E(t)?t.bind(n,n):E(t.get)?t.get.bind(n,n):p,set:!E(t)&&E(t.set)?t.set.bind(n):p});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)Ha(s[e],r,n,e);if(c){let e=E(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{vr(t,e[t])})}u&&Va(u,e,`c`);function M(e,t){x(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(M(Xi,d),M(Zi,f),M(Qi,m),M($i,h),M(Hi,g),M(Ui,_),M(aa,D),M(ia,w),M(ra,T),M(ea,y),M(ta,S),M(na,O),x(A)){if(A.length){let t=e.exposed||={};A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}C&&e.render===p&&(e.render=C),ee!=null&&(e.inheritAttrs=ee),j&&(e.components=j),te&&(e.directives=te),O&&oi(e)}function Ba(e,t,n=p){x(e)&&(e=Ja(e));for(let n in e){let r=e[n],i;i=k(r)?`default`in r?yr(r.from||n,r.default,!0):yr(r.from||n):yr(r),ln(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Va(e,t,n){Hn(x(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ha(e,t,n,r){let i=r.includes(`.`)?kr(n,r):()=>n[r];if(D(e)){let n=t[e];E(n)&&Er(i,n)}else if(E(e))Er(i,e.bind(n));else if(k(e)){if(x(e))e.forEach(e=>Ha(e,t,n,r));else{let r=E(e.handler)?e.handler.bind(n):t[e.handler];E(r)&&Er(i,r,e)}}}function Ua(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Wa(c,e,o,!0)),Wa(c,t,o)),k(t)&&a.set(t,c),c}function Wa(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Wa(e,a,n,!0),i&&i.forEach(t=>Wa(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Ga[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Ga={data:Ka,props:Za,emits:Za,methods:Xa,computed:Xa,beforeCreate:Ya,created:Ya,beforeMount:Ya,mounted:Ya,beforeUpdate:Ya,updated:Ya,beforeDestroy:Ya,beforeUnmount:Ya,destroyed:Ya,unmounted:Ya,activated:Ya,deactivated:Ya,errorCaptured:Ya,serverPrefetch:Ya,components:Xa,directives:Xa,watch:Qa,provide:Ka,inject:qa};function Ka(e,t){return t?e?function(){return _(E(e)?e.call(this,this):e,E(t)?t.call(this,this):t)}:t:e}function qa(e,t){return Xa(Ja(e),Ja(t))}function Ja(e){if(x(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ya(e,t){return e?[...new Set([].concat(e,t))]:t}function Xa(e,t){return e?_(Object.create(null),e,t):t}function Za(e,t){return e?x(e)&&x(t)?[...new Set([...e,...t])]:_(Object.create(null),Na(e),Na(t??{})):t}function Qa(e,t){if(!e)return t;if(!t)return e;let n=_(Object.create(null),e);for(let r in t)n[r]=Ya(e[r],t[r]);return n}function $a(){return{app:null,config:{isNativeTag:m,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var eo=0;function to(e,t){return function(n,r=null){E(n)||(n=_({},n)),r!=null&&!k(r)&&(r=null);let i=$a(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:eo++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:oc,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&E(e.install)?(a.add(e),e.install(c,...t)):E(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||X(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,$s(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Hn(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=no;no=c;try{return e()}finally{no=t}}};return c}}var no=null;function ro(e,t,n=d){let r=Is(),i=N(t),a=F(t),o=io(e,i),s=vn((o,s)=>{let c,l=d,u;return Tr(()=>{let t=e[i];se(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!se(o,c)&&!(l!==d&&se(e,l)))return;let f=r.vnode.props,p=!!(f&&(t in f||i in f||a in f)&&(`onUpdate:${t}`in f||`onUpdate:${i}`in f||`onUpdate:${a}`in f));p||(c=e,s()),r.emit(`update:${t}`,o),se(e,l)&&(se(e,o)&&!se(o,u)||p&&l!==d&&!se(o,c))&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||d:s,done:!1}:{done:!0}}}},s}var io=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${N(t)}Modifiers`]||e[`${F(t)}Modifiers`];function ao(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||d,i=n,a=t.startsWith(`update:`),o=a&&io(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>D(e)?e.trim():e)),o.number&&(i=i.map(le)));let s,c=r[s=oe(t)]||r[s=oe(N(t))];!c&&a&&(c=r[s=oe(F(t))]),c&&Hn(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Hn(l,e,6,i)}}var oo=new WeakMap;function so(e,t,n=!1){let r=n?oo:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!E(e)){let r=e=>{let n=so(e,t,!0);n&&(s=!0,_(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(k(e)&&r.set(e,null),null):(x(a)?a.forEach(e=>o[e]=null):_(o,a),k(e)&&r.set(e,o),o)}function co(e,t){return!e||!h(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),b(e,t[0].toLowerCase()+t.slice(1))||b(e,F(t))||b(e,t))}function lo(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,_=fr(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Ds(l.call(t,e,u,d,p,f,m)),y=s}else{let e=t;v=Ds(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),y=t.props?s:fo(s)}}catch(t){ds.length=0,Un(t,e,1),v=X(ls)}let b=v;if(y&&h!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(g)&&(y=po(y,a)),b=ws(b,y,!1,!0))}return n.dirs&&(b=ws(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ri(Mr(b.type)&&ni(b)||b,n.transition),v=b,fr(_),v}function uo(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(_s(r)){if(r.type!==ls||r.children===`v-if`){if(n)return;n=r}}else return}return n}var fo=e=>{let t;for(let n in e)(n===`class`||n===`style`||h(n))&&((t||={})[n]=e[n]);return t},po=(e,t)=>{let n={};for(let r in e)(!g(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function mo(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?ho(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(go(o,r,n)&&!co(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||ho(r,o,l):!!o;return!1}function ho(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(go(t,e,a)&&!co(n,a))return!0}return!1}function go(e,t,n){let r=e[n],i=t[n];return n===`style`&&k(r)&&k(i)?!Ee(r,i):r!==i}function _o({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var vo={},yo=()=>Object.create(vo),bo=e=>Object.getPrototypeOf(e)===vo;function xo(e,t,n,r=!1){let i={},a=yo();e.propsDefaults=Object.create(null),Co(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Xt(i):e.type.props?i:a,e.attrs=a}function So(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=an(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(co(e.emitsOptions,o))continue;let u=t[o];if(c){if(b(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=N(o);i[t]=wo(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Co(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!b(t,a)&&((r=F(a))===a||!b(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=wo(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!b(t,e))&&(delete a[e],l=!0)}l&&mt(e.attrs,`set`,``)}function Co(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(re(c))continue;let l=t[c],u;i&&b(i,u=N(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:co(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=an(n),r=s||d;for(let o=0;o<a.length;o++){let s=a[o];n[s]=wo(i,t,s,r[s],e,!b(r,s))}}return o}function wo(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=b(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&E(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=zs(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===F(n))&&(r=!0))}return r}var To=new WeakMap;function Eo(e,t,n=!1){let r=n?To:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!E(e)){let r=e=>{c=!0;let[n,r]=Eo(e,t,!0);_(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return k(e)&&r.set(e,f),f;if(x(a))for(let e=0;e<a.length;e++){let t=N(a[e]);Do(t)&&(o[t]=d)}else if(a)for(let e in a){let t=N(e);if(Do(t)){let n=a[e],r=o[t]=x(n)||E(n)?{type:n}:_({},n),i=r.type,c=!1,l=!0;if(x(i))for(let e=0;e<i.length;++e){let t=i[e],n=E(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=E(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||b(r,`default`))&&s.push(t)}}let l=[o,s];return k(e)&&r.set(e,l),l}function Do(e){return e[0]!==`$`&&!re(e)}var Oo=e=>e===`_`||e===`_ctx`||e===`$stable`,ko=e=>x(e)?e.map(Ds):[Ds(e)],Ao=(e,t,n)=>{if(t._n)return t;let r=U((...e)=>ko(t(...e)),n);return r._c=!1,r},jo=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Oo(n))continue;let i=e[n];if(E(i))t[n]=Ao(n,i,r);else if(i!=null){let e=ko(i);t[n]=()=>e}}},Mo=(e,t)=>{let n=ko(t);e.slots.default=()=>n},No=(e,t,n)=>{for(let r in t)(n||!Oo(r))&&(e[r]=t[r])},Po=(e,t,n)=>{let r=e.slots=yo();if(e.vnode.shapeFlag&32){let e=t._;e?(No(r,t,n),n&&ce(r,`_`,e,!0)):jo(t,r)}else t&&Mo(e,t)},Fo=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=d;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:No(i,t,n):(a=!t.$stable,jo(t,i)),o=t}else t&&(Mo(e,t),o={default:1});if(a)for(let e in i)!Oo(e)&&o[e]==null&&delete i[e]},Io=is;function Lo(e){return zo(e)}function Ro(e){return zo(e,vi)}function zo(e,t){let n=fe();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:m,nextSibling:h,setScopeId:g=p,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!vs(e,t)&&(r=ue(e),I(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case cs:y(e,t,n,r);break;case ls:b(e,t,n,r);break;case us:e??x(t,n,r,o);break;case ss:ee(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?j(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,me)}u!=null&&i?ui(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&ui(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),O(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&D(e.children,f,null,i,s,Bo(e,c),l,d),_&&_r(e,null,i,`created`),E(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!re(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&js(p,i,e)}_&&_r(e,null,i,`beforeMount`);let v=Ho(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&Io(()=>{try{p&&js(p,i,e),v&&g.enter(f),_&&_r(e,null,i,`mounted`)}finally{}},s)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||Jo(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;E(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},D=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Os(e[l]):Ds(e[l]);v(null,c,t,n,r,i,a,o,s)}},O=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:f,dirs:p}=t;l|=e.patchFlag&16;let m=e.props||d,h=t.props||d,g;if(n&&Vo(n,!1),(g=h.onVnodeBeforeUpdate)&&js(g,n,t,e),p&&_r(t,e,n,`beforeUpdate`),n&&Vo(n,!0),f&&(!e.dynamicChildren||e.dynamicChildren.length!==f.length)&&(l=0,s=!1,f=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&u(c,``),f?k(e.dynamicChildren,f,c,n,r,Bo(t,i),o):s||ae(e,t,c,null,n,r,Bo(t,i),o,!1),l>0){if(l&16)A(c,m,h,n,i);else if(l&2&&m.class!==h.class&&a(c,`class`,null,h.class,i),l&4&&a(c,`style`,m.style,h.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&f==null&&A(c,m,h,n,i);((g=h.onVnodeUpdated)||p)&&Io(()=>{g&&js(g,n,t,e),p&&_r(t,e,n,`updated`)},r)},k=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===ss||!vs(c,l)||c.shapeFlag&198)?m(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},A=(e,t,n,r,i)=>{if(t!==n){if(t!==d)for(let o in t)!re(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(re(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ee=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),D(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(k(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Uo(e,t,!0)):ae(e,t,n,f,a,o,c,l,u)},j=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):te(t,n,r,i,a,o,c):ne(e,t,c)},te=(e,t,n,r,i,a,o)=>{let s=e.component=Ps(e,r,i);if(zi(e)&&(s.ctx.renderer=me),Us(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,M,o),!e.el){let r=s.subTree=X(ls);b(null,r,t,n),e.placeholder=r.el}}else M(s,e,t,n,i,a,o)},ne=(e,t,n)=>{let r=t.component=e.component;if(mo(e,t,n)){if(r.asyncDep&&!r.asyncResolved){ie(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},M=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Go(e);if(n){t&&(t.el=c.el,ie(e,t,o)),n.asyncDep.then(()=>{Io(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Vo(e,!1),t?(t.el=c.el,ie(e,t,o)):t=c,n&&L(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&js(d,s,t,c),Vo(e,!0);let f=lo(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),ue(p),e,i,a),t.el=f.el,u===null&&_o(e,f.el),r&&Io(r,i),(d=t.props&&t.props.onVnodeUpdated)&&Io(()=>js(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Ii(t);if(Vo(e,!1),l&&L(l),!m&&(o=c&&c.onVnodeBeforeMount)&&js(o,d,t),Vo(e,!0),s&&ge){let t=()=>{e.subTree=lo(e),ge(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=lo(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Io(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Io(()=>js(o,d,e),i)}(t.shapeFlag&256||d&&Ii(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Io(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new ze(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>er(u),Vo(e,!0),l()},ie=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,So(e,t.props,r,n),Fo(e,t.children,n),nt(),rr(e),rt()},ae=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){P(l,f,n,r,i,a,o,s,c);return}if(p&256){N(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&le(l,i,a),f!==l&&u(n,f)):d&16?m&16?P(l,f,n,r,i,a,o,s,c):le(l,i,a,!0):(d&8&&u(n,``),m&16&&D(f,n,r,i,a,o,s,c))},N=(e,t,n,r,i,a,o,s,c)=>{e||=f,t||=f;let l=e.length,u=t.length,d=Math.min(l,u),p;for(p=0;p<d;p++){let r=t[p]=c?Os(t[p]):Ds(t[p]);v(e[p],r,n,null,i,a,o,s,c)}l>u?le(e,i,a,!0,!1,d):D(t,n,r,i,a,o,s,c,d)},P=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,p=u-1;for(;l<=d&&l<=p;){let r=e[l],u=t[l]=c?Os(t[l]):Ds(t[l]);if(vs(r,u))v(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=p;){let r=e[d],l=t[p]=c?Os(t[p]):Ds(t[p]);if(vs(r,l))v(r,l,n,null,i,a,o,s,c);else break;d--,p--}if(l>d){if(l<=p){let e=p+1,d=e<u?t[e].el:r;for(;l<=p;)v(null,t[l]=c?Os(t[l]):Ds(t[l]),n,d,i,a,o,s,c),l++}}else if(l>p)for(;l<=d;)I(e[l],i,a,!0),l++;else{let m=l,h=l,g=new Map;for(l=h;l<=p;l++){let e=t[l]=c?Os(t[l]):Ds(t[l]);e.key!=null&&g.set(e.key,l)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(l=0;l<b;l++)C[l]=0;for(l=m;l<=d;l++){let r=e[l];if(y>=b){I(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&vs(r,t[_])){u=_;break}u===void 0?I(r,i,a,!0):(C[u-h]=l+1,u>=S?S=u:x=!0,v(r,t[u],n,null,i,a,o,s,c),y++)}let w=x?Wo(C):f;for(_=w.length-1,l=b-1;l>=0;l--){let e=h+l,d=t[e],f=t[e+1],p=e+1<u?f.el||qo(f):r;C[l]===0?v(null,d,n,p,i,a,o,s,c):x&&(_<0||l!==w[_]?F(d,n,p,2):_--)}}},F=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){F(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,me);return}if(c===ss){r(s,t,n);for(let e=0;e<u.length;e++)F(u[e],t,n,a);r(e.anchor,t,n);return}if(c===us){S(e,t,n);return}if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[Wr]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),Io(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[Wr];s._isLeaving&&s[Wr](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},I=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(nt(),ui(s,null,n,e,!0),rt()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Ii(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&js(_,t,e),u&6)ce(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&_r(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,me,r):l&&!l.hasOnce&&(a!==ss||d>0&&d&64)?le(l,t,n,!1,!0):(a===ss&&d&384||!i&&u&16)&&le(c,t,n),r&&oe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Io(()=>{_&&js(_,t,e),h&&_r(e,null,t,`unmounted`),v&&(e.el=null)},n)},oe=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===ss){se(n,r);return}if(t===us){C(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},se=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},ce=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Ko(c),Ko(l),r&&L(r),i.stop(),a&&(a.flags|=8,I(o,e,t,n)),s&&Io(s,t),Io(()=>{e.isUnmounted=!0},t)},le=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)I(e[o],t,n,r,i)},ue=e=>{if(e.shapeFlag&6)return ue(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[jr];return n?h(n):t},de=!1,pe=(e,t,n)=>{let r;e==null?t._vnode&&(I(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,de||=(de=!0,rr(r),ir(),!1)},me={p:v,um:I,m:F,r:oe,mt:te,mc:D,pc:ae,pbc:k,n:ue,o:e},he,ge;return t&&([he,ge]=t(me)),{render:pe,hydrate:he,createApp:to(pe,he)}}function Bo({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Vo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ho(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Uo(e,t,n=!1){let r=e.children,i=t.children;if(x(r)&&x(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Os(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Uo(t,a)),a.type===cs&&(a.patchFlag===-1&&(a=i[e]=Os(a)),a.el=t.el),a.type===ls&&!a.el&&(a.el=t.el)}}function Wo(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Go(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Go(t)}function Ko(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function qo(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?qo(t.subTree):null}var Jo=e=>e.__isSuspense,Yo=0,Xo={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)Qo(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}$o(e,t,n,r,i,o,s,c,l)}},hydrate:ts,normalize:ns};function Zo(e,t){let n=e.props&&e.props[t];E(n)&&n()}function Qo(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=es(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(Zo(e,`onPending`),Zo(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),as(f,e.ssFallback)):f.resolve(!1,!0)}function $o(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,vs(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&!_&&!d.isFallbackMountPending&&(c(m,p,n,r,i,null,a,o,s),as(d,p))):(d.pendingId=Yo++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():d.isFallbackMountPending||(c(m,p,n,r,i,null,a,o,s),as(d,p))):m&&vs(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&vs(m,f))c(m,f,n,r,i,d,a,o,s),as(d,f);else if(Zo(t,`onPending`),d.pendingBranch=f,d.pendingId=f.shapeFlag&512?f.component.suspenseId:Yo++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function es(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=os(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?ue(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Yo++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),nr(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&Io(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,as(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){for(let e=0;e<c.length;e++)y.effects.push(c[e]);S=!0;break}y=y.parent}!S&&!g&&nr(c),x.effects=[],v&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!n&&t.resolve()),Zo(r,`onResolve`)},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=x;Zo(t,`onFallback`);let o=m(n),l=()=>{if(x.isFallbackMountPending=!1,!x.isInFallback)return;let e=x.vnode.ssFallback;d(null,e,i,o,r,null,a,s,c),as(x,e)},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{Un(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;Bs(),e.asyncResolved=!0;let{vnode:s}=e;Gs(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),_o(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function ts(e,t,n,r,i,a,o,s,c){let l=t.suspense=es(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function ns(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=rs(r?n.default:n),e.ssFallback=r?rs(n.fallback):X(ls)}function rs(e){let t;if(E(e)){let n=ms&&e._c;n&&(e._d=!1,K()),e=e(),n&&(e._d=!0,t=fs,ps())}return x(e)&&(e=uo(e)),e=Ds(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function is(e,t){t&&t.pendingBranch?x(e)?t.effects.push(...e):t.effects.push(e):nr(e)}function as(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,_o(r,i))}function os(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var ss=Symbol.for(`v-fgt`),cs=Symbol.for(`v-txt`),ls=Symbol.for(`v-cmt`),us=Symbol.for(`v-stc`),ds=[],fs=null;function K(e=!1){ds.push(fs=e?null:[])}function ps(){ds.pop(),fs=ds[ds.length-1]||null}var ms=1;function hs(e,t=!1){ms+=e,e<0&&fs&&t&&(fs.hasOnce=!0)}function gs(e){return e.dynamicChildren=ms>0?fs||f:null,ps(),ms>0&&fs&&fs.push(e),e}function q(e,t,n,r,i,a){return gs(Y(e,t,n,r,i,a,!0))}function J(e,t,n,r,i){return gs(X(e,t,n,r,i,!0))}function _s(e){return e?e.__v_isVNode===!0:!1}function vs(e,t){return e.type===t.type&&e.key===t.key}function ys(e){}var bs=({key:e})=>e??null,xs=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:D(e)||ln(e)||E(e)?{i:ur,r:e,k:t,f:!!n}:e);function Y(e,t=null,n=null,r=0,i=null,a=e===ss?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&bs(t),ref:t&&xs(t),scopeId:dr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:ur};return s?(ks(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=D(n)?8:16),ms>0&&!o&&fs&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&fs.push(c),c}var X=Ss;function Ss(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===la)&&(e=ls),_s(e)){let r=ws(e,t,!0);return n&&ks(r,n),ms>0&&!a&&fs&&(r.shapeFlag&6?fs[fs.indexOf(e)]=r:fs.push(r)),r.patchFlag=-2,r}if(tc(e)&&(e=e.__vccOpts),t){t=Cs(t);let{class:e,style:n}=t;e&&!D(e)&&(t.class=ye(e)),k(n)&&(rn(n)&&!x(n)&&(n=_({},n)),t.style=me(n))}let o=D(e)?1:Jo(e)?128:Mr(e)?64:k(e)?4:E(e)?2:0;return Y(e,t,n,r,i,o,a,!0)}function Cs(e){return e?rn(e)||bo(e)?_({},e):e:null}function ws(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?As(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&bs(l),ref:t&&t.ref?n&&a?x(a)?a.concat(xs(t)):[a,xs(t)]:xs(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ss?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ws(e.ssContent),ssFallback:e.ssFallback&&ws(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&ri(u,c.clone(u)),u}function Ts(e=` `,t=0){return X(cs,null,e,t)}function Es(e,t){let n=X(us,null,e);return n.staticCount=t,n}function Z(e=``,t=!1){return t?(K(),J(ls,null,e)):X(ls,null,e)}function Ds(e){return e==null||typeof e==`boolean`?X(ls):x(e)?X(ss,null,e.slice()):_s(e)?Os(e):X(cs,null,String(e))}function Os(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ws(e)}function ks(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(x(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ks(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!bo(t)?t._ctx=ur:r===3&&ur&&(ur.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(E(t)){if(r&65){ks(e,{default:t});return}t={default:t,_ctx:ur},n=32}else t=String(t),r&64?(n=16,t=[Ts(t)]):n=8;e.children=t,e.shapeFlag|=n}function As(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=ye([t.class,r.class]));else if(e===`style`)t.style=me([t.style,r.style]);else if(h(e)){let n=t[e],i=r[e];i&&n!==i&&!(x(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!g(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function js(e,t,n,r=null){Hn(e,t,7,[n,r])}var Ms=$a(),Ns=0;function Ps(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||Ms,a={uid:Ns++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Pe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Eo(r,i),emitsOptions:so(r,i),emit:null,emitted:null,propsDefaults:d,inheritAttrs:r.inheritAttrs,ctx:d,data:d,props:d,attrs:d,slots:d,refs:d,setupState:d,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=ao.bind(null,a),e.ce&&e.ce(a),a}var Fs=null,Is=()=>Fs||ur,Ls,Rs;{let e=fe(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Ls=t(`__VUE_INSTANCE_SETTERS__`,e=>Fs=e),Rs=t(`__VUE_SSR_SETTERS__`,e=>Hs=e)}var zs=e=>{let t=Fs;return Ls(e),e.scope.on(),()=>{e.scope.off(),Ls(t)}},Bs=()=>{Fs&&Fs.scope.off(),Ls(null)};function Vs(e){return e.vnode.shapeFlag&4}var Hs=!1;function Us(e,t=!1,n=!1){t&&Rs(t);let{props:r,children:i}=e.vnode,a=Vs(e);xo(e,r,a,t),Po(e,i,n||t);let o=a?Ws(e,t):void 0;return t&&Rs(!1),o}function Ws(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,xa);let{setup:r}=n;if(r){nt();let n=e.setupContext=r.length>1?Qs(e):null,i=zs(e),a=Vn(r,e,0,[e.props,n]),o=A(a);if(rt(),i(),(o||e.sp)&&!Ii(e)&&oi(e),o){if(a.then(Bs,Bs),t)return a.then(n=>{Rs(!0);try{Gs(e,n,t)}finally{Rs(!1)}}).catch(t=>{Un(t,e,0)});e.asyncDep=a}else Gs(e,a,t)}else Xs(e,t)}function Gs(e,t,n){E(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:k(t)&&(e.setupState=gn(t)),Xs(e,n)}var Ks,qs;function Js(e){Ks=e,qs=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,Sa))}}var Ys=()=>!Ks;function Xs(e,t,n){let r=e.type;if(!e.render){if(!t&&Ks&&!r.render){let t=r.template||Ua(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r,s=_(_({isCustomElement:n,delimiters:a},i),o);r.render=Ks(t,s)}}e.render=r.render||p,qs&&qs(e)}{let t=zs(e);nt();try{za(e)}finally{rt(),t()}}}var Zs={get(e,t){return pt(e,`get`,``),e[t]}};function Qs(e){return{attrs:new Proxy(e.attrs,Zs),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function $s(e){return e.exposed?e.exposeProxy||=new Proxy(gn(on(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ya)return ya[n](e)},has(e,t){return t in e||t in ya}}):e.proxy}function ec(e,t=!0){return E(e)?e.displayName||e.name:e.name||t&&e.__name}function tc(e){return E(e)&&`__vccOpts`in e}var Q=(e,t)=>Tn(e,t,Hs);function nc(e,t,n){try{hs(-1);let r=arguments.length;return r===2?k(t)&&!x(t)?_s(t)?X(e,null,[t]):X(e,t):X(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&_s(n)&&(n=[n]),X(e,t,n))}finally{hs(1)}}function rc(){}function ic(e,t,n,r){let i=n[r];if(i&&ac(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function ac(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(se(n[e],t[e]))return!1;return ms>0&&fs&&fs.push(e),!0}var oc=`3.5.42`,sc=p,cc=Bn,lc=sr,uc=lr,dc={createComponentInstance:Ps,setupComponent:Us,renderComponentRoot:lo,setCurrentRenderingInstance:fr,isVNode:_s,normalizeVNode:Ds,getComponentPublicInstance:$s,ensureValidVNode:ga,pushWarningContext:In,popWarningContext:Ln},fc=void 0,pc=typeof window<`u`&&window.trustedTypes;if(pc)try{fc=pc.createPolicy(`vue`,{createHTML:e=>e})}catch{}var mc=fc?e=>fc.createHTML(e):e=>e,hc=`http://www.w3.org/2000/svg`,gc=`http://www.w3.org/1998/Math/MathML`,_c=typeof document<`u`?document:null,vc=_c&&_c.createElement(`template`),yc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?_c.createElementNS(hc,e):t===`mathml`?_c.createElementNS(gc,e):n?_c.createElement(e,{is:n}):_c.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>_c.createTextNode(e),createComment:e=>_c.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>_c.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{vc.innerHTML=mc(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=vc.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},bc=`transition`,xc=`animation`,Sc=Symbol(`_vtc`),Cc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},wc=_({},Jr,Cc),Tc=(e=>(e.displayName=`Transition`,e.props=wc,e))((e,{slots:t})=>nc(Qr,Oc(e),t)),Ec=(e,t=[])=>{x(e)?e.forEach(e=>e(...t)):e&&e(...t)},Dc=e=>e?x(e)?e.some(e=>e.length>1):e.length>1:!1;function Oc(e){let t={};for(let n in e)n in Cc||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=kc(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,Mc(e,t?u:s),Mc(e,t?l:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,Mc(e,d),Mc(e,p),Mc(e,f),t&&t()},O=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);Ec(i,[t,o]),Nc(()=>{Mc(t,e?c:a),jc(t,e?u:s),Dc(i)||Fc(t,r,h,o)})};return _(t,{onBeforeEnter(e){Ec(v,[e]),jc(e,a),jc(e,o)},onBeforeAppear(e){Ec(C,[e]),jc(e,c),jc(e,l)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);jc(e,d),e._enterCancelled?(jc(e,f),zc(e)):(zc(e),jc(e,f)),Nc(()=>{e._isLeaving&&(Mc(e,d),jc(e,p),Dc(x)||Fc(e,r,g,n))}),Ec(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),Ec(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),Ec(T,[e])},onLeaveCancelled(e){D(e),Ec(S,[e])}})}function kc(e){if(e==null)return null;if(k(e))return[Ac(e.enter),Ac(e.leave)];{let t=Ac(e);return[t,t]}}function Ac(e){return ue(e)}function jc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Sc]||(e[Sc]=new Set)).add(t)}function Mc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Sc];n&&(n.delete(t),n.size||(e[Sc]=void 0))}function Nc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Pc=0;function Fc(e,t,n,r){let i=e._endId=++Pc,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Ic(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Ic(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${bc}Delay`),a=r(`${bc}Duration`),o=Lc(i,a),s=r(`${xc}Delay`),c=r(`${xc}Duration`),l=Lc(s,c),u=null,d=0,f=0;t===bc?o>0&&(u=bc,d=o,f=a.length):t===xc?l>0&&(u=xc,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?bc:xc:null,f=u?u===bc?a.length:c.length:0);let p=u===bc&&/\b(?:transform|all)(?:,|$)/.test(r(`${bc}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Lc(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Rc(t)+Rc(e[n])))}function Rc(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function zc(e){return(e?e.ownerDocument:document).body.offsetHeight}function Bc(e,t,n){let r=e[Sc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Vc=Symbol(`_vod`),Hc=Symbol(`_vsh`),Uc={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Vc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Wc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Wc(e,!0),r.enter(e)):r.leave(e,()=>{Wc(e,!1)}):Wc(e,t))},beforeUnmount(e,{value:t}){Wc(e,t)}};function Wc(e,t){e.style.display=t?e[Vc]:`none`,e[Hc]=!t}function Gc(){Uc.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}var Kc=Symbol(``);function qc(e){let t=Is();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Yc(e,n))},r=()=>{let r=e(t.proxy);t.ce?Yc(t.ce,r):Jc(t.subTree,r),n(r)};Qi(()=>{nr(r)}),Zi(()=>{Er(r,p,{flush:`post`});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),ta(()=>e.disconnect())})}function Jc(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Jc(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Yc(e.el,t);else if(e.type===ss)e.children.forEach(e=>Jc(e,t));else if(e.type===us){let{el:n,anchor:r}=e;for(;n&&(Yc(n,t),n!==r);)n=n.nextSibling}}function Yc(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=Me(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[Kc]=r}}var Xc=/(?:^|;)\s*display\s*:/;function Zc(e,t,n){let r=e.style,i=D(n),a=!1;if(n&&!i){if(t){if(D(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??$c(r,t,``)}else for(let e in t)n[e]??$c(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?$c(r,i,``):rl(e,i,!D(t)&&t?t[i]:void 0,o)||$c(r,i,o)}}else if(i){if(t!==n){let e=r[Kc];e&&(n+=`;`+e),r.cssText=n,a=Xc.test(n)}}else t&&e.removeAttribute(`style`);Vc in e&&(e[Vc]=a?r.display:``,e[Hc]&&(r.display=`none`))}var Qc=/\s*!important$/;function $c(e,t,n){if(x(n))n.forEach(n=>$c(e,t,n));else if(n??=``,t.startsWith(`--`))Qc.test(n)?e.setProperty(t,n.replace(Qc,``),`important`):e.setProperty(t,n);else{let r=nl(e,t);Qc.test(n)?e.setProperty(F(r),n.replace(Qc,``),`important`):e[r]=n}}var el=[`Webkit`,`Moz`,`ms`],tl={};function nl(e,t){let n=tl[t];if(n)return n;let r=N(t);if(r!==`filter`&&r in e)return tl[t]=r;r=I(r);for(let n=0;n<el.length;n++){let i=el[n]+r;if(i in e)return tl[t]=i}return t}function rl(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&D(r)&&n===r}var il=`http://www.w3.org/1999/xlink`;function al(e,t,n,r,i,a=Se(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(il,t.slice(6,t.length)):e.setAttributeNS(il,t,n):n==null||a&&!Ce(n)?e.removeAttribute(t):e.setAttribute(t,a?``:O(n)?String(n):n)}function ol(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?mc(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Ce(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function sl(e,t,n,r){e.addEventListener(t,n,r)}function cl(e,t,n,r){e.removeEventListener(t,n,r)}var ll=Symbol(`_vei`);function ul(e,t,n,r,i=null){let a=e[ll]||(e[ll]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=pl(t);r?sl(e,n,a[t]=_l(r,i),s):o&&(cl(e,n,o,s),a[t]=void 0)}}var dl=/(Once|Passive|Capture)$/,fl=/^on:?(?:Once|Passive|Capture)$/;function pl(e){let t,n;for(;(n=e.match(dl))&&!fl.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):F(e.slice(2)),t]}var ml=0,hl=Promise.resolve(),gl=()=>ml||=(hl.then(()=>ml=0),Date.now());function _l(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(x(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Hn(e,t,5,a)}}else Hn(r,t,5,[e])};return n.value=e,n.attached=gl(),n}var vl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,yl=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Bc(e,r,o):t===`style`?Zc(e,n,r):h(t)?g(t)||ul(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):bl(e,t,r,o))?(ol(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&al(e,t,r,o,a,t!==`value`)):e._isVueCE&&(xl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!D(r)))?ol(e,N(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),al(e,t,r,o))};function bl(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&vl(t)&&E(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return vl(t)&&D(n)?!1:t in e}function xl(e,t){let n=e._def.props;if(!n)return!1;let r=N(t);return Array.isArray(n)?n.some(e=>N(e)===r):Object.keys(n).some(e=>N(e)===r)}var Sl={};function Cl(e,t,n){let r=W(e,t);ne(r)&&(r=_({},r,t));class i extends El{constructor(e){super(r,e,n)}}return i.def=r,i}var wl=((e,t)=>Cl(e,t,vu)),Tl=typeof HTMLElement<`u`?HTMLElement:class{},El=class e extends Tl{constructor(e,t={},n=_u){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==_u?this._root=this.shadowRoot:e.shadowRoot===!1?this._root=this:(this.attachShadow(_({},e.shadowRootOptions,{mode:`open`})),this._root=this.shadowRoot)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t&&=t.assignedSlot||t.parentNode||t.host;)if(t instanceof e){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,Qn(()=>{this._connected||(this._ob&&=(this._ob.disconnect(),null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&=(this._teleportTargets.clear(),void 0))})}_processMutations(e){for(let t of e)this._setAttr(t.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let e=0;e<this.attributes.length;e++)this._setAttr(this.attributes[e].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{this._resolved=!0,this._pendingResolve=void 0;let{props:n,styles:r}=e,i;if(n&&!x(n))for(let e in n){let t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=ue(this._props[e])),(i||=Object.create(null))[N(e)]=!0)}this._numberProps=i,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;if(t)return this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}),this._pendingResolve;e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)b(this,e)||Object.defineProperty(this,e,{get:()=>H(t[e])})}_resolveProps(e){let{props:t}=e,n=x(t)?t:Object.keys(t||{});for(let e of Object.keys(this))e[0]!==`_`&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(N))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!this._patching)}})}_setAttr(e){if(e.startsWith(`data-v-`))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):Sl,r=N(e);t&&this._numberProps&&this._numberProps[r]&&(n=ue(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(this._dirty=!0,t===Sl?delete this._props[e]:(this._props[e]=t,e===`key`&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&(this._processMutations(n.takeRecords()),n.disconnect()),t===!0?this.setAttribute(F(e),``):typeof t==`string`||typeof t==`number`?this.setAttribute(F(e),t+``):t||this.removeAttribute(F(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),hu(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=X(this._def,_(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,ne(t[0])?_({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),F(e)!==e&&t(F(e),n)},this._setParent()}),t}_applyStyles(e,t,n){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let r=this._nonce,i=this.shadowRoot,a=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i),o=null;for(let s=e.length-1;s>=0;s--){let c=document.createElement(`style`);r&&c.setAttribute(`nonce`,r),c.textContent=e[s],i.insertBefore(c,o||a),o=c,s===0&&(n||this._styleAnchors.set(this._def,c),t&&this._styleAnchors.set(t,c))}}_getStyleAnchor(e){if(!e)return null;let t=this._styleAnchors.get(e);return t&&t.parentNode===this.shadowRoot?t:(t&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];if(!(n instanceof HTMLStyleElement))return n}return null}_parseSlots(){let e=this._slots={},t;for(;t=this.firstChild;){let n=t.nodeType===1&&t.getAttribute(`slot`)||`default`;(e[n]||(e[n]=[])).push(t),this.removeChild(t)}}_renderSlots(){let e=this._getSlots(),t=this._instance.type.__scopeId;for(let n=0;n<e.length;n++){let r=e[n],i=r.getAttribute(`name`)||`default`,a=this._slots[i],o=r.parentNode;if(a)for(let e of a){if(t&&e.nodeType===1){let n=t+`-s`,r=document.createTreeWalker(e,1);e.setAttribute(n,``);let i;for(;i=r.nextNode();)i.setAttribute(n,``)}o.insertBefore(e,r)}else for(;r.firstChild;)o.insertBefore(r.firstChild,r);o.removeChild(r)}}_getSlots(){let e=[this];this._teleportTargets&&e.push(...this._teleportTargets);let t=new Set;for(let n of e){let e=n.querySelectorAll(`slot`);for(let n=0;n<e.length;n++)t.add(e[n])}return Array.from(t)}_injectChildStyle(e,t){this._applyStyles(e.styles,e,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(e){}};function Dl(e){let t=Is();return t&&t.ce||null}function Ol(){let e=Dl();return e&&e.shadowRoot}function kl(e=`$style`){{let t=Is();if(!t)return d;let n=t.type.__cssModules;return n&&n[e]||d}}var Al=new WeakMap,jl=new WeakMap,Ml=Symbol(`_moveCb`),Nl=Symbol(`_enterCb`),Pl=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:_({},wc,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Is(),r=Kr(),i,a;return $i(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!zl(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(Fl),i.forEach(Il);let r=i.filter(Ll);zc(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;jc(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[Ml]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[Ml]=null,Mc(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=an(e),s=Oc(o),c=o.tag||ss;if(i=[],a)for(let e=0;e<a.length;e++){let t=a[e];t.el&&t.el instanceof Element&&!t.el[Hc]&&(i.push(t),ri(t,ei(t,s,r,n)),Al.set(t,Rl(t.el)))}a=t.default?ii(t.default()):[];for(let e=0;e<a.length;e++){let t=a[e];t.key!=null&&ri(t,ei(t,s,r,n))}return X(c,null,a)}}});function Fl(e){let t=e.el;t[Ml]&&t[Ml](),t[Nl]&&t[Nl]()}function Il(e){jl.set(e,Rl(e.el))}function Ll(e){let t=Al.get(e),n=jl.get(e),r=t.left-n.left,i=t.top-n.top;if(r||i){let t=e.el,n=t.style,a=t.getBoundingClientRect(),o=1,s=1;return t.offsetWidth&&(o=a.width/t.offsetWidth),t.offsetHeight&&(s=a.height/t.offsetHeight),(!Number.isFinite(o)||o===0)&&(o=1),(!Number.isFinite(s)||s===0)&&(s=1),Math.abs(o-1)<.01&&(o=1),Math.abs(s-1)<.01&&(s=1),n.transform=n.webkitTransform=`translate(${r/o}px,${i/s}px)`,n.transitionDuration=`0s`,e}}function Rl(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function zl(e,t,n){let r=e.cloneNode(),i=e[Sc];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Ic(r);return a.removeChild(r),o}var Bl=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return x(t)?e=>L(t,e):t};function Vl(e){e.target.composing=!0}function Hl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Ul=Symbol(`_assign`),Wl=Symbol(`_initialValue`);function Gl(e,t,n){return t&&(e=e.trim()),n&&(e=le(e)),e}var Kl={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Wl]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Wl]=e.defaultValue.replace(/\r\n?/g,`
|
|
4
|
+
`))),e[Ul]=Bl(i);let a=r||i.props&&i.props.type===`number`;sl(e,t?`change`:`input`,t=>{t.target.composing||e[Ul](Gl(e.value,n,a))}),(n||a)&&sl(e,`change`,()=>{e.value=Gl(e.value,n,a)}),t||(sl(e,`compositionstart`,Vl),sl(e,`compositionend`,Hl),sl(e,`change`,Hl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Wl];delete e[Wl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Ul](Gl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Ul]=Bl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?le(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ql={deep:!0,created(e,t,n){e[Ul]=Bl(n),sl(e,`change`,()=>{let t=e._modelValue,n=$l(e),r=e.checked,i=e[Ul];if(x(t)){let e=De(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(C(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(eu(e,r))})},mounted:Jl,beforeUpdate(e,t,n){e[Ul]=Bl(n),Jl(e,t,n)}};function Jl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(x(t))i=De(t,r.props.value)>-1;else if(C(t))i=t.has(r.props.value);else{if(t===n)return;i=Ee(t,eu(e,!0))}e.checked!==i&&(e.checked=i)}var Yl={created(e,{value:t},n){e.checked=Ee(t,n.props.value),e[Ul]=Bl(n),sl(e,`change`,()=>{e[Ul]($l(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Ul]=Bl(r),t!==n&&(e.checked=Ee(t,r.props.value))}},Xl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,sl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?le($l(e)):$l(e)),r=e.multiple,i=r?C(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?x(i)?t.slice():t:i];try{e[Ul](i)}finally{Qn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Ul]=Bl(r)},mounted(e,{value:t}){Ql(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ul]=Bl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Zl(t,n[1],n[0]))&&Ql(e,t)}};function Zl(e,t,n){if(!n||x(e))return Ee(e,t);if(C(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Ql(e,t){let n=e.multiple,r=x(t);if(!(n&&!r&&!C(t))){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=$l(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):De(t,o)>-1}else a.selected=t.has(o)}else if(Ee($l(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function $l(e){return`_value`in e?e._value:e.value}function eu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var tu={created(e,t,n){ru(e,t,n,null,`created`)},mounted(e,t,n){ru(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ru(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ru(e,t,n,r,`updated`)}};function nu(e,t){switch(e){case`SELECT`:return Xl;case`TEXTAREA`:return Kl;default:switch(t){case`checkbox`:return ql;case`radio`:return Yl;default:return Kl}}}function ru(e,t,n,r,i){let a=nu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function iu(){Kl.getSSRProps=({value:e})=>({value:e}),Yl.getSSRProps=({value:e},t)=>{if(t.props&&Ee(t.props.value,e))return{checked:!0}},ql.getSSRProps=({value:e},t)=>{if(x(e)){if(t.props&&De(e,t.props.value)>-1)return{checked:!0}}else if(C(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},tu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=nu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var au=[`ctrl`,`shift`,`alt`,`meta`],ou={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>au.some(n=>e[`${n}Key`]&&!t.includes(n))},su=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=ou[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},cu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},lu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=F(n.key);if(t.some(e=>e===r||cu[e]===r))return e(n)}))},uu=_({patchProp:yl},yc),du,fu=!1;function pu(){return du||=Lo(uu)}function mu(){return du=fu?du:Ro(uu),fu=!0,du}var hu=((...e)=>{pu().render(...e)}),gu=((...e)=>{mu().hydrate(...e)}),_u=((...e)=>{let t=pu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=bu(e);if(!r)return;let i=t._component;!E(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,yu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),vu=((...e)=>{let t=mu().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=bu(e);if(t)return n(t,!0,yu(t))},t});function yu(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function bu(e){return D(e)?document.querySelector(e):e}var xu=!1,Su=()=>{xu||(xu=!0,iu(),Gc())},Cu=s({BaseTransition:()=>Qr,BaseTransitionPropsValidators:()=>Jr,Comment:()=>ls,DeprecationTypes:()=>null,EffectScope:()=>Pe,ErrorCodes:()=>zn,ErrorTypeStrings:()=>cc,Fragment:()=>ss,KeepAlive:()=>Bi,ReactiveEffect:()=>ze,Static:()=>us,Suspense:()=>Xo,Teleport:()=>Vr,Text:()=>cs,TrackOpTypes:()=>En,Transition:()=>Tc,TransitionGroup:()=>Pl,TriggerOpTypes:()=>Dn,VueElement:()=>El,assertNumber:()=>Rn,callWithAsyncErrorHandling:()=>Hn,callWithErrorHandling:()=>Vn,camelize:()=>N,capitalize:()=>I,cloneVNode:()=>ws,compatUtils:()=>null,compile:()=>wu,computed:()=>Q,createApp:()=>_u,createBlock:()=>J,createCommentVNode:()=>Z,createElementBlock:()=>q,createElementVNode:()=>Y,createHydrationRenderer:()=>Ro,createPropsRestProxy:()=>Ia,createRenderer:()=>Lo,createSSRApp:()=>vu,createSlots:()=>ha,createStaticVNode:()=>Es,createTextVNode:()=>Ts,createVNode:()=>X,customRef:()=>vn,defineAsyncComponent:()=>Li,defineComponent:()=>W,defineCustomElement:()=>Cl,defineEmits:()=>wa,defineExpose:()=>Ta,defineModel:()=>Oa,defineOptions:()=>Ea,defineProps:()=>Ca,defineSSRCustomElement:()=>wl,defineSlots:()=>Da,devtools:()=>lc,effect:()=>Qe,effectScope:()=>R,getCurrentInstance:()=>Is,getCurrentScope:()=>Fe,getCurrentWatcher:()=>jn,getTransitionRawChildren:()=>ii,guardReactiveProps:()=>Cs,h:()=>nc,handleError:()=>Un,hasInjectionContext:()=>br,hydrate:()=>gu,hydrateOnIdle:()=>Ai,hydrateOnInteraction:()=>Pi,hydrateOnMediaQuery:()=>Ni,hydrateOnVisible:()=>Mi,initCustomFormatter:()=>rc,initDirectivesForSSR:()=>Su,inject:()=>yr,isMemoSame:()=>ac,isProxy:()=>rn,isReactive:()=>en,isReadonly:()=>tn,isRef:()=>ln,isRuntimeOnly:()=>Ys,isShallow:()=>nn,isVNode:()=>_s,markRaw:()=>on,mergeDefaults:()=>Pa,mergeModels:()=>Fa,mergeProps:()=>As,nextTick:()=>Qn,nodeOps:()=>yc,normalizeClass:()=>ye,normalizeProps:()=>be,normalizeStyle:()=>me,onActivated:()=>Hi,onBeforeMount:()=>Xi,onBeforeUnmount:()=>ea,onBeforeUpdate:()=>Qi,onDeactivated:()=>Ui,onErrorCaptured:()=>aa,onMounted:()=>Zi,onRenderTracked:()=>ia,onRenderTriggered:()=>ra,onScopeDispose:()=>Ie,onServerPrefetch:()=>na,onUnmounted:()=>ta,onUpdated:()=>$i,onWatcherCleanup:()=>Mn,openBlock:()=>K,patchProp:()=>yl,popScopeId:()=>mr,provide:()=>vr,proxyRefs:()=>gn,pushScopeId:()=>pr,queuePostFlushCb:()=>nr,reactive:()=>Yt,readonly:()=>Zt,ref:()=>V,registerRuntimeCompiler:()=>Js,render:()=>hu,renderList:()=>ma,renderSlot:()=>G,resolveComponent:()=>ca,resolveDirective:()=>da,resolveDynamicComponent:()=>ua,resolveFilter:()=>null,resolveTransitionHooks:()=>ei,setBlockTracking:()=>hs,setDevtoolsHook:()=>uc,setTransitionHooks:()=>ri,shallowReactive:()=>Xt,shallowReadonly:()=>Qt,shallowRef:()=>un,ssrContextKey:()=>xr,ssrUtils:()=>dc,stop:()=>$e,toDisplayString:()=>ke,toHandlerKey:()=>oe,toHandlers:()=>_a,toRaw:()=>an,toRef:()=>Sn,toRefs:()=>yn,toValue:()=>mn,transformVNodeArgs:()=>ys,triggerRef:()=>pn,unref:()=>H,useAttrs:()=>ja,useCssModule:()=>kl,useCssVars:()=>qc,useHost:()=>Dl,useId:()=>ai,useModel:()=>ro,useSSRContext:()=>Sr,useShadowRoot:()=>Ol,useSlots:()=>Aa,useTemplateRef:()=>si,useTransitionState:()=>Kr,vModelCheckbox:()=>ql,vModelDynamic:()=>tu,vModelRadio:()=>Yl,vModelSelect:()=>Xl,vModelText:()=>Kl,vShow:()=>Uc,version:()=>oc,warn:()=>sc,watch:()=>Er,watchEffect:()=>Cr,watchPostEffect:()=>wr,watchSyncEffect:()=>Tr,withAsyncContext:()=>La,withCtx:()=>U,withDefaults:()=>ka,withDirectives:()=>gr,withKeys:()=>lu,withMemo:()=>ic,withModifiers:()=>su,withScopeId:()=>hr}),wu=()=>{};function Tu(e,t){return Fe()?(Ie(e,t),!0):!1}function Eu(e){let t=!1,n,r=R(!0);return((...i)=>(t||=(n=r.run(()=>e(...i)),!0),n))}var Du=new WeakMap,Ou=(...e)=>{let t=e[0],n=Is()?.proxy??Fe();if(n==null&&!br())throw Error(`injectLocal must be called in setup`);return n&&Du.has(n)&&t in Du.get(n)?Du.get(n)[t]:yr(...e)},ku=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Au=e=>e!==void 0,ju=Object.prototype.toString,Mu=e=>ju.call(e)===`[object Object]`,Nu=()=>{},Pu=Fu();function Fu(){var e,t;return ku&&!!((e=window)!=null&&(e=e.navigator)!=null&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Iu(...e){if(e.length!==1)return Sn(...e);let t=e[0];return typeof t==`function`?Zt(vn(()=>({get:t,set:Nu}))):V(t)}function Lu(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return`cancel`in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}var Ru=e=>e();function zu(e=Ru,t={}){let{initialState:n=`active`}=t,r=Iu(n===`active`);function i(){r.value=!1}function a(){r.value=!0}return{isActive:Qt(r),pause:i,resume:a,eventFilter:(...t)=>{r.value&&e(...t)}}}function Bu(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function Vu(e){return Array.isArray(e)?e:[e]}function Hu(e){return e||Is()}function Uu(e){if(!ku)return e;let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return((...a)=>(t+=1,r||(r=R(!0),n=r.run(()=>e(...a))),Tu(i),n))}function Wu(e,t=1e4){return vn((n,r)=>{let i=mn(e),a,o=()=>setTimeout(()=>{i=mn(e),r()},mn(t));return Tu(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function Gu(e,t,n={}){let{eventFilter:r=Ru,...i}=n;return Er(e,Lu(r,t),i)}function Ku(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=zu(r,{initialState:i});return{stop:Gu(e,t,{...a,eventFilter:o}),pause:s,resume:c,isActive:l}}function qu(e,t){Hu(t)&&ea(e,t)}function Ju(e,t=!0,n){Hu(n)?Zi(e,n):t?e():Qn(e)}function Yu(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=null,o=un(!1);function s(){a&&=(clearInterval(a),null)}function c(){o.value=!1,s()}function l(){let n=mn(t);n<=0||(o.value=!0,i&&e(),s(),o.value&&(a=setInterval(e,n)))}return r&&ku&&l(),(ln(t)||typeof t==`function`)&&Tu(Er(t,()=>{o.value&&ku&&l()})),Tu(c),{isActive:Qt(o),pause:c,resume:l}}function Xu(e,t,n){return Er(e,t,{...n,immediate:!0})}var Zu=ku?window:void 0;ku&&window.document,ku&&window.navigator,ku&&window.location;function Qu(e){let t=mn(e);return t?.$el??t}function $u(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=Q(()=>{let t=Vu(mn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return Xu(()=>[n.value?.map(e=>Qu(e))??[Zu].filter(e=>e!=null),Vu(mn(n.value?e[1]:e[0])),Vu(H(n.value?e[2]:e[1])),mn(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=Mu(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function ed(){let e=un(!1),t=Is();return t&&Zi(()=>{e.value=!0},t),e}function td(e){let t=ed();return Q(()=>(t.value,!!e()))}function nd(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function rd(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=Zu,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=nd(t);return $u(i,a,e=>{e.repeat&&mn(s)||c(e)&&n(e)},o)}var id=Symbol(`vueuse-ssr-width`);function ad(){let e=br()?Ou(id,null):null;return typeof e==`number`?e:void 0}function od(e,t={}){let{window:n=Zu,ssrWidth:r=ad()}=t,i=td(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=un(typeof r==`number`),o=un(),s=un(!1);return Cr(()=>{if(a.value){a.value=!i.value;let t=mn(e).split(`,`);s.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=Bu(n[1])),i&&a&&(a=r<=Bu(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(mn(e)),s.value=o.value.matches)}),$u(o,`change`,e=>{s.value=e.matches},{passive:!0}),Q(()=>s.value)}function sd(e){return JSON.parse(JSON.stringify(e))}var cd=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},ld=`__vueuse_ssr_handlers__`,ud=dd();function dd(){return ld in cd||(cd[ld]=cd[ld]||{}),cd[ld]}function fd(e,t){return ud[e]||t}function pd(e){return od(`(prefers-color-scheme: dark)`,e)}function md(e){return e==null?`any`:e instanceof Set?`set`:e instanceof Map?`map`:e instanceof Date?`date`:typeof e==`boolean`?`boolean`:typeof e==`string`?`string`:typeof e==`object`?`object`:Number.isNaN(e)?`any`:`number`}var hd={boolean:{read:e=>e===`true`,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},gd=`vueuse-storage`;function _d(e,t,n,r={}){let{flush:i=`pre`,deep:a=!0,listenToStorageChanges:o=!0,writeDefaults:s=!0,mergeDefaults:c=!1,shallow:l,window:u=Zu,eventFilter:d,onError:f=e=>{console.error(e)},initOnMounted:p}=r,m=(l?un:V)(typeof t==`function`?t():t),h=Q(()=>mn(e));if(!n)try{n=fd(`getDefaultStorage`,()=>Zu?.localStorage)()}catch(e){f(e)}if(!n)return m;let g=mn(t),_=md(g),v=r.serializer??hd[_],{pause:y,resume:b}=Ku(m,e=>C(e),{flush:i,deep:a,eventFilter:d});Er(h,()=>T(),{flush:i});let x=!1;u&&o&&(n instanceof Storage?$u(u,`storage`,e=>{p&&!x||T(e)},{passive:!0}):$u(u,gd,e=>{p&&!x||E(e)})),p?Ju(()=>{x=!0,T()}):T();function S(e,t){if(u){let r={key:h.value,oldValue:e,newValue:t,storageArea:n};u.dispatchEvent(n instanceof Storage?new StorageEvent(`storage`,r):new CustomEvent(gd,{detail:r}))}}function C(e){try{let t=n.getItem(h.value);if(e==null)S(t,null),n.removeItem(h.value);else{let r=v.write(e);t!==r&&(n.setItem(h.value,r),S(t,r))}}catch(e){f(e)}}function w(e){let t=e?e.newValue:n.getItem(h.value);if(t==null)return s&&g!=null&&n.setItem(h.value,v.write(g)),g;if(!e&&c){let e=v.read(t);return typeof c==`function`?c(e,g):_===`object`&&!Array.isArray(e)?{...g,...e}:e}return typeof t==`string`?v.read(t):t}function T(e){if(!(e&&e.storageArea!==n)){if(e&&e.key==null){m.value=g;return}if(!(e&&e.key!==h.value)){y();try{let t=v.write(m.value);(e===void 0||e?.newValue!==t)&&(m.value=w(e))}catch(e){f(e)}finally{e?Qn(b):b()}}}}function E(e){T(e.detail)}return m}var vd=`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function yd(e={}){let{selector:t=`html`,attribute:n=`class`,initialValue:r=`auto`,window:i=Zu,storage:a,storageKey:o=`vueuse-color-scheme`,listenToStorageChanges:s=!0,storageRef:c,emitAuto:l,disableTransition:u=!0}=e,d={auto:``,light:`light`,dark:`dark`,...e.modes||{}},f=pd({window:i}),p=Q(()=>f.value?`dark`:`light`),m=c||(o==null?Iu(r):_d(o,r,a,{window:i,listenToStorageChanges:s})),h=Q(()=>m.value===`auto`?p.value:m.value),g=fd(`updateHTMLAttrs`,(e,t,n)=>{let r=typeof e==`string`?i?.document.querySelector(e):Qu(e);if(!r)return;let a=new Set,o=new Set,s=null;if(t===`class`){let e=n.split(/\s/g);Object.values(d).flatMap(e=>(e||``).split(/\s/g)).filter(Boolean).forEach(t=>{e.includes(t)?a.add(t):o.add(t)})}else s={key:t,value:n};if(a.size===0&&o.size===0&&s===null)return;let c;u&&(c=i.document.createElement(`style`),c.appendChild(document.createTextNode(vd)),i.document.head.appendChild(c));for(let e of a)r.classList.add(e);for(let e of o)r.classList.remove(e);s&&r.setAttribute(s.key,s.value),u&&(i.getComputedStyle(c).opacity,document.head.removeChild(c))});function _(e){g(t,n,d[e]??e)}function v(t){e.onChanged?e.onChanged(t,_):_(t)}Er(h,v,{flush:`post`,immediate:!0}),Ju(()=>v(h.value));let y=Q({get(){return l?m.value:h.value},set(e){m.value=e}});return Object.assign(y,{store:m,system:p,state:h})}function bd(e={}){let{valueDark:t=`dark`,valueLight:n=``}=e,r=yd({...e,onChanged:(t,n)=>{var r;e.onChanged?(r=e.onChanged)==null||r.call(e,t===`dark`,n,t):n(t)},modes:{dark:t,light:n}}),i=Q(()=>r.system.value);return Q({get(){return r.value===`dark`},set(e){let t=e?`dark`:`light`;i.value===t?r.value=`auto`:r.value=t}})}function xd(e,t,n={}){let{window:r=Zu,...i}=n,a,o=td(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=Er(Q(()=>{let t=mn(e);return Array.isArray(t)?t.map(e=>Qu(e)):[Qu(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return Tu(l),{isSupported:o,stop:l}}function Sd(e,t,n={}){let{window:r=Zu}=n;return _d(e,t,r?.localStorage,n)}function Cd(e,t,n,r={}){var i,a;let{clone:o=!1,passive:s=!1,eventName:c,deep:l=!1,defaultValue:u,shouldEmit:d}=r,f=Is(),p=n||f?.emit||(f==null||(i=f.$emit)==null?void 0:i.bind(f))||(f==null||(a=f.proxy)==null||(a=a.$emit)==null?void 0:a.bind(f?.proxy)),m=c;t||=`modelValue`,m||=`update:${t.toString()}`;let h=e=>o?typeof o==`function`?o(e):sd(e):e,g=()=>Au(e[t])?h(e[t]):u,_=e=>{d?d(e)&&p(m,e):p(m,e)};if(s){let n=V(g()),r=!1;return Er(()=>e[t],e=>{r||(r=!0,n.value=h(e),Qn(()=>r=!1))}),Er(n,n=>{!r&&(n!==e[t]||l)&&_(n)},{deep:l}),n}return Q({get(){return g()},set(e){_(e)}})}var wd=Object.assign({inheritAttrs:!1},{__name:`splitpanes`,props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1},keyboardStep:{type:Number,default:5}},emits:[`ready`,`resize`,`resized`,`pane-click`,`pane-maximize`,`pane-add`,`pane-remove`,`splitter-click`,`splitter-dblclick`,`direction-changed`],setup(e,{emit:t}){let n=t,r=e,i=ja(),a=Aa(),o=V([]),s=Q(()=>o.value.reduce((e,t)=>(e[~~t.id]=t)&&e,{})),c=Q(()=>o.value.length),l=V(null),u=V(!1),d=V({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),f=V({splitter:null,timeoutId:null}),p=Q(()=>({[`splitpanes splitpanes--${r.horizontal?`horizontal`:`vertical`}`]:!0,"splitpanes--dragging":d.value.dragging,"splitpanes--ready":u.value})),m=()=>{document.addEventListener(`mousemove`,_,{passive:!1}),document.addEventListener(`mouseup`,v),`ontouchstart`in window&&(document.addEventListener(`touchmove`,_,{passive:!1}),document.addEventListener(`touchend`,v))},h=()=>{document.removeEventListener(`mousemove`,_,{passive:!1}),document.removeEventListener(`mouseup`,v),`ontouchstart`in window&&(document.removeEventListener(`touchmove`,_,{passive:!1}),document.removeEventListener(`touchend`,v))},g=(e,t)=>{let n=e.target.closest(`.splitpanes__splitter`);if(n){let{left:t,top:i}=n.getBoundingClientRect(),{clientX:a,clientY:o}=`ontouchstart`in window&&e.touches?e.touches[0]:e;d.value.cursorOffset=r.horizontal?o-i:a-t}m(),d.value.mouseDown=!0,d.value.activeSplitter=t,document.documentElement.style.cursor=r.horizontal?`row-resize`:`col-resize`},_=e=>{d.value.mouseDown&&(e.preventDefault(),d.value.dragging||(window.getSelection()?.removeAllRanges(),d.value.dragging=!0),requestAnimationFrame(()=>{T(C(e)),L(`resize`,{event:e},!0)}))},v=e=>{d.value.dragging&&(window.getSelection()?.removeAllRanges(),L(`resized`,{event:e},!0)),d.value.mouseDown=!1,d.value.activeSplitter=null,setTimeout(()=>{d.value.dragging=!1,h(),document.documentElement.style.cursor=``},100)},y=(e,t)=>{`ontouchstart`in window&&(e.preventDefault(),f.value.splitter===t?(clearTimeout(f.value.timeoutId),f.value.timeoutId=null,b(e,t),f.value.splitter=null):(f.value.splitter=t,f.value.timeoutId=setTimeout(()=>f.value.splitter=null,500))),d.value.dragging||L(`splitter-click`,{event:e,index:t},!0)},b=(e,t)=>{if(L(`splitter-dblclick`,{event:e,index:t},!0),r.maximizePanes){let n=0;o.value=o.value.map((e,r)=>(e.size=r===t?e.max:e.min,r!==t&&(n+=e.min),e)),o.value[t].size-=n,L(`pane-maximize`,{event:e,index:t,pane:o.value[t]}),L(`resized`,{event:e,index:t},!0)}},x=(e,t)=>{if(!r.keyboardStep)return;let n=r.horizontal?e.key===`ArrowDown`:e.key===`ArrowRight`,i=r.horizontal?e.key===`ArrowUp`:e.key===`ArrowLeft`;if(!n&&!i)return;e.preventDefault(),d.value.activeSplitter=t;let a=(n?1:-1)*(r.rtl&&!r.horizontal?-1:1),s=O(t)+o.value[t].size;E(Math.min(Math.max(s+a*r.keyboardStep,0),100)),L(`resize`,{event:e},!0),L(`resized`,{event:e},!0),d.value.activeSplitter=null},S=(e,t)=>{let n=s.value[t];n&&L(`pane-click`,{event:e,index:n.index,pane:n})},C=e=>{let t=l.value.getBoundingClientRect(),{clientX:n,clientY:i}=`ontouchstart`in window&&e.touches?e.touches[0]:e;return{x:n-(r.horizontal?0:d.value.cursorOffset)-t.left,y:i-(r.horizontal?d.value.cursorOffset:0)-t.top}},w=e=>{e=e[r.horizontal?`y`:`x`];let t=l.value[r.horizontal?`clientHeight`:`clientWidth`];return r.rtl&&!r.horizontal&&(e=t-e),e*100/t},T=e=>{E(w(e))},E=e=>{let t=d.value.activeSplitter;if(t===null||t>=o.value.length-1)return;let n={prevPanesSize:O(t),nextPanesSize:k(t),prevReachedMinPanes:0,nextReachedMinPanes:0},i=0+(r.pushOtherPanes?0:n.prevPanesSize),a=100-(r.pushOtherPanes?0:n.nextPanesSize);e=Math.max(Math.min(e,a),i);let s=[t,t+1],c=o.value[s[0]]||null,l=o.value[s[1]]||null,u=c!==null&&c.max<100&&e>=c.max+n.prevPanesSize,f=l!==null&&l.max<100&&e<=100-(l.max+k(t+1));if(u||f){u?(c.size=c.max,l.size=Math.min(Math.max(100-c.max-n.prevPanesSize-n.nextPanesSize,l.min),l.max)):(c.size=Math.min(Math.max(100-l.max-n.prevPanesSize-k(t+1),c.min),c.max),l.size=l.max);return}if(r.pushOtherPanes){let t=D(n,e);if(!t)return;({sums:n,panesToResize:s}=t),c=o.value[s[0]]||null,l=o.value[s[1]]||null}c!==null&&(c.size=Math.min(Math.max(e-n.prevPanesSize-n.prevReachedMinPanes,c.min),c.max)),l!==null&&(l.size=Math.min(Math.max(100-e-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.max))},D=(e,t)=>{let n=d.value.activeSplitter,r=[n,n+1];if(t<e.prevPanesSize+o.value[r[0]].min){if(r[0]=A(n).index,e.prevReachedMinPanes=0,r[0]<n&&o.value.forEach((t,i)=>{i>r[0]&&i<=n&&(t.size=t.min,e.prevReachedMinPanes+=t.min)}),r[0]===void 0)return e.prevReachedMinPanes=0,o.value[0].size=o.value[0].min,o.value.forEach((t,r)=>{r>0&&r<=n&&(t.size=t.min,e.prevReachedMinPanes+=t.min)}),o.value[r[1]].size=100-e.prevReachedMinPanes-o.value[0].min-e.prevPanesSize-e.nextPanesSize,null;e.prevPanesSize=O(r[0])}return t>100-e.nextPanesSize-o.value[r[1]].min&&(r[1]=ee(n).index,e.nextReachedMinPanes=0,r[1]>n+1&&o.value.forEach((t,i)=>{i>n&&i<r[1]&&(t.size=t.min,e.nextReachedMinPanes+=t.min)}),e.nextPanesSize=r[1]===void 0?0:k(r[1]-1),r[1]===void 0)?(e.nextReachedMinPanes=0,o.value.forEach((t,r)=>{r>=n+1&&(t.size=t.min,e.nextReachedMinPanes+=t.min)}),r[0]!==void 0&&(o.value[r[0]].size=100-e.prevPanesSize-k(r[0]-1)),null):{sums:e,panesToResize:r}},O=e=>o.value.reduce((t,n,r)=>t+(r<e?n.size:0),0),k=e=>o.value.reduce((t,n,r)=>t+(r>e+1?n.size:0),0),A=e=>[...o.value].reverse().find(t=>t.index<e&&t.size>t.min)||{},ee=e=>o.value.find(t=>t.index>e+1&&t.size>t.min)||{},j=()=>{let e=Array.from(l.value?.children||[]);for(let t of e){let e=t.classList.contains(`splitpanes__pane`),n=t.classList.contains(`splitpanes__splitter`);!e&&!n&&(t.remove(),console.warn(`Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.`))}},te=(e,t,n=!1)=>{let i=e-1,a=document.createElement(`div`);a.classList.add(`splitpanes__splitter`),n||(a.onmousedown=e=>g(e,i),typeof window<`u`&&`ontouchstart`in window&&(a.ontouchstart=e=>g(e,i)),a.onclick=e=>y(e,i+1),r.keyboardStep&&(a.setAttribute(`tabindex`,`0`),a.setAttribute(`role`,`separator`),a.setAttribute(`aria-orientation`,r.horizontal?`horizontal`:`vertical`),a.onkeydown=e=>x(e,i))),a.ondblclick=e=>b(e,i+1),t.parentNode.insertBefore(a,t)},ne=e=>{e.onmousedown=null,e.onclick=null,e.ondblclick=null,e.onkeydown=null,e.remove()},M=()=>{let e=Array.from(l.value?.children||[]);for(let t of e)t.className.includes(`splitpanes__splitter`)&&ne(t);let t=0;for(let n of e)n.className.includes(`splitpanes__pane`)&&(!t&&r.firstSplitter?te(t,n,!0):t&&te(t,n),t++)},re=({uid:e,...t})=>{let n=s.value[e];for(let[e,r]of Object.entries(t))n[e]=r},ie=!1,ae=e=>{let t=-1;Array.from(l.value?.children||[]).some(n=>(n.className.includes(`splitpanes__pane`)&&t++,n.isSameNode(e.el))),o.value.splice(t,0,{...e,index:t}),o.value.forEach((e,t)=>e.index=t),u.value&&!ie&&(ie=!0,Qn(()=>{M(),P({addedPane:o.value[t]}),L(`pane-add`,{pane:o.value[t]}),ie=!1}))},N=e=>{let t=o.value.findIndex(t=>t.id===e);o.value[t].el=null;let n=o.value.splice(t,1)[0];o.value.forEach((e,t)=>e.index=t),Qn(()=>{M(),L(`pane-remove`,{pane:n}),P({removedPane:{...n,index:t}})})},P=(e={})=>{!e.addedPane&&!e.removedPane?I():o.value.some(e=>e.givenSize!==null||e.min||e.max<100)?oe(e):F(),u.value&&L(`resized`)},F=()=>{let e=100/c.value,t=100,n=[],r=[];for(let i of o.value)i.size=Math.max(Math.min(e,i.max),i.min),t-=i.size,i.size>=i.max&&n.push(i.id),i.size<=i.min&&r.push(i.id);Math.abs(t)>.1&&se(t,n,r)},I=()=>{let e=100,t=[],n=[],r=0;for(let i of o.value)e-=i.size,i.givenSize!==null&&r++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id);let i=100;if(e>.1){for(let t of o.value)t.givenSize===null&&(t.size=Math.max(Math.min(e/(c.value-r),t.max),t.min)),i-=t.size;i>.1&&se(i,t,n)}},oe=({addedPane:e,removedPane:t}={})=>{let n=o.value.reduce((e,t)=>e+(t.givenSize===null?0:t.givenSize),0),r=o.value.filter(e=>e.givenSize===null).length,i=r>0?(100-n)/r:0,a=0,s=[],c=[];for(let e of o.value)a-=e.size,e.size>=e.max&&s.push(e.id),e.size<=e.min&&c.push(e.id);if(!(Math.abs(a)<.1)){a=100;for(let e of o.value)e.givenSize===null&&(e.size=Math.max(Math.min(i,e.max),e.min)),a-=e.size,e.size>=e.max&&s.push(e.id),e.size<=e.min&&c.push(e.id);Math.abs(a)>.1&&se(a,s,c)}},se=(e,t,n)=>{let r;r=e>0?e/(c.value-t.length):e/(c.value-n.length),o.value.forEach((i,a)=>{if(e>0&&!t.includes(i.id)){let t=Math.max(Math.min(i.size+r,i.max),i.min),n=t-i.size;e-=n,i.size=t}else if(!n.includes(i.id)){let t=Math.max(Math.min(i.size+r,i.max),i.min),n=t-i.size;e-=n,i.size=t}}),Math.abs(e)>.1&&u.value&&console.warn(`Splitpanes: Could not resize panes correctly due to their constraints.`)},L=(e,t=void 0,i=!1)=>{let a=t?.index??d.value.activeSplitter??null;n(e,{...t,...a!==null&&{index:a},...i&&a!==null&&{prevPane:o.value[a-+!!r.firstSplitter],nextPane:o.value[a+ +!r.firstSplitter]},panes:o.value.map(e=>({min:e.min,max:e.max,size:e.size}))})};Er(()=>r.firstSplitter,()=>M()),Er(()=>r.horizontal,e=>Qn(()=>{n(`direction-changed`,{horizontal:e,panes:o.value.map(e=>({min:e.min,max:e.max,size:e.size}))})})),Zi(()=>{j(),M(),P(),L(`ready`),u.value=!0}),ea(()=>u.value=!1);let ce=()=>{let{class:e,...t}=i;return nc(`div`,{ref:l,class:[p.value,e],...t},a.default?.())};return vr(`panes`,o),vr(`indexedPanes`,s),vr(`horizontal`,Q(()=>r.horizontal)),vr(`requestUpdate`,re),vr(`onPaneAdd`,ae),vr(`onPaneRemove`,N),vr(`onPaneClick`,S),(e,t)=>(K(),J(ua(ce)))}}),Td={__name:`pane`,props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(e){let t=e,n=yr(`requestUpdate`),r=yr(`onPaneAdd`),i=yr(`horizontal`),a=yr(`onPaneRemove`),o=yr(`onPaneClick`),s=Is()?.uid,c=yr(`indexedPanes`),l=Q(()=>c.value[s]),u=V(null),d=Q(()=>{let e=isNaN(t.size)||t.size===void 0?0:parseFloat(t.size);return Math.max(Math.min(e,p.value),f.value)}),f=Q(()=>{let e=parseFloat(t.minSize);return isNaN(e)?0:e}),p=Q(()=>{let e=parseFloat(t.maxSize);return isNaN(e)?100:e}),m=Q(()=>{let e=l.value?.size??(t.size===void 0?void 0:d.value);return e===void 0?``:`${i.value?`height`:`width`}: ${e}%`});return Er(()=>d.value,e=>n({uid:s,size:e})),Er(()=>f.value,e=>n({uid:s,min:e})),Er(()=>p.value,e=>n({uid:s,max:e})),Zi(()=>{r({id:s,el:u.value,min:f.value,max:p.value,givenSize:t.size===void 0?null:d.value,size:d.value})}),ea(()=>a(s)),(e,t)=>(K(),q(`div`,{ref_key:`paneEl`,ref:u,class:`splitpanes__pane`,onClick:t[0]||=t=>H(o)(t,e._.uid),style:me(m.value)},[G(e.$slots,`default`)],4))}},Ed=W({__name:`LayoutSplitPane`,props:{horizontal:{type:Boolean},storageKey:{}},setup(e){let t=e,n=t.storageKey?Sd(t.storageKey,[]):V([]);function r(e){n.value=e.panes.map(e=>e.size)}return(t,i)=>(K(),J(H(wd),{horizontal:e.horizontal,onResized:r},{default:U(()=>[G(t.$slots,`default`,{sizes:H(n)})]),_:3},8,[`horizontal`]))}}),Dd=Symbol(`antfu-design-color-scheme`);function Od(e){let t=Sn(e);return vr(Dd,t),t}function kd(e){let t=yr(Dd,void 0);return Q(()=>e?.()??t?.value??`light`)}var Ad=[`top`,`right`,`bottom`,`left`],jd=[`start`,`end`],Md=Ad.reduce((e,t)=>e.concat(t,t+`-`+jd[0],t+`-`+jd[1]),[]),Nd=Math.min,Pd=Math.max,Fd=Math.round,Id=Math.floor,Ld=e=>({x:e,y:e}),Rd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function zd(e,t,n){return Pd(e,Nd(t,n))}function Bd(e,t){return typeof e==`function`?e(t):e}function Vd(e){return e.split(`-`)[0]}function Hd(e){return e.split(`-`)[1]}function Ud(e){return e===`x`?`y`:`x`}function Wd(e){return e===`y`?`height`:`width`}function Gd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Kd(e){return Ud(Gd(e))}function qd(e,t,n){n===void 0&&(n=!1);let r=Hd(e),i=Kd(e),a=Wd(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=nf(o)),[o,nf(o)]}function Jd(e){let t=nf(e);return[Yd(e),t,Yd(t)]}function Yd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Xd=[`left`,`right`],Zd=[`right`,`left`],Qd=[`top`,`bottom`],$d=[`bottom`,`top`];function ef(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Zd:Xd:t?Xd:Zd;case`left`:case`right`:return t?Qd:$d;default:return[]}}function tf(e,t,n,r){let i=Hd(e),a=ef(Vd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Yd)))),a}function nf(e){let t=Vd(e);return Rd[t]+e.slice(t.length)}function rf(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function af(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:rf(e)}function of(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function sf(e,t,n){let{reference:r,floating:i}=e,a=Gd(t),o=Kd(t),s=Wd(o),c=Vd(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Hd(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function cf(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Bd(t,e),p=af(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=of(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=of(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var lf=50,uf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:cf},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=sf(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<lf&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=sf(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},df=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Bd(e,t)||{};if(l==null)return{};let d=af(u),f={x:n,y:r},p=Kd(i),m=Wd(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Nd(d[_],T),D=Nd(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=zd(E,k,O),ee=!c.arrow&&Hd(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,j=ee?k<E?k-E:k-O:0;return{[p]:f[p]+j,data:{[p]:A,centerOffset:k-A-j,...ee&&{alignmentOffset:j}},reset:ee}}});function ff(e,t,n){return(e?[...n.filter(t=>Hd(t)===e),...n.filter(t=>Hd(t)!==e)]:n.filter(e=>Vd(e)===e)).filter(n=>!e||Hd(n)===e||(t?Yd(n)!==n:!1))}var pf=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=Md,autoAlignment:u=!0,...d}=Bd(e,t),f=c!==void 0||l===Md?ff(c||null,u,l):l,p=r.autoPlacement?.index||0,m=f[p];if(m==null)return{};if(i!==m)return{reset:{placement:f[0]}};let h=await a.detectOverflow(t,d),g=qd(m,n,await(a.isRTL==null?void 0:a.isRTL(o.floating))),_=[h[Vd(m)],h[g[0]],h[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:m,overflows:_}],y=f[p+1];if(y)return{data:{index:p+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=Hd(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,Hd(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:p+1,overflows:v},reset:{placement:x}}}}},mf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Bd(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Vd(r),_=Gd(o),v=Vd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[nf(o)]:Jd(o)),x=p!==`none`;!d&&x&&b.push(...tf(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=qd(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Gd(t)||T.every(e=>Gd(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Gd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function hf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gf(e){return Ad.some(t=>e[t]>=0)}var _f=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Bd(e,t);switch(i){case`referenceHidden`:{let e=hf(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:gf(e)}}}case`escaped`:{let e=hf(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:gf(e)}}}default:return{}}}}},vf=new Set([`left`,`top`]);async function yf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Vd(n),s=Hd(n),c=Gd(n)===`y`,l=vf.has(o)?-1:1,u=a&&c?-1:1,d=Bd(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var bf=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await yf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},xf=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Bd(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Gd(i),p=Ud(f),m=u[p],h=u[f],g=(e,t)=>zd(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Sf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Bd(e,t),u={x:n,y:r},d=Gd(i),f=Ud(d),p=u[f],m=u[d],h=Bd(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=vf.has(Vd(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Cf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Bd(e,t),c=await i.detectOverflow(t,s),l=Vd(n),u=Hd(n),d=Gd(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Nd(p-c[m],g),y=Nd(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Pd(c.left,c.right):S=p-2*Pd(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function wf(e){return e.ownerDocument?.defaultView||window}function Tf(e){return wf(e).getComputedStyle(e)}var Ef=Math.min,Df=Math.max,Of=Math.round;function kf(e){let t=Tf(e),n=parseFloat(t.width),r=parseFloat(t.height),i=e.offsetWidth,a=e.offsetHeight,o=Of(n)!==i||Of(r)!==a;return o&&(n=i,r=a),{width:n,height:r,fallback:o}}function Af(e){return Ff(e)?(e.nodeName||``).toLowerCase():``}var jf;function Mf(){if(jf)return jf;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(jf=e.brands.map((e=>e.brand+`/`+e.version)).join(` `),jf):navigator.userAgent}function Nf(e){return e instanceof wf(e).HTMLElement}function Pf(e){return e instanceof wf(e).Element}function Ff(e){return e instanceof wf(e).Node}function If(e){return typeof ShadowRoot>`u`?!1:e instanceof wf(e).ShadowRoot||e instanceof ShadowRoot}function Lf(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Tf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function Rf(e){return[`table`,`td`,`th`].includes(Af(e))}function zf(e){let t=/firefox/i.test(Mf()),n=Tf(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!==`none`||n.perspective!==`none`||!!r&&r!==`none`||t&&n.willChange===`filter`||t&&!!n.filter&&n.filter!==`none`||[`transform`,`perspective`].some((e=>n.willChange.includes(e)))||[`paint`,`layout`,`strict`,`content`].some((e=>{let t=n.contain;return t!=null&&t.includes(e)}))}function Bf(){return!/^((?!chrome|android).)*safari/i.test(Mf())}function Vf(e){return[`html`,`body`,`#document`].includes(Af(e))}function Hf(e){return Pf(e)?e:e.contextElement}var Uf={x:1,y:1};function Wf(e){let t=Hf(e);if(!Nf(t))return Uf;let n=t.getBoundingClientRect(),{width:r,height:i,fallback:a}=kf(t),o=(a?Of(n.width):n.width)/r,s=(a?Of(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}function Gf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Hf(e),o=Uf;t&&(r?Pf(r)&&(o=Wf(r)):o=Wf(e));let s=a?wf(a):window,c=!Bf()&&n,l=(i.left+(c&&s.visualViewport?.offsetLeft||0))/o.x,u=(i.top+(c&&s.visualViewport?.offsetTop||0))/o.y,d=i.width/o.x,f=i.height/o.y;if(a){let e=wf(a),t=r&&Pf(r)?wf(r):r,n=e.frameElement;for(;n&&r&&t!==e;){let e=Wf(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=t.x,u+=t.y,n=wf(n).frameElement}}return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l,x:l,y:u}}function Kf(e){return((Ff(e)?e.ownerDocument:e.document)||window.document).documentElement}function qf(e){return Pf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Jf(e){return Gf(Kf(e)).left+qf(e).scrollLeft}function Yf(e){if(Af(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||If(e)&&e.host||Kf(e);return If(t)?t.host:t}function Xf(e){let t=Yf(e);return Vf(t)?t.ownerDocument.body:Nf(t)&&Lf(t)?t:Xf(t)}function Zf(e,t){t===void 0&&(t=[]);let n=Xf(e),r=n===e.ownerDocument?.body,i=wf(n);return r?t.concat(i,i.visualViewport||[],Lf(n)?n:[]):t.concat(n,Zf(n))}function Qf(e,t,n){return t===`viewport`?of(function(e,t){let n=wf(e),r=Kf(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Bf();(e||!e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}(e,n)):Pf(t)?of(function(e,t){let n=Gf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Nf(e)?Wf(e):{x:1,y:1};return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n)):of(function(e){let t=Kf(e),n=qf(e),r=e.ownerDocument.body,i=Df(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Df(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Jf(e),s=-n.scrollTop;return Tf(r).direction===`rtl`&&(o+=Df(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(Kf(e)))}function $f(e){return Nf(e)&&Tf(e).position!==`fixed`?e.offsetParent:null}function ep(e){let t=wf(e),n=$f(e);for(;n&&Rf(n)&&Tf(n).position===`static`;)n=$f(n);return n&&(Af(n)===`html`||Af(n)===`body`&&Tf(n).position===`static`&&!zf(n))?t:n||function(e){let t=Yf(e);for(;Nf(t)&&!Vf(t);){if(zf(t))return t;t=Yf(t)}return null}(e)||t}function tp(e,t,n){let r=Nf(t),i=Kf(t),a=Gf(e,!0,n===`fixed`,t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&n!==`fixed`){if((Af(t)!==`body`||Lf(i))&&(o=qf(t)),Nf(t)){let e=Gf(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=Jf(i))}return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}var np={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?function(e,t){let n=t.get(e);if(n)return n;let r=Zf(e).filter((e=>Pf(e)&&Af(e)!==`body`)),i=null,a=Tf(e).position===`fixed`,o=a?Yf(e):e;for(;Pf(o)&&!Vf(o);){let e=Tf(o),t=zf(o);(a?t||i:t||e.position!==`static`||!i||![`absolute`,`fixed`].includes(i.position))?i=e:r=r.filter((e=>e!==o)),o=Yf(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=a[0],s=a.reduce(((e,n)=>{let r=Qf(t,n,i);return e.top=Df(r.top,e.top),e.right=Ef(r.right,e.right),e.bottom=Ef(r.bottom,e.bottom),e.left=Df(r.left,e.left),e}),Qf(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=Nf(n),a=Kf(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((i||!i&&r!==`fixed`)&&((Af(n)!==`body`||Lf(a))&&(o=qf(n)),Nf(n))){let e=Gf(n);s=Wf(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-o.scrollLeft*s.x+c.x,y:t.y*s.y-o.scrollTop*s.y+c.y}},isElement:Pf,getDimensions:function(e){return Nf(e)?kf(e):e.getBoundingClientRect()},getOffsetParent:ep,getDocumentElement:Kf,getScale:Wf,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e,i=this.getOffsetParent||ep,a=this.getDimensions;return{reference:tp(t,await i(n),r),floating:{x:0,y:0,...await a(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Tf(e).direction===`rtl`},rp=(e,t,n)=>{let r=new Map,i={platform:np,...n},a={...i.platform,_c:r};return uf(e,t,{...i,platform:a})},ip={disabled:!1,distance:5,skidding:0,container:`body`,boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:`absolute`,preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:`top`,triggers:[`hover`,`focus`,`touch`],hideTriggers:e=>[...e,`click`],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:`...`},dropdown:{placement:`bottom`,triggers:[`click`],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:`dropdown`,triggers:[`hover`,`focus`],popperTriggers:[`hover`],delay:{show:0,hide:400}}}};function ap(e,t){let n=ip.themes[e]||{},r;do r=n[t],typeof r>`u`?n.$extend?n=ip.themes[n.$extend]||{}:(n=null,r=ip[t]):n=null;while(n);return r}function op(e){let t=[e],n=ip.themes[e]||{};do n.$extend&&!n.$resetCss?(t.push(n.$extend),n=ip.themes[n.$extend]||{}):n=null;while(n);return t.map(e=>`v-popper--theme-${e}`)}function sp(e){let t=[e],n=ip.themes[e]||{};do n.$extend?(t.push(n.$extend),n=ip.themes[n.$extend]||{}):n=null;while(n);return t}var cp=!1;if(typeof window<`u`){cp=!1;try{let e=Object.defineProperty({},"passive",{get(){cp=!0}});window.addEventListener(`test`,null,e)}catch{}}var lp=!1;typeof window<`u`&&typeof navigator<`u`&&(lp=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);var up=[`auto`,`top`,`bottom`,`left`,`right`].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),dp={hover:`mouseenter`,focus:`focus`,click:`click`,touch:`touchstart`,pointer:`pointerdown`},fp={hover:`mouseleave`,focus:`blur`,click:`click`,touch:`touchend`,pointer:`pointerup`};function pp(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}function mp(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}var hp=[],gp=null,_p={};function vp(e){let t=_p[e];return t||=_p[e]=[],t}var yp=function(){};typeof window<`u`&&(yp=window.Element);function bp(e){return function(t){return ap(t.theme,e)}}var xp=`__floating-vue__popper`,Sp=()=>W({name:`VPopper`,provide(){return{[xp]:{parentPopper:this}}},inject:{[xp]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:bp(`disabled`)},positioningDisabled:{type:Boolean,default:bp(`positioningDisabled`)},placement:{type:String,default:bp(`placement`),validator:e=>up.includes(e)},delay:{type:[String,Number,Object],default:bp(`delay`)},distance:{type:[Number,String],default:bp(`distance`)},skidding:{type:[Number,String],default:bp(`skidding`)},triggers:{type:Array,default:bp(`triggers`)},showTriggers:{type:[Array,Function],default:bp(`showTriggers`)},hideTriggers:{type:[Array,Function],default:bp(`hideTriggers`)},popperTriggers:{type:Array,default:bp(`popperTriggers`)},popperShowTriggers:{type:[Array,Function],default:bp(`popperShowTriggers`)},popperHideTriggers:{type:[Array,Function],default:bp(`popperHideTriggers`)},container:{type:[String,Object,yp,Boolean],default:bp(`container`)},boundary:{type:[String,yp],default:bp(`boundary`)},strategy:{type:String,validator:e=>[`absolute`,`fixed`].includes(e),default:bp(`strategy`)},autoHide:{type:[Boolean,Function],default:bp(`autoHide`)},handleResize:{type:Boolean,default:bp(`handleResize`)},instantMove:{type:Boolean,default:bp(`instantMove`)},eagerMount:{type:Boolean,default:bp(`eagerMount`)},popperClass:{type:[String,Array,Object],default:bp(`popperClass`)},computeTransformOrigin:{type:Boolean,default:bp(`computeTransformOrigin`)},autoMinSize:{type:Boolean,default:bp(`autoMinSize`)},autoSize:{type:[Boolean,String],default:bp(`autoSize`)},autoMaxSize:{type:Boolean,default:bp(`autoMaxSize`)},autoBoundaryMaxSize:{type:Boolean,default:bp(`autoBoundaryMaxSize`)},preventOverflow:{type:Boolean,default:bp(`preventOverflow`)},overflowPadding:{type:[Number,String],default:bp(`overflowPadding`)},arrowPadding:{type:[Number,String],default:bp(`arrowPadding`)},arrowOverflow:{type:Boolean,default:bp(`arrowOverflow`)},flip:{type:Boolean,default:bp(`flip`)},shift:{type:Boolean,default:bp(`shift`)},shiftCrossAxis:{type:Boolean,default:bp(`shiftCrossAxis`)},noAutoFocus:{type:Boolean,default:bp(`noAutoFocus`)},disposeTimeout:{type:Number,default:bp(`disposeTimeout`)}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:``,strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join(`_`)}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId==null?this.randomId:this.ariaId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide==`function`?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){return this[xp]?.parentPopper},hasPopperShowTriggerHover(){return this.popperTriggers?.includes(`hover`)||this.popperShowTriggers?.includes(`hover`)}},watch:{shown:`$_autoShowHide`,disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:`$_refreshListeners`,deep:!0},positioningDisabled:`$_refreshListeners`,...[`placement`,`distance`,`skidding`,`boundary`,`strategy`,`overflowPadding`,`arrowPadding`,`preventOverflow`,`shift`,`shiftCrossAxis`,`flip`].reduce((e,t)=>(e[t]=`$_computePosition`,e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:n=!1}={}){var r;(r=this.parentPopper)!=null&&r.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(n||!this.disabled)&&(this.parentPopper?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit(`show`),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit(`update:shown`,!0))},hide({event:e=null,skipDelay:t=!1}={}){if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}this.parentPopper?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit(`hide`),this.$emit(`update:shown`,!1)}},init(){this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=this.referenceNode?.call(this)??this.$el,this.$_targetNodes=this.targetNodes().filter(e=>e.nodeType===e.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(`.v-popper__inner`),this.$_arrowNode=this.$_popperNode.querySelector(`.v-popper__arrow-container`),this.$_swapTargetAttrs(`title`,`data-original-title`),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs(`data-original-title`,`title`))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit(`resize`))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;let e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(bf({mainAxis:this.distance,crossAxis:this.skidding}));let t=this.placement.startsWith(`auto`);if(t?e.middleware.push(pf({alignment:this.placement.split(`-`)[1]??``})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(xf({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(mf({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(df({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:`arrowOverflow`,fn:({placement:e,rects:t,middlewareData:n})=>{let r,{centerOffset:i}=n.arrow;return r=e.startsWith(`top`)||e.startsWith(`bottom`)?Math.abs(i)>t.reference.width/2:Math.abs(i)>t.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){let t=this.autoSize?this.autoSize:this.autoMinSize?`min`:null;e.middleware.push({name:`autoSize`,fn:({rects:e,placement:n,middlewareData:r})=>{var i;if((i=r.autoSize)!=null&&i.skip)return{};let a,o;return n.startsWith(`top`)||n.startsWith(`bottom`)?a=e.reference.width:o=e.reference.height,this.$_innerNode.style[t===`min`?`minWidth`:t===`max`?`maxWidth`:`width`]=a==null?null:`${a}px`,this.$_innerNode.style[t===`min`?`minHeight`:t===`max`?`maxHeight`:`height`]=o==null?null:`${o}px`,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(Cf({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:e,availableHeight:t})=>{this.$_innerNode.style.maxWidth=e==null?null:`${e}px`,this.$_innerNode.style.maxHeight=t==null?null:`${t}px`}})));let n=await rp(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:n.x,y:n.y,placement:n.placement,strategy:n.strategy,arrow:{...n.middlewareData.arrow,...n.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),gp&&this.instantMove&&gp.instantMove&&gp!==this.parentPopper){gp.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay(`show`))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(gp=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay(`hide`))},$_computeDelay(e){let t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await mp(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...Zf(this.$_referenceNode),...Zf(this.$_popperNode)],`scroll`,()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){let e=this.$_referenceNode.getBoundingClientRect(),t=this.$_popperNode.querySelector(`.v-popper__wrapper`),n=t.parentNode.getBoundingClientRect(),r=e.x+e.width/2-(n.left+t.offsetLeft),i=e.y+e.height/2-(n.top+t.offsetTop);this.result.transformOrigin=`${r}px ${i}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":``});let e=this.showGroup;if(e){let t;for(let n=0;n<hp.length;n++)t=hp[n],t.showGroup!==e&&(t.hide(),t.$emit(`close-group`))}hp.push(this),document.body.classList.add(`v-popper--some-open`);for(let e of sp(this.theme))vp(e).push(this),document.body.classList.add(`v-popper--some-open--${e}`);this.$emit(`apply-show`),this.classes.showFrom=!0,this.classes.showTo=!1,this.classes.hideFrom=!1,this.classes.hideTo=!1,await mp(),this.classes.showFrom=!1,this.classes.showTo=!0,this.noAutoFocus||this.$_popperNode.focus()},async $_applyHide(e=!1){if(this.shownChildren.size>0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,pp(hp,this),hp.length===0&&document.body.classList.remove(`v-popper--some-open`);for(let e of sp(this.theme)){let t=vp(e);pp(t,this),t.length===0&&document.body.classList.remove(`v-popper--some-open--${e}`)}gp===this&&(gp=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);let t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners(`scroll`),this.$emit(`apply-hide`),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await mp(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e==`string`?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw Error(`No container for popover: `+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){let e=e=>{this.isShown&&!this.$_hideInProgress||(e.usedByTooltip=!0,!this.$_preventShow&&this.show({event:e}))};this.$_registerTriggerListeners(this.$_targetNodes,dp,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],dp,this.popperTriggers,this.popperShowTriggers,e);let t=e=>{e.usedByTooltip||this.hide({event:e})};this.$_registerTriggerListeners(this.$_targetNodes,fp,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],fp,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,n){this.$_events.push({targetNodes:e,eventType:t,handler:n}),e.forEach(e=>e.addEventListener(t,n,cp?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,n,r,i){let a=n;r!=null&&(a=typeof r==`function`?r(a):r),a.forEach(n=>{let r=t[n];r&&this.$_registerEventListeners(e,r,i)})},$_removeEventListeners(e){let t=[];this.$_events.forEach(n=>{let{targetNodes:r,eventType:i,handler:a}=n;!e||e===i?r.forEach(e=>e.removeEventListener(i,a)):t.push(n)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit(`close-directive`):this.$emit(`auto-hide`),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(let n of this.$_targetNodes){let r=n.getAttribute(e);r&&(n.removeAttribute(e),n.setAttribute(t,r))}},$_applyAttrsToTarget(e){for(let t of this.$_targetNodes)for(let n in e){let r=e[n];r==null?t.removeAttribute(n):t.setAttribute(n,r)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){let e=this.$_referenceNode.getBoundingClientRect();if(jp>=e.left&&jp<=e.right&&Mp>=e.top&&Mp<=e.bottom){let e=this.$_popperNode.getBoundingClientRect(),t=jp-kp,n=Mp-Ap,r=e.left+e.width/2-kp+(e.top+e.height/2)-Ap+e.width+e.height,i=kp+t*r,a=Ap+n*r;return Np(kp,Ap,i,a,e.left,e.top,e.left,e.bottom)||Np(kp,Ap,i,a,e.left,e.top,e.right,e.top)||Np(kp,Ap,i,a,e.right,e.top,e.right,e.bottom)||Np(kp,Ap,i,a,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<`u`&&typeof window<`u`){if(lp){let e=!cp||{passive:!0,capture:!0};document.addEventListener(`touchstart`,e=>Cp(e,!0),e),document.addEventListener(`touchend`,e=>wp(e,!0),e)}else window.addEventListener(`mousedown`,e=>Cp(e,!1),!0),window.addEventListener(`click`,e=>wp(e,!1),!0);window.addEventListener(`resize`,Op)}function Cp(e,t){if(ip.autoHideOnMousedown)Tp(e,t);else for(let t=0;t<hp.length;t++){let n=hp[t];try{n.mouseDownContains=n.popperNode().contains(e.target)}catch{}}}function wp(e,t){ip.autoHideOnMousedown||Tp(e,t)}function Tp(e,t){let n={};for(let r=hp.length-1;r>=0;r--){let i=hp[r];try{let r=i.containsGlobalTarget=i.mouseDownContains||i.popperNode().contains(e.target);i.pendingHide=!1,requestAnimationFrame(()=>{if(i.pendingHide=!1,!n[i.randomId]&&Ep(i,r,e)){if(i.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&r){let e=i.parentPopper;for(;e;)n[e.randomId]=!0,e=e.parentPopper;return}let a=i.parentPopper;for(;a&&Ep(a,a.containsGlobalTarget,e);)a.$_handleGlobalClose(e,t),a=a.parentPopper}})}catch{}}}function Ep(e,t,n){return n.closeAllPopover||n.closePopover&&t||Dp(e,n)&&!t}function Dp(e,t){if(typeof e.autoHide==`function`){let n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function Op(){for(let e=0;e<hp.length;e++)hp[e].$_computePosition()}var kp=0,Ap=0,jp=0,Mp=0;typeof window<`u`&&window.addEventListener(`mousemove`,e=>{kp=jp,Ap=Mp,jp=e.clientX,Mp=e.clientY},cp?{passive:!0}:void 0);function Np(e,t,n,r,i,a,o,s){let c=((o-i)*(t-a)-(s-a)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t)),l=((n-e)*(t-a)-(r-t)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t));return c>=0&&c<=1&&l>=0&&l<=1}var Pp={extends:Sp()},Fp=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};function Ip(e,t,n,r,i,a){return K(),q(`div`,{ref:`reference`,class:ye([`v-popper`,{"v-popper--shown":e.slotData.isShown}])},[G(e.$slots,`default`,be(Cs(e.slotData)))],2)}var Lp=Fp(Pp,[[`render`,Ip]]);function Rp(){var e=window.navigator.userAgent,t=e.indexOf(`MSIE `);if(t>0)return parseInt(e.substring(t+5,e.indexOf(`.`,t)),10);if(e.indexOf(`Trident/`)>0){var n=e.indexOf(`rv:`);return parseInt(e.substring(n+3,e.indexOf(`.`,n)),10)}var r=e.indexOf(`Edge/`);return r>0?parseInt(e.substring(r+5,e.indexOf(`.`,r)),10):-1}var zp;function Bp(){Bp.init||(Bp.init=!0,zp=Rp()!==-1)}var Vp={name:`ResizeObserver`,props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:[`notify`],mounted(){Bp(),Qn(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});let e=document.createElement(`object`);this._resizeObject=e,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,-1),e.onload=this.addResizeHandlers,e.type=`text/html`,zp&&this.$el.appendChild(e),e.data=`about:blank`,zp||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit(`notify`,{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener(`resize`,this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!zp&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener(`resize`,this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}},Hp=hr(`data-v-b329ee4c`);pr(`data-v-b329ee4c`);var Up={class:`resize-observer`,tabindex:`-1`};mr(),Vp.render=Hp((e,t,n,r,i,a)=>(K(),J(`div`,Up))),Vp.__scopeId=`data-v-b329ee4c`,Vp.__file=`src/components/ResizeObserver.vue`;var Wp=(e=`theme`)=>({computed:{themeClass(){return op(this[e])}}}),Gp=W({name:`VPopperContent`,components:{ResizeObserver:Vp},mixins:[Wp()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:[`hide`,`resize`],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Kp=[`id`,`aria-hidden`,`tabindex`,`data-popper-placement`],qp={ref:`inner`,class:`v-popper__inner`},Jp=[Y(`div`,{class:`v-popper__arrow-outer`},null,-1),Y(`div`,{class:`v-popper__arrow-inner`},null,-1)];function Yp(e,t,n,r,i,a){let o=ca(`ResizeObserver`);return K(),q(`div`,{id:e.popperId,ref:`popover`,class:ye([`v-popper__popper`,[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:me(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?`false`:`true`,tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||=lu(t=>e.autoHide&&e.$emit(`hide`),[`esc`])},[Y(`div`,{class:`v-popper__backdrop`,onClick:t[0]||=t=>e.autoHide&&e.$emit(`hide`)}),Y(`div`,{class:`v-popper__wrapper`,style:me(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[Y(`div`,qp,[e.mounted?(K(),q(ss,{key:0},[Y(`div`,null,[G(e.$slots,`default`)]),e.handleResize?(K(),J(o,{key:0,onNotify:t[1]||=t=>e.$emit(`resize`,t)})):Z(``,!0)],64)):Z(``,!0)],512),Y(`div`,{ref:`arrow`,class:`v-popper__arrow-container`,style:me(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Jp,4)],4)],46,Kp)}var Xp=Fp(Gp,[[`render`,Yp]]),Zp={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}},Qp=function(){};typeof window<`u`&&(Qp=window.Element);var $p=W({name:`VPopperWrapper`,components:{Popper:Lp,PopperContent:Xp},mixins:[Zp,Wp(`finalTheme`)],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,Qp,Boolean],default:void 0},boundary:{type:[String,Qp],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function em(e,t,n,r,i,a){let o=ca(`PopperContent`),s=ca(`Popper`);return K(),J(s,As({ref:`popper`},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||=()=>e.$emit(`show`),onHide:t[1]||=()=>e.$emit(`hide`),"onUpdate:shown":t[2]||=t=>e.$emit(`update:shown`,t),onApplyShow:t[3]||=()=>e.$emit(`apply-show`),onApplyHide:t[4]||=()=>e.$emit(`apply-hide`),onCloseGroup:t[5]||=()=>e.$emit(`close-group`),onCloseDirective:t[6]||=()=>e.$emit(`close-directive`),onAutoHide:t[7]||=()=>e.$emit(`auto-hide`),onResize:t[8]||=()=>e.$emit(`resize`)}),{default:U(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,show:s,hide:c,handleResize:l,onResize:u,classes:d,result:f})=>[G(e.$slots,`default`,{shown:n,show:s,hide:c}),X(o,{ref:`popperContent`,"popper-id":t,theme:e.finalTheme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":l,classes:d,result:f,onHide:c,onResize:u},{default:U(()=>[G(e.$slots,`popper`,{shown:n,hide:c})]),_:2},1032,[`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:3},16,[`theme`,`target-nodes`,`popper-node`,`class`])}var tm=Fp($p,[[`render`,em]]);({...tm}),{...tm},{...tm};var nm=W({name:`VTooltipDirective`,components:{Popper:Sp(),PopperContent:Xp},mixins:[Zp],inheritAttrs:!1,props:{theme:{type:String,default:`tooltip`},html:{type:Boolean,default:e=>ap(e.theme,`html`)},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>ap(e.theme,`loadingContent`)},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content==`function`},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content==`function`&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;let e=++this.$_fetchId,t=this.content(this);t.then?t.then(t=>this.onResult(e,t)):this.onResult(e,t)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),rm=[`innerHTML`],im=[`textContent`];function am(e,t,n,r,i,a){let o=ca(`PopperContent`),s=ca(`Popper`);return K(),J(s,As({ref:`popper`},e.$attrs,{theme:e.theme,"target-nodes":e.targetNodes,"popper-node":()=>e.$refs.popperContent.$el,onApplyShow:e.onShow,onApplyHide:e.onHide}),{default:U(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,hide:s,handleResize:c,onResize:l,classes:u,result:d})=>[X(o,{ref:`popperContent`,class:ye({"v-popper--tooltip-loading":e.loading}),"popper-id":t,theme:e.theme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":c,classes:u,result:d,onHide:s,onResize:l},{default:U(()=>[e.html?(K(),q(`div`,{key:0,innerHTML:e.finalContent},null,8,rm)):(K(),q(`div`,{key:1,textContent:ke(e.finalContent)},null,8,im))]),_:2},1032,[`class`,`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:1},16,[`theme`,`target-nodes`,`popper-node`,`onApplyShow`,`onApplyHide`])}var om=Fp(nm,[[`render`,am]]),sm=`v-popper--has-tooltip`;function cm(e,t){let n=e.placement;if(!n&&t)for(let e of up)t[e]&&(n=e);return n||=ap(e.theme||`tooltip`,`placement`),n}function lm(e,t,n){let r,i=typeof t;return r=i===`string`?{content:t}:t&&i===`object`?t:{content:!1},r.placement=cm(r,n),r.targetNodes=()=>[e],r.referenceNode=()=>e,r}var um,dm,fm=0;function pm(){if(um)return;dm=V([]),um=_u({name:`VTooltipDirectiveApp`,setup(){return{directives:dm}},render(){return this.directives.map(e=>nc(om,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});let e=document.createElement(`div`);document.body.appendChild(e),um.mount(e)}function mm(e,t,n){pm();let r=V(lm(e,t,n)),i=V(!1),a={id:fm++,options:r,shown:i};return dm.value.push(a),e.classList&&e.classList.add(sm),e.$_popper={options:r,item:a,show(){i.value=!0},hide(){i.value=!1}}}function hm(e){if(e.$_popper){let t=dm.value.indexOf(e.$_popper.item);t!==-1&&dm.value.splice(t,1),delete e.$_popper,delete e.$_popperOldShown,delete e.$_popperMountTarget}e.classList&&e.classList.remove(sm)}function gm(e,{value:t,modifiers:n}){let r=lm(e,t,n);if(!r.content||ap(r.theme||`tooltip`,`disabled`))hm(e);else{let i;e.$_popper?(i=e.$_popper,i.options.value=r):i=mm(e,t,n),typeof t.shown<`u`&&t.shown!==e.$_popperOldShown&&(e.$_popperOldShown=t.shown,t.shown?i.show():i.hide())}}var _m={beforeMount:gm,updated:gm,beforeUnmount(e){hm(e)}},vm=W({__name:`ActionIconButton`,props:{as:{},to:{},href:{},icon:{},tooltip:{},active:{type:Boolean},disabled:{type:Boolean},label:{},compact:{type:Boolean},activeClass:{}},setup(e){let t=e,n=Q(()=>t.as?t.as:t.href!=null||t.to!=null?`a`:`button`),r=Q(()=>n.value===`a`),i=Q(()=>n.value===`button`),a=Q(()=>t.compact?`btn-icon-compact`:`btn-icon`),o=Q(()=>t.compact?`w-auto! h-auto! p-[0.25em]`:`w-auto! h-auto! p-[0.5em]`),s=Q(()=>t.active?t.activeClass||`color-active bg-active op100`:``);return(t,c)=>gr((K(),J(ua(n.value),{type:i.value?`button`:void 0,class:ye([a.value,o.value,s.value,{"pointer-events-none op-mute":e.disabled&&!i.value}]),href:r.value?e.href??e.to:void 0,to:e.as&&e.to!=null?e.to:void 0,disabled:i.value?e.disabled:void 0,"aria-disabled":e.disabled&&!i.value||void 0,"aria-label":e.label??e.tooltip,"aria-pressed":e.active||void 0},{default:U(()=>[e.icon?(K(),q(`span`,{key:0,class:ye(e.icon),"aria-hidden":`true`},null,2)):Z(``,!0),G(t.$slots,`default`),G(t.$slots,`badge`)]),_:3},8,[`type`,`class`,`href`,`to`,`disabled`,`aria-disabled`,`aria-label`,`aria-pressed`])),[[H(_m),e.tooltip]])}});function ym(e,t){let n=e.length,r,i,a=!1,o=!1;Array.isArray(e[0])?r=e:(r=[e],n=r.length,a=!0),Array.isArray(t[0])?i=t:(i=t.length>0?t.map(e=>[e]):[[]],o=!0);let s=i[0].length,c=i[0].map((e,t)=>i.map(e=>e[t])),l=r.map(e=>c.map(t=>{let n=0;if(!Array.isArray(e)){for(let r of t)n+=e*r;return n}for(let r=0;r<e.length;r++)n+=e[r]*(t[r]||0);return n}));return n===1&&a&&(l=l[0]),s===1&&o?n===1&&a?l[0]:l.map(e=>e[0]):l}function bm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function xm(e,t,n=[0,0,0]){let r=bm(e,t[0]),i=bm(e,t[1]),a=bm(e,t[2]);return n[0]=r,n[1]=i,n[2]=a,n}function Sm(e){return Cm(e)===`string`}function Cm(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function wm(e,{precision:t=16,unit:n}){return Tm(e)?`none`:(e=+Dm(e,t),e+(n??``))}function Tm(e){return e===null}function Em(e){return Tm(e)?0:e}function Dm(e,t){if(e===0)return 0;let n=~~e,r=0;n&&t&&(r=~~Math.log10(Math.abs(n))+1);let i=10**(t-r);return Math.floor(e*i+.5)/i}function Om(e,t,n){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*n}function km(e,t,n){return(n-e)/(t-e)}function Am(e,t,n){return!e||!t||e===t||e[0]===t[0]&&e[1]===t[1]||isNaN(n)||n===null?n:Om(t[0],t[1],km(e[0],e[1],n))}function jm(e,t,n){return Math.max(Math.min(n,t),e)}function Mm(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function Nm(e,t){return Mm(Math.abs(e)**t,e)}function Pm(e,t){return t===0?0:e/t}function Fm(e,t,n=0,r=e.length){for(;n<r;){let i=n+r>>1;e[i]<t?n=i+1:r=i}return n}function Im(e,t){if(e instanceof t)return!0;let n=t.name;for(;e;){let t=Object.getPrototypeOf(e),r=t?.constructor?.name;if(r===n)return!0;if(!r||r===`Object`)return!1;e=t}return!1}var Lm=Object.freeze({__proto__:null,bisectLeft:Fm,clamp:jm,copySign:Mm,interpolate:Om,interpolateInv:km,isInstance:Im,isNone:Tm,isString:Sm,mapRange:Am,multiplyMatrices:ym,multiply_v3_m3x3:xm,serializeNumber:wm,skipNone:Em,spow:Nm,toPrecision:Dm,type:Cm,zdiv:Pm}),Rm=new class{add(e,t,n){if(typeof arguments[0]!=`string`){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?`unshift`:`push`](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},zm={gamut_mapping:`css`,precision:5,deltaE:`76`,verbose:!0,warn:function(e){this.verbose&&globalThis?.console?.warn?.(e)}},Bm=class{type;coordMeta;coordRange;range;constructor(e,t){if(typeof e==`object`&&(this.coordMeta=e),t&&(this.coordMeta=t,this.coordRange=t.range??t.refRange),typeof e==`string`){let t=e.trim().match(/^(?<type><[a-z]+>)(\[(?<min>-?[.\d]+),\s*(?<max>-?[.\d]+)\])?$/);if(!t)throw TypeError(`Cannot parse ${e} as a type definition.`);this.type=t.groups.type;let{min:n,max:r}=t.groups;(n||r)&&(this.range=[+n,+r])}}get computedRange(){return this.range?this.range:this.type===`<percentage>`?this.percentageRange():this.type===`<angle>`?[0,360]:null}get unit(){return this.type===`<percentage>`?`%`:this.type===`<angle>`?`deg`:``}resolve(e){if(this.type===`<angle>`)return e;let t=this.computedRange,n=this.coordRange;return this.type===`<percentage>`&&(n??=this.percentageRange()),Am(t,n,e)}serialize(e,t){let n=this.type===`<percentage>`?this.percentageRange(100):this.computedRange,r=this.unit;return e=Am(this.coordRange,n,e),wm(e,{unit:r,precision:t})}toString(){let e=this.type;if(this.range){let[t=``,n=``]=this.range;e+=`[${t},${n}]`}return e}percentageRange(e=1){let t;return t=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1],[t[0]*e,t[1]*e]}static get(e,t){return Im(e,this)?e:new this(e,t)}},Vm=Symbol(`instance`),Hm=class e{type;name;spaceCoords;coords;id;alpha;constructor(e,t=e.space){e[Vm]=this,this.type=`function`,this.name=`color`,Object.assign(this,e),this.space=t,this.type!==`custom`&&(this.spaceCoords=Object.values(t.coords),this.coords||=this.spaceCoords.map(e=>{let t=[`<number>`,`<percentage>`];return e.type===`angle`&&t.push(`<angle>`),t}),this.coords=this.coords.map((e,t)=>{let n=this.spaceCoords[t];return typeof e==`string`&&(e=e.trim().split(/\s*\|\s*/)),e.map(e=>Bm.get(e,n))}))}serializeCoords(e,t,n){return n=e.map((e,t)=>Bm.get(n?.[t]??this.coords[t][0],this.spaceCoords[t])),e.map((e,r)=>n[r].serialize(e,t))}coerceCoords(e,t){return Object.entries(this.space.coords).map(([n,r],i)=>{let a=e[i];if(Tm(a)||isNaN(a))return a;let o=t[i],s=this.coords[i].find(e=>e.type==o);if(!s){let e=r.name||n;throw TypeError(`${o??a?.raw??a} not allowed for ${e} in ${this.name}()`)}return a=s.resolve(a),s.range&&(t[i]=s.toString()),a})}canSerialize(){return this.type===`function`||this.serialize}parse(e){return null}static get(t,...n){return!t||Im(t,this)?t:t[Vm]?t[Vm]:new e(t,...n)}},Um={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function Wm(e){return Array.isArray(e)?e:Um[e]}function Gm(e,t,n,r={}){if(e=Wm(e),t=Wm(t),!e||!t)throw TypeError(`Missing white point to convert ${e?``:`from`}${!e&&!t?`/`:``}${t?``:`to`}`);if(e===t)return n;let i={W1:e,W2:t,XYZ:n,options:r};if(Rm.run(`chromatic-adaptation-start`,i),i.M||(i.W1===Um.D65&&i.W2===Um.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Um.D50&&i.W2===Um.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Rm.run(`chromatic-adaptation-end`,i),i.M)return xm(i.XYZ,i.M);throw TypeError(`Only Bradford CAT with white points D50 and D65 supported for now.`)}function Km(e,t){let n={str:String(e)?.trim(),options:t};if(Rm.run(`parse-start`,n),n.color)return n.color;n.parsed=Xm(n.str);let r,i=n.options?n.options.parseMeta??n.options.meta:null;if(n.parsed){let t=n.parsed.name,a,o,s=n.parsed.args,c=s.map((e,t)=>n.parsed.argMeta[t]?.type);if(t===`color`){let r=s.shift();c.shift();let i=r.startsWith(`--`)?r.substring(2):`--${r}`,l=[r,i];if(a=$m.findFormat({name:t,id:l,type:`function`}),!a){let t,a=r in $m.registry?r:i;if(a in $m.registry){let n=$m.registry[a].formats?.color?.id;n&&(t=`Did you mean ${e.replace(`color(`+r,`color(`+n)}?`)}throw TypeError(`Cannot parse ${n.str}. `+(t??`Missing a plugin?`))}o=a.space,a.id.startsWith(`--`)&&!r.startsWith(`--`)&&zm.warn(`${o.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${a.id}) instead of color(${r}).`),r.startsWith(`--`)&&!a.id.startsWith(`--`)&&zm.warn(`${o.name} is a standard space and supported in the CSS spec. Use color(${a.id}) instead of prefixed color(${r}).`)}else a=$m.findFormat({name:t,type:`function`}),o=a.space;i&&Object.assign(i,{format:a,formatId:a.name,types:c,commas:n.parsed.commas});let l=1;n.parsed.lastAlpha&&(l=n.parsed.args.pop(),i&&(i.alphaType=c.pop()));let u=a.coords.length;if(s.length!==u)throw TypeError(`Expected ${u} coordinates for ${o.id} in ${n.str}), got ${s.length}`);s=a.coerceCoords(s,c),r={spaceId:o.id,coords:s,alpha:l}}else spaceloop:for(let e of $m.all)for(let t in e.formats){let a=e.formats[t];if(a.type!==`custom`||a.test&&!a.test(n.str))continue;let o=e.getFormat(a),s=o.parse(n.str);if(s){i&&Object.assign(i,{format:o,formatId:t}),r=s;break spaceloop}}if(!r)throw TypeError(`Could not parse ${e} as a color. Missing a plugin?`);return r.alpha=Tm(r.alpha)?r.alpha:r.alpha===void 0?1:jm(0,r.alpha,1),r}var qm={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},Jm={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp(`(${Object.keys(qm).join(`|`)})$`),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function Ym(e){let t={},n=e.match(Jm.unitValue)?.[0],r=t.raw=e;return n?(t.type=n===`%`?`<percentage>`:`<angle>`,t.unit=n,t.unitless=Number(r.slice(0,-n.length)),r=t.unitless*qm[n]):Jm.number.test(r)?(r=Number(r),t.type=`<number>`):r===`none`?r=null:r===`NaN`||r===`calc(NaN)`?(r=NaN,t.type=`<number>`):t.type=`<ident>`,{value:r,meta:t}}function Xm(e){if(!e)return;e=e.trim();let t=e.match(Jm.function);if(t){let e=[],n=[],r=!1,i=t[1].toLowerCase(),a=t[2].replace(Jm.singleArgument,(t,a)=>{let{value:o,meta:s}=Ym(a);return(t.startsWith(`/`)||i!==`color`&&e.length===3)&&(r=!0),e.push(o),n.push(s),``});return{name:i,args:e,argMeta:n,lastAlpha:r,commas:a.includes(`,`),rawName:t[1],rawArgs:t[2]}}}function Zm(e,t){if(Array.isArray(e))return e.map(e=>Zm(e,t));if(!e)throw TypeError(`Empty color reference`);Sm(e)&&(e=Km(e,t));let n=e.space||e.spaceId;return typeof n==`string`&&(e.space=$m.get(n)),e.alpha===void 0&&(e.alpha=1),e}var Qm=75e-6,$m=class e{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?e.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let n=t.coords??this.base.coords;for(let e in n)`name`in n[e]||(n[e].name=e);this.coords=n;let r=t.white??this.base.white??`D65`;this.white=Wm(r),this.formats=t.formats??{};for(let e in this.formats){let t=this.formats[e];t.type||=`function`,t.name||=e}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),this.gamutSpace=t.gamutSpace?t.gamutSpace===`self`?this:e.get(t.gamutSpace):this.isPolar?this.base:this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.referred=t.referred,Object.defineProperty(this,"path",{value:eh(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Rm.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=Qm}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((e,r)=>{let i=n[r];if(i.type!==`angle`&&i.range){if(Tm(e))return!0;let[n,r]=i.range;return(n===void 0||e>=n-t)&&(r===void 0||e<=r+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!(`range`in e))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type===`angle`)return!0;return!1}getFormat(e){if(!e)return null;e==="default"?e=Object.values(this.formats)[0]:typeof e==`string`&&(e=this.formats[e]);let t=Hm.get(e,this);return t!==e&&e.name in this.formats&&(this.formats[e.name]=t),t}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(t,n){if(arguments.length===1){let e=Zm(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>Tm(e)?0:e);let r=this.path,i=t.path,a,o;for(let e=0;e<r.length&&r[e].equals(i[e]);e++)a=r[e],o=e;if(!a)throw Error(`Cannot convert between color spaces ${this} and ${t}: no connection space was found`);for(let e=r.length-1;e>o;e--)n=r[e].toBase(n);for(let e=o+1;e<i.length;e++)n=i[e].fromBase(n);return n}from(t,n){if(arguments.length===1){let e=Zm(t);[t,n]=[e.space,e.coords]}return t=e.get(t),t.to(this,n)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let n=this.coords[t],r=n.range||n.refRange;e.push(r?.min??0)}return e}static registry={};static get all(){return[...new Set(Object.values(e.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let e of t.aliases)this.register(e,t);return t}static get(t,...n){if(!t||Im(t,this))return t;if(Cm(t)===`string`){let n=e.registry[t.toLowerCase()];if(!n)throw TypeError(`No color space found with id = "${t}"`);return n}if(n.length)return e.get(...n);throw TypeError(`${t} is not a valid color space`)}static findFormat(t,n=e.all){if(!t)return null;typeof t==`string`&&(t={name:t});for(let e of n)for(let[n,r]of Object.entries(e.formats)){r.name??=n,r.type??=`function`;let i=(!t.name||r.name===t.name)&&(!t.type||r.type===t.type);if(t.id){let e=r.ids||[r.id],n=Array.isArray(t.id)?t.id:[t.id];i&&=n.some(t=>e.includes(t))}if(i){let t=Hm.get(r,e);return t!==r&&(e.formats[r.name]=t),t}}return null}static resolveCoord(t,n){let r=Cm(t),i,a;if(r===`string`?t.includes(`.`)?[i,a]=t.split(`.`):[i,a]=[,t]:Array.isArray(t)?[i,a]=t:(i=t.space,a=t.coordId),i=e.get(i),i||=n,!i)throw TypeError(`Cannot resolve coordinate reference ${t}: No color space specified and relative references are not allowed here`);if(r=Cm(a),r===`number`||r===`string`&&a>=0){let e=Object.entries(i.coords)[a];if(e)return{space:i,id:e[0],index:a,...e[1]}}i=e.get(i);let o=a.toLowerCase(),s=0;for(let e in i.coords){let t=i.coords[e];if(e.toLowerCase()===o||t.name?.toLowerCase()===o)return{space:i,id:e,index:s,...t};s++}throw TypeError(`No "${a}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(`, `)}`)}static DEFAULT_FORMAT={type:`functions`,name:`color`}};function eh(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}var th=new $m({id:`xyz-d65`,name:`XYZ D65`,coords:{x:{refRange:[0,1],name:`X`},y:{refRange:[0,1],name:`Y`},z:{refRange:[0,1],name:`Z`}},white:`D65`,formats:{color:{ids:[`xyz-d65`,`xyz`]}},aliases:[`xyz`]}),nh=class extends $m{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=th,e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??=t=>{let n=xm(t,e.toXYZ_M);return this.white!==this.base.white&&(n=Gm(this.white,this.base.white,n)),n},e.fromBase??=t=>(t=Gm(this.base.white,this.white,t),xm(t,e.fromXYZ_M))),e.referred??=`display`,super(e)}};function rh(e,t={}){if(Array.isArray(e))return e.map(e=>rh(e,t));let{cssProperty:n=`background-color`,element:r,...i}=t,a=null;try{return Zm(e,i)}catch(e){a=e}let{CSS:o,getComputedStyle:s}=globalThis;if(Sm(e)&&r&&o&&s&&o.supports(n,e)){let t=r.style[n];e!==t&&(r.style[n]=e);let o=s(r).getPropertyValue(n);if(e!==t&&(r.style[n]=t),o!==e)try{return Zm(o,i)}catch(e){a=e}else a={message:`Color value is a valid CSS color, but it could not be resolved :(`}}return t.errorMeta&&(t.errorMeta.error=a),null}function ih(e,t){e=Zm(e);let n=$m.get(t,t?.space),r=t?.precision,i;return i=!n||e.space.equals(n)?e.coords.slice():n.from(e),r===void 0?i:i.map(e=>Dm(e,r))}function ah(e,t){if(e=Zm(e),t===`alpha`)return e.alpha??1;let{space:n,index:r}=$m.resolveCoord(t,e.space);return ih(e,n)[r]}function oh(e,t,n,r){return e=Zm(e),Array.isArray(t)&&([t,n,r]=[e.space,t,n]),t=$m.get(t),e.coords=t===e.space?n.slice():t.to(e.space,n),r!==void 0&&(e.alpha=r),e}oh.returns=`color`;function sh(e,t,n){if(e=Zm(e),arguments.length===2&&Cm(arguments[1])===`object`){let t=arguments[1];for(let n in t)sh(e,n,t[n])}else if(typeof n==`function`&&(n=n(ah(e,t))),t===`alpha`)e.alpha=n;else{let{space:r,index:i}=$m.resolveCoord(t,e.space),a=ih(e,r);a[i]=n,oh(e,r,a)}return e}sh.returns=`color`;var ch=new $m({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:th,fromBase:e=>Gm(th.white,`D50`,e),toBase:e=>Gm(`D50`,th.white,e)}),lh=216/24389,uh=24/116,dh=24389/27,fh=Um.D50,ph=new $m({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:fh,base:ch,fromBase(e){let t=e.map((e,t)=>e/fh[t]).map(e=>e>lh?Math.cbrt(e):(dh*e+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let[t,n,r]=e,i=[];return i[1]=(t+16)/116,i[0]=n/500+i[1],i[2]=i[1]-r/200,[i[0]>uh?i[0]**3:(116*i[0]-16)/dh,e[0]>8?((e[0]+16)/116)**3:e[0]/dh,i[2]>uh?i[2]**3:(116*i[2]-16)/dh].map((e,t)=>e*fh[t])},formats:{lab:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function mh(e){return typeof e==`number`?(e%360+360)%360:e}function hh(e,t){let[n,r]=t,i=Tm(n),a=Tm(r);if(i&&a)return[n,r];if(i?n=r:a&&(r=n),e===`raw`)return t;n=mh(n),r=mh(r);let o=r-n;return e===`increasing`?o<0&&(r+=360):e===`decreasing`?o>0&&(n+=360):e===`longer`?-180<o&&o<180&&(o>0?n+=360:r+=360):e===`shorter`&&(o>180?n+=360:o<-180&&(r+=360)),[n,r]}var gh=new $m({id:`lch`,name:`LCH`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,150],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:ph,fromBase(e){if(this.ε===void 0){let e=Object.values(this.base.coords)[1].refRange,t=e[1]-e[0];this.ε=t/1e5}let[t,n,r]=e,i=Math.abs(n)<this.ε&&Math.abs(r)<this.ε,a=i?null:mh(Math.atan2(r,n)*180/Math.PI);return[t,i?0:Math.sqrt(n**2+r**2),a]},toBase(e){let[t,n,r]=e,i=null,a=null;return Tm(r)||(n=n<0?0:n,i=n*Math.cos(r*Math.PI/180),a=n*Math.sin(r*Math.PI/180)),[t,i,a]},formats:{lch:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),_h=25**7,vh=Math.PI,yh=180/vh,bh=vh/180;function xh(e){let t=e*e;return t*t*t*e}function Sh(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=Zm([e,t]);let[a,o,s]=ph.from(e),c=gh.from(ph,[a,o,s])[1],[l,u,d]=ph.from(t),f=gh.from(ph,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=xh((c+f)/2),m=.5*(1-Math.sqrt(p/(p+_h))),h=(1+m)*o,g=(1+m)*u,_=Math.sqrt(h**2+s**2),v=Math.sqrt(g**2+d**2),y=h===0&&s===0?0:Math.atan2(s,h),b=g===0&&d===0?0:Math.atan2(d,g);y<0&&(y+=2*vh),b<0&&(b+=2*vh),y*=yh,b*=yh;let x=l-a,S=v-_,C=b-y,w=y+b,T=Math.abs(C),E;_*v===0?E=0:T<=180?E=C:C>180?E=C-360:C<-180?E=C+360:zm.warn(`the unthinkable has happened`);let D=2*Math.sqrt(v*_)*Math.sin(E*bh/2),O=(a+l)/2,k=(_+v)/2,A=xh(k),ee;ee=_*v===0?w:T<=180?w/2:w<360?(w+360)/2:(w-360)/2;let j=(O-50)**2,te=1+.015*j/Math.sqrt(20+j),ne=1+.045*k,M=1;M-=.17*Math.cos((ee-30)*bh),M+=.24*Math.cos(2*ee*bh),M+=.32*Math.cos((3*ee+6)*bh),M-=.2*Math.cos((4*ee-63)*bh);let re=1+.015*k*M,ie=30*Math.exp(-1*((ee-275)/25)**2),ae=2*Math.sqrt(A/(A+_h)),N=-1*Math.sin(2*ie*bh)*ae,P=(x/(n*te))**2;return P+=(S/(r*ne))**2,P+=(D/(i*re))**2,P+=N*(S/(r*ne))*(D/(i*re)),Math.sqrt(P)}var Ch=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],wh=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Th=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Eh=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Dh=new $m({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:th,fromBase(e){let t=xm(e,Ch);return t[0]=Math.cbrt(t[0]),t[1]=Math.cbrt(t[1]),t[2]=Math.cbrt(t[2]),xm(t,Th,t)},toBase(e){let t=xm(e,Eh);return t[0]**=3,t[1]**=3,t[2]**=3,xm(t,wh,t)},formats:{oklab:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function Oh(e,t){[e,t]=Zm([e,t]);let[n,r,i]=Dh.from(e),[a,o,s]=Dh.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}var kh=75e-6;function Ah(e,t,{epsilon:n=kh}={}){e=Zm(e),t||=e.space,t=$m.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function jh(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Mh(e,t,n=`lab`){n=$m.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return Tm(t)||Tm(r)?e:e+(r-t)**2},0))}function Nh(e,t){return Mh(e,t,`lab`)}var Ph=Math.PI/180;function Fh(e,t,{l:n=2,c:r=1}={}){[e,t]=Zm([e,t]);let[i,a,o]=ph.from(e),[,s,c]=gh.from(ph,[i,a,o]),[l,u,d]=ph.from(t),f=gh.from(ph,[l,u,d])[1];s<0&&(s=0),f<0&&(f=0);let p=i-l,m=s-f,h=a-u,g=o-d,_=h**2+g**2-m**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let y=.0638*s/(1+.0131*s)+.638,b;Tm(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*Ph)):.36+Math.abs(.4*Math.cos((c+35)*Ph));let x=s**4,S=Math.sqrt(x/(x+1900)),C=y*(S*b+1-S),w=(p/(n*v))**2;return w+=(m/(r*y))**2,w+=_/C**2,Math.sqrt(w)}var Ih=203,Lh=new $m({id:`xyz-abs-d65`,cssId:`--xyz-abs-d65`,name:`Absolute XYZ D65`,coords:{x:{refRange:[0,9504.7],name:`Xa`},y:{refRange:[0,1e4],name:`Ya`},z:{refRange:[0,10888.3],name:`Za`}},base:th,fromBase(e){return e.map(e=>e*Ih)},toBase(e){return e.map(e=>e/Ih)}}),Rh=1.15,zh=.66,Bh=2610/2**14,Vh=2**14/2610,Hh=3424/4096,Uh=2413/128,Wh=2392/128,Gh=1.7*2523/32,Kh=32/(1.7*2523),qh=-.56,Jh=16295499532821565e-27,Yh=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],Xh=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Zh=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Qh=[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]],$h=new $m({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:Lh,fromBase(e){let[t,n,r]=e,[i,a,o]=xm(xm([Rh*t-.1499999999999999*r,zh*n- -.33999999999999997*t,r],Yh).map(function(e){return Nm((Hh+Uh*Nm(e/1e4,Bh))/(1+Wh*Nm(e/1e4,Bh)),Gh)}),Zh);return[.43999999999999995*i/(1+qh*i)-Jh,a,o]},toBase(e){let[t,n,r]=e,[i,a,o]=xm(xm([(t+Jh)/(.43999999999999995-qh*(t+Jh)),n,r],Qh).map(function(e){return 1e4*Nm((Hh-Nm(e,Kh))/(Wh*Nm(e,Kh)-Uh),Vh)}),Xh),s=(i+.1499999999999999*o)/Rh;return[s,(a+-.33999999999999997*s)/zh,o]},formats:{jzazbz:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),eg=new $m({id:`jzczhz`,name:`JzCzHz`,coords:{jz:{refRange:[0,1],name:`Jz`},cz:{refRange:[0,.26],name:`Chroma`},hz:{refRange:[0,360],type:`angle`,name:`Hue`}},base:$h,fromBase:gh.fromBase,toBase:gh.toBase,formats:{jzczhz:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}});function tg(e,t){[e,t]=Zm([e,t]);let[n,r,i]=eg.from(e),[a,o,s]=eg.from(t),c=n-a,l=r-o;Tm(i)&&Tm(s)?(i=0,s=0):Tm(i)?i=s:Tm(s)&&(s=i);let u=i-s,d=2*Math.sqrt(r*o)*Math.sin(u/2*(Math.PI/180));return Math.sqrt(c**2+l**2+d**2)}var ng=3424/4096,rg=2413/128,ig=2392/128,ag=2610/16384,og=2523/32,sg=16384/2610,cg=32/2523,lg=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],ug=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],dg=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],fg=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],pg=new $m({id:`ictcp`,name:`ICTCP`,coords:{i:{refRange:[0,1],name:`I`},ct:{refRange:[-.5,.5],name:`CT`},cp:{refRange:[-.5,.5],name:`CP`}},base:Lh,fromBase(e){return mg(xm(e,lg))},toBase(e){return xm(hg(e),fg)},formats:{ictcp:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function mg(e){return xm(e.map(function(e){return((ng+rg*(e/1e4)**ag)/(1+ig*(e/1e4)**ag))**og}),ug)}function hg(e){return xm(e,dg).map(function(e){return 1e4*(Math.max(e**cg-ng,0)/(rg-ig*e**cg))**sg})}function gg(e,t){[e,t]=Zm([e,t]);let[n,r,i]=pg.from(e),[a,o,s]=pg.from(t);return 720*Math.sqrt((n-a)**2+.25*(r-o)**2+(i-s)**2)}function _g(e,t){[e,t]=Zm([e,t]);let[n,r,i]=Dh.from(e),[a,o,s]=Dh.from(t),c=n-a,l=2*(r-o),u=2*(i-s);return Math.sqrt(c**2+l**2+u**2)}var vg=Um.D65,yg=.42,bg=1/yg,xg=2*Math.PI,Sg=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],Cg=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],wg=[[460,451,288],[460,-891,-261],[460,-220,-6300]],Tg={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Eg={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},Dg=180/Math.PI,Og=Math.PI/180;function kg(e,t){return e.map(e=>{let n=Nm(t*Math.abs(e)*.01,yg);return 400*Mm(n,e)/(n+27.13)})}function Ag(e,t){let n=100/t*27.13**bg;return e.map(e=>{let t=Math.abs(e);return Mm(n*Nm(t/(400-t),bg),e)})}function jg(e){let t=mh(e);t<=Eg.h[0]&&(t+=360);let n=Fm(Eg.h,t)-1,[r,i]=Eg.h.slice(n,n+2),[a,o]=Eg.e.slice(n,n+2),s=Eg.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function Mg(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=Eg.h.slice(n,n+2),[a,o]=Eg.e.slice(n,n+2);return mh((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function Ng(e,t,n,r,i){let a={};a.discounting=i,a.refWhite=e,a.surround=r;let o=e.map(e=>e*100);a.la=t,a.yb=n;let s=o[1],c=xm(o,Sg),l=Tg[a.surround],u=l[0];a.c=l[1],a.nc=l[2];let d=(1/(5*a.la+1))**4;a.fl=d*a.la+.1*(1-d)*(1-d)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/s,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let f=Math.max(Math.min(u*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=c.map(e=>Om(1,s/e,f)),a.dRgbInv=a.dRgb.map(e=>1/e);let p=kg(c.map((e,t)=>e*a.dRgb[t]),a.fl);return a.aW=a.nbb*(2*p[0]+p[1]+.05*p[2]),a}var Pg=Ng(vg,64/Math.PI*.2,20,`average`,!1);function Fg(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw Error(`Conversion requires one and only one: 'J' or 'Q'`);if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw Error(`Conversion requires one and only one: 'C', 'M' or 's'`);if(!(e.h!==void 0^e.H!==void 0))throw Error(`Conversion requires one and only one: 'h' or 'H'`);if(e.J===0||e.Q===0)return[0,0,0];let n=0;n=e.h===void 0?Mg(e.H)*Og:mh(e.h)*Og;let r=Math.cos(n),i=Math.sin(n),a=0;e.J===void 0?e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot)):a=Nm(e.J,1/2)*.1;let o=0;e.C===void 0?e.M===void 0?e.s!==void 0&&(o=4e-4*e.s**2*(t.aW+4)/t.c):o=e.M/t.flRoot/a:o=e.C/a;let s=Nm(o*(1.64-.29**t.n)**-.73,10/9),c=.25*(Math.cos(n+2)+3.8),l=t.aW*Nm(a,2/t.c/t.z),u=5e4/13*t.nc*t.ncb*c,d=l/t.nbb,f=23*(d+.305)*Pm(s,23*u+s*(11*r+108*i));return xm(Ag(xm([d,f*r,f*i],wg).map(e=>e*1/1403),t.fl).map((e,n)=>e*t.dRgbInv[n]),Cg).map(e=>e/100)}function Ig(e,t){let n=kg(xm(e.map(e=>e*100),Sg).map((e,n)=>e*t.dRgb[n]),t.fl),r=n[0]+(-12*n[1]+n[2])/11,i=(n[0]+n[1]-2*n[2])/9,a=(Math.atan2(i,r)%xg+xg)%xg,o=.25*(Math.cos(a+2)+3.8),s=Nm(5e4/13*t.nc*t.ncb*Pm(o*Math.sqrt(r**2+i**2),n[0]+n[1]+1.05*n[2]+.305),.9)*(1.64-.29**t.n)**.73,c=Nm(t.nbb*(2*n[0]+n[1]+.05*n[2])/t.aW,.5*t.c*t.z),l=100*Nm(c,2),u=4/t.c*c*(t.aW+4)*t.flRoot,d=s*c,f=d*t.flRoot,p=mh(a*Dg),m=jg(p);return{J:l,C:d,h:p,s:50*Nm(t.c*s/(t.aW+4),1/2),Q:u,M:f,H:m}}var Lg=new $m({id:`cam16-jmh`,cssId:`--cam16-jmh`,name:`CAM16-JMh`,coords:{j:{refRange:[0,100],name:`J`},m:{refRange:[0,105],name:`Colorfulness`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:th,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let t=Ig(e,Pg),n=Math.abs(t.M)<this.ε;return[t.J,n?0:t.M,n?null:t.h]},toBase(e){return Fg({J:e[0],M:e[1],h:e[2]},Pg)}}),Rg=Um.D65,zg=216/24389,Bg=24389/27;function Vg(e){return 116*(e>zg?Math.cbrt(e):(Bg*e+16)/116)-16}function Hg(e){return e>8?((e+16)/116)**3:e/Bg}function Ug(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=Hg(i);o=i>0?.00379058511492914*i**2+.608983189401032*i+.9155088574762233:9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;let c=0,l=1/0;for(;c<=15;){a=Fg({J:o,C:r,h:n},t);let e=Math.abs(a[1]-s);if(e<l){if(e<=2e-12)return a;l=e}o-=(a[1]-s)*o/(2*a[1]),c+=1}return Fg({J:o,C:r,h:n},t)}function Wg(e,t){let n=Vg(e[1]);if(n===0)return[0,0,0];let r=Ig(e,Gg);return[mh(r.h),r.C,n]}var Gg=Ng(Rg,200/Math.PI*Hg(50),Hg(50)*100,`average`,!1),Kg=new $m({id:`hct`,name:`HCT`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},c:{refRange:[0,145],name:`Colorfulness`},t:{refRange:[0,100],name:`Tone`}},base:th,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let t=Wg(e);return t[1]<this.ε&&(t[1]=0,t[0]=null),t},toBase(e){return Ug(e,Gg)},formats:{color:{id:`--hct`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),qg=Math.PI/180,Jg=[1,.007,.0228];function Yg(e){e[1]<0&&(e=Kg.fromBase(Kg.toBase(e)));let t=Math.log(Math.max(1+Jg[2]*e[1]*Gg.flRoot,1))/Jg[2],n=e[0]*qg,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function Xg(e,t){[e,t]=Zm([e,t]);let[n,r,i]=Yg(Kg.from(e)),[a,o,s]=Yg(Kg.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var Zg={deltaE76:Nh,deltaECMC:Fh,deltaE2000:Sh,deltaEJz:tg,deltaEITP:gg,deltaEOK:Oh,deltaEOK2:_g,deltaEHCT:Xg};function Qg(e){return Math.max(parseFloat(`1e${(e?Math.floor(Math.log10(Math.abs(e))):0)-2}`),1e-6)}var $g={hct:{method:`hct.c`,jnd:2,deltaEMethod:`hct`,blackWhiteClamp:{}},"hct-tonal":{method:`hct.c`,jnd:0,deltaEMethod:`hct`,blackWhiteClamp:{channel:`hct.t`,min:0,max:100}}};function e_(e,{method:t=zm.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a=void 0}={}){if(e=Zm(e),Sm(arguments[1])?n=arguments[1]:n||=e.space,n=$m.get(n),Ah(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=n_(e,{space:n});else{if(t!==`clip`&&!Ah(e,n)){Object.prototype.hasOwnProperty.call($g,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=$g[t]);let s=Sh;if(r!==``){for(let e in Zg)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=Zg[e];break}}i===0&&(i=1e-16);let c=e_(r_(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(a&&Object.keys(a).length===3){let t=$m.resolveCoord(a.channel),n=ah(r_(e,t.space),t.id);if(Tm(n)&&(n=0),n>=a.max)return r_({space:`xyz-d65`,coords:Um.D65},e.space);if(n<=a.min)return r_({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=$m.resolveCoord(t),c=r.space,l=r.id,u=r_(e,c);u.coords.forEach((e,t)=>{Tm(e)&&(u.coords[t]=0)});let d=(r.range||r.refRange)[0],f=Qg(i),p=d,m=ah(u,l);for(;m-p>f;){let e=jh(u);e=e_(e,{space:n,method:`clip`}),s(u,e)-i<f?p=ah(u,l):m=ah(u,l),sh(u,l,(p+m)/2)}o=r_(u,n)}else o=c}else o=r_(e,n);if(t===`clip`||!Ah(o,n,{epsilon:0})){let e=Object.values(n.coords).map(e=>e.range||[]);o.coords=o.coords.map((t,n)=>{let[r,i]=e[n];return r!==void 0&&(t=Math.max(r,t)),i!==void 0&&(t=Math.min(t,i)),t})}}return n!==e.space&&(o=r_(o,e.space)),e.coords=o.coords,e}e_.returns=`color`;var t_={WHITE:{space:Dh,coords:[1,0,0],alpha:1},BLACK:{space:Dh,coords:[0,0,0],alpha:1}};function n_(e,{space:t}={}){let n=.02,r=1e-4;e=Zm(e),t||=e.space,t=$m.get(t);let i=$m.get(`oklch`);if(t.isUnbounded)return r_(e,t);let a=r_(e,i),o=a.coords[0];if(o>=1){let n=r_(t_.WHITE,t);return n.alpha=e.alpha,r_(n,t)}if(o<=0){let n=r_(t_.BLACK,t);return n.alpha=e.alpha,r_(n,t)}if(Ah(a,t,{epsilon:0}))return r_(a,t);function s(e){let n=r_(e,t),r=Object.values(t.coords);return n.coords=n.coords.map((e,t)=>{if(`range`in r[t]){let[n,i]=r[t].range;return jm(n,e,i)}return e}),n}let c=0,l=a.coords[1],u=!0,d=jh(a),f=s(d),p=Oh(f,d);if(p<n)return f;for(;l-c>r;){let e=(c+l)/2;if(d.coords[1]=e,u&&Ah(d,t,{epsilon:0}))c=e;else if(f=s(d),p=Oh(f,d),p<n){if(n-p<r)break;u=!1,c=e}else l=e}return f}function r_(e,t,{inGamut:n}={}){e=Zm(e),t=$m.get(t);let r=t.from(e),i={space:t,coords:r,alpha:e.alpha};return n&&(i=e_(i,n===!0?void 0:n)),i}r_.returns=`color`;function i_(e,t={}){let{precision:n=zm.precision,format:r,inGamut:i=!0,coords:a,alpha:o,commas:s}=t,c,l=Zm(e),u=r,d=l.parseMeta;d&&!r&&(d.format.canSerialize()&&(r=d.format,u=d.formatId),a??=d.types,o??=d.alphaType,s??=d.commas),u&&(r=l.space.getFormat(r)??$m.findFormat(u)),r||(r=l.space.getFormat(`default`)??$m.DEFAULT_FORMAT,u=r.name),r&&r.space&&r.space!==l.space&&(l=r_(l,r.space));let f=l.coords.slice();if(i||=r.toGamut,i&&!Ah(l)&&(f=e_(jh(l),i===!0?void 0:i).coords),r.type===`custom`){if(r.serialize)c=r.serialize(f,l.alpha,t);else throw TypeError(`format ${u} can only be used to parse colors, not for serialization`)}else{let e=r.name||`color`,t=r.serializeCoords(f,n,a);if(e===`color`){let e=r.id||r.ids?.[0]||l.space.cssId||l.space.id;t.unshift(e)}let i=l.alpha;o!==void 0&&typeof o!=`object`&&(o=typeof o==`string`?{type:o}:{include:o});let u=o?.type??`<number>`,d=o?.include===!0||r.alpha===!0||o?.include!==!1&&r.alpha!==!1&&i<1,p=``;if(s??=r.commas,d){if(n!==null){let e;u===`<percentage>`&&(e=`%`,i*=100),i=wm(i,{precision:n,unit:e})}p=`${s?`,`:` /`} ${i}`}c=`${e}(${t.join(s?`, `:` `)}${p})`}return c}var a_=new nh({id:`rec2020-linear`,cssId:`--rec2020-linear`,name:`Linear REC.2020`,white:`D65`,toXYZ_M:[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],fromXYZ_M:[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]]}),o_=new nh({id:`rec2020`,name:`REC.2020`,base:a_,toBase(e){return e.map(function(e){let t=e<0?-1:1;return t*(e*t)**2.4})},fromBase(e){return e.map(function(e){let t=e<0?-1:1;return t*(e*t)**(1/2.4)})}}),s_=new nh({id:`p3-linear`,cssId:`display-p3-linear`,name:`Linear P3`,white:`D65`,toXYZ_M:[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fromXYZ_M:[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]]}),c_=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],l_=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],u_=new nh({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,toXYZ_M:c_,fromXYZ_M:l_}),d_={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},f_=[,,,].fill(`<percentage> | <number>[0, 255]`),p_=[,,,].fill(`<number>[0, 255]`),m_=new nh({id:`srgb`,name:`sRGB`,base:u_,fromBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:f_},rgb_number:{name:`rgb`,commas:!0,coords:p_,alpha:!1},color:{},rgba:{coords:f_,commas:!0,alpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:p_},hex:{type:`custom`,toGamut:!0,test:e=>/^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,`$&$&`));let t=[];return e.replace(/[a-f0-9]{2}/gi,e=>{t.push(parseInt(e,16)/255)}),{spaceId:`srgb`,coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:n=!0,alpha:r}={})=>{(r!==!1&&t<1||r===!0)&&e.push(t),e=e.map(e=>Math.round(e*255));let i=n&&e.every(e=>e%17==0);return`#`+e.map(e=>i?(e/17).toString(16):e.toString(16).padStart(2,`0`)).join(``)}},keyword:{type:`custom`,test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:`srgb`,coords:null,alpha:1};if(e===`transparent`?(t.coords=d_.black,t.alpha=0):t.coords=d_[e],t.coords)return t}}}}),h_=new nh({id:`p3`,cssId:`display-p3`,name:`P3`,base:s_,fromBase:m_.fromBase,toBase:m_.toBase});zm.display_space=m_;var g_;if(typeof CSS<`u`&&CSS.supports)for(let e of[ph,o_,h_]){let t=i_({space:e,coords:e.getMinCoords(),alpha:1});if(CSS.supports(`color`,t)){zm.display_space=e;break}}function __(e,{space:t=zm.display_space,...n}={}){e=Zm(e);let r=i_(e,n);if(typeof CSS>`u`||CSS.supports(`color`,r)||!zm.display_space)r=new String(r),r.color=e;else{let i=e;if((e.coords.some(Tm)||Tm(e.alpha))&&!(g_??=CSS.supports(`color`,`hsl(none 50% 50%)`))&&(i=jh(e),i.coords=i.coords.map(Em),i.alpha=Em(i.alpha),r=i_(i,n),CSS.supports(`color`,r)))return r=new String(r),r.color=i,r;i=r_(i,t),r=new String(i_(i,n)),r.color=i}return r}function v_(e,t,{space:n,hue:r=`shorter`}={}){e=Zm(e),n||=e.space,n=$m.get(n);let i=Object.values(n.coords);[e,t]=[e,t].map(e=>r_(e,n));let[a,o]=[e,t].map(e=>e.coords),s=a.map((e,t)=>{let n=i[t],a=o[t];return n.type===`angle`&&([e,a]=hh(r,[e,a])),y_(e,a)}),c=y_(e.alpha,t.alpha);return{space:n,coords:s,alpha:c}}function y_(e,t){return Tm(e)||Tm(t)?e===t?null:0:e-t}function b_(e,t){return e=Zm(e),t=Zm(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}function x_(e){return ah(e,[th,`y`])}function S_(e,t){sh(e,[th,`y`],t)}function C_(e){Object.defineProperty(e.prototype,"luminance",{get(){return x_(this)},set(e){S_(this,e)}})}var w_=Object.freeze({__proto__:null,getLuminance:x_,register:C_,setLuminance:S_});function T_(e,t){e=Zm(e),t=Zm(t);let n=Math.max(x_(e),0),r=Math.max(x_(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}var E_=.56,D_=.57,O_=.62,k_=.65,A_=.022,j_=1.414,M_=.1,N_=5e-4,P_=1.14,F_=.027,I_=1.14;function L_(e){return e>=A_?e:e+(A_-e)**j_}function R_(e){return(e<0?-1:1)*Math.abs(e)**2.4}function z_(e,t){t=Zm(t),e=Zm(e);let n,r,i,a,o,s;t=r_(t,`srgb`),[a,o,s]=t.coords.map(e=>Tm(e)?0:e);let c=R_(a)*.2126729+R_(o)*.7151522+R_(s)*.072175;e=r_(e,`srgb`),[a,o,s]=e.coords.map(e=>Tm(e)?0:e);let l=R_(a)*.2126729+R_(o)*.7151522+R_(s)*.072175,u=L_(c),d=L_(l),f=d>u;return Math.abs(d-u)<N_?r=0:f?(n=d**E_-u**D_,r=n*P_):(n=d**k_-u**O_,r=n*I_),i=Math.abs(r)<M_?0:r>0?r-F_:r+F_,i*100}function B_(e,t){e=Zm(e),t=Zm(t);let n=Math.max(x_(e),0),r=Math.max(x_(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}var V_=5e4;function H_(e,t){e=Zm(e),t=Zm(t);let n=Math.max(x_(e),0),r=Math.max(x_(t),0);return r>n&&([n,r]=[r,n]),r===0?V_:(n-r)/r}function U_(e,t){e=Zm(e),t=Zm(t);let n=ah(e,[ph,`l`]),r=ah(t,[ph,`l`]);return Math.abs(n-r)}var W_=216/24389,G_=24/116,K_=24389/27,q_=Um.D65,J_=new $m({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:q_,base:th,fromBase(e){let t=e.map((e,t)=>e/q_[t]).map(e=>e>W_?Math.cbrt(e):(K_*e+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let t=[];return t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200,[t[0]>G_?t[0]**3:(116*t[0]-16)/K_,e[0]>8?((e[0]+16)/116)**3:e[0]/K_,t[2]>G_?t[2]**3:(116*t[2]-16)/K_].map((e,t)=>e*q_[t])},formats:{"lab-d65":{coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),Y_=5**.5*.5+.5;function X_(e,t){e=Zm(e),t=Zm(t);let n=ah(e,[J_,`l`]),r=ah(t,[J_,`l`]),i=Math.abs(n**+Y_-r**+Y_)**(1/Y_)*Math.SQRT2-40;return i<7.5?0:i}var Z_=Object.freeze({__proto__:null,contrastAPCA:z_,contrastDeltaPhi:X_,contrastLstar:U_,contrastMichelson:B_,contrastWCAG21:T_,contrastWeber:H_});function Q_(e,t,n){Sm(n)&&(n={algorithm:n});let{algorithm:r,...i}=n||{};if(!r){let e=Object.keys(Z_).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}e=Zm(e),t=Zm(t);for(let n in Z_)if(`contrast`+r.toLowerCase()===n.toLowerCase())return Z_[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}function $_(e){let[t,n,r]=ih(e,th),i=t+15*n+3*r;return[4*t/i,9*n/i]}function ev(e){let[t,n,r]=ih(e,th),i=t+n+r;return[t/i,n/i]}function tv(e){Object.defineProperty(e.prototype,"uv",{get(){return $_(this)}}),Object.defineProperty(e.prototype,"xy",{get(){return ev(this)}})}var nv=Object.freeze({__proto__:null,register:tv,uv:$_,xy:ev});function rv(e,t,n={}){Sm(n)&&(n={method:n});let{method:r=zm.deltaE,...i}=n;for(let n in Zg)if(`deltae`+r.toLowerCase()===n.toLowerCase())return Zg[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}function iv(e,t=.25){return sh(e,[$m.get(`oklch`,`lch`),`l`],e=>e*(1+t))}function av(e,t=.25){return sh(e,[$m.get(`oklch`,`lch`),`l`],e=>e*(1-t))}iv.returns=`color`,av.returns=`color`;var ov=Object.freeze({__proto__:null,darken:av,lighten:iv});function sv(e,t,n,r={}){return[e,t]=[Zm(e),Zm(t)],Cm(n)===`object`&&([n,r]=[.5,n]),lv(e,t,r)(n??.5)}function cv(e,t,n={}){let r;uv(e)&&([r,n]=[e,t],[e,t]=r.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:a,steps:o=2,maxSteps:s=1e3,...c}=n;r||=([e,t]=[Zm(e),Zm(t)],lv(e,t,c));let l=rv(e,t),u=i>0?Math.max(o,Math.ceil(l/i)+1):o,d=[];if(s!==void 0&&(u=Math.min(u,s)),u===1)d=[{p:.5,color:r(.5)}];else{let e=1/(u-1);d=Array.from({length:u},(t,n)=>{let i=n*e;return{p:i,color:r(i)}})}if(i>0){let e=d.reduce((e,t,n)=>{if(n===0)return 0;let r=rv(t.color,d[n-1].color,a);return Math.max(e,r)},0);for(;e>i;){e=0;for(let t=1;t<d.length&&d.length<s;t++){let n=d[t-1],i=d[t],a=(i.p+n.p)/2,o=r(a);e=Math.max(e,rv(o,n.color),rv(o,i.color)),d.splice(t,0,{p:a,color:r(a)}),t++}}}return d=d.map(e=>e.color),d}function lv(e,t,n={}){if(uv(e)){let[n,r]=[e,t];return lv(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=Zm(e),t=Zm(t),e=jh(e),t=jh(t);let s={colors:[e,t],options:n};if(r=r?$m.get(r):$m.registry[zm.interpolationSpace]||e.space,i=i?$m.get(i):r,e=r_(e,r),t=r_(t,r),e=e_(e),t=e_(t),r.coords.h&&r.coords.h.type===`angle`){let i=n.hue=n.hue||`shorter`,a=[r,`h`],[o,s]=[ah(e,a),ah(t,a)];Tm(o)&&!Tm(s)?o=s:Tm(s)&&!Tm(o)&&(s=o),[o,s]=hh(i,[o,s]),sh(e,a,o),sh(t,a,s)}return o&&(e.coords=e.coords.map(t=>t*e.alpha),t.coords=t.coords.map(e=>e*t.alpha)),Object.assign(n=>{n=a?a(n):n;let s=e.coords.map((e,r)=>{let i=t.coords[r];return Om(e,i,n)}),c=Om(e.alpha,t.alpha,n),l={space:r,coords:s,alpha:c};return o&&(l.coords=l.coords.map(e=>e/c)),i!==r&&(l=r_(l,i)),l},{rangeArgs:s})}function uv(e){return Cm(e)===`function`&&!!e.rangeArgs}zm.interpolationSpace=`lab`;function dv(e){e.defineFunction(`mix`,sv,{returns:`color`}),e.defineFunction(`range`,lv,{returns:`function<color>`}),e.defineFunction(`steps`,cv,{returns:`array<color>`})}var fv=Object.freeze({__proto__:null,isRange:uv,mix:sv,range:lv,register:dv,steps:cv}),pv=new $m({id:`hsl`,name:`HSL`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:m_,fromBase:e=>{let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[null,0,(n+t)/2],l=t-n;if(l!==0){switch(s=c===0||c===1?0:(t-c)/Math.min(c,1-c),t){case r:o=(i-a)/l+(i<a?6:0);break;case i:o=(a-r)/l+2;break;case a:o=(r-i)/l+4}o*=60}return s<0&&(o+=180,s=Math.abs(s)),o>=360&&(o-=360),[o,s*100,c*100]},toBase:e=>{let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/30)%12,a=n*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]},hsla:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`],commas:!0,alpha:!0}}}),mv=new $m({id:`hsv`,name:`HSV`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},v:{range:[0,100],name:`Value`}},base:m_,fromBase(e){let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[null,0,t],l=t-n;if(l!==0){switch(t){case r:o=(i-a)/l+(i<a?6:0);break;case i:o=(a-r)/l+2;break;case a:o=(r-i)/l+4}o*=60}return c&&(s=l/c),o>=360&&(o-=360),[o,s*100,c*100]},toBase(e){let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/60)%6;return r-r*n*Math.max(0,Math.min(i,4-i,1))}return[i(5),i(3),i(1)]},formats:{color:{id:`--hsv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),hv=new $m({id:`hwb`,name:`HWB`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},w:{range:[0,100],name:`Whiteness`},b:{range:[0,100],name:`Blackness`}},base:mv,fromBase(e){let[t,n,r]=e;return[t,r*(100-n)/100,100-r]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=n+r;if(i>=1)return[t,0,n/i*100];let a=1-r;return[t,(a===0?0:1-n/a)*100,a*100]},formats:{hwb:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),gv=new nh({id:`a98rgb-linear`,cssId:`--a98-rgb-linear`,name:`Linear Adobe® 98 RGB compatible`,white:`D65`,toXYZ_M:[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],fromXYZ_M:[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]]}),_v=new nh({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:gv,toBase:e=>e.map(e=>Math.abs(e)**(563/256)*Math.sign(e)),fromBase:e=>e.map(e=>Math.abs(e)**(256/563)*Math.sign(e))}),vv=new nh({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:ch,toXYZ_M:[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fromXYZ_M:[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]]}),yv=1/512,bv=16/512,xv=new nh({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:vv,toBase(e){return e.map(e=>{let t=e<0?-1:1,n=e*t;return n<bv?e/16:t*n**1.8})},fromBase(e){return e.map(e=>{let t=e<0?-1:1,n=e*t;return n>=yv?t*n**(1/1.8):16*e})}}),Sv=1.09929682680944,Cv=.018053968510807,wv=new nh({id:`--rec2020-oetf`,name:`REC.2020_Scene_Referred`,base:a_,referred:`scene`,toBase(e){return e.map(function(e){let t=e<0?-1:1,n=e*t;return n<Cv*4.5?e/4.5:t*((n+Sv-1)/Sv)**(1/.45)})},fromBase(e){return e.map(function(e){let t=e<0?-1:1,n=e*t;return n>=Cv?t*(Sv*n**.45-.09929682680944008):4.5*e})}}),Tv=new $m({id:`oklch`,name:`OkLCh`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:Dh,fromBase:gh.fromBase,toBase:gh.toBase,formats:{oklch:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),Ev=2*Math.PI,Dv=[[4.076741636075958,-3.307711539258063,.2309699031821043],[-1.2684379732850315,2.609757349287688,-.341319376002657],[-.0041960761386756,-.7034186179359362,1.7076146940746117]],Ov=[[[-1.8817031,-.80936501],[1.19086277,1.76576728,.59662641,.75515197,.56771245]],[[1.8144408,-1.19445267],[.73956515,-.45954404,.08285427,.12541073,-.14503204]],[[.13110758,1.81333971],[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167]]],kv=Number.MAX_VALUE,Av=.206,jv=.03,Mv=1.206/1.03;function Nv(e,t){let n=e.length;if(n!==t.length)throw Error(`Vectors of size ${n} and ${t.length} are not aligned`);let r=0;return e.forEach((e,n)=>{r+=e*t[n]}),r}function Pv(e){return .5*(Mv*e-Av+Math.sqrt((Mv*e-Av)*(Mv*e-Av)+4*jv*Mv*e))}function Fv(e){return(e**2+Av*e)/(Mv*(e+jv))}function Iv(e){let[t,n]=e;return[n/t,n/(1-t)]}function Lv(e,t){return[.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e))))]}function Rv(e,t){let n=xm(e,Eh);return n[0]**=3,n[1]**=3,n[2]**=3,xm(n,t,n)}function zv(e,t,n,r){let i=Hv(e,t,n,r),a=Rv([1,i*e,i*t],n),o=Nm(1/Math.max(...a),1/3);return[o,o*i]}function Bv(e,t,n,r,i,a,o,s){let c;if(s===void 0&&(s=zv(e,t,a,o)),(n-i)*s[1]-(s[0]-i)*r<=0)c=s[1]*i/(r*s[0]+s[1]*(i-n));else{c=s[1]*(i-1)/(r*(s[0]-1)+s[1]*(i-n));let o=n-i,l=r,u=Nv(Eh[0].slice(1),[e,t]),d=Nv(Eh[1].slice(1),[e,t]),f=Nv(Eh[2].slice(1),[e,t]),p=o+l*u,m=o+l*d,h=o+l*f,g=i*(1-c)+c*n,_=c*r,v=g+_*u,y=g+_*d,b=g+_*f,x=v**3,S=y**3,C=b**3,w=3*p*v**2,T=3*m*y**2,E=3*h*b**2,D=6*p**2*v,O=6*m**2*y,k=6*h**2*b,A=Nv(a[0],[x,S,C])-1,ee=Nv(a[0],[w,T,E]),j=Nv(a[0],[D,O,k]),te=ee/(ee*ee-.5*A*j),ne=-A*te,M=Nv(a[1],[x,S,C])-1,re=Nv(a[1],[w,T,E]),ie=Nv(a[1],[D,O,k]),ae=re/(re*re-.5*M*ie),N=-M*ae,P=Nv(a[2],[x,S,C])-1,F=Nv(a[2],[w,T,E]),I=Nv(a[2],[D,O,k]),oe=F/(F*F-.5*P*I),se=-P*oe;ne=te>=0?ne:kv,N=ae>=0?N:kv,se=oe>=0?se:kv,c+=Math.min(ne,Math.min(N,se))}return c}function Vv(e,t,n){let[r,i,a]=e,o=zv(i,a,t,n),s=Bv(i,a,r,1,r,t,n,o),c=Iv(o),l=s/Math.min(r*c[0],(1-r)*c[1]),u=Lv(i,a),d=r*u[0],f=(1-r)*u[1],p=.9*l*Math.sqrt(Math.sqrt(1/(1/d**4+1/f**4)));return d=r*.4,f=(1-r)*.8,[Math.sqrt(1/(1/d**2+1/f**2)),p,s]}function Hv(e,t,n,r){let i,a,o,s,c,l,u,d;Nv(r[0][0],[e,t])>1?([i,a,o,s,c]=r[0][1],[l,u,d]=n[0]):Nv(r[1][0],[e,t])>1?([i,a,o,s,c]=r[1][1],[l,u,d]=n[1]):([i,a,o,s,c]=r[2][1],[l,u,d]=n[2]);let f=i+a*e+o*t+s*e**2+c*e*t,p=Nv(Eh[0].slice(1),[e,t]),m=Nv(Eh[1].slice(1),[e,t]),h=Nv(Eh[2].slice(1),[e,t]),g=1+f*p,_=1+f*m,v=1+f*h,y=g**3,b=_**3,x=v**3,S=3*p*g**2,C=3*m*_**2,w=3*h*v**2,T=6*p**2*g,E=6*m**2*_,D=6*h**2*v,O=l*y+u*b+d*x,k=l*S+u*C+d*w,A=l*T+u*E+d*D;return f-=O*k/(k**2-.5*O*A),f}function Uv(e,t,n){let[r,i,a]=e,o=Fv(a),s=null,c=null;if(r=mh(r)/360,o!==0&&o!==1&&i!==0){let e=Math.cos(Ev*r),a=Math.sin(Ev*r),[l,u,d]=Vv([o,e,a],t,n),f=.8,p,m,h,g;i<f?(p=1.25*i,m=0,h=f*l,g=1-h/u):(p=5*(i-.8),m=u,h=.2*u**2*1.25**2/l,g=1-h/(d-u));let _=m+p*h/(1-g*p);s=_*e,c=_*a}return[o,s,c]}function Wv(e,t,n){let r=e[0],i=0,a=Pv(r),o=Math.sqrt(e[1]**2+e[2]**2),s=.5+Math.atan2(-e[2],-e[1])/Ev;if(a!==0&&a!==1&&o!==0){let[a,s,c]=Vv([r,e[1]/o,e[2]/o],t,n),l=.8,u,d,f,p;o<s?(d=l*a,f=1-d/s,p=o/(d+f*o),i=p*l):(u=s,d=.2*s**2*1.25**2/a,f=1-d/(c-s),p=(o-u)/(d+f*(o-u)),i=l+.2*p)}let c=Math.abs(i)<1e-4;return c||a===0||Math.abs(1-a)<1e-7?(s=null,c||(i=0)):s=mh(s*360),[s,i,a]}var Gv=new $m({id:`okhsl`,name:`Okhsl`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,1],name:`Saturation`},l:{range:[0,1],name:`Lightness`}},base:Dh,gamutSpace:`self`,fromBase(e){return Wv(e,Dv,Ov)},toBase(e){return Uv(e,Dv,Ov)},formats:{color:{id:`--okhsl`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Kv=new $m({id:`oklrab`,name:`Oklrab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:Dh,fromBase(e){return[Pv(e[0]),e[1],e[2]]},toBase(e){return[Fv(e[0]),e[1],e[2]]},formats:{color:{coords:[`<percentage> | <number>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}}),qv=new $m({id:`oklrch`,name:`Oklrch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:Kv,fromBase:gh.fromBase,toBase:gh.toBase,formats:{color:{coords:[`<percentage> | <number>`,`<number> | <percentage>[0,1]`,`<number> | <angle>`]}}});function Jv(e,t,n){let[r,i,a]=e;r=mh(r)/360;let o=Fv(a),s=null,c=null;if(o!==0&&i!==0){let e=Math.cos(Ev*r),l=Math.sin(Ev*r),[u,d]=Iv(zv(e,l,t,n)),f=.5,p=1-f/u,m=1-i*f/(f+d-d*p*i),h=i*d*f/(f+d-d*p*i);o=a*m;let g=a*h,_=Fv(m),v=h*_/m,y=Fv(o);g=g*y/o,o=y;let[b,x,S]=Rv([_,e*v,l*v],t),C=Nm(1/Math.max(Math.max(b,x),Math.max(S,0)),1/3);o*=C,g*=C,s=g*e,c=g*l}return[o,s,c]}function Yv(e,t,n){let r=e[0],i=0,a=Pv(r),o=Math.sqrt(e[1]**2+e[2]**2),s=.5+Math.atan2(-e[2],-e[1])/Ev;if(r!==0&&r!==1&&o!==0){let s=e[1]/o,c=e[2]/o,[l,u]=Iv(zv(s,c,t,n)),d=.5,f=1-d/l,p=u/(o+r*u),m=p*r,h=p*o,g=Fv(m),_=h*g/m,[v,y,b]=Rv([g,s*_,c*_],t),x=Nm(1/Math.max(Math.max(v,y),Math.max(b,0)),1/3);r/=x,o/=x,o=o*Pv(r)/r,r=Pv(r),a=r/m,i=(d+u)*h/(u*d+u*f*h)}return s=Math.abs(i)<1e-4||a===0?null:mh(s*360),[s,i,a]}var Xv=new $m({id:`okhsv`,name:`Okhsv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,1],name:`Saturation`},v:{range:[0,1],name:`Value`}},base:Dh,gamutSpace:`self`,fromBase(e){return Yv(e,Dv,Ov)},toBase(e){return Jv(e,Dv,Ov)},formats:{color:{id:`--okhsv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Zv=Um.D65,Qv=216/24389,$v=24389/27,[ey,ty]=$_({space:th,coords:Zv}),ny=new $m({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:Zv,base:th,fromBase(e){let t=[Em(e[0]),Em(e[1]),Em(e[2])],n=t[1],[r,i]=$_({space:th,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=Qv?$v*n:116*Math.cbrt(n)-16;return[a,13*a*(r-ey),13*a*(i-ty)]},toBase(e){let[t,n,r]=e;if(t===0||Tm(t))return[0,0,0];n=Em(n),r=Em(r);let i=n/(13*t)+ey,a=r/(13*t)+ty,o=t<=8?t/$v:((t+16)/116)**3;return[o*(9*i/(4*a)),o,o*((12-3*i-20*a)/(4*a))]},formats:{color:{id:`--luv`,coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),ry=new $m({id:`lchuv`,name:`LChuv`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,220],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:ny,fromBase:gh.fromBase,toBase:gh.toBase,formats:{color:{id:`--lchuv`,coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),iy=216/24389,ay=24389/27,oy=l_[0][0],sy=l_[0][1],cy=l_[0][2],ly=l_[1][0],uy=l_[1][1],dy=l_[1][2],fy=l_[2][0],py=l_[2][1],my=l_[2][2];function hy(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function gy(e){let t=(e+16)**3/1560896,n=t>iy?t:e/ay,r=n*(284517*oy-94839*cy),i=n*(838422*cy+769860*sy+731718*oy),a=n*(632260*cy-126452*sy),o=n*(284517*ly-94839*dy),s=n*(838422*dy+769860*uy+731718*ly),c=n*(632260*dy-126452*uy),l=n*(284517*fy-94839*my),u=n*(838422*my+769860*py+731718*fy),d=n*(632260*my-126452*py);return{r0s:r/a,r0i:i*e/a,r1s:r/(a+126452),r1i:(i-769860)*e/(a+126452),g0s:o/c,g0i:s*e/c,g1s:o/(c+126452),g1i:(s-769860)*e/(c+126452),b0s:l/d,b0i:u*e/d,b1s:l/(d+126452),b1i:(u-769860)*e/(d+126452)}}function _y(e,t){let n=t/360*Math.PI*2,r=hy(e.r0s,e.r0i,n),i=hy(e.r1s,e.r1i,n),a=hy(e.g0s,e.g0i,n),o=hy(e.g1s,e.g1i,n),s=hy(e.b0s,e.b0i,n),c=hy(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var vy=new $m({id:`hsluv`,name:`HSLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:ry,gamutSpace:m_,fromBase(e){let[t,n,r]=[Em(e[0]),Em(e[1]),Em(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/_y(gy(t),r)*100,[r,i,t]},toBase(e){let[t,n,r]=[Em(e[0]),Em(e[1]),Em(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=_y(gy(r),t)/100*n,[r,i,t]},formats:{color:{id:`--hsluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}});l_[0][0],l_[0][1],l_[0][2],l_[1][0],l_[1][1],l_[1][2],l_[2][0],l_[2][1],l_[2][2];function yy(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function by(e){let t=yy(e.r0s,e.r0i),n=yy(e.r1s,e.r1i),r=yy(e.g0s,e.g0i),i=yy(e.g1s,e.g1i),a=yy(e.b0s,e.b0i),o=yy(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var xy=new $m({id:`hpluv`,name:`HPLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:ry,gamutSpace:`self`,fromBase(e){let[t,n,r]=[Em(e[0]),Em(e[1]),Em(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/by(gy(t))*100,[r,i,t]},toBase(e){let[t,n,r]=[Em(e[0]),Em(e[1]),Em(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=by(gy(r))/100*n,[r,i,t]},formats:{color:{id:`--hpluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Sy=new nh({id:`rec2100-linear`,name:`Linear REC.2100`,white:`D65`,toBase:a_.toBase,fromBase:a_.fromBase}),Cy=203,wy=2610/2**14,Ty=2**14/2610,Ey=2523/32,Dy=32/2523,Oy=3424/4096,ky=2413/128,Ay=2392/128,jy=new nh({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:Sy,toBase(e){return e.map(function(e){return(Math.max(e**Dy-Oy,0)/(ky-Ay*e**Dy))**Ty*1e4/Cy})},fromBase(e){return e.map(function(e){let t=Math.max(e*Cy/1e4,0);return((Oy+ky*t**wy)/(1+Ay*t**wy))**Ey})}}),My=.17883277,Ny=.28466892,Py=.55991073,Fy=3.7743,Iy=new nh({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:Sy,toBase(e){return e.map(function(e){return e<=.5?e**2/3*Fy:(Math.exp((e-Py)/My)+Ny)/12*Fy})},fromBase(e){return e.map(function(e){return e/=Fy,e<=1/12?Nm(3*e,.5):My*Math.log(12*e-Ny)+Py})}}),Ly={};Rm.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=zy(e.W1,e.W2,e.options.method))}),Rm.add(`chromatic-adaptation-end`,e=>{e.M||=zy(e.W1,e.W2,e.options.method)});function Ry({id:e,toCone_M:t,fromCone_M:n}){Ly[e]=arguments[0]}function zy(e,t,n=`Bradford`){let r=Ly[n],[i,a,o]=ym(r.toCone_M,e),[s,c,l]=ym(r.toCone_M,t),u=ym([[s/i,0,0],[0,c/a,0],[0,0,l/o]],r.toCone_M);return ym(r.fromCone_M,u)}Ry({id:`von Kries`,toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),Ry({id:`Bradford`,toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),Ry({id:`CAT02`,toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),Ry({id:`CAT16`,toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(Um,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),Um.ACES=[.32168/.33767,1,.34065/.33767];var By=new nh({id:`acescg`,cssId:`--acescg`,name:`ACEScg`,coords:{r:{range:[0,65504],name:`Red`},g:{range:[0,65504],name:`Green`},b:{range:[0,65504],name:`Blue`}},referred:`scene`,white:Um.ACES,toXYZ_M:[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],fromXYZ_M:[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]]}),Vy=2**-16,Hy=-.35828683,Uy=(Math.log2(65504)+9.72)/17.52,Wy=new nh({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[Hy,Uy],name:`Red`},g:{range:[Hy,Uy],name:`Green`},b:{range:[Hy,Uy],name:`Blue`}},referred:`scene`,base:By,toBase(e){return e.map(function(e){return e<=-.3013698630136986?(2**(e*17.52-9.72)-Vy)*2:e<Uy?2**(e*17.52-9.72):65504})},fromBase(e){return e.map(function(e){return e<=0?(Math.log2(Vy)+9.72)/17.52:e<Vy?(Math.log2(Vy+e*.5)+9.72)/17.52:(Math.log2(e)+9.72)/17.52})}}),Gy=Object.freeze({__proto__:null,A98RGB:_v,A98RGB_Linear:gv,ACEScc:Wy,ACEScg:By,CAM16_JMh:Lg,HCT:Kg,HPLuv:xy,HSL:pv,HSLuv:vy,HSV:mv,HWB:hv,ICTCP:pg,JzCzHz:eg,Jzazbz:$h,LCH:gh,LCHuv:ry,Lab:ph,Lab_D65:J_,Luv:ny,OKLCH:Tv,OKLab:Dh,OKLrCH:qv,OKLrab:Kv,Okhsl:Gv,Okhsv:Xv,P3:h_,P3_Linear:s_,ProPhoto:xv,ProPhoto_Linear:vv,REC_2020:o_,REC_2020_Linear:a_,REC_2020_Scene_Referred:wv,REC_2100_HLG:Iy,REC_2100_Linear:Sy,REC_2100_PQ:jy,XYZ_ABS_D65:Lh,XYZ_D50:ch,XYZ_D65:th,sRGB:m_,sRGB_Linear:u_}),Ky=class e{constructor(...e){let t;if(e.length===1){let n={};typeof e[0]==`object`&&Object.getPrototypeOf(e[0]).constructor===Object&&(e[0]={...e[0]}),t=Zm(e[0],{parseMeta:n}),n.format&&(this.parseMeta=n)}let n,r,i;t?(n=t.space||t.spaceId,r=t.coords,i=t.alpha):[n,r,i]=e,Object.defineProperty(this,"space",{value:$m.get(n),writable:!1,enumerable:!0,configurable:!0}),this.coords=r?r.slice():[0,0,0],this.alpha=Tm(i)?i:i===void 0?1:jm(0,i,1);for(let e in this.space.coords)Object.defineProperty(this,e,{get:()=>this.get(e),set:t=>this.set(e,t)})}get spaceId(){return this.space.id}clone(){return new e(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...t){let n=__(this,...t);return n.color=new e(n.color),n}static get(t,...n){return Im(t,this)?t:new e(t,...n)}static try(t,n){if(Im(t,this))return t;let r=rh(t,n);return r?new e(r):null}static defineFunction(t,n,r=n){let{instance:i=!0,returns:a}=r,o=function(...t){let r=n(...t);if(a===`color`)r=e.get(r);else if(a===`function<color>`){let t=r;r=function(...n){let r=t(...n);return e.get(r)},Object.assign(r,t)}else a===`array<color>`&&(r=r.map(t=>e.get(t)));return r};t in e||(e[t]=o),i&&(e.prototype[t]=function(...e){return o(this,...e)})}static defineFunctions(t){for(let n in t)e.defineFunction(n,t[n],t[n])}static extend(t){if(t.register)t.register(e);else for(let n in t)e.defineFunction(n,t[n])}};Ky.defineFunctions({get:ah,getAll:ih,set:sh,setAll:oh,to:r_,equals:b_,inGamut:Ah,toGamut:e_,distance:Mh,deltas:v_,toString:i_}),Object.assign(Ky,{util:Lm,hooks:Rm,WHITES:Um,Space:$m,spaces:$m.registry,parse:Km,defaults:zm});for(let e of Object.keys(Gy))$m.register(Gy[e]);for(let e in $m.registry)qy(e,$m.registry[e]);Rm.add(`colorspace-init-end`,e=>{qy(e.id,e),e.aliases?.forEach(t=>{qy(t,e)})});function qy(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty(Ky.prototype,n,{get(){let n=this.getAll(e);if(typeof Proxy>`u`)return n;let r=new Proxy(n,{has:(e,n)=>{try{return $m.resolveCoord([t,n]),!0}catch{}return Reflect.has(e,n)},get:(e,n,i)=>{if(n&&typeof n!=`symbol`&&!(n in e)&&n in r){let{index:r}=$m.resolveCoord([t,n]);if(r>=0)return e[r]}return Reflect.get(e,n,i)},set:(n,r,i,a)=>{if(r&&typeof r!=`symbol`&&!(r in n)||Number(r)>=0){let{index:a}=$m.resolveCoord([t,r]);if(a>=0)return n[a]=i,this.setAll(e,n),!0}return Reflect.set(n,r,i,a)}});return r},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}Ky.extend(Zg),Ky.extend({deltaE:rv}),Object.assign(Ky,{deltaEMethods:Zg}),Ky.extend(ov),Ky.extend({contrast:Q_}),Ky.extend(nv),Ky.extend(w_),Ky.extend(fv),Ky.extend(Z_);function Jy(e,t=1,n=!1){return`hsla(${e}, ${n?50:65}%, ${n?60:40}%, ${t})`}function Yy(e,t=1,n=!1){let r=0;for(let t=0;t<e.length;t++)r=e.charCodeAt(t)+((r<<5)-r);return Jy((r%360+360)%360,t,n)}var Xy=[`vite-plugin-`,`rollup-plugin-`,`webpack-plugin-`,`unplugin-`,`nuxt-`,`eslint-plugin-`,`postcss-`,`vite:`,`rollup:`,`rolldown:`,`webpack:`,`__`];function Zy(e){let t=e.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`);return RegExp(`^(?:@[^/]+\\/)?(?:${t})`)}Zy(Xy);function Qy(e,t){let[n,r,i]=new Ky(e).to(`srgb`).coords.map(e=>Math.round(Math.max(0,Math.min(1,e??0))*255));return`rgba(${n}, ${r}, ${i}, ${t})`}var $y=W({__name:`DisplayBadge`,props:{text:{},color:{type:[Boolean,Number,String],default:!0},variant:{default:`subtle`},icon:{},as:{},colorScheme:{},rounded:{default:`md`},paddingX:{default:.5},paddingY:{default:.25}},setup(e){let t=e;function n(e){return/^#|^hsl|^rgb|^var\(/.test(e)}let r=kd(()=>t.colorScheme),i=Q(()=>r.value===`dark`),a=Q(()=>typeof t.color==`string`&&!n(t.color)),o=Q(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return Jy(e,1,i.value);if(typeof e==`string`&&n(e))return e;if(e===!0&&r)return Yy(r,1,i.value)}),s=Q(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return Jy(e,t.variant===`solid`?1:.12,i.value);if(typeof e==`string`&&n(e))return t.variant===`solid`?e:Qy(e,.12);if(e===!0&&r)return Yy(r,t.variant===`solid`?1:.12,i.value)}),c=Q(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return Jy(e,.2,i.value);if(typeof e==`string`&&n(e))return t.variant===`solid`?e:Qy(e,.2);if(e===!0&&r)return Yy(r,.2,i.value)}),l=Q(()=>{let e={padding:`${t.paddingY}em ${t.paddingX}em`,...typeof t.rounded==`number`?{borderRadius:`${t.rounded}em`}:{}};return o.value?t.variant===`solid`?{...e,color:`#fff`,background:s.value,border:`1px solid ${s.value}`}:a.value?{...e,color:o.value,background:s.value}:{...e,color:o.value,background:s.value,border:`1px solid ${c.value}`}:e}),u=Q(()=>a.value?`badge-color-${t.color}`:t.color===!1?`bg-#8881 color-muted`:``),d=Q(()=>typeof t.rounded==`number`?``:t.rounded===`full`?`rounded-full`:`rounded-md`);return(t,n)=>(K(),J(ua(e.as||`span`),{class:ye([`leading-none font-medium inline-flex gap-1 items-center`,[d.value,u.value]]),style:me(l.value)},{default:U(()=>[e.icon?(K(),q(`span`,{key:0,class:ye(e.icon),"aria-hidden":`true`},null,2)):Z(``,!0),G(t.$slots,`default`,{},()=>[Ts(ke(e.text),1)])]),_:3},8,[`class`,`style`]))}}),eb={key:0,class:`flex-1 min-w-0`},tb={key:1,class:`flex gap-1 items-center`},nb=W({__name:`LayoutToolbar`,props:{sticky:{type:Boolean,default:!0},glass:{type:Boolean,default:!0}},setup(e){return(t,n)=>(K(),q(`div`,{class:ye([`px-3 py-2 border-b border-base flex gap-3 items-center`,[e.sticky?`sticky top-0 z-nav`:``,e.glass?`bg-glass`:`bg-base`]])},[G(t.$slots,`start`,{},()=>[G(t.$slots,`default`)]),t.$slots.search?(K(),q(`div`,eb,[G(t.$slots,`search`)])):Z(``,!0),t.$slots.end?(K(),q(`div`,tb,[G(t.$slots,`end`)])):Z(``,!0)],2))}});function rb(...e){return e.filter(Boolean).join(` `)}var ib={connecting:{label:`connecting…`,dot:`bg-neutral-400 animate-pulse`},disconnected:{label:`disconnected`,dot:`bg-error`},unauthorized:{label:`unauthorized`,dot:`bg-warning`},error:{label:`error`,dot:`bg-error`}};function ab(e,t){if(e===`connected`)return null;let n=ib[e];return{label:n.label,dot:rb(`inline-block size-1.5 rounded-full shrink-0`,n.dot),class:rb(`flex items-center gap-1.5 shrink-0 text-xs color-muted select-none`,t)}}var ob={bus:{agentManifestChanged:`agent:manifest:changed`,agentToolRegistered:`agent:tool:registered`,agentToolUnregistered:`agent:tool:unregistered`,agentResourceRegistered:`agent:resource:registered`,agentResourceUnregistered:`agent:resource:unregistered`},client:{isTrustedUpdated:`rpc:is-trusted:updated`,error:`rpc:error`,connectionStatus:`connection:status`,connectionError:`connection:error`},broadcast:{authRevoked:`devframe:auth:revoked`,clientStateUpdated:`devframe:rpc:client-state:updated`,clientStatePatch:`devframe:rpc:client-state:patch`,streamingChunk:`devframe:streaming:chunk`,streamingEnd:`devframe:streaming:end`,streamingUploadCancel:`devframe:streaming:upload-cancel`},inPageChannel:{panelStateUpdated:`devframe:in-page:panel-state:updated`,panelStatePatch:`devframe:in-page:panel-state:patch`},postMessage:{remoteAssetsError:`devframe:remote-assets-error`,inPageChannel:`devframe:in-page-channel`}},sb=`__connection.json`,cb=`__DEVFRAME_CONNECTION__`,lb=`x-birpc-session`,ub=`__rpc-dump/index.json`,db=`devframe:services`,fb=`devframe_otp`,pb=`devframe_auth_token`;ob.postMessage.remoteAssetsError;function mb(e){return typeof e==`string`?`'${e}'`:new vb().serialize(e)}var hb=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,gb=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[hb.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function _b(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&gb[n]?gb[n]:n+128,s=a<128&&gb[a]?gb[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var vb=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?_b(e,t):n===`number`&&r===`number`?e-t:_b(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(_b),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})();function yb(e,t){return e===t||mb(e)===mb(t)}var bb=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],xb=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Sb=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,Cb=[],wb=class{_data=new Tb;_hash=new Tb([...bb]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=this._nDataBytes*8,n=this._data.sigBytes*8;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)Cb[n]=e[t+n]|0;else{let e=Cb[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=Cb[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;Cb[n]=t+Cb[n-7]+i+Cb[n-16]}let d=s&c^~s&l,f=r&i^r&a^i&a,p=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),h=u+m+d+xb[n]+Cb[n],g=p+f;u=l,l=c,c=s,s=o+h|0,o=a,a=i,i=r,r=h+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+u|0}_append(e){typeof e==`string`&&(e=Tb.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64;n=e?Math.ceil(n):Math.max((n|0)-this._minBufferSize,0);let r=n*16,i=Math.min(r*4,this._data.sigBytes);if(r){for(let e=0;e<r;e+=16)this._doProcessBlock(this._data.words,e);t=this._data.words.splice(0,r),this._data.sigBytes-=i}return new Tb(t,i)}},Tb=class e{words;sigBytes;constructor(e,t){e=this.words=e||[],this.sigBytes=t===void 0?e.length*4:t}static fromUtf8(t){let n=unescape(encodeURIComponent(t)),r=n.length,i=[];for(let e=0;e<r;e++)i[e>>>2]|=(n.charCodeAt(e)&255)<<24-e%4*8;return new e(i,r)}toBase64(){let e=[];for(let t=0;t<this.sigBytes;t+=3){let n=this.words[t>>>2]>>>24-t%4*8&255,r=this.words[t+1>>>2]>>>24-(t+1)%4*8&255,i=this.words[t+2>>>2]>>>24-(t+2)%4*8&255,a=n<<16|r<<8|i;for(let n=0;n<4&&t*8+n*6<this.sigBytes*8;n++)e.push(Sb.charAt(a>>>6*(3-n)&63))}return e.join(``)}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let n=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}};function Eb(e){return new wb().finalize(e).toBase64()}function Db(e){return Eb(mb(e))}function Ob(e){return Db(e)}var kb=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>Ob(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}};function Ab(e,t){let n=`\x1B[${e}m`,r=`\x1B[${t}m`;return((e,...t)=>{if(Array.isArray(e)&&`raw`in e){let i=e,a=``;for(let e=0;e<i.length;e++)a+=i[e],e<t.length&&(a+=String(t[e]));return`${n}${a}${r}`}return`${n}${String(e)}${r}`})}var jb={blue:Ab(34,39),cyan:Ab(36,39),gray:Ab(90,39),green:Ab(32,39),red:Ab(31,39),yellow:Ab(33,39),bold:Ab(1,22),dim:Ab(2,22),reset:Ab(0,0),underline:Ab(4,24)};function Mb(e,...t){return typeof e==`function`?e(...t):e}var Nb=Error.captureStackTrace,Pb=class e extends Error{name;code;docs;fix;sources;get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.code=this.name=t.code,this.fix=t.fix,this.docs=t.docs,this.sources=t.sources,Nb?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function Fb(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}function Ib(e){let t=e.reporters??[],n={},{docsBase:r}=e;for(let i of Object.keys(e.codes)){let a=e.codes[i],o=a.docs===!1?void 0:a.docs||Fb(r,i),s=(e={},n={})=>{let r=new Pb({code:i,why:Mb(a.why,e),fix:Mb(a.fix,e),docs:o,cause:e.cause,sources:e.sources},s);for(let e of t)e(r,n);return r};n[i]=s}return n}function Lb(e){return t=>{let n=`${e.bold(e.red(`[${t.name}]`))} ${t.message}`,r=[];return t.fix&&r.push(`${e.dim(`fix:`)} ${t.fix}`),t.sources?.length&&r.push(`${e.dim(`sources:`)} ${t.sources.join(`, `)}`),t.docs&&r.push(`${e.dim(`see:`)} ${e.cyan(t.docs)}`),r.length===0?n:[n,...r.map((t,n)=>`${e.dim(n<r.length-1?`├▶`:`╰▶`)} ${t}`)].join(`
|
|
5
|
+
`)}}var Rb=Lb(jb);function zb(e,{method:t=`warn`}={}){console[t](Rb(e))}function Bb(e){return Ib({...e,reporters:[zb,...e.reporters??[]]})}var Vb=Bb({docsBase:`https://devfra.me/errors`,codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\`; MCP requires JSON-serializable data.`,fix:"Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."},DF0043:{why:e=>`RPC function "${e.name}" received an invalid argument at position ${e.index}: ${e.issues}`,fix:"Pass a value that satisfies the `args` schema declared for this function."},DF0044:{why:e=>`RPC function "${e.name}" returned a value that failed its \`returns\` schema: ${e.issues}`,fix:"Make the handler return a value that satisfies the `returns` schema, or relax the schema."}}});async function Hb(e,t){let n=e[`~standard`].validate(t);return n instanceof Promise?await n:n}function Ub(e){return e.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `)}async function Wb(e,t,n){let r=n.slice();if(!t||t.length===0)return r;for(let r=0;r<t.length;r++){let i=t[r];if(!i)continue;let a=await Hb(i,n[r]);if(a.issues)throw Vb.DF0043({name:e,index:r,issues:Ub(a.issues)})}return r}async function Gb(e,t,n){if(!t)return n;let r=await Hb(t,n);if(r.issues)throw Vb.DF0044({name:e,issues:Ub(r.issues)});return n}async function Kb(e,t){if(!e.setup)return{};if(typeof t==`object`&&t){e.__cache??=new WeakMap;let n=e.__cache,r=n.get(t);return r||(r=Promise.resolve(e.setup(t)),r.catch(()=>{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function qb(e,t){let n=e.handler;if(!n){let r=await Kb(e,t);if(!r.handler)throw Vb.DF0024({name:e.name});n=r.handler}let r=e.args,i=e.returns;if(!r&&!i)return n;let a=n;return async(...t)=>{let n=await Wb(e.name,r,t),o=await a(...n);return await Gb(e.name,i,o)}}var Jb=class{context;definitions=new Map;functions;_onChanged=[];constructor(e){this.context=e;let t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return qb(i,n.context)},has(e,n){return t.has(n)},getOwnPropertyDescriptor(e,n){return{value:t.get(n)?.handler,configurable:!0,enumerable:!0}},ownKeys(){return Array.from(t.keys())}})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw Vb.DF0021({name:e.name});Yb(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw Vb.DF0022({name:e.name});Yb(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);t!==-1&&this._onChanged.splice(t,1)}}async getHandler(e){return await qb(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw Vb.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}};function Yb(e){if(e.agent&&e.jsonSerializable!==!0)throw Vb.DF0019({name:e.name})}function Xb(e,t=``){return JSON.stringify(e,function(e,n){let r=this,i=r==null?n:r[e];if(i===void 0){if(Array.isArray(r))throw Qb(t,`undefined`,r,e);return n}return i!==null&&Zb(i,r,e,t),n})}function Zb(e,t,n,r){if(typeof e==`bigint`)throw Qb(r,`BigInt`,t,n);if(typeof e!=`object`)return;if(e instanceof Map)throw Qb(r,`Map`,t,n);if(e instanceof Set)throw Qb(r,`Set`,t,n);if(e instanceof Date)throw Qb(r,`Date`,t,n);if(Array.isArray(e))return;let i=Object.getPrototypeOf(e);if(i!==null&&i!==Object.prototype)throw Qb(r,e.constructor?.name??`class instance`,t,n)}function Qb(e,t,n,r){let i=$b(n,r);return Vb.DF0020({name:e||`<anonymous>`,type:t,path:i})}function $b(e,t){return Array.isArray(e)?`[${t}]`:t===``?`<root>`:t}function ex(){let e={};function t(t,...n){let r=e[t]||[];for(let e=0,t=r.length;e<t;e++){let t=r[e];t&&t(...n)}}function n(n,...r){t(n,...r),delete e[n]}function r(t,n){return(e[t]||=[]).push(n),()=>{e[t]=e[t]?.filter(e=>n!==e)}}function i(e,t){let n=r(e,((...e)=>(n(),t(...e))));return n}return{_listeners:e,emit:t,emitOnce:n,on:r,once:i}}String.fromCharCode;var tx=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,nx=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,rx=/^([/\\]\s*){2,}[^/\\]/,ix=/\/$|\/\?|\/#/,ax=/^\.?\//;function ox(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?tx.test(e):nx.test(e)||(t.acceptRelative?rx.test(e):!1)}function sx(e=``,t){return t?ix.test(e):e.endsWith(`/`)}function cx(e=``,t){if(!t)return(sx(e)?e.slice(0,-1):e)||`/`;if(!sx(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function lx(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(sx(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function ux(e,t){if(dx(t)||ox(e))return e;let n=cx(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return px(n,e)}function dx(e){return!e||e===`/`}function fx(e){return e&&e!==`/`}function px(e,...t){let n=e||``;for(let e of t.filter(e=>fx(e)))if(n){let t=e.replace(ax,``);n=lx(n)+t}else n=e;return n}function mx(e,t){let n=e.match(nx);return n||=e.match(/^\/{2,}/),n?t+e.slice(n[0].length):t+e}var hx=`__DEVFRAME_CONNECTION_META__`,gx=`__DEVFRAME_CONNECTION_AUTH_TOKEN__`;function _x(e){let t=[()=>window?.[e],()=>globalThis?.[e],()=>parent.window?.[e]];for(let e of t)try{let t=e();if(t)return t}catch{}}function vx(){return _x(cb)}function yx(){return _x(hx)}function bx(e){if(e)return e;try{let e=localStorage.getItem(gx);if(e)return e}catch{}return _x(gx)}function xx(e){globalThis[cb]=e,globalThis[hx]={...e.connectionMeta,baseUrl:e.metaBaseUrl},e.authToken&&Sx(e.authToken)}function Sx(e){try{localStorage.setItem(gx,e)}catch{}globalThis[gx]=e;let t=vx();t&&(globalThis[cb]={...t,authToken:e})}function Cx(e){let t=ux(sb,e);try{return new URL(t,globalThis.location?.href).href}catch{return t}}function wx(e,t){return t&&t!==e.authToken?{...e,authToken:t}:e}function Tx(){let e=vx();if(e)return wx(e,bx()??e.authToken??e.connectionMeta.authToken);let t=yx();if(t)return{connectionMeta:t,metaBaseUrl:t.baseUrl??Cx(`./`),authToken:bx(t.authToken)}}async function Ex(e={}){if(e.connection){let t=wx(e.connection,bx(e.authToken??e.connection.authToken??e.connection.connectionMeta.authToken));return xx(t),t}let t=Array.isArray(e.baseURL)?e.baseURL:[e.baseURL??`./`];if(e.connectionMeta){let n={connectionMeta:e.connectionMeta,metaBaseUrl:Cx(t[0]??`./`),authToken:bx(e.authToken??e.connectionMeta.authToken)};return xx(n),n}let n=Tx();if(n){let t=wx(n,bx(e.authToken??n.authToken??n.connectionMeta.authToken));return xx(t),t}let r=[];for(let n of t){let t=ux(sb,n),i=Cx(n);try{let n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch connection meta from ${i}: ${n.status}`);let r=await n.json(),a={connectionMeta:r,metaBaseUrl:n.url||i,authToken:bx(e.authToken??r.authToken)};return xx(a),a}catch(e){r.push(e)}}throw Error(`Failed to get connection meta from ${t.join(`, `)}`,{cause:r})}var Dx=class extends Error{name=`DevframeConnectionError`;kind;constructor(e,t,n){super(t,n),this.kind=e}};function Ox(e=fb){try{let t=globalThis.location?.hash?.replace(/^#/,``)??``;return new URLSearchParams(t).get(e)||void 0}catch{return}}function kx(e){try{let t=new URL(globalThis.location.href),n=new URLSearchParams(t.hash.replace(/^#/,``));if(!n.has(e))return;n.delete(e),t.hash=n.toString(),globalThis.history?.replaceState(globalThis.history.state,``,t.href)}catch{}}function Ax(e=fb){let t=Ox(e);return t&&kx(e),t}async function jx(e,t={}){let n=Ax(t.param??`devframe_otp`);return n?e.isTrusted?!0:e.requestTrustWithCode(n):!1}function Mx(e){let t={},n=new WeakMap,r,i=()=>(r??=e.sharedState.get(db,{initialValue:{}}).then(e=>(t=e.value(),e.on(`updated`,e=>{t=e}),e)),r);return i(),{state:i,has:e=>e in t,keys:()=>Object.keys(t),get:r=>{let i=t[r];if(!i)return;let a=n.get(i);return a||(a={...i,rpc:e.scope(i.scope).rpc},n.set(i,a)),a}}}var Nx=Symbol.for(`immer-nothing`),Px=Symbol.for(`immer-draftable`),Fx=Symbol.for(`immer-state`);function Ix(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Lx=Object,Rx=Lx.getPrototypeOf,zx=`constructor`,Bx=`prototype`,Vx=`configurable`,Hx=`enumerable`,Ux=`writable`,Wx=`value`,Gx=e=>!!e&&!!e[Fx];function Kx(e){return e?Yx(e)||nS(e)||!!e[Px]||!!e[zx]?.[Px]||rS(e)||iS(e):!1}var qx=Lx[Bx][zx].toString(),Jx=new WeakMap;function Yx(e){if(!e||!aS(e))return!1;let t=Rx(e);if(t===null||t===Lx[Bx])return!0;let n=Lx.hasOwnProperty.call(t,zx)&&t[zx];if(n===Object)return!0;if(!oS(n))return!1;let r=Jx.get(n);return r===void 0&&(r=Function.toString.call(n),Jx.set(n,r)),r===qx}function Xx(e,t,n=!0){Zx(e)===0?(n?Reflect.ownKeys(e):Lx.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Zx(e){let t=e[Fx];return t?t.type_:nS(e)?1:rS(e)?2:iS(e)?3:0}var Qx=(e,t,n=Zx(e))=>n===2?e.has(t):Lx[Bx].hasOwnProperty.call(e,t),$x=(e,t,n=Zx(e))=>n===2?e.get(t):e[t],eS=(e,t,n,r=Zx(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function tS(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var nS=Array.isArray,rS=e=>e instanceof Map,iS=e=>e instanceof Set,aS=e=>typeof e==`object`,oS=e=>typeof e==`function`,sS=e=>typeof e==`boolean`;function cS(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var lS=e=>aS(e)?e?.[Fx]:null,uS=e=>e.copy_||e.base_,dS=e=>e.modified_?e.copy_:e.base_;function fS(e,t){if(rS(e))return new Map(e);if(iS(e))return new Set(e);if(nS(e))return Array[Bx].slice.call(e);let n=Yx(e);if(t===!0||t===`class_only`&&!n){let t=Lx.getOwnPropertyDescriptors(e);delete t[Fx];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Ux]===!1&&(a[Ux]=!0,a[Vx]=!0),(a.get||a.set)&&(t[i]={[Vx]:!0,[Ux]:!0,[Hx]:a[Hx],[Wx]:e[i]})}return Lx.create(Rx(e),t)}{let t=Rx(e);if(t!==null&&n)return{...e};let r=Lx.create(t);return Lx.assign(r,e)}}function pS(e,t=!1){return gS(e)||Gx(e)||!Kx(e)?e:(Zx(e)>1&&Lx.defineProperties(e,{set:hS,add:hS,clear:hS,delete:hS}),Lx.freeze(e),t&&Xx(e,(e,t)=>{pS(t,!0)},!1),e)}function mS(){Ix(2)}var hS={[Wx]:mS};function gS(e){return e===null||!aS(e)||Lx.isFrozen(e)}var _S=`MapSet`,vS=`Patches`,yS=`ArrayMethods`,bS={};function xS(e){let t=bS[e];return t||Ix(0,e),t}var SS=e=>!!bS[e];function CS(e,t){bS[e]||(bS[e]=t)}var wS,TS=()=>wS,ES=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:SS(_S)?xS(_S):void 0,arrayMethodsPlugin_:SS(yS)?xS(yS):void 0});function DS(e,t){t&&(e.patchPlugin_=xS(vS),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function OS(e){kS(e),e.drafts_.forEach(jS),e.drafts_=null}function kS(e){e===wS&&(wS=e.parent_)}var AS=e=>wS=ES(wS,e);function jS(e){let t=e[Fx];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function MS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Fx].modified_&&(OS(t),Ix(4)),Kx(e)&&(e=NS(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Fx].base_,e,t)}else e=NS(t,n);return PS(t,e,!0),OS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Nx?void 0:e}function NS(e,t){if(gS(t))return t;let n=t[Fx];if(!n)return HS(t,e.handledSet_,e);if(!IS(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);BS(n,e)}return n.copy_}function PS(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&pS(t,n)}function FS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var IS=(e,t)=>e.scope_===t,LS=[];function RS(e,t,n,r){let i=uS(e),a=e.type_;if(r!==void 0&&$x(i,r,a)===t){eS(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Xx(i,(e,n)=>{if(Gx(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??LS;for(let e of o)eS(i,e,n,a)}function zS(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!IS(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=dS(i);RS(e,i.draft_??i,a,n),BS(i,r)})}function BS(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}FS(e)}}function VS(e,t,n){let{scope_:r}=e;if(Gx(n)){let i=n[Fx];IS(i,r)&&i.callbacks_.push(function(){ZS(e),RS(e,n,dS(i),t)})}else Kx(n)&&e.callbacks_.push(function(){let i=uS(e);e.type_===3?i.has(n)&&HS(n,r.handledSet_,r):$x(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&HS($x(e.copy_,t,e.type_),r.handledSet_,r)})}function HS(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Gx(e)||t.has(e)||!Kx(e)||gS(e)?e:(t.add(e),Xx(e,(r,i)=>{if(Gx(i)){let t=i[Fx];IS(t,n)&&(eS(e,r,dS(t),e.type_),FS(t))}else Kx(i)&&HS(i,t,n)}),e)}function US(e,t){let n=nS(e),r={type_:+!!n,scope_:t?t.scope_:TS(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=WS;n&&(i=[r],a=GS);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var WS={get(e,t){if(t===Fx)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=uS(e);if(!Qx(i,t,e.type_))return JS(e,i,t);let a=i[t];if(e.finalized_||!Kx(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&cS(t))return a;if(a===KS(e.base_,t)||qS(e,t,a)){ZS(e);let n=e.type_===1?+t:t,r=$S(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in uS(e)},ownKeys(e){return Reflect.ownKeys(uS(e))},set(e,t,n){let r=YS(uS(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=KS(uS(e),t),i=r?.[Fx];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(tS(n,r)&&(n!==void 0||Qx(e.base_,t,e.type_)))return!0;ZS(e),XS(e)}return e.copy_[t]===n&&(n!==void 0||Qx(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),VS(e,t,n),!0)},deleteProperty(e,t){return ZS(e),KS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),XS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=uS(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ux]:!0,[Vx]:e.type_!==1||t!==`length`,[Hx]:r[Hx],[Wx]:n[t]}},defineProperty(){Ix(11)},getPrototypeOf(e){return Rx(e.base_)},setPrototypeOf(){Ix(12)}},GS={};for(let e in WS){let t=WS[e];GS[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}GS.deleteProperty=function(e,t){return GS.set.call(this,e,t,void 0)},GS.set=function(e,t,n){return WS.set.call(this,e[0],t,n,e[0])};function KS(e,t){let n=e[Fx];return(n?uS(n):e)[t]}function qS(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Kx(n)||n[Fx]?!1:e.baseRefs_.has(n)}function JS(e,t,n){let r=YS(t,n);return r?Wx in r?r[Wx]:r.get?.call(e.draft_):void 0}function YS(e,t){if(!(t in e))return;let n=Rx(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Rx(n)}}function XS(e){e.modified_||(e.modified_=!0,e.parent_&&XS(e.parent_))}function ZS(e){e.copy_||=(e.assigned_=new Map,fS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var QS=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(oS(e)&&!oS(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}oS(t)||Ix(6),n!==void 0&&!oS(n)&&Ix(7);let r;if(Kx(e)){let i=AS(this),a=$S(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?OS(i):kS(i)}return DS(i,n),MS(r,i)}if(!e||!aS(e)){if(r=t(e),r===void 0&&(r=e),r===Nx&&(r=void 0),this.autoFreeze_&&pS(r,!0),n){let t=[],i=[];xS(vS).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}Ix(1,e)},this.produceWithPatches=(e,t)=>{if(oS(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},sS(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),sS(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),sS(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Kx(e)||Ix(8),Gx(e)&&(e=eC(e));let t=AS(this),n=$S(t,e,void 0);return n[Fx].isManual_=!0,kS(t),n}finishDraft(e,t){let n=e&&e[Fx];(!n||!n.isManual_)&&Ix(9);let{scope_:r}=n;return DS(r,t),MS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=xS(vS).applyPatches_;return Gx(e)?r(e,t):this.produce(e,e=>r(e,t))}};function $S(e,t,n,r){let[i,a]=rS(t)?xS(_S).proxyMap_(t,n):iS(t)?xS(_S).proxySet_(t,n):US(t,n);return(n?.scope_??TS()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?zS(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function eC(e){return Gx(e)||Ix(10,e),tC(e)}function tC(e){if(!Kx(e)||gS(e))return e;let t=e[Fx],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=fS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=fS(e,!0);return Xx(n,(e,t)=>{eS(n,e,tC(t))},r),t&&(t.finalized_=!1),n}function nC(){function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=lS($x(e,n.key_)),i=$x(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||Qx(e,o)))return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(n=$x(n,r),!aS(n)||n===null)throw Error(`Cannot resolve path at '${t.join(`/`)}'`)}return n}let n=`replace`,r=`remove`;function i(e,t,n){if(e.scope_.processedForPatches_.has(e))return;e.scope_.processedForPatches_.add(e);let{patches_:r,inversePatches_:i}=n;switch(e.type_){case 0:case 2:return o(e,t,r,i);case 1:return a(e,t,r,i);case 3:return s(e,t,r,i)}}function a(e,t,i,a){let{base_:o,assigned_:s}=e,c=e.copy_;c.length<o.length&&([o,c]=[c,o],[i,a]=[a,i]);let l=e.allIndicesReassigned_===!0;for(let e=0;e<o.length;e++){let r=c[e],u=o[e];if((l||s?.get(e.toString()))&&r!==u){let o=r?.[Fx];if(o&&o.modified_)continue;let s=t.concat([e]);i.push({op:n,path:s,value:d(r)}),a.push({op:n,path:s,value:d(u)})}}for(let e=o.length;e<c.length;e++){let n=t.concat([e]);i.push({op:`add`,path:n,value:d(c[e])})}for(let e=c.length-1;o.length<=e;--e){let n=t.concat([e]);a.push({op:r,path:n})}}function o(e,t,i,a){let{base_:o,copy_:s,type_:c}=e;Xx(e.assigned_,(e,l)=>{let u=$x(o,e,c),f=$x(s,e,c),p=l?Qx(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===Nx?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e<i.length-1;e++){let t=Zx(o),n=i[e];typeof n!=`string`&&typeof n!=`number`&&(n=``+n),(t===0||t===1)&&(n===`__proto__`||n===zx)&&Ix(19),oS(o)&&n===Bx&&Ix(19),o=$x(o,n),(o===null||!aS(o))&&Ix(18,i.join(`/`))}let s=Zx(o),c=u(t.value),l=i[i.length-1];switch(a){case n:switch(s){case 2:return o.set(l,c);case 3:Ix(16);default:return o[l]=c}case`add`:switch(s){case 1:return l===`-`?o.push(c):o.splice(l,0,c);case 2:return o.set(l,c);case 3:return o.add(c);default:return o[l]=c}case r:switch(s){case 1:return o.splice(l,1);case 2:return o.delete(l);case 3:return o.delete(t.value);default:return delete o[l]}default:Ix(17,a)}}),e}function u(e){if(!Kx(e))return e;if(nS(e))return e.map(u);if(rS(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,u(t)]));if(iS(e))return new Set(Array.from(e).map(u));let t=Object.create(Rx(e));for(let n in e)t[n]=u(e[n]);return Qx(e,Px)&&(t[Px]=e[Px]),t}function d(e){return Gx(e)?u(e):e}CS(vS,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}globalThis.Iterator?.from;var rC=new QS,iC=rC.produce,aC=rC.produceWithPatches.bind(rC),oC=rC.applyPatches.bind(rC),sC=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function cC(e=21){let t=``,n=e;for(;n--;)t+=sC[Math.random()*64|0];return t}var lC=1e3;function uC(e,t){if(e.add(t),e.size>lC){let t=e.values().next().value;t!==void 0&&e.delete(t)}}function dC(e){let{enablePatches:t=!1}=e;t&&nC();let n=ex(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=cC())=>{i.has(t)||(nC(),r=oC(r,e),uC(i,t),n.emit(`updated`,r,void 0,t))},mutate:(e,a=cC())=>{if(!i.has(a)){if(uC(i,a),t){let[t,i]=aC(r,e);r=t,n.emit(`updated`,r,i,a)}else r=iC(r,e),n.emit(`updated`,r,void 0,a)}},syncIds:i}}function fC(e){let t=new Map,n=new Map,r=new Map,i=new Set,a=e.connectionMeta.backend===`static`;function o(e,t){let n=r.get(e);return n&&typeof n==`object`&&!Array.isArray(n)&&typeof t==`object`&&!Array.isArray(t)?{...n,...t}:t}e.client.register({name:ob.broadcast.clientStateUpdated,type:`event`,handler:(e,n,r)=>{let i=t.get(e);!i||i.syncIds.has(r)||i.mutate(()=>o(e,n),r)}}),e.client.register({name:ob.broadcast.clientStatePatch,type:`event`,handler:(e,n,r)=>{let i=t.get(e);!i||i.syncIds.has(r)||i.patch(n,r)}});function s(t,n){let r=[];return r.push(n.on(`updated`,(n,r,i)=>{a||(r?e.callEvent(`devframe:rpc:server-state:patch`,t,r,i):e.callEvent(`devframe:rpc:server-state:set`,t,n,i))})),()=>{for(let e of r)e()}}return{keys:()=>Array.from(t.keys()),onKeyAdded(e){return i.add(e),()=>{i.delete(e)}},delete(e){let i=n.get(e);n.delete(e);let a=t.delete(e);return r.delete(e),i?.(),a},get:async(c,l)=>{if(l?.initialValue!==void 0&&r.set(c,l.initialValue),t.has(c))return t.get(c);let u=dC({initialValue:l?.initialValue,enablePatches:!1});async function d(){if(a||e.callEvent(`devframe:rpc:server-state:subscribe`,c),l?.initialValue!==void 0){t.set(c,u);for(let e of i)e(c);return e.call(`devframe:rpc:server-state:get`,c).then(e=>{e!==void 0&&u.mutate(()=>o(c,e))}).catch(e=>{console.error(`Error getting server state`,e)}),n.set(c,s(c,u)),u}{let r=await e.call(`devframe:rpc:server-state:get`,c);u.mutate(()=>o(c,r)),t.set(c,u);for(let e of i)e(c);return n.set(c,s(c,u)),u}}return new Promise(t=>{if(e.isTrusted)d().then(t);else{t(u);let n=!1;e.events.on(ob.client.isTrustedUpdated,e=>{e&&!n&&(n=!0,d())})}})}}}var pC=typeof self==`object`?self:globalThis,mC=new Set([`Error`,`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`,`AggregateError`]),hC=new Set([`Boolean`,`Number`,`String`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float16Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]);function gC(e,t){let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o,r=mC.has(e)?pC[e]:void 0;return n(new(r??pC.Error)(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}if(typeof a==`string`&&hC.has(a))return n(new pC[a](o),i);throw TypeError(`unable to deserialize unsafe or unknown type: ${String(a)}`)};return r}function _C(e){return gC(new Map,e)(0)}var vC=``,{toString:yC}={},{keys:bC}=Object;function xC(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=yC.call(e).slice(8,-1);switch(n){case`Array`:return[1,vC];case`Object`:return[2,vC];case`Date`:return[3,vC];case`RegExp`:return[4,vC];case`Map`:return[5,vC];case`Set`:return[6,vC];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function SC([e,t]){return e===0&&(t===`function`||t===`symbol`)}function CC(e,t,n,r){let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=xC(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize ${s}`);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of bC(r))(e||!SC(xC(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(SC(xC(n))||SC(xC(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!SC(xC(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function wC(e,t={}){let n=[];return CC(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:TC,stringify:EC}=JSON,DC={json:!0,lossy:!0};function OC(e){return _C(TC(e))}function kC(e){return EC(wC(e,DC))}function AC(e){return _C(e)}function jC(e){return kC(e)}function MC(e){return OC(e)}var NC=new Map;function PC(e=NC){let t=new Map;return{serialize:n=>{let r;return n.t===`q`?r=n.m:(r=t.get(n.i),t.delete(n.i)),!(n.t===`s`&&`e`in n)&&r&&e.get(r)?.jsonSerializable===!0?Xb(n,r??``):`s:${jC(n)}`},deserialize:e=>{let n=e.startsWith(`s:`)?MC(e.slice(2)):JSON.parse(e);return n.t===`q`&&n.i&&n.m&&t.set(n.i,n.m),n}}}function FC(){}function IC(e){let t=e.search(/\n\n|\r\n\r\n/);if(!(t<0))return{frame:e.slice(0,t),rest:e.slice(t+(e[t]===`\r`?4:2))}}function LC(e){let t=`message`,n=[];for(let r of e.split(/\r?\n/))r.startsWith(`:`)||(r.startsWith(`event:`)?t=r.slice(6).trimStart():r.startsWith(`data:`)&&n.push(r.slice(5).replace(/^ /,``)));return{event:t,data:n}}function RC(e){let{onConnected:t=FC,onError:n=FC,onDisconnected:r=FC,definitions:i,fetch:a=globalThis.fetch.bind(globalThis)}=e,o=e.url;e.authToken&&(o=`${o}${o.includes(`?`)?`&`:`?`}${pb}=${encodeURIComponent(e.authToken)}`);let s=PC(i),c=new AbortController,l=!1,u,d,f,p,m=new Promise((e,t)=>{f=e,p=t});m.catch(()=>{});function h(e){l||(l=!0,p(e),n(e),r())}function g(){l||(l=!0,p(Error(`Devframe SSE stream closed`)),r())}function _(e,n){if(e===`session`){f(n),t();return}u?.(n)}async function v(e){let t=e.getReader();d=t;let n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();if(e)break;for(r+=n.decode(i,{stream:!0});;){let e=IC(r);if(!e)break;r=e.rest;let{event:t,data:n}=LC(e.frame);n.length>0&&_(t,n.join(`
|
|
6
|
+
`))}}g()}return(async()=>{try{let e=await a(o,{headers:{accept:`text/event-stream`},signal:c.signal});if(!e.ok||!e.body)throw Error(`Devframe SSE stream request failed: ${e.status}`);await v(e.body)}catch(e){if(c.signal.aborted){g();return}h(e instanceof Error?e:Error(String(e)))}})(),{close:()=>{l=!0,c.abort(),d?.cancel().catch(()=>{})},on:e=>{u=e},post:async e=>{let t;try{t=await m}catch{return}if(l){n(Error(`Devframe SSE channel is closed; message dropped`));return}try{let n=await a(o,{method:`POST`,headers:{"content-type":`text/plain; charset=utf-8`,[lb]:t},body:e});if(n.status===200){let e=await n.text();e&&u?.(e);return}if(!n.ok)throw Error(`Devframe SSE POST failed: ${n.status}`)}catch(e){n(e instanceof Error?e:Error(String(e)))}},serialize:s.serialize,deserialize:s.deserialize}}function zC(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var BC=Math.random.bind(Math),VC=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function HC(e=21){let t=``,n=e;for(;n--;)t+=VC[BC()*64|0];return t}var UC=6e4,WC=e=>e,GC=WC,{clearTimeout:KC,setTimeout:qC}=globalThis;function JC(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=WC,deserialize:s=GC,resolver:c,bind:l=`rpc`,timeout:u=UC,proxify:d=!0}=t,f=!1,p=new Map,m,h;async function g(e,r,i,a){if(f)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let s={m:e,a:r,t:`q`};a&&(s.o=!0);let c=async e=>n(o(e));if(i){await c(s);return}if(m)try{await m}finally{m=void 0}let{promise:l,resolve:d,reject:g}=zC(),_=HC();s.i=_;let v;async function y(n=s){return u>=0&&(v=qC(()=>{try{if(t.onTimeoutError?.call(h,e,r)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){g(e)}p.delete(_)},u),typeof v==`object`&&(v=v.unref?.())),p.set(_,{resolve:d,reject:g,timeoutId:v,method:e}),await c(n),l}try{t.onRequest?await t.onRequest.call(h,s,y,d):await y()}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}finally{KC(v),p.delete(_)}return l}let _={$call:(e,...t)=>g(e,t,!1),$callOptional:(e,...t)=>g(e,t,!1,!0),$callEvent:(e,...t)=>g(e,t,!0),$callRaw:e=>g(e.method,e.args,e.event,e.optional),$rejectPendingCalls:y,get $closed(){return f},get $meta(){return t.meta},$close:v,$functions:e};h=d?new Proxy({},{get(t,n){if(Object.hasOwn(_,n))return _[n];if(n===`then`&&!a.includes(`then`)&&!(`then`in e))return;let r=(...e)=>g(n,e,!0);if(a.includes(n))return r.asEvent=r,r;let i=(...e)=>g(n,e,!1);return i.asEvent=r,i}}):_;function v(e){f=!0,p.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),p.clear(),i(b)}function y(e){let t=Array.from(p.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return p.clear(),t}async function b(r,...i){let a;try{a=s(r)}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}if(a.t===`q`){let{m:r,a:s,o:u}=a,d,f,p=await(c?c.call(h,r,e[r]):e[r]);if(u&&(p||=()=>void 0),!p)f=Error(`[birpc] function "${r}" not found`);else try{d=await p.apply(l===`rpc`?h:e,s)}catch(e){f=e}if(a.i){if(f&&t.onFunctionError&&t.onFunctionError.call(h,f,r,s)===!0)return;if(!f)try{await n(o({t:`s`,i:a.i,r:d}),...i);return}catch(e){if(f=e,t.onGeneralError?.call(h,e,r,s)!==!0)throw e}try{await n(o({t:`s`,i:a.i,e:f}),...i)}catch(e){if(t.onGeneralError?.call(h,e,r,s)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=p.get(e);r&&(KC(r.timeoutId),n?r.reject(n):r.resolve(t)),p.delete(e)}}return m=r(b),h}function YC(e,t){let{channel:n,rpcOptions:r={}}=t;return JC(e,{...n,timeout:-1,...r,proxify:!1})}function XC(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function ZC(e){let{transport:t,authToken:n,connectionMeta:r,events:i,clientRpc:a,rpcOptions:o={},callTimeout:s=0}=e,c=!1,l=`connecting`,u=null,d=XC();function f(e,t=null){if(t?u=t:e===`connected`&&(u=null),e===l)return;let n=l;l=e,i.emit(ob.client.connectionStatus,e,n)}let p=new Set;function m(e){for(let t of[...p])t.reject(e)}function h(){return l===`disconnected`||l===`error`?new Dx(`connection`,`[devframe] Not connected to the devframe server`,{cause:u??void 0}):l===`unauthorized`?new Dx(`auth`,`[devframe] Not authorized by the devframe server`,{cause:u??void 0}):null}function g(e,t){return new Promise((n,r)=>{let a=!1,o,c={reject(e){a||(l(),i.emit(ob.client.error,e,t),r(e))}};function l(){a=!0,p.delete(c),o&&clearTimeout(o)}p.add(c),s>0&&(o=setTimeout(()=>{c.reject(new Dx(`timeout`,`[devframe] RPC call "${t}" timed out after ${s}ms`))},s)),e.then(e=>{a||(l(),n(e))},e=>{if(a)return;l();let n=e instanceof Error?e:Error(String(e));i.emit(ob.client.error,n,t),r(n)})})}let _=new Map;for(let e of r.jsonSerializableMethods??[])_.set(e,{jsonSerializable:!0});let v=e.createChannel({definitions:_,onError(e){f(`error`,e),i.emit(ob.client.connectionError,e),m(new Dx(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){l!==`error`&&f(`disconnected`),m(new Dx(`connection`,`[devframe] Disconnected from the devframe server`,{cause:u??void 0}))}}),y=YC(a.functions,{channel:v,rpcOptions:o});a.register({name:ob.broadcast.authRevoked,type:`event`,handler:()=>{c=!1;let e=new Dx(`auth`,`[devframe] The devframe server revoked this client's trust`);f(`unauthorized`,e),i.emit(ob.client.connectionError,e),m(e),i.emit(ob.client.isTrustedUpdated,!1)}});let b=n;async function x(e){b=e;let t=await y.$call(`anonymous:devframe:auth`,{authToken:e,ua:navigator.userAgent,origin:location.origin});if(c=t.isTrusted,c)d.resolve(!0),f(`connected`);else{let e=new Dx(`auth`,`[devframe] The devframe server refused this client's credentials`);f(`unauthorized`,e),i.emit(ob.client.connectionError,e)}return i.emit(ob.client.isTrustedUpdated,c),t.isTrusted}async function S(e){let t=(await y.$call(`anonymous:devframe:auth:exchange`,{code:e,ua:navigator.userAgent,origin:location.origin}))?.authToken??null;return t&&(b=t,c=!0,d.resolve(!0),f(`connected`),i.emit(ob.client.isTrustedUpdated,!0)),t}async function C(){return c?!0:x(b??``)}async function w(e=6e4){if(c&&d.resolve(!0),e<=0)return d.promise;let t=()=>{};return await Promise.race([d.promise.then(t),new Promise((n,r)=>{let i=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e);t=()=>clearTimeout(i)})]),c}return{transport:t,get isTrusted(){return c},get status(){return l},get connectionError(){return u},requestTrust:C,requestTrustWithToken:x,requestTrustWithCode:S,ensureTrusted:w,call:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(ob.client.error,n,t),Promise.reject(n)):g(y.$call(...e),t)},callEvent:(...e)=>{let t=h();if(t){i.emit(ob.client.error,t,String(e[0]));return}return y.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(ob.client.error,n,t),Promise.reject(n)):g(y.$callOptional(...e),t)},close:()=>{v.close()}}}function QC(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`;return new URL(e.path??`/`,`${r.protocol}//${t}`).href}return new URL(e.path??``,r).href}let i=e??``;return/^https?:\/\//i.test(i)?i:new URL(i,r).href}function $C(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},sseOptions:s={},callTimeout:c=0}=e,l=QC(n.sse,r??`./`,location);return ZC({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>RC({url:l,authToken:t,definitions:e.definitions,...s,onConnected(){s.onConnected?.()},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(){e.onDisconnected(),s.onDisconnected?.()}})})}function ew(e){let{name:t,message:n,cause:r,...i}=e,a=r instanceof Error?r:tw(r)?ew(r):r,o=a===void 0?Error(n):Error(n,{cause:a});return o.name=t,Object.assign(o,i),o}function tw(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function nw(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function rw(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function iw(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function aw(e){if(e.error)throw ew(e.error);return e.output}function ow(e){return e.some(e=>e!=null)}function sw(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function cw(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?AC(e):e}function a(e,t){return i(sw(e),t)}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>a(t,e.serialization)));let r=await n.get(e.path);return iw(r)?aw(r):r}async function s(e,n){return r.has(e)||r.set(e,t(e).then(e=>a(e,n))),await r.get(e)}async function c(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if(nw(r)){if(ow(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(rw(r)){let e=Ob(n),i=r.records[e];if(i)return aw(await s(i,r.serialization));if(r.fallback)return aw(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!ow(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await c(e,t),callOptional:async(t,n)=>{if(t in e)return await c(t,n)},callEvent:async(e,t)=>{}}}async function lw(e){let t=cw(await e.fetchJsonFromBases(ub),e.fetchJsonFromBases);return{transport:`static`,isTrusted:!0,status:`connected`,connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1)),close:()=>{}}}var uw=256,dw=class extends Error{name=`StreamClosedError`};function fw(e={}){let t=e.id??cC(),n=Math.max(0,e.replayWindow??0),r=ex(),i=new AbortController,a=[],o=!1,s=0;function c(e){if(o)throw new dw(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(a.push({seq:s,chunk:e}),a.length>n&&a.splice(0,a.length-n)),r.emit(`chunk`,s,e)}function l(e){if(o)return;o=!0;let t=mw(e);i.abort(e),r.emit(`end`,t)}function u(){o||(o=!0,i.signal.aborted||i.abort(`stream closed`),r.emit(`end`,void 0))}function d(e){o||i.signal.aborted||i.abort(e??`aborted`)}let f=new WritableStream({write(e){c(e)},close(){u()},abort(e){l(e)}});return{id:t,signal:i.signal,get closed(){return o},get lastSeq(){return s},write:c,error:l,close:u,abort:d,writable:f,events:r,buffer:a}}function pw(e={}){let t=e.id??cC(),n=Math.max(1,e.highWaterMark??uw),r=[],i=0,a=!1,o=!1,s,c,l,u;function d(){if(c){if(r.length>0){let e=r.shift(),t=c;c=void 0,t.resolve({value:e,done:!1});return}if(a){let e=c;if(c=void 0,s){let t=Error(s.message);t.name=s.name,e.reject(t)}else e.resolve({value:void 0,done:!0})}}}function f(){if(l){for(;r.length>0;){let e=r.shift();try{l.enqueue(e)}catch{break}}if(a&&l){try{if(s){let e=Error(s.message);e.name=s.name,l.error(e)}else l.close()}catch{}l=void 0}}}function p(t,s){if(!(a||o)&&!(t<=i)){if(i=t,r.push(s),r.length>n){let t=r.length-n;r.splice(0,t),e.onOverflow?.(t)}d(),u&&f()}}function m(e){a||(a=!0,s=e,d(),u&&f())}function h(){o||a||(o=!0,e.onCancel?.(),m(void 0))}function g(){return u||(u=new ReadableStream({start(e){l=e,f()},cancel(){h()}}),u)}return{id:t,get cancelled(){return o},get done(){return a},get lastSeenSeq(){return i},get readable(){return g()},cancel:h,_push:p,_end:m,[Symbol.asyncIterator](){return{next(){if(r.length>0)return Promise.resolve({value:r.shift(),done:!1});if(a){if(s){let e=Error(s.message);return e.name=s.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{c={resolve:e,reject:t}})},return(){return h(),Promise.resolve({value:void 0,done:!0})}}}}}function mw(e){if(e instanceof Error)return{name:e.name||`Error`,message:e.message};if(typeof e==`string`)return{name:`Error`,message:e};try{return{name:`Error`,message:JSON.stringify(e)}}catch{return{name:`Error`,message:String(e)}}}var hw=``;function gw(e,t){return`${e}${hw}${t}`}function _w(e){let t=new Map,n=new Map;e.client.register({name:ob.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(gw(e,n))?._push(r,i)}}),e.client.register({name:ob.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=gw(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:ob.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let r=gw(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(ob.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(hw);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function r(n,r,i={}){let a=gw(n,r),o=t.get(a);if(o)return o;let s=pw({id:r,highWaterMark:i.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${n}#${r}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,n,r),t.delete(a)}});if(t.set(a,s),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:0});else{let i=e.events.on(ob.client.isTrustedUpdated,o=>{o&&(i(),t.has(a)&&!s.cancelled&&!s.done&&e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:s.lastSeenSeq}))})}return s}function i(t,r){let i=gw(t,r),a=n.get(i);if(a)return a;let o=fw({id:r});return o.events.on(`chunk`,(n,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,r,n,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,r,a),n.delete(i)}),n.set(i,o),o}return{subscribe:r,upload:i}}function vw(){}var yw=new Map;function bw(e){let t=e.url;e.authToken&&(t=`${t}?${pb}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=vw,onError:i=vw,onDisconnected:a=vw,definitions:o=yw}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{let t=e instanceof Error?e:Error(e.type);i(t)}),n.addEventListener(`close`,e=>{a(e)});let s=PC(o);return{close:()=>{n.close()},on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN){n.send(e);return}if(n.readyState===WebSocket.CONNECTING){let t=()=>{i(),n.readyState===WebSocket.OPEN&&n.send(e)},r=()=>i();function i(){n.removeEventListener(`open`,t),n.removeEventListener(`close`,r)}n.addEventListener(`open`,t),n.addEventListener(`close`,r);return}i(Error(`Devframe WebSocket is not open; message dropped`))},serialize:s.serialize,deserialize:s.deserialize}}function xw(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})(),i=r.protocol===`https:`?`wss:`:`ws:`;if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`,n=new URL(e.path??`/`,`${i}//${t}`);return n.protocol=i,n.href}let t=new URL(e.path??``,r);return t.protocol=i,t.href}if(typeof e==`number`)return`${i}//${r.hostname}:${e}`;let a=e??``;if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a))return mx(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function Sw(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=xw(n.websocket,r??`./`,location);return ZC({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>bw({url:l,authToken:t,definitions:e.definitions,...s,onConnected(e){s.onConnected?.(e)},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(t){e.onDisconnected(),s.onDisconnected?.(t)}})})}function Cw(e){return e.includes(`:`)}function ww(e,t){return Cw(t)?t:`${e}:${t}`}function Tw(e,t,n){let r=`devframe:settings:${n}:${t}`,i;function a(){return i||=e.sharedState.get(r,{initialValue:{}}),i}return{async get(e){return(await a()).value()[e]},async set(e,t){(await a()).mutate(n=>{n[e]=t})},async delete(e){(await a()).mutate(t=>{delete t[e]})},async all(){return(await a()).value()},async onChange(e){return(await a()).on(`updated`,t=>e(t))}}}function Ew(e,t){return{global:Tw(e,t,`global`),project:Tw(e,t,`project`)}}function Dw(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(Cw(n.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${t}" received an already-namespaced function name "${n.name}". Pass a bare name without a ":" separator.`);e.client.register({...n,name:`${t}:${n.name}`})},call:((n,...r)=>e.call(ww(t,n),...r)),callEvent:((n,...r)=>e.callEvent(ww(t,n),...r)),callOptional:((n,...r)=>e.callOptional(ww(t,n),...r)),sharedState:((n,r)=>e.sharedState.get(ww(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe(ww(t,n),r,i),upload:(n,r)=>e.streaming.upload(ww(t,n),r)}},settings:Ew(e,t),scope:e.scope}}function Ow(e,t){if(t.backend===`static`)return`static`;let n=t.websocket!==void 0,r=t.sse!==void 0;if(e===`websocket`){if(!n)throw Error(`[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint`);return`websocket`}if(e===`sse`){if(!r)throw Error(`[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint`);return`sse`}if(t.backend===`sse`&&r)return`sse`;if(n)return`websocket`;if(r)return`sse`;throw Error(`[devframe] This server advertises no RPC transport (backend "none"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function kw(e={}){let{baseURL:t=`./`,rpcOptions:n={},cacheOptions:r=!1}=e,i=ex(),a=Array.isArray(t)?t:[t],o=await Ex(e),{connectionMeta:s,metaBaseUrl:c,authToken:l}=o,u=a[0]??`./`;try{u=new URL(`.`,c).href}catch{}let d=new kb({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),f={rpc:void 0},p=new Jb(f);async function m(e){let t=[u,...a.filter(e=>e!==u)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(ux(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let h={authToken:l,connectionMeta:s,metaBaseUrl:c,events:i,clientRpc:p,callTimeout:e.callTimeout,rpcOptions:{...n,async onRequest(e,t,i){if(await n.onRequest?.call(this,e,t,i),r&&d?.validate(e.m)){if(d.has(e.m,e.a))return i(d.cached(e.m,e.a));let n=await t(e);d.apply(e,n)}else await t(e)}}},g=Ow(e.transport??`auto`,s),_=g===`static`?await lw({fetchJsonFromBases:m}):g===`sse`?$C({...h,sseOptions:e.sseOptions}):Sw({...h,wsOptions:e.wsOptions}),v;try{v=new BroadcastChannel(`devframe-auth`)}catch{}let y,b=!1;function x(e){return((...t)=>b||!y?e(...t):y.then(()=>e(...t)))}let S={events:i,get isTrusted(){return _.isTrusted},get status(){return _.status},get connectionError(){return _.connectionError},get transport(){return _.transport??g},get connection(){return o},connectionMeta:s,ensureTrusted:_.ensureTrusted,requestTrust:_.requestTrust,requestTrustWithToken:async e=>(Sx(e),o={...o,authToken:e},_.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await _.requestTrustWithCode(e);if(!t)return!1;Sx(t),o={...o,authToken:t};try{v?.postMessage({type:`auth-update`,authToken:t})}catch{}return!0},call:x(_.call),callEvent:x(_.callEvent),callOptional:x(_.callOptional),client:p,sharedState:void 0,services:void 0,streaming:void 0,cacheManager:d,scope:void 0,close:()=>_.close?.()};S.sharedState=fC(S),S.streaming=_w(S),S.services=Mx(S);let C=new Map;S.scope=(e=>{if(!e)return S;let t=C.get(e);return t||(t=Dw(S,e),C.set(e,t)),t}),f.rpc=S;function w(){try{return typeof window<`u`&&window.self===window.top}catch{return!1}}async function T(){if(!(e.simpleAuth===!1||!w())&&typeof globalThis.prompt==`function`)for(;!S.isTrusted;){let e=globalThis.prompt(`devframe: enter the authentication code shown in your terminal`);if(e==null)return;let t=e.trim();if(t&&await S.requestTrustWithCode(t))return}}async function E(){let t=await _.requestTrust(),n=e.otpParam??`devframe_otp`,r=n?await jx(S,{param:n}):!1;t||r||S.isTrusted||await T()}return y=E().then(()=>{b=!0},()=>{b=!0}),v&&(v.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&S.requestTrustWithToken(e.data.authToken)}),S}var Aw=kw;function jw(e,t){return!!(t.excludeUnderscoreProps&&e.startsWith(`_`)||t.excludeDollarProps&&e.startsWith(`$`))}var Mw=[];for(let e of[`WeakMap`,`WeakSet`,`WeakRef`,`ArrayBuffer`,`SharedArrayBuffer`]){let t=globalThis[e];typeof t==`function`&&Mw.push([t,e])}function Nw(e,t={}){let n=performance.now(),r={seen:new Map,stats:{nodes:0,refs:0,truncatedDepth:0,truncatedEntries:0,truncatedProps:0,ms:0},opts:{maxDepth:t.maxDepth??8,maxEntries:t.maxEntries??200,maxProps:t.maxProps??150,maxString:t.maxString??4e3,excludeFunctions:t.excludeFunctions??!1,excludeUnderscoreProps:t.excludeUnderscoreProps??!1,excludeDollarProps:t.excludeDollarProps??!1}},i=Fw(e,r,0,`#`,[]);return r.stats.ms=Math.round((performance.now()-n)*100)/100,{data:i,stats:r.stats}}function Pw(e,t,n={}){let r=e;for(let[e,i]of t){if(typeof r!=`object`||!r)return;switch(e){case`k`:r=r instanceof Map?r.get(i):Object.hasOwn(r,i)?r[i]:void 0;break;case`i`:{let e=r;r=(n.excludeFunctions?e.filter(e=>typeof e!=`function`):e)[i];break}case`s`:r=[...r][i];break;case`mk`:r=[...r.entries()][i]?.[0];break;case`mv`:r=[...r.entries()][i]?.[1]}}return r}function Fw(e,t,n,r,i){t.stats.nodes++;let a=Iw(e,t);if(a.handled)return a.value;let o=e,s=t.seen.get(o);return s===void 0?Lw(o)||(n>=t.opts.maxDepth?(t.stats.truncatedDepth++,{$truncated:`depth`,$preview:Gw(o),$path:i}):(t.seen.set(o,r),Array.isArray(o)?Rw(o,t,n,r,i):ArrayBuffer.isView(o)?zw(o):o instanceof Map?Bw(o,t,n,r,i):o instanceof Set?Vw(o,t,n,r,i):Hw(o,t,n,r,i))):(t.stats.refs++,{$ref:s})}function Iw(e,t){if(e==null)return{handled:!0,value:e??null};let n=typeof e;if(n===`string`){let n=e;return{handled:!0,value:n.length>t.opts.maxString?`${n.slice(0,t.opts.maxString)}… [$truncated string, ${n.length} chars]`:n}}return n===`number`?{handled:!0,value:Number.isFinite(e)?e:String(e)}:n===`boolean`?{handled:!0,value:e}:n===`bigint`?{handled:!0,value:{$type:`bigint`,value:String(e)}}:n===`symbol`?{handled:!0,value:{$type:`symbol`,value:String(e)}}:n===`function`?{handled:!0,value:{$type:`function`,name:e.name||`(anonymous)`}}:{handled:!1}}function Lw(e){if(e instanceof Date)return{$type:`Date`,value:Number.isNaN(e.getTime())?`Invalid Date`:e.toISOString()};if(e instanceof RegExp)return{$type:`RegExp`,value:String(e)};if(e instanceof URL)return{$type:`URL`,value:e.href};if(e instanceof Error)return{$type:`Error`,name:e.name,message:e.message};if(e instanceof Promise)return{$type:`Promise`};for(let[t,n]of Mw)if(e instanceof t)return{$type:n}}function Rw(e,t,n,r,i){let a=t.opts.excludeFunctions?e.filter(e=>typeof e!=`function`):e,o=Math.min(a.length,t.opts.maxEntries),s=Array.from({length:o});for(let e=0;e<o;e++)s[e]=Fw(a[e],t,n+1,`${r}[${e}]`,Ww(i,[`i`,e]));return a.length>o&&(t.stats.truncatedEntries++,s.push({$truncated:`entries`,$total:a.length,$shown:o})),s}function zw(e){let t=e;return{$type:e.constructor?.name??`TypedArray`,length:t.length??t.byteLength}}function Bw(e,t,n,r,i){let a=[...e.entries()].slice(0,t.opts.maxEntries);if(e.size>a.length&&t.stats.truncatedEntries++,a.every(([e])=>typeof e==`string`)){let o={};for(let[e,s]of a)o[e]=Fw(s,t,n+1,`${r}.${String(e)}`,Ww(i,[`k`,e]));return{$type:`Map`,size:e.size,value:o}}return{$type:`Map`,size:e.size,entries:a.map(([e,a],o)=>({key:Fw(e,t,n+1,`${r}~keys[${o}]`,Ww(i,[`mk`,o])),value:Fw(a,t,n+1,`${r}~values[${o}]`,Ww(i,[`mv`,o]))}))}}function Vw(e,t,n,r,i){let a=[...e].slice(0,t.opts.maxEntries);return e.size>a.length&&t.stats.truncatedEntries++,{$type:`Set`,size:e.size,values:a.map((e,a)=>Fw(e,t,n+1,`${r}~set[${a}]`,Ww(i,[`s`,a])))}}function Hw(e,t,n,r,i){let a=Object.getPrototypeOf(e),o=a&&a!==Object.prototype&&a!==null?a.constructor?.name:void 0,s={};o&&o!==`Object`&&(s.$class=o);let c=Object.keys(e).filter(e=>!jw(e,t.opts)),l=Math.min(c.length,t.opts.maxProps);for(let a=0;a<l;a++)Uw(e,c[a],t,n,r,i,s);return c.length>l&&(t.stats.truncatedProps++,s.$truncated=`props: showing ${l} of ${c.length}`),s}function Uw(e,t,n,r,i,a,o){let s;try{s=e[t]}catch(e){o[t]={$type:`getter-error`,message:e instanceof Error?e.message:String(e)};return}n.opts.excludeFunctions&&typeof s==`function`||(o[t]=Fw(s,n,r+1,`${i}.${t}`,Ww(a,[`k`,t])))}function Ww(e,t){return[...e,t]}function Gw(e){if(Array.isArray(e))return`Array(${e.length})`;if(e instanceof Map)return`Map(${e.size})`;if(e instanceof Set)return`Set(${e.size})`;let t=e.constructor?.name??`Object`,n=Object.keys(e);return`${t} { ${n.slice(0,5).join(`, `)}${n.length>5?`, …`:``} }`}var Kw=`modulepreload`,qw=function(e,t){return new URL(e,t).href},Jw={},Yw=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=qw(t,n),t=s(t),t in Jw)return;Jw[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Kw,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function Xw(e){return!!e&&typeof e==`object`&&e.$type===`Map`}function Zw(e){return!!e&&typeof e==`object`&&e.$type===`Set`}function Qw(e){return!!e&&typeof e==`object`&&typeof e.entries==`function`&&typeof e.get==`function`}function $w(e){return!!e&&typeof e==`object`&&typeof e.has==`function`&&typeof e[Symbol.iterator]==`function`&&typeof e.get!=`function`}var eT;function tT(){return eT??=Yw(async()=>{let{default:e}=await Promise.resolve().then(()=>aM);return{default:e}},void 0,import.meta.url).then(({default:e})=>e.setup({methods:{fromMap:e=>Qw(e)?Object.fromEntries(e.entries()):Xw(e)?e.value??Object.fromEntries((e.entries??[]).map(e=>[String(e.key),e.value])):e,mapEntries:e=>Qw(e)?[...e.entries()].map(([e,t])=>({key:e,value:t})):Xw(e)?e.entries?e.entries:Object.entries(e.value??{}).map(([e,t])=>({key:e,value:t})):[],fromSet:e=>$w(e)?[...e]:Zw(e)?e.values??[]:e,typeOf:e=>e===null?`null`:typeof e==`object`?e.constructor?.name??`Object`:typeof e,ownKeys:e=>e&&typeof e==`object`?Reflect.ownKeys(e).map(String):[]}}))}async function nT(e,t,n){try{let r=performance.now(),i=(await tT())(t)(e),a=Math.round((performance.now()-r)*100)/100,{data:o,stats:s}=Nw(i,n);return{ok:!0,result:o,stats:{queryMs:a,normalize:s,payloadBytes:new TextEncoder().encode(JSON.stringify(o)??``).length}}}catch(e){let t=e instanceof Error?e:Error(String(e));return{ok:!1,error:{message:t.message,name:t.name}}}}async function rT(e,t,n,r){try{let i=performance.now(),a=Pw((await tT())(t)(e),n,r),o=Math.round((performance.now()-i)*100)/100,{data:s,stats:c}=Nw(a,r);return{ok:!0,result:s,stats:{queryMs:o,normalize:c,payloadBytes:new TextEncoder().encode(JSON.stringify(s)??``).length}}}catch(e){let t=e instanceof Error?e:Error(String(e));return{ok:!1,error:{message:t.message,name:t.name}}}}async function iT(e,t,n,r=30){try{let i=performance.now(),a=(await tT())(t,{tolerant:!0,stat:!0})(e).suggestion(n,{limit:r})??[],o=Math.round((performance.now()-i)*100)/100,s=[];for(let e of a){for(let t of e.suggestions??[])if(s.push({type:String(e.type),from:e.from,to:e.to,current:String(e.text??``),value:String(t).slice(0,200)}),s.length>=r)break;if(s.length>=r)break}return{ok:!0,suggestions:s,statMs:o}}catch(e){return{ok:!1,suggestions:[],statMs:0,error:e instanceof Error?e.message:String(e)}}}function aT(e,t={}){let n=performance.now(),r={seen:new WeakSet,nodes:0,opts:{maxDepth:t.maxDepth??5,maxProps:t.maxProps??80,excludeFunctions:t.excludeFunctions??!1,excludeUnderscoreProps:t.excludeUnderscoreProps??!1,excludeDollarProps:t.excludeDollarProps??!1}};return{skeleton:cT(e,r,0),nodes:r.nodes,ms:Math.round((performance.now()-n)*100)/100}}function oT(e){return typeof e.entries==`function`&&typeof e.get==`function`&&typeof e.size==`number`}function sT(e){return typeof e.has==`function`&&typeof e[Symbol.iterator]==`function`&&typeof e.get!=`function`&&typeof e.size==`number`}function cT(e,t,n){if(t.nodes++,e==null)return String(e);let r=typeof e;if(r!==`object`)return r;let i=e;if(i instanceof Date)return`Date`;if(i instanceof RegExp)return`RegExp`;if(i instanceof URL)return`URL`;if(i instanceof Error)return`Error`;if(i instanceof Promise)return`Promise`;if(t.seen.has(i))return`[circular]`;if(n>=t.opts.maxDepth)return`...`;t.seen.add(i);try{return lT(i,t,n)}finally{t.seen.delete(i)}}function lT(e,t,n){return Array.isArray(e)?uT(e,t,n):ArrayBuffer.isView(e)?e.constructor?.name??`TypedArray`:oT(e)?dT(e,t,n):sT(e)?fT(e,t,n):pT(e,t,n)}function uT(e,t,n){let r=t.opts.excludeFunctions?e.filter(e=>typeof e!=`function`):e;if(r.length===0)return[];let i=cT(r[0],t,n+1);return r.length>1?[i,`+${r.length-1} more`]:[i]}function dT(e,t,n){let r=e.entries().next().value;return r?{[`Map(${e.size})`]:{key:cT(r[0],t,n+1),value:cT(r[1],t,n+1)}}:`Map(0)`}function fT(e,t,n){let r=e[Symbol.iterator]().next().value;return r===void 0?`Set(0)`:{[`Set(${e.size})`]:cT(r,t,n+1)}}function pT(e,t,n){let r=Object.getPrototypeOf(e),i=r&&r!==Object.prototype?r.constructor?.name:void 0,a={};i&&i!==`Object`&&(a.$class=i);let o=Object.keys(e).filter(e=>!jw(e,t.opts)),s=Math.min(o.length,t.opts.maxProps);for(let r=0;r<s;r++)mT(e,o[r],t,n,a);return o.length>s&&(a[`...`]=`+${o.length-s} more props`),a}function mT(e,t,n,r,i){let a;try{a=e[t]}catch{i[t]=`getter-error`;return}n.opts.excludeFunctions&&typeof a==`function`||(i[t]=cT(a,n,r+1))}var hT=Yt({connected:!1,status:`connecting`,error:null,mode:`rpc`}),gT=un(null);function _T(){if(!gT.value)throw Error(`not connected`);return gT.value}var vT=`devframe:docks:active`,yT=null;async function bT(e,t){let n=yT;if(!n)return;let r=n=>{let r=n?.activation;if(!r||r.dockId!==e)return;let i=r.params?.sourceId;typeof i==`string`&&t(i)};try{let e=await n.sharedState.get(vT,{initialValue:{activation:null}});r(e.value()),e.on(`updated`,r)}catch{}}function xT(e){let t=(t,...n)=>e.call(t,...n);return{static:!1,sources:()=>t(`devframes:plugin:data-inspector:sources`),query:(e,n,r)=>t(`devframes:plugin:data-inspector:query`,e,n,r),queryPath:(e,n,r,i)=>t(`devframes:plugin:data-inspector:queryPath`,e,n,r,i),suggest:(e,n,r)=>t(`devframes:plugin:data-inspector:suggest`,e,n,r),skeleton:(e,n)=>t(`devframes:plugin:data-inspector:skeleton`,e,n),savedList:()=>t(`devframes:plugin:data-inspector:saved:list`),savedSave:e=>t(`devframes:plugin:data-inspector:saved:save`,e),savedDelete:async(e,n)=>{await t(`devframes:plugin:data-inspector:saved:delete`,e,n)},write:(e,n,r)=>t(`devframes:plugin:data-inspector:write`,e,n,r),onSourcesChanged:t=>{e.client.register({name:`devframes:plugin:data-inspector:sources:changed`,type:`event`,handler:t})},onDataChanged:t=>{e.client.register({name:`devframes:plugin:data-inspector:data:changed`,type:`event`,handler:t})}}}function ST(e){let t=e.sources;function n(e){let n=t.find(t=>t.id===e);if(!n)throw Error(`unknown data source "${e}"`);return n.data}return{static:!0,async sources(){return t.map(({data:e,...t})=>t)},async query(e,t,r){return nT(n(e),t,r)},async queryPath(e,t,r,i){return rT(n(e),t,r,i)},async suggest(e,t,r){return iT(n(e),t,r)},async skeleton(e,t){try{return{ok:!0,...aT(n(e),t)}}catch(e){let t=e instanceof Error?e:Error(String(e));return{ok:!1,error:{name:t.name,message:t.message}}}},async savedList(){return[]},async savedSave(){throw Error(`saved queries are unavailable in static mode`)},async savedDelete(){throw Error(`saved queries are unavailable in static mode`)},async write(){throw Error(`editing is unavailable in static mode`)},onSourcesChanged:()=>{},onDataChanged:()=>{}}}function CT(){let e=new URLSearchParams(location.search),t=e.get(pb);if(!t)return;e.delete(pb);let n=e.toString();return history.replaceState(null,``,n?`?${n}`:location.pathname),t}async function wT(){try{let e=await fetch(`./__connection.json`);if(!e.ok||(await e.json())?.backend!==`static`)return null}catch{return null}let e=await fetch(`./data-inspector-static.json`);if(!e.ok)throw Error(`failed to load static dataset (${e.status})`);return await e.json()}function TT(e){hT.status=e.status,hT.connected=e.status===`connected`,hT.error=e.connectionError?.message??null}async function ET(){let e=CT();try{let t=await wT();if(t){gT.value=ST(t),hT.mode=`static`,hT.status=`connected`,hT.connected=!0,hT.error=null;return}let n=await Aw({baseURL:`./`,authToken:e});yT=n,gT.value=xT(n),TT(n),n.events.on(`connection:status`,()=>TT(n)),await n.ensureTrusted(1e4).catch(()=>{}),TT(n)}catch(e){hT.status=`error`,hT.error=e instanceof Error?e.message:String(e)}}var DT=bd(),OT=Q(()=>DT.value?`dark`:`light`),kT={class:`min-w-0 flex items-center gap-1.5`},AT=[`title`],jT=W({__name:`AppHeader`,setup(e){let t=Q(()=>ab(hT.status));return(e,n)=>(K(),J(nb,{glass:!1,class:`h-nav`},{search:U(()=>[...n[3]||=[Y(`div`,null,null,-1)]]),end:U(()=>[X(vm,{icon:`i-ph:book-open-duotone`,as:`a`,href:`https://devfra.me/plugins/data-inspector`,target:`_blank`,title:`Data Inspector docs: using the plugin and providing data sources`}),X(vm,{icon:`i-ph:sun-duotone dark:i-ph:moon-duotone`,title:`Toggle dark mode`,onClick:n[0]||=e=>DT.value=!H(DT)})]),default:U(()=>[Y(`div`,kT,[n[1]||=Y(`span`,{class:`flex items-center gap-1.5 shrink-0 font-semibold text-sm select-none`},[Y(`span`,{class:`i-ph-crosshair-duotone text-base color-active`}),Y(`span`,null,`Data Inspector`)],-1),n[2]||=Y(`span`,{class:`truncate op-fade text-xs select-none`},`Inspect server side data/objects interactively`,-1),H(hT).mode===`static`?(K(),J($y,{key:0,class:`flex items-center gap-1.5 py-1 text-xs select-none`,text:`static`,color:!1})):t.value?(K(),q(`span`,{key:1,class:ye(t.value.class),title:H(hT).error??void 0},[Y(`span`,{class:ye(t.value.dot)},null,2),Ts(` `+ke(t.value.label),1)],10,AT)):Z(``,!0)])]),_:1}))}}),MT=`1.0.0-beta.16`,NT=Object.hasOwn||((e,t)=>Object.hasOwnProperty.call(e,t)),PT=Object.prototype.toString;function FT(e,t){return t!==void 0&&(VT(t)?t.forEach(t=>e.add(t)):e.add(t)),e}function IT(e,t,n){e.has(t)?e.get(t).add(n):e.set(t,new Set([n]))}function LT(e,t){return e&&NT(e,t)?e[t]:void 0}function RT(e){return typeof e==`object`&&!!e&&e.constructor===Object}function zT(e){return PT.call(e)===`[object RegExp]`}function BT(e){return e&&(VT(e)||NT(e,`length`)&&isFinite(e.length))}function VT(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function HT(e,t=0){let n=parseInt(e,10);return isNaN(n)?t:n}function UT(e){if(VT(e))return e.length>0;if(RT(e)){for(let t in e)if(NT(e,t))return!0;return!1}return!!e}function WT(e,t){let n=e.startsWith(`0x`)||e.startsWith(`0X`);if(e.includes(`_`)){let r=e.match(n?/(?:^|[^0-9a-fA-F])_|_(?:[^0-9a-fA-F]|$)/:/(?:^|\D)_|_(?:\D|$)/);if(r){let e=r[0],n=r.index+Number(e[1]===`_`);t(`${e===`__`?`Only one underscore is allowed`:`Wrong underscore`} as numeric separator`,{inside:[n,1]})}e=e.replace(/_/g,``)}return n?parseInt(e,16):parseFloat(e)}var GT={0:`\0`,b:`\b`,n:`
|
|
7
|
+
`,r:`\r`,f:`\f`,t:` `,v:`\v`};function KT(e,t=!1,n=1,r){return e.slice(1,e.length-n).replace(/\\(?:(\r\n?|\n|\u2028|\u2029)|([xu][0-9a-fA-F]*)|$|(.))|[\r\n\u2028\u2029]/g,(e,n,i,a,o)=>{if(n)return``;if(i){let t=i[0]===`u`;if(i.length===(t?5:3))return String.fromCharCode(parseInt(i.slice(1),16));r(`Invalid ${t?`Unicode`:`hexadecimal`} escape sequence`,{inside:[o+1,e.length]})}return e===`\\`&&r(`Invalid backslash`,{inside:[o+1,1]}),a?GT[a]||a:(!t&&/[\r\n\u2028\u2029]/.test(e)&&r(`Invalid line terminator`,{inside:[o+1,1]}),e)})}function qT(e,t){let n=e.match(/[^/]*$/)||{index:e.length};for(let r=n.index;r<e.length;r++){let n=e.indexOf(e[r],r+1);n!==-1&&t(`Duplicate flag in regexp`,{inside:[n,1]})}return new RegExp(e.slice(1,n.index-1),e.slice(n.index))}var JT=/\n|\r\n?|\u2028|\u2029/g;function YT(e,t){let n=Math.max(t-32,0),r=Math.min(t+32,e.length),i=(n===0?``:`...`)+e.slice(n,t).replace(JT,`\\n`);return`${i}${e.slice(t,r).replace(JT,`\\n`)+(r===e.length?``:`...`)}\n${`-`.repeat(i.length)}^`}function XT(e,t){let n=e.slice(0,t).split(JT);return{line:n.length,column:n[n.length-1].length,offset:t}}var ZT=59,QT={0:`NUMBER`,1:`STRING`,2:`REGEXP`,3:`LITERAL`,4:`IDENT`,5:`$IDENT`,6:`@`,7:`#`,8:`$`,9:`$$`,10:`AND`,11:`OR`,12:`NOT`,13:`NO`,14:`IS`,15:`IN`,16:`NOTIN`,17:`HAS`,18:`HASNO`,19:`ORDER`,20:`METHOD(`,21:`$METHOD(`,22:`TEMPLATE`,23:`TPL_START`,24:`TPL_CONTINUE`,25:`TPL_END`,26:`.`,27:`..`,28:`...`,29:`.(`,30:`.[`,31:`..(`,32:`|`,33:`=>`,34:`=`,35:`!=`,36:`~=`,37:`<`,38:`<=`,39:`>`,40:`>=`,41:`+`,42:`-`,43:`*`,44:`/`,45:`%`,46:`??`,47:`?`,48:`(`,49:`)`,50:`[`,51:`]`,52:`{`,53:`}`,54:`,`,55:`:`,56:`;`,57:`BAD_TOKEN`,58:`EOF`},$T=oE(48,49,29,49,31,49,20,49,21,49,50,51,30,51,52,53,23,25),eE={"has no":18,"not in":16,and:10,or:11,not:12,has:17,is:14,in:15,no:13,asc:19,ascN:19,ascA:19,ascNA:19,ascAN:19,desc:19,descN:19,descA:19,descNA:19,descAN:19},tE={"...":28,"..(":31,"..":27,".(":29,".[":30,"=>":33,"!=":35,"~=":36,"<=":38,">=":40,"??":46,"@":6,"#":7,".":26,"|":32,"=":34,"<":37,">":39,"+":41,"-":42,"*":43,"/":44,"%":45,"?":47,"(":48,")":49,"[":50,"]":51,"{":52,"}":53,",":54,":":55,";":56},nE=aE(10,11,12,13,15,16,17,18,14,19),rE=aE(26,27),iE=aE(0,1,22,25,2,3,4,9,5,8,6,7,49,51,53,26);function aE(...e){let t=new Int8Array(ZT);for(let n of e)t[n]=1;return t}function oE(...e){let t=new Int8Array(ZT).fill(-1);for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1];return t}var sE=[10,11,15,16,17,18,14],cE=[41,42,43,44,45,32,34,35,36,40,38,37,39],lE=[54,47,55,56,58,51,49,53,24,25,19,...cE,...sE],uE=aE(...lE),dE=aE(...lE);dE[49]=0;var fE=aE(...lE);fE[51]=0;var pE=aE(54,47,55,24,25,19,...cE,...sE);[32,34,41,42,43,44,45,15,17,16,18].forEach(e=>pE[e]=0);var mE=new Map([[null,uE],[47,uE],[55,uE],[56,uE],[54,uE],[26,uE],[27,uE],[48,uE],[33,uE],[12,uE],[13,uE],[29,dE],[31,dE],[20,dE],[21,dE],[50,fE],[30,fE],[8,pE],...cE.map(e=>[e,uE]),...sE.map(e=>[e,uE])]),hE=/\/\/.*?(?:\n|\r\n?|\u2028|\u2029|$)|\/\*(?:.|\s)*?(?:\*\/|$)/y,gE=/\s+/y,_E=new RegExp(Object.keys(tE).map(e=>e.replace(/[\[\]{}()^$|?*+.]/g,`\\$&`)).join(`|`),`y`),vE=/(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)\b/y,yE=/(?:has no|not in|and|or|not|has|is|in|no|(?:asc|desc)(?:NA?|AN?)?)\b/y,bE=/\/(?:\\.|[^/])+\/[gimsu]*/y,xE=/(?:[_\d]*\.)?[_\d]+(?:[eE][-+]?[_\d]+)?\b|0[xX][_0-9a-fA-F]+\b/y,SE=/"(?:\\.|[^"])*"|'(?:\\.|[^'])*'/sy,CE=/`(?:\\.|[^`\\$]|\$(?!\{))*(\$\{|`)/sy,wE=/\}(?:\\.|[^`\\$]|\$(?!\{))*(\$\{|`)/sy,TE=()=>{},EE=new Map([[`true`,!0],[`false`,!1],[`null`,null],[`undefined`,void 0],[`Infinity`,1/0],[`NaN`,NaN]]),DE=class{#e;#t;constructor(e,t,n,r,i=null){this.type=e,this.start=t,this.end=n,this.#e=r,this.#t=i}get name(){return QT[this.type]}get value(){return this.#t??=this.#e.slice(this.start,this.end)}};function*OE(e,t=!1){let n=AE(e,t),r;for(;r=n();)yield r}function kE(e,t=!1){let n=AE(e,t),r=[],i;for(;i=n();)r.push(i);return r}function AE(e,t){let{tolerant:n=!1,onComment:r}=typeof t==`boolean`?{tolerant:t}:t||{},i=typeof r==`function`?r:Array.isArray(r)?(e,t)=>r.push([e,t]):TE,a=e.length,o=0,s=!1,c=[],l=!1,u=!1,d=null,f=null,p=0;function m(e=1){o=Math.min(o+e,a)}function h(t){t.lastIndex=o;let n=t.exec(e);if(n){let e=n[0];return m(e.length),e}return null}function g(){return o<a?e[o]:``}function _(){let t=o+1;return t<a?e[t]:``}function v(e){return e>=`A`&&e<=`Z`||e>=`a`&&e<=`z`||e===`_`||e===`\\`&&_()===`u`}function y(e){if(e>=`0`&&e<=`9`)return!0;if(e===`.`){let e=_();return e>=`0`&&e<=`9`||e===`_`}return!1}function b(e){$T[e]===-1?x()===e&&c.pop():c.push($T[e])}function x(){return c.length>0?c[c.length-1]:-1}function S(t){if(mE.get(f)?.[t.type]){d=t;let n,r;return f===null?(n=0,r=nE[t.type]?Math.max(0,t.start-1):t.start):nE[f]?(n=t.start,r=t.start):nE[t.type]?(n=p,r=Math.max(p,t.start-1)):(n=p,r=t.start),new DE(4,n,r,e,``)}return f=t.type,p=t.end,t}function C(){if(o>=a)return s=!0,58;let t=o,n=e[o];if(y(n)&&h(xE))return 0;if((n===`"`||n===`'`)&&h(SE))return 1;if(n==="`"&&h(CE))return e[o-1]=="`"?22:23;if(n===`}`&&x()===25&&h(wE))return e[o-1]==="`"?25:24;if(n===`/`)return!l&&h(bE)?2:(m(),44);if(v(n)){if(!u&&h(yE))return eE[e.slice(t,o)];if(h(vE))return!u&&EE.has(e.slice(t,o))?3:g()===`(`?(m(),20):4}return n===`$`?(m(),g()===`$`?(m(),9):h(vE)?g()===`(`?(m(),21):5:8):h(_E)?tE[e.slice(t,o)]:(o++,57)}function w(){let t=o;return g()===`/`&&h(hE)?(i(t,o,e),!0):!1}return function(){if(d){let e=d;return d=null,f=e.type,p=e.end,e}if(s)return null;do h(gE)&&(u=!1);while(w());let t=o,r=C(),i=new DE(r,t,o,e);return l=iE[r],u=rE[r],b(r),n?S(i):i}}var jE=Symbol(`RECOVERABLE_ERROR`),ME=-1,NE=!0,PE=!1,FE=aE(47),IE=oE(19,1,32,2,47,3,14,4,11,5,10,6,46,7,12,8,13,8,15,9,16,9,17,9,18,9,34,10,35,10,36,10,37,11,38,11,39,11,40,11,41,12,42,12,43,12,44,12,45,12);function LE(e,t){let n=kE(e,t),r=0,i=n[r],a=!1,o=null;try{return o=E()}finally{o&&f(58)}function s(t,n){if(a)throw jE;let r=i.start,o=i.end;n??={},Array.isArray(n?.inside)&&(r+=n.inside[0],o=r+n.inside[1]),i.type===57&&(t=`Bad input on line ${XT(e,r).line} column ${XT(e,r).column}`);let s=XT(e,r),c=i.type===57||n?.inside?[t,``,YT(e,r)]:[`Parse error on line ${s.line}:`,``,YT(e,r),...t?[``,t]:[]],l=i.type===57||!Array.isArray(n?.expected)?null:[...new Set([].concat(...n.expected).map(e=>`'${QT[e]}'`))];throw l&&c.push(``,`Expecting `+l.join(`, `)+` got `+QT[i.type]),Object.assign(SyntaxError(c.join(`
|
|
8
|
+
`)),{details:{rawMessage:t,text:i.value,token:i.name,expected:l,loc:{range:[r,o],start:s,end:XT(e,o)}}})}function c(...e){s(null,{expected:e})}function l(e=ME){e!==ME&&i.type!==e&&c(e)}function u(e){let t=a;a=!1;let n=e();return a=t,n}function d(e,...t){let o=a,s=r;try{return a=!0,e(...t)}catch(e){if(e!==jE)throw e;return r=s,i=n[r],null}finally{a=o}}function f(e){let t=i;return l(e),r=Math.min(r+1,n.length-1),i=n[r],t}function p(e){return _(e)?f():null}function m(e){let t=i.value;return f(e),t}function h(e){let t=[i.start,i.end];return f(e),t}function g(e,t,n){f(e);let r=t();return f(n),r}function _(e){return i.type===e}function v(e){return(r<n.length-1?n[r+1].type:58)===e}function y(){return i.start}function b(e){let t=r>0?n[r-1].end:0;return e>t?[t,t]:[e,t]}function x(e){return e?.range[0]??y()}function S(){let e=r>0?n[r-1].end:0;return{type:`Placeholder`,range:[e,e]}}function C(e,t,n){return e===null?t:w(e,t,b(n))}function w(e,t,n){return{type:`Block`,definitions:e,body:t,range:n}}function T(e,t,n){return{type:`Method`,reference:e,arguments:t,range:n}}function E(){let e=y();return w(D()||[],M()||S(),b(e))}function D(){let e=null;for(let t;t=O();)e===null?e=[t]:e.push(t);return e}function O(){return _(8)||_(5)?d(k):null}function k(){let e=y(),t=A(),n=p(55)?u(M):null;return f(56),{type:`Definition`,declarator:t,value:n,range:b(e)}}function A(){let e=y();return{type:`Declarator`,name:_(5)?m().slice(1):p(8)?null:c(5,8),range:b(e)}}function ee(e=!1){let{start:t,end:n,type:r,value:a}=i,o=m();return e||(r===5||r===21)&&(o=o.slice(1)),(r===20||r===21)&&(o=o.slice(0,-1)),{type:`Identifier`,name:o,range:[t,n-!a.endsWith(o)]}}function j(){let e=ee();return{type:`Reference`,name:e,range:e.range.slice()}}function te(){switch(i.type){case 6:return{type:`Data`,range:h()};case 7:return{type:`Context`,range:h()};case 8:return{type:`Current`,range:h()};case 9:return{type:`Arg1`,range:h()};default:c(6,7,8,9)}}function ne(){let e=y(),t;switch(i.type){case 0:t=WT(i.value,s);break;case 1:t=KT(i.value,!1,1,s);break;case 22:case 25:t=KT(i.value,!0,1,s);break;case 23:case 24:t=KT(i.value,!0,2,s);break;case 2:t=qT(i.value,s);break;case 3:t=EE.get(i.value);break;default:c(0,1,2,3,22,23,24,25)}return f(),{type:`Literal`,value:t,range:b(e)}}function M(e=0){let t=re();for(;IE[i.type]>=e&&!_(58);){let e=IE[i.type]+!FE[i.type];switch(i.type){case 47:t=Ce(t,e);break;case 32:t=Se(t);break;case 19:t=ue(t);break;default:t=we(t,e)}}return t}function re(){switch(i.type){case 12:case 13:case 41:case 42:case 14:return ie();default:return ae()}}function ie(){let e=y(),t=IE[i.type],n=m();return{type:`Prefix`,operator:n,argument:n===`is`?F():M(t+1),range:b(e)}}function ae(){let e=N();for(;!_(58);)switch(i.type){case 14:e=P(e);break;case 26:e=v(4)?I(e,!0):v(20)||v(21)?se(e,!0):c(4,20,21);break;case 29:e=ye(e);break;case 30:e=xe(e);break;case 27:case 31:e=be(e);break;case 50:e=d(me,e)||ve(e);break;default:return e}return e}function N(){switch(i.type){case 0:case 1:case 2:case 3:return ne();case 22:case 23:return L();case 6:case 7:case 8:case 9:return te();case 5:return ce()||j();case 4:return I();case 20:case 21:return se();case 50:return d(me)||pe();case 52:return he();case 48:return ce()||fe();case 33:return le();default:return null}}function P(e){let t=x(e);return f(14),{type:`Postfix`,operator:F(),argument:e,range:b(t)}}function F(){let e=y(),t=p(12)!==null,n=[];switch(i.type){case 48:f(48);do n.length&&n.push(_(10)||_(11)?m():c(10,11)),n.push(F());while(!p(49));break;case 4:case 3:n=ee();break;case 5:n=T(j(),[],b(e));break;default:c(48,4,3,5)}return{type:`Assertion`,negation:t,assertion:n,range:b(e)}}function I(e=null,t=!1){let n=x(e);return t&&f(26),{type:`GetProperty`,value:e,property:ee(),range:b(n)}}function oe(){let e=y(),t=_(20)?ee():_(21)?j():c(20,21),n=[];if(!_(49))do n.push(M());while(p(54));return f(49),T(t,n,b(e))}function se(e=null,t=!1){let n=x(e);return t&&f(26),{type:`MethodCall`,value:e,method:oe(),range:b(n)}}function L(){let e=y(),t=[];if(_(22))t.push(ne());else{for(t.push(ne(23));t.push(M()),_(24);)t.push(ne(24));t.push(ne(25))}return{type:`Template`,values:t,range:b(e)}}function ce(){if(_(48)){if(!v(5)&&!v(33)&&!v(49))return null}else if(!v(33))return null;return d(le)}function le(){let e=y(),t=[];if(p(48)){if(!_(49))do l(5),t.push(ee());while(p(54));f(49)}else _(5)&&t.push(ee());return f(33),{type:`Function`,arguments:t,body:M()||s(`Expected non-empty expression`),range:b(e)}}function ue(e){let t=x(e),n=[de(e)];for(;p(54);)n.push(de(M(IE[19]+1)));return{type:`CompareFunction`,compares:n,range:b(t)}}function de(e){let t=x(e);return{type:`Compare`,query:e,order:m(19),range:b(t)}}function fe(){let e=y();f(48);let t=D(),n=M()||S();return f(49),{type:`Parentheses`,body:C(t,n,e),range:b(e)}}function pe(){let e=y(),t=[];if(f(50),!p(51)){do _(54)&&s(`Expected expression before comma`),t.push(_(28)?_e(NE):M());while(p(54)&&!_(51));f(51)}return{type:`Array`,elements:t,range:b(e)}}function me(e=null){let t=x(e),n=[g(50,M,55),M()];return p(55)&&n.push(M()),f(51),{type:`SliceNotation`,value:e,arguments:n,range:b(t)}}function he(){let e=y();f(52);let t=D(),n=[];if(!_(53))do n.push(_(28)?_e(PE):ge());while(p(54)&&!_(53));return f(53),C(t,{type:`Object`,properties:n,range:b(e)},e)}function ge(){let e=y(),t,n=null,r=null;switch(i.type){case 20:case 21:{let e=oe();t={type:`Literal`,value:e.reference.type===`Identifier`?e.reference.name:e.reference.name.name,range:void 0},n=e,!_(54)&&!_(53)&&!_(58)&&(r=n,n=Se(r,!0));break}case 4:v(55)||v(54)||v(53)||v(58)?t=ee():(r=I(null,!1),t=r.property,n=Se(r,!0));break;case 5:v(55)?t=ee(!0):(t=j(),!_(54)&&!_(53)&&!_(58)&&(r=t,t=t.name,n=Se(r,!0)));break;case 3:case 1:case 0:t=ne();break;case 8:t=te();break;case 50:t=g(50,M,51),f(55),n=M();break;default:c(4,3,1,0,8,5,50,20,21)}return!r&&!n&&(n=p(55)?M():null),{type:`ObjectEntry`,key:t,value:n,range:b(e)}}function _e(e){let t=y();return{type:`Spread`,query:f(28)&&M(),array:e,range:b(t)}}function ve(e){let t=x(e);return{type:`Pick`,value:e,getter:g(50,M,51),range:b(t)}}function ye(e){let t=x(e);return{type:`Map`,value:e,query:g(29,E,49),range:b(t)}}function be(e){let t=x(e);return{type:`MapRecursive`,value:e,query:p(27)?_(4)?I():se():g(31,E,49),range:b(t)}}function xe(e){let t=x(e);return{type:`Filter`,value:e,query:g(30,E,51),range:b(t)}}function Se(e,t=!1){let n=x(e);return t?p(32):f(32),{type:`Pipeline`,left:e,right:C(t?null:D(),t?M():M(IE[32]+1)||S(),n),range:b(n)}}function Ce(e,t){let n=x(e);return f(47),{type:`Conditional`,test:e,consequent:M(t)||S(),alternate:p(55)?M(t)||S():null,range:b(n)}}function we(e,t){let n=x(e);return{type:`Binary`,operator:m(),left:e,right:M(t)||s(`Expected expression`),range:b(n)}}}var RE={parse(e,t=!1){let n=[];return{ast:LE(e,{tolerant:t,onComment:n}),commentRanges:n}},createTokenizer:AE,tokenize:OE},zE=s({compile:()=>BE,stringify:()=>HE,walk:()=>VE});function BE(e,t){let n=t.scope.arg1;t.put(typeof n==`string`?n:`undefined`)}function VE(){}function HE(e,t){t.put(`$$`)}var UE=s({compile:()=>GE,stringify:()=>qE,suggest:()=>WE,walk:()=>KE});function WE(e,t){e.elements.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function GE(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}function KE(e,t){t.list(e.elements)}function qE(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}var JE=s({compile:()=>XE,stringify:()=>QE,suggest:()=>YE,walk:()=>ZE});function YE(e,t){Array.isArray(e.assertion)||(t.range(e.assertion.range,`var`),t.range(e.assertion.range,`assertion`))}function XE(e,t){if(Array.isArray(e.assertion)){t.put(e.negation?`!(`:`(`);for(let n=0;n<e.assertion.length;n++)if(n%2==0)t.node(e.assertion[n]);else switch(e.assertion[n]){case`and`:t.put(`&&`);break;case`or`:t.put(`||`);break;default:t.error(`Bad conjuction operator in assertion`,e)}t.put(`)`)}else switch(e.negation&&t.put(`!`),e.assertion.type){case`Identifier`:e.assertion.name?(t.put(`!!`),t.tolerant&&t.put(`(typeof `),t.put(`a[`),t.node(e.assertion),t.put(`]`),t.tolerant&&(t.put(`==="function"?a[`),t.node(e.assertion),t.put(`]`)),t.put(`.call(mctx,`),t.nodeOrCurrent(),t.put(`)`),t.tolerant&&t.put(`:false)`),t.usedAssertions.has(e.assertion.name)?t.usedAssertions.get(e.assertion.name).push(e.assertion.range):t.usedAssertions.set(e.assertion.name,e.assertion.range)):t.put(`false`);break;case`Method`:t.put(`!!`),t.node(e.assertion);break;default:t.error(`Unknown assertion node type "`+e.assertion.type+`"`,e.assertion)}}function ZE(e,t){if(Array.isArray(e.assertion))for(let n=0;n<e.assertion.length;n++)n%2==0&&t.node(e.assertion[n]);else t.node(e.assertion)}function QE(e,t){if(e.negation&&t.put(`not `),Array.isArray(e.assertion)){t.put(`(`);for(let n=0;n<e.assertion.length;n++)n%2==0?t.node(e.assertion[n]):(t.put(` `),t.put(e.assertion[n]),t.put(` `));t.put(`)`)}else t.node(e.assertion)}var $E=s({compile:()=>rD,stringify:()=>aD,suggest:()=>nD,walk:()=>iD}),eD={in:`in`,"not in":`notIn`,has:`has`,"has no":`hasNo`,and:`and`,or:`or`,"??":`nullish`,"+":`add`,"-":`sub`,"*":`mul`,"/":`div`,"%":`mod`,"=":`eq`,"!=":`ne`,"<":`lt`,"<=":`lte`,">":`gt`,">=":`gte`,"~=":`match`};function tD(e,t,n){if(n.type===`Array`){if(n.elements.length===0){e.range([n.range[0]+1,n.range[1]-1],`value-subset`,t,!1);return}let r=[];for(let{type:e,range:t,value:i}of n.elements)t&&(e===`Literal`||e===`Identifier`)&&r.push(i);let i=r.length?e.literalList(r):!1;for(let{type:r,range:a,value:o}of n.elements)a&&(r===`Literal`||r===`Identifier`||r===`GetProperty`&&o===null)&&e.range(a,`value-subset`,t,i)}}function nD(e,t){switch(e.operator){case`in`:t.range(e.left.range,`in-value`,e.right,null),tD(t,e.left,e.right);break;case`not in`:tD(t,e.left,e.right);break;case`has`:t.range(e.right.range,`in-value`,e.left,null),tD(t,e.right,e.left);break;case`has no`:tD(t,e.right,e.left);break;case`=`:case`!=`:t.range(e.right.range,`value`,e.left,null)}}function rD(e,t){if(!(e.operator in eD)){t.error(`Unknown operator "`+e.operator+`"`,e);return}switch(e.operator){case`and`:t.put(`!`);case`or`:{let n=t.allocateVar();t.put(`${t.buildinFn(`bool`)}(${n}=`),t.node(e.left),t.put(`)?${n}:`),t.createScope(()=>t.node(e.right),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref);break}case`??`:{let n=t.allocateVar();t.put(`(${n}=`),t.node(e.left),t.put(`,${n}!==null&&${n}!==undefined)?${n}:`),t.createScope(()=>t.node(e.right),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref);break}case`has no`:t.put(`!`);case`has`:t.put(t.buildinFn(`in`)),t.put(`(`),t.node(e.right),t.put(`,`),t.node(e.left),t.put(`)`);break;default:t.put(t.buildinFn(eD[e.operator])),t.put(`(`),t.node(e.left),t.put(`,`),t.node(e.right),t.put(`)`)}}function iD(e,t){t.node(e.left),t.node(e.right)}function aD(e,t){t.node(e.left),/^[a-z]/i.test(e.operator)?(t.put(` `),t.put(e.operator),t.put(` `)):t.put(e.operator),t.node(e.right)}var oD=s({compile:()=>cD,stringify:()=>uD,suggest:()=>sD,walk:()=>lD});function sD(e,t){e.body===null&&t.queryRoot(e.range[1])}function cD(e,t){e.definitions.length?(t.put(`(()=>{`),t.createScope(()=>{for(let{declarator:n}of e.definitions)n.name&&t.scope.awaitInit.add(t.unescapeName(`$`+n.name,n));t.list(e.definitions),t.put(`return `),t.nodeOrCurrent(e.body)},e=>e+`;`,t.scope.$ref),t.put(`})()`)):e.body&&e.body.type===`Object`?(t.put(`(`),t.nodeOrCurrent(e.body),t.put(`)`)):t.nodeOrCurrent(e.body)}function lD(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}function uD(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}var dD=s({compile:()=>pD,stringify:()=>hD,walk:()=>mD}),fD={"":`cmp`,N:`cmpNatural`,A:`cmpAnalytical`,NA:`cmpNaturalAnalytical`,AN:`cmpNaturalAnalytical`};function pD(e,t){let n=e.order.startsWith(`desc`),r=fD[e.order.slice(n?4:3)]||fD[``];n&&t.put(`-`),t.put(t.buildinFn(r)),t.put(`((_q=$=>(`),t.createScope(()=>t.node(e.query),e=>e+`,`),t.put(`))(_a),_q(_b))`)}function mD(e,t){t.node(e.query)}function hD(e,t){t.node(e.query),t.put(` `),t.put(e.order)}var gD=s({compile:()=>_D,stringify:()=>yD,walk:()=>vD});function _D(e,t){t.put(`(_a, _b)=>{let _q;return `),t.list(e.compares,`||`),t.put(`||0}`)}function vD(e,t){t.list(e.compares)}function yD(e,t){t.list(e.compares,`,`)}var bD=s({compile:()=>xD,stringify:()=>CD,walk:()=>SD});function xD(e,t){t.put(t.buildinFn(`bool`)),t.put(`(`),t.nodeOrCurrent(e.test),t.put(`)?`),t.createScope(()=>t.nodeOrCurrent(e.consequent),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref),t.put(`:`),t.createScope(()=>{e.alternate?e.alternate.type===`Placeholder`?(t.put(`(`),t.node(e.alternate),t.put(`,undefined)`)):t.node(e.alternate):t.put(`undefined`)},e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref)}function SD(e,t){t.nodeOrNothing(e.test),t.nodeOrNothing(e.consequent),t.nodeOrNothing(e.alternate)}function CD(e,t){t.nodeOrNothing(e.test),t.put(`?`),t.nodeOrNothing(e.consequent),e.alternate&&(t.put(`:`),t.node(e.alternate))}var wD=s({compile:()=>TD,stringify:()=>DD,walk:()=>ED});function TD(e,t){t.put(`context`)}function ED(){}function DD(e,t){t.put(`#`)}var OD=s({compile:()=>AD,stringify:()=>MD,suggest:()=>kD,walk:()=>jD});function kD(e,t){e.range&&t.range(e.range,`var`)}function AD(e,t){t.put(t.scope.$ref)}function jD(){}function MD(e,t){t.put(`$`)}var ND=s({compile:()=>PD,stringify:()=>ID,walk:()=>FD});function PD(e,t){t.put(`data`)}function FD(){}function ID(e,t){t.put(`@`)}var LD=s({compile:()=>RD,stringify:()=>BD,walk:()=>zD});function RD(e,t){e.name&&t.putIdent(`$`+t.unescapeName(e.name,e),e)}function zD(){}function BD(e,t){t.put(e.name?`$`+e.name:`$`)}var VD=s({compile:()=>KD,stringify:()=>JD,suggest:()=>GD,walk:()=>qD}),HD=[`$data`,`$context`,`$ctx`,`$array`,`$idx`,`$index`],UD=function(e,t,n){return{type:`GetProperty`,value:e,property:t,range:n}},WD=function(e,t){return{type:`Identifier`,name:e,range:t}};function GD(e,t){e.value===null&&t.range(e.declarator.range,`path`)}function KD(e,t){let n=e.declarator.name,r=n&&t.unescapeName(`$`+n,e);if(r===null){t.node(e.declarator),t.nodeOrCurrent(e.value),t.put(`;`);return}if(t.scope.own.has(r)){t.error(`Identifier "${r}" has already been declared`,e.declarator);return}if(HD.includes(r)){t.error(`Identifier "${r}" is reserved for future use`,e.declarator);return}t.put(`const `),t.node(e.declarator),t.put(`=`),t.node(e.value||UD(null,WD(n))),t.put(`;`),t.scope.add(r),t.scope.own.add(r),t.scope.awaitInit.delete(r)}function qD(e,t){t.node(e.declarator),t.nodeOrNothing(e.value)}function JD(e,t){t.node(e.declarator),e.value!==null&&(t.put(`:`),t.node(e.value)),t.put(`;`)}var YD=s({compile:()=>XD,stringify:()=>QD,walk:()=>ZD});function XD(e,t){t.put(t.buildinFn(`filter`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function ZD(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function QD(e,t){t.nodeOrNothing(e.value),t.put(`.[`),t.node(e.query),t.put(`]`)}var $D=s({compile:()=>eO,stringify:()=>nO,walk:()=>tO});function eO(e,t){let n=e.arguments.map(e=>t.unescapeName(`$`+e.name,e)),r=e.arguments.find((e,t)=>t>0&&n.lastIndexOf(`$`+e.name,t-1)!==-1);r&&t.error(`Duplicate parameter name "$`+r.name+`" is not allowed`,r),t.put(`function(`),t.put(String(n)||`$`),t.put(`){return `),t.createScope(()=>{t.scope.arg1=n[1]||`arguments[1]`,t.scope.$ref=n[0]||`$`;for(let e of n)t.scope.add(e);t.node(e.body)},e=>e+`,`),t.put(`}`)}function tO(e,t){t.node(e.body)}function nO(e,t){t.put(`=>`),t.node(e.body)}var rO=s({compile:()=>aO,stringify:()=>sO,suggest:()=>iO,walk:()=>oO});function iO(e,t){t.range(e.property.range,`path`,e.value||void 0,!e.value),e.value===null&&t.range(e.property.range,`var`),e.range&&e.value===null&&e.property.range[0]!==e.range[0]&&t.queryRoot(e.range[0])}function aO(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,`),t.node(e.property),t.put(`)`)}function oO(e,t){t.nodeOrNothing(e.value),t.node(e.property)}function sO(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.property)}var cO=s({compile:()=>lO,stringify:()=>dO,walk:()=>uO});function lO(e,t){t.put(JSON.stringify(t.unescapeName(e.name,e,!1)))}function uO(){}function dO(e,t){t.put(e.name)}var fO=s({compile:()=>pO,stringify:()=>hO,walk:()=>mO});function pO(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}function mO(){}function hO(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}var gO=s({compile:()=>_O,stringify:()=>yO,walk:()=>vO});function _O(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function vO(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function yO(e,t){t.nodeOrNothing(e.value),t.put(`.(`),t.node(e.query),t.put(`)`)}var bO=s({compile:()=>xO,stringify:()=>CO,walk:()=>SO});function xO(e,t){t.put(t.buildinFn(`mapRecursive`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function SO(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function CO(e,t){t.nodeOrNothing(e.value),t.put(`..`),t.isSimpleGetPropertyQuery(e.query)||t.isSimpleMethodCallQuery(e.query)?t.node(e.query):(t.put(`(`),t.node(e.query),t.put(`)`))}var wO=s({compile:()=>EO,stringify:()=>OO,suggest:()=>TO,walk:()=>DO});function TO(e,t){e.arguments.length===0&&t.queryRoot(e.range[1]-1)}function EO(e,t,n){let r=e.reference.type===`Identifier`;t.tolerant&&t.put(`(typeof `),r?(t.usedMethods.has(e.reference.name)?t.usedMethods.get(e.reference.name).push(e.reference.range):t.usedMethods.set(e.reference.name,[e.reference.range]),t.put(`m[`),t.node(e.reference),t.put(`]`)):t.node(e.reference),t.tolerant&&(t.put(`==="function"?`),r?(t.put(`m[`),t.node(e.reference),t.put(`]`)):t.node(e.reference)),t.put(r?`.call(mctx,`:`(`),t.nodeOrCurrent(n),e.arguments.length&&(t.put(`,`),t.list(e.arguments,`,`)),t.put(`)`),t.tolerant&&t.put(`:undefined)`)}function DO(e,t){t.node(e.reference),t.list(e.arguments)}function OO(e,t){t.node(e.reference),t.put(`(`),t.list(e.arguments,`,`),t.put(`)`)}var kO=s({compile:()=>AO,stringify:()=>MO,walk:()=>jO});function AO(e,t){t.node(e.method,e.value)}function jO(e,t){t.nodeOrNothing(e.value),t.node(e.method)}function MO(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.method)}var NO=s({compile:()=>FO,stringify:()=>LO,suggest:()=>PO,walk:()=>IO});function PO(e,t){e.properties.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function FO(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}function IO(e,t){t.list(e.properties)}function LO(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}var RO=s({compile:()=>UO,stringify:()=>GO,suggest:()=>HO,walk:()=>WO}),zO=function(e,t,n){return{type:`GetProperty`,value:e,property:t,range:n}},BO=function(e,t){return{type:`Identifier`,name:e,range:t}},VO=new Set([`Literal`,`Identifier`,`Reference`,`Current`]);function HO(e,t){if(e.value===null)switch(e.key.type){case`Literal`:case`Identifier`:t.range(e.range,`path`),t.range(e.range,`var`);break;case`Current`:case`Reference`:t.range(e.range,`var`)}}function UO(e,t){let n=e.value;switch(e.key.type){case`Current`:t.put(`...null`);return;case`Literal`:t.node(e.key),n||=zO(null,BO(String(e.key.value)));break;case`Identifier`:t.node(e.key),n||=zO(null,e.key);break;case`Reference`:t.node(e.key.name),n||=e.key;break;default:t.put(`[`),t.node(e.key),t.put(`]`)}t.put(`:`),t.node(n)}function WO(e,t){t.node(e.key),t.nodeOrNothing(e.value)}function GO(e,t){if(VO.has(e.key.type)){if(t.node(e.key),e.value===null)return}else t.put(`[`),t.node(e.key),t.put(`]`);t.put(`:`),t.node(e.value)}var KO=s({compile:()=>qO,stringify:()=>YO,walk:()=>JO});function qO(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}function JO(e,t){t.node(e.body)}function YO(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}var XO=s({compile:()=>QO,stringify:()=>ek,suggest:()=>ZO,walk:()=>$O});function ZO(e,t){if(e.getter===null){let n=e.range[1]-1;t.range([n,n],`key`,e.value,!1),t.queryRoot(n)}else(e.getter.type===`GetProperty`||e.getter.type===`Reference`||e.getter.type===`Literal`&&typeof e.getter.value==`string`)&&t.range(e.getter.range,`key`,e.value,!1)}function QO(e,t){t.put(t.buildinFn(`pick`)),t.put(`(`),t.node(e.value),e.getter&&(t.put(`,`),t.node(e.getter)),t.put(`)`)}function $O(e,t){t.node(e.value),e.getter!==null&&t.node(e.getter)}function ek(e,t){t.node(e.value),t.put(`[`),e.getter!==null&&t.node(e.getter),t.put(`]`)}var tk=s({compile:()=>nk,stringify:()=>ik,walk:()=>rk});function nk(e,t){t.put(`($=>(`),t.createScope(()=>t.node(e.right),e=>e+`,`),t.put(`))`),t.put(`(`),t.nodeOrCurrent(e.left),t.put(`)`)}function rk(e,t){t.node(e.left),t.node(e.right)}function ik(e,t){t.node(e.left),t.put(`|`),t.node(e.right)}var ak=s({compile:()=>sk,stringify:()=>lk,suggest:()=>ok,walk:()=>ck});function ok(e,t){t.queryRoot(e.range[1])}function sk(e,t){t.put(t.scope.$ref)}function ck(){}function lk(){}var uk=s({compile:()=>dk,stringify:()=>pk,walk:()=>fk});function dk(e,t){if(e.operator&&e.operator.type){t.put(`($=>(`),t.createScope(()=>t.node(e.operator),e=>e+`,`),t.put(`))`),t.put(`(`),t.node(e.argument),t.put(`)`);return}t.error(`Unknown operator "`+e.operator+`"`,e)}function fk(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function pk(e,t){t.node(e.argument),t.put(` `),t.node(e.operator)}var mk=s({compile:()=>hk,stringify:()=>_k,walk:()=>gk});function hk(e,t){switch(e.operator){case`no`:case`not`:t.put(`!`),t.put(t.buildinFn(`bool`)),t.put(`(`),t.node(e.argument),t.put(`)`);break;case`+`:case`-`:t.put(e.operator),t.node(e.argument);break;case`is`:t.put(`!!(`),t.node(e.argument),t.put(`)`);break;default:t.error(`Unknown operator "`+e.operator+`"`,e)}}function gk(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function _k(e,t){t.put(e.operator),e.operator!==`-`&&e.operator!==`+`&&t.put(` `),t.node(e.argument)}var vk=s({compile:()=>bk,stringify:()=>Sk,suggest:()=>yk,walk:()=>xk});function yk(e,t){e.range&&t.range(e.range,`var`)}function bk(e,t){let n=e.name,r=t.unescapeName(`$`+n.name,n),i=t.scope.has(r),a=t.scope.awaitInit.has(r);if(!i||a){a?(t.put(`f.awaitInitRef(()=>`),t.putIdent(r,n),t.tolerant||(t.put(`,`),t.put(JSON.stringify(r)),t.put(`,`),t.put(JSON.stringify(n.range))),t.put(`)`)):t.tolerant?t.put(`undefined`):(t.putIdent(r,e),t.error(`${r} is not defined`,e));return}t.putIdent(r,n)}function xk(e,t){t.node(e.name)}function Sk(e,t){t.put(`$`),t.node(e.name)}var Ck=s({compile:()=>wk,stringify:()=>Ek,walk:()=>Tk});function wk(e,t){t.put(t.buildinFn(`slice`)),t.put(`(`),t.nodeOrCurrent(e.value),e.arguments.slice(0,3).forEach(e=>{t.put(`,`),e?t.node(e):t.put(`undefined`)}),t.put(`)`)}function Tk(e,t){t.nodeOrNothing(e.value);for(let n of e.arguments.slice(0,3))n&&t.node(n)}function Ek(e,t){let[n,r,i]=e.arguments;t.nodeOrNothing(e.value),t.put(`[`),n&&t.node(n),t.put(`:`),r&&t.node(r),i&&(t.put(`:`),t.node(i)),t.put(`]`)}var Dk=s({compile:()=>kk,stringify:()=>jk,suggest:()=>Ok,walk:()=>Ak});function Ok(e,t){e.query===null&&t.queryRoot(e.range[1])}function kk(e,t){if(e.array){t.put(`...`),t.put(t.buildinFn(`ensureArray`)),t.put(`(`),t.nodeOrCurrent(e.query),t.put(`)`);return}t.put(`...`),t.nodeOrCurrent(e.query)}function Ak(e,t){t.nodeOrNothing(e.query)}function jk(e,t){t.put(`...`),t.nodeOrNothing(e.query)}var Mk=s({compile:()=>Pk,stringify:()=>Ik,suggest:()=>Nk,walk:()=>Fk});function Nk(e,t){for(let[n,r]of Object.entries(e.values))r===null&&t.queryRoot(e.values[Number(n)-1].range[1])}function Pk(e,t){for(let[n,r]of Object.entries(e.values)){let e=Number(n);r!==null&&(e!==0&&t.put(`+`),e%2==0?t.put(`"`+zk(r.value,Lk)+`"`):(t.put(`(`),t.node(r),t.put(`)`)))}}function Fk(e,t){for(let n of e.values)n!==null&&t.node(n)}function Ik(e,t){let n=e.values.length-1;for(let[r,i]of Object.entries(e.values)){let e=Number(r);e%2==0?(t.put(e===0?"`":`}`),t.put(zk(i.value,Rk)),t.put(e===n?"`":"${")):i!==null&&t.node(i)}}var Lk=new Map([[`\b`,`\\b`],[`
|
|
9
|
+
`,`\\n`],[`\r`,`\\r`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\u2028`,`\\u2028`],[`\u2029`,`\\u2029`],[`\\`,`\\\\`],[`"`,`\\"`]]),Rk=new Map([[`\b`,`\\b`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\\`,`\\\\`],[`$`,`\\$`]]);function zk(e,t){let n=``;for(let r=0;r<e.length;r++)n+=t.get(e[r])||e[r];return n}var Bk={Arg1:zE,Array:UE,Assertion:JE,Binary:$E,Block:oD,Compare:dD,Conditional:bD,Context:wD,Current:OD,Data:ND,Declarator:LD,Definition:VD,Filter:YD,Function:$D,GetProperty:rO,Identifier:cO,Literal:fO,Map:gO,MapRecursive:bO,Method:wO,MethodCall:kO,Object:NO,ObjectEntry:RO,Parentheses:KO,Pick:XO,Pipeline:tk,Placeholder:ak,Postfix:uk,Prefix:mk,Reference:vk,SliceNotation:Ck,CompareFunction:gD,Spread:Dk,Template:Mk},Vk=e=>new Map(Object.entries(Bk).map(([t,n])=>[t,n[e]]).filter(([,e])=>typeof e==`function`)),Hk={};Vk(`build`).forEach((e,t)=>Hk[t]=e);var Uk=Vk(`compile`),Wk=Vk(`walk`),Gk=Vk(`stringify`),Kk=Vk(`suggest`);function qk(e,t){function n(e){if(Wk.has(e.type))i(e),Wk.get(e.type)(e,r),a(e);else throw Error(`Unknown node type "`+e.type+`"`)}let r={node:n,nodeOrNothing(e){e!==null&&n(e)},list(e){e.forEach(n)}},i=()=>{},a=()=>{};typeof t==`function`&&(t={enter:t}),t&&(typeof t.enter==`function`&&(i=t.enter),typeof t.leave==`function`&&(a=t.leave)),n(e)}function Jk(e,t){return t>=0&&t<e.length&&/[a-zA-Z_$0-9]/.test(e[t])}function Yk(e,t){let n=e.charCodeAt(t);return n===9||n===10||n===13||n===32}function Xk(e,t,n){for(;t<n;t++)if(!Yk(e,t))return!1;return!0}function Zk(e,t,n,r,i){let a=[];for(let n=0;n<r.length;n++){let[i,o]=r[n];if(i>=t)break;i<e||(a.push(e,i),e=o)}return(e!==n.length||!i)&&a.push(e,t),a}function Qk(e,t,n,r){let i=[];for(let a=0;a<e.length;a++){let[o,s,c,l]=e[a];if(Xk(t,o,s)){for(;o>=0&&Yk(t,o-1);)o--;for(;s<t.length&&Yk(t,s);)s++;if(Jk(t,o-1)){if(o===s)continue;o++}if(Jk(t,s)){if(o===s)continue;s--}}let u=Zk(o,s,t,n,r);for(let e=0;e<u.length;e+=2)i.push([u[e],u[e+1],c,l])}return i}function $k(e){let t=null,n=[],r=Object.assign(new Map,{literalList:n}),i=(e,t)=>{r.has(e)?r.get(e).push(t):r.set(e,[t])},a={range(e,n,r=t,a=!0){i(r,[...e,n,a])},literalList(e){let t=`l`+n.length;return n.push([t,e]),t},queryRoot(e,n=e){i(t,[e,n,`var`,!0]),i(t,[e,n,`path`,!0])}};return qk(e,e=>{if(Kk.has(e.type)){let n=t;t=e,Kk.get(e.type)(e,a),t=n}}),r}function eA(e,{ast:t,commentRanges:n}){let r=$k(t),i=n.length&&n[n.length-1][1]===e.length&&!/[\r\n]$/.test(e);for(let[t,a]of r)r.set(t,Qk(a,e,n,i));return r}function tA(e){return e.type===`GetProperty`}function nA(e){return e.type===`MethodCall`}function rA(e){function t(e){if(Gk.has(e.type))Gk.get(e.type)(e,r);else throw Error(`Unknown node type "`+e.type+`"`)}let n=[],r={isSimpleGetPropertyQuery:tA,isSimpleMethodCallQuery:nA,put(e){n.push(e)},node:t,nodeOrNothing(e){if(e!==null)return t(e),!0},list(e,n){if(!n){e.forEach(t);return}e.forEach((e,i)=>{i>0&&r.put(n),t(e)})}};return t(e),n.join(``)}function iA(e,t,n){let r=Object.assign(Object.create(SyntaxError.prototype),n),i=Error();return r.name=e,r.message=t,Object.defineProperty(r,"stack",{get:function(){return(i.stack||``).replace(/^(.+\n){1,3}/,e+`: `+t+`
|
|
10
|
+
`)}}),r}var aA=/^[\p{ID_Start}$_]$/u,oA=/^[\p{ID_Continue}$]$/u;function sA(e,t,n){return uA(e,`query`,t,n)}function cA(e,t,n){return uA(e,`method`,t,n)}var lA=class e extends Set{constructor(e,t=[],n=!1,r=`$`){super(e),this.own=new Set,this.awaitInit=new Set(t),this.firstCurrent=null,this.captureCurrent=[],this.arg1=n,this.$ref=r}spawn(t,n){return new e(this,this.awaitInit,t,n)}};function uA(e,t,n=!1,r=null){function i(e){let t=`s`+l.length;return l.push(e?[t,e]:[t]),t}function a(e){let t=u.get(e);return t||u.set(e,t=i()),t}function o(e,t,n,r,o){let s=[e,t,JSON.stringify(n)];if(n===`var`){if(!g.scope.size)return;s.push(JSON.stringify([...g.scope]))}else r||=i(),s.push(r),o&&s.push(typeof o==`string`?o:a(o));return f.push(s),r}function s(e,n,r=`$`){let i=g.scope,a=p.length-1,s=i.arg1||t===`method`&&`arguments[1]`;if(g.scope=i.spawn(s,r),e(),g.scope.captureCurrent.length){let e=`stat(`+g.scope.captureCurrent.reduce((e,t)=>o(...t,e),void 0)+`,`+g.scope.$ref+`)`;g.scope.firstCurrent?p[g.scope.firstCurrent]=e:p[a]+=n(e)}g.scope=i}function c(e,t){let n=!1;if(r!==null){if(r.has(e))for(let[t,i,s,c]of r.get(e))s===`var`?o(t,i,s):c===!0?g.scope.captureCurrent.push([t,i,s]):(n||(n=a(e),p.push(`stat(`+n+`,`)),s&&o(t,i,s,n,c));e.type===`Current`&&g.scope.firstCurrent===null&&(g.scope.firstCurrent=p.length)}if(Uk.has(e.type))Uk.get(e.type)(e,g,t);else throw Error(`Unknown node type "`+e.type+`"`);n&&p.push(`)`)}let l=[],u=new WeakMap,d=[],f=[],p=[{toString(){if(t===`query`)return[`((data,context)=>{`,...g.usedMethods.size||g.usedAssertions.size?[`const method = (name,...args)=>m[name].apply(mctx,args);`,`const assertion = (name,...args)=>a[name].apply(mctx,args);`,`const mctx = Object.freeze({context,method,assertion});`]:[]].join(`
|
|
11
|
+
`)+`
|
|
12
|
+
`;if(t===`method`)return[`(function(data){`,`const mctx = this;`,`const context = mctx.context;`].join(`
|
|
13
|
+
`)+`
|
|
14
|
+
`;throw Error(`Unknown kind: `+t)}},{toString(){return d.length>0?`let `+d+`;
|
|
15
|
+
`:``}},{toString(){return l.length>0?[`const stat=(s,v)=>(s.add(v),v);
|
|
16
|
+
`,`const `+l.map(([e,t])=>e+`=new Set(`+(t?JSON.stringify(t):``)+`)`)+`;
|
|
17
|
+
`].join(``):``}},{toString(){let e=r&&Array.isArray(r.literalList)&&r.literalList.map(([e,t])=>e+`=`+JSON.stringify(t));return e&&e.length?`const `+e+`;
|
|
18
|
+
`:``}},r===null?`return `:`return{
|
|
19
|
+
value: `],m={},h=new Set,g={tolerant:n,usedAssertions:new Map,usedMethods:new Map,suggestions:r!==null,buildinFn(e){return h.add(e),`f.`+e},scope:new lA,createScope:s,error(e,t){let r=SyntaxError(e);if(t&&t.range&&(r.details={loc:{range:t.range}}),!n)throw r;return r},allocateVar(){let e=`tmp`+d.length;return d.push(e),e},unescapeName(e,t,n=!0){return e.replace(/\\u[0-9a-fA-F]{4}/g,(e,r)=>{let i=String.fromCharCode(parseInt(e.slice(2),16)),a=r===0?aA:oA;return n&&!a.test(i)&&this.error(`Bad escape sequence in indentifier name (expected ${a})`,t&&{range:[t.range[0]+r,t.range[0]+r+6]}),i})},put:e=>p.push(e),putIdent(e,t){if(!/^[\p{ID_Start}$_][\p{ID_Continue}$]*$/u.test(e))throw this.error(`Bad identifier name `+JSON.stringify(e),t);this.put(e)},node:c,nodeOrCurrent(e,t){c(e||{type:`Current`},t)},list(e,t,n){e.forEach((e,r)=>{r>0&&p.push(t),c(e,n)})}};if(s(()=>c(e),e=>(p.push(`)`),`(`+e+`,`),`data`),!n){let{usedMethods:e,usedAssertions:t}=g;t.size&&(p.unshift(` this.assertAssertions(a)||`),m.assertAssertions=function(e){for(let[n,r]of t.entries())if(!NT(e,n))return()=>{throw Object.assign(Error(`Assertion "${n}" is not defined`),{details:{loc:{range:r}}})}}),e.size&&(p.unshift(` this.assertMethods(m)||`),m.assertMethods=function(t){for(let[n,r]of e.entries())if(!NT(t,n))return()=>{throw Object.assign(Error(`Method "${n}" is not defined. If that's a custom method make sure you added it with "methods" section in options`),{details:{loc:{range:r[0]}}})}})}return r!==null&&p.push(`,
|
|
20
|
+
stats: [`+f.map(e=>`[`+e+`]`)+`],
|
|
21
|
+
methods: m,
|
|
22
|
+
assertions: a
|
|
23
|
+
}`),dA(m,`return`+p.join(``)+`})`)}function dA(e,t){try{let n=Function(`f,m,a`,t);return Object.assign(n.bind(e),{toString(){return n.toString().replace(/^(\S+\s+)anonymous([^)\s]+)\s*\)/,`$1query$2)`)}})}catch(e){throw iA(`SyntaxError`,`Jora query compilation error`,{compiledSource:`function(f,m,a){\n${t}\n}`,details:e})}}var fA=0,pA=1,mA=2,hA=4,gA=8,_A=3,vA=12,yA=e=>typeof e==`number`||typeof e==`string`,bA=(e,t)=>t<e.length?e.charCodeAt(t):0,xA=e=>e===43||e===45,SA=e=>e>=48&&e<=57,CA=e=>e===9||e===10||e===12||e===13||e===32,wA=e=>e>32&&e<256&&(e<65||e>90)&&(e<97||e>122)&&!SA(e)&&!xA(e)||e===8470,TA=e=>e&&!CA(e)&&!wA(e)&&!SA(e),EA=(e,t,n)=>xA(e)?SA(t)?2:t===46&&SA(n)?3:0:+!!SA(e),DA=(e,t,n)=>{for(;n(bA(e,++t)););return t},OA=(e,t,n)=>{let r=bA(e,t);if(xA(r)&&(r=bA(e,t+=1)),SA(r)&&(t=DA(e,t,SA),r=bA(e,t)),r===46&&SA(bA(e,t+1))){if(n)return t;let i=DA(e,t+1,SA);if(r=bA(e,i),r===46)return t;t=i}if(r===69||r===101){let n=1;r=bA(e,t+1),xA(r)&&(n=2,r=bA(e,t+2)),SA(r)&&(t=DA(e,t+n,SA))}return t},kA=(e,t,n,r)=>{if(t>=e.length)return fA;let i=bA(e,t);return CA(i)?pA|DA(e,t,CA)-t<<4:wA(i)||r&&xA(i)?mA|DA(e,t,wA)-t<<4:EA(i,bA(e,t+1),bA(e,t+2))?hA|OA(e,t,n)-t<<4:gA|DA(e,t,TA)-t<<4},AA=(e,t,n)=>{let r=0,i=0,a=!1,o=!1,s=0,c=0,l=!0;for(;;){let u=kA(e,r,a,o),d=kA(t,i,a,o),f=u&15,p=u>>4,m=d&15,h=d>>4;if(f!==m){if(l&&f&_A&&m&vA){s=1,c=f,r+=p;continue}if(l&&m&_A&&f&vA){s=-1,c=m,i+=h;continue}return f-m}if(f===fA)return s;l=!1,a=!1,o=!1;let g=p<h?p:h,_=p-h,v=``,y=``;for(let n=0;n<g;n++)if(v=e[r+n],y=t[i+n],v!==y){_=v<y?-1:1;break}if(f&_A)a=e[r+p-1]===`.`,_!==0&&f>c&&(c=f,s=_);else if(f&hA){if(o=!0,_!==0){let a=e.substr(r,p)-t.substr(i,h);if(a!==0)return n?-a:a;if(f>c){let a=bA(e,r),o=bA(t,i),l=a===45?-1:1;c=f,s=a!==o&&(a===45||o===43)?-1:a!==o&&(a===43||o===45)?1:(p-h||_)<0?-l:l,n&&(s=-s)}}}else if(_!==0){if(v!==y){let n=e.substr(r,p),a=t.substr(i,h),o=n.toLowerCase(),s=a.toLowerCase();return o===s?n<a?-1:1:o<s?-1:1}return _}r+=p,i+=h}},jA=e=>(t,n)=>yA(t)&&yA(n)?Math.sign(AA(String(t),String(n),e)):0,MA=jA(!1),NA=jA(!0),PA=1,FA=2,IA=3,LA=4,RA=5,zA=6,BA=7,VA=8;function HA(e){switch(typeof e){case`boolean`:return PA;case`number`:return e===e?IA:FA;case`string`:return LA;case`object`:return e===null?RA:zA;case`undefined`:return VA;default:return BA}}function UA(e,t){let n=HA(e),r=HA(t);return n===r?e<t?-1:+(e>t):n<r?-1:1}function WA(e,t){let n=HA(e),r=HA(t);return n===r?n===IA?t-e:e<t?-1:+(e>t):n<r?-1:1}function GA(e,t){let n=HA(e),r=HA(t);return(n===IA||n===LA)&&(r===IA||r===LA)?MA(e,t):n===r?e<t?-1:+(e>t):n<r?-1:1}function KA(e,t){let n=HA(e),r=HA(t);return(n===IA||n===LA)&&(r===IA||r===LA)?NA(e,t,!0):n===r?e<t?-1:+(e>t):n<r?-1:1}function qA(e,t){return e.length===1?(n,r)=>t(e(n),e(r)):e}var JA=Object.freeze({awaitInitRef:YA,ensureArray:XA,bool:UT,and:(e,t)=>UT(e)?t:e,or:(e,t)=>UT(e)?e:t,add:ZA,sub:QA,mul:$A,div:ej,mod:tj,eq:nj,ne:rj,lt:ij,lte:aj,gt:oj,gte:sj,in:cj,notIn:(e,t)=>!cj(e,t),has:(e,t)=>cj(t,e),hasNo:(e,t)=>!cj(t,e),cmp:UA,cmpAnalytical:WA,cmpNatural:GA,cmpNaturalAnalytical:KA,match:lj,pick:uj,indexOf:dj,lastIndexOf:pj,map:hj,mapRecursive:gj,some:_j,filter:vj,slice:yj});function YA(e,t,n){try{return e()}catch{if(t)throw Object.assign(ReferenceError(`Cannot access ${t} before initialization`),{details:{name:t,loc:{range:n}}})}}function XA(e){return VT(e)?e:[e]}function ZA(e,t){return VT(e)||VT(t)?[...new Set([...VT(e)?e:[e],...VT(t)?t:[t]])]:e+t}function QA(e,t){if(VT(e)){let n=new Set(e);return VT(t)?t.forEach(e=>n.delete(e)):n.delete(t),[...n]}return e-t}function $A(e,t){return e*t}function ej(e,t){return e/t}function tj(e,t){return e%t}function nj(e,t){return Object.is(e,t)}function rj(e,t){return!Object.is(e,t)}function ij(e,t){return e<t}function aj(e,t){return e<=t}function oj(e,t){return e>t}function sj(e,t){return e>=t}function cj(e,t){return RT(t)?NT(t,e):t?fj(t,e)!==-1:!1}function lj(e,t){return typeof t==`function`?_j(e,t):zT(t)?_j(e,t.test.bind(t)):t==null}function uj(e,t=()=>!0){if(e){if(typeof t==`function`){if(VT(e)||typeof e==`string`){for(let n=0;n<e.length;n++)if(UT(t(e[n],n)))return e[n]}for(let n in e)if(NT(e,n)&&UT(t(e[n],n)))return e[n];return}return VT(e)||typeof e==`string`?isFinite(t)?e[t<0?e.length+Number(t):Number(t)||0]:void 0:NT(e,t)?e[t]:void 0}}function dj(e,t,n){return e?fj(e,t,n):-1}function fj(e,t,n=0){if(Number.isNaN(t)&&BT(e)){for(let t=HT(n,0);t<e.length;t++)if(Number.isNaN(e[t]))return t}return typeof e.indexOf==`function`?e.indexOf(t,n):-1}function pj(e,t,n){return e?mj(e,t,n):-1}function mj(e,t,n){if(Number.isNaN(t)&&BT(e)){for(let t=HT(n,e.length-1);t>=0;t--)if(Number.isNaN(e[t]))return t}return typeof e.lastIndexOf==`function`?e.lastIndexOf(t,HT(n,e.length-1)):-1}function hj(e,t){let n=typeof t==`function`?t:e=>LT(e,t);return VT(e)?[...e.reduce((e,t)=>FT(e,n(t)),new Set)]:e===void 0?e:n(e)}function gj(e,t){let n=new Set;return FT(n,hj(e,t)),n.forEach(e=>FT(n,hj(e,t))),[...n]}function _j(e,t){return VT(e)?e.some(e=>UT(t(e))):UT(t(e))}function vj(e,t){return VT(e)?e.filter(e=>UT(t(e))):UT(t(e))?e:void 0}function yj(e,t,n,r=1){if(!BT(e))return[];if(t=HT(t,0),n=HT(n,e.length),r=HT(r,1)||1,t=t<0?Math.max(0,e.length+t):Math.min(e.length,t),n=n<0?Math.max(0,e.length+n):Math.min(e.length,n),t>=0&&n>=0&&t<=n&&r===1)return typeof e==`string`?e.slice(t,n):Array.prototype.slice.call(e,t,n);t>n&&([t,n]=[n,t],r=-r);let i=[];if(r>0)for(let a=t;a<n;a+=r)i.push(e[a]);else for(let a=n-1;a>=t;a+=r)i.push(e[a]);return typeof e==`string`?i.join(``):i}var bj=xj(20)?1/0:xj(10)?10:0;function xj(e){return Array.from({length:e},(e,t)=>({idx:t})).sort((e,t)=>e.idx%2-t.idx%2).every((t,n)=>n<e/2?t.idx>>1===n:Math.ceil(e/2)+(t.idx>>1)===n)}function Sj(e,t){return e.length<=bj?e.slice().sort(t):e.map((e,t)=>({value:e,idx:t})).sort((e,n)=>(e.value===void 0?n.value!==void 0:n.value===void 0?-1:t(e.value,n.value))||e.idx-n.idx).map(e=>e.value)}var Cj=(e,t)=>e-t,wj=(e,t)=>t-e,Tj=class{constructor(e,t,n,r=!1){this.maxSize=e||1/0,this.compare=t||wj,this.accept=n||null,this.values=[],this.valuesSet=r?new Set:null}add(e){this.accept!==null&&!this.accept(e)||this.valuesSet!==null&&this.valuesSet.has(e)||(this.values.length<this.maxSize?(this.valuesSet!==null&&this.valuesSet.add(e),this.values.push(e),this.heapifyUp(this.values.length-1)):this.compare(this.values[0],e)>0&&(this.valuesSet!==null&&(this.valuesSet.delete(this.values[0]),this.valuesSet.add(e)),this.values[0]=e,this.heapifyDown()))}addArray(e){for(let t=0;t<e.length;t++)this.add(e[t])}extract(){let e=this.values[0],t=this.values.pop();return this.values.length>0&&(this.values[0]=t,this.heapifyDown()),this.valuesSet!==null&&this.valuesSet.delete(e),e}heapifyUp(e){let t=this.values,n=t[e];for(;e>0;){let r=e-1>>1,i=t[r];if(this.compare(i,n)>0)break;t[r]=n,t[e]=i,e=r}}heapifyDown(){let e=this.values,t=e.length,n=t>>1,r=0,i=e[r],a=r,o=i;for(;r<n;){let n=2*r+1,s=e[n],c=n+1;if(this.compare(s,i)>0&&(a=n,o=s),c<t){let t=e[c];this.compare(t,o)>0&&(a=c,o=t)}if(a===r)break;e[r]=o,e[a]=i,r=a,o=i}}[Symbol.iterator](){return this.values.slice().sort(this.compare)[Symbol.iterator]()}},Ej=class extends Tj{},Dj=class extends Tj{constructor(e,t,n,r){super(e,t?(e,n)=>-t(e,n):Cj,n,r)}},Oj=e=>e;function kj(e){return typeof e==`object`&&e?NaN:Number(e)}function Aj(e,t,n){if(BT(e)){typeof t!=`function`&&(t=Oj);for(let r of e){let e=t(r);e!==void 0&&n(kj(e))}}}function jj(e,t,n,r){if(e.length===0||!isFinite(t)||t<0||t>100)return;let i=0,a=t*(e.length-1)/100,o=Math.floor(a),s=Math.ceil(a),c=!1,l=t<50?new Dj(s+1,r):new Ej(e.length-o,r);if(Aj(e,n,e=>{Number.isNaN(e)&&(c=!0),l.add(e),i++}),c)return NaN;if(e.length!==i){if(i===0)return;a=t*(i-1)/100,o=Math.floor(a),s=Math.ceil(a);let e=t<50?s+1:i-o;for(let t=l.values.length;t>e;t--)l.extract()}if(o!==s){let e=l.extract(),t=l.values[0];return e<=t?e+(t-e)*(a-o):t+(e-t)*(a-o)}return l.values[0]}var Mj=e=>e;function Nj(e,t){let n,r=0,i=0;return Aj(e,t,e=>{if(i++,n===void 0)n=e;else{let t=n,i=Math.abs(t),a=Math.abs(e);n+=e,i!==1/0&&a!==1/0&&(r+=i>=a?t-n+e:e-n+t)}}),n!==void 0&&(n+=r),{sum:n,count:i}}function Pj(e,t){let n=[];return Aj(e,t,n.push.bind(n)),n}function Fj(e,t){let n=0;if(BT(e)){typeof t!=`function`&&(t=Mj);for(let r of e)t(r)!==void 0&&n++}return n}function Ij(e,t){return Nj(e,t).sum}function Lj(e,t){let{sum:n,count:r}=Nj(e,t);if(r>0)return n/r}function Rj(e,t){let n=0,r=0,i=0;if(Aj(e,t,e=>{n+=1;let t=e-r;r+=t/n,i+=t*(e-r)}),n>0)return i/n}function zj(e,t){let n=Rj(e,t);if(n!==void 0)return Math.sqrt(n)}function Bj(e,t=GA){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=qA(t,GA);for(let r=0;r<e.length;r++){let i=e[r];(n===void 0||t(i,n)<0)&&t(i,void 0)!==0&&(n=i)}}return n}function Vj(e,t=GA){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=qA(t,GA);for(let r=0;r<e.length;r++){let i=e[r];(n===void 0||t(i,n)>=0)&&t(i,void 0)!==0&&(n=i)}}return n}function Hj(e,t,n){if(BT(e))return jj(e,t,n)}function Uj(e,t){return Hj(e,50,t)}function Wj(){}function Gj(e){return e}function Kj(e){return e===null?null:{matched:e.slice(),start:e.index,end:e.index+e[0].length,input:e.input,groups:e.groups||null}}function qj(e){let t=e.pop(),n=typeof t==`string`?null:t,r=n===null?t:e.pop(),i=e.pop();return{matched:e,start:i,end:i+e[0].length,input:r,groups:n}}var Jj=String.prototype.replaceAll||function(e,t){return zT(e)?this.replace(e,t):this.split(e).join(String(t))},Yj=Object.freeze({bool:JA.bool,filter:JA.filter,map:JA.map,pick:JA.pick,indexOf:JA.indexOf,lastIndexOf:JA.lastIndexOf,keys(e){return Object.keys(e||{})},values(e){let t=new Set;for(let n in e)NT(e,n)&&FT(t,e[n]);return[...t]},entries(e){let t=[];for(let n in e)NT(e,n)&&t.push({key:n,value:e[n]});return t},fromEntries(e){let t=Object.create(null);if(Array.isArray(e))for(let n of e)n&&(t[n.key]=n.value);return t},size(e){return RT(e)?Object.keys(e).length:e&&e.length||0},sort(e,t=UA){if(!VT(e))return e;if(typeof t==`function`&&t.length!==2){let e=t;t=(t,n)=>{if(t=e(t),n=e(n),Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return t.length<n.length?-1:1;for(let e=0;e<t.length;e++){let r=UA(t[e],n[e]);if(r!==0)return r}return 0}return UA(t,n)}}return Sj(e,t)},reverse(e){return VT(e)?e.slice().reverse():e},slice(e,t,n){return typeof e==`string`||VT(e)?e.slice(t,n):Array.prototype.slice.call(e,t,n)},group(e,t,n){let r=new Map,i=[];typeof t!=`function`&&(t=Wj),typeof n!=`function`&&(n=Gj),VT(e)||(e=[e]);for(let i of e){let e=t(i);if(VT(e)){if(e.length>0){let t=n(i);for(let n of e)IT(r,n,t)}else IT(r,void 0,n(i))}else IT(r,e,n(i))}for(let[e,t]of r)i.push({key:e,value:[...t]});return i},join(e,t){return VT(e)?e.join(t):String(e)},match(e,t,n){let r=String(e),i=zT(t)?t.flags:``;if(n||i.includes(`g`)){let e=[],n=new RegExp(t,(i||``).replace(/g|$/,`g`)),a;for(;a=n.exec(r);)e.push(Kj(a));return e}return Kj(r.match(t))},reduce(e,t,n=void 0){return VT(e)?n===void 0?e.reduce((e,n)=>t(n,e)):e.reduce((e,n)=>t(n,e),n):t(e,n)},split(e,t){if(VT(e)){let n=typeof t==`function`?t:Object.is.bind(null,t),r=[],i=0,a=0;for(;a<e.length;a++)n(e[a])&&(r.push(e.slice(i,a)),i=a+1);return r.push(e.slice(i,a)),r}return String(e).split(t)},replace(e,t,n){if(VT(e)){let r=typeof t==`function`?t:Object.is.bind(null,t),i=[...e];for(let e=0;e<i.length;e++){let t=i[e];r(t)&&(i[e]=typeof n==`function`?n(t):n)}return i}return zT(t)&&!t.flags.includes(`g`)&&(t=new RegExp(t,t.flags+`g`)),Jj.call(String(e),t,typeof n==`function`?(...e)=>n(qj(e)):n)},toLowerCase(e,t){return String(e).toLocaleLowerCase(t)},toUpperCase(e,t){return String(e).toLocaleUpperCase(t)},trim(e){return String(e).trim()},...`abs.acos.acosh.asin.asinh.atan.atan2.atanh.cbrt.ceil.clz32.cos.cosh.exp.expm1.floor.fround.hypot.imul.log10.log2.pow.round.sign.sin.sinh.sqrt.tan.tanh.trunc`.split(`.`).reduce((e,t)=>(e[t]=Math[t],e),{}),ln:Math.log,ln1p:Math.log1p,numbers:Pj,count:Fj,sum:Ij,avg:Lj,variance:Rj,stdev:zj,min:Bj,max:Vj,percentile:Hj,p:Hj,median:Uj}),Xj=Object.freeze({function:e=>typeof e==`function`,symbol:e=>typeof e==`symbol`,primitive:e=>e===null||typeof e!=`object`&&typeof e!=`function`,string:e=>typeof e==`string`,number:e=>typeof e==`number`,int:Number.isInteger,finite:e=>Number.isFinite(e),nan:e=>Number.isNaN(e),infinity:e=>e===1/0||e===-1/0,boolean:e=>e===!0||e===!1,null:e=>e===null,undefined:e=>e===void 0,nullish:e=>e==null,object:RT,array:VT,regexp:zT,truthy:UT,falsy:e=>!UT(e)}),Zj={path:`property`,key:`value`,value:`value`,"in-value":`value`,"value-subset":`value`,var:`variable`,assertion:`assertion`};function Qj(e,t){typeof e==`object`&&e&&!VT(e)&&Reflect.ownKeys(e).forEach(t.add,t)}function $j(e,t,n,r=new Set){let i=e=>{switch(typeof e){case`string`:case`number`:r.add(e)}};switch(e){case`path`:{let e=new Set;for(let n of t)if(Array.isArray(n))for(let t of n)Qj(t,e);else Qj(n,e);e.forEach(r.add,r);break}case`key`:{let e=new Set;for(let n of t)Qj(n,e);e.forEach(r.add,r);break}case`value`:for(let e of t)i(e);break;case`in-value`:{let e=new Set;for(let n of t)VT(n)?n.forEach(i):Qj(n,e);e.forEach(r.add,r);break}case`var`:for(let e of t)r.add(e);break;case`value-subset`:{let e=new Set(n);for(let n of t)e.has(n)||i(n);break}}return r}function eM(e,t,n,r=!1){let i=[];for(let[a,o,s,c,l=null]of n)if(t>=a&&t<=o&&(r||c.size||c.length)){let n=e.substring(a,o);/\S/.test(n)||(a=o=t,n=``),i.push({context:s,from:a,to:o,text:n,values:c,related:l})}return i}function tM(e,t){return typeof e==`function`?e:e===!0&&t}function nM(e){if(/^(["']).*\1$/.test(e))try{return e[0]===`'`&&(e=`"${e.slice(1,-1).replace(/\\.|"/g,e=>e===`\\'`?`'`:e===`"`?`\\"`:e)}"`),JSON.parse(e)}catch{}return e}function rM(e){return t=>(typeof t==`string`?t:String(t)).toLowerCase().indexOf(e)!==-1}var iM=(e,{value:t,stats:n,assertions:r})=>({get value(){return t},stat(t,r){return eM(e,t,n,r)},suggestion(t,i){let{limit:a=1/0,sort:o,filter:s}=i||{};o=tM(o,JA.cmp),s=tM(s,rM);let c=o&&isFinite(a)?Ej:Set,l=eM(e,t,n,!0),u=new Map,d=[];for(let e of l){let{context:t,text:n,from:i,to:l,values:d,related:f}=e,p=Zj[t];if(!u.has(p)){let e;switch(c){case Ej:e=new Ej(a,o,s&&s(nM(n)),!0);break;case Set:e=new Set}u.set(p,{type:p,from:i,to:l,text:n,suggestions:e})}let{suggestions:m}=u.get(p);switch(t){case`assertion`:if(m.size===0||m.values&&m.values.length===0)for(let e of Object.keys(r))m.add(e);break;default:$j(t,d,f,m)}}if(c===Set)for(let e of u.values()){let{suggestions:t}=e;if(o&&(t=[...t].sort(o)),s||isFinite(a)){let n=[],r=s?s(nM(e.text)):()=>!0;for(let e of t)if(r(e)&&n.push(e)>=a)break;t=n}e.suggestions=t}for(let e of u.values())e.suggestions=Array.isArray(e.suggestions)?e.suggestions:[...e.suggestions],e.suggestions.length&&d.push(e);return d.length?d:null}}),aM=s({default:()=>gM}),oM=new Map,sM=new Map,cM=new Map,lM=new Map;function uM(e,t,n,r,i){typeof n==`string`?Object.defineProperty(e,t,{configurable:!0,get(){let a=pM(n,`method`)(JA,r,i);return Object.defineProperty(e,t,{enumerable:!0,value:a}),a}}):typeof n==`function`&&Object.defineProperty(e,t,{enumerable:!0,value:n})}function dM(e,t){if(!e&&!t)return{queryMethods:Yj,queryAssertions:Xj};let n={...Yj},r={...Xj};for(let[t,i]of Object.entries(e||{})){if(NT(Yj,t))throw Error(`Builtin method "${t}" can\'t be overridden`);uM(n,t,i,n,r)}for(let[e,i]of Object.entries(t||{})){if(NT(Xj,e))throw Error(`Builtin assertion "${e}" can\'t be overridden`);uM(r,e,i,n,r)}return{queryMethods:n,queryAssertions:r}}function fM(e,t){console.log(`[${e}]`),typeof t==`string`?console.log(t):t!==void 0&&console.dir(t,{depth:null}),console.log()}function pM(e,t,n,r,i){i=typeof i==`function`?i:i?fM:!1,i&&(i(`=========================`),i(`Compile query from source`,e));let a=RE.parse(e,r);i&&(i(`AST`,a.ast),i(`Restored source`,rA(a.ast)));let o=n?eA(e,a):null;if(i&&o){let t=e=>JSON.stringify(e).slice(1,-1),n=[].concat(...[...o.entries()].map(([e,t])=>t.map(t=>[e,...t]))),r=[],a=null;i(`Stat/suggestion ranges`,n.sort((e,t)=>e[1]-t[1]).map(([n,...i])=>{let[o,s,c,l]=i,u;if(o===r[0]&&s===r[1])u=` `.repeat(a.length);else{let n=t(e.slice(0,o)).length,c=t(e.substring(o,s)).length;r=i,a=` `.repeat(n)+(c?`~`.repeat(c):`\\`)+` `+o+`:`+s,u=t(e)+`
|
|
24
|
+
`+a}return u+` [`+c+`] on `+n.type+(l===!0?` (current)`:l&&l.type?` & `+l.type:``)}).join(`
|
|
25
|
+
`))}let s=t===`method`?cA(a.ast,r,o):sA(a.ast,r,o);return i&&i(`Compiled code`,s.toString()),s}function mM(e,t){t||={};let n=!!t.stat,r=!!t.tolerant,i=n?r?lM:sM:r?cM:oM,{methods:a,assertions:o}=t||{},{queryMethods:s,queryAssertions:c}=dM(a,o),l;return e=String(e),i.has(e)&&!t.debug?l=i.get(e):(l=pM(e,`query`,n,r,t.debug),i.set(e,l)),l=l(JA,s,c),n?Object.assign((t,n)=>iM(e,l(t,n)),{query:l}):l}function hM(e){let t=new Map,n=new Map,r=new Map,i=new Map,{methods:a,assertions:o}=e||{},{queryMethods:s,queryAssertions:c}=dM(a,o);return function(e,a){a||={};let o=!!a.stat,l=!!a.tolerant,u=o?l?i:n:l?r:t,d;if(e=String(e),u.has(e)&&!a.debug)d=u.get(e);else{let t=pM(e,`query`,o,l,a.debug)(JA,s,c);d=o?Object.assign((n,r)=>iM(e,t(n,r)),{query:t}):t,u.set(e,d)}return d}}var gM=Object.assign(mM,{version:MT,buildin:JA,methods:Yj,assertions:Xj,setup:hM,syntax:{tokenize:RE.tokenize,parse:RE.parse,suggest:eA,walk:qk,stringify:rA,compile:sA,compileMethod:cA}}),_M=400,vM=150,yM=300,bM=`data-inspector:drafts`,xM=5,SM=1,CM=3600,wM=[`excludeFunctions`,`excludeUnderscoreProps`,`excludeDollarProps`];function TM(){try{let e=JSON.parse(localStorage.getItem(bM)??`{}`);return e&&typeof e==`object`?e:{}}catch{return{}}}function EM(e){try{return gM.syntax.parse(e),{kind:`ok`}}catch(t){let n=t,r=n.details?.loc?.range;return!r||r[1]>=e.trimEnd().length?{kind:`pending`}:{kind:`error`,message:n.message}}}function DM(e){return Number.isFinite(e)?Math.min(CM,Math.max(SM,Math.round(e))):xM}function OM(){let e=new URLSearchParams(location.hash.replace(/^#/,``)),t={};for(let n of wM)e.get(n)===`1`&&(t[n]=!0);let n=Number(e.get(`autorunSecs`));return{sourceId:e.get(`source`)??``,query:e.get(`query`)??``,filters:t,autoRun:e.get(`autorun`)===`1`,autoRunSeconds:n?DM(n):xM}}function kM(){let e=OM(),t=V([]),n=V(e.sourceId),r=V(e.query),i=TM(),a=!1;function o(){n.value&&(r.value?i[n.value]=r.value:delete i[n.value],localStorage.setItem(bM,JSON.stringify(i)))}function s(){a=!0,r.value=i[n.value]??``}let c=Yt({excludeFunctions:!1,excludeUnderscoreProps:!1,excludeDollarProps:!1,...e.filters}),l=V(e.autoRun),u=V(e.autoRunSeconds),d;function f(){clearTimeout(d),d=setTimeout(()=>{let e=new URLSearchParams;n.value&&e.set(`source`,n.value),r.value&&e.set(`query`,r.value);for(let t of wM)c[t]&&e.set(t,`1`);l.value&&(e.set(`autorun`,`1`),e.set(`autorunSecs`,String(u.value)));let t=e.toString();location.hash.replace(/^#/,``)!==t&&history.replaceState(history.state,``,t?`#${t}`:location.pathname+location.search)},yM)}function p(){let e=OM();e.sourceId&&e.sourceId!==n.value&&t.value.some(t=>t.id===e.sourceId)&&(n.value=e.sourceId),r.value=e.query;for(let t of wM)c[t]=e.filters[t]??!1;l.value=e.autoRun,u.value=e.autoRunSeconds}let m=V({kind:`ok`}),h=V(!1),g=V(null),_=V(null),v=V(!1),y=un(),b=V(!1),x=V(null),S=V([]),C=un(),w=V(null),T=V(!1),E=Q(()=>t.value.find(e=>e.id===n.value)),D=Q(()=>{let e=r.value.trim();return!e||e===`$`}),O=Q(()=>hT.mode===`rpc`&&!!E.value?.writable&&D.value),k=Q(()=>hT.mode!==`rpc`||!E.value?null:E.value.writable?D.value?null:`derived-view`:`readonly-source`),A=null;async function ee(){t.value=await _T().sources(),A&&t.value.some(e=>e.id===A)&&(n.value=A,A=null),(!n.value||!t.value.some(e=>e.id===n.value))&&(n.value=t.value[0]?.id??``),e.query&&o()}function j(e){t.value.some(t=>t.id===e)?(n.value=e,A=null):A=e}let te=0,ne;async function M(){if(clearTimeout(ne),!n.value)return;let e=r.value.trim()||`$`;if(e!==`$`){let t=EM(e);if(m.value=t,t.kind!==`ok`)return}else m.value={kind:`ok`};let t=++te;h.value=!0;let i=performance.now(),a;try{a=await _T().query(n.value,e,{...c})}catch(e){t===te&&(h.value=!1,g.value=`rpc: ${e instanceof Error?e.message:String(e)}`,v.value=!0);return}if(t===te){if(h.value=!1,!a.ok){g.value=`${a.error.name}: ${a.error.message}`,v.value=!0;return}g.value=null,v.value=!1,_.value={...a.stats,rpcMs:Math.round(performance.now()-i)},y.value=a.result,b.value=!0,x.value=Date.now()}}function re(){clearTimeout(ne),ne=setTimeout(()=>void M(),_M)}let ie;function ae(){return typeof document<`u`&&document.hidden}function N(){clearInterval(ie),ie=void 0,!(!l.value||ae())&&(ie=setInterval(()=>{h.value||m.value.kind===`error`||M()},DM(u.value)*1e3))}typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{l.value&&(N(),!ae()&&!h.value&&m.value.kind!==`error`&&M())});async function P(e){if(!n.value)throw Error(`no source selected`);let t=r.value.trim()||`$`,i=await _T().queryPath(n.value,t,e,{...c});if(!i.ok)throw Error(`${i.error.name}: ${i.error.message}`);return i.result}async function F(e){if(!n.value)return{ok:!1,error:{name:`NoSource`,message:`no source selected`}};let t;try{t=await _T().write(n.value,e,{excludeFunctions:c.excludeFunctions})}catch(e){return{ok:!1,error:{name:`RpcError`,message:e instanceof Error?e.message:String(e)}}}return t.ok&&(M(),L()),t}let I;function oe(e){e!==n.value||I||(I=setTimeout(()=>{I=void 0,!(h.value||m.value.kind===`error`)&&(M(),L())},300))}let se=0;async function L(){if(!n.value)return;let e=++se;T.value=!0;let t;try{t=await _T().skeleton(n.value,{...c})}catch(t){e===se&&(T.value=!1,w.value=`rpc: ${t instanceof Error?t.message:String(t)}`);return}if(e===se){if(T.value=!1,!t.ok){w.value=`${t.error.name}: ${t.error.message}`;return}w.value=null,C.value=t.skeleton}}let ce=0,le;async function ue(e){let t=++ce,i;try{i=await _T().suggest(n.value,r.value,e)}catch{return}t===ce&&(S.value=(i.ok?i.suggestions:[]).filter(e=>!e.current||e.value.toLowerCase().startsWith(e.current.toLowerCase())))}function de(e){clearTimeout(le),le=setTimeout(()=>void ue(e),vM)}function fe(e){let t=r.value;return r.value=t.slice(0,e.from)+e.value+t.slice(e.to),S.value=[],M(),r.value}function pe(e){for(let t of wM)c[t]=e[t]??!1;r.value=e.query,M()}Er(r,()=>{if(o(),f(),a){a=!1;return}re()}),Er(n,()=>{S.value=[],s(),f(),M(),L()}),Er(c,()=>{f(),M(),L()}),Er([l,u],()=>{u.value=DM(u.value),f(),N()}),l.value&&N(),typeof window<`u`&&window.addEventListener(`hashchange`,p);function me(e){r.value=/^[a-z_$][\w$]*$/i.test(e)?e:`$["${e.replaceAll(`"`,`\\"`)}"]`,M()}function he(e){let t=r.value.trim();r.value=t&&t!==`$`?`${t}\n| ${e}`:e,M()}function ge(e){let t=r.value.trim();r.value=t?`${t}${e.startsWith(`[`)?``:`.`}${e}`:e,M()}return{sources:t,sourceId:n,activeSource:E,query:r,settings:c,autoRun:l,autoRunSeconds:u,syntax:m,running:h,serverError:g,stats:_,statsStale:v,result:y,hasResult:b,lastRunAt:x,suggestions:S,skeleton:C,skeletonError:w,skeletonLoading:T,isIdentityQuery:D,canEdit:O,editHint:k,applyEdit:F,handleDataChanged:oe,loadSources:ee,loadSkeleton:L,focusSource:j,expandNode:P,runNow:M,requestSuggestions:ue,scheduleSuggestions:de,acceptSuggestion:fe,applyRecipe:pe,queryProp:me,applySubquery:he,appendPath:ge}}var AM=Symbol(`data-inspector:workbench`);function jM(){let e=yr(AM);if(!e)throw Error(`workbench not provided`);return e}var MM={class:`flex flex-col h-full min-h-0`},NM={class:`flex gap-2`},PM={key:0,class:`text-sm op-fade`},FM={key:0,class:`mx-1 mb-1 px-2.5 py-1.5 font-mono text-11px rounded-lg border border-red-600/40 bg-red-500:8 color-red-700 dark:border-red-400/40 dark:color-red-300`},IM={class:`flex-1 min-h-0 overflow-auto font-mono max-h50 text-xs border border-base rounded-lg px-3 py-2`},LM=[`title`,`onClick`],RM={class:`op50`},zM={key:1,class:`op50`},BM={key:2,class:`op50`},VM=W({__name:`DataShapePanel`,props:{source:{},skeleton:{},error:{},loading:{type:Boolean}},emits:[`refresh`,`select`],setup(e,{emit:t}){let n=e,r=t;function i(e){if(typeof e==`string`)return e===`...`||e===`[circular]`?`object`:e;if(Array.isArray(e))return`array`;if(e&&typeof e==`object`){let t=e;return typeof t.$class==`string`?`class ${t.$class}`:Object.keys(t).find(e=>/^(?:Map|Set)\(\d+\)$/.test(e))||`object`}return String(e)}let a=Q(()=>{let{skeleton:e}=n;return!e||typeof e!=`object`||Array.isArray(e)?[]:Object.entries(e).filter(([e])=>e!==`$class`&&e!==`...`).map(([e,t])=>({key:e,label:i(t)}))}),o=Q(()=>{let{skeleton:e}=n;return e===void 0||a.value.length?null:i(e)});return(t,n)=>(K(),q(`div`,MM,[Y(`div`,NM,[e.source?.description?(K(),q(`div`,PM,ke(e.source.description),1)):Z(``,!0),n[1]||=Y(`div`,{class:`flex-auto`},null,-1),X(vm,{class:`text-sm`,icon:e.loading?`i-ph:arrows-clockwise animate-spin`:`i-ph:arrows-clockwise`,label:`Refresh data shape`,tooltip:`Refresh`,disabled:e.loading,onClick:n[0]||=e=>r(`refresh`)},null,8,[`icon`,`disabled`])]),e.error?(K(),q(`div`,FM,ke(e.error),1)):Z(``,!0),Y(`div`,IM,[a.value.length?(K(),q(ss,{key:0},[n[2]||=Y(`div`,{class:`op50 select-none`},` { `,-1),(K(!0),q(ss,null,ma(a.value,e=>(K(),q(`div`,{key:e.key,class:`pl-4 whitespace-nowrap`},[Y(`button`,{type:`button`,class:`color-active hover:underline cursor-pointer`,title:`Query ${e.key}`,onClick:t=>r(`select`,e.key)},ke(e.key),9,LM),Y(`span`,RM,`: `+ke(e.label)+`,`,1)]))),128)),n[3]||=Y(`div`,{class:`op50 select-none`},` } `,-1)],64)):o.value?(K(),q(`span`,zM,ke(o.value),1)):(K(),q(`span`,BM,`loading shape...`))])]))}});function HM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function UM(e){if(Array.isArray(e))return e}function WM(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function GM(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KM(e,t){return UM(e)||WM(e,t)||qM(e,t)||GM()}function qM(e,t){if(e){if(typeof e==`string`)return HM(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HM(e,t):void 0}}var JM=Object.entries,YM=Object.setPrototypeOf,XM=Object.isFrozen,ZM=Object.getPrototypeOf,QM=Object.getOwnPropertyDescriptor,$M=Object.freeze,eN=Object.seal,tN=Object.create,nN=typeof Reflect<`u`&&Reflect,rN=nN.apply,iN=nN.construct;$M||=function(e){return e},eN||=function(e){return e},rN||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},iN||=function(e){return new e(...[...arguments].slice(1))};var aN=TN(Array.prototype.forEach),oN=TN(Array.prototype.lastIndexOf),sN=TN(Array.prototype.pop),cN=TN(Array.prototype.push),lN=TN(Array.prototype.splice),uN=Array.isArray,dN=TN(String.prototype.toLowerCase),fN=TN(String.prototype.toString),pN=TN(String.prototype.match),mN=TN(String.prototype.replace),hN=TN(String.prototype.indexOf),gN=TN(String.prototype.trim),_N=TN(Number.prototype.toString),vN=TN(Boolean.prototype.toString),yN=typeof BigInt>`u`?null:TN(BigInt.prototype.toString),bN=typeof Symbol>`u`?null:TN(Symbol.prototype.toString),xN=TN(Object.prototype.hasOwnProperty),SN=TN(Object.prototype.toString),CN=TN(RegExp.prototype.test),wN=EN(TypeError);function TN(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return rN(e,t,n)}}function EN(e){return function(){return iN(e,[...arguments])}}function DN(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dN;if(YM&&YM(e,null),!uN(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(XM(t)||(t[r]=e),i=e)}e[i]=!0}return e}function ON(e){for(let t=0;t<e.length;t++)xN(e,t)||(e[t]=null);return e}function kN(e){let t=tN(null);for(let r of JM(e)){var n=KM(r,2);let i=n[0],a=n[1];xN(e,i)&&(t[i]=uN(a)?ON(a):a&&typeof a==`object`&&a.constructor===Object?kN(a):a)}return t}function AN(e){switch(typeof e){case`string`:return e;case`number`:return _N(e);case`boolean`:return vN(e);case`bigint`:return yN?yN(e):`0`;case`symbol`:return bN?bN(e):`Symbol()`;case`undefined`:return SN(e);case`function`:case`object`:{if(e===null)return SN(e);let t=e,n=jN(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:SN(e)}return SN(e)}default:return SN(e)}}function jN(e,t){for(;e!==null;){let n=QM(e,t);if(n){if(n.get)return TN(n.get);if(typeof n.value==`function`)return TN(n.value)}e=ZM(e)}function n(){return null}return n}function MN(e){try{return CN(e,``),!0}catch{return!1}}var NN=$M(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),PN=$M(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),FN=$M([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),IN=$M([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),LN=$M(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),RN=$M([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),zN=$M([`#text`]),BN=$M(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),VN=$M(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),HN=$M(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),UN=$M([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),WN=eN(/{{[\w\W]*|^[\w\W]*}}/g),GN=eN(/<%[\w\W]*|^[\w\W]*%>/g),KN=eN(/\${[\w\W]*/g),qN=eN(/^data-[\-\w.\u00B7-\uFFFF]+$/),JN=eN(/^aria-[\-\w]+$/),YN=eN(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),XN=eN(/^(?:\w+script|data):/i),ZN=eN(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),QN=eN(/^html$/i),$N=eN(/^[a-z][.\w]*(-[.\w]+)+$/i),eP=eN(/<[/\w!]/g),tP=eN(/<[/\w]/g),nP=eN(/<\/no(script|embed|frames)/i),rP=eN(/\/>/i),iP={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},aP=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],oP=$M(DN({},aP)),sP=function(){let e={};return aN(aP,t=>{e[t]=eN(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),$M(e)}(),cP=function(){return typeof window>`u`?null:window},lP=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},uP=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},dP=function(e,t,n,r){return xN(e,t)&&uN(e[t])?DN(r.base?kN(r.base):{},e[t],r.transform):n},fP=function(e,t,n){let r=xN(e,t)?e[t]:void 0;return r&&typeof r==`object`?kN(r):n()};function pP(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cP(),t=e=>pP(e);if(t.version=`3.4.14`,t.removed=[],!e||!e.document||e.document.nodeType!==iP.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=jN(d,`cloneNode`),p=jN(d,`remove`),m=jN(d,`nextSibling`),h=jN(d,`childNodes`),g=jN(d,`parentNode`),_=jN(d,`shadowRoot`),v=jN(d,`attributes`),y=o&&o.prototype?jN(o.prototype,`nodeType`):null,b=o&&o.prototype?jN(o.prototype,`nodeName`):null,x=o&&o.prototype?jN(o.prototype,`ownerDocument`):null,S=function(e){return y?y(e):e.nodeType},C=function(e){return b?b(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,T=``,E,D=!1,O=0,k=function(){if(O>0)throw wN(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return w.createHTML(e)}finally{O--}},ee=function(e){k(),O++;try{return w.createScriptURL(e)}finally{O--}},j=function(){return D||=(E=lP(u,i),!0),E},te=n,ne=te.implementation,M=te.createNodeIterator,re=te.createDocumentFragment,ie=te.getElementsByTagName,ae=r.importNode,N=uP();t.isSupported=typeof JM==`function`&&typeof g==`function`&&ne&&ne.createHTMLDocument!==void 0;let P=WN,F=GN,I=KN,oe=qN,se=JN,L=XN,ce=ZN,le=$N,ue=YN,de=null,fe=DN({},[...NN,...PN,...FN,...LN,...zN]),pe=null,me=DN({},[...BN,...VN,...HN,...UN]),he=Object.seal(tN(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,_e=null,ve=Object.seal(tN(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ye=!0,be=!0,xe=!1,Se=!0,Ce=!1,we=!0,Te=!1,Ee=!1,De=null,Oe=null,ke=!1,Ae=!1,je=!1,Me=!1,Ne=!0,Pe=!1,R=`user-content-`,Fe=!0,Ie=!1,Le={},Re=null,ze=DN({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Be=null,Ve=DN({},[`audio`,`video`,`img`,`source`,`image`,`track`]),He=null,Ue=DN({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),We=`http://www.w3.org/1998/Math/MathML`,Ge=`http://www.w3.org/2000/svg`,Ke=`http://www.w3.org/1999/xhtml`,qe=Ke,Je=!1,Ye=null,Xe=DN({},[We,Ge,Ke],fN),Ze=$M([`mi`,`mo`,`mn`,`ms`,`mtext`]),Qe=DN({},Ze),$e=$M([`annotation-xml`]),et=DN({},$e),tt=DN({},[`title`,`style`,`font`,`a`,`script`]),nt=null,rt=[`application/xhtml+xml`,`text/html`],it=null,at=null,ot=n.createElement(`form`),st=function(e){return e instanceof RegExp||e instanceof Function},ct=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(at&&at===e)return;(!e||typeof e!=`object`)&&(e={}),e=kN(e),nt=rt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,it=nt===`application/xhtml+xml`?fN:dN,de=dP(e,`ALLOWED_TAGS`,fe,{transform:it}),pe=dP(e,`ALLOWED_ATTR`,me,{transform:it}),Ye=dP(e,`ALLOWED_NAMESPACES`,Xe,{transform:fN}),He=dP(e,`ADD_URI_SAFE_ATTR`,Ue,{transform:it,base:Ue}),Be=dP(e,`ADD_DATA_URI_TAGS`,Ve,{transform:it,base:Ve}),Re=dP(e,`FORBID_CONTENTS`,ze,{transform:it}),ge=dP(e,`FORBID_TAGS`,kN({}),{transform:it}),_e=dP(e,`FORBID_ATTR`,kN({}),{transform:it}),Le=xN(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?kN(e.USE_PROFILES):e.USE_PROFILES:!1,ye=e.ALLOW_ARIA_ATTR!==!1,be=e.ALLOW_DATA_ATTR!==!1,xe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=e.SAFE_FOR_TEMPLATES||!1,we=e.SAFE_FOR_XML!==!1,Te=e.WHOLE_DOCUMENT||!1,Ae=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,Me=e.RETURN_TRUSTED_TYPE||!1,ke=e.FORCE_BODY||!1,Ne=e.SANITIZE_DOM!==!1,Pe=e.SANITIZE_NAMED_PROPS||!1,Fe=e.KEEP_CONTENT!==!1,Ie=e.IN_PLACE||!1,ue=MN(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:YN,qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ke,Qe=fP(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>DN({},Ze)),et=fP(e,`HTML_INTEGRATION_POINTS`,()=>DN({},$e));let t=fP(e,`CUSTOM_ELEMENT_HANDLING`,()=>tN(null));if(he=tN(null),xN(t,`tagNameCheck`)&&st(t.tagNameCheck)&&(he.tagNameCheck=t.tagNameCheck),xN(t,`attributeNameCheck`)&&st(t.attributeNameCheck)&&(he.attributeNameCheck=t.attributeNameCheck),xN(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(he.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),eN(he),Ce&&(be=!1),je&&(Ae=!0),Le&&(de=DN({},zN),pe=tN(null),Le.html===!0&&(DN(de,NN),DN(pe,BN)),Le.svg===!0&&(DN(de,PN),DN(pe,VN),DN(pe,UN)),Le.svgFilters===!0&&(DN(de,FN),DN(pe,VN),DN(pe,UN)),Le.mathMl===!0&&(DN(de,LN),DN(pe,HN),DN(pe,UN))),ve.tagCheck=null,ve.attributeCheck=null,xN(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ve.tagCheck=e.ADD_TAGS:uN(e.ADD_TAGS)&&(de===fe&&(de=kN(de)),DN(de,e.ADD_TAGS,it))),xN(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ve.attributeCheck=e.ADD_ATTR:uN(e.ADD_ATTR)&&(pe===me&&(pe=kN(pe)),DN(pe,e.ADD_ATTR,it))),xN(e,`ADD_FORBID_CONTENTS`)&&uN(e.ADD_FORBID_CONTENTS)&&(Re===ze&&(Re=kN(Re)),DN(Re,e.ADD_FORBID_CONTENTS,it)),Fe&&(de[`#text`]=!0),Te&&DN(de,[`html`,`head`,`body`]),de.table&&(DN(de,[`tbody`]),delete ge.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw wN(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw wN(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=w;w=e.TRUSTED_TYPES_POLICY;try{T=A(``)}catch(e){throw w=t,e}}else e.TRUSTED_TYPES_POLICY===null?(w=void 0,T=``):(w===void 0&&(w=j()),w&&typeof T==`string`&&(T=A(``)));$M&&$M(e),at=e},lt=DN({},[...PN,...FN,...IN]),ut=DN({},[...LN,...RN]),dt=function(e,t,n){return t.namespaceURI===Ke?e===`svg`:t.namespaceURI===We?e===`svg`&&(n===`annotation-xml`||Qe[n]):!!lt[e]},ft=function(e,t,n){return t.namespaceURI===Ke?e===`math`:t.namespaceURI===Ge?e===`math`&&et[n]:!!ut[e]},pt=function(e,t,n){return t.namespaceURI===Ge&&!et[n]||t.namespaceURI===We&&!Qe[n]?!1:!ut[e]&&(tt[e]||!lt[e])},mt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:qe,tagName:`template`});let n=dN(e.tagName),r=dN(t.tagName);return Ye[e.namespaceURI]?e.namespaceURI===Ge?dt(n,t,r):e.namespaceURI===We?ft(n,t,r):e.namespaceURI===Ke?pt(n,t,r):!!(nt===`application/xhtml+xml`&&Ye[e.namespaceURI]):!1},ht=function(e){cN(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw wN(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},z=function(e,t,n){try{e.removeAttributeNode(t)}catch{try{e.removeAttribute(n)}catch{}}},gt=function(e){yt(e);let t=h(e);if(t){let e=[];aN(t,t=>{cN(e,t)}),aN(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&z(e,r,i)}},_t=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}cN(t.removed,{attribute:r||null,from:n});try{r?n.removeAttributeNode(r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ae||je)try{ht(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},vt=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||pe[it(i)]||z(e,r,i)}},yt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();S(e)===iP.element&&vt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},bt=function(e,t){return we?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},xt=function(e){if(!we)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=S(e);if(n===iP.processingInstruction||n===iP.comment&&CN(tP,e.data)){try{p(e)}catch{}continue}if(n===iP.element){let t=e,n=it(C(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&bt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},St=function(e){let t=null,r=null;if(ke)e=`<remove></remove>`+e;else{let t=pN(e,/^[\r\n\t ]+/);r=t&&t[0]}nt===`application/xhtml+xml`&&qe===Ke&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=w?A(e):e;if(qe===Ke)try{t=new l().parseFromString(i,nt)}catch{}if(!t||!t.documentElement){t=ne.createDocument(qe,`template`,null);try{t.documentElement.innerHTML=Je?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),qe===Ke?ie.call(t,Te?`html`:`body`)[0]:Te?t.documentElement:a},B=function(e){let t=x?x(e):e.ownerDocument;return M.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ct=function(e){return e=mN(e,P,` `),e=mN(e,F,` `),e=mN(e,I,` `),e},wt=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=M.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Ct(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&aN(i,e=>{Et(e.content)&&wt(e.content)})},Tt=function(e){let t=b?b(e):null;return typeof t!=`string`||it(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Et=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===iP.documentFragment}catch{return!1}},Dt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Ot(e,n,r){e.length!==0&&aN(e,e=>{e.call(t,n,r,at)})}let kt=function(e,t){return!!(we&&e.hasChildNodes()&&!Dt(e.firstElementChild)&&CN(eP,e.textContent)&&CN(eP,e.innerHTML)||we&&e.namespaceURI===Ke&&oP[t]&&(Dt(e.firstElementChild)||typeof e.textContent==`string`&&CN(sP[t],e.textContent))||e.nodeType===iP.processingInstruction||we&&e.nodeType===iP.comment&&CN(tP,e.data))},At=function(e,t){return e instanceof RegExp?CN(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},jt=function(e,t,n){if(!ge[t]&&Lt(t)&&At(he.tagNameCheck,t))return!1;if(Fe&&!Re[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return ht(e),!0},Mt=function(e,t,n,r){return e.length===0?t:t===n||t===r?kN(t):t},Nt=function(e,t){return e===t||g(e)!==null?!1:(Ie&&yt(e),!0)},Pt=function(e,n){if(Ot(N.beforeSanitizeElements,e,null),Nt(e,n))return!0;if(Tt(e))return ht(e),!0;let r=it(C(e));if(de=Mt(N.uponSanitizeElement,de,fe,De),Ot(N.uponSanitizeElement,e,{tagName:r,allowedTags:de}),Nt(e,n))return!0;if(kt(e,r))return ht(e),!0;if(ge[r]||!(ve.tagCheck instanceof Function&&ve.tagCheck(r))&&!de[r]){let t=jt(e,r,n);return t===!1&&Ot(N.afterSanitizeElements,e,null),t}if(S(e)===iP.element&&!mt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&CN(nP,e.innerHTML))return ht(e),!0;if(Ce&&e.nodeType===iP.text){let n=Ct(e.textContent);e.textContent!==n&&(cN(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ot(N.afterSanitizeElements,e,null),!1},Ft=function(e,t,r){if(_e[t]||bt(t,e)||Ne&&(t===`id`||t===`name`)&&(r in n||r in ot))return!1;let i=pe[t]||ve.attributeCheck instanceof Function&&ve.attributeCheck(t,e);return be&&CN(oe,t)||ye&&CN(se,t)?!0:i?He[t]||CN(ue,mN(r,ce,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&hN(r,`data:`)===0&&Be[e]||xe&&!CN(L,mN(r,ce,``))?!0:!r:Lt(e)&&At(he.tagNameCheck,e)&&At(he.attributeNameCheck,t,e)||t===`is`&&he.allowCustomizedBuiltInElements&&At(he.tagNameCheck,r)},It=DN({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Lt=function(e){return!It[dN(e)]&&CN(le,e)},Rt=function(e,t,n,r){if(w&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return ee(r)}return r},zt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),Tt(e)?ht(e):sN(t.removed)}catch{_t(n,e)}},Bt=function(e){Ot(N.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||Tt(e))return;pe=Mt(N.uponSanitizeAttribute,pe,me,Oe);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:pe,forceKeepAttr:void 0},r=t.length,i=it(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=it(o),u=c,d=o===`value`?u:gN(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Ot(N.uponSanitizeAttribute,e,n),d=n.attrValue,Pe&&(l===`id`||l===`name`)&&hN(d,R)!==0&&(_t(o,e,a),d=R+d),we&&CN(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){_t(o,e,a);continue}if(l===`attributename`&&pN(d,`href`)){_t(o,e,a);continue}if(!n.forceKeepAttr){if(!n.keepAttr){_t(o,e,a);continue}if(!Se&&CN(rP,d)){_t(o,e,a);continue}if(Ce&&(d=Ct(d)),!Ft(i,l,d)){_t(o,e,a);continue}d=Rt(i,l,s,d),d!==u&&zt(e,o,s,d)}}Ot(N.afterSanitizeAttributes,e,null)},Vt=function(e){let t=null,n=B(e);for(Ot(N.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ot(N.uponSanitizeShadowNode,t,null),Pt(t,e),Bt(t),Et(t.content)&&Vt(t.content),S(t)===iP.element){let e=_(t);Et(e)&&(Ht(e),Vt(e))}Ot(N.afterSanitizeShadowDOM,e,null)},Ht=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Vt(e.shadow);continue}let n=e.node,r=S(n)===iP.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&it(e)===`template`){let e=n.content;Et(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Et(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Je=!e,Je&&(e=`<!-->`),typeof e!=`string`&&!Dt(e)&&(e=AN(e),typeof e!=`string`))throw wN(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ee?(de=De,pe=Oe):ct(n),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(de=kN(de)),N.uponSanitizeAttribute.length>0&&(pe=kN(pe)),t.removed=[];let c=Ie&&typeof e!=`string`&&Dt(e);if(c){xt(e);let t=C(e);if(typeof t==`string`){let n=it(t);if(!de[n]||ge[n])throw gt(e),wN(`root node is forbidden and cannot be sanitized in-place`)}if(Tt(e))throw gt(e),wN(`root node is clobbered and cannot be sanitized in-place`);try{Ht(e)}catch(t){throw gt(e),t}}else if(Dt(e))i=St(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===iP.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Ht(a);else{if(!Ae&&!Ce&&!Te&&e.indexOf(`<`)===-1)return w&&Me?A(e):e;if(i=St(e),!i)return Ae?null:Me?T:``}i&&ke&&ht(i.firstChild);let l=c?e:i;try{let e=B(l);for(;o=e.nextNode();)Pt(o,l),Bt(o),Et(o.content)&&Vt(o.content)}catch(n){throw c&&(gt(e),aN(t.removed,e=>{e.element&&yt(e.element)})),n}if(c)return aN(t.removed,e=>{e.element&&yt(e.element)}),Ce&&wt(e),e;if(Ae){if(Ce&&wt(i),je)for(s=re.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(pe.shadowroot||pe.shadowrootmode)&&(s=ae.call(r,s,!0)),s}let u=Te?i.outerHTML:i.innerHTML;return Te&&de[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&CN(QN,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
27
|
+
`+u),Ce&&(u=Ct(u)),w&&Me?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ct(e),Ee=!0,De=de,Oe=pe},t.clearConfig=function(){at=null,Ee=!1,De=null,Oe=null,w=E,T=``},t.isValidAttribute=function(e,t,n){at||ct({});let r=it(e),i=it(t);return Ft(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&xN(N,e)&&cN(N[e],t)},t.removeHook=function(e,t){if(xN(N,e)){if(t!==void 0){let n=oN(N[e],t);return n===-1?void 0:lN(N[e],n,1)[0]}return sN(N[e])}},t.removeHooks=function(e){xN(N,e)&&(N[e]=[])},t.removeAllHooks=function(){N=uP()},t}var mP=pP(),hP=new Map,gP=mP();async function _P(e,t){let n=`${e}:${t}`;if(hP.has(n))return hP.get(n);let r=i().then(e=>(hP.set(n,e),e)).catch(e=>{throw hP.delete(n),e});return hP.set(n,r),r;async function i(){let n=`https://api.iconify.design/${e}/${t}.svg?color=currentColor&width=100%`,r=await fetch(n).then(e=>e.text());return gP.sanitize(r)}}var vP=[`innerHTML`],yP=[`src`],bP=W({__name:`DisplayIconifyRemoteIcon`,props:{icon:{},size:{default:`1em`}},setup(e){let t=e,n=Q(()=>t.icon.includes(`/`)||t.icon.startsWith(`data:`)||t.icon.startsWith(`builtin:`)),r=Q(()=>{if(n.value)return;let e=t.icon.match(/^(?:i-)?([\w-]+):([\w-]+)$/);if(e)return{collection:e[1],icon:e[2]}}),i=V(void 0);return Cr(async()=>{if(!r.value){i.value=void 0;return}try{i.value=await _P(r.value.collection,r.value.icon)}catch{i.value=void 0}}),(t,n)=>r.value?(K(),q(`div`,{key:0,class:`shrink-0 inline-block [&>svg]:h-full [&>svg]:w-full`,style:me({width:e.size,height:e.size}),innerHTML:i.value},null,12,vP)):(K(),q(`img`,{key:1,src:e.icon,class:`shrink-0 inline-block object-contain`,style:me({width:e.size,height:e.size}),draggable:`false`},null,12,yP))}});function xP(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function SP(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n);return[t=>{let n=yr(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},e=>(vr(r,e),e)]}function CP(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function wP(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function TP(e){return e==null}function EP(e,t){return TP(e)?!1:Array.isArray(e)?e.some(e=>yb(e,t)):yb(e,t)}function DP(e){return e?e.flatMap(e=>e.type===ss?DP(e.children):[e]):[]}var[OP,kP]=SP(`ConfigProvider`),AP=Yt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});function jP(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function MP(e,t,n=`.`,r){if(!jP(t))return MP(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:jP(a)&&jP(i[t])?MP(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function NP(e){return(...t)=>t.reduce((t,n)=>MP(t,n,``,e),{})}var PP=NP(),FP=Uu(()=>{let e=V(new Map),t=V(),n=Q(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=OP({scrollBody:V(!0)}),i=null,a=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,AP.layersWithOutsidePointerEventsDisabled.size===0&&(document.body.style.pointerEvents=``),document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,Pu&&i?.(),t.value=void 0};return Er(n,(e,o)=>{if(!ku)return;if(!e){o&&a();return}t.value===void 0&&(t.value=document.body.style.overflow);let s=window.innerWidth-document.documentElement.clientWidth,c={padding:s,margin:0},l=r.scrollBody?.value?typeof r.scrollBody.value==`object`?PP({padding:r.scrollBody.value.padding===!0?s:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?s:r.scrollBody.value.margin},c):c:{padding:0,margin:0};s>0&&(document.body.style.paddingRight=typeof l.padding==`number`?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin==`number`?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty(`--scrollbar-width`,`${s}px`),document.body.style.overflow=`hidden`),Pu&&(i=$u(document,`touchmove`,e=>RP(e),{passive:!1})),Qn(()=>{n.value&&(document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`)})},{immediate:!0,flush:`sync`}),e});function IP(e){let t=Math.random().toString(36).substring(2,7),n=FP();n.value.set(t,e??!1);let r=Q({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return qu(()=>{n.value.delete(t)}),r}function LP(e){let t=window.getComputedStyle(e);if(t.overflowX===`scroll`||t.overflowY===`scroll`||t.overflowX===`auto`&&e.clientWidth<e.scrollWidth||t.overflowY===`auto`&&e.clientHeight<e.scrollHeight)return!0;{let t=e.parentNode;return!(t instanceof Element)||t.tagName===`BODY`?!1:LP(t)}}function RP(e){let t=e||window.event,n=t.target;return n instanceof Element&&LP(n)?!1:t.touches.length>1||(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function zP(e){let t=OP({dir:V(`ltr`)});return Q(()=>e?.value||t.dir?.value||`ltr`)}function BP(e){let t=Is(),n=t?.type.emits,r={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(t=>{r[oe(N(t))]=(...n)=>e(t,...n)}),r}var VP=0;function HP(){Cr(e=>{if(!ku)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??UP()),document.body.insertAdjacentElement(`beforeend`,t[1]??UP()),VP++,e(()=>{VP===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),VP--})})}function UP(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function WP(e){return Q(()=>!mn(e)||!!Qu(e)?.closest(`form`))}function GP(){let e=Is(),t=V(),n=Q(()=>r());$i(()=>{n.value!==r()&&pn(t)});function r(){return t.value&&`$el`in t.value&&[`#text`,`#comment`].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:Qu(t)}let i=Object.assign({},e.exposed),a={};for(let t in e.props)Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(i).length>0)for(let e in i)Object.defineProperty(a,e,{enumerable:!0,configurable:!0,get:()=>i[e]});Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=a;function o(n){if(t.value=n,n&&(Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),!(n instanceof Element)&&!Object.hasOwn(n,`$el`))){let t=n.$.exposed,r=Object.assign({},a);for(let e in t)Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>t[e]});e.exposed=r}}return{forwardRef:o,currentRef:t,currentElement:n}}function KP(e){let t=Is(),n=Object.keys(t?.type.props??{}).reduce((e,n)=>{let r=(t?.type.props[n]).default;return r!==void 0&&(e[n]=r),e},{}),r=Sn(e);return Q(()=>{let e={},i=t?.vnode.props??{};return Object.keys(i).forEach(t=>{e[N(t)]=i[t]}),Object.keys({...n,...e}).reduce((e,t)=>(r.value[t]!==void 0&&(e[t]=r.value[t]),e),{})})}function qP(e,t){let n=KP(e),r=t?BP(t):{};return Q(()=>({...n.value,...r}))}function JP(){let e=Is()?.vnode?.scopeId;return e?{[e]:``}:{}}var YP=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},XP=new WeakMap,ZP=new WeakMap,QP={},$P=0,eF=function(e){return e&&(e.host||eF(e.parentNode))},tF=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=eF(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},nF=function(e,t,n,r){var i=tF(t,Array.isArray(e)?e:[e]);QP[n]||(QP[n]=new WeakMap);var a=QP[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(XP.get(e)||0)+1,l=(a.get(e)||0)+1;XP.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ZP.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$P++,function(){o.forEach(function(e){var t=XP.get(e)-1,i=a.get(e)-1;XP.set(e,t),a.set(e,i),t||(ZP.has(e)||e.removeAttribute(r),ZP.delete(e)),i||e.removeAttribute(n)}),$P--,$P||(XP=new WeakMap,XP=new WeakMap,ZP=new WeakMap,QP={})}},rF=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||YP(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),nF(r,i,n,`aria-hidden`)):function(){return null}};function iF(e){let t;Er(()=>Qu(e),e=>{let n=!1;try{n=!!e?.closest(`[popover]:not(:popover-open)`)}catch{}e&&!n?t=rF(e):t&&t()}),ta(()=>{t&&t()})}var aF=0;function oF(e,t=`reka`){if(e)return e;let n,r=OP({useId:void 0});return n=r.useId?r.useId():`useId`in Cu?ai?.():`${++aF}`,t?`${t}-${n}`:n}function sF(e){let t=V(),n=Q(()=>t.value?.width??0),r=Q(()=>t.value?.height??0),i;return Zi(()=>{let n=Qu(e);n?(t.value={width:n.offsetWidth,height:n.offsetHeight},i=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}}),i.observe(n,{box:`border-box`})):t.value=void 0}),ta(()=>{i?.disconnect(),i=void 0}),{width:n,height:r}}function cF(e,t){let n=V(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function lF(e){let t=Wu(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=CP(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=dF(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function uF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function dF(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=uF(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function fF(e,t){let n=V({}),r=V(`none`),i=V(e),a=e.value?`mounted`:`unmounted`,o,s=t.value?.ownerDocument.defaultView??Zu,{state:c,dispatch:l}=cF(a,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),u=e=>{if(ku){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};Er(e,async(e,i)=>{let a=i!==e;if(await Qn(),a){let a=r.value,o=pF(t.value);e?(l(`MOUNT`),u(`enter`),o===`none`&&u(`after-enter`)):o===`none`||o===`undefined`||n.value?.display===`none`?(l(`UNMOUNT`),u(`leave`),u(`after-leave`)):i&&a!==o?(l(`ANIMATION_OUT`),u(`leave`)):(l(`UNMOUNT`),u(`after-leave`))}},{immediate:!0});let d=e=>{if(e.target!==t.value)return;let n=pF(t.value),r=n.includes(CSS.escape(e.animationName)),a=c.value===`mounted`?`enter`:`leave`;if(r&&(u(`after-${a}`),l(`ANIMATION_END`),!i.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,o=s?.setTimeout(()=>{t.value?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}n===`none`&&l(`ANIMATION_END`)},f=e=>{e.target===t.value&&(r.value=pF(t.value))},p=Er(t,(e,t)=>{e?(n.value=getComputedStyle(e),e.addEventListener(`animationstart`,f),e.addEventListener(`animationcancel`,d),e.addEventListener(`animationend`,d)):(l(`ANIMATION_END`),o!==void 0&&s?.clearTimeout(o),t?.removeEventListener(`animationstart`,f),t?.removeEventListener(`animationcancel`,d),t?.removeEventListener(`animationend`,d))},{immediate:!0}),m=Er(c,()=>{let e=pF(t.value);r.value=c.value===`mounted`?e:`none`});return ta(()=>{p(),m(),t.value&&(t.value.removeEventListener(`animationstart`,f),t.value.removeEventListener(`animationcancel`,d),t.value.removeEventListener(`animationend`,d)),o!==void 0&&s?.clearTimeout(o)}),{isPresent:Q(()=>[`mounted`,`unmountSuspended`].includes(c.value))}}function pF(e){return e&&getComputedStyle(e).animationName||`none`}var mF=W({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){let{present:r,forceMount:i}=yn(e),a=V(),{isPresent:o}=fF(r,a);n({present:o});let s=t.default({present:o.value});s=DP(s||[]);let c=Is();if(s&&s?.length>1){let e=c?.parent?.type.name?`<${c.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(e=>` - ${e}`).join(`
|
|
28
|
+
`)].join(`
|
|
29
|
+
`))}return()=>i.value||r.value||o.value?nc(t.default({present:o.value})[0],{ref:e=>{let t=Qu(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),hF=W({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=DP(n.default()),r=e.findIndex(e=>e.type!==ls);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?As(t,i.props):t,o=ws({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),gF=[`area`,`img`,`input`],_F=W({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&gF.includes(r)?()=>nc(r,t):r===`template`?()=>nc(hF,t,{default:n.default}):()=>nc(e.as,t,{default:n.default})}});function vF(){let e=V();return{primitiveElement:e,currentElement:Q(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Qu(e))}}function yF({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function bF({type:e,defaultValue:t,modelValue:n}){return e||yF({type:e,defaultValue:t,modelValue:n})}function xF({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function SF(e,t){let n=Q(()=>bF(e)),r=Cd(e,`modelValue`,t,{defaultValue:xF(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=yb(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(EP(t,e)){let n=t.findIndex(t=>yb(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Q(()=>n.value===`single`)}}var[CF,wF]=SP(`DialogRoot`),TF=W({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Cd(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=V(),a=V(),{modal:o,unmountOnHide:s}=yn(n);return wF({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>G(e.$slots,`default`,{open:H(r),close:()=>r.value=!1})}}),EF=W({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;GP();let n=CF();return(e,r)=>(K(),J(H(_F),As(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>H(n).onOpenChange(!1)}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`type`]))}}),DF=`dismissableLayer.pointerDownOutside`,OF=`dismissableLayer.focusOutside`;function kF(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function AF(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=V(!1),a=V(()=>{});return Cr(o=>{if(!ku||!mn(n))return;let s=async n=>{let o=n.target;if(!(!t?.value||!o)){if(kF(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){wP(DF,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{mn(n)&&(i.value=!0)}}}function jF(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=V(!1);return Cr(a=>{if(!ku||!mn(n))return;let o=async n=>{if(!t?.value)return;await Qn(),await Qn();let r=n.target;!t.value||!r||kF(t.value,r)||n.target&&!i.value&&wP(OF,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{mn(n)&&(i.value=!0)},onBlurCapture:()=>{mn(n)&&(i.value=!1)}}}var MF=W({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=GP(),o=Q(()=>a.value?.ownerDocument??globalThis.document),s=Q(()=>AP.layersRoot),c=Q(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=Q(()=>AP.layersWithOutsidePointerEventsDisabled.size>0),u=Q(()=>{let e=Array.from(s.value),[t]=[...AP.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=AF(async e=>{let t=[...AP.branches].some(t=>t?.contains(e.target));!n.present||!u.value||t||(r(`pointerDownOutside`,e),r(`interactOutside`,e),await Qn(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=jF(e=>{let t=[...AP.branches].some(t=>t?.contains(e.target));!n.present||t||(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return rd(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),Er([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{!e||!n||t&&(AP.layersWithOutsidePointerEventsDisabled.size===0&&(AP.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),AP.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{AP.layersWithOutsidePointerEventsDisabled.delete(e),AP.layersWithOutsidePointerEventsDisabled.size===0&&!TP(AP.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=AP.originalBodyPointerEvents)}))},{immediate:!0}),Er([a,()=>n.present],([e,t],n,r)=>{!e||!t||(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),Cr(e=>{e(()=>{a.value&&(s.value.delete(a.value),AP.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(K(),J(H(_F),{ref:H(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:me({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:H(f).onFocusCapture,onBlurCapture:H(f).onBlurCapture,onPointerdownCapture:H(d).onPointerDownCapture},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),NF=Eu(()=>V([]));function PF(){let e=NF();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=FF(e.value,t),e.value.unshift(t)},remove(t){e.value=FF(e.value,t),e.value[0]?.resume()}}}function FF(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var IF=`focusScope.autoFocusOnMount`,LF=`focusScope.autoFocusOnUnmount`,RF={bubbles:!1,cancelable:!0};function zF(e,{select:t=!1}={}){let n=CP();for(let r of e)if(GF(r,{select:t}),CP()!==n)return!0}function BF(e){let t=VF(e);return[HF(t,e),HF(t.reverse(),e)]}function VF(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function HF(e,t){for(let n of e)if(!UF(n,{upTo:t}))return n}function UF(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function WF(e){return e instanceof HTMLInputElement&&`select`in e}function GF(e,{select:t=!1}={}){if(e&&e.focus){let n=CP();e.focus({preventScroll:!0}),e!==n&&WF(e)&&t&&e.select()}}var KF=W({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},present:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=GP(),o=V(null),s=PF(),c=Yt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Cr(e=>{if(!ku)return;let t=a.value;if(!n.trapped)return;function r(e){if(c.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:GF(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||GF(o.value,{select:!0}))}function s(e){let n=o.value;if(n===null||!e.some(e=>e.removedNodes.length>0))return;let r=CP();r&&t.contains(r)||t.contains(n)||GF(t)}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let l=new MutationObserver(s);t&&l.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),l.disconnect()})});function l(e,t){let n=new CustomEvent(IF,RF),i=e=>r(`mountAutoFocus`,e);e.addEventListener(IF,i),e.dispatchEvent(n),e.removeEventListener(IF,i),n.defaultPrevented||(zF(VF(e),{select:!0}),CP()===t&&GF(e))}Cr(async e=>{let t=a.value;if(await Qn(),!t)return;n.present!==!1&&s.add(c);let i=CP();!t.contains(i)&&n.present!==!1&&l(t,i),e(()=>{let e=new CustomEvent(LF,RF),n=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(LF,n),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||GF(i??document.body,{select:!0}),t.removeEventListener(LF,n),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})}),Er(()=>n.present,async(e,t)=>{if(!ku)return;if(e===!1&&t===!0){s.remove(c);return}if(e!==!0||t!==!1)return;s.add(c),await Qn();let n=a.value;if(!n)return;let r=CP();n.contains(r)||l(n,r)});function u(e){if(!n.loop&&!n.trapped||c.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=CP();if(t&&r){let t=e.currentTarget,[i,a]=BF(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&GF(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&GF(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(K(),J(H(_F),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:u},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),qF=[`Enter`,` `],JF=[`ArrowDown`,`PageUp`,`Home`],YF=[`ArrowUp`,`PageDown`,`End`];[...JF,...YF],[...qF],[...qF];function XF(e){return e?`open`:`closed`}function ZF(e){let t=CP();for(let n of e)if(n===t||(n.focus(),CP()!==t))return}var QF=W({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=CF(),{forwardRef:a,currentElement:o}=GP();return i.titleId||=oF(void 0,`reka-dialog-title`),i.descriptionId||=oF(void 0,`reka-dialog-description`),Zi(()=>{i.contentElement=o,CP()!==document.body&&(i.triggerElement.value=CP())}),(e,t)=>(K(),J(H(KF),{"as-child":``,loop:``,trapped:n.trapFocus,present:n.present,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:U(()=>[X(H(MF),As({id:H(i).contentId,ref:H(a),as:e.as,"as-child":e.asChild,present:n.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":H(i).descriptionId,"aria-labelledby":H(i).titleId,"data-state":H(XF)(H(i).open.value)},e.$attrs,{onDismiss:t[0]||=e=>H(i).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>r(`focusOutside`,e),onInteractOutside:t[3]||=e=>r(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>r(`pointerDownOutside`,e)}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),$F=W({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=CF(),a=BP(r),{forwardRef:o,currentElement:s}=GP();iF(Q(()=>n.present?s.value:void 0));let c=Q(()=>{let{present:e,...t}=n;return t});return Er(()=>n.present,(e,t)=>{!e&&t&&i.triggerElement.value?.focus()}),(e,t)=>(K(),J(QF,As({...c.value,...H(a)},{ref:H(o),present:e.present,"trap-focus":H(i).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),H(i).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),eI=W({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=BP(t);GP();let i=CF(),a=V(!1),o=V(!1),s=Q(()=>{let{present:e,...t}=n;return t});return Er(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(K(),J(QF,As({...s.value,...H(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||H(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;H(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`present`]))}}),tI=W({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=CF(),a=BP(r),{forwardRef:o}=GP();return(e,t)=>(K(),J(H(mF),{present:e.forceMount||H(i).open.value,"force-mount":e.forceMount||!H(i).unmountOnHide.value},{default:U(({present:t})=>[H(i).modal.value?gr((K(),J($F,As({key:0,ref:H(o),present:H(i).unmountOnHide.value||t},{...n,...H(a),...e.$attrs}),{default:U(()=>[G(e.$slots,`default`)]),_:2},1040,[`present`])),[[Uc,H(i).unmountOnHide.value||t]]):gr((K(),J(eI,As({key:1,ref:H(o),present:H(i).unmountOnHide.value||t},{...n,...H(a),...e.$attrs}),{default:U(()=>[G(e.$slots,`default`)]),_:2},1040,[`present`])),[[Uc,H(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),nI=W({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;GP();let n=CF();return(e,r)=>(K(),J(H(_F),As(t,{id:H(n).descriptionId}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`id`]))}}),rI=W({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(e){let t=e,n=CF(),r=IP(t.present);return Er(()=>t.present,e=>r.value=e),GP(),(e,t)=>(K(),J(H(_F),{as:e.as,"as-child":e.asChild,"data-state":H(n).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=su(()=>{},[`left`,`self`,`prevent`])},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),iI=W({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=CF(),{forwardRef:n}=GP();return(e,r)=>H(t)?.modal.value?(K(),J(H(mF),{key:0,present:e.forceMount||H(t).open.value,"force-mount":e.forceMount||!H(t).unmountOnHide.value},{default:U(({present:r})=>[gr(X(rI,As(e.$attrs,{ref:H(n),as:e.as,"as-child":e.asChild,present:H(t).unmountOnHide.value||r}),{default:U(()=>[G(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[Uc,H(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):Z(`v-if`,!0)}}),aI=W({__name:`Teleport`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e,n=OP({}),r=Q(()=>t.to??n.teleportTo?.value??`body`),i=ed();return(e,t)=>H(i)||e.forceMount?(K(),J(Vr,{key:0,to:r.value,disabled:e.disabled,defer:e.defer},[G(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):Z(`v-if`,!0)}}),oI=W({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(K(),J(H(aI),be(Cs(t)),{default:U(()=>[G(e.$slots,`default`)]),_:3},16))}}),sI=W({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=CF();return GP(),(e,r)=>(K(),J(H(_F),As(t,{id:H(n).titleId}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`id`]))}}),cI=W({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=CF(),{forwardRef:r,currentElement:i}=GP();return n.contentId||=oF(void 0,`reka-dialog-content`),Zi(()=>{n.triggerElement.value=i.value}),(e,i)=>(K(),J(H(_F),As(t,{ref:H(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":H(n).open.value||!1,"aria-controls":H(n).open.value?H(n).contentId:void 0,"data-state":H(n).open.value?`open`:`closed`,onClick:H(n).onOpenToggle}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),lI=`data-reka-collection-item`;function uI(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:V(),itemMap:V(new Map)},vr(r,i)):i=yr(r);let a=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${lI}]`)),r=new Map(n.map((e,t)=>[e,t])),a=Array.from(i.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?a:a.filter(e=>e.ref.dataset.disabled!==``)},o=W({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=vF();return Er(a,()=>{i.collectionRef.value=a.value}),()=>nc(hF,{ref:r,...n},t)}}),s=W({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=vF();return Cr(t=>{if(a.value){let n=on(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>nc(hF,{...n,[lI]:``,ref:r},t)}});return{getItems:a,reactiveItems:Q(()=>Array.from(i.itemMap.value.values())),itemMapSize:Q(()=>i.itemMap.value.size),CollectionSlot:o,CollectionItem:s}}var dI=W({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(K(),J(H(_F),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`||e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),fI=W({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=vF();return Er(Q(()=>t.checked??t.value),(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(K(),J(dI,As({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),pI=W({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=Q(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=Q(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(K(),q(ss,null,[Z(` We render single input if it's required `),n.value?(K(),J(fI,As({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(K(!0),q(ss,{key:1},ma(r.value,n=>(K(),J(fI,As({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),mI=`rovingFocusGroup.onEntryFocus`,hI={bubbles:!1,cancelable:!0},gI={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function _I(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function vI(e,t,n){let r=_I(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return gI[r]}function yI(e,t=!1){let n=CP();for(let r of e)if(r===n||(r.focus({preventScroll:t}),CP()!==n))return}function bI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[xI,SI]=SP(`PopperRoot`),CI=W({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=V();return SI({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>G(e.$slots,`default`)}}),wI=W({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=GP(),i=xI();return wr(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(K(),J(H(_F),{ref:H(n),as:e.as,"as-child":e.asChild},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function TI(e){return e!==null}function EI(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=DI(n),u={start:e.dir===`rtl`?`100%`:`0%`,center:`50%`,end:e.dir===`rtl`?`0%`:`100%`}[l],d={start:`0%`,center:`50%`,end:`100%`}[l],f=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+s/2,m=``,h=``;return c===`bottom`?(m=a?u:`${f}px`,h=`${-s}px`):c===`top`?(m=a?u:`${f}px`,h=`${r.floating.height+s}px`):c===`right`?(m=`${-s}px`,h=a?d:`${p}px`):c===`left`&&(m=`${r.floating.width+s}px`,h=a?d:`${p}px`),{data:{x:m,y:h}}}}}function DI(e){let[t,n=`center`]=e.split(`-`);return[t,n]}function OI(){return typeof window<`u`}function kI(e){return MI(e)?(e.nodeName||``).toLowerCase():`#document`}function AI(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jI(e){return((MI(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function MI(e){return OI()?e instanceof Node||e instanceof AI(e).Node:!1}function NI(e){return OI()?e instanceof Element||e instanceof AI(e).Element:!1}function PI(e){return OI()?e instanceof HTMLElement||e instanceof AI(e).HTMLElement:!1}function FI(e){return!OI()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof AI(e).ShadowRoot}function II(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=qI(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function LI(e){return/^(table|td|th)$/.test(kI(e))}function RI(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var zI=/transform|translate|scale|rotate|perspective|filter/,BI=/paint|layout|strict|content/,VI=e=>!!e&&e!==`none`,HI;function UI(e){let t=NI(e)?qI(e):e;return VI(t.transform)||VI(t.translate)||VI(t.scale)||VI(t.rotate)||VI(t.perspective)||!GI()&&(VI(t.backdropFilter)||VI(t.filter))||zI.test(t.willChange||``)||BI.test(t.contain||``)}function WI(e){let t=YI(e);for(;PI(t)&&!KI(t);){if(UI(t))return t;if(RI(t))return null;t=YI(t)}return null}function GI(){return HI??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),HI}function KI(e){return/^(html|body|#document)$/.test(kI(e))}function qI(e){return AI(e).getComputedStyle(e)}function JI(e){return NI(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function YI(e){if(kI(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||FI(e)&&e.host||jI(e);return FI(t)?t.host:t}function XI(e){let t=YI(e);return KI(t)?(e.ownerDocument||e).body:PI(t)&&II(t)?t:XI(t)}function ZI(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=XI(e),i=r===e.ownerDocument?.body,a=AI(r);if(i){let e=QI(a);return t.concat(a,a.visualViewport||[],II(r)?r:[],e&&n?ZI(e):[])}return t.concat(r,ZI(r,[],n))}function QI(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $I(e){let t=qI(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=PI(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Fd(n)!==a||Fd(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function eL(e){return NI(e)?e:e.contextElement}function tL(e){let t=eL(e);if(!PI(t))return Ld(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$I(t),o=(a?Fd(n.width):n.width)/r,s=(a?Fd(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nL=Ld(0);function rL(e){let t=AI(e);return!GI()||!t.visualViewport?nL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iL(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===AI(e)}function aL(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=eL(e),o=Ld(1);t&&(r?NI(r)&&(o=tL(r)):o=tL(e));let s=iL(a,n,r)?rL(a):Ld(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=AI(a),t=NI(r)?AI(r):r,n=e,i=QI(n);for(;i&&t!==n;){let e=tL(i),t=i.getBoundingClientRect(),r=qI(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=AI(i),i=QI(n)}}return of({width:u,height:d,x:c,y:l})}function oL(e,t){let n=JI(e).scrollLeft;return t?t.left+n:aL(jI(e)).left+n}function sL(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-oL(e,n),y:n.top+t.scrollTop}}function cL(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=jI(r),s=t?RI(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ld(1),u=Ld(0),d=PI(r);if((d||!a)&&((kI(r)!==`body`||II(o))&&(c=JI(r)),d)){let e=aL(r);l=tL(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?sL(o,c):Ld(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function lL(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function uL(e){let t=JI(e),n=e.ownerDocument.body,r=Pd(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Pd(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+oL(e),o=-t.scrollTop;return qI(n).direction===`rtl`&&(a+=Pd(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var dL=25;function fL(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=AI(e),a=jI(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!GI()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(oL(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=dL&&(s-=o)}return{width:s,height:c,x:l,y:u}}function pL(e,t){let n=aL(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=tL(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mL(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=fL(e,n,t);else if(t===`document`)r=uL(jI(e));else if(NI(t))r=pL(t,n);else{let n=rL(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return of(r)}function hL(e,t){let n=t.get(e);if(n)return n;let r=ZI(e,[],!1).filter(e=>NI(e)&&kI(e)!==`body`),i=null,a=qI(e).position===`fixed`,o=a?YI(e):e;for(;NI(o)&&!KI(o);){let e=qI(o),t=UI(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=YI(o)}return t.set(e,r),r}function gL(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?RI(t)?[]:hL(t,this._c):[].concat(n),r],o=mL(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=mL(t,a[e],i);s=Pd(n.top,s),c=Nd(n.right,c),l=Nd(n.bottom,l),u=Pd(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function _L(e){let{width:t,height:n}=$I(e);return{width:t,height:n}}function vL(e,t,n){let r=PI(t),i=jI(t),a=n===`fixed`,o=aL(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ld(0);if((r||!a)&&((kI(t)!==`body`||II(i))&&(s=JI(t)),r)){let e=aL(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=oL(i));let l=i&&!r&&!a?sL(i,s):Ld(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function yL(e){return qI(e).position===`static`}function bL(e,t){if(!PI(e)||qI(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return jI(e)===n&&(n=n.ownerDocument.body),n}function xL(e,t){let n=AI(e);if(RI(e))return n;if(!PI(e)){let t=YI(e);for(;t&&!KI(t);){if(NI(t)&&!yL(t))return t;t=YI(t)}return n}let r=bL(e,t);for(;r&&LI(r)&&yL(r);)r=bL(r,t);return r&&KI(r)&&yL(r)&&!UI(r)?n:r||WI(e)||n}var SL=async function(e){let t=this.getOffsetParent||xL,n=this.getDimensions,r=await n(e.floating);return{reference:vL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function CL(e){return qI(e).direction===`rtl`}var wL={convertOffsetParentRelativeRectToViewportRelativeRect:cL,getDocumentElement:jI,getClippingRect:gL,getOffsetParent:xL,getElementRects:SL,getClientRects:lL,getDimensions:_L,getScale:tL,isElement:NI,isRTL:CL};function TL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function EL(e,t,n){let r=null,i,a=jI(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Id(d),h=Id(a.clientWidth-(u+f)),g=Id(a.clientHeight-(d+p)),_=Id(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Pd(0,Nd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!TL(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=AI(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function DL(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=eL(e),u=i||a?[...l?ZI(l):[],...t?ZI(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?EL(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?aL(e):null;c&&g();function g(){let t=aL(e);h&&!TL(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var OL=bf,kL=xf,AL=mf,jL=Cf,ML=_f,NL=df,PL=Sf,FL=(e,t,n)=>{let r=new Map,i=n??{},a={...wL,...i.platform,_c:r};return uf(e,t,{...i,platform:a})};function IL(e){return typeof e==`object`&&!!e&&`$el`in e}function LL(e){if(IL(e)){let t=e.$el;return MI(t)&&kI(t)===`#comment`?null:t}return e}function RL(e){return typeof e==`function`?e():H(e)}function zL(e){return{name:`arrow`,options:e,fn(t){let n=LL(RL(e.element));return n==null?{}:NL({element:n,padding:e.padding}).fn(t)}}}function BL(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VL(e,t){let n=BL(e);return Math.round(t*n)/n}function HL(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=Q(()=>RL(n.open)??!0),a=Q(()=>RL(n.middleware)),o=Q(()=>RL(n.placement)??`bottom`),s=Q(()=>RL(n.strategy)??`absolute`),c=Q(()=>RL(n.transform)??!0),l=Q(()=>LL(e.value)),u=Q(()=>LL(t.value)),d=V(0),f=V(0),p=V(s.value),m=V(o.value),h=un({}),g=V(!1),_=Q(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=VL(u.value,d.value),n=VL(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...BL(u.value)>=1.5&&{willChange:`transform`}}:{position:p.value,left:t+`px`,top:n+`px`}}),v;function y(){if(l.value==null||u.value==null)return;let e=i.value;FL(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,f.value=t.y,p.value=t.strategy,m.value=t.placement,h.value=t.middlewareData,g.value=e!==!1})}function b(){typeof v==`function`&&(v(),v=void 0)}function x(){if(b(),r===void 0){y();return}if(l.value!=null&&u.value!=null){v=r(l.value,u.value,y);return}}function S(){i.value||(g.value=!1)}return Er([a,o,s,i],y,{flush:`sync`}),Er([l,u],x,{flush:`sync`}),Er(i,S,{flush:`sync`}),Fe()&&Ie(b),{x:Qt(d),y:Qt(f),strategy:Qt(p),placement:Qt(m),middlewareData:Qt(h),isPositioned:Qt(g),floatingStyles:_,update:y}}var UL=[`dir`],WL={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[GL,KL]=SP(`PopperContent`),qL=W({inheritAttrs:!1,__name:`PopperContent`,props:Pa({memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...WL}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=xI(),{forwardRef:a,currentElement:o}=GP(),s=zP(Q(()=>n.dir)),c=V(),l=V(),{width:u,height:d}=sF(l),f=Q(()=>n.side+(n.align===`center`?``:`-${n.align}`)),p=Q(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),m=Q(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=Q(()=>({padding:p.value,boundary:m.value.filter(TI),altBoundary:m.value.length>0})),g=Q(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=Q(()=>[OL({mainAxis:n.sideOffset+d.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&AL({...h.value,...g.value}),n.avoidCollisions&&kL({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?PL():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&AL({...h.value,...g.value}),jL({...h.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),l.value&&zL({element:l.value,padding:n.arrowPadding}),EI({arrowWidth:u.value,arrowHeight:d.value,dir:s.value}),n.hideWhenDetached&&ML({strategy:`referenceHidden`,...h.value})]),{floatingStyles:v,placement:y,isPositioned:b,middlewareData:x,update:S}=HL(Q(()=>n.reference??i.anchor.value),c,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...e)=>DL(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:_}),C=Q(()=>DI(y.value)[0]),w=Q(()=>DI(y.value)[1]);wr(()=>{b.value&&r(`placed`)});let T=Q(()=>{let e=x.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),E=V(``);return Cr(()=>{o.value&&(E.value=window.getComputedStyle(o.value).zIndex)}),KL({placedSide:C,onArrowChange:e=>l.value=e,arrowX:Q(()=>x.value.arrow?.x??0),arrowY:Q(()=>x.value.arrow?.y??0),shouldHideArrow:T}),(e,t)=>(K(),q(`div`,{ref_key:`floatingRef`,ref:c,"data-reka-popper-content-wrapper":``,dir:H(s),style:me({...H(v),transform:H(b)?H(v).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:E.value,"--reka-popper-transform-origin":[H(x).transformOrigin?.x,H(x).transformOrigin?.y].join(` `),...H(x).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[n.memoDependencies?ic([n.asChild,n.as,C.value,w.value,H(b),...Object.values(e.$attrs),...n.memoDependencies],()=>(K(),J(H(_F),As({key:0,ref:H(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,style:{animation:H(b)?void 0:`none`}}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])),t,0):(K(),J(H(_F),As({key:1,ref:H(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,dir:H(s),style:{animation:H(b)?void 0:`none`}}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`dir`,`style`]))],12,UL))}});function JL(e){let t=OP({nonce:V()});return Q(()=>e?.value||t.nonce?.value)}var[YL,XL]=SP(`RovingFocusGroup`),ZL=W({__name:`RovingFocusGroup`,props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:t,emit:n}){let r=e,i=n,{loop:a,orientation:o,dir:s}=yn(r),c=zP(s),l=Cd(r,`currentTabStopId`,i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),u=V(!1),d=V(!1),f=V(0),{getItems:p,CollectionSlot:m}=uI({isProvider:!0});function h(e){let t=!d.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!u.value){let t=new CustomEvent(mI,hI);if(e.currentTarget.dispatchEvent(t),i(`entryFocus`,t),!t.defaultPrevented){let e=p().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);yI([e.find(e=>e.getAttribute(`data-active`)===``),e.find(e=>e.getAttribute(`data-highlighted`)===``),e.find(e=>e.id===l.value),...e].filter(Boolean),r.preventScrollOnEntryFocus)}}d.value=!1}function g(){setTimeout(()=>{d.value=!1},1)}return t({getItems:p}),XL({loop:a,dir:c,orientation:o,currentTabStopId:l,onItemFocus:e=>{l.value=e},onItemShiftTab:()=>{u.value=!0},onFocusableItemAdd:()=>{f.value++},onFocusableItemRemove:()=>{f.value--}}),(e,t)=>(K(),J(H(m),null,{default:U(()=>[X(H(_F),{tabindex:u.value||f.value===0?-1:0,"data-orientation":H(o),as:e.as,"as-child":e.asChild,dir:H(c),style:{outline:`none`},onMousedown:t[0]||=e=>d.value=!0,onMouseup:g,onFocus:h,onBlur:t[1]||=e=>u.value=!1},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),QL=W({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=YL(),r=oF(),i=Q(()=>t.tabStopId||r),a=Q(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=uI();Zi(()=>{t.focusable&&n.onFocusableItemAdd()}),ta(()=>{t.focusable&&n.onFocusableItemRemove()}),Er(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=vI(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?bI(i,t+1):i.slice(t+1)}Qn(()=>yI(i))}}return(e,t)=>(K(),J(H(s),null,{default:U(()=>[X(H(_F),{tabindex:a.value?0:-1,"data-orientation":H(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?H(n).onItemFocus(i.value):t.preventDefault()},onFocus:t[1]||=e=>H(n).onItemFocus(i.value),onKeydown:c},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[$L,eR]=SP(`CheckboxGroupRoot`);function tR(e){return e===`indeterminate`}function nR(e){return tR(e)?`indeterminate`:e?`checked`:`unchecked`}var[rR,iR]=SP(`CheckboxRoot`),aR=W({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=GP(),o=$L(null),s=Cd(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),c=Q(()=>o?.disabled.value||n.disabled),l=Q(()=>yb(s.value,n.trueValue)),u=Q(()=>TP(o?.modelValue.value)?s.value===`indeterminate`?`indeterminate`:l.value:EP(o.modelValue.value,n.value));function d(){if(TP(o?.modelValue.value))s.value===`indeterminate`?s.value=n.trueValue:s.value=l.value?n.falseValue:n.trueValue;else{let e=[...o.modelValue.value||[]];if(EP(e,n.value)){let t=e.findIndex(e=>yb(e,n.value));e.splice(t,1)}else e.push(n.value);o.modelValue.value=e}}let f=WP(a),p=JP(),m=ja(),h=Q(()=>{if(!m[`aria-label`])return n.id&&a.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0});return iR({disabled:c,state:u}),(e,t)=>(K(),q(ss,null,[(K(),J(ua(H(o)?.rovingFocus.value?H(QL):H(_F)),As({...e.$attrs,...H(p)},{id:e.id,ref:H(i),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":H(tR)(u.value)?`mixed`:u.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||h.value,"data-state":H(nR)(u.value),"data-disabled":c.value?``:void 0,disabled:c.value,focusable:H(o)?.rovingFocus.value?!c.value:void 0,onKeydown:lu(su(()=>{},[`prevent`]),[`enter`]),onClick:d}),{default:U(()=>[G(e.$slots,`default`,{modelValue:H(s),state:u.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),H(f)&&e.name&&!H(o)?(K(),J(H(pI),As({key:0,type:`checkbox`,checked:!!u.value,name:e.name,value:e.value,disabled:c.value,required:e.required},H(p)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):Z(`v-if`,!0)],64))}}),oR=W({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=GP(),n=rR();return(e,r)=>(K(),J(H(mF),{present:e.forceMount||H(tR)(H(n).state.value)||H(n).state.value===!0},{default:U(()=>[X(H(_F),As({ref:H(t),"data-state":H(nR)(H(n).state.value),"data-disabled":H(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),sR=[` `,`Enter`,`ArrowUp`,`ArrowDown`],cR=[` `,`Enter`];function lR(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>uR(e,t,n)):uR(e,t,n)}function uR(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:yb(e,t)}function dR(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var fR=[`value`],[pR,mR]=SP(`SelectRoot`),hR=W({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},nullableValue:{type:String,required:!1,default:``},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{required:i,disabled:a,multiple:o,dir:s}=yn(n),c=Cd(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=Cd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),u=V(),d=V(),f=V({x:0,y:0}),p=Q(()=>o.value&&Array.isArray(c.value)?c.value?.length===0:TP(c.value));uI({isProvider:!0});let m=zP(s),h=WP(u),g=V(new Set),_=Q(()=>Array.from(g.value).map(e=>e.value).join(`;`));function v(e){if(o.value){let t=Array.isArray(c.value)?[...c.value]:[],r=t.findIndex(t=>uR(t,e,n.by));r===-1?t.push(e):t.splice(r,1),c.value=[...t]}else c.value=e}function y(e){return Array.from(g.value).find(t=>lR(e,t.value,n.by))}return mR({triggerElement:u,onTriggerChange:e=>{u.value=e},valueElement:d,onValueElementChange:e=>{d.value=e},contentId:``,modelValue:c,onValueChange:v,by:n.by,open:l,multiple:o,required:i,onOpenChange:e=>{l.value=e},dir:m,triggerPointerDownPosRef:f,disabled:a,isEmptyModelValue:p,optionsSet:g,onOptionAdd:e=>{let t=y(e.value);t&&g.value.delete(t),g.value.add(e)},onOptionRemove:e=>{let t=y(e.value);t&&g.value.delete(t)}}),(e,t)=>(K(),J(H(CI),null,{default:U(()=>[G(e.$slots,`default`,{modelValue:H(c),open:H(l)}),H(h)&&e.name?(K(),J(gR,{key:_.value,"aria-hidden":`true`,tabindex:`-1`,multiple:H(o),required:H(i),name:e.name,autocomplete:e.autocomplete,disabled:H(a),value:H(c)},{default:U(()=>[H(TP)(H(c))?(K(),q(`option`,{key:0,value:e.nullableValue},null,8,fR)):Z(`v-if`,!0),(K(!0),q(ss,null,ma(Array.from(g.value),e=>(K(),q(`option`,As({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):Z(`v-if`,!0)]),_:3}))}}),gR=W({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=V(),r=pR();Er(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(e!==t&&i&&n.value){let t=new Event(`change`,{bubbles:!0});i.call(n.value,e),n.value.dispatchEvent(t)}});function i(e){r.onValueChange(e.target.value)}return(e,r)=>(K(),J(H(dI),{"as-child":``},{default:U(()=>[Y(`select`,As({ref_key:`selectElement`,ref:n},t,{onInput:i}),[G(e.$slots,`default`)],16)]),_:3}))}}),_R=W({__name:`SelectPopperPosition`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:10},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=KP(e);return(e,n)=>(K(),J(H(qL),As(H(t),{style:{boxSizing:`border-box`,"--reka-select-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-select-content-available-width":`var(--reka-popper-available-width)`,"--reka-select-content-available-height":`var(--reka-popper-available-height)`,"--reka-select-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-select-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16))}}),vR={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[yR,bR]=SP(`SelectContent`),xR=W({__name:`SelectContentImpl`,props:{position:{type:String,required:!1,default:`item-aligned`},bodyLock:{type:Boolean,required:!1,default:!0},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=pR();HP(),IP(n.bodyLock);let{CollectionSlot:a,getItems:o}=uI(),s=V();iF(s);let{search:c,handleTypeaheadSearch:l}=lF(),u=V(),d=V(),f=V(),p=V(!1),m=V(!1),h=V(!1);function g(){d.value&&s.value&&ZF([d.value,s.value])}Er(p,()=>{g()});let{onOpenChange:_,triggerPointerDownPosRef:v}=i;Cr(e=>{if(!s.value)return;let t={x:0,y:0},n=e=>{t={x:Math.abs(Math.round(e.pageX)-(v.value?.x??0)),y:Math.abs(Math.round(e.pageY)-(v.value?.y??0))}},r=e=>{e.pointerType!==`touch`&&(t.x<=10&&t.y<=10?e.preventDefault():s.value?.contains(e.target)||_(!1),document.removeEventListener(`pointermove`,n),v.value=null)};v.value!==null&&(document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,r,{capture:!0,once:!0})),e(()=>{document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,r,{capture:!0})})});function y(e){let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&l(e.key,o()),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=[...o().map(e=>e.ref)];if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ZF(t)),e.preventDefault()}}let b=KP(Q(()=>n.position===`popper`?n:{}).value);return bR({content:s,viewport:u,onViewportChange:e=>{u.value=e},itemRefCallback:(e,t,n)=>{let r=!m.value&&!n,a=lR(i.modelValue.value,t,i.by);if(i.multiple.value){if(h.value)return;(a||r)&&(d.value=e,a&&(h.value=!0))}else(a||r)&&(d.value=e);r&&(m.value=!0)},selectedItem:d,selectedItemText:f,onItemLeave:()=>{s.value?.focus()},itemTextRefCallback:(e,t,n)=>{let r=!m.value&&!n;(lR(i.modelValue.value,t,i.by)||r)&&(f.value=e)},focusSelectedItem:g,position:n.position,isPositioned:p,searchRef:c}),(e,t)=>(K(),J(H(a),null,{default:U(()=>[X(H(KF),{"as-child":``,onMountAutoFocus:t[6]||=su(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{r(`closeAutoFocus`,e),!e.defaultPrevented&&(H(i).triggerElement.value?.focus({preventScroll:!0}),e.preventDefault())}},{default:U(()=>[X(H(MF),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onFocusOutside:t[2]||=su(()=>{},[`prevent`]),onDismiss:t[3]||=e=>H(i).onOpenChange(!1),onEscapeKeyDown:t[4]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[5]||=e=>r(`pointerDownOutside`,e)},{default:U(()=>[(K(),J(ua(e.position===`popper`?_R:wR),As({...e.$attrs,...H(b)},{id:H(i).contentId,ref:e=>{if(!e)return;let t=H(Qu)(e);t?.hasAttribute(`data-reka-popper-content-wrapper`)?s.value=t.firstElementChild:s.value=t},role:`listbox`,"data-state":H(i).open.value?`open`:`closed`,dir:H(i).dir.value,style:{display:`flex`,flexDirection:`column`,outline:`none`},onContextmenu:t[0]||=su(()=>{},[`prevent`]),onPlaced:t[1]||=e=>p.value=!0,onKeydown:y}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`onKeydown`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3})]),_:3}))}}),[SR,CR]=SP(`SelectItemAlignedPosition`),wR=W({inheritAttrs:!1,__name:`SelectItemAlignedPosition`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,{getItems:i}=uI(),a=pR(),o=yR(),s=V(!1),c=V(!0),l=V(),{forwardRef:u,currentElement:d}=GP(),{viewport:f,selectedItem:p,selectedItemText:m,focusSelectedItem:h}=o;function g(){if(a.triggerElement.value&&a.valueElement.value&&l.value&&d.value&&f?.value&&p?.value&&m?.value){let e=a.triggerElement.value.getBoundingClientRect(),t=d.value.getBoundingClientRect(),n=a.valueElement.value.getBoundingClientRect(),o=m.value.getBoundingClientRect();if(a.dir.value!==`rtl`){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=xP(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.left=`${d}px`}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=xP(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.right=`${d}px`}let c=i().map(e=>e.ref),u=window.innerHeight-20,h=f.value.scrollHeight,g=window.getComputedStyle(d.value),_=Number.parseInt(g.borderTopWidth,10),v=Number.parseInt(g.paddingTop,10),y=Number.parseInt(g.borderBottomWidth,10),b=Number.parseInt(g.paddingBottom,10),x=_+v+h+b+y,S=Math.min(p.value.offsetHeight*5,x),C=window.getComputedStyle(f.value),w=Number.parseInt(C.paddingTop,10),T=Number.parseInt(C.paddingBottom,10),E=e.top+e.height/2-10,D=u-E,O=p.value.offsetHeight/2,k=p.value.offsetTop+O,A=_+v+k,ee=x-A;if(A<=E){let e=p.value===c.at(-1);l.value.style.bottom=`0px`;let t=d.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);l.value.style.height=`${n}px`}else{let e=p.value===c[0];l.value.style.top=`0px`;let t=Math.max(E,_+f.value.offsetTop+(e?w:0)+O)+ee;l.value.style.height=`${t}px`,f.value.scrollTop=A-E+f.value.offsetTop}l.value.style.margin=`10px 0`,l.value.style.minHeight=`${S}px`,l.value.style.maxHeight=`${u}px`,r(`placed`),requestAnimationFrame(()=>s.value=!0)}}let _=V(``);Zi(async()=>{await Qn(),g(),d.value&&(_.value=window.getComputedStyle(d.value).zIndex)});function v(e){e&&c.value===!0&&(g(),h?.(),c.value=!1)}return xd(a.triggerElement,()=>{g()}),CR({contentWrapper:l,shouldExpandOnScrollRef:s,onScrollButtonChange:v}),(e,t)=>(K(),q(`div`,{ref_key:`contentWrapperElement`,ref:l,style:me({display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:_.value})},[X(H(_F),As({ref:H(u),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16)],4))}}),TR=W({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{type:Object,required:!0}},setup(e){return mR(e.context),bR(vR),(e,t)=>G(e.$slots,`default`)}}),ER={key:1},DR=W({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=qP(n,t),i=pR(),a=V();Zi(()=>{a.value=new DocumentFragment});let o=V(),s=Q(()=>n.forceMount||i.open.value),c=V(s.value),l;function u(){l&&=(clearTimeout(l),void 0)}return Er(s,(e,t,n)=>{u(),l=setTimeout(()=>{c.value=s.value,l=void 0}),n(u)}),ta(u),(e,t)=>s.value||c.value||o.value?.present?(K(),J(H(mF),{key:0,ref_key:`presenceRef`,ref:o,present:s.value},{default:U(()=>[X(xR,be(Cs({...H(r),...e.$attrs})),{default:U(()=>[G(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`])):a.value?(K(),q(`div`,ER,[(K(),J(Vr,{to:a.value},[X(TR,{context:H(i)},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`context`])],8,[`to`]))])):Z(`v-if`,!0)}}),OR=W({__name:`SelectIcon`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(K(),J(H(_F),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:U(()=>[G(e.$slots,`default`,{},()=>[t[0]||=Ts(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),[kR,AR]=SP(`SelectItem`),jR=W({__name:`SelectItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=yn(n),a=pR(),o=yR(),{forwardRef:s,currentElement:c}=GP(),{CollectionItem:l}=uI(),u=Q(()=>lR(a.modelValue?.value,n.value,a.by)),d=V(!1),f=V(n.textValue??``),p=oF(void 0,`reka-select-item-text`);async function m(e){e.defaultPrevented||wP(`select.select`,h,{originalEvent:e,value:n.value})}async function h(e){await Qn(),r(`select`,e),!e.defaultPrevented&&(i.value||(a.onValueChange(n.value),a.multiple.value||a.onOpenChange(!1)))}async function g(e){await Qn(),!e.defaultPrevented&&(i.value?o.onItemLeave?.():e.currentTarget?.focus({preventScroll:!0}))}async function _(e){await Qn(),!e.defaultPrevented&&e.currentTarget===CP()&&o.onItemLeave?.()}async function v(e){await Qn(),!e.defaultPrevented&&(o.searchRef?.value===``||e.key!==` `)&&(cR.includes(e.key)&&m(e),e.key===` `&&e.preventDefault())}if(n.value===``)throw Error(`A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return Zi(()=>{c.value&&o.itemRefCallback(c.value,n.value,n.disabled)}),AR({value:n.value,disabled:i,textId:p,isSelected:u,onItemTextChange:e=>{f.value=((f.value||e?.textContent)??``).trim()}}),(e,t)=>(K(),J(H(l),{value:{textValue:f.value}},{default:U(()=>[X(H(_F),{ref:H(s),role:`option`,"aria-labelledby":H(p),"data-highlighted":d.value?``:void 0,"aria-selected":u.value,"data-state":u.value?`checked`:`unchecked`,"aria-disabled":H(i)||void 0,"data-disabled":H(i)?``:void 0,tabindex:H(i)?void 0:-1,as:e.as,"as-child":e.asChild,onFocus:t[0]||=e=>d.value=!0,onBlur:t[1]||=e=>d.value=!1,onPointerup:m,onPointerdown:t[2]||=e=>{e.currentTarget.focus({preventScroll:!0})},onTouchend:t[3]||=su(()=>{},[`prevent`,`stop`]),onPointermove:g,onPointerleave:_,onKeydown:v},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`tabindex`,`as`,`as-child`])]),_:3},8,[`value`]))}}),MR=W({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=kR();return(e,r)=>H(n).isSelected.value?(K(),J(H(_F),As({key:0,"aria-hidden":`true`},t),{default:U(()=>[G(e.$slots,`default`)]),_:3},16)):Z(`v-if`,!0)}}),NR=W({__name:`SelectPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(K(),J(H(aI),be(Cs(t)),{default:U(()=>[G(e.$slots,`default`)]),_:3},16))}}),PR=W({__name:`SelectTrigger`,props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=pR(),{forwardRef:r,currentElement:i}=GP(),a=Q(()=>n.disabled?.value||t.disabled);n.contentId||=oF(void 0,`reka-select-content`),Zi(()=>{n.onTriggerChange(i.value)});let{getItems:o}=uI(),{search:s,handleTypeaheadSearch:c,resetTypeahead:l}=lF();function u(){a.value||(n.onOpenChange(!0),l())}function d(e){u(),n.triggerPointerDownPosRef.value={x:Math.round(e.pageX),y:Math.round(e.pageY)}}function f(e){return e.button===0&&e.ctrlKey===!1}let p=!1;function m(e){if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),f(e)&&(d(e),p=!0)}function h(e){f(e)&&e.preventDefault()}function g(e){p||e.currentTarget?.focus(),p=!1}return(e,t)=>(K(),J(H(wI),{"as-child":``,reference:e.reference},{default:U(()=>[X(H(_F),{ref:H(r),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":H(n).open.value?H(n).contentId:void 0,"aria-expanded":H(n).open.value||!1,"aria-required":H(n).required?.value,"aria-autocomplete":`none`,disabled:a.value,dir:H(n)?.dir.value,"data-state":H(n)?.open.value?`open`:`closed`,"data-disabled":a.value?``:void 0,"data-placeholder":H(dR)(H(n).modelValue?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:g,onPointerdown:m,onMousedown:h,onPointerup:t[0]||=su(e=>{e.pointerType===`touch`&&d(e)},[`prevent`]),onKeydown:t[1]||=e=>{let t=H(s)!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&t&&e.key===` `||(H(c)(e.key,H(o)()),H(sR).includes(e.key)&&(u(),e.preventDefault()))}},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`type`,`aria-controls`,`aria-expanded`,`aria-required`,`disabled`,`dir`,`data-state`,`data-disabled`,`data-placeholder`,`as-child`,`as`])]),_:3},8,[`reference`]))}}),FR=W({__name:`SelectViewport`,props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{nonce:n}=yn(t),r=JL(n),i=yR(),a=i.position===`item-aligned`?SR():void 0,{forwardRef:o,currentElement:s}=GP();Zi(()=>{i?.onViewportChange(s.value)});let c=V(0);function l(e){let t=e.currentTarget,{shouldExpandOnScrollRef:n,contentWrapper:r}=a??{};if(n?.value&&r?.value){let e=Math.abs(c.value-t.scrollTop);if(e>0){let n=window.innerHeight-20,i=Number.parseFloat(r.value.style.minHeight),a=Number.parseFloat(r.value.style.height),o=Math.max(i,a);if(o<n){let i=o+e,a=Math.min(n,i),s=i-a;r.value.style.height=`${a}px`,r.value.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,r.value.style.justifyContent=`flex-end`)}}}c.value=t.scrollTop}return(e,n)=>(K(),q(ss,null,[X(H(_F),As({ref:H(o),"data-reka-select-viewport":``,role:`presentation`},{...e.$attrs,...t},{style:{position:`relative`,flex:1,overflow:`hidden auto`},onScroll:l}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16),X(H(_F),{as:`style`,nonce:H(r)},{default:U(()=>n[0]||=[Ts(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } `)]),_:1,__:[0]},8,[`nonce`])],64))}}),[IR,LR]=SP(`ToggleGroupRoot`),RR=W({__name:`ToggleGroupRoot`,props:{rovingFocus:{type:Boolean,required:!1,default:!0},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{loop:i,rovingFocus:a,disabled:o,dir:s}=yn(n),c=zP(s),{forwardRef:l,currentElement:u}=GP(),{modelValue:d,changeModelValue:f,isSingle:p}=SF(n,r),m=WP(u);return LR({isSingle:p,modelValue:d,changeModelValue:f,dir:c,orientation:n.orientation,loop:i,rovingFocus:a,disabled:o}),(e,t)=>(K(),J(ua(H(a)?H(ZL):H(_F)),{"as-child":``,orientation:H(a)?e.orientation:void 0,dir:H(c),loop:H(a)?H(i):void 0},{default:U(()=>[X(H(_F),{ref:H(l),role:`group`,"as-child":e.asChild,as:e.as},{default:U(()=>[G(e.$slots,`default`,{modelValue:H(d)}),H(m)&&e.name?(K(),J(pI,{key:0,name:e.name,required:e.required,value:H(d)},null,8,[`name`,`required`,`value`])):Z(`v-if`,!0)]),_:3},8,[`as-child`,`as`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),zR=W({inheritAttrs:!1,__name:`Toggle`,props:{defaultValue:{type:Boolean,required:!1},modelValue:{type:[Boolean,null],required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=GP(),o=JP(),s=IR(null),c=Cd(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function l(){c.value=!c.value}let u=Q(()=>c.value?`on`:`off`),d=WP(a);return(e,t)=>(K(),q(ss,null,[X(H(_F),As({ref:H(i),type:e.as===`button`?`button`:void 0,"as-child":n.asChild,as:e.as,"aria-pressed":H(c),"data-state":u.value,"data-disabled":e.disabled?``:void 0,disabled:e.disabled},{...H(o),...e.$attrs},{onClick:l}),{default:U(()=>[G(e.$slots,`default`,{modelValue:H(c),disabled:e.disabled,pressed:H(c),state:u.value})]),_:3},16,[`type`,`as-child`,`as`,`aria-pressed`,`data-state`,`data-disabled`,`disabled`]),H(d)&&e.name&&!H(s)?(K(),J(pI,As({key:0,type:`checkbox`,name:e.name,value:H(c),required:e.required},H(o)),null,16,[`name`,`value`,`required`])):Z(`v-if`,!0)],64))}}),BR=W({__name:`ToggleGroupItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=IR(),r=Q(()=>n.disabled?.value||t.disabled),i=Q(()=>EP(n.modelValue.value,t.value)),{forwardRef:a}=GP(),o=JP();return(e,s)=>(K(),J(ua(H(n).rovingFocus.value?H(QL):H(_F)),As({"as-child":``},H(n).rovingFocus.value?{focusable:!r.value,active:i.value}:{}),{default:U(()=>[X(H(zR),As({...H(o),...t},{ref:H(a),disabled:r.value,"model-value":i.value,"onUpdate:modelValue":s[0]||=t=>H(n).changeModelValue(e.value)}),{default:U(t=>[G(e.$slots,`default`,be(Cs(t)))]),_:3},16,[`disabled`,`model-value`])]),_:3},16))}}),VR={class:`inline-flex items-center gap-2 min-w-0`},HR={class:`truncate font-semibold text-primary`},UR={class:`flex flex-col min-w-0 flex-1 of-hidden`},WR={class:`flex items-center gap-1.5`},GR={class:`truncate font-medium`},KR={key:0,class:`shrink-0 text-10px op-fade border border-base rounded px-1`},qR={key:0,class:`text-11px color-faint truncate`},JR=`i-ph:database-duotone`,YR=W({__name:`DataSourceSelect`,props:Fa({sources:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=ro(e,`modelValue`),r=Q(()=>t.sources.find(e=>e.id===n.value));function i(e){return e?.icon||JR}return(t,a)=>(K(),J(H(hR),{modelValue:n.value,"onUpdate:modelValue":a[0]||=e=>n.value=e},{default:U(()=>[X(H(PR),{class:`text-sm px-2.5 outline-none border border-base rounded bg-base inline-flex gap-2 h-9 min-w-52 max-w-80 transition items-center justify-between data-[disabled]:op50 focus-visible:ring-2 focus-visible:ring-primary-500/40`},{default:U(()=>[Y(`span`,VR,[X(bP,{icon:i(r.value),class:`shrink-0 w-3.5 h-3.5 color-active [&_svg]:h-full [&_svg]:w-full`,"aria-hidden":`true`},null,8,[`icon`]),Y(`span`,HR,ke(r.value?.title??e.placeholder??`Data source`),1)]),X(H(OR),{class:`op-fade shrink-0`},{default:U(()=>[...a[1]||=[Y(`div`,{class:`i-ph:caret-down`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:1}),X(H(NR),null,{default:U(()=>[X(H(DR),{position:`popper`,"side-offset":6,class:`border border-base rounded-lg bg-base min-w-[--reka-select-trigger-width] max-w-100 shadow-lg z-dropdown overflow-hidden`},{default:U(()=>[X(H(FR),{class:`p-1`},{default:U(()=>[(K(!0),q(ss,null,ma(e.sources,e=>(K(),J(H(jR),{key:e.id,value:e.id,class:`text-sm color-base py-1.5 pl-2 pr-2 outline-none rounded-md flex gap-2 cursor-pointer select-none transition items-start relative data-[highlighted]:bg-active`},{default:U(()=>[X(bP,{icon:i(e),class:`shrink-0 mt-0.5 w-3.5 h-3.5 color-active [&_svg]:h-full [&_svg]:w-full`,"aria-hidden":`true`},null,8,[`icon`]),Y(`span`,UR,[Y(`span`,WR,[Y(`span`,GR,ke(e.title),1),e.static?(K(),q(`span`,KR,`static`)):Z(``,!0)]),e.description?(K(),q(`span`,qR,ke(e.description),1)):Z(``,!0)]),X(H(MR),{class:`color-active inline-flex items-center shrink-0 mt-0.5`},{default:U(()=>[...a[2]||=[Y(`span`,{class:`i-ph:check`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1})]),_:1},8,[`modelValue`]))}}),XR={class:`px3 py2 border-b border-base flex flex-col gap-2 shrink-0`},ZR={class:`flex items-center gap-2`},QR=[`title`],$R={key:0,class:`text-xs color-muted`},ez=W({__name:`DataSourcePanel`,setup(e){let t=jM(),n=V(!1);return(e,r)=>(K(),q(`div`,XR,[Y(`div`,ZR,[r[4]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none ws-nowrap`},` Data Source `,-1),X(YR,{modelValue:H(t).sourceId.value,"onUpdate:modelValue":r[0]||=e=>H(t).sourceId.value=e,sources:H(t).sources.value,placeholder:`Data source`},null,8,[`modelValue`,`sources`]),H(t).activeSource.value?.description&&!n.value?(K(),q(`div`,{key:0,class:`text-xs op-fade ws-nowrap of-hidden shrink`,title:H(t).activeSource.value?.description},ke(H(t).activeSource.value?.description),9,QR)):Z(``,!0),r[5]||=Y(`div`,{class:`flex-auto`},null,-1),X(vm,{icon:`i-ph:caret-down`,class:ye([`transition flex-none text-sm`,{"rotate-180":n.value}]),title:n.value?`Hide details`:`Show details`,onClick:r[1]||=e=>n.value=!n.value},null,8,[`class`,`title`])]),H(hT).connected&&!H(t).sources.value.length?(K(),q(`div`,$R,[...r[6]||=[Ts(` No data sources registered yet. Call `,-1),Y(`code`,{class:`font-mono bg-secondary border border-base rounded px-1`},`registerDataSource()`,-1),Ts(` from your plugin or host; `,-1),Y(`a`,{href:`https://devfra.me/plugins/data-inspector#providing-data-sources`,target:`_blank`,class:`color-active hover:underline`},`see the docs`,-1),Ts(`. `,-1)]])):Z(``,!0),n.value?(K(),J(VM,{key:1,source:H(t).activeSource.value,skeleton:H(t).skeleton.value,error:H(t).skeletonError.value,loading:H(t).skeletonLoading.value,onRefresh:r[2]||=e=>H(t).loadSkeleton(),onSelect:r[3]||=e=>H(t).queryProp(e)},null,8,[`source`,`skeleton`,`error`,`loading`])):Z(``,!0)]))}}),tz=W({__name:`FeedbackSpinner`,props:{size:{default:`1em`}},setup(e){let t=e,n=Q(()=>typeof t.size==`number`?`${t.size}px`:t.size);return(e,t)=>(K(),q(`span`,{class:`border-2 border-current border-t-transparent rounded-full inline-block animate-spin`,style:me({width:n.value,height:n.value}),role:`status`,"aria-label":`Loading`},null,4))}}),nz=W({__name:`ActionButton`,props:{as:{},to:{},href:{},icon:{},variant:{default:`action`},size:{default:`md`},loading:{type:Boolean},disabled:{type:Boolean}},setup(e){let t=e,n=Q(()=>t.as?t.as:t.href!=null||t.to!=null?`a`:`button`),r=Q(()=>n.value===`a`),i=Q(()=>n.value===`button`),a=Q(()=>t.size===`sm`),o=Q(()=>t.variant===`primary`?a.value?`btn-primary text-sm`:`btn-primary`:t.variant===`text`?a.value?`btn-text text-sm`:`btn-text`:a.value?`btn-action-sm`:`btn-action`),s=Q(()=>t.disabled||t.loading);return(t,a)=>(K(),J(ua(n.value),{class:ye([o.value,{"pointer-events-none op-mute":s.value&&!i.value}]),href:r.value?e.href??e.to:void 0,to:e.as&&e.to!=null?e.to:void 0,disabled:i.value?s.value:void 0,"aria-disabled":s.value||void 0,"aria-busy":e.loading||void 0},{default:U(()=>[e.loading?(K(),J(tz,{key:0,size:`1em`})):e.icon?(K(),q(`span`,{key:1,class:ye(e.icon),"aria-hidden":`true`},null,2)):Z(``,!0),G(t.$slots,`default`)]),_:3},8,[`class`,`href`,`to`,`disabled`,`aria-disabled`,`aria-busy`]))}}),{toString:rz,hasOwnProperty:iz}=Object.prototype,az=e=>rz.call(e),oz=Object.hasOwn||((e,t)=>iz.call(e,t));function $(e,t,n){let r=document.createElement(e);typeof t==`string`&&(t={class:t});for(let e in t)if(oz(t,e)){let n=t[e];if(n===void 0)continue;typeof n==`function`?r.addEventListener(e.slice(2),n):r.setAttribute(e,n)}return Array.isArray(n)?r.append(...n):typeof n==`string`&&(r.innerHTML=n),r}function sz(e){return document.createTextNode(String(e))}function cz(e){return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function lz(...e){let t=document.createDocumentFragment();return e.forEach(e=>t.appendChild(e instanceof Node?e:sz(e))),t}var uz=!(()=>{let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test-passive`,n,t),window.removeEventListener(`test-passive`,n)}catch{}return e})()||Object.freeze({passive:!0,capture:!0}),dz=/\.\d+(?:eE[-+]?\d+)?|\B(?=(?:\d{3})+(?:\D|$))/g;function fz(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function pz(e,t=!0){let n=t&&typeof e!=`number`?fz(String(e)):String(e);return n.length>3?n.replace(dz,e=>e||`<span class="num-delim"></span>`):n}var mz=class{subscriber;value;constructor(e,t){this.subscriber=null,this.value=e,this.shouldUpdate=typeof t==`function`?t:this.shouldUpdate}get readonly(){let e=this;return{subscribe:this.subscribe.bind(this),subscribeSync:this.subscribeSync.bind(this),unsubscribe:this.unsubscribe.bind(this),get value(){return e.value}}}subscribe(e){return this.subscriber={callback:e,subscriber:this.subscriber},()=>this.unsubscribe(e)}subscribeSync(e){let t=this.subscribe(e);return e(this.value,t),t}unsubscribe(e){let t=this,n=this.subscriber;for(;n!==null;){if(n.callback===e){n.callback=null,t.subscriber=n.subscriber;break}t=n,n=n.subscriber}}shouldUpdate(e,t){return e!==t}set(e){return this.#e(e)!==!1}asyncSet(e){let t=this.#e(e);return t===!1?Promise.resolve(!1):Promise.all(t).then(()=>!0)}#e(e){if(!this.shouldUpdate(e,this.value))return!1;let t=[],n=this.subscriber;for(this.value=e;n!==null;){let{callback:r}=n;r!==null&&t.push(r(e,()=>this.unsubscribe(r))),n=n.subscriber}return t}},hz=typeof ResizeObserver==`function`,gz=class extends mz{static supported=hz;el;observer;constructor(){super(null),this.el=null,this.observer=hz?new ResizeObserver(e=>{for(let t of e)this.set(t.contentRect)}):null}observe(e){if(this.observer===null){this.el=null;return}e||=null,this.el!==e&&(this.el!==null&&this.observer.unobserve(this.el),e!==null&&this.observer.observe(e),this.el=e)}dispose(){this.el=null,this.observer=null}},_z=class{listeners;constructor(){this.listeners=Object.create(null)}on(e,t){return this.listeners[e]={callback:t,next:this.listeners[e]||null},this}once(e,t){return this.on(e,function n(...r){t.apply(this,r),this.off(e,n)})}off(e,t){let n=this.listeners[e]||null,r=null;for(;n!==null;){if(n.callback===t){n.callback=null,r?r.next=n.next:this.listeners[e]=n.next;break}r=n,n=n.next}return this}emit(e,...t){let n=this.listeners[e]||null,r=!1;for(;n!==null;)typeof n.callback==`function`&&n.callback.apply(this,t),r=!0,n=n.next;return r}},vz=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.CodeMirror=r())})(e,(function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),c=!a&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),g=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),_=/Android/.test(e),v=g||_||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),S=f&&e.match(/Version\/(\d*\.\d*)/);S&&=Number(S[1]),S&&S>=15&&(f=!1,c=!0);var C=y&&(l||f&&(S==null||S<12.11)),w=n||o&&s>=9;function T(e){return RegExp(`(^|\\s)`+e+`(?:$|\\s)\\s*`)}var E=function(e,t){var n=e.className,r=T(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:``)}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return D(e).appendChild(t)}function k(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t==`string`)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function A(e,t,n,r){var i=k(e,t,n,r);return i.setAttribute(`role`,`presentation`),i}var ee=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd(`character`,n),r.moveStart(`character`,t),r};function j(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function te(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function ne(e,t){var n=e.className;T(t).test(n)||(e.className+=(n?` `:``)+t)}function M(e,t){for(var n=e.split(` `),r=0;r<n.length;r++)n[r]&&!T(n[r]).test(t)&&(t+=` `+n[r]);return t}var re=function(e){e.select()};g?re=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(re=function(e){try{e.select()}catch{}});function ie(e){return e.display.wrapper.ownerDocument}function ae(e){return N(e.display.wrapper)}function N(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function P(e){return ie(e).defaultView}function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t||={},e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function oe(e,t,n,r,i){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var s=e.indexOf(` `,a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}var se=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};se.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},se.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function L(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ce=50,le={toString:function(){return`CodeMirror.Pass`}},ue={scroll:!1},de={origin:`*mouse`},fe={origin:`+move`};function pe(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(` `,r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var me=[``];function he(e){for(;me.length<=e;)me.push(ge(me)+` `);return me[e]}function ge(e){return e[e.length-1]}function _e(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ve(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ye(){}function be(e,t){var n;return Object.create?n=Object.create(e):(ye.prototype=e,n=new ye),t&&I(t,n),n}var xe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Se(e){return/\w/.test(e)||e>``&&(e.toUpperCase()!=e.toLowerCase()||xe.test(e))}function Ce(e,t){return t?t.source.indexOf(`\\w`)>-1&&Se(e)?!0:t.test(e):Se(e)}function we(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Te=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ee(e){return e.charCodeAt(0)>=768&&Te.test(e)}function De(e,t,n){for(;(n<0?t>0:t<e.length)&&Ee(e.charAt(t));)t+=n;return t}function Oe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function ke(e,t,n,r){if(!e)return r(t,n,`ltr`,0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?`rtl`:`ltr`,a),i=!0)}i||r(t,n,`ltr`)}var Ae=null;function je(e,t,n){var r;Ae=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n==`before`?r=i:Ae=i),a.from==t&&(a.from!=a.to&&n!=`before`?r=i:Ae=i)}return r??Ae}var Me=(function(){function e(e){return e<=247?`bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN`.charAt(e):1424<=e&&e<=1524?`R`:1536<=e&&e<=1785?`nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111`.charAt(e-1536):1774<=e&&e<=2220?`r`:8192<=e&&e<=8203?`w`:e==8204?`b`:`L`}var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,r=/[LRr]/,i=/[Lb1n]/,a=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s,c){var l=c==`ltr`?`L`:`R`;if(s.length==0||c==`ltr`&&!t.test(s))return!1;for(var u=s.length,d=[],f=0;f<u;++f)d.push(e(s.charCodeAt(f)));for(var p=0,m=l;p<u;++p){var h=d[p];h==`m`?d[p]=m:m=h}for(var g=0,_=l;g<u;++g){var v=d[g];v==`1`&&_==`r`?d[g]=`n`:r.test(v)&&(_=v,v==`r`&&(d[g]=`R`))}for(var y=1,b=d[0];y<u-1;++y){var x=d[y];x==`+`&&b==`1`&&d[y+1]==`1`?d[y]=`1`:x==`,`&&b==d[y+1]&&(b==`1`||b==`n`)&&(d[y]=b),b=x}for(var S=0;S<u;++S){var C=d[S];if(C==`,`)d[S]=`N`;else if(C==`%`){var w=void 0;for(w=S+1;w<u&&d[w]==`%`;++w);for(var T=S&&d[S-1]==`!`||w<u&&d[w]==`1`?`1`:`N`,E=S;E<w;++E)d[E]=T;S=w-1}}for(var D=0,O=l;D<u;++D){var k=d[D];O==`L`&&k==`1`?d[D]=`L`:r.test(k)&&(O=k)}for(var A=0;A<u;++A)if(n.test(d[A])){var ee=void 0;for(ee=A+1;ee<u&&n.test(d[ee]);++ee);for(var j=(A?d[A-1]:l)==`L`,te=j==((ee<u?d[ee]:l)==`L`)?j?`L`:`R`:l,ne=A;ne<ee;++ne)d[ne]=te;A=ee-1}for(var M=[],re,ie=0;ie<u;)if(i.test(d[ie])){var ae=ie;for(++ie;ie<u&&i.test(d[ie]);++ie);M.push(new o(0,ae,ie))}else{var N=ie,P=M.length,F=+(c==`rtl`);for(++ie;ie<u&&d[ie]!=`L`;++ie);for(var I=N;I<ie;)if(a.test(d[I])){N<I&&(M.splice(P,0,new o(1,N,I)),P+=F);var oe=I;for(++I;I<ie&&a.test(d[I]);++I);M.splice(P,0,new o(2,oe,I)),P+=F,N=I}else++I;N<ie&&M.splice(P,0,new o(1,N,ie))}return c==`ltr`&&(M[0].level==1&&(re=s.match(/^\s+/))&&(M[0].from=re[0].length,M.unshift(new o(0,0,re[0].length))),ge(M).level==1&&(re=s.match(/\s+$/))&&(ge(M).to-=re[0].length,M.push(new o(0,u-re[0].length,u)))),c==`rtl`?M.reverse():M}})();function Ne(e,t){var n=e.order;return n??=e.order=Me(e.text,t),n}var Pe=[],R=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent(`on`+t,n);else{var r=e._handlers||={};r[t]=(r[t]||Pe).concat(n)}};function Fe(e,t){return e._handlers&&e._handlers[t]||Pe}function Ie(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent(`on`+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=L(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Le(e,t){var n=Fe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Re(e,t,n){return typeof t==`string`&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Le(e,n||t.type,e,t),We(t)||t.codemirrorIgnore}function ze(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)L(n,t[r])==-1&&n.push(t[r])}function Be(e,t){return Fe(e,t).length>0}function Ve(e){e.prototype.on=function(e,t){R(this,e,t)},e.prototype.off=function(e,t){Ie(this,e,t)}}function He(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ue(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function We(e){return e.defaultPrevented==null?e.returnValue==0:e.defaultPrevented}function Ge(e){He(e),Ue(e)}function Ke(e){return e.target||e.srcElement}function qe(e){var t=e.which;return t??(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),y&&e.ctrlKey&&t==1&&(t=3),t}var Je=function(){if(o&&s<9)return!1;var e=k(`div`);return`draggable`in e||`dragDrop`in e}(),Ye;function Xe(e){if(Ye==null){var t=k(`span`,``);O(e,k(`span`,[t,document.createTextNode(`x`)])),e.firstChild.offsetHeight!=0&&(Ye=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=Ye?k(`span`,``):k(`span`,`\xA0`,null,`display: inline-block; width: 1px; margin-right: -1px`);return n.setAttribute(`cm-text`,``),n}var Ze;function Qe(e){if(Ze!=null)return Ze;var t=O(e,document.createTextNode(`AخA`)),n=ee(t,0,1).getBoundingClientRect(),r=ee(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:Ze=r.right-n.right<3}var $e=`
|
|
30
|
+
|
|
31
|
+
b`.split(/\n/).length==3?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
32
|
+
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)==`\r`?i-1:i),o=a.indexOf(`\r`);o==-1?(n.push(a),t=i+1):(n.push(a.slice(0,o)),t+=o+1)}return n},et=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints(`StartToEnd`,t)!=0},tt=(function(){var e=k(`div`);return`oncopy`in e||(e.setAttribute(`oncopy`,`return;`),typeof e.oncopy==`function`)})(),nt=null;function rt(e){if(nt!=null)return nt;var t=O(e,k(`span`,`x`)),n=t.getBoundingClientRect(),r=ee(t,0,1).getBoundingClientRect();return nt=Math.abs(n.left-r.left)>1}var it={},at={};function ot(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),it[e]=t}function st(e,t){at[e]=t}function ct(e){if(typeof e==`string`&&at.hasOwnProperty(e))e=at[e];else if(e&&typeof e.name==`string`&&at.hasOwnProperty(e.name)){var t=at[e.name];typeof t==`string`&&(t={name:t}),e=be(t,e),e.name=t.name}else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ct(`application/xml`);else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ct(`application/json`);return typeof e==`string`?{name:e}:e||{name:`null`}}function lt(e,t){t=ct(t);var n=it[t.name];if(!n)return lt(e,`text/plain`);var r=n(e,t);if(ut.hasOwnProperty(t.name)){var i=ut[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r[`_`+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var ut={};function dt(e,t){I(t,ut.hasOwnProperty(e)?ut[e]:ut[e]={})}function ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function pt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function mt(e,t,n){return!e.startState||e.startState(t,n)}var ht=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};ht.prototype.eol=function(){return this.pos>=this.string.length},ht.prototype.sol=function(){return this.pos==this.lineStart},ht.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ht.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ht.prototype.eat=function(e){var t=this.string.charAt(this.pos);if(typeof e==`string`?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},ht.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ht.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ht.prototype.skipToEnd=function(){this.pos=this.string.length},ht.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ht.prototype.backUp=function(e){this.pos-=e},ht.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?oe(this.string,this.lineStart,this.tabSize):0)},ht.prototype.indentation=function(){return oe(this.string,null,this.tabSize)-(this.lineStart?oe(this.string,this.lineStart,this.tabSize):0)},ht.prototype.match=function(e,t,n){if(typeof e==`string`){var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}},ht.prototype.current=function(){return this.string.slice(this.start,this.pos)},ht.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ht.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ht.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function z(e,t){if(t-=e.first,t<0||t>=e.size)throw Error(`There is no line `+(t+e.first)+` in the document.`);for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function gt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var a=e.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function _t(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function vt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function yt(e){if(e.parent==null)return null;for(var t=e.parent,n=L(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function bt(e,t){var n=e.first;outer:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue outer}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o].height;if(t<s)break;t-=s}return n+o}function xt(e,t){return t>=e.first&&t<e.first+e.size}function St(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function B(e,t,n){if(n===void 0&&(n=null),!(this instanceof B))return new B(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function wt(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function Tt(e){return B(e.line,e.ch)}function Et(e,t){return Ct(e,t)<0?t:e}function Dt(e,t){return Ct(e,t)<0?e:t}function Ot(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function kt(e,t){if(t.line<e.first)return B(e.first,0);var n=e.first+e.size-1;return t.line>n?B(n,z(e,n).text.length):At(t,z(e,t.line).text.length)}function At(e,t){var n=e.ch;return n==null||n>t?B(e.line,t):n<0?B(e.line,0):e}function jt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=kt(e,t[r]);return n}var Mt=function(e,t){this.state=e,this.lookAhead=t},Nt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Nt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Nt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,``),size:this.baseTokens[this.baseTokenPos]-e}},Nt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Nt.fromSaved=function(e,t,n){return t instanceof Mt?new Nt(e,ft(e.mode,t.state),n,t.lookAhead):new Nt(e,ft(e.mode,t),n)},Nt.prototype.save=function(e){var t=e===!1?this.state:ft(this.doc.mode,this.state);return this.maxLookAhead>0?new Mt(t,this.maxLookAhead):t};function Pt(e,t,n,r){var i=[e.state.modeGen],a={};Ut(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},a,r);for(var o=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],c=1,l=0;n.state=!0,Ut(e,t.text,s.mode,n,function(e,t){for(var n=c;l<e;){var r=i[c];r>e&&i.splice(c,1,e,i[c+1],r),c+=2,l=Math.min(e,r)}if(t){if(s.opaque)i.splice(n,c-n,e,`overlay `+t),c=n+2;else for(;n<c;n+=2){var a=i[n+1];i[n+1]=(a?a+` `:``)+`overlay `+t}}},a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},c=0;c<e.state.overlays.length;++c)s(c);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Ft(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=It(e,yt(t)),i=t.text.length>e.options.maxHighlightLength&&ft(e.doc.mode,r.state),a=Pt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&=null,n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function It(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Nt(r,!0,t);var a=Wt(e,t,n),o=a>r.first&&z(r,a-1).stateAfter,s=o?Nt.fromSaved(r,o,a):new Nt(r,mt(r.mode),a);return r.iter(a,t,function(n){Lt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function Lt(e,t,n,r){var i=e.doc.mode,a=new ht(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==``&&Rt(i,n.state);!a.eol();)zt(i,a,n.state),a.start=a.pos}function Rt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=pt(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function zt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=pt(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw Error(`Mode `+e.name+` failed to advance stream.`)}var Bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Vt(e,t,n,r){var i=e.doc,a=i.mode,o;t=kt(i,t);var s=z(i,t.line),c=It(e,t.line,n),l=new ht(s.text,e.options.tabSize,c),u;for(r&&(u=[]);(r||l.pos<t.ch)&&!l.eol();)l.start=l.pos,o=zt(a,l,c.state),r&&u.push(new Bt(l,o,ft(i.mode,c.state)));return r?u:new Bt(l,o,c.state)}function Ht(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-background-?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?`bgClass`:`textClass`;t[r]==null?t[r]=n[2]:RegExp(`(?:^|\\s)`+n[2]+`(?:$|\\s)`).test(t[r])||(t[r]+=` `+n[2])}return e}function Ut(e,t,n,r,i,a,o){var s=n.flattenSpans;s??=e.options.flattenSpans;var c=0,l=null,u=new ht(t,e.options.tabSize,r),d,f=e.options.addModeClass&&[null];for(t==``&&Ht(Rt(n,r.state),a);!u.eol();){if(u.pos>e.options.maxHighlightLength?(s=!1,o&&Lt(e,t,r,u.pos),u.pos=t.length,d=null):d=Ht(zt(n,u,r.state,f),a),f){var p=f[0].name;p&&(d=`m-`+(d?p+` `+d:p))}if(!s||l!=d){for(;c<u.start;)c=Math.min(u.start,c+5e3),i(c,l);l=d}u.start=u.pos}for(;c<u.pos;){var m=Math.min(u.pos,c+5e3);i(m,l),c=m}}function Wt(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var c=z(a,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof Mt?l.lookAhead:0)<=a.modeFrontier))return s;var u=oe(c.text,null,e.options.tabSize);(i==null||r>u)&&(i=s-1,r=u)}return i}function Gt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=z(e,r).stateAfter;if(i&&(!(i instanceof Mt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Kt=!1,qt=!1;function Jt(){Kt=!0}function Yt(){qt=!0}function Xt(e,t,n){this.marker=e,this.from=t,this.to=n}function Zt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Qt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||=[]).push(e[r]);return n}function $t(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||=new WeakSet);r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function en(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t)||a.from==t&&o.type==`bookmark`&&(!n||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||=[]).push(new Xt(o,a.from,s?null:a.to))}}return r}function tn(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.to==null||(o.inclusiveRight?a.to>=t:a.to>t)||a.from==t&&o.type==`bookmark`&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||=[]).push(new Xt(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function nn(e,t){if(t.full)return null;var n=xt(e,t.from.line)&&z(e,t.from.line).markedSpans,r=xt(e,t.to.line)&&z(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=Ct(t.from,t.to)==0,s=en(n,i,o),c=tn(r,a,o),l=t.text.length==1,u=ge(t.text).length+(l?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(f.to==null){var p=Zt(c,f.marker);p?l&&(f.to=p.to==null?null:p.to+u):f.to=i}}if(c)for(var m=0;m<c.length;++m){var h=c[m];h.to!=null&&(h.to+=u),h.from==null?Zt(s,h.marker)||(h.from=u,l&&(s||=[]).push(h)):(h.from+=u,l&&(s||=[]).push(h))}s&&=rn(s),c&&c!=s&&(c=rn(c));var g=[s];if(!l){var _=t.text.length-2,v;if(_>0&&s)for(var y=0;y<s.length;++y)s[y].to??(v||=[]).push(new Xt(s[y].marker,null,null));for(var b=0;b<_;++b)g.push(v);g.push(c)}return g}function rn(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function an(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!r||L(r,n)==-1)&&(r||=[]).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],s=o.find(0),c=0;c<i.length;++c){var l=i[c];if(!(Ct(l.to,s.from)<0||Ct(l.from,s.to)>0)){var u=[c,1],d=Ct(l.from,s.from),f=Ct(l.to,s.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:l.from,to:s.from}),(f>0||!o.inclusiveRight&&!f)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}function on(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function sn(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function cn(e){return e.inclusiveLeft?-1:0}function ln(e){return+!!e.inclusiveRight}function V(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=Ct(r.from,i.from)||cn(e)-cn(t);return a?-a:Ct(r.to,i.to)||ln(e)-ln(t)||t.id-e.id}function un(e,t){var n=qt&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||V(r,i.marker)<0)&&(r=i.marker);return r}function dn(e){return un(e,!0)}function fn(e){return un(e,!1)}function pn(e,t){var n=qt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||V(r,a.marker)<0)&&(r=a.marker)}return r}function H(e,t,n,r,i){var a=z(e,t),o=qt&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var c=o[s];if(c.marker.collapsed){var l=c.marker.find(0),u=Ct(l.from,n)||cn(c.marker)-cn(i),d=Ct(l.to,r)||ln(c.marker)-ln(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?Ct(l.to,n)>=0:Ct(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?Ct(l.from,r)<=0:Ct(l.from,r)<0)))return!0}}}function mn(e){for(var t;t=dn(e);)e=t.find(-1,!0).line;return e}function hn(e){for(var t;t=fn(e);)e=t.find(1,!0).line;return e}function gn(e){for(var t,n;t=fn(e);)e=t.find(1,!0).line,(n||=[]).push(e);return n}function _n(e,t){var n=z(e,t),r=mn(n);return n==r?t:yt(r)}function vn(e,t){if(t>e.lastLine())return t;var n=z(e,t),r;if(!yn(e,n))return t;for(;r=fn(n);)n=r.find(1,!0).line;return yt(n)+1}function yn(e,t){var n=qt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed&&(r.from==null||!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&bn(e,t,r)))return!0}}function bn(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return bn(e,r.line,Zt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&bn(e,t,i))return!0}function xn(e){e=mn(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==n)break;t+=s.height}return t}function Sn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=dn(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=fn(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function Cn(e){var t=e.display,n=e.doc;t.maxLine=z(n,n.first),t.maxLineLength=Sn(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=Sn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var wn=function(e,t,n){this.text=e,sn(this,t),this.height=n?n(this):1};wn.prototype.lineNo=function(){return yt(this)},Ve(wn);function Tn(e,t,n,r){e.text=t,e.stateAfter&&=null,e.styles&&=null,e.order!=null&&(e.order=null),on(e),sn(e,n);var i=r?r(e):1;i!=e.height&&vt(e,i)}function En(e){e.parent=null,on(e)}var Dn={},On={};function kn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?On:Dn;return n[e]||(n[e]=e.replace(/\S+/g,`cm-$&`))}function An(e,t){var n=A(`span`,null,null,c?`padding-right: .1px`:null),r={pre:A(`pre`,[n],`CodeMirror-line`),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption(`lineWrapping`)};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=Mn,Qe(e.display.measure)&&(o=Ne(a,e.doc.direction))&&(r.addToken=Pn(r.addToken,o)),r.map=[],In(a,r,Ft(e,a,t!=e.display.externalMeasured&&yt(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=M(a.styleClasses.bgClass,r.bgClass||``)),a.styleClasses.textClass&&(r.textClass=M(a.styleClasses.textClass,r.textClass||``))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Xe(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(`.cm-tab`))&&(r.content.className=`cm-tab-wrap-hack`)}return Le(e,`renderLine`,e,t.line,r.pre),r.pre.className&&(r.textClass=M(r.pre.className,r.textClass||``)),r}function jn(e){var t=k(`span`,`•`,`cm-invalidchar`);return t.title=`\\u`+e.charCodeAt(0).toString(16),t.setAttribute(`aria-label`,t.title),t}function Mn(e,t,n,r,i,a,c){if(t){var l=e.splitSpaces?Nn(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,f;if(!u.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),o&&s<9&&(d=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var p=0;;){u.lastIndex=p;var m=u.exec(t),h=m?m.index-p:t.length-p;if(h){var g=document.createTextNode(l.slice(p,p+h));o&&s<9?f.appendChild(k(`span`,[g])):f.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!m)break;p+=h+1;var _=void 0;if(m[0]==` `){var v=e.cm.options.tabSize,y=v-e.col%v;_=f.appendChild(k(`span`,he(y),`cm-tab`)),_.setAttribute(`role`,`presentation`),_.setAttribute(`cm-text`,` `),e.col+=y}else m[0]==`\r`||m[0]==`
|
|
33
|
+
`?(_=f.appendChild(k(`span`,m[0]==`\r`?`␍`:``,`cm-invalidchar`)),_.setAttribute(`cm-text`,m[0]),e.col+=1):(_=e.cm.options.specialCharPlaceholder(m[0]),_.setAttribute(`cm-text`,m[0]),o&&s<9?f.appendChild(k(`span`,[_])):f.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||d||a||c){var b=n||``;r&&(b+=r),i&&(b+=i);var x=k(`span`,[f],b,a);if(c)for(var S in c)c.hasOwnProperty(S)&&S!=`style`&&S!=`class`&&x.setAttribute(S,c[S]);return e.content.appendChild(x)}e.content.appendChild(f)}}function Nn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r=``,i=0;i<e.length;i++){var a=e.charAt(i);a==` `&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a=`\xA0`),r+=a,n=a==` `}return r}function Pn(e,t){return function(n,r,i,a,o,s,c){i=i?i+` cm-force-border`:`cm-force-border`;for(var l=n.pos,u=l+r.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>l&&d.from<=l));f++);if(d.to>=u)return e(n,r,i,a,o,s,c);e(n,r.slice(0,d.to-l),i,a,null,s,c),a=null,r=r.slice(d.to-l),l=d.to}}}function Fn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||=e.content.appendChild(document.createElement(`span`)),i.setAttribute(`cm-marker`,n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function In(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(a,a=n[o]),kn(n[o+1],t.cm.options));return}for(var s=i.length,c=0,l=1,u=``,d,f,p=0,m,h,g,_,v;;){if(p==c){m=h=g=f=``,v=null,_=null,p=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var S=r[x],C=S.marker;if(C.type==`bookmark`&&S.from==c&&C.widgetNode)y.push(C);else if(S.from<=c&&(S.to==null||S.to>c||C.collapsed&&S.to==c&&S.from==c)){if(S.to!=null&&S.to!=c&&p>S.to&&(p=S.to,h=``),C.className&&(m+=` `+C.className),C.css&&(f=(f?f+`;`:``)+C.css),C.startStyle&&S.from==c&&(g+=` `+C.startStyle),C.endStyle&&S.to==p&&(b||=[]).push(C.endStyle,S.to),C.title&&((v||={}).title=C.title),C.attributes)for(var w in C.attributes)(v||={})[w]=C.attributes[w];C.collapsed&&(!_||V(_.marker,C)<0)&&(_=S)}else S.from>c&&p>S.from&&(p=S.from)}if(b)for(var T=0;T<b.length;T+=2)b[T+1]==p&&(h+=` `+b[T]);if(!_||_.from==c)for(var E=0;E<y.length;++E)Fn(t,0,y[E]);if(_&&(_.from||0)==c){if(Fn(t,(_.to==null?s+1:_.to)-c,_.marker,_.from==null),_.to==null)return;_.to==c&&(_=!1)}}if(c>=s)break;for(var D=Math.min(s,p);;){if(u){var O=c+u.length;if(!_){var k=O>D?u.slice(0,D-c):u;t.addToken(t,k,d?d+m:m,g,c+k.length==p?h:``,f,v)}if(O>=D){u=u.slice(D-c),c=D;break}c=O,g=``}u=i.slice(a,a=n[l++]),d=kn(n[l++],t.cm.options)}}}function Ln(e,t,n){this.line=t,this.rest=gn(t),this.size=this.rest?yt(ge(this.rest))-n+1:1,this.node=this.text=null,this.hidden=yn(e,t)}function Rn(e,t,n){for(var r=[],i,a=t;a<n;a=i){var o=new Ln(e.doc,z(e.doc,a),a);i=a+o.size,r.push(o)}return r}var zn=null;function Bn(e){zn?zn.ops.push(e):e.ownsGroup=zn={ops:[e],delayedCallbacks:[]}}function Vn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Hn(e,t){var n=e.ownsGroup;if(n)try{Vn(n)}finally{zn=null,t(n)}}var Un=null;function Wn(e,t){var n=Fe(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;zn?i=zn.delayedCallbacks:Un?i=Un:(i=Un=[],setTimeout(Gn,0));for(var a=function(e){i.push(function(){return n[e].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function Gn(){var e=Un;Un=null;for(var t=0;t<e.length;++t)e[t]()}function Kn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a==`text`?Xn(e,t):a==`gutter`?Qn(e,t,n,r):a==`class`?Zn(e,t):a==`widget`&&$n(e,t,r)}t.changes=null}function qn(e){return e.node==e.text&&(e.node=k(`div`,null,null,`position: relative`),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&s<8&&(e.node.style.zIndex=2)),e.node}function Jn(e,t){var n=t.bgClass?t.bgClass+` `+(t.line.bgClass||``):t.line.bgClass;if(n&&(n+=` CodeMirror-linebackground`),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=qn(t);t.background=r.insertBefore(k(`div`,null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Yn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):An(e,t)}function Xn(e,t){var n=t.text.className,r=Yn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Zn(e,t)):n&&(t.text.className=n)}function Zn(e,t){Jn(e,t),t.line.wrapClass?qn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=``);var n=t.textClass?t.textClass+` `+(t.line.textClass||``):t.line.textClass;t.text.className=n||``}function Qn(e,t,n,r){if(t.gutter&&=(t.node.removeChild(t.gutter),null),t.gutterBackground&&=(t.node.removeChild(t.gutterBackground),null),t.line.gutterClass){var i=qn(t);t.gutterBackground=k(`div`,null,`CodeMirror-gutter-background `+t.line.gutterClass,`left: `+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+`px; width: `+r.gutterTotalWidth+`px`),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=qn(t),s=t.gutter=k(`div`,null,`CodeMirror-gutter-wrapper`,`left: `+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+`px`);if(s.setAttribute(`aria-hidden`,`true`),e.display.input.setUneditable(s),o.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=` `+t.line.gutterClass),e.options.lineNumbers&&(!a||!a[`CodeMirror-linenumbers`])&&(t.lineNumber=s.appendChild(k(`div`,St(e.options,n),`CodeMirror-linenumber CodeMirror-gutter-elt`,`left: `+r.gutterLeft[`CodeMirror-linenumbers`]+`px; width: `+e.display.lineNumInnerWidth+`px`))),a)for(var c=0;c<e.display.gutterSpecs.length;++c){var l=e.display.gutterSpecs[c].className,u=a.hasOwnProperty(l)&&a[l];u&&s.appendChild(k(`div`,[u],`CodeMirror-gutter-elt`,`left: `+r.gutterLeft[l]+`px; width: `+r.gutterWidth[l]+`px`))}}}function $n(e,t,n){t.alignable&&=null;for(var r=T(`CodeMirror-linewidget`),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);tr(e,t,n)}function er(e,t,n,r){var i=Yn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Zn(e,t),Qn(e,t,n,r),tr(e,t,r),t.node}function tr(e,t,n){if(nr(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)nr(e,t.rest[r],t,n,!1)}function nr(e,t,n,r,i){if(t.widgets)for(var a=qn(n),o=0,s=t.widgets;o<s.length;++o){var c=s[o],l=k(`div`,[c.node],`CodeMirror-linewidget`+(c.className?` `+c.className:``));c.handleMouseEvents||l.setAttribute(`cm-ignore-events`,`true`),rr(c,l,n,r),e.display.input.setUneditable(l),i&&c.above?a.insertBefore(l,n.gutter||n.text):a.appendChild(l),Wn(c,`redraw`)}}function rr(e,t,n,r){if(e.noHScroll){(n.alignable||=[]).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+`px`,e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+`px`),t.style.width=i+`px`}e.coverGutter&&(t.style.zIndex=5,t.style.position=`relative`,e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+`px`))}function ir(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!j(document.body,e.node)){var n=`position: relative;`;e.coverGutter&&(n+=`margin-left: -`+t.display.gutters.offsetWidth+`px;`),e.noHScroll&&(n+=`width: `+t.display.wrapper.clientWidth+`px;`),O(t.display.measure,k(`div`,[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function ar(e,t){for(var n=Ke(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute(`cm-ignore-events`)==`true`||n.parentNode==e.sizer&&n!=e.mover)return!0}function or(e){return e.lineSpace.offsetTop}function sr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function cr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,k(`pre`,`x`,`CodeMirror-line-like`)),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function lr(e){return ce-e.display.nativeBarWidth}function ur(e){return e.display.scroller.clientWidth-lr(e)-e.display.barWidth}function dr(e){return e.display.scroller.clientHeight-lr(e)-e.display.barHeight}function fr(e,t,n){var r=e.options.lineWrapping,i=r&&ur(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var c=o[s],l=o[s+1];Math.abs(c.bottom-l.bottom)>2&&a.push((c.bottom+l.top)/2-n.top)}}a.push(n.bottom-n.top)}}function pr(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(yt(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function mr(e,t){t=mn(t);var n=yt(t),r=e.display.externalMeasured=new Ln(e.doc,t,n);r.lineN=n;var i=r.built=An(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}function hr(e,t,n,r){return _r(e,gr(e,t),n,r)}function U(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Xr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function gr(e,t){var n=yt(t),r=U(e,n);r&&!r.text?r=null:r&&r.changes&&(Kn(e,r,n,Gr(e)),e.curOp.forceUpdate=!0),r||=mr(e,t);var i=pr(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function _r(e,t,n,r,i){t.before&&(n=-1);var a=n+(r||``),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||=t.view.text.getBoundingClientRect(),t.hasHeights||=(fr(e,t.view,t.rect),!0),o=xr(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var vr={left:0,right:0,top:0,bottom:0};function yr(e,t,n){for(var r,i,a,o,s,c,l=0;l<e.length;l+=3)if(s=e[l],c=e[l+1],t<s?(i=0,a=1,o=`left`):t<c?(i=t-s,a=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(a=c-s,i=a-1,t>=c&&(o=`right`)),i!=null){if(r=e[l+2],s==c&&n==(r.insertLeft?`left`:`right`)&&(o=n),n==`left`&&i==0)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],o=`left`;if(n==`right`&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],o=`right`;break}return{node:r,start:i,end:a,collapse:o,coverStart:s,coverEnd:c}}function br(e,t){var n=vr;if(t==`left`)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function xr(e,t,n,r){var i=yr(t.map,n,r),a=i.node,c=i.start,l=i.end,u=i.collapse,d;if(a.nodeType==3){for(var f=0;f<4;f++){for(;c&&Ee(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+l<i.coverEnd&&Ee(t.line.text.charAt(i.coverStart+l));)++l;if(d=o&&s<9&&c==0&&l==i.coverEnd-i.coverStart?a.parentNode.getBoundingClientRect():br(ee(a,c,l).getClientRects(),r),d.left||d.right||c==0)break;l=c,--c,u=`right`}o&&s<11&&(d=Sr(e.display.measure,d))}else{c>0&&(u=r=`right`);var p;d=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p[r==`right`?p.length-1:0]:a.getBoundingClientRect()}if(o&&s<9&&!c&&(!d||!d.left&&!d.right)){var m=a.parentNode.getClientRects()[0];d=m?{left:m.left,right:m.left+Wr(e.display),top:m.top,bottom:m.bottom}:vr}for(var h=d.top-t.rect.top,g=d.bottom-t.rect.top,_=(h+g)/2,v=t.view.measure.heights,y=0;y<v.length-1&&!(_<v[y]);y++);var b=y?v[y-1]:0,x=v[y],S={left:(u==`right`?d.right:d.left)-t.rect.left,right:(u==`left`?d.left:d.right)-t.rect.left,top:b,bottom:x};return!d.left&&!d.right&&(S.bogus=!0),e.options.singleCursorHeightPerLine||(S.rtop=h,S.rbottom=g),S}function Sr(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!rt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Cr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function wr(e){e.display.externalMeasure=null,D(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Cr(e.display.view[t])}function Tr(e){wr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Er(e){return u&&_?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Dr(e){return u&&_?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Or(e){var t=mn(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=ir(t[r]));return n}function kr(e,t,n,r,i){if(!i){var a=Or(t);n.top+=a,n.bottom+=a}if(r==`line`)return n;r||=`local`;var o=xn(t);if(r==`local`?o+=or(e.display):o-=e.display.viewOffset,r==`page`||r==`window`){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(r==`window`?0:Dr(ie(e)));var c=s.left+(r==`window`?0:Er(ie(e)));n.left+=c,n.right+=c}return n.top+=o,n.bottom+=o,n}function Ar(e,t,n){if(n==`div`)return t;var r=t.left,i=t.top;if(n==`page`)r-=Er(ie(e)),i-=Dr(ie(e));else if(n==`local`||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function jr(e,t,n,r,i){return r||=z(e.doc,t.line),kr(e,r,hr(e,r,t.ch,i),n)}function Mr(e,t,n,r,i,a){r||=z(e.doc,t.line),i||=gr(e,r);function o(t,o){var s=_r(e,i,t,o?`right`:`left`,a);return o?s.left=s.right:s.right=s.left,kr(e,r,s,n)}var s=Ne(r,e.doc.direction),c=t.ch,l=t.sticky;if(c>=r.text.length?(c=r.text.length,l=`before`):c<=0&&(c=0,l=`after`),!s)return o(l==`before`?c-1:c,l==`before`);function u(e,t,n){var r=s[t].level==1;return o(n?e-1:e,r!=n)}var d=je(s,c,l),f=Ae,p=u(c,d,l==`before`);return f!=null&&(p.other=u(c,f,l!=`before`)),p}function Nr(e,t){var n=0;t=kt(e.doc,t),e.options.lineWrapping||(n=Wr(e.display)*t.ch);var r=z(e.doc,t.line),i=xn(r)+or(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Pr(e,t,n,r,i){var a=B(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function Fr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Pr(r.first,0,null,-1,-1);var i=bt(r,n),a=r.first+r.size-1;if(i>a)return Pr(r.first+r.size-1,z(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=z(r,i);;){var s=zr(e,o,i,t,n),c=pn(o,s.ch+ +(s.xRel>0||s.outside>0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;o=z(r,i=l.line)}}function Ir(e,t,n,r){r-=Or(t);var i=t.text.length,a=Oe(function(t){return _r(e,n,t-1).bottom<=r},i,0);return i=Oe(function(t){return _r(e,n,t).top>r},a,i),{begin:a,end:i}}function Lr(e,t,n,r){n||=gr(e,t);var i=kr(e,t,_r(e,n,r),`line`).top;return Ir(e,t,n,i)}function Rr(e,t,n,r){return e.bottom<=n?!1:e.top>n||(r?e.left:e.right)>t}function zr(e,t,n,r,i){i-=xn(t);var a=gr(e,t),o=Or(t),s=0,c=t.text.length,l=!0,u=Ne(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Vr:Br)(e,t,n,a,u,r,i);l=d.level!=1,s=l?d.from:d.to-1,c=l?d.to:d.from-1}var f=null,p=null,m=Oe(function(t){var n=_r(e,a,t);return n.top+=o,n.bottom+=o,Rr(n,r,i,!1)?(n.top<=i&&n.left<=r&&(f=t,p=n),!0):!1},s,c),h,g,_=!1;if(p){var v=r-p.left<p.right-r,y=v==l;m=f+ +!y,g=y?`after`:`before`,h=v?p.left:p.right}else{!l&&(m==c||m==s)&&m++,g=m==0?`after`:m==t.text.length?`before`:_r(e,a,m-+!!l).bottom+o<=i==l?`after`:`before`;var b=Mr(e,B(n,m,g),`line`,t,a);h=b.left,_=i<b.top?-1:+(i>=b.bottom)}return m=De(t.text,m,1),Pr(n,m,g,_,r-h)}function Br(e,t,n,r,i,a,o){var s=Oe(function(s){var c=i[s],l=c.level!=1;return Rr(Mr(e,B(n,l?c.to:c.from,l?`before`:`after`),`line`,t,r),a,o,!0)},0,i.length-1),c=i[s];if(s>0){var l=c.level!=1,u=Mr(e,B(n,l?c.from:c.to,l?`after`:`before`),`line`,t,r);Rr(u,a,o,!0)&&u.top>o&&(c=i[s-1])}return c}function Vr(e,t,n,r,i,a,o){var s=Ir(e,t,r,o),c=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var u=null,d=null,f=0;f<i.length;f++){var p=i[f];if(!(p.from>=l||p.to<=c)){var m=_r(e,r,p.level==1?Math.max(c,p.from):Math.min(l,p.to)-1).right,h=m<a?a-m+1e9:m-a;(!u||d>h)&&(u=p,d=h)}}return u||=i[i.length-1],u.from<c&&(u={from:c,to:u.to,level:u.level}),u.to>l&&(u={from:u.from,to:l,level:u.level}),u}var Hr;function Ur(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Hr==null){Hr=k(`pre`,null,`CodeMirror-line-like`);for(var t=0;t<49;++t)Hr.appendChild(document.createTextNode(`x`)),Hr.appendChild(k(`br`));Hr.appendChild(document.createTextNode(`x`))}O(e.measure,Hr);var n=Hr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),D(e.measure),n||1}function Wr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=k(`span`,`xxxxxxxxxx`),n=k(`pre`,[t],`CodeMirror-line-like`);O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Gr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;n[s]=a.offsetLeft+a.clientLeft+i,r[s]=a.clientWidth}return{fixedPos:Kr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Kr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function qr(e){var t=Ur(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Wr(e.display)-3);return function(i){if(yn(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function Jr(e){var t=e.doc,n=qr(e);t.iter(function(e){var t=n(e);t!=e.height&&vt(e,t)})}function Yr(e,t,n,r){var i=e.display;if(!n&&Ke(t).getAttribute(`cm-not-content`)==`true`)return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch{return null}var c=Fr(e,a,o),l;if(r&&c.xRel>0&&(l=z(e.doc,c.line).text).length==c.ch){var u=oe(l,l.length,e.options.tabSize)-l.length;c=B(c.line,Math.max(0,Math.round((a-cr(e.display).left)/Wr(e.display))-u))}return c}function Xr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Zr(e,t,n,r){t??=e.doc.first,n??=e.doc.first+e.doc.size,r||=0;var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)qt&&_n(e.doc,t)<i.viewTo&&$r(e);else if(n<=i.viewFrom)qt&&vn(e.doc,n+r)>i.viewFrom?$r(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)$r(e);else if(t<=i.viewFrom){var a=ei(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):$r(e)}else if(n>=i.viewTo){var o=ei(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):$r(e)}else{var s=ei(e,t,t,-1),c=ei(e,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(Rn(e,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):$r(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function Qr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Xr(e,t)];if(a.node!=null){var o=a.changes||=[];L(o,n)==-1&&o.push(n)}}}function $r(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ei(e,t,n,r){var i=Xr(e,t),a,o=e.display.view;if(!qt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,c=0;c<i;c++)s+=o[c].size;if(s!=t){if(r>0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,n+=a}for(;_n(e.doc,n)!=n;){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-+(r<0)].size,i+=r}return{index:i,lineN:n}}function ti(e,t,n){var r=e.display;r.view.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Rn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Rn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Xr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Rn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Xr(e,n)))),r.viewTo=n}function ni(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function ri(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ii(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=e.options.$customCursor;o&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(!(!t&&s==n.sel.primIndex)){var c=n.sel.ranges[s];if(!(c.from().line>=e.display.viewTo||c.to().line<e.display.viewFrom)){var l=c.empty();if(o){var u=o(e,c);u&&W(e,u,i)}else(l||e.options.showCursorWhenSelecting)&&W(e,c.head,i);l||oi(e,c,a)}}return r}function W(e,t,n){var r=Mr(e,t,`div`,null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(k(`div`,`\xA0`,`CodeMirror-cursor`));if(i.style.left=r.left+`px`,i.style.top=r.top+`px`,i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+`px`,/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=jr(e,t,`div`,null,null),o=a.right-a.left;i.style.width=(o>0?o:e.defaultCharWidth())+`px`}if(r.other){var s=n.appendChild(k(`div`,`\xA0`,`CodeMirror-cursor CodeMirror-secondarycursor`));s.style.display=``,s.style.left=r.other.left+`px`,s.style.top=r.other.top+`px`,s.style.height=(r.other.bottom-r.other.top)*.85+`px`}}function ai(e,t){return e.top-t.top||e.left-t.left}function oi(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=cr(e.display),s=o.left,c=Math.max(r.sizerWidth,ur(e)-r.sizer.offsetLeft)-o.right,l=i.direction==`ltr`;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(k(`div`,null,`CodeMirror-selected`,`position: absolute; left: `+e+`px;
|
|
34
|
+
top: `+t+`px; width: `+(n??c-e)+`px;
|
|
35
|
+
height: `+(r-t)+`px`))}function d(t,n,r){var a=z(i,t),o=a.text.length,d,f;function p(n,r){return jr(e,B(t,n),`div`,a,r)}function m(t,n,r){var i=Lr(e,a,null,t),o=n==`ltr`==(r==`after`)?`left`:`right`;return p(r==`after`?i.begin:i.end-(/\s/.test(a.text.charAt(i.end-1))?2:1),o)[o]}var h=Ne(a,i.direction);return ke(h,n||0,r??o,function(e,t,i,a){var g=i==`ltr`,_=p(e,g?`left`:`right`),v=p(t-1,g?`right`:`left`),y=n==null&&e==0,b=r==null&&t==o,x=a==0,S=!h||a==h.length-1;if(v.top-_.top<=3){var C=(l?y:b)&&x,w=(l?b:y)&&S,T=C?s:(g?_:v).left,E=w?c:(g?v:_).right;u(T,_.top,E-T,_.bottom)}else{var D,O,k,A;g?(D=l&&y&&x?s:_.left,O=l?c:m(e,i,`before`),k=l?s:m(t,i,`after`),A=l&&b&&S?c:v.right):(D=l?m(e,i,`before`):s,O=!l&&y&&x?c:_.right,k=!l&&b&&S?s:v.left,A=l?m(t,i,`after`):c),u(D,_.top,O-D,_.bottom),_.bottom<v.top&&u(s,_.bottom,null,v.top),u(k,v.top,A-k,v.bottom)}(!d||ai(_,d)<0)&&(d=_),ai(v,d)<0&&(d=v),(!f||ai(_,f)<0)&&(f=_),ai(v,f)<0&&(f=v)}),{start:d,end:f}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var m=z(i,f.line),h=z(i,p.line),g=mn(m)==mn(h),_=d(f.line,f.ch,g?m.text.length+1:null).end,v=d(p.line,g?0:null,p.ch).start;g&&(_.top<v.top-2?(u(_.right,_.top,null,_.bottom),u(s,v.top,v.left,v.bottom)):u(_.right,_.top,v.left-_.right,_.bottom)),_.bottom<v.top&&u(s,_.bottom,null,v.top)}n.appendChild(a)}function si(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility=``,e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||di(e),t.cursorDiv.style.visibility=(n=!n)?``:`hidden`},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility=`hidden`)}}function ci(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ui(e))}function li(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&di(e))},100)}function ui(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!=`nocursor`&&(e.state.focused||(Le(e,`focus`,e,t),e.state.focused=!0,ne(e.display.wrapper,`CodeMirror-focused`),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),si(e))}function di(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Le(e,`blur`,e,t),e.state.focused=!1,E(e.display.wrapper,`CodeMirror-focused`)),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function fi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,c=0;c<t.view.length;c++){var l=t.view[c],u=e.options.lineWrapping,d=void 0,f=0;if(!l.hidden){if(i+=l.line.height,o&&s<8){var p=l.node.offsetTop+l.node.offsetHeight;d=p-n,n=p}else{var m=l.node.getBoundingClientRect();d=m.bottom-m.top,!u&&l.text.firstChild&&(f=l.text.firstChild.getBoundingClientRect().right-m.left-1)}var h=l.line.height-d;if((h>.005||h<-.005)&&(i<r&&(a-=h),vt(l.line,d),pi(l.line),l.rest))for(var g=0;g<l.rest.length;g++)pi(l.rest[g]);if(f>e.display.sizerWidth){var _=Math.ceil(f/Wr(e.display));_>e.display.maxLineLength&&(e.display.maxLineLength=_,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function pi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function mi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-or(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=bt(t,r),o=bt(t,i);if(n&&n.ensure){var s=n.ensure.from.line,c=n.ensure.to.line;s<a?(a=s,o=bt(t,xn(z(t,s))+e.wrapper.clientHeight)):Math.min(c,t.lastLine())>=o&&(a=bt(t,xn(z(t,c))-e.wrapper.clientHeight),o=c)}return{from:a,to:Math.max(o,a+1)}}function hi(e,t){if(!Re(e,`scrollCursorIntoView`)){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!h){var o=k(`div`,``,null,`position: absolute;
|
|
36
|
+
top: `+(t.top-n.viewOffset-or(e.display))+`px;
|
|
37
|
+
height: `+(t.bottom-t.top+lr(e)+n.barHeight)+`px;
|
|
38
|
+
left: `+t.left+`px; width: `+Math.max(2,t.right-t.left)+`px;`);e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function gi(e,t,n,r){r??=0;var i;!e.options.lineWrapping&&t==n&&(n=t.sticky==`before`?B(t.line,t.ch+1,`before`):t,t=t.ch?B(t.line,t.sticky==`before`?t.ch-1:t.ch,`after`):t);for(var a=0;a<5;a++){var o=!1,s=Mr(e,t),c=!n||n==t?s:Mr(e,n);i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r};var l=vi(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(l.scrollTop!=null&&(Ti(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),l.scrollLeft!=null&&(Di(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}function _i(e,t){var n=vi(e,t);n.scrollTop!=null&&Ti(e,n.scrollTop),n.scrollLeft!=null&&Di(e,n.scrollLeft)}function vi(e,t){var n=e.display,r=Ur(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=dr(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+sr(n),c=t.top<r,l=t.bottom>s-r;if(t.top<i)o.scrollTop=c?0:t.top;else if(t.bottom>i+a){var u=Math.min(t.top,(l?s:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=ur(e)-n.gutters.offsetWidth,m=t.right-t.left>p;return m&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.left<f?o.scrollLeft=Math.max(0,t.left+d-(m?0:10)):t.right>p+f-3&&(o.scrollLeft=t.right+(m?0:10)-p),o}function yi(e,t){t!=null&&(Ci(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function bi(e){Ci(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xi(e,t,n){(t!=null||n!=null)&&Ci(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Si(e,t){Ci(e),e.curOp.scrollToPos=t}function Ci(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,wi(e,Nr(e,t.from),Nr(e,t.to),t.margin))}function wi(e,t,n,r){var i=vi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});xi(e,i.scrollLeft,i.scrollTop)}function Ti(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||na(e,{top:t}),Ei(e,t,!0),n&&na(e),Ji(e,100))}function Ei(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Di(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,oa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Oi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+sr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+lr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var ki=function(e,t,n){this.cm=n;var r=this.vert=k(`div`,[k(`div`,null,null,`min-width: 1px`)],`CodeMirror-vscrollbar`),i=this.horiz=k(`div`,[k(`div`,null,null,`height: 100%; min-height: 1px`)],`CodeMirror-hscrollbar`);r.tabIndex=i.tabIndex=-1,e(r),e(i),R(r,`scroll`,function(){r.clientHeight&&t(r.scrollTop,`vertical`)}),R(i,`scroll`,function(){i.clientWidth&&t(i.scrollLeft,`horizontal`)}),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=`18px`)};ki.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display=`block`,this.vert.style.bottom=t?r+`px`:`0`;var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+`px`}else this.vert.scrollTop=0,this.vert.style.display=``,this.vert.firstChild.style.height=`0`;if(t){this.horiz.style.display=`block`,this.horiz.style.right=n?r+`px`:`0`,this.horiz.style.left=e.barLeft+`px`;var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+`px`}else this.horiz.style.display=``,this.horiz.firstChild.style.width=`0`;return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},ki.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,`horiz`)},ki.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,`vert`)},ki.prototype.zeroWidthHack=function(){var e=y&&!m?`12px`:`18px`;this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility=`hidden`,this.disableHoriz=new se,this.disableVert=new se},ki.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility=``;function r(){var i=e.getBoundingClientRect();(n==`vert`?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))==e?t.set(1e3,r):e.style.visibility=`hidden`}t.set(1e3,r)},ki.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ai=function(){};Ai.prototype.update=function(){return{bottom:0,right:0}},Ai.prototype.setScrollLeft=function(){},Ai.prototype.setScrollTop=function(){},Ai.prototype.clear=function(){};function ji(e,t){t||=Oi(e);var n=e.display.barWidth,r=e.display.barHeight;Mi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&fi(e),Mi(e,Oi(e)),n=e.display.barWidth,r=e.display.barHeight}function Mi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+`px`,n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+`px`,n.heightForcer.style.borderBottom=r.bottom+`px solid transparent`,r.right&&r.bottom?(n.scrollbarFiller.style.display=`block`,n.scrollbarFiller.style.height=r.bottom+`px`,n.scrollbarFiller.style.width=r.right+`px`):n.scrollbarFiller.style.display=``,r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display=`block`,n.gutterFiller.style.height=r.bottom+`px`,n.gutterFiller.style.width=t.gutterWidth+`px`):n.gutterFiller.style.display=``}var Ni={native:ki,null:Ai};function Pi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ni[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),R(t,`mousedown`,function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute(`cm-not-content`,`true`)},function(t,n){n==`horizontal`?Di(e,t):Ti(e,t)},e),e.display.scrollbars.addClass&&ne(e.display.wrapper,e.display.scrollbars.addClass)}var Fi=0;function Ii(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Fi,markArrays:null},Bn(e.curOp)}function Li(e){var t=e.curOp;t&&Hn(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Ri(e)})}function Ri(e){for(var t=e.ops,n=0;n<t.length;n++)zi(t[n]);for(var r=0;r<t.length;r++)Bi(t[r]);for(var i=0;i<t.length;i++)Vi(t[i]);for(var a=0;a<t.length;a++)Hi(t[a]);for(var o=0;o<t.length;o++)Ui(t[o])}function zi(e){var t=e.cm,n=t.display;Zi(t),e.updateMaxLine&&Cn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Bi(e){e.updatedDisplay=e.mustUpdate&&ea(e.cm,e.update)}function Vi(e){var t=e.cm,n=t.display;e.updatedDisplay&&fi(t),e.barMeasure=Oi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=hr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+lr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-ur(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Hi(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+`px`,e.maxScrollLeft<t.doc.scrollLeft&&Di(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==te(ae(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ji(t,e.barMeasure),e.updatedDisplay&&aa(t,e.barMeasure),e.selectionChanged&&si(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&ci(e.cm)}function Ui(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&ta(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Ei(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Di(t,e.scrollLeft,!0,!0),e.scrollToPos&&hi(t,gi(t,kt(r,e.scrollToPos.from),kt(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var o=0;o<i.length;++o)i[o].lines.length||Le(i[o],`hide`);if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Le(a[s],`unhide`);n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Le(t,`changes`,t,e.changeObjs),e.update&&e.update.finish()}function Wi(e,t){if(e.curOp)return t();Ii(e);try{return t()}finally{Li(e)}}function Gi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ii(e);try{return t.apply(e,arguments)}finally{Li(e)}}}function Ki(e){return function(){if(this.curOp)return e.apply(this,arguments);Ii(this);try{return e.apply(this,arguments)}finally{Li(this)}}}function qi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ii(t);try{return e.apply(this,arguments)}finally{Li(t)}}}function Ji(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(Yi,e))}function Yi(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=It(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?ft(t.mode,r.state):null,c=Pt(e,a,r,!0);s&&(r.state=s),a.styles=c.styles;var l=a.styleClasses,u=c.classes;u?a.styleClasses=u:l&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!d&&f<o.length;++f)d=o[f]!=a.styles[f];d&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Lt(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Ji(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Wi(e,function(){for(var t=0;t<i.length;t++)Qr(e,i[t],`text`)})}}var Xi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=mi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=ur(e),this.force=n,this.dims=Gr(e),this.events=[]};Xi.prototype.signal=function(e,t){Be(e,t)&&this.events.push(arguments)},Xi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Le.apply(null,this.events[e])};function Zi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=lr(e)+`px`,t.sizer.style.marginBottom=-t.nativeBarWidth+`px`,t.sizer.style.borderRightWidth=lr(e)+`px`,t.scrollbarsClipped=!0)}function Qi(e){if(e.hasFocus())return null;var t=te(ae(e));if(!t||!j(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=P(e).getSelection();r.anchorNode&&r.extend&&j(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function $i(e){if(!(!e||!e.activeElt||e.activeElt==te(N(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&j(document.body,e.anchorNode)&&j(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function ea(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return $r(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ni(e)==0)return!1;sa(e)&&($r(e),t.dims=Gr(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),qt&&(a=_n(e.doc,a),o=vn(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;ti(e,a,o),n.viewOffset=xn(z(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+`px`;var c=ni(e);if(!s&&c==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var l=Qi(e);return c>4&&(n.lineDiv.style.display=`none`),ra(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=``),n.renderedView=n.view,$i(l),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ji(e,400)),n.updateLineNumbers=null,!0}function ta(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ur(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+sr(e.display)-dr(e),n.top)}),t.visible=mi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=mi(e.display,e.doc,n));if(!ea(e,t))break;fi(e);var i=Oi(e);ri(e),ji(e,i),aa(e,i),t.force=!1}t.signal(e,`update`,e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,`viewportChange`,e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function na(e,t){var n=new Xi(e,t);if(ea(e,n)){fi(e),ta(e,n);var r=Oi(e);ri(e),ji(e,r),aa(e,r),n.finish()}}function ra(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(t){var n=t.nextSibling;return c&&y&&e.display.currentWheelTarget==t?t.style.display=`none`:t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(!f.hidden){if(!f.node||f.node.parentNode!=a){var p=er(e,f,u,n);a.insertBefore(p,o)}else{for(;o!=f.node;)o=s(o);var m=i&&t!=null&&t<=u&&f.lineNumber;f.changes&&(L(f.changes,`gutter`)>-1&&(m=!1),Kn(e,f,u,n)),m&&(D(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(St(e.options,u)))),o=f.node.nextSibling}}u+=f.size}for(;o;)o=s(o)}function ia(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+`px`,Wn(e,`gutterChanged`,e)}function aa(e,t){e.display.sizer.style.minHeight=t.docHeight+`px`,e.display.heightForcer.style.top=t.docHeight+`px`,e.display.gutters.style.height=t.docHeight+e.display.barHeight+lr(e)+`px`}function oa(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Kr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+`px`,o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var c=0;c<s.length;c++)s[c].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+`px`)}}function sa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=St(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(k(`div`,[k(`div`,n)],`CodeMirror-linenumber CodeMirror-gutter-elt`)),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width=``,r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+`px`,ia(e.display),!0}return!1}function ca(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!=`string`&&(o=a.style,a=a.className),a==`CodeMirror-linenumbers`){if(t)r=!0;else continue}n.push({className:a,style:o})}return t&&!r&&n.push({className:`CodeMirror-linenumbers`,style:null}),n}function la(e){var t=e.gutters,n=e.gutterSpecs;D(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,s=t.appendChild(k(`div`,null,`CodeMirror-gutter `+a));o&&(s.style.cssText=o),a==`CodeMirror-linenumbers`&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+`px`)}t.style.display=n.length?``:`none`,ia(e)}function ua(e){la(e.display),Zr(e),oa(e)}function da(e,t,r,i){var a=this;this.input=r,a.scrollbarFiller=k(`div`,null,`CodeMirror-scrollbar-filler`),a.scrollbarFiller.setAttribute(`cm-not-content`,`true`),a.gutterFiller=k(`div`,null,`CodeMirror-gutter-filler`),a.gutterFiller.setAttribute(`cm-not-content`,`true`),a.lineDiv=A(`div`,null,`CodeMirror-code`),a.selectionDiv=k(`div`,null,null,`position: relative; z-index: 1`),a.cursorDiv=k(`div`,null,`CodeMirror-cursors`),a.measure=k(`div`,null,`CodeMirror-measure`),a.lineMeasure=k(`div`,null,`CodeMirror-measure`),a.lineSpace=A(`div`,[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,`position: relative; outline: none`),a.mover=k(`div`,[A(`div`,[a.lineSpace],`CodeMirror-lines`)],null,`position: relative`),a.sizer=k(`div`,[a.mover],`CodeMirror-sizer`),a.sizerWidth=null,a.heightForcer=k(`div`,null,null,`position: absolute; height: `+ce+`px; width: 1px;`),a.gutters=k(`div`,null,`CodeMirror-gutters`),a.lineGutter=null,a.scroller=k(`div`,[a.sizer,a.heightForcer,a.gutters],`CodeMirror-scroll`),a.scroller.setAttribute(`tabIndex`,`-1`),a.wrapper=k(`div`,[a.scrollbarFiller,a.gutterFiller,a.scroller],`CodeMirror`),u&&d===105&&(a.wrapper.style.clipPath=`inset(0px)`),a.wrapper.setAttribute(`translate`,`no`),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!c&&!(n&&v)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=ca(i.gutters,i.lineNumbers),la(a),r.init(a)}var fa=0,pa=null;o?pa=-.53:n?pa=15:u?pa=-.7:p&&(pa=-1/3);function ma(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n??=e.wheelDelta,{x:t,y:n}}function ha(e){var t=ma(e);return t.x*=pa,t.y*=pa,t}function G(e,t){u&&d==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents=`none`:clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=``},100));var r=ma(t),i=r.x,a=r.y,o=pa;t.deltaMode===0&&(i=t.deltaX,a=t.deltaY,o=1);var s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(i&&p||a&&m){if(a&&y&&c){outer:for(var h=t.target,g=s.view;h!=l;h=h.parentNode)for(var _=0;_<g.length;_++)if(g[_].node==h){e.display.currentWheelTarget=h;break outer}}if(i&&!n&&!f&&o!=null){a&&m&&Ti(e,Math.max(0,l.scrollTop+a*o)),Di(e,Math.max(0,l.scrollLeft+i*o)),(!a||a&&m)&&He(t),s.wheelStartX=null;return}if(a&&o!=null){var v=a*o,b=e.doc.scrollTop,x=b+s.wrapper.clientHeight;v<0?b=Math.max(0,b+v-50):x=Math.min(e.doc.height,x+v+50),na(e,{top:b,bottom:x})}fa<20&&t.deltaMode!==0&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX!=null){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(pa=(pa*fa+n)/(fa+1),++fa)}},200)):(s.wheelDX+=i,s.wheelDY+=a))}}var ga=function(e,t){this.ranges=e,this.primIndex=t};ga.prototype.primary=function(){return this.ranges[this.primIndex]},ga.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!wt(n.anchor,r.anchor)||!wt(n.head,r.head))return!1}return!0},ga.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new _a(Tt(this.ranges[t].anchor),Tt(this.ranges[t].head));return new ga(e,this.primIndex)},ga.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ga.prototype.contains=function(e,t){t||=e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Ct(t,r.from())>=0&&Ct(e,r.to())<=0)return n}return-1};var _a=function(e,t){this.anchor=e,this.head=t};_a.prototype.from=function(){return Dt(this.anchor,this.head)},_a.prototype.to=function(){return Et(this.anchor,this.head)},_a.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function va(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return Ct(e.from(),t.from())}),n=L(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],c=Ct(s.to(),o.from());if(r&&!o.empty()?c>0:c>=0){var l=Dt(s.from(),o.from()),u=Et(s.to(),o.to()),d=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,t.splice(--a,2,new _a(d?u:l,d?l:u))}}return new ga(t,n)}function ya(e,t){return new ga([new _a(e,t||e)],0)}function ba(e){return e.text?B(e.from.line+e.text.length-1,ge(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function xa(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return ba(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ba(t).ch-t.to.ch),B(n,r)}function Sa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new _a(xa(i.anchor,t),xa(i.head,t)))}return va(e.cm,n,e.sel.primIndex)}function Ca(e,t,n){return e.line==t.line?B(n.line,e.ch-t.ch+n.ch):B(n.line+(e.line-t.line),e.ch)}function wa(e,t,n){for(var r=[],i=B(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],c=Ca(s.from,i,a),l=Ca(ba(s),i,a);if(i=s.to,a=l,n==`around`){var u=e.sel.ranges[o],d=Ct(u.head,u.anchor)<0;r[o]=new _a(d?l:c,d?c:l)}else r[o]=new _a(c,c)}return new ga(r,e.sel.primIndex)}function Ta(e){e.doc.mode=lt(e.options,e.doc.modeOption),Ea(e)}function Ea(e){e.doc.iter(function(e){e.stateAfter&&=null,e.styles&&=null}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ji(e,100),e.state.modeGen++,e.curOp&&Zr(e)}function Da(e,t){return t.from.ch==0&&t.to.ch==0&&ge(t.text)==``&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Oa(e,t,n,r){function i(e){return n?n[e]:null}function a(e,n,i){Tn(e,n,i,r),Wn(e,`change`,e,t)}function o(e,t){for(var n=[],a=e;a<t;++a)n.push(new wn(l[a],i(a),r));return n}var s=t.from,c=t.to,l=t.text,u=z(e,s.line),d=z(e,c.line),f=ge(l),p=i(l.length-1),m=c.line-s.line;if(t.full)e.insert(0,o(0,l.length)),e.remove(l.length,e.size-l.length);else if(Da(e,t)){var h=o(0,l.length-1);a(d,d.text,p),m&&e.remove(s.line,m),h.length&&e.insert(s.line,h)}else if(u==d){if(l.length==1)a(u,u.text.slice(0,s.ch)+f+u.text.slice(c.ch),p);else{var g=o(1,l.length-1);g.push(new wn(f+u.text.slice(c.ch),p,r)),a(u,u.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,g)}}else if(l.length==1)a(u,u.text.slice(0,s.ch)+l[0]+d.text.slice(c.ch),i(0)),e.remove(s.line+1,m);else{a(u,u.text.slice(0,s.ch)+l[0],i(0)),a(d,f+d.text.slice(c.ch),p);var _=o(1,l.length-1);m>1&&e.remove(s.line+1,m-1),e.insert(s.line+1,_)}Wn(e,`change`,e,t)}function ka(e,t,n){function r(e,i,a){if(e.linked)for(var o=0;o<e.linked.length;++o){var s=e.linked[o];if(s.doc!=i){var c=a&&s.sharedHist;n&&!c||(t(s.doc,c),r(s.doc,e,c))}}}r(e,null,!0)}function Aa(e,t){if(t.cm)throw Error(`This document is already in use.`);e.doc=t,t.cm=e,Jr(e),Ta(e),ja(e),e.options.direction=t.direction,e.options.lineWrapping||Cn(e),e.options.mode=t.modeOption,Zr(e)}function ja(e){(e.doc.direction==`rtl`?ne:E)(e.display.lineDiv,`CodeMirror-rtl`)}function Ma(e){Wi(e,function(){ja(e),Zr(e)})}function Na(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Pa(e,t){var n={from:Tt(t.from),to:ba(t),text:gt(e,t.from,t.to)};return Va(e,n,t.from.line,t.to.line+1),ka(e,function(e){return Va(e,n,t.from.line,t.to.line+1)},!0),n}function Fa(e){for(;e.length&&ge(e).ranges;)e.pop()}function Ia(e,t){if(t)return Fa(e.done),ge(e.done);if(e.done.length&&!ge(e.done).ranges)return ge(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ge(e.done)}function La(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)==`+`&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)==`*`))&&(o=Ia(i,i.lastOp==r)))s=ge(o.changes),Ct(t.from,t.to)==0&&Ct(t.from,s.to)==0?s.to=ba(t):o.changes.push(Pa(e,t));else{var c=ge(i.done);for((!c||!c.ranges)&&Ba(e.sel,i.done),o={changes:[Pa(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||Le(e,`historyAdded`)}function Ra(e,t,n,r){var i=t.charAt(0);return i==`*`||i==`+`&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function za(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||Ra(e,a,ge(i.done),t))?i.done[i.done.length-1]=t:Ba(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Fa(i.undone)}function Ba(e,t){var n=ge(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Va(e,t,n,r){var i=t[`spans_`+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||=t[`spans_`+e.id]={})[a]=n.markedSpans),++a})}function Ha(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||=e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}function Ua(e,t){var n=t[`spans_`+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ha(n[i]));return r}function Wa(e,t){var n=Ua(e,t),r=nn(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)spans:for(var s=0;s<o.length;++s){for(var c=o[s],l=0;l<a.length;++l)if(a[l].marker==c.marker)continue spans;a.push(c)}else o&&(n[i]=o)}return n}function Ga(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?ga.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];r.push({changes:s});for(var c=0;c<o.length;++c){var l=o[c],u=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),t)for(var d in l)(u=d.match(/^spans_(\d+)$/))&&L(t,Number(u[1]))>-1&&(ge(s)[d]=l[d],delete l[d])}}return r}function Ka(e,t,n,r){if(r){var i=e.anchor;if(n){var a=Ct(t,i)<0;a==Ct(n,i)<0?a!=Ct(t,n)<0&&(t=n):(i=t,t=n)}return new _a(i,t)}return new _a(n||t,t)}function qa(e,t,n,r,i){i??=e.cm&&(e.cm.display.shift||e.extend),$a(e,new ga([Ka(e.sel.primary(),t,n,i)],0),r)}function Ja(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Ka(e.sel.ranges[a],t[a],null,i);$a(e,va(e.cm,r,e.sel.primIndex),n)}function Ya(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,$a(e,va(e.cm,i,e.sel.primIndex),r)}function Xa(e,t,n,r){$a(e,ya(t,n),r)}function Za(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new _a(kt(e,t[n].anchor),kt(e,t[n].head))},origin:n&&n.origin};return Le(e,`beforeSelectionChange`,e,r),e.cm&&Le(e.cm,`beforeSelectionChange`,e.cm,r),r.ranges==t.ranges?t:va(e.cm,r.ranges,r.ranges.length-1)}function Qa(e,t,n){var r=e.history.done,i=ge(r);i&&i.ranges?(r[r.length-1]=t,eo(e,t,n)):$a(e,t,n)}function $a(e,t,n){eo(e,t,n),za(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(Be(e,`beforeSelectionChange`)||e.cm&&Be(e.cm,`beforeSelectionChange`))&&(t=Za(e,t,n));var r=n&&n.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,ro(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption(`readOnly`)!=`nocursor`&&bi(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ze(e.cm)),Wn(e,`cursorActivity`,e))}function no(e){to(e,ro(e,e.sel,null,!1))}function ro(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],c=ao(e,o.anchor,s&&s.anchor,n,r),l=o.head==o.anchor?c:ao(e,o.head,s&&s.head,n,r);(i||c!=o.anchor||l!=o.head)&&(i||=t.ranges.slice(0,a),i[a]=new _a(c,l))}return i?va(e.cm,i,t.primIndex):t}function io(e,t,n,r,i){var a=z(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],c=s.marker,l=`selectLeft`in c?!c.selectLeft:c.inclusiveLeft,u=`selectRight`in c?!c.selectRight:c.inclusiveRight;if((s.from==null||(l?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(Le(c,`beforeCursorEnter`),c.explicitlyCleared)){if(a.markedSpans){--o;continue}break}if(!c.atomic)continue;if(n){var d=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(d=oo(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=Ct(d,n))&&(r<0?f<0:f>0))return io(e,d,t,r,i)}var p=c.find(r<0?-1:1);return(r<0?l:u)&&(p=oo(e,p,r,p.line==t.line?a:null)),p?io(e,p,t,r,i):null}}return t}function ao(e,t,n,r,i){var a=r||1;return io(e,t,n,a,i)||!i&&io(e,t,n,a,!0)||io(e,t,n,-a,i)||!i&&io(e,t,n,-a,!0)||(e.cantEdit=!0,B(e.first,0))}function oo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?kt(e,B(t.line-1)):null:n>0&&t.ch==(r||z(e,t.line)).text.length?t.line<e.first+e.size-1?B(t.line+1,0):null:new B(t.line,t.ch+n)}function so(e){e.setSelection(B(e.firstLine(),0),B(e.lastLine()),ue)}function co(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,a){t&&(r.from=kt(e,t)),n&&(r.to=kt(e,n)),i&&(r.text=i),a!==void 0&&(r.origin=a)}),Le(e,`beforeChange`,e,r),e.cm&&Le(e.cm,`beforeChange`,e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function lo(e,t,n){if(e.cm){if(!e.cm.curOp)return Gi(e.cm,lo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Be(e,`beforeChange`)||e.cm&&Be(e.cm,`beforeChange`))&&(t=co(e,t,!0),!t))){var r=Kt&&!n&&an(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)uo(e,{from:r[i].from,to:r[i].to,text:i?[``]:t.text,origin:t.origin});else uo(e,t)}}function uo(e,t){if(t.text.length!=1||t.text[0]!=``||Ct(t.from,t.to)!=0){var n=Sa(e,t);La(e,t,n,e.cm?e.cm.curOp.id:NaN),mo(e,t,n,nn(e,t));var r=[];ka(e,function(e,n){!n&&L(r,e.history)==-1&&(yo(e.history,t),r.push(e.history)),mo(e,t,null,nn(e,t))})}}function fo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,s=t==`undo`?i.done:i.undone,c=t==`undo`?i.undone:i.done,l=0;l<s.length&&(a=s[l],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Ba(a,c),n&&!a.equals(e.sel)){$a(e,a,{clearRedo:!1});return}o=a}else if(r){s.push(a);return}else break;var u=[];Ba(o,c),c.push({changes:u,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var d=Be(e,`beforeChange`)||e.cm&&Be(e.cm,`beforeChange`),f=function(n){var r=a.changes[n];if(r.origin=t,d&&!co(e,r,!1))return s.length=0,{};u.push(Pa(e,r)),mo(e,r,n?Sa(e,r):ge(s),Wa(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:ba(r)});var i=[];ka(e,function(e,t){!t&&L(i,e.history)==-1&&(yo(e.history,r),i.push(e.history)),mo(e,r,null,Wa(e,r))})},p=a.changes.length-1;p>=0;--p){var m=f(p);if(m)return m.v}}}}function po(e,t){if(t!=0&&(e.first+=t,e.sel=new ga(_e(e.sel.ranges,function(e){return new _a(B(e.anchor.line+t,e.anchor.ch),B(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Zr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Qr(e.cm,r,`gutter`)}}function mo(e,t,n,r){if(e.cm&&!e.cm.curOp)return Gi(e.cm,mo)(e,t,n,r);if(t.to.line<e.first){po(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);po(e,i),t={from:B(e.first,0),to:B(t.to.line+i,t.to.ch),text:[ge(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:B(a,z(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=gt(e,t.from,t.to),n||=Sa(e,t),e.cm?ho(e.cm,t,r):Oa(e,t,r),eo(e,n,ue),e.cantEdit&&ao(e,B(e.firstLine(),0))&&(e.cantEdit=!1)}}function ho(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=yt(mn(z(r,a.line))),r.iter(c,o.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ze(e),Oa(r,t,n,qr(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=Sn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),Gt(r,a.line),Ji(e,400);var l=t.text.length-(o.line-a.line)-1;t.full?Zr(e):a.line==o.line&&t.text.length==1&&!Da(e.doc,t)?Qr(e,a.line,`text`):Zr(e,a.line,o.line+1,l);var u=Be(e,`changes`),d=Be(e,`change`);if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&Wn(e,`change`,e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function go(e,t,n,r,i){var a;r||=n,Ct(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t==`string`&&(t=e.splitLines(t)),lo(e,{from:n,to:r,text:t,origin:i})}function _o(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function vo(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)_o(a.ranges[s].anchor,t,n,r),_o(a.ranges[s].head,t,n,r);continue}for(var c=0;c<a.changes.length;++c){var l=a.changes[c];if(n<l.from.line)l.from=B(l.from.line+r,l.from.ch),l.to=B(l.to.line+r,l.to.ch);else if(t<=l.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function yo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;vo(e.done,n,r,i),vo(e.undone,n,r,i)}function bo(e,t,n,r){var i=t,a=t;return typeof t==`number`?a=z(e,Ot(e,t)):i=yt(t),i==null?null:(r(a,i)&&e.cm&&Qr(e.cm,i,n),a)}function xo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}xo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,En(i),Wn(i,`delete`)}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function So(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}So.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xo))){var s=[];this.collapse(s),this.children=[new xo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var c=new xo(i.lines.slice(s,s+=25));i.height-=c.height,this.children.splice(++r,0,c),c.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new So(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=L(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new So(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var Co=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Co.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=yt(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=ir(this);vt(n,Math.max(0,n.height-a)),e&&(Wi(e,function(){wo(e,n,-a),Qr(e,r,`widget`)}),Wn(e,`lineWidgetCleared`,e,this,r))}},Co.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=ir(this)-t;i&&(yn(this.doc,r)||vt(r,r.height+i),n&&Wi(n,function(){n.curOp.forceUpdate=!0,wo(n,r,i),Wn(n,`lineWidgetChanged`,n,e,yt(r))}))},Ve(Co);function wo(e,t,n){xn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&yi(e,n)}function To(e,t,n,r){var i=new Co(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),bo(e,t,`widget`,function(t){var n=t.widgets||=[];if(i.insertAt==null?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,a&&!yn(e,t)){var r=xn(t)<e.scrollTop;vt(t,t.height+ir(i)),r&&yi(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Wn(a,`lineWidgetAdded`,a,i,typeof t==`number`?t:yt(t)),i}var Eo=0,Do=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Eo};Do.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ii(e),Be(this,`clear`)){var n=this.find();n&&Wn(this,`clear`,n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Zt(o.markedSpans,this);e&&!this.collapsed?Qr(e,yt(o),`text`):e&&(s.to!=null&&(i=yt(o)),s.from!=null&&(r=yt(o))),o.markedSpans=Qt(o.markedSpans,s),s.from==null&&this.collapsed&&!yn(this.doc,o)&&e&&vt(o,Ur(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var l=mn(this.lines[c]),u=Sn(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Zr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&Wn(e,`markerCleared`,e,this,r,i),t&&Li(e),this.parent&&this.parent.clear()}},Do.prototype.find=function(e,t){e==null&&this.type==`bookmark`&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Zt(a.markedSpans,this);if(o.from!=null&&(n=B(t?a:yt(a),o.from),e==-1))return n;if(o.to!=null&&(r=B(t?a:yt(a),o.to),e==1))return r}return n&&{from:n,to:r}},Do.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Wi(r,function(){var i=t.line,a=U(r,yt(t.line));if(a&&(Cr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!yn(n.doc,i)&&n.height!=null){var o=n.height;n.height=null;var s=ir(n)-o;s&&vt(i,i.height+s)}Wn(r,`markerChanged`,r,e)})},Do.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||L(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||=[]).push(this)}this.lines.push(e)},Do.prototype.detachLine=function(e){if(this.lines.splice(L(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||=[]).push(this)}},Ve(Do);function Oo(e,t,n,r,i){if(r&&r.shared)return Ao(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Gi(e.cm,Oo)(e,t,n,r,i);var a=new Do(e,i),o=Ct(t,n);if(r&&I(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=A(`span`,[a.replacedWith],`CodeMirror-widget`),r.handleMouseEvents||a.widgetNode.setAttribute(`cm-ignore-events`,`true`),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(H(e,t.line,t,n,a)||t.line!=n.line&&H(e,n.line,t,n,a))throw Error(`Inserting collapsed marker partially overlapping an existing one`);Yt()}a.addToHistory&&La(e,{from:t,to:n,origin:`markText`},e.sel,NaN);var s=t.line,c=e.cm,l;if(e.iter(s,n.line+1,function(r){c&&a.collapsed&&!c.options.lineWrapping&&mn(r)==c.display.maxLine&&(l=!0),a.collapsed&&s!=t.line&&vt(r,0),$t(r,new Xt(a,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s}),a.collapsed&&e.iter(t.line,n.line+1,function(t){yn(e,t)&&vt(t,0)}),a.clearOnEnter&&R(a,`beforeCursorEnter`,function(){return a.clear()}),a.readOnly&&(Jt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Eo,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)Zr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)Qr(c,u,`text`);a.atomic&&no(c.doc),Wn(c,`markerAdded`,c,a)}return a}var ko=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};ko.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Wn(this,`clear`)}},ko.prototype.find=function(e,t){return this.primary.find(e,t)},Ve(ko);function Ao(e,t,n,r,i){r=I(r),r.shared=!1;var a=[Oo(e,t,n,r,i)],o=a[0],s=r.widgetNode;return ka(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),a.push(Oo(e,kt(e,t),kt(e,n),r,i));for(var c=0;c<e.linked.length;++c)if(e.linked[c].isParent)return;o=ge(a)}),new ko(a,o)}function jo(e){return e.findMarks(B(e.first,0),e.clipPos(B(e.lastLine())),function(e){return e.parent})}function Mo(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(Ct(a,o)){var s=Oo(e,a,o,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function No(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];ka(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var a=n.markers[i];L(r,a.doc)==-1&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}var Po=0,Fo=function(e,t,n,r,i){if(!(this instanceof Fo))return new Fo(e,t,n,r,i);n??=0,So.call(this,[new xo([new wn(``,null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=B(n,0);this.sel=ya(a),this.history=new Na(null),this.id=++Po,this.modeOption=t,this.lineSep=r,this.direction=i==`rtl`?`rtl`:`ltr`,this.extend=!1,typeof e==`string`&&(e=this.splitLines(e)),Oa(this,{from:a,to:a,text:e}),$a(this,ya(a),ue)};Fo.prototype=be(So.prototype,{constructor:Fo,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=_t(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:qi(function(e){var t=B(this.first,0),n=this.first+this.size-1;lo(this,{from:t,to:B(n,z(this,n).text.length),text:this.splitLines(e),origin:`setValue`,full:!0},!0),this.cm&&xi(this.cm,0,0),$a(this,ya(t),ue)}),replaceRange:function(e,t,n,r){t=kt(this,t),n=n?kt(this,n):t,go(this,e,t,n,r)},getRange:function(e,t,n){var r=gt(this,kt(this,e),kt(this,t));return n===!1?r:n===``?r.join(``):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(xt(this,e))return z(this,e)},getLineNumber:function(e){return yt(e)},getLineHandleVisualStart:function(e){return typeof e==`number`&&(e=z(this,e)),mn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return kt(this,e)},getCursor:function(e){var t=this.sel.primary();return e==null||e==`head`?t.head:e==`anchor`?t.anchor:e==`end`||e==`to`||e===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:qi(function(e,t,n){Xa(this,kt(this,typeof e==`number`?B(e,t||0):e),null,n)}),setSelection:qi(function(e,t,n){Xa(this,kt(this,e),kt(this,t||e),n)}),extendSelection:qi(function(e,t,n){qa(this,kt(this,e),t&&kt(this,t),n)}),extendSelections:qi(function(e,t){Ja(this,jt(this,e),t)}),extendSelectionsBy:qi(function(e,t){var n=_e(this.sel.ranges,e);Ja(this,jt(this,n),t)}),setSelections:qi(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new _a(kt(this,e[i].anchor),kt(this,e[i].head||e[i].anchor));t??=Math.min(e.length-1,this.sel.primIndex),$a(this,va(this.cm,r,t),n)}}),addSelection:qi(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new _a(kt(this,e),kt(this,t||e))),$a(this,va(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=gt(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=gt(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||`+input`)},replaceSelections:qi(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var s=t&&t!=`end`&&wa(this,r,t),c=r.length-1;c>=0;c--)lo(this,r[c]);s?Qa(this,s):this.cm&&bi(this.cm)}),undo:qi(function(){fo(this,`undo`)}),redo:qi(function(){fo(this,`redo`)}),undoSelection:qi(function(){fo(this,`undo`,!0)}),redoSelection:qi(function(){fo(this,`redo`,!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Na(this.history),ka(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ga(this.history.done),undone:Ga(this.history.undone)}},setHistory:function(e){var t=this.history=new Na(this.history);t.done=Ga(e.done.slice(0),null,!0),t.undone=Ga(e.undone.slice(0),null,!0)},setGutterMarker:qi(function(e,t,n){return bo(this,e,`gutter`,function(e){var r=e.gutterMarkers||={};return r[t]=n,!n&&we(r)&&(e.gutterMarkers=null),!0})}),clearGutter:qi(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,`gutter`,function(){return n.gutterMarkers[e]=null,we(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e==`number`){if(!xt(this,e)||(t=e,e=z(this,e),!e))return null}else if(t=yt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:qi(function(e,t,n){return bo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`;if(!e[r])e[r]=n;else if(T(n).test(e[r]))return!1;else e[r]+=` `+n;return!0})}),removeLineClass:qi(function(e,t,n){return bo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`,i=e[r];if(!i)return!1;if(n==null)e[r]=null;else{var a=i.match(T(n));if(!a)return!1;var o=a.index+a[0].length;e[r]=i.slice(0,a.index)+(!a.index||o==i.length?``:` `)+i.slice(o)||null}return!0})}),addLineWidget:qi(function(e,t,n){return To(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Oo(this,kt(this,e),kt(this,t),n,n&&n.type||`range`)},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=kt(this,e),Oo(this,e,e,n,`bookmark`)},findMarksAt:function(e){e=kt(this,e);var t=[],n=z(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=kt(this,e),t=kt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var c=o[s];!(c.to!=null&&i==e.line&&e.ch>=c.to||c.from==null&&i!=e.line||c.from!=null&&i==t.line&&c.from>=t.ch)&&(!n||n(c.marker))&&r.push(c.marker.parent||c.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),kt(this,B(n,t))},indexFromPos:function(e){e=kt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Fo(_t(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||={};var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Fo(_t(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||=[]).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Mo(r,jo(this)),r},unlinkDoc:function(e){if(e instanceof Us&&(e=e.doc),this.linked){for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),No(jo(this));break}}if(e.history==this.history){var n=[e.id];ka(e,function(e){return n.push(e.id)},!0),e.history=new Na(null),e.history.done=Ga(this.history.done,n),e.history.undone=Ga(this.history.undone,n)}},iterLinkedDocs:function(e){ka(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):$e(e)},lineSeparator:function(){return this.lineSep||`
|
|
39
|
+
`},setDirection:qi(function(e){e!=`rtl`&&(e=`ltr`),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Ma(this.cm))})}),Fo.prototype.eachLine=Fo.prototype.iter;var Io=0;function Lo(e){var t=this;if(Bo(t),!(Re(t,e)||ar(t.display,e))){He(e),o&&(Io=+new Date);var n=Yr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly())){if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),s=0,c=function(){++s==i&&Gi(t,function(){n=kt(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(a.filter(function(e){return e!=null}).join(t.doc.lineSeparator())),origin:`paste`};lo(t.doc,e),Qa(t.doc,ya(kt(t.doc,n),kt(t.doc,ba(e))))})()},l=function(e,n){if(t.options.allowDropFileTypes&&L(t.options.allowDropFileTypes,e.type)==-1){c();return}var r=new FileReader;r.onerror=function(){return c()},r.onload=function(){var e=r.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){c();return}a[n]=e,c()},r.readAsText(e)},u=0;u<r.length;u++)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData(`Text`);if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),eo(t.doc,ya(n,n)),f)for(var p=0;p<f.length;++p)go(t.doc,``,f[p].anchor,f[p].head,`drag`);t.replaceSelection(d,`around`,`paste`),t.display.input.focus()}}catch{}}}}}function Ro(e,t){if(o&&(!e.state.draggingText||+new Date-Io<100)){Ge(t);return}if(!(Re(e,t)||ar(e.display,t))&&(t.dataTransfer.setData(`Text`,e.getSelection()),t.dataTransfer.effectAllowed=`copyMove`,t.dataTransfer.setDragImage&&!p)){var n=k(`img`,null,null,`position: fixed; left: 0; top: 0;`);n.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`,f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}function zo(e,t){var n=Yr(e,t);if(n){var r=document.createDocumentFragment();W(e,n,r),e.display.dragCursor||(e.display.dragCursor=k(`div`,null,`CodeMirror-cursors CodeMirror-dragcursors`),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}function Bo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Vo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName(`CodeMirror`),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}var Ho=!1;function Uo(){Ho||=(Wo(),!0)}function Wo(){var e;R(window,`resize`,function(){e??=setTimeout(function(){e=null,Vo(Go)},100)}),R(window,`blur`,function(){return Vo(di)})}function Go(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ko={3:`Pause`,8:`Backspace`,9:`Tab`,13:`Enter`,16:`Shift`,17:`Ctrl`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Esc`,32:`Space`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`Left`,38:`Up`,39:`Right`,40:`Down`,44:`PrintScrn`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Mod`,92:`Mod`,93:`Mod`,106:`*`,107:`=`,109:`-`,110:`.`,111:`/`,145:`ScrollLock`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`,224:`Mod`,63232:`Up`,63233:`Down`,63234:`Left`,63235:`Right`,63272:`Delete`,63273:`Home`,63275:`End`,63276:`PageUp`,63277:`PageDown`,63302:`Insert`},qo=0;qo<10;qo++)Ko[qo+48]=Ko[qo+96]=String(qo);for(var Jo=65;Jo<=90;Jo++)Ko[Jo]=String.fromCharCode(Jo);for(var Yo=1;Yo<=12;Yo++)Ko[Yo+111]=Ko[Yo+63235]=`F`+Yo;var Xo={};Xo.basic={Left:`goCharLeft`,Right:`goCharRight`,Up:`goLineUp`,Down:`goLineDown`,End:`goLineEnd`,Home:`goLineStartSmart`,PageUp:`goPageUp`,PageDown:`goPageDown`,Delete:`delCharAfter`,Backspace:`delCharBefore`,"Shift-Backspace":`delCharBefore`,Tab:`defaultTab`,"Shift-Tab":`indentAuto`,Enter:`newlineAndIndent`,Insert:`toggleOverwrite`,Esc:`singleSelection`},Xo.pcDefault={"Ctrl-A":`selectAll`,"Ctrl-D":`deleteLine`,"Ctrl-Z":`undo`,"Shift-Ctrl-Z":`redo`,"Ctrl-Y":`redo`,"Ctrl-Home":`goDocStart`,"Ctrl-End":`goDocEnd`,"Ctrl-Up":`goLineUp`,"Ctrl-Down":`goLineDown`,"Ctrl-Left":`goGroupLeft`,"Ctrl-Right":`goGroupRight`,"Alt-Left":`goLineStart`,"Alt-Right":`goLineEnd`,"Ctrl-Backspace":`delGroupBefore`,"Ctrl-Delete":`delGroupAfter`,"Ctrl-S":`save`,"Ctrl-F":`find`,"Ctrl-G":`findNext`,"Shift-Ctrl-G":`findPrev`,"Shift-Ctrl-F":`replace`,"Shift-Ctrl-R":`replaceAll`,"Ctrl-[":`indentLess`,"Ctrl-]":`indentMore`,"Ctrl-U":`undoSelection`,"Shift-Ctrl-U":`redoSelection`,"Alt-U":`redoSelection`,fallthrough:`basic`},Xo.emacsy={"Ctrl-F":`goCharRight`,"Ctrl-B":`goCharLeft`,"Ctrl-P":`goLineUp`,"Ctrl-N":`goLineDown`,"Ctrl-A":`goLineStart`,"Ctrl-E":`goLineEnd`,"Ctrl-V":`goPageDown`,"Shift-Ctrl-V":`goPageUp`,"Ctrl-D":`delCharAfter`,"Ctrl-H":`delCharBefore`,"Alt-Backspace":`delWordBefore`,"Ctrl-K":`killLine`,"Ctrl-T":`transposeChars`,"Ctrl-O":`openLine`},Xo.macDefault={"Cmd-A":`selectAll`,"Cmd-D":`deleteLine`,"Cmd-Z":`undo`,"Shift-Cmd-Z":`redo`,"Cmd-Y":`redo`,"Cmd-Home":`goDocStart`,"Cmd-Up":`goDocStart`,"Cmd-End":`goDocEnd`,"Cmd-Down":`goDocEnd`,"Alt-Left":`goGroupLeft`,"Alt-Right":`goGroupRight`,"Cmd-Left":`goLineLeft`,"Cmd-Right":`goLineRight`,"Alt-Backspace":`delGroupBefore`,"Ctrl-Alt-Backspace":`delGroupAfter`,"Alt-Delete":`delGroupAfter`,"Cmd-S":`save`,"Cmd-F":`find`,"Cmd-G":`findNext`,"Shift-Cmd-G":`findPrev`,"Cmd-Alt-F":`replace`,"Shift-Cmd-Alt-F":`replaceAll`,"Cmd-[":`indentLess`,"Cmd-]":`indentMore`,"Cmd-Backspace":`delWrappedLineLeft`,"Cmd-Delete":`delWrappedLineRight`,"Cmd-U":`undoSelection`,"Shift-Cmd-U":`redoSelection`,"Ctrl-Up":`goDocStart`,"Ctrl-Down":`goDocEnd`,fallthrough:[`basic`,`emacsy`]},Xo.default=y?Xo.macDefault:Xo.pcDefault;function Zo(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw Error(`Unrecognized modifier name: `+s)}return n&&(e=`Alt-`+e),r&&(e=`Ctrl-`+e),a&&(e=`Cmd-`+e),i&&(e=`Shift-`+e),e}function Qo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r==`...`){delete e[n];continue}for(var i=_e(n.split(` `),Zo),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(` `),o=r):(s=i.slice(0,a+1).join(` `),o=`...`);var c=t[s];if(!c)t[s]=o;else if(c!=o)throw Error(`Inconsistent bindings for `+s)}delete e[n]}for(var l in t)e[l]=t[l];return e}function $o(e,t,n,r){t=rs(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return`nothing`;if(i===`...`)return`multi`;if(i!=null&&n(i))return`handled`;if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!=`[object Array]`)return $o(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=$o(e,t.fallthrough[a],n,r);if(o)return o}}}function es(e){var t=typeof e==`string`?e:Ko[e.keyCode];return t==`Ctrl`||t==`Alt`||t==`Shift`||t==`Mod`}function ts(e,t,n){var r=e;return t.altKey&&r!=`Alt`&&(e=`Alt-`+e),(C?t.metaKey:t.ctrlKey)&&r!=`Ctrl`&&(e=`Ctrl-`+e),(C?t.ctrlKey:t.metaKey)&&r!=`Mod`&&(e=`Cmd-`+e),!n&&t.shiftKey&&r!=`Shift`&&(e=`Shift-`+e),e}function ns(e,t){if(f&&e.keyCode==34&&e.char)return!1;var n=Ko[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),ts(n,e,t))}function rs(e){return typeof e==`string`?Xo[e]:e}function is(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&Ct(a.from,ge(r).to)<=0;){var o=r.pop();if(Ct(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Wi(e,function(){for(var t=r.length-1;t>=0;t--)go(e.doc,``,r[t].from,r[t].to,`+delete`);bi(e)})}function as(e,t,n){var r=De(e.text,t+n,n);return r<0||r>e.text.length?null:r}function os(e,t,n){var r=as(e,t.ch,n);return r==null?null:new B(t.line,r,n<0?`after`:`before`)}function ss(e,t,n,r,i){if(e){t.doc.direction==`rtl`&&(i=-i);var a=Ne(n,t.doc.direction);if(a){var o=i<0?ge(a):a[0],s=i<0==(o.level==1)?`after`:`before`,c;if(o.level>0||t.doc.direction==`rtl`){var l=gr(t,n);c=i<0?n.text.length-1:0;var u=_r(t,l,c).top;c=Oe(function(e){return _r(t,l,e).top==u},i<0==(o.level==1)?o.from:o.to-1,c),s==`before`&&(c=as(n,c,1))}else c=i<0?o.to:o.from;return new B(r,c,s)}}return new B(r,i<0?n.text.length:0,i<0?`before`:`after`)}function cs(e,t,n,r){var i=Ne(t,e.doc.direction);if(!i)return os(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky=`before`):n.ch<=0&&(n.ch=0,n.sticky=`after`);var a=je(i,n.ch,n.sticky),o=i[a];if(e.doc.direction==`ltr`&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return os(t,n,r);var s=function(e,n){return as(t,e instanceof B?e.ch:e,n)},c,l=function(n){return e.options.lineWrapping?(c||=gr(e,t),Lr(e,t,c,n)):{begin:0,end:t.text.length}},u=l(n.sticky==`before`?s(n,-1):n.ch);if(e.doc.direction==`rtl`||o.level==1){var d=o.level==1==r<0,f=s(n,d?1:-1);if(f!=null&&(d?f<=o.to&&f<=u.end:f>=o.from&&f>=u.begin)){var p=d?`before`:`after`;return new B(n.line,f,p)}}var m=function(e,t,r){for(var a=function(e,t){return t?new B(n.line,s(e,1),`before`):new B(n.line,e,`after`)};e>=0&&e<i.length;e+=t){var o=i[e],c=t>0==(o.level!=1),l=c?r.begin:s(r.end,-1);if(o.from<=l&&l<o.to||(l=c?o.from:s(o.to,-1),r.begin<=l&&l<r.end))return a(l,c)}},h=m(a+r,r,u);if(h)return h;var g=r>0?u.end:s(u.begin,-1);return g!=null&&!(r>0&&g==t.text.length)&&(h=m(r>0?0:i.length-1,r,l(g)),h)?h:null}var ls={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor(`anchor`),e.getCursor(`head`),ue)},killLine:function(e){return is(e,function(t){if(t.empty()){var n=z(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:B(t.head.line+1,0)}:{from:t.head,to:B(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return is(e,function(t){return{from:B(t.from().line,0),to:kt(e.doc,B(t.to().line+1,0))}})},delLineLeft:function(e){return is(e,function(e){return{from:B(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return is(e,function(t){var n=e.charCoords(t.head,`div`).top+5;return{from:e.coordsChar({left:0,top:n},`div`),to:t.from()}})},delWrappedLineRight:function(e){return is(e,function(t){var n=e.charCoords(t.head,`div`).top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`);return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(B(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(B(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return us(e,t.head.line)},{origin:`+move`,bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head)},{origin:`+move`,bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:`+move`,bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`)},fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:0,top:n},`div`)},fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5,r=e.coordsChar({left:0,top:n},`div`);return r.ch<e.getLine(r.line).search(/\S/)?fs(e,t.head):r},fe)},goLineUp:function(e){return e.moveV(-1,`line`)},goLineDown:function(e){return e.moveV(1,`line`)},goPageUp:function(e){return e.moveV(-1,`page`)},goPageDown:function(e){return e.moveV(1,`page`)},goCharLeft:function(e){return e.moveH(-1,`char`)},goCharRight:function(e){return e.moveH(1,`char`)},goColumnLeft:function(e){return e.moveH(-1,`column`)},goColumnRight:function(e){return e.moveH(1,`column`)},goWordLeft:function(e){return e.moveH(-1,`word`)},goGroupRight:function(e){return e.moveH(1,`group`)},goGroupLeft:function(e){return e.moveH(-1,`group`)},goWordRight:function(e){return e.moveH(1,`word`)},delCharBefore:function(e){return e.deleteH(-1,`codepoint`)},delCharAfter:function(e){return e.deleteH(1,`char`)},delWordBefore:function(e){return e.deleteH(-1,`word`)},delWordAfter:function(e){return e.deleteH(1,`word`)},delGroupBefore:function(e){return e.deleteH(-1,`group`)},delGroupAfter:function(e){return e.deleteH(1,`group`)},indentAuto:function(e){return e.indentSelection(`smart`)},indentMore:function(e){return e.indentSelection(`add`)},indentLess:function(e){return e.indentSelection(`subtract`)},insertTab:function(e){return e.replaceSelection(` `)},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=oe(e.getLine(a.line),a.ch,r);t.push(he(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection(`add`):e.execCommand(`insertTab`)},transposeChars:function(e){return Wi(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=z(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new B(i.line,i.ch-1)),i.ch>0)i=new B(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),B(i.line,i.ch-2),i,`+transpose`);else if(i.line>e.doc.first){var o=z(e.doc,i.line-1).text;o&&(i=new B(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),B(i.line-1,o.length-1),i,`+transpose`))}}n.push(new _a(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Wi(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,`+input`);t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);bi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
40
|
+
`,`start`)},toggleOverwrite:function(e){return e.toggleOverwrite()}};function us(e,t){var n=z(e.doc,t),r=mn(n);return r!=n&&(t=yt(r)),ss(!0,e,r,t,1)}function ds(e,t){var n=z(e.doc,t),r=hn(n);return r!=n&&(t=yt(r)),ss(!0,e,n,t,-1)}function fs(e,t){var n=us(e,t.line),r=z(e.doc,n.line),i=Ne(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return B(n.line,o?0:a,n.sticky)}return n}function K(e,t,n){if(typeof t==`string`&&(t=ls[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=le}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ps(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=$o(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&$o(t,e.options.extraKeys,n,e)||$o(t,e.options.keyMap,n,e)}var ms=new se;function hs(e,t,n,r){var i=e.state.keySeq;if(i){if(es(t))return`handled`;if(/\'$/.test(t)?e.state.keySeq=null:ms.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),gs(e,i+` `+t,n,r))return!0}return gs(e,t,n,r)}function gs(e,t,n,r){var i=ps(e,t,r);return i==`multi`&&(e.state.keySeq=t),i==`handled`&&Wn(e,`keyHandled`,e,t,n),(i==`handled`||i==`multi`)&&(He(n),si(e)),!!i}function q(e,t){var n=ns(t,!0);return n?t.shiftKey&&!e.state.keySeq?hs(e,`Shift-`+n,t,function(t){return K(e,t,!0)})||hs(e,n,t,function(t){if(typeof t==`string`?/^go[A-Z]/.test(t):t.motion)return K(e,t)}):hs(e,n,t,function(t){return K(e,t)}):!1}function J(e,t,n){return hs(e,`'`+n+`'`,t,function(t){return K(e,t,!0)})}var _s=null;function vs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=te(ae(t)),!Re(t,e))){o&&s<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=q(t,e);f&&(_s=i?r:null,!i&&r==88&&!tt&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection(``,null,`cut`)),n&&!y&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand(`cut`),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&ys(t)}}function ys(e){var t=e.display.lineDiv;ne(t,`CodeMirror-crosshair`);function n(e){(e.keyCode==18||!e.altKey)&&(E(t,`CodeMirror-crosshair`),Ie(document,`keyup`,n),Ie(document,`mouseover`,n))}R(document,`keyup`,n),R(document,`mouseover`,n)}function bs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Re(this,e)}function xs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(ar(t.display,e)||Re(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==_s){_s=null,He(e);return}if(!(f&&(!e.which||e.which<10)&&q(t,e))){var i=String.fromCharCode(r??n);i!=`\b`&&(J(t,e,i)||t.display.input.onKeyPress(e))}}}var Y=400,X=function(e,t,n){this.time=e,this.pos=t,this.button=n};X.prototype.compare=function(e,t,n){return this.time+Y>e&&Ct(t,this.pos)==0&&n==this.button};var Ss,Cs;function ws(e,t){var n=+new Date;return Cs&&Cs.compare(n,e,t)?(Ss=Cs=null,`triple`):Ss&&Ss.compare(n,e,t)?(Cs=new X(n,e,t),Ss=null,`double`):(Ss=new X(n,e,t),Cs=null,`single`)}function Ts(e){var t=this,n=t.display;if(!(Re(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,ar(n,e)){c||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Ns(t,e)){var r=Yr(t,e),i=qe(e),a=r?ws(r,i):`single`;P(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Es(t,i,r,a,e))&&(i==1?r?Ds(t,r,a,e):Ke(e)==n.scroller&&He(e):i==2?(r&&qa(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):li(t)))}}}function Es(e,t,n,r,i){var a=`Click`;return r==`double`?a=`Double`+a:r==`triple`&&(a=`Triple`+a),a=(t==1?`Left`:t==2?`Middle`:`Right`)+a,hs(e,ts(a,i),i,function(t){if(typeof t==`string`&&(t=ls[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=le}finally{e.state.suppressEdits=!1}return r})}function Z(e,t,n){var r=e.getOption(`configureMouse`),i=r?r(e,t,n):{};return i.unit??=(b?n.shiftKey&&n.metaKey:n.altKey)?`rectangle`:t==`single`?`char`:t==`double`?`word`:`line`,(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew??=y?n.metaKey:n.ctrlKey,i.moveOnDrag??=!(y?n.altKey:n.ctrlKey),i}function Ds(e,t,n,r){o?setTimeout(F(ci,e),0):e.curOp.focus=te(ae(e));var i=Z(e,n,r),a=e.doc.sel,s;e.options.dragDrop&&Je&&!e.isReadOnly()&&n==`single`&&(s=a.contains(t))>-1&&(Ct((s=a.ranges[s]).from(),t)<0||t.xRel>0)&&(Ct(s.to(),t)>0||t.xRel<0)?Os(e,r,t,i):As(e,r,t,i)}function Os(e,t,n,r){var i=e.display,a=!1,l=Gi(e,function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:li(e)),Ie(i.wrapper.ownerDocument,`mouseup`,l),Ie(i.wrapper.ownerDocument,`mousemove`,u),Ie(i.scroller,`dragstart`,d),Ie(i.scroller,`drop`,l),a||(He(t),r.addNew||qa(e.doc,n,null,null,r.extend),c&&!p||o&&s==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),u=function(e){a||=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,R(i.wrapper.ownerDocument,`mouseup`,l),R(i.wrapper.ownerDocument,`mousemove`,u),R(i.scroller,`dragstart`,d),R(i.scroller,`drop`,l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(e,t,n){if(n==`char`)return new _a(t,t);if(n==`word`)return e.findWordAt(t);if(n==`line`)return new _a(B(t.line,0),kt(e.doc,B(t.line+1,0)));var r=n(e,t);return new _a(r.from,r.to)}function As(e,t,n,r){o&&li(e);var i=e.display,a=e.doc;He(t);var s,c,l=a.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=a.sel.contains(n),s=c>-1?u[c]:new _a(n,n)):(s=a.sel.primary(),c=a.sel.primIndex),r.unit==`rectangle`)r.addNew||(s=new _a(n,n)),n=Yr(e,t,!0,!0),c=-1;else{var d=ks(e,n,r.unit);s=r.extend?Ka(s,d.anchor,d.head,r.extend):d}r.addNew?c==-1?(c=u.length,$a(a,va(e,u.concat([s]),c),{scroll:!1,origin:`*mouse`})):u.length>1&&u[c].empty()&&r.unit==`char`&&!r.extend?($a(a,va(e,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:`*mouse`}),l=a.sel):Ya(a,c,s,de):(c=0,$a(a,new ga([s],0),de),l=a.sel);var f=n;function p(t){if(Ct(f,t)!=0){if(f=t,r.unit==`rectangle`){for(var i=[],o=e.options.tabSize,u=oe(z(a,n.line).text,n.ch,o),d=oe(z(a,t.line).text,t.ch,o),p=Math.min(u,d),m=Math.max(u,d),h=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));h<=g;h++){var _=z(a,h).text,v=pe(_,p,o);p==m?i.push(new _a(B(h,v),B(h,v))):_.length>v&&i.push(new _a(B(h,v),B(h,pe(_,m,o))))}i.length||i.push(new _a(n,n)),$a(a,va(e,l.ranges.slice(0,c).concat(i),c),{origin:`*mouse`,scroll:!1}),e.scrollIntoView(t)}else{var y=s,b=ks(e,t,r.unit),x=y.anchor,S;Ct(b.anchor,x)>0?(S=b.head,x=Dt(y.from(),b.anchor)):(S=b.anchor,x=Et(y.to(),b.head));var C=l.ranges.slice(0);C[c]=js(e,new _a(kt(a,x),S)),$a(a,va(e,C,c),de)}}}var m=i.wrapper.getBoundingClientRect(),h=0;function g(t){var n=++h,o=Yr(e,t,!0,r.unit==`rectangle`);if(o){if(Ct(o,f)!=0){e.curOp.focus=te(ae(e)),p(o);var s=mi(i,a);(o.line>=s.to||o.line<s.from)&&setTimeout(Gi(e,function(){h==n&&g(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(Gi(e,function(){h==n&&(i.scroller.scrollTop+=c,g(t))}),50)}}}function _(t){e.state.selectingText=!1,h=1/0,t&&(He(t),i.input.focus()),Ie(i.wrapper.ownerDocument,`mousemove`,v),Ie(i.wrapper.ownerDocument,`mouseup`,y),a.history.lastSelOrigin=null}var v=Gi(e,function(e){e.buttons===0||!qe(e)?_(e):g(e)}),y=Gi(e,_);e.state.selectingText=y,R(i.wrapper.ownerDocument,`mousemove`,v),R(i.wrapper.ownerDocument,`mouseup`,y)}function js(e,t){var n=t.anchor,r=t.head,i=z(e.doc,n.line);if(Ct(n,r)==0&&n.sticky==r.sticky)return t;var a=Ne(i);if(!a)return t;var o=je(a,n.ch,n.sticky),s=a[o];if(s.from!=n.ch&&s.to!=n.ch)return t;var c=o+(s.from==n.ch==(s.level!=1)?0:1);if(c==0||c==a.length)return t;var l;if(r.line!=n.line)l=(r.line-n.line)*(e.doc.direction==`ltr`?1:-1)>0;else{var u=je(a,r.ch,r.sticky),d=u-o||(r.ch-n.ch)*(s.level==1?-1:1);l=u==c-1||u==c?d<0:d>0}var f=a[c+(l?-1:0)],p=l==(f.level==1),m=p?f.from:f.to,h=p?`after`:`before`;return n.ch==m&&n.sticky==h?t:new _a(new B(n.line,m,h),r)}function Ms(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&He(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!Be(e,n))return We(t);a-=s.top-o.viewOffset;for(var c=0;c<e.display.gutterSpecs.length;++c){var l=o.gutters.childNodes[c];if(l&&l.getBoundingClientRect().right>=i){var u=bt(e.doc,a),d=e.display.gutterSpecs[c];return Le(e,n,e,u,d.className,t),We(t)}}}function Ns(e,t){return Ms(e,t,`gutterClick`,!0)}function Ps(e,t){ar(e.display,t)||Fs(e,t)||Re(e,t,`contextmenu`)||w||e.display.input.onContextMenu(t)}function Fs(e,t){return Be(e,`gutterContextMenu`)?Ms(e,t,`gutterContextMenu`,!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,``)+e.options.theme.replace(/(^|\s)\s*/g,` cm-s-`),Tr(e)}var Ls={toString:function(){return`CodeMirror.Init`}},Rs={},zs={};function Bs(e){var t=e.optionHandlers;function n(n,r,i,a){e.defaults[n]=r,i&&(t[n]=a?function(e,t,n){n!=Ls&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ls,n(`value`,``,function(e,t){return e.setValue(t)},!0),n(`mode`,null,function(e,t){e.doc.modeOption=t,Ta(e)},!0),n(`indentUnit`,2,Ta,!0),n(`indentWithTabs`,!1),n(`smartIndent`,!0),n(`tabSize`,4,function(e){Ea(e),Tr(e),Zr(e)},!0),n(`lineSeparator`,null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(a==-1)break;i=a+t.length,n.push(B(r,a))}r++});for(var i=n.length-1;i>=0;i--)go(e.doc,t,n[i],B(n[i].line,n[i].ch+t.length))}}),n(`specialChars`,/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=RegExp(t.source+(t.test(` `)?``:`| `),`g`),n!=Ls&&e.refresh()}),n(`specialCharPlaceholder`,jn,function(e){return e.refresh()},!0),n(`electricChars`,!0),n(`inputStyle`,v?`contenteditable`:`textarea`,function(){throw Error(`inputStyle can not (yet) be changed in a running editor`)},!0),n(`spellcheck`,!1,function(e,t){return e.getInputField().spellcheck=t},!0),n(`autocorrect`,!1,function(e,t){return e.getInputField().autocorrect=t},!0),n(`autocapitalize`,!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n(`rtlMoveVisually`,!x),n(`wholeLineUpdateBefore`,!0),n(`theme`,`default`,function(e){Is(e),ua(e)},!0),n(`keyMap`,`default`,function(e,t,n){var r=rs(t),i=n!=Ls&&rs(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n(`extraKeys`,null),n(`configureMouse`,null),n(`lineWrapping`,!1,Hs,!0),n(`gutters`,[],function(e,t){e.display.gutterSpecs=ca(t,e.options.lineNumbers),ua(e)},!0),n(`fixedGutter`,!0,function(e,t){e.display.gutters.style.left=t?Kr(e.display)+`px`:`0`,e.refresh()},!0),n(`coverGutterNextToScrollbar`,!1,function(e){return ji(e)},!0),n(`scrollbarStyle`,`native`,function(e){Pi(e),ji(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n(`lineNumbers`,!1,function(e,t){e.display.gutterSpecs=ca(e.options.gutters,t),ua(e)},!0),n(`firstLineNumber`,1,ua,!0),n(`lineNumberFormatter`,function(e){return e},ua,!0),n(`showCursorWhenSelecting`,!1,ri,!0),n(`resetSelectionOnContextMenu`,!0),n(`lineWiseCopyCut`,!0),n(`pasteLinesPerSelection`,!0),n(`selectionsMayTouch`,!1),n(`readOnly`,!1,function(e,t){t==`nocursor`&&(di(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n(`screenReaderLabel`,null,function(e,t){t=t===``?null:t,e.display.input.screenReaderLabelChanged(t)}),n(`disableInput`,!1,function(e,t){t||e.display.input.reset()},!0),n(`dragDrop`,!0,Vs),n(`allowDropFileTypes`,null),n(`cursorBlinkRate`,530),n(`cursorScrollMargin`,0),n(`cursorHeight`,1,ri,!0),n(`singleCursorHeightPerLine`,!0,ri,!0),n(`workTime`,100),n(`workDelay`,100),n(`flattenSpans`,!0,Ea,!0),n(`addModeClass`,!1,Ea,!0),n(`pollInterval`,100),n(`undoDepth`,200,function(e,t){return e.doc.history.undoDepth=t}),n(`historyEventDelay`,1250),n(`viewportMargin`,10,function(e){return e.refresh()},!0),n(`maxHighlightLength`,1e4,Ea,!0),n(`moveInputWithCursor`,!0,function(e,t){t||e.display.input.resetPosition()}),n(`tabindex`,null,function(e,t){return e.display.input.getField().tabIndex=t||``}),n(`autofocus`,null),n(`direction`,`ltr`,function(e,t){return e.doc.setDirection(t)},!0),n(`phrases`,null)}function Vs(e,t,n){if(!t!=!(n&&n!=Ls)){var r=e.display.dragFunctions,i=t?R:Ie;i(e.display.scroller,`dragstart`,r.start),i(e.display.scroller,`dragenter`,r.enter),i(e.display.scroller,`dragover`,r.over),i(e.display.scroller,`dragleave`,r.leave),i(e.display.scroller,`drop`,r.drop)}}function Hs(e){e.options.lineWrapping?(ne(e.display.wrapper,`CodeMirror-wrap`),e.display.sizer.style.minWidth=``,e.display.sizerWidth=null):(E(e.display.wrapper,`CodeMirror-wrap`),Cn(e)),Jr(e),Zr(e),Tr(e),setTimeout(function(){return ji(e)},100)}function Us(e,t){var n=this;if(!(this instanceof Us))return new Us(e,t);this.options=t=t?I(t):{},I(Rs,t,!1);var r=t.value;typeof r==`string`?r=new Fo(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Us.inputStyles[t.inputStyle](this),a=this.display=new da(e,r,i,t);for(var l in a.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=` CodeMirror-wrap`),Pi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new se,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),o&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ws(this),Uo(),Ii(this),this.curOp.forceUpdate=!0,Aa(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&ui(n)},20):di(this),zs)zs.hasOwnProperty(l)&&zs[l](this,t[l],Ls);sa(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Gs.length;++u)Gs[u](this);Li(this),c&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering==`optimizelegibility`&&(a.lineDiv.style.textRendering=`auto`)}Us.defaults=Rs,Us.optionHandlers=zs;function Ws(e){var t=e.display;R(t.scroller,`mousedown`,Gi(e,Ts)),o&&s<11?R(t.scroller,`dblclick`,Gi(e,function(t){if(!Re(e,t)){var n=Yr(e,t);if(!(!n||Ns(e,t)||ar(e.display,t))){He(t);var r=e.findWordAt(n);qa(e.doc,r.anchor,r.head)}}})):R(t.scroller,`dblclick`,function(t){return Re(e,t)||He(t)}),R(t.scroller,`contextmenu`,function(t){return Ps(e,t)}),R(t.input.getField(),`contextmenu`,function(n){t.scroller.contains(n.target)||Ps(e,n)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(e){if(e.touches.length!=1)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function c(e,t){if(t.left==null)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}R(t.scroller,`touchstart`,function(i){if(!Re(e,i)&&!a(i)&&!Ns(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},i.touches.length==1&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),R(t.scroller,`touchmove`,function(){t.activeTouch&&(t.activeTouch.moved=!0)}),R(t.scroller,`touchend`,function(n){var r=t.activeTouch;if(r&&!ar(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var a=e.coordsChar(t.activeTouch,`page`),o=!r.prev||c(r,r.prev)?new _a(a,a):!r.prev.prev||c(r,r.prev.prev)?e.findWordAt(a):new _a(B(a.line,0),kt(e.doc,B(a.line+1,0)));e.setSelection(o.anchor,o.head),e.focus(),He(n)}i()}),R(t.scroller,`touchcancel`,i),R(t.scroller,`scroll`,function(){t.scroller.clientHeight&&(Ti(e,t.scroller.scrollTop),Di(e,t.scroller.scrollLeft,!0),Le(e,`scroll`,e))}),R(t.scroller,`mousewheel`,function(t){return G(e,t)}),R(t.scroller,`DOMMouseScroll`,function(t){return G(e,t)}),R(t.wrapper,`scroll`,function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){Re(e,t)||Ge(t)},over:function(t){Re(e,t)||(zo(e,t),Ge(t))},start:function(t){return Ro(e,t)},drop:Gi(e,Lo),leave:function(t){Re(e,t)||Bo(e)}};var l=t.input.getField();R(l,`keyup`,function(t){return bs.call(e,t)}),R(l,`keydown`,Gi(e,vs)),R(l,`keypress`,Gi(e,xs)),R(l,`focus`,function(t){return ui(e,t)}),R(l,`blur`,function(t){return di(e,t)})}var Gs=[];Us.defineInitHook=function(e){return Gs.push(e)};function Ks(e,t,n,r){var i=e.doc,a;n??=`add`,n==`smart`&&(i.mode.indent?a=It(e,t).state:n=`prev`);var o=e.options.tabSize,s=z(i,t),c=oe(s.text,null,o);s.stateAfter&&=null;var l=s.text.match(/^\s*/)[0],u;if(!r&&!/\S/.test(s.text))u=0,n=`not`;else if(n==`smart`&&(u=i.mode.indent(a,s.text.slice(l.length),s.text),u==le||u>150)){if(!r)return;n=`prev`}n==`prev`?u=t>i.first?oe(z(i,t-1).text,null,o):0:n==`add`?u=c+e.options.indentUnit:n==`subtract`?u=c-e.options.indentUnit:typeof n==`number`&&(u=c+n),u=Math.max(0,u);var d=``,f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/o);p;--p)f+=o,d+=` `;if(f<u&&(d+=he(u-f)),d!=l)return go(i,d,B(t,0),B(t,l.length),`+input`),s.stateAfter=null,!0;for(var m=0;m<i.sel.ranges.length;m++){var h=i.sel.ranges[m];if(h.head.line==t&&h.head.ch<l.length){var g=B(t,l.length);Ya(i,m,new _a(g,g));break}}}var qs=null;function Js(e){qs=e}function Ys(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||=a.sel;var o=new Date-200,s=i==`paste`||e.state.pasteIncoming>o,c=$e(t),l=null;if(s&&r.ranges.length>1){if(qs&&qs.text.join(`
|
|
41
|
+
`)==t){if(r.ranges.length%qs.text.length==0){l=[];for(var u=0;u<qs.text.length;u++)l.push(a.splitLines(qs.text[u]))}}else c.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(l=_e(c,function(e){return[e]}))}for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],m=p.from(),h=p.to();p.empty()&&(n&&n>0?m=B(m.line,m.ch-n):e.state.overwrite&&!s?h=B(h.line,Math.min(z(a,h.line).text.length,h.ch+ge(c).length)):s&&qs&&qs.lineWise&&qs.text.join(`
|
|
42
|
+
`)==c.join(`
|
|
43
|
+
`)&&(m=h=B(m.line,0)));var g={from:m,to:h,text:l?l[f%l.length]:c,origin:i||(s?`paste`:e.state.cutIncoming>o?`cut`:`+input`)};lo(e.doc,g),Wn(e,`inputRead`,e,g)}t&&!s&&Zs(e,t),bi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Xs(e,t){var n=e.clipboardData&&e.clipboardData.getData(`Text`);if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Wi(t,function(){return Ys(t,n,0,null,`paste`)}),!0}function Zs(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){o=Ks(e,i.head.line,`smart`);break}}else a.electricInput&&a.electricInput.test(z(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Ks(e,i.head.line,`smart`));o&&Wn(e,`electricInput`,e,i.head.line)}}}function Qs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:B(i,0),head:B(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function $s(e,t,n,r){e.setAttribute(`autocorrect`,n?`on`:`off`),e.setAttribute(`autocapitalize`,r?`on`:`off`),e.setAttribute(`spellcheck`,!!t)}function ec(){var e=k(`textarea`,null,null,`position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none`),t=k(`div`,[e],null,`overflow: hidden; position: relative; width: 3px; height: 0px;`);return c?e.style.width=`1000px`:e.setAttribute(`wrap`,`off`),g&&(e.style.border=`1px solid black`),t}function tc(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){P(this).focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];(r[e]!=n||e==`mode`)&&(r[e]=n,t.hasOwnProperty(e)&&Gi(this,t[e])(this,n,i),Le(this,`optionChange`,this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?`push`:`unshift`](rs(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Ki(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw Error(`Overlays may not be stateful.`);ve(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Zr(this)}),removeOverlay:Ki(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||typeof e==`string`&&r.name==e){t.splice(n,1),this.state.modeGen++,Zr(this);return}}}),indentLine:Ki(function(e,t,n){typeof t!=`string`&&typeof t!=`number`&&(t=t==null?this.options.smartIndent?`smart`:`prev`:t?`add`:`subtract`),xt(this.doc,e)&&Ks(this,e,t,n)}),indentSelection:Ki(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Ks(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&bi(this));else{var a=i.from(),o=i.to(),s=Math.max(n,a.line);n=Math.min(this.lastLine(),o.line-+!o.ch)+1;for(var c=s;c<n;++c)Ks(this,c,e);var l=this.doc.sel.ranges;a.ch==0&&t.length==l.length&&l[r].from().ch>0&&Ya(this.doc,r,new _a(a,l[r].to()),ue)}}}),getTokenAt:function(e,t){return Vt(this,e,t)},getLineTokens:function(e,t){return Vt(this,B(e),t,!0)},getTokenTypeAt:function(e){e=kt(this.doc,e);var t=Ft(this,z(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,a;if(i==0)a=t[2];else for(;;){var o=n+r>>1;if((o?t[o*2-1]:0)>=i)r=o;else if(t[o*2+1]<i)n=o+1;else{a=t[o*2+2];break}}var s=a?a.indexOf(`overlay `):-1;return s<0?a:s==0?null:a.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],a=this.getModeAt(e);if(typeof a[t]==`string`)i[a[t]]&&r.push(i[a[t]]);else if(a[t])for(var o=0;o<a[t].length;o++){var s=i[a[t][o]];s&&r.push(s)}else a.helperType&&i[a.helperType]?r.push(i[a.helperType]):i[a.name]&&r.push(i[a.name]);for(var c=0;c<i._global.length;c++){var l=i._global[c];l.pred(a,this)&&L(r,l.val)==-1&&r.push(l.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=Ot(n,e??n.first+n.size-1),It(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=e==null?r.head:typeof e==`object`?kt(this.doc,e):e?r.from():r.to(),Mr(this,n,t||`page`)},charCoords:function(e,t){return jr(this,kt(this.doc,e),t||`page`)},coordsChar:function(e,t){return e=Ar(this,e,t||`page`),Fr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Ar(this,{top:e,left:0},t||`page`).top,bt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r=!1,i;if(typeof e==`number`){var a=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>a&&(e=a,r=!0),i=z(this.doc,e)}else i=e;return kr(this,i,{top:0,left:0},t||`page`,n||r).top+(r?this.doc.height-xn(i):0)},defaultTextHeight:function(){return Ur(this.display)},defaultCharWidth:function(){return Wr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var a=this.display;e=Mr(this,kt(this.doc,e));var o=e.bottom,s=e.left;if(t.style.position=`absolute`,t.setAttribute(`cm-ignore-events`,`true`),this.display.input.setUneditable(t),a.sizer.appendChild(t),r==`over`)o=e.top;else if(r==`above`||r==`near`){var c=Math.max(a.wrapper.clientHeight,this.doc.height),l=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);(r==`above`||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(o=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=o+`px`,t.style.left=t.style.right=``,i==`right`?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right=`0px`):(i==`left`?s=0:i==`middle`&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+`px`),n&&_i(this,{left:s,top:o,right:s+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:Ki(vs),triggerOnKeyPress:Ki(xs),triggerOnKeyUp:bs,triggerOnMouseDown:Ki(Ts),execCommand:function(e){if(ls.hasOwnProperty(e))return ls[e].call(null,this)},triggerElectric:Ki(function(e){Zs(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var a=kt(this.doc,e),o=0;o<t&&(a=Q(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Ki(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Q(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},fe)}),deleteH:Ki(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection(``,null,`+delete`):is(this,function(n){var i=Q(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,a=r;t<0&&(i=-1,t=-t);for(var o=kt(this.doc,e),s=0;s<t;++s){var c=Mr(this,o,`div`);if(a==null?a=c.left:c.left=a,o=nc(this,c,i,n),o.hitSide)break}return o},moveV:Ki(function(e,t){var n=this,r=this.doc,i=[],a=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(o){if(a)return e<0?o.from():o.to();var s=Mr(n,o.head,`div`);o.goalColumn!=null&&(s.left=o.goalColumn),i.push(s.left);var c=nc(n,s,e,t);return t==`page`&&o==r.sel.primary()&&yi(n,jr(n,c,`div`).top-s.top),c},fe),i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]}),findWordAt:function(e){var t=this.doc,n=z(t,e.line).text,r=e.ch,i=e.ch;if(n){var a=this.getHelper(e,`wordChars`);(e.sticky==`before`||i==n.length)&&r?--r:++i;for(var o=n.charAt(r),s=Ce(o,a)?function(e){return Ce(e,a)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Ce(e)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new _a(B(e.line,r),B(e.line,i))},toggleOverwrite:function(e){(e==null||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?ne(this.display.cursorDiv,`CodeMirror-overwrite`):E(this.display.cursorDiv,`CodeMirror-overwrite`),Le(this,`overwriteToggle`,this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==te(ae(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ki(function(e,t){xi(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-lr(this)-this.display.barHeight,width:e.scrollWidth-lr(this)-this.display.barWidth,clientHeight:dr(this),clientWidth:ur(this)}},scrollIntoView:Ki(function(e,t){e==null?(e={from:this.doc.sel.primary().head,to:null},t??=this.options.cursorScrollMargin):typeof e==`number`?e={from:B(e,0),to:null}:e.from??(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,e.from.line==null?wi(this,e.from,e.to,e.margin):Si(this,e)}),setSize:Ki(function(e,t){var n=this,r=function(e){return typeof e==`number`||/^\d+$/.test(String(e))?e+`px`:e};e!=null&&(this.display.wrapper.style.width=r(e)),t!=null&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&wr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Qr(n,i,`widget`);break}}++i}),this.curOp.forceUpdate=!0,Le(this,`refresh`,this)}),operation:function(e){return Wi(this,e)},startOperation:function(){return Ii(this)},endOperation:function(){return Li(this)},refresh:Ki(function(){var e=this.display.cachedTextHeight;Zr(this),this.curOp.forceUpdate=!0,Tr(this),xi(this,this.doc.scrollLeft,this.doc.scrollTop),ia(this.display),(e==null||Math.abs(e-Ur(this.display))>.5||this.options.lineWrapping)&&Jr(this),Le(this,`refresh`,this)}),swapDoc:Ki(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Aa(this,e),Tr(this),this.display.input.reset(),xi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Wn(this,`swapDoc`,this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ve(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,a){e.registerHelper(t,r,a),n[t]._global.push({pred:i,val:a})}}function Q(e,t,n,r,i){var a=t,o=n,s=z(e,t.line),c=i&&e.direction==`rtl`?-n:n;function l(){var n=t.line+c;return n<e.first||n>=e.first+e.size?!1:(t=new B(n,t.ch,t.sticky),s=z(e,n))}function u(a){var o;if(r==`codepoint`){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))o=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;o=new B(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else o=i?cs(e.cm,s,t,n):os(s,t,n);if(o==null){if(!a&&l())t=ss(i,e.cm,s,t.line,c);else return!1}else t=o;return!0}if(r==`char`||r==`codepoint`)u();else if(r==`column`)u(!0);else if(r==`word`||r==`group`)for(var d=null,f=r==`group`,p=e.cm&&e.cm.getHelper(t,`wordChars`),m=!0;!(n<0&&!u(!m));m=!1){var h=s.text.charAt(t.ch)||`
|
|
44
|
+
`,g=Ce(h,p)?`w`:f&&h==`
|
|
45
|
+
`?`n`:!f||/\s/.test(h)?null:`p`;if(f&&!m&&!g&&(g=`s`),d&&d!=g){n<0&&(n=1,u(),t.sticky=`after`);break}if(g&&(d=g),n>0&&!u(!m))break}var _=ao(e,t,a,o,!0);return wt(a,_)&&(_.hitSide=!0),_}function nc(e,t,n,r){var i=e.doc,a=t.left,o;if(r==`page`){var s=Math.min(e.display.wrapper.clientHeight,P(e).innerHeight||i(e).documentElement.clientHeight),c=Math.max(s-.5*Ur(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else r==`line`&&(o=n>0?t.bottom+3:t.top-3);for(var l;l=Fr(e,a,o),l.outside;){if(n<0?o<=0:o>=i.height){l.hitSide=!0;break}o+=n*5}return l}var rc=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new se,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};rc.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,$s(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-?:line?widget\b/.test(t.className))break}return!1}R(i,`paste`,function(e){!a(e)||Re(r,e)||Xs(e,r)||s<=11&&setTimeout(Gi(r,function(){return t.updateFromDOM()}),20)}),R(i,`compositionstart`,function(e){t.composing={data:e.data,done:!1}}),R(i,`compositionupdate`,function(e){t.composing||={data:e.data,done:!1}}),R(i,`compositionend`,function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),R(i,`touchstart`,function(){return n.forceCompositionEnd()}),R(i,`input`,function(){t.composing||t.readFromDOMSoon()});function o(e){if(!(!a(e)||Re(r,e))){if(r.somethingSelected())Js({lineWise:!1,text:r.getSelections()}),e.type==`cut`&&r.replaceSelection(``,null,`cut`);else if(r.options.lineWiseCopyCut){var t=Qs(r);Js({lineWise:!0,text:t.text}),e.type==`cut`&&r.operation(function(){r.setSelections(t.ranges,0,ue),r.replaceSelection(``,null,`cut`)})}else return;if(e.clipboardData){e.clipboardData.clearData();var o=qs.text.join(`
|
|
46
|
+
`);if(e.clipboardData.setData(`Text`,o),e.clipboardData.getData(`Text`)==o){e.preventDefault();return}}var s=ec(),c=s.firstChild;$s(c),r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),c.value=qs.text.join(`
|
|
47
|
+
`);var l=te(N(i));re(c),setTimeout(function(){r.display.lineSpace.removeChild(s),l.focus(),l==i&&n.showPrimarySelection()},50)}}R(i,`copy`,o),R(i,`cut`,o)},rc.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute(`aria-label`,e):this.div.removeAttribute(`aria-label`)},rc.prototype.prepareSelection=function(){var e=ii(this.cm,!1);return e.focus=te(N(this.div))==this.div,e},rc.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},rc.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},rc.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),a=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var o=cc(t,e.anchorNode,e.anchorOffset),s=cc(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&s&&!s.bad&&Ct(Dt(o,s),i)==0&&Ct(Et(o,s),a)==0)){var c=t.display.view,l=i.line>=t.display.viewFrom&&ic(t,i)||{node:c[0].measure.map[2],offset:0},u=a.line<t.display.viewTo&&ic(t,a);if(!u){var d=c[c.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!l||!u){e.removeAllRanges();return}var p=e.rangeCount&&e.getRangeAt(0),m;try{m=ee(l.node,l.offset,u.offset,u.node)}catch{}m&&(!n&&t.state.focused?(e.collapse(l.node,l.offset),m.collapsed||(e.removeAllRanges(),e.addRange(m))):(e.removeAllRanges(),e.addRange(m)),p&&e.anchorNode==null?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}},rc.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},rc.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},rc.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},rc.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return j(this.div,t)},rc.prototype.focus=function(){this.cm.options.readOnly!=`nocursor`&&((!this.selectionInEditor()||te(N(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},rc.prototype.blur=function(){this.div.blur()},rc.prototype.getField=function(){return this.div},rc.prototype.supportsTouch=function(){return!0},rc.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Wi(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},rc.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},rc.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(_&&u&&this.cm.display.gutterSpecs.length&&ac(e.anchorNode)){this.cm.triggerOnKeyDown({type:`keydown`,keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=cc(t,e.anchorNode,e.anchorOffset),r=cc(t,e.focusNode,e.focusOffset);n&&r&&Wi(t,function(){$a(t.doc,ya(n,r),ue),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},rc.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=B(r.line-1,z(e.doc,r.line-1).length)),i.ch==z(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=B(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;r.line==t.viewFrom||(a=Xr(e,r.line))==0?(o=yt(t.view[0].line),s=t.view[0].node):(o=yt(t.view[a].line),s=t.view[a-1].node.nextSibling);var c=Xr(e,i.line),l,u;if(c==t.view.length-1?(l=t.viewTo-1,u=t.lineDiv.lastChild):(l=yt(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var d=e.doc.splitLines(sc(e,s,u,o,l)),f=gt(e.doc,B(o,0),B(l,z(e.doc,l).text.length));d.length>1&&f.length>1;)if(ge(d)==ge(f))d.pop(),f.pop(),l--;else if(d[0]==f[0])d.shift(),f.shift(),o++;else break;for(var p=0,m=0,h=d[0],g=f[0],_=Math.min(h.length,g.length);p<_&&h.charCodeAt(p)==g.charCodeAt(p);)++p;for(var v=ge(d),y=ge(f),b=Math.min(v.length-(d.length==1?p:0),y.length-(f.length==1?p:0));m<b&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)++m;if(d.length==1&&f.length==1&&o==r.line)for(;p&&p>r.ch&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)p--,m++;d[d.length-1]=v.slice(0,v.length-m).replace(/^\u200b+/,``),d[0]=d[0].slice(p).replace(/\u200b+$/,``);var x=B(o,p),S=B(l,f.length?ge(f).length-m:0);if(d.length>1||d[0]||Ct(x,S))return go(e.doc,d,x,S,`+input`),!0},rc.prototype.ensurePolled=function(){this.forceCompositionEnd()},rc.prototype.reset=function(){this.forceCompositionEnd()},rc.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},rc.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout??=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(e.composing.done)e.composing=null;else return}e.updateFromDOM()},80)},rc.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wi(this.cm,function(){return Zr(e.cm)})},rc.prototype.setUneditable=function(e){e.contentEditable=`false`},rc.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Gi(this.cm,Ys)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},rc.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!=`nocursor`)},rc.prototype.onContextMenu=function(){},rc.prototype.resetPosition=function(){},rc.prototype.needsContentAttribute=!0;function ic(e,t){var n=U(e,t.line);if(!n||n.hidden)return null;var r=z(e.doc,t.line),i=pr(n,r,t.line),a=Ne(r,e.doc.direction),o=`left`;a&&(o=je(a,t.ch)%2?`right`:`left`);var s=yr(i.map,t.ch,o);return s.offset=s.collapse==`right`?s.end:s.start,s}function ac(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function oc(e,t){return t&&(e.bad=!0),e}function sc(e,t,n,r,i){var a=``,o=!1,s=e.doc.lineSeparator(),c=!1;function l(e){return function(t){return t.id==e}}function u(){o&&=(a+=s,c&&(a+=s),c=!1)}function d(e){e&&(u(),a+=e)}function f(t){if(t.nodeType==1){var n=t.getAttribute(`cm-text`);if(n){d(n);return}var a=t.getAttribute(`cm-marker`),p;if(a){var m=e.findMarks(B(r,0),B(i+1,0),l(+a));m.length&&(p=m[0].find(0))&&d(gt(e.doc,p.from,p.to).join(s));return}if(t.getAttribute(`contenteditable`)==`false`)return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0)return;h&&u();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(c=!0),h&&(o=!0)}else t.nodeType==3&&d(t.nodeValue.replace(/\u200b/g,``).replace(/\u00a0/g,` `))}for(;f(t),t!=n;)t=t.nextSibling,c=!1;return a}function cc(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return oc(e.clipPos(B(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return lc(a,t,n)}}function lc(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!j(r,t))return oc(B(yt(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?ge(e.rest):e.line;return oc(B(yt(a),a.text.length),i)}var o=t.nodeType==3?t:null,s=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&=o.nodeValue.length);s.parentNode!=r;)s=s.parentNode;var c=e.measure,l=c.maps;function u(t,n,r){for(var i=-1;i<(l?l.length:0);i++)for(var a=i<0?c.map:l[i],o=0;o<a.length;o+=3){var s=a[o+2];if(s==t||s==n){var u=yt(i<0?e.line:e.rest[i]),d=a[o]+r;return(r<0||s!=t)&&(d=a[o+ +!!r]),B(u,d)}}}var d=u(o,s,n);if(d)return oc(d,i);for(var f=s.nextSibling,p=o?o.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0),d)return oc(B(d.line,d.ch-p),i);p+=f.textContent.length}for(var m=s.previousSibling,h=n;m;m=m.previousSibling){if(d=u(m,m.firstChild,-1),d)return oc(B(d.line,d.ch+h),i);h+=m.textContent.length}}var uc=function(e){this.cm=e,this.prevInput=``,this.pollingFast=!1,this.polling=new se,this.hasSelection=!1,this.composing=null,this.resetting=!1};uc.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width=`0px`),R(i,`input`,function(){o&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),R(i,`paste`,function(e){Re(r,e)||Xs(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(e){if(!Re(r,e)){if(r.somethingSelected())Js({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var t=Qs(r);Js({lineWise:!0,text:t.text}),e.type==`cut`?r.setSelections(t.ranges,null,ue):(n.prevInput=``,i.value=t.text.join(`
|
|
48
|
+
`),re(i))}else return;e.type==`cut`&&(r.state.cutIncoming=+new Date)}}R(i,`cut`,a),R(i,`copy`,a),R(e.scroller,`paste`,function(t){if(!(ar(e,t)||Re(r,t))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event(`paste`);a.clipboardData=t.clipboardData,i.dispatchEvent(a)}}),R(e.lineSpace,`selectstart`,function(t){ar(e,t)||He(t)}),R(i,`compositionstart`,function(){var e=r.getCursor(`from`);n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor(`to`),{className:`CodeMirror-composing`})}}),R(i,`compositionend`,function(){n.composing&&=(n.poll(),n.composing.range.clear(),null)})},uc.prototype.createField=function(e){this.wrapper=ec(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;$s(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},uc.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute(`aria-label`,e):this.textarea.removeAttribute(`aria-label`)},uc.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ii(e);if(e.options.moveInputWithCursor){var i=Mr(e,n.sel.primary().head,`div`),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},uc.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+`px`,this.wrapper.style.left=e.teLeft+`px`)},uc.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput=``;var n=t.getSelection();this.textarea.value=n,t.state.focused&&re(this.textarea),o&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value=``,o&&s>=9&&(this.hasSelection=null));this.resetting=!1}},uc.prototype.getField=function(){return this.textarea},uc.prototype.supportsTouch=function(){return!1},uc.prototype.focus=function(){if(this.cm.options.readOnly!=`nocursor`&&(!v||te(N(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},uc.prototype.blur=function(){this.textarea.blur()},uc.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},uc.prototype.receivedFocus=function(){this.slowPoll()},uc.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},uc.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){!t.poll()&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},uc.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||et(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(o&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r=``),a==8666)return this.reset(),this.cm.execCommand(`undo`)}for(var c=0,l=Math.min(r.length,i.length);c<l&&r.charCodeAt(c)==i.charCodeAt(c);)++c;return Wi(t,function(){Ys(t,i.slice(c),r.length-c,null,e.composing?`*compose`:null),i.length>1e3||i.indexOf(`
|
|
49
|
+
`)>-1?n.value=e.prevInput=``:e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor(`to`),{className:`CodeMirror-composing`}))}),!0},uc.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},uc.prototype.onKeyPress=function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},uc.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Yr(n,e),l=r.scroller.scrollTop;if(!a||f)return;n.options.resetSelectionOnContextMenu&&n.doc.sel.contains(a)==-1&&Gi(n,$a)(n.doc,ya(a),ue);var u=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText=`position: static`,i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
50
|
+
top: `+(e.clientY-p.top-5)+`px; left: `+(e.clientX-p.left-5)+`px;
|
|
51
|
+
z-index: 1000; background: `+(o?`rgba(255, 255, 255, .05)`:`transparent`)+`;
|
|
52
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var m;c&&(m=i.ownerDocument.defaultView.scrollY),r.input.focus(),c&&i.ownerDocument.defaultView.scrollTo(null,m),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=` `),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function h(){if(i.selectionStart!=null){var e=n.somethingSelected(),a=``+(e?i.value:``);i.value=`⇚`,i.value=a,t.prevInput=e?``:``,i.selectionStart=1,i.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,o&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!o||o&&s<9)&&h();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==``?Gi(n,so)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}if(o&&s>=9&&h(),w){Ge(e);var _=function(){Ie(window,`mouseup`,_),setTimeout(g,20)};R(window,`mouseup`,_)}else setTimeout(g,50)},uc.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e==`nocursor`,this.textarea.readOnly=!!e},uc.prototype.setUneditable=function(){},uc.prototype.needsContentAttribute=!1;function dc(e,t){if(t=t?I(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=te(N(e));t.autofocus=n==e||e.getAttribute(`autofocus`)!=null&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(R(e.form,`submit`,r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch{}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display=``,e.form&&(Ie(e.form,`submit`,r),!t.leaveSubmitMethodAlone&&typeof e.form.submit==`function`&&(e.form.submit=i))}},e.style.display=`none`;var s=Us(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}function fc(e){e.off=Ie,e.on=R,e.wheelEventPixels=ha,e.Doc=Fo,e.splitLines=$e,e.countColumn=oe,e.findColumn=pe,e.isWordChar=Se,e.Pass=le,e.signal=Le,e.Line=wn,e.changeEnd=ba,e.scrollbarModel=Ni,e.Pos=B,e.cmpPos=Ct,e.modes=it,e.mimeModes=at,e.resolveMode=ct,e.getMode=lt,e.modeExtensions=ut,e.extendMode=dt,e.copyState=ft,e.startState=mt,e.innerMode=pt,e.commands=ls,e.keyMap=Xo,e.keyName=ns,e.isModifierKey=es,e.lookupKey=$o,e.normalizeKeyMap=Qo,e.StringStream=ht,e.SharedTextMarker=ko,e.TextMarker=Do,e.LineWidget=Co,e.e_preventDefault=He,e.e_stopPropagation=Ue,e.e_stop=Ge,e.addClass=ne,e.contains=j,e.rmClass=E,e.keyNames=Ko}Bs(Us),tc(Us);var pc=`iter insert remove copy getEditor constructor`.split(` `);for(var mc in Fo.prototype)Fo.prototype.hasOwnProperty(mc)&&L(pc,mc)<0&&(Us.prototype[mc]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Fo.prototype[mc]));return Ve(Fo),Us.inputStyles={textarea:uc,contenteditable:rc},Us.defineMode=function(e){!Us.defaults.mode&&e!=`null`&&(Us.defaults.mode=e),ot.apply(this,arguments)},Us.defineMIME=st,Us.defineMode(`null`,function(){return{token:function(e){return e.skipToEnd()}}}),Us.defineMIME(`text/plain`,`null`),Us.defineExtension=function(e,t){Us.prototype[e]=t},Us.defineDocExtension=function(e,t){Fo.prototype[e]=t},Us.fromTextArea=dc,fc(Us),Us.version=`5.65.21`,Us}))})),yz=l(vz(),1);function bz(e){let t=new Set([`has`,`in`,`no`,`not`,`and`,`or`,`is`,`asc`,`ascN`,`ascA`,`ascAN`,`ascNA`,`desc`,`descN`,`descA`,`descAN`,`descNA`]),n=yz.default.getMode(e,{name:`javascript`,json:!0});return{...n,indent(t,n){return t.indented+e.indentUnit*(t.lastType===`{`&&n.trim()[0]!==`}`||t.lastType===`(`&&n.trim()[0]!==`)`||t.lastType===`[`&&n.trim()[0]!==`]`)},token(e,r){let i=e.peek();if(i===`#`||i===`@`)return n.token(new yz.default.StringStream(`$`,4,e.lineOracle),r),e.pos++,`variable`;let a=n.token(e,r),o=e.string.slice(e.start,e.pos);if(e.string[e.start-1]!==`.`){if(r.isAssertionContext){if((a===`variable`||a===`atom`)&&r.isAssertionParen===0&&o!==`not`)return`type`;o===`(`?r.isAssertionParen++:o===`)`&&(r.isAssertionParen>0&&r.isAssertionParen--,r.isAssertionParen===0&&(r.isAssertionContext=!1))}if(t.has(o))return o===`is`&&(r.isAssertionContext=!0,r.isAssertionParen=0),`keyword`}if(r.isAssertionContext){if(a===`variable`||a===`atom`||a===`def`||o===`function`)return`type`;r.isAssertionParen===0&&(a||/\S/.test(o))&&(r.isAssertionContext=!1)}return a}}}function xz(e,t){let n=typeof t.isDiscoveryViewDefined==`function`?t.isDiscoveryViewDefined:()=>{},r=yz.default.getMode(e,{name:`javascript`,json:!0});return{...r,indent(t,n){return t.indented+e.indentUnit*(t.lastType===`{`&&n.trim()[0]!==`}`||t.lastType===`(`&&n.trim()[0]!==`)`||t.lastType===`[`&&n.trim()[0]!==`]`)},token:function(e,t){if(t.suspendTokens){let{pos:n,token:r}=t.suspendTokens.shift();return e.pos=n,t.suspendTokens.length===0&&(t.suspendTokens=null),r}let i=e.pos,a=r.token(e,t);if(a===`string`){let r=e.pos,[,o]=e.string.slice(i+1,r-1).match(/^(.+?)([:{]|$)/)||[];n(o)&&(e.pos=i+1,t.suspendTokens=[{pos:i+1+o.length,token:`string discovery-view-name`},{pos:r,token:a}])}return a}}}o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(vz()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){e.defineMode(`javascript`,function(t,n){var r=t.indentUnit,i=n.statementIndent,a=n.jsonld,o=n.json||a,s=n.trackScope!==!1,c=n.typescript,l=n.wordCharacters||/[\w$\xa1-\uffff]/,u=function(){function e(e){return{type:e,style:`keyword`}}var t=e(`keyword a`),n=e(`keyword b`),r=e(`keyword c`),i=e(`keyword d`),a=e(`operator`),o={type:`atom`,style:`atom`};return{if:e(`if`),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e(`new`),delete:r,void:r,throw:r,debugger:e(`debugger`),var:e(`var`),const:e(`var`),let:e(`var`),function:e(`function`),catch:e(`catch`),for:e(`for`),switch:e(`switch`),case:e(`case`),default:e(`default`),in:a,typeof:a,instanceof:a,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e(`this`),class:e(`class`),super:e(`atom`),yield:r,export:e(`export`),import:e(`import`),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e){for(var t=!1,n,r=!1;(n=e.next())!=null;){if(!t){if(n==`/`&&!r)return;n==`[`?r=!0:r&&n==`]`&&(r=!1)}t=!t&&n==`\\`}}var m,h;function g(e,t,n){return m=e,h=n,t}function _(e,t){var n=e.next();if(n==`"`||n==`'`)return t.tokenize=v(n),t.tokenize(e,t);if(n==`.`&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g(`number`,`number`);if(n==`.`&&e.match(`..`))return g(`spread`,`meta`);if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if(n==`=`&&e.eat(`>`))return g(`=>`,`operator`);if(n==`0`&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g(`number`,`number`);if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g(`number`,`number`);if(n==`/`)return e.eat(`*`)?(t.tokenize=y,y(e,t)):e.eat(`/`)?(e.skipToEnd(),g(`comment`,`comment`)):vt(e,t,1)?(p(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g(`regexp`,`string-2`)):(e.eat(`=`),g(`operator`,`operator`,e.current()));if(n=="`")return t.tokenize=b,b(e,t);if(n==`#`&&e.peek()==`!`)return e.skipToEnd(),g(`meta`,`meta`);if(n==`#`&&e.eatWhile(l))return g(`variable`,`property`);if(n==`<`&&e.match(`!--`)||n==`-`&&e.match(`->`)&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g(`comment`,`comment`);if(d.test(n))return(n!=`>`||!t.lexical||t.lexical.type!=`>`)&&(e.eat(`=`)?(n==`!`||n==`=`)&&e.eat(`=`):/[<>*+\-|&?]/.test(n)&&(e.eat(n),n==`>`&&e.eat(n))),n==`?`&&e.eat(`.`)?g(`.`):g(`operator`,`operator`,e.current());if(l.test(n)){e.eatWhile(l);var r=e.current();if(t.lastType!=`.`){if(u.propertyIsEnumerable(r)){var i=u[r];return g(i.type,i.style,r)}if(r==`async`&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g(`async`,`keyword`,r)}return g(`variable`,`variable`,r)}}function v(e){return function(t,n){var r=!1,i;if(a&&t.peek()==`@`&&t.match(f))return n.tokenize=_,g(`jsonld-keyword`,`meta`);for(;(i=t.next())!=null&&!(i==e&&!r);)r=!r&&i==`\\`;return r||(n.tokenize=_),g(`string`,`string`)}}function y(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=_;break}n=r==`*`}return g(`comment`,`comment`)}function b(e,t){for(var n=!1,r;(r=e.next())!=null;){if(!n&&(r=="`"||r==`$`&&e.eat(`{`))){t.tokenize=_;break}n=!n&&r==`\\`}return g(`quasi`,`string-2`,e.current())}var x=`([{}])`;function S(e,t){t.fatArrowAt&&=null;var n=e.string.indexOf(`=>`,e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,a=!1,o=n-1;o>=0;--o){var s=e.string.charAt(o),u=x.indexOf(s);if(u>=0&&u<3){if(!i){++o;break}if(--i==0){s==`(`&&(a=!0);break}}else if(u>=3&&u<6)++i;else if(l.test(s))a=!0;else if(/["'\/`]/.test(s))for(;;--o){if(o==0)return;if(e.string.charAt(o-1)==s&&e.string.charAt(o-2)!=`\\`){o--;break}}else if(a&&!i){++o;break}}a&&!i&&(t.fatArrowAt=o)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=a,r!=null&&(this.align=r)}function T(e,t){if(!s)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function E(e,t,n,r,i){var a=e.cc;for(D.state=e,D.stream=i,D.marked=null,D.cc=a,D.style=t,e.lexical.hasOwnProperty(`align`)||(e.lexical.align=!0);;)if((a.length?a.pop():o?L:oe)(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return D.marked?D.marked:n==`variable`&&T(e,r)?`variable-2`:t}}var D={state:null,column:null,marked:null,cc:null};function O(){for(var e=arguments.length-1;e>=0;e--)D.cc.push(arguments[e])}function k(){return O.apply(null,arguments),!0}function A(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function ee(e){var t=D.state;if(D.marked=`def`,s){if(t.context){if(t.lexical.info==`var`&&t.context&&t.context.block){var r=j(e,t.context);if(r!=null){t.context=r;return}}else if(!A(e,t.localVars)){t.localVars=new M(e,t.localVars);return}}n.globalVars&&!A(e,t.globalVars)&&(t.globalVars=new M(e,t.globalVars))}}function j(e,t){if(!t)return null;if(t.block){var n=j(e,t.prev);return n?n==t.prev?t:new ne(n,t.vars,!0):null}return A(e,t.vars)?t:new ne(t.prev,new M(e,t.vars),!1)}function te(e){return e==`public`||e==`private`||e==`protected`||e==`abstract`||e==`readonly`}function ne(e,t,n){this.prev=e,this.vars=t,this.block=n}function M(e,t){this.name=e,this.next=t}var re=new M(`this`,new M(`arguments`,null));function ie(){D.state.context=new ne(D.state.context,D.state.localVars,!1),D.state.localVars=re}function ae(){D.state.context=new ne(D.state.context,D.state.localVars,!0),D.state.localVars=null}ie.lex=ae.lex=!0;function N(){D.state.localVars=D.state.context.vars,D.state.context=D.state.context.prev}N.lex=!0;function P(e,t){var n=function(){var n=D.state,r=n.indented;if(n.lexical.type==`stat`)r=n.lexical.indented;else for(var i=n.lexical;i&&i.type==`)`&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,D.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function F(){var e=D.state;e.lexical.prev&&(e.lexical.type==`)`&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}F.lex=!0;function I(e){function t(n){return n==e?k():e==`;`||n==`}`||n==`)`||n==`]`?O():k(t)}return t}function oe(e,t){return e==`var`?k(P(`vardef`,t),Ue,I(`;`),F):e==`keyword a`?k(P(`form`),le,oe,F):e==`keyword b`?k(P(`form`),oe,F):e==`keyword d`?D.stream.match(/^\s*$/,!1)?k():k(P(`stat`),de,I(`;`),F):e==`debugger`?k(I(`;`)):e==`{`?k(P(`}`),ae,Oe,F,N):e==`;`?k():e==`if`?(D.state.lexical.info==`else`&&D.state.cc[D.state.cc.length-1]==F&&D.state.cc.pop()(),k(P(`form`),le,oe,F,Ye)):e==`function`?k($e):e==`for`?k(P(`form`),ae,Xe,oe,N,F):e==`class`||c&&t==`interface`?(D.marked=`keyword`,k(P(`form`,e==`class`?e:t),it,F)):e==`variable`?c&&t==`declare`?(D.marked=`keyword`,k(oe)):c&&(t==`module`||t==`enum`||t==`type`)&&D.stream.match(/^\s*\w/,!1)?(D.marked=`keyword`,t==`enum`?k(z):t==`type`?k(tt,I(`operator`),Ne,I(`;`)):k(P(`form`),We,I(`{`),P(`}`),Oe,F,F)):c&&t==`namespace`?(D.marked=`keyword`,k(P(`form`),L,oe,F)):c&&t==`abstract`?(D.marked=`keyword`,k(oe)):k(P(`stat`),xe):e==`switch`?k(P(`form`),le,I(`{`),P(`}`,`switch`),ae,Oe,F,F,N):e==`case`?k(L,I(`:`)):e=="default"?k(I(`:`)):e==`catch`?k(P(`form`),ie,se,oe,F,N):e==`export`?k(P(`stat`),ct,F):e==`import`?k(P(`stat`),ut,F):e==`async`?k(oe):t==`@`?k(L,oe):O(P(`stat`),L,I(`;`),F)}function se(e){if(e==`(`)return k(nt,I(`)`))}function L(e,t){return ue(e,t,!1)}function ce(e,t){return ue(e,t,!0)}function le(e){return e==`(`?k(P(`)`),de,I(`)`),F):O()}function ue(e,t,n){if(D.state.fatArrowAt==D.stream.start){var r=n?_e:ge;if(e==`(`)return k(ie,P(`)`),Ee(nt,`)`),F,I(`=>`),r,N);if(e==`variable`)return O(ie,We,I(`=>`),r,N)}var i=n?pe:fe;return C.hasOwnProperty(e)?k(i):e==`function`?k($e,i):e==`class`||c&&t==`interface`?(D.marked=`keyword`,k(P(`form`),rt,F)):e==`keyword c`||e==`async`?k(n?ce:L):e==`(`?k(P(`)`),de,I(`)`),F,i):e==`operator`||e==`spread`?k(n?ce:L):e==`[`?k(P(`]`),ht,F,i):e==`{`?De(Ce,`}`,null,i):e==`quasi`?O(me,i):e==`new`?k(ve(n)):k()}function de(e){return e.match(/[;\}\)\],]/)?O():O(L)}function fe(e,t){return e==`,`?k(de):pe(e,t,!1)}function pe(e,t,n){var r=n==0?fe:pe,i=n==0?L:ce;if(e==`=>`)return k(ie,n?_e:ge,N);if(e==`operator`)return/\+\+|--/.test(t)||c&&t==`!`?k(r):c&&t==`<`&&D.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?k(P(`>`),Ee(Ne,`>`),F,r):t==`?`?k(L,I(`:`),i):k(i);if(e==`quasi`)return O(me,r);if(e!=`;`){if(e==`(`)return De(ce,`)`,`call`,r);if(e==`.`)return k(Se,r);if(e==`[`)return k(P(`]`),de,I(`]`),F,r);if(c&&t==`as`)return D.marked=`keyword`,k(Ne,r);if(e==`regexp`)return D.state.lastType=D.marked=`operator`,D.stream.backUp(D.stream.pos-D.stream.start-1),k(i)}}function me(e,t){return e==`quasi`?t.slice(t.length-2)=="${"?k(de,he):k(me):O()}function he(e){if(e==`}`)return D.marked=`string-2`,D.state.tokenize=b,k(me)}function ge(e){return S(D.stream,D.state),O(e==`{`?oe:L)}function _e(e){return S(D.stream,D.state),O(e==`{`?oe:ce)}function ve(e){return function(t){return t==`.`?k(e?be:ye):t==`variable`&&c?k(Be,e?pe:fe):O(e?ce:L)}}function ye(e,t){if(t==`target`)return D.marked=`keyword`,k(fe)}function be(e,t){if(t==`target`)return D.marked=`keyword`,k(pe)}function xe(e){return e==`:`?k(F,oe):O(fe,I(`;`),F)}function Se(e){if(e==`variable`)return D.marked=`property`,k()}function Ce(e,t){if(e==`async`)return D.marked=`property`,k(Ce);if(e==`variable`||D.style==`keyword`){if(D.marked=`property`,t==`get`||t==`set`)return k(we);var n;return c&&D.state.fatArrowAt==D.stream.start&&(n=D.stream.match(/^\s*:\s*/,!1))&&(D.state.fatArrowAt=D.stream.pos+n[0].length),k(Te)}if(e==`number`||e==`string`)return D.marked=a?`property`:D.style+` property`,k(Te);if(e==`jsonld-keyword`)return k(Te);if(c&&te(t))return D.marked=`keyword`,k(Ce);if(e==`[`)return k(L,ke,I(`]`),Te);if(e==`spread`)return k(ce,Te);if(t==`*`)return D.marked=`keyword`,k(Ce);if(e==`:`)return O(Te)}function we(e){return e==`variable`?(D.marked=`property`,k($e)):O(Te)}function Te(e){if(e==`:`)return k(ce);if(e==`(`)return O($e)}function Ee(e,t,n){function r(i,a){if(n?n.indexOf(i)>-1:i==`,`){var o=D.state.lexical;return o.info==`call`&&(o.pos=(o.pos||0)+1),k(function(n,r){return n==t||r==t?O():O(e)},r)}return i==t||a==t?k():n&&n.indexOf(`;`)>-1?O(e):k(I(t))}return function(n,i){return n==t||i==t?k():O(e,r)}}function De(e,t,n){for(var r=3;r<arguments.length;r++)D.cc.push(arguments[r]);return k(P(t,n),Ee(e,t),F)}function Oe(e){return e==`}`?k():O(oe,Oe)}function ke(e,t){if(c){if(e==`:`)return k(Ne);if(t==`?`)return k(ke)}}function Ae(e,t){if(c&&(e==`:`||t==`in`))return k(Ne)}function je(e){if(c&&e==`:`)return D.stream.match(/^\s*\w+\s+is\b/,!1)?k(L,Me,Ne):k(Ne)}function Me(e,t){if(t==`is`)return D.marked=`keyword`,k()}function Ne(e,t){if(t==`keyof`||t==`typeof`||t==`infer`||t==`readonly`)return D.marked=`keyword`,k(t==`typeof`?ce:Ne);if(e==`variable`||t==`void`)return D.marked=`type`,k(ze);if(t==`|`||t==`&`)return k(Ne);if(e==`string`||e==`number`||e==`atom`)return k(ze);if(e==`[`)return k(P(`]`),Ee(Ne,`]`,`,`),F,ze);if(e==`{`)return k(P(`}`),R,F,ze);if(e==`(`)return k(Ee(Re,`)`),Pe,ze);if(e==`<`)return k(Ee(Ne,`>`),Ne);if(e==`quasi`)return O(Ie,ze)}function Pe(e){if(e==`=>`)return k(Ne)}function R(e){return e.match(/[\}\)\]]/)?k():e==`,`||e==`;`?k(R):O(Fe,R)}function Fe(e,t){if(e==`variable`||D.style==`keyword`)return D.marked=`property`,k(Fe);if(t==`?`||e==`number`||e==`string`)return k(Fe);if(e==`:`)return k(Ne);if(e==`[`)return k(I(`variable`),Ae,I(`]`),Fe);if(e==`(`)return O(et,Fe);if(!e.match(/[;\}\)\],]/))return k()}function Ie(e,t){return e==`quasi`?t.slice(t.length-2)=="${"?k(Ne,Le):k(Ie):O()}function Le(e){if(e==`}`)return D.marked=`string-2`,D.state.tokenize=b,k(Ie)}function Re(e,t){return e==`variable`&&D.stream.match(/^\s*[?:]/,!1)||t==`?`?k(Re):e==`:`?k(Ne):e==`spread`?k(Re):O(Ne)}function ze(e,t){if(t==`<`)return k(P(`>`),Ee(Ne,`>`),F,ze);if(t==`|`||e==`.`||t==`&`)return k(Ne);if(e==`[`)return k(Ne,I(`]`),ze);if(t==`extends`||t==`implements`)return D.marked=`keyword`,k(Ne);if(t==`?`)return k(Ne,I(`:`),Ne)}function Be(e,t){if(t==`<`)return k(P(`>`),Ee(Ne,`>`),F,ze)}function Ve(){return O(Ne,He)}function He(e,t){if(t==`=`)return k(Ne)}function Ue(e,t){return t==`enum`?(D.marked=`keyword`,k(z)):O(We,ke,qe,Je)}function We(e,t){if(c&&te(t))return D.marked=`keyword`,k(We);if(e==`variable`)return ee(t),k();if(e==`spread`)return k(We);if(e==`[`)return De(Ke,`]`);if(e==`{`)return De(Ge,`}`)}function Ge(e,t){return e==`variable`&&!D.stream.match(/^\s*:/,!1)?(ee(t),k(qe)):(e==`variable`&&(D.marked=`property`),e==`spread`?k(We):e==`}`?O():e==`[`?k(L,I(`]`),I(`:`),Ge):k(I(`:`),We,qe))}function Ke(){return O(We,qe)}function qe(e,t){if(t==`=`)return k(ce)}function Je(e){if(e==`,`)return k(Ue)}function Ye(e,t){if(e==`keyword b`&&t==`else`)return k(P(`form`,`else`),oe,F)}function Xe(e,t){if(t==`await`)return k(Xe);if(e==`(`)return k(P(`)`),Ze,F)}function Ze(e){return e==`var`?k(Ue,Qe):e==`variable`?k(Qe):O(Qe)}function Qe(e,t){return e==`)`?k():e==`;`?k(Qe):t==`in`||t==`of`?(D.marked=`keyword`,k(L,Qe)):O(L,Qe)}function $e(e,t){if(t==`*`)return D.marked=`keyword`,k($e);if(e==`variable`)return ee(t),k($e);if(e==`(`)return k(ie,P(`)`),Ee(nt,`)`),F,je,oe,N);if(c&&t==`<`)return k(P(`>`),Ee(Ve,`>`),F,$e)}function et(e,t){if(t==`*`)return D.marked=`keyword`,k(et);if(e==`variable`)return ee(t),k(et);if(e==`(`)return k(ie,P(`)`),Ee(nt,`)`),F,je,N);if(c&&t==`<`)return k(P(`>`),Ee(Ve,`>`),F,et)}function tt(e,t){if(e==`keyword`||e==`variable`)return D.marked=`type`,k(tt);if(t==`<`)return k(P(`>`),Ee(Ve,`>`),F)}function nt(e,t){return t==`@`&&k(L,nt),e==`spread`?k(nt):c&&te(t)?(D.marked=`keyword`,k(nt)):c&&e==`this`?k(ke,qe):O(We,ke,qe)}function rt(e,t){return e==`variable`?it(e,t):at(e,t)}function it(e,t){if(e==`variable`)return ee(t),k(at)}function at(e,t){if(t==`<`)return k(P(`>`),Ee(Ve,`>`),F,at);if(t==`extends`||t==`implements`||c&&e==`,`)return t==`implements`&&(D.marked=`keyword`),k(c?Ne:L,at);if(e==`{`)return k(P(`}`),ot,F)}function ot(e,t){if(e==`async`||e==`variable`&&(t==`static`||t==`get`||t==`set`||c&&te(t))&&D.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return D.marked=`keyword`,k(ot);if(e==`variable`||D.style==`keyword`)return D.marked=`property`,k(st,ot);if(e==`number`||e==`string`)return k(st,ot);if(e==`[`)return k(L,ke,I(`]`),st,ot);if(t==`*`)return D.marked=`keyword`,k(ot);if(c&&e==`(`)return O(et,ot);if(e==`;`||e==`,`)return k(ot);if(e==`}`)return k();if(t==`@`)return k(L,ot)}function st(e,t){if(t==`!`||t==`?`)return k(st);if(e==`:`)return k(Ne,qe);if(t==`=`)return k(ce);var n=D.state.lexical.prev;return O(n&&n.info==`interface`?et:$e)}function ct(e,t){return t==`*`?(D.marked=`keyword`,k(mt,I(`;`))):t=="default"?(D.marked=`keyword`,k(L,I(`;`))):e==`{`?k(Ee(lt,`}`),mt,I(`;`)):O(oe)}function lt(e,t){if(t==`as`)return D.marked=`keyword`,k(I(`variable`));if(e==`variable`)return O(ce,lt)}function ut(e){return e==`string`?k():e==`(`?O(L):e==`.`?O(fe):O(dt,ft,mt)}function dt(e,t){return e==`{`?De(dt,`}`):(e==`variable`&&ee(t),t==`*`&&(D.marked=`keyword`),k(pt))}function ft(e){if(e==`,`)return k(dt,ft)}function pt(e,t){if(t==`as`)return D.marked=`keyword`,k(dt)}function mt(e,t){if(t==`from`)return D.marked=`keyword`,k(L)}function ht(e){return e==`]`?k():O(Ee(ce,`]`))}function z(){return O(P(`form`),We,I(`{`),P(`}`),Ee(gt,`}`),F,F)}function gt(){return O(We,qe)}function _t(e,t){return e.lastType==`operator`||e.lastType==`,`||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function vt(e,t,n){return t.tokenize==_&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType==`quasi`&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return{startState:function(e){var t={tokenize:_,lastType:`sof`,cc:[],lexical:new w((e||0)-r,0,`block`,!1),localVars:n.localVars,context:n.localVars&&new ne(null,null,!1),indented:e||0};return n.globalVars&&typeof n.globalVars==`object`&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty(`align`)||(t.lexical.align=!1),t.indented=e.indentation(),S(e,t)),t.tokenize!=y&&e.eatSpace())return null;var n=t.tokenize(e,t);return m==`comment`?n:(t.lastType=m==`operator`&&(h==`++`||h==`--`)?`incdec`:m,E(t,n,m,h,e))},indent:function(t,a){if(t.tokenize==y||t.tokenize==b)return e.Pass;if(t.tokenize!=_)return 0;var o=a&&a.charAt(0),s=t.lexical,c;if(!/^\s*else\b/.test(a))for(var l=t.cc.length-1;l>=0;--l){var u=t.cc[l];if(u==F)s=s.prev;else if(u!=Ye&&u!=N)break}for(;(s.type==`stat`||s.type==`form`)&&(o==`}`||(c=t.cc[t.cc.length-1])&&(c==fe||c==pe)&&!/^[,\.=+\-*:?[\(]/.test(a));)s=s.prev;i&&s.type==`)`&&s.prev.type==`stat`&&(s=s.prev);var d=s.type,f=o==d;return d==`vardef`?s.indented+(t.lastType==`operator`||t.lastType==`,`?s.info.length+1:0):d==`form`&&o==`{`?s.indented:d==`form`?s.indented+r:d==`stat`?s.indented+(_t(t,a)?i||r:0):s.info==`switch`&&!f&&n.doubleIndentSwitch!=0?s.indented+(/^(?:case|default)\b/.test(a)?r:2*r):s.align?s.column+ +!f:s.indented+(f?0:r)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:o?null:`/*`,blockCommentEnd:o?null:`*/`,blockCommentContinue:o?null:` * `,lineComment:o?null:`//`,fold:`brace`,closeBrackets:`()[]{}''""\`\``,helperType:o?`json`:`javascript`,jsonldMode:a,jsonMode:o,expressionAllowed:vt,skipExpression:function(t){E(t,`atom`,`atom`,`true`,new e.StringStream(``,2,null))}}}),e.registerHelper(`wordChars`,`javascript`,/[\w$]/),e.defineMIME(`text/javascript`,`javascript`),e.defineMIME(`text/ecmascript`,`javascript`),e.defineMIME(`application/javascript`,`javascript`),e.defineMIME(`application/x-javascript`,`javascript`),e.defineMIME(`application/ecmascript`,`javascript`),e.defineMIME(`application/json`,{name:`javascript`,json:!0}),e.defineMIME(`application/x-json`,{name:`javascript`,json:!0}),e.defineMIME(`application/manifest+json`,{name:`javascript`,json:!0}),e.defineMIME(`application/ld+json`,{name:`javascript`,jsonld:!0}),e.defineMIME(`text/typescript`,{name:`javascript`,typescript:!0}),e.defineMIME(`application/typescript`,{name:`javascript`,typescript:!0})})}))();var{documentElement:Sz,compatMode:Cz}=document,wz=Cz===`CSS1Compat`;function Tz(e){let t=e.offsetParent;for(;t!==null&&t!==Sz&&getComputedStyle(t).position===`static`;)t=t.offsetParent;return t||Sz}function Ez(e){let t=e.parentNode;for(;t!==null&&t!==Sz&&getComputedStyle(t).overflow===`visible`;)t=t.parentNode;return t||Sz}function Dz(e=null){let t=0,n=0;if(typeof e?.getBoundingClientRect==`function`){let r=e.getBoundingClientRect();t=-r.top,n=-r.left}else if(wz)t=window.pageYOffset||Sz.scrollTop,n=window.pageXOffset||Sz.scrollLeft;else{let{body:r}=document;e!==r&&(t=r.scrollTop-r.clientTop,n=r.scrollLeft-r.clientLeft)}return{left:n,top:t}}function Oz(e,t=null){let n=Dz(t),r=0,i=0,a=0,o=0;return e instanceof Element&&typeof e?.getBoundingClientRect==`function`&&({top:r,left:i,right:a,bottom:o}=e.getBoundingClientRect()),{top:r+n.top,left:i+n.left,right:a+n.left,bottom:o+n.top,width:a-i,height:o-r}}function kz(e,t=null){let{top:n,left:r}=e===(wz?Sz:document.body)&&!t?Dz():Oz(e,t),i=0,a=0;return!e||e instanceof Window?(i=window.innerWidth||0,a=window.innerHeight||0):(n+=e.clientTop,r+=e.clientLeft,i=e.clientWidth,a=e.clientHeight),{top:n,left:r,right:r+i,bottom:n+a,width:i,height:a}}var Az=`discovery-view-editor-hints-popup`,jz=`discovery-view-editor-hint`,Mz=`active`,Nz=window.requestAnimationFrame||(e=>setTimeout(e,1e3/60)),Pz=window.cancelAnimationFrame||clearTimeout;yz.default.commands.autocomplete=yz.default.showHint,yz.default.defineOption(`showHintOptions`,null),yz.default.defineExtension(`showHint`,function(e){e={closeOnUnfocus:!0,container:null,...this.options.showHintOptions,...e},this.state.completionActive&&this.state.completionActive.close(),!(this.listSelections().length>1)&&(this.somethingSelected()||typeof e.hint==`function`&&(this.state.completionActive=new Fz(this,e),this.state.completionActive.update(!0),yz.default.signal(this,`startCompletion`,this)))});var Fz=class{constructor(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor(`start`),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,e.on(`cursorActivity`,this.activityFunc=()=>this.cursorActivity()),t.closeOnUnfocus){let t;this.onFocus=()=>clearTimeout(t),this.onBlur=()=>t=setTimeout(()=>this.close(),100),e.on(`focus`,this.onFocus),e.on(`blur`,this.onBlur)}}close(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off(`cursorActivity`,this.activityFunc),this.options.closeOnUnfocus&&(this.cm.off(`blur`,this.onBlur),this.cm.off(`focus`,this.onFocus)),this.widget&&(this.data&&yz.default.signal(this.data,`close`),this.widget.close()),yz.default.signal(this.cm,`endCompletion`,this.cm))}active(){return this.cm.state.completionActive===this}pick(e,t){let n=e.list[t];this.cm.state.completionEnabled=!1,n.hint?n.hint(this.cm,e,n):this.cm.replaceRange(Iz(n),n.from||e.from,n.to||e.to,`complete`),yz.default.signal(e,`pick`,n),this.close()}cursorActivity(){this.debounce&&=(Pz(this.debounce),0);let e=this.cm.getCursor(),t=this.cm.getLine(e.line);e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()?this.close():(this.debounce=Nz(()=>this.update()),this.widget&&this.widget.disable())}update(e){if(this.tick===null)return;let t=++this.tick;Promise.resolve(this.options.hint(this.cm,this.options)).then(n=>{this.tick==t&&this.finishUpdate(n,e)})}finishUpdate(e){this.data&&yz.default.signal(this.data,`update`);let t=this.widget&&this.widget.picked;this.widget&&this.widget.close(),this.data=e,e&&e.list.length&&(t&&e.list.length==1?this.pick(e,0):(this.widget=new Rz(this,e),yz.default.signal(e,`shown`)))}};function Iz(e){return typeof e==`string`?e:e.text}function Lz(e,t){for(;t&&t.parentNode!==e;)t=t.parentNode;return t}var Rz=class{constructor(e,t){let n=e.cm,r=this.hintsEl=document.createElement(`ul`),i=[Az,e.cm.options.theme].filter(Boolean),a=e.options.container||document.body;this.rootEls=new Set([a.getRootNode()]),this.completion=e,this.data=t,this.picked=!1,this.selectedHint=t.selectedHint||0,r.style.visibility=`hidden`,r.classList.add(...i),a.appendChild(r),this.items=t.list.map((e,n)=>{let i=r.appendChild(document.createElement(`li`));return i.className=jz,n===this.selectedHint&&i.classList.add(Mz),e.render?e.render(i,t,e):i.appendChild(document.createTextNode(e.displayText||Iz(e))),i}),n.addKeyMap(this.keyMap={Up:()=>this.changeActive(this.selectedHint-1),Down:()=>this.changeActive(this.selectedHint+1),Enter:()=>this.pick(),Tab:()=>this.pick(),Esc:()=>{n.state.completionEnabled=!1,e.close()}}),this.updatePosSize(),this.onScroll=()=>this.updatePosSize();for(let e of this.rootEls)e.addEventListener(`scroll`,this.onScroll,uz);yz.default.on(r,`mousedown`,e=>{let t=Lz(r,e.target),i=this.items.indexOf(t);i!==-1&&(this.close(),this.selectedHint=i,this.pick(),setTimeout(()=>n.focus(),1))}),yz.default.signal(t,`select`,t.list[this.selectedHint],this.items[this.selectedHint])}close(){if(this.completion.widget===this){this.completion.widget=null,this.completion.cm.removeKeyMap(this.keyMap),this.hintsEl.remove();for(let e of this.rootEls)e.removeEventListener(`scroll`,this.onScroll,uz)}}disable(){this.completion.cm.removeKeyMap(this.keyMap),this.keyMap={Enter:()=>this.picked=!0},this.completion.cm.addKeyMap(this.keyMap)}pick(){this.completion.pick(this.data,this.selectedHint)}changeActive(e,t){e>=this.items.length?e=t?this.items.length-1:0:e<0&&(e=t?0:this.items.length-1);let n=this.items[this.selectedHint],r=this.items[this.selectedHint=e];r!==n&&(n&&n.classList.remove(Mz),r.classList.add(Mz),r.offsetTop<this.hintsEl.scrollTop?this.hintsEl.scrollTop=r.offsetTop-3:r.offsetTop+r.offsetHeight>this.hintsEl.scrollTop+this.hintsEl.clientHeight&&(this.hintsEl.scrollTop=r.offsetTop+r.offsetHeight-this.hintsEl.clientHeight+3),yz.default.signal(this.data,`select`,this.data.list[this.selectedHint],r))}getCursorCoords(){let{completion:e,hintsEl:t}=this,n=e.cm,r=Tz(t),i=n.cursorCoords(null,`local`),a=Oz(n.display.wrapper,r);return{top:a.top+i.top+5,left:a.left+i.left+9,bottom:a.top+i.bottom+5,right:a.left+i.right+9}}updatePosSize(){let{hintsEl:e}=this,t=this.getCursorCoords(),{clientWidth:n,clientHeight:r}=Ez(e);e.style.left=`0px`,e.style.top=`0px`;let{width:i,height:a}=e.getBoundingClientRect(),o=r-t.bottom,s=t.top;if(o<a&&s>o){let n=Math.min(a,s-6-1);e.style.top=`${t.top-1-n-6}px`,e.style.maxHeight=`${n}px`}else e.style.top=`${t.bottom+1}px`,e.style.maxHeight=`${o-1-6}px`;let c=n-t.right,l=t.left;c<i&&l>c?(e.style.left=`${t.left+1-Math.min(i,l-6)}px`,e.style.maxWidth=`${l-6}px`):(e.style.left=`${t.right}px`,e.style.maxWidth=`${c-6}px`),e.style.visibility=`visible`}};Object.defineProperty(yz.default.prototype,"display",{configurable:!0,set(e){return e.scroller.addEventListener=function(e,t,n){EventTarget.prototype.addEventListener.call(this,e,t,typeof n==`boolean`?{capture:n,passive:[`touchstart`,`touchmove`,`wheel`,`mousewheel`].includes(e)}:n)},Object.defineProperty(this,"display",{configurable:!0,enumerable:!0,value:e}),e}});var zz=(e,t,{entry:{type:n,text:r,value:i}})=>{let a=r[0],o=r[r.length-1],s=+(a===`"`||a===`'`),c=+(o===`"`||o===`'`),l=r.toLowerCase().substring(s,r.length-c),u=l?i.toLowerCase().indexOf(l,+(i[0]===`"`||i[0]===`'`)):-1;u!==-1&&(i=fz(i.substring(0,u))+`<span class="match">`+fz(i.slice(u,u+l.length))+`</span>`+fz(i.slice(u+l.length))),e.classList.add(`type-`+n),e.appendChild($(`span`,`name`,i))},Bz=class extends _z{static CodeMirror=yz.default;el;cm;get container(){return null}constructor({hint:e,mode:t,placeholder:n}){super(),this.el=document.createElement(`div`),this.el.className=`discovery-view-editor empty-value`;let r=this,i=(0,yz.default)(this.el,{extraKeys:{"Alt-Space":`autocomplete`},mode:t||`javascript`,theme:`neo`,indentUnit:0,showHintOptions:{hint:e,get container(){return r.container}}});n&&(i.display.lineDiv.parentNode.dataset.placeholder=n),i.on(`change`,(e,t)=>{let n=i.getValue();this.el.classList.toggle(`empty-value`,n===``),this.emit(`change`,n,t)}),typeof e==`function`&&(i.on(`cursorActivity`,e=>{e.state.completionEnabled&&e.state.focused&&e.showHint()}),i.on(`focus`,e=>{e.getValue()===``&&(e.state.completionEnabled=!0),e.state.completionEnabled&&!e.state.completionActive&&e.showHint()}),i.on(`change`,(e,t)=>{t.origin!==`complete`&&(i.state.completionEnabled=!0)})),this.cm=i;let a=new gz;a.subscribe(()=>i.refresh()),a.observe(i.display.wrapper)}getValue(){return this.cm.getValue()}setValue(e){return requestAnimationFrame(()=>this.cm.refresh()),typeof e==`string`&&this.getValue()!==e&&(this.cm.setValue(e||``),!0)}focus(){this.cm.focus()}},Vz=class extends Bz{queryData;queryContext;inputPanelEl;outputPanelEl;constructor(e){super({mode:`discovery-query`,placeholder:`Enter a jora query`,hint:t=>{let n=t.getCursor(),r=e(t.getValue(),t.doc.indexFromPos(n),this.queryData,this.queryContext);return r?{list:r.slice(0,50).map(e=>({entry:e,text:e.value,render:zz,from:t.posFromIndex(e.from),to:t.posFromIndex(e.to)}))}:null}}),this.inputPanelEl=$(`div`,`discovery-view-editor__input-panel`),this.outputPanelEl=$(`div`,`discovery-view-editor__output-panel`),this.el.append(this.inputPanelEl,this.outputPanelEl)}setValue(e,t,n){let r=this.queryData!==t||this.queryContext!==n;return this.queryData=t,this.queryContext=n,super.setValue(e)?!0:(r&&this.cm.state.completionEnabled&&this.cm.state.focused&&this.cm.showHint(),!1)}},Hz=class extends Bz{constructor(){super({mode:{name:`discovery-view`,isDiscoveryViewDefined:e=>this.isViewDefined(e)}})}isViewDefined(){return!1}};yz.default.defineMode(`jora`,bz),yz.default.defineMode(`discovery-query`,bz),yz.default.defineMode(`discovery-view`,xz);function Uz(e){Object.assign(e.view,{QueryEditor:class extends Vz{get container(){return e.dom.container}},ViewEditor:class extends Hz{isViewDefined(t){return e.view.isDefined(t)||e.textView.isDefined(t)}}})}var Wz={class:`flex flex-col gap-2 h-full min-h-0`},Gz={key:0,class:`m-0 px-3 py-2 font-mono text-11px leading-relaxed whitespace-pre-wrap break-all rounded-lg border border-red-600/40 bg-red-500:8 color-red-700 dark:border-red-400/40 dark:color-red-300`},Kz={key:1,class:`px-3 py-1.5 font-mono text-11px rounded-lg border border-amber-600/40 bg-amber-500:8 color-amber-700 dark:border-amber-400/40 dark:color-amber-300`},qz=`jora query, runs as you type. Ctrl+Space for suggestions, Ctrl+Enter to run now`,Jz=W({__name:`QueryEditor`,props:Fa({syntax:{},suggestions:{}},{modelValue:{default:``},modelModifiers:{}}),emits:Fa([`run`,`suggest`,`accept`,`dismiss`],[`update:modelValue`]),setup(e,{emit:t}){let n=e,r=t,i=ro(e,`modelValue`),a=un(null),o=null,s=null,c;function l(){return s?s.indexFromPos(s.getCursor()):i.value.length}function u(e){return e[0]===`"`||e[0]===`'`?e.slice(1):e}function d(e,t,n){e.classList.add(`type-${t.type}`);let r=document.createElement(`span`);r.className=`name`;let i=u(n).toLowerCase(),a=i?t.value.toLowerCase().indexOf(i,+(t.value[0]===`"`||t.value[0]===`'`)):-1;if(a===-1)r.textContent=t.value;else{let e=document.createElement(`span`);e.className=`match`,e.textContent=t.value.slice(a,a+i.length),r.append(t.value.slice(0,a),e,t.value.slice(a+i.length))}e.appendChild(r)}function f(e){let t=Math.max(e.to,l());r(`accept`,t===e.to?e:{...e,to:t}),Qn(()=>{s&&(s.setCursor(s.posFromIndex(e.from+e.value.length)),s.focus())})}function p(){if(!s)return null;let e=n.suggestions;if(!e.length)return null;let t=s.getValue(),r=l(),i=[];for(let n of e.slice(0,50)){if(n.from>r||n.to>t.length)continue;let e=t.slice(n.from,r);e&&!u(n.value).toLowerCase().startsWith(u(e).toLowerCase())||i.push({text:n.value,from:s.posFromIndex(n.from),to:s.posFromIndex(n.to),render:t=>d(t,n,e),hint:()=>f(n)})}return i.length?{list:i}:null}return Zi(()=>{let e=a.value;if(!e)return;let t=new Bz({mode:`jora`,placeholder:qz,hint:p});t.on(`change`,(e,t)=>{t.origin!==`setValue`&&(i.value=e,r(`suggest`,l()))}),s=t.cm,s.setOption(`extraKeys`,{"Cmd-Enter":()=>r(`run`),"Ctrl-Enter":()=>r(`run`),"Ctrl-Space":()=>r(`suggest`,l()),"Alt-Space":`autocomplete`}),s.on(`endCompletion`,()=>{s?.state.completionEnabled===!1&&r(`dismiss`)}),s.on(`blur`,()=>{c=setTimeout(r,150,`dismiss`)}),s.on(`focus`,()=>clearTimeout(c)),e.appendChild(t.el),t.setValue(i.value),o=t}),ea(()=>{clearTimeout(c),s?.state.completionActive?.close(),o?.el.remove(),o=null,s=null}),Er(i,e=>o?.setValue(e??``)),Er(()=>n.suggestions,e=>{if(s){if(!e.length){s.state.completionActive?.close();return}s.hasFocus()&&(s.state.completionEnabled=!0,s.showHint())}}),(t,n)=>(K(),q(`div`,Wz,[Y(`div`,{ref_key:`hostEl`,ref:a,class:ye([`di-query-editor relative flex flex-1 min-h-24 min-w-0`,{"di-query-editor-error":e.syntax.kind===`error`}])},null,2),e.syntax.kind===`error`?(K(),q(`pre`,Gz,ke(e.syntax.message),1)):e.syntax.kind===`pending`?(K(),q(`div`,Kz,` incomplete query, keep typing `)):Z(``,!0)]))}}),Yz=`outline-none border border-base rounded bg-raised flex h-4 w-4 transition items-center justify-center data-[state=checked]:border-primary-500 data-[state=checked]:bg-primary-500 focus-visible:ring-2 focus-visible:ring-primary-500/40`,Xz=W({inheritAttrs:!1,__name:`FormCheckbox`,props:Fa({label:{},disabled:{type:Boolean}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=ro(e,`modelValue`);return(n,r)=>e.label||n.$slots.default?(K(),q(`label`,As({key:0},n.$attrs,{class:[`text-sm inline-flex gap-1.5 cursor-pointer select-none items-center`,{"op-fade saturate-0 pointer-events-none":e.disabled}]}),[X(H(aR),{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,disabled:e.disabled,class:ye(Yz)},{default:U(()=>[X(H(oR),{class:`text-white`},{default:U(()=>[...r[2]||=[Y(`div`,{class:`i-ph:check-bold text-micro text-white mt--1px`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:1},8,[`modelValue`,`disabled`]),Y(`span`,null,[G(n.$slots,`default`,{},()=>[Ts(ke(e.label),1)])])],16)):(K(),J(H(aR),As({key:1},n.$attrs,{modelValue:t.value,"onUpdate:modelValue":r[1]||=e=>t.value=e,disabled:e.disabled,class:Yz}),{default:U(()=>[X(H(oR),{class:`text-white`},{default:U(()=>[...r[3]||=[Y(`div`,{class:`i-ph:check-bold text-micro text-white mt--1px`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:1},16,[`modelValue`,`disabled`]))}}),Zz={class:`flex flex-col gap-2 text-sm`},Qz={class:`flex items-center gap-4 flex-wrap`},$z={class:`flex items-center gap-2 select-none color-base`},eB=[`disabled`],tB=W({__name:`QuerySettings`,props:{modelValue:{required:!0},modelModifiers:{},autoRun:{type:Boolean,default:!1},autoRunModifiers:{},autoRunSeconds:{default:5},autoRunSecondsModifiers:{}},emits:[`update:modelValue`,`update:autoRun`,`update:autoRunSeconds`],setup(e){let t=ro(e,`modelValue`),n=ro(e,`autoRun`),r=ro(e,`autoRunSeconds`);return(e,i)=>(K(),q(`div`,Zz,[Y(`div`,Qz,[i[5]||=Y(`span`,{class:`text-xs font-medium color-muted uppercase tracking-wide select-none`},`Filters`,-1),X(Xz,{modelValue:t.value.excludeFunctions,"onUpdate:modelValue":i[0]||=e=>t.value.excludeFunctions=e,label:`Exclude functions`},null,8,[`modelValue`]),X(Xz,{modelValue:t.value.excludeUnderscoreProps,"onUpdate:modelValue":i[1]||=e=>t.value.excludeUnderscoreProps=e,label:`Exclude _ props`},null,8,[`modelValue`]),X(Xz,{modelValue:t.value.excludeDollarProps,"onUpdate:modelValue":i[2]||=e=>t.value.excludeDollarProps=e,label:`Exclude $ props`},null,8,[`modelValue`])]),Y(`div`,$z,[X(Xz,{modelValue:n.value,"onUpdate:modelValue":i[3]||=e=>n.value=e,label:`Auto rerun every`},null,8,[`modelValue`]),gr(Y(`input`,{"onUpdate:modelValue":i[4]||=e=>r.value=e,type:`number`,min:`1`,max:`3600`,disabled:!n.value,class:`w-14 px-1.5 py-0.5 text-center rounded border border-base bg-secondary font-mono text-xs tabular-nums disabled:op-fade focus:border-primary-600/50 dark:focus:border-primary-400/50 outline-none`,"aria-label":`Auto rerun interval in seconds`},null,8,eB),[[Kl,r.value,void 0,{number:!0}]]),Y(`span`,{class:ye([`text-xs`,n.value?`color-muted`:`color-faint`])},`seconds`,2)])]))}}),nB={class:`border-b border-base flex-auto flex-col flex`},rB={class:`flex px3 py2 items-center gap-2 select-none`},iB=W({__name:`QueryPanel`,setup(e){let t=jM(),n=un(!1),r;function i(){try{navigator.clipboard.writeText(t.query.value||`$`),n.value=!0,clearTimeout(r),r=setTimeout(()=>n.value=!1,1200)}catch{}}return(e,r)=>(K(),q(`div`,nB,[Y(`div`,rB,[r[12]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Jora Query `,-1),r[13]||=Y(`a`,{href:`https://discoveryjs.github.io/jora/#article:jora-syntax`,target:`_blank`,title:`Jora query language reference`,class:`flex items-center gap-1 color-muted hover:color-active`},[Y(`span`,{class:`i-ph:question-duotone`})],-1),r[14]||=Y(`div`,{class:`flex-auto`},null,-1),H(t).query.value?(K(),J(vm,{key:0,class:`text-sm`,icon:n.value?`i-ph:check`:`i-ph:copy-duotone`,label:`Copy query`,tooltip:`Copy the jora query`,onClick:i},null,8,[`icon`])):Z(``,!0),H(t).query.value?(K(),J(nz,{key:1,class:`text-sm`,title:`Clear query`,icon:`i-ph:trash-duotone`,onClick:r[0]||=e=>H(t).query.value=``},{default:U(()=>[...r[10]||=[Y(`span`,null,`Clear`,-1)]]),_:1})):Z(``,!0),X(nz,{disabled:H(t).running.value,loading:H(t).running.value,class:`text-sm`,title:`Run query`,icon:`i-ph:play-duotone`,onClick:r[1]||=e=>H(t).runNow()},{default:U(()=>[...r[11]||=[Y(`span`,null,`Run`,-1)]]),_:1},8,[`disabled`,`loading`])]),X(Jz,{modelValue:H(t).query.value,"onUpdate:modelValue":r[2]||=e=>H(t).query.value=e,syntax:H(t).syntax.value,suggestions:H(t).suggestions.value,class:`flex-1 min-h-32 mx2`,onRun:r[3]||=e=>H(t).runNow(),onSuggest:r[4]||=e=>H(t).scheduleSuggestions(e),onAccept:r[5]||=e=>H(t).acceptSuggestion(e),onDismiss:r[6]||=e=>H(t).suggestions.value=[]},null,8,[`modelValue`,`syntax`,`suggestions`]),X(tB,{modelValue:H(t).settings,"onUpdate:modelValue":r[7]||=e=>H(t).settings=e,"auto-run":H(t).autoRun.value,"onUpdate:autoRun":r[8]||=e=>H(t).autoRun.value=e,"auto-run-seconds":H(t).autoRunSeconds.value,"onUpdate:autoRunSeconds":r[9]||=e=>H(t).autoRunSeconds.value=e,class:`py2 px4`},null,8,[`modelValue`,`auto-run`,`auto-run-seconds`])]))}}),aB={neutral:`color-scale-neutral`,low:`color-scale-low`,medium:`color-scale-medium`,high:`color-scale-high`,critical:`color-scale-critical`};function oB(e,t){for(let[n,r]of t)if(e<=n)return r;return t.at(-1)?.[1]??aB.neutral}var sB=`en-US`,cB=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`],lB=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`];function uB(e,t={}){let{base:n=1024,digits:r=2}=t;if(!e||e<0)return[`0`,`B`];let i=n===1e3?lB:cB,a=Math.min(Math.floor(Math.log(e)/Math.log(n)),i.length-1);return a===0?[String(e),`B`]:[(e/n**a).toFixed(r).replace(/\.?0+$/,``),i[a]??`B`]}var dB=1024,fB=1024*dB,pB=[[80*dB,aB.neutral],[500*dB,aB.low],[fB,aB.medium],[10*fB,aB.high],[1/0,aB.critical]];function mB(e,t=pB){return oB(e,t)}var hB={ns:1e-6,us:.001,ms:1,s:1e3};function gB(e,t={}){if(e==null)return[``,`-`];let n=t.unit??`ms`,r=e*hB[n];if(r<1){if(n===`ms`)return[`<1`,`ms`];let e=r*1e3;return e<1?[Math.round(e*1e3).toString(),`ns`]:[(e<10?e.toFixed(1):e.toFixed(0)).replace(/\.0$/,``),`µs`]}return r<1e3?[r.toFixed(0),`ms`]:r<6e4?[(r/1e3).toFixed(1),`s`]:r<36e5?[(r/6e4).toFixed(1),`min`]:r<864e5?[(r/36e5).toFixed(1),`h`]:[(r/864e5).toFixed(1),`d`]}var _B=[[50,aB.neutral],[200,aB.low],[1e3,aB.medium],[5e3,aB.high],[1/0,aB.critical]];function vB(e,t=_B){return oB(e,t)}var yB=1e3,bB=60*yB,xB=60*bB,SB=24*xB,CB=30*SB,wB=365*SB,TB=[[bB,yB,`s`],[xB,bB,`min`],[SB,xB,`h`],[CB,SB,`d`],[wB,CB,`mo`],[1/0,wB,`y`]];function EB(e,t=Date.now()){let n=t-(e instanceof Date?e.getTime():e),r=Math.abs(n);if(r<yB)return`just now`;for(let[e,t,i]of TB)if(r<e){let e=Math.round(r/t);return n>=0?`${e} ${i} ago`:`in ${e} ${i}`}return``}var DB=[[180*SB,aB.neutral],[365*SB,aB.low],[3*wB,aB.medium],[5*wB,aB.high],[1/0,aB.critical]];function OB(e,t=DB){return oB(e,t)}function kB(e,t,n){return new Intl.DateTimeFormat(n??sB,t??{dateStyle:`medium`,timeStyle:`short`}).format(e)}var AB={class:`text-xs ml-0.5 op-fade`},jB={key:0,class:`text-xs ml-1 op-mute`},MB=W({__name:`DisplayBytes`,props:{bytes:{},base:{default:1024},digits:{},colorize:{type:Boolean},scale:{},total:{},mono:{type:Boolean,default:!0}},setup(e){let t=e,n=Q(()=>uB(t.bytes,{base:t.base,digits:t.digits})),r=Q(()=>t.colorize?mB(t.bytes,t.scale):``),i=Q(()=>t.total&&t.total>0?t.bytes/t.total*100:void 0);return(t,a)=>(K(),q(`span`,{class:ye([[r.value,{"font-mono tabular-nums":e.mono}],`inline-flex gap-1 items-center`])},[t.$slots.icon?G(t.$slots,`icon`,{},void 0,void 0,0):Z(``,!0),G(t.$slots,`default`,{value:n.value[0],unit:n.value[1],percent:i.value},()=>[Y(`span`,null,[Ts(ke(n.value[0]),1),Y(`span`,AB,ke(n.value[1]),1),i.value==null?Z(``,!0):(K(),q(`span`,jB,ke(i.value.toFixed(0))+`%`,1))])])],2))}}),NB=[`datetime`],PB=W({__name:`DisplayDate`,props:{date:{},colorize:{type:Boolean},scale:{},live:{type:Boolean},interval:{default:3e4}},setup(e){let t=e,n=V(Date.now());Yu(()=>{t.live&&(n.value=Date.now())},Sn(t,`interval`)),Er(()=>t.date,()=>{t.live&&(n.value=Date.now())});let r=Q(()=>new Date(t.date).getTime()),i=Q(()=>EB(r.value,t.live?n.value:Date.now())),a=Q(()=>kB(r.value)),o=Q(()=>t.colorize?OB(Math.abs(n.value-r.value),t.scale):``);return(e,t)=>gr((K(),q(`time`,{datetime:new Date(r.value).toISOString(),class:ye(o.value)},[G(e.$slots,`default`,{relative:i.value,exact:a.value},()=>[Ts(ke(i.value),1)])],10,NB)),[[H(_m),a.value]])}}),FB={class:`text-xs ml-0.5 op-fade`},IB=W({__name:`DisplayDuration`,props:{ms:{},unit:{default:`ms`},colorize:{type:Boolean},scale:{},mono:{type:Boolean,default:!0}},setup(e){let t=e,n={ns:1e-6,us:.001,ms:1,s:1e3},r=Q(()=>gB(t.ms,{unit:t.unit})),i=Q(()=>t.colorize?vB(t.ms*n[t.unit],t.scale):``);return(t,n)=>(K(),q(`span`,{class:ye([i.value,{"font-mono tabular-nums":e.mono}])},[Ts(ke(r.value[0]),1),Y(`span`,FB,ke(r.value[1]),1)],2))}}),LB=`1.0.0-beta.99`,RB=`1.0.0-beta.15`,zB=Object.hasOwn||((e,t)=>Object.hasOwnProperty.call(e,t)),BB=Object.prototype.toString;function VB(e,t){return t!==void 0&&(qB(t)?t.forEach(t=>e.add(t)):e.add(t)),e}function HB(e,t,n){e.has(t)?e.get(t).add(n):e.set(t,new Set([n]))}function UB(e,t){return e&&zB(e,t)?e[t]:void 0}function WB(e){return typeof e==`object`&&!!e&&e.constructor===Object}function GB(e){return BB.call(e)===`[object RegExp]`}function KB(e){return e&&(qB(e)||zB(e,`length`)&&isFinite(e.length))}function qB(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function JB(e,t=0){let n=parseInt(e,10);return isNaN(n)?t:n}function YB(e){if(qB(e))return e.length>0;if(WB(e)){for(let t in e)if(zB(e,t))return!0;return!1}return!!e}var XB=(function(){return{yy:{},options:{ranges:!0},rules:[/^(?:\/\/.*?(?:\n|\r\n?|\u2028|\u2029|$)|\/\*(?:.|\s)*?(?:\*\/|$))/,/^\s+/,/^\//,/^<(?!=)/,/^/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\(?)/,/^/,(e,t)=>{if(e[0]!==(t===`template`?`}`:"`"))return null;for(let t=1;t<e.length;t++){if(e[t]==="`")return t+1;if(e[t]===`$`&&e[t+1]===`{`)return t+2;e[t]===`\\`&&t++}return null},(e,t)=>{if(e[0]!==(t===`template`?`}`:"`"))return null;for(let t=1;t<e.length;t++){if(e[t]==="`")return t+1;if(e[t]===`$`&&e[t+1]===`{`)return t+2;e[t]===`\\`&&t++}return null},/^/,/^\(/,/^\)/,/^\[/,/^\]/,/^\{/,/^\}/,/^(?:(true|false|null|undefined|Infinity|NaN)\b)/,/^and\b/,/^or\b/,/^is\b/,/^has\s+no\b/,/^has\b/,/^in\b/,/^not\s+in\b/,/^not\b/,/^no\b/,/^(?:(asc|desc)(NA?|AN?)?\b)/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\()/,/^(?:\$(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\()/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)/,/^(?:\$(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)/,/^(?:[_\d]*\.)?[_\d]+(?:[eE][-+]?[_\d]+)?\b/,/^(?:\d*\.)?\d+(?:[eE][-+]?\d+)?\b/,/^0[xX][_0-9a-fA-F]+/,/^0[xX][0-9a-fA-F]+/,/^(?:"(?:\\[\\"]|[^"])*")/,/^(?:'(?:\\[\\']|[^'])*')/,/^(?:\/(?:\\.|[^/])+\/[gimsu]*)/,/^@/,/^#/,/^\$\$/,/^\$/,/^=>/,/^=/,/^!=/,/^~=/,/^>=/,/^<=/,/^</,/^>/,/^\.\.\(/,/^\.\(/,/^\.\[/,/^\.\.\./,/^\.\./,/^\./,/^\?\?/,/^\?/,/^,/,/^:/,/^;/,/^\-/,/^\+/,/^\*/,/^\//,/^\%/,/^(?:\|)/,/^./,/^$/],conditions:{preventPrimitive:{rules:[0,1,2,3,4,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68],inclusive:!0},preventKeyword:{rules:[5,6],inclusive:!1},template:{rules:[8,9],inclusive:!1},INITIAL:{rules:[0,1,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68],inclusive:!0}},performAction(e,t,n,r){switch(n){case 0:e.commentRanges.push(t.yylloc.range);break;case 1:break;case 2:return this.popState(),40;case 3:return this.popState(),44;case 4:this.done=!1,this.popState();break;case 5:if(this.popState(),t.yytext.endsWith(`(`)){this.unput(t.yytext);return}return e.pps(),14;case 6:this.done=!1,this.popState();break;case 7:{let n=t.yytext.endsWith("`")?`TEMPLATE`:`TPL_START`;return t.yytext=this.toStringLiteral(t.yytext,!0,1+Number(n!==`TEMPLATE`)),n===`TEMPLATE`&&e.pps(),n}case 8:{let n=t.yytext.endsWith("`")?`TPL_END`:`TPL_CONTINUE`;return t.yytext=this.toStringLiteral(t.yytext,!0,1+Number(n!==`TPL_END`)),this.popState(),n===`TPL_END`&&e.pps(),n}case 9:this.parseError(`Unexpected end of input`);break;case 10:return 21;case 11:return e.pps(),22;case 12:return 61;case 13:return e.pps(),63;case 14:return 84;case 15:if(this.bracketStack[this.bracketStack.length-1]!==`TPL_END`)return e.pps(),85;this.unput(`}`),this.begin(`template`);break;case 16:return t.yytext=this.toLiteral(t.yytext),57;case 17:return 36;case 18:return 37;case 19:return 30;case 20:return 35;case 21:return 33;case 22:return 32;case 23:return 34;case 24:return 25;case 25:return 26;case 26:return 95;case 27:return t.yytext=t.yytext.slice(0,-1),70;case 28:return t.yytext=t.yytext.slice(1,-1),72;case 29:return e.pps(),14;case 30:return e.pps(),t.yytext=t.yytext.slice(1),15;case 31:return e.pps(),t.yytext=this.toNumberLiteral(t.yytext,!0),55;case 32:return e.pps(),t.yytext=this.toNumberLiteral(t.yytext),55;case 33:return e.pps(),t.yytext=this.toNumberLiteral(t.yytext,!0,!0),55;case 34:return e.pps(),t.yytext=this.toNumberLiteral(t.yytext,!1,!0),55;case 35:return e.pps(),t.yytext=this.toStringLiteral(t.yytext),54;case 36:return e.pps(),t.yytext=this.toStringLiteral(t.yytext),54;case 37:return e.pps(),t.yytext=this.toRegExp(t.yytext),56;case 38:return e.pps(),51;case 39:return e.pps(),52;case 40:return e.pps(),53;case 41:return e.pps(),9;case 42:return 20;case 43:return 42;case 44:return 43;case 45:return 48;case 46:return 47;case 47:return 45;case 48:return 44;case 49:return 46;case 50:return 69;case 51:return 66;case 52:return 67;case 53:return 89;case 54:return e.pps(),e.pks(),68;case 55:return e.pps(),e.pks(),65;case 56:return 38;case 57:return 17;case 58:return 73;case 59:return 11;case 60:return 10;case 61:return 27;case 62:return 28;case 63:return 39;case 64:return 40;case 65:return 41;case 66:return 29;case 67:this.parseError(`Bad input on line ${t.yylloc.first_line} column ${t.yylloc.first_column}\n`+this.showPosition(),{text:t.yytext,token:`BAD_TOKEN`});break;case 68:return 5}},setInput(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=!1,this._backtrack=!1,this.done=!1,this.currentCondition=`INITIAL`,this.conditionStack=[`INITIAL`],this.offset=0,this.yytext=this.match=``,this.yyleng=0,this.yylineno=0,this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.yylloc.range=[0,0],this},parseError(e,t){if(!this.yy.parser)throw Error(e);this.yy.parser.parseError(e,t)},input(){let e=this._input[this.offset],t=/\n|\r\n?|\u2028|\u2029/g.test(e);return this.offset++,this.yyleng++,this.yytext=this.match=this.yytext+e,t?(this.yylineno++,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++,this.yylloc.range[1]++,e},lineColumnForOffset(e=this.offset,t=this._input,n=1,r=0){let i=/\n|\r\n?|\u2028|\u2029/g,a=n,o=r,s=0,c;for(;(c=i.exec(t))!==null;)if(c.index<e)a++,o=0,s=c.index+c[0].length;else{o+=e-s,s=-1;break}return s!==-1&&(o+=e-s),{line:a,column:o}},setMatch(e,t){let n=this._input.slice(e,t),r=e===this.offset?{line:this.yylloc.last_line,column:this.yylloc.last_column}:this.lineColumnForOffset(e),i=e===t?r:this.lineColumnForOffset(t-e,n,r.line,r.column);this.yytext=this.match=n,this.yyleng=t-e,this.offset=t,this.yylineno=i.line-1,this.yylloc={first_line:r.line,first_column:r.column,last_line:i.line,last_column:i.column},this.yylloc.range=[e,t]},less(e){let t=this.offset-this.match.length;this.setMatch(t,t+e)},unput(e){let t=this.match.length-e.length;if(!this.match.startsWith(e,t))throw Error(`Lexer#unput() should receive a part of matched text only`);this.less(t)},more(){this._more=!0},reject(){throw Error(`reject() is allowed only when options.backtrack_lexer = true`)},showPosition(e=this.offset-this.match.length){let t=this._input,n=Math.max(e-20,0),r=Math.min(e+20,t.length),i=(n===0?``:`...`)+t.slice(n,e).replace(/\n|\r\n?|\u2028|\u2029/g,`\\n`);return i+(t.slice(e,r).replace(/\n|\r\n?|\u2028|\u2029/g,`\\n`)+(r===t.length?``:`...`))+`\n${`-`.repeat(i.length)}^`},test_match(e,t){let n;this._more=!1,this._backtrack=!1,this.setMatch(this.offset,this.offset+e[0].length),this.matches=e;let r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]);return!r&&this._backtrack?(Object.assign(this,n),!1):(this.eof()||(this.done=!1),typeof r==`number`&&this.yy.parser?this.yy.parser.terminals_[r]:r||!1)},eof(){return this.offset===this._input.length},next(){if(this.done)return 1;this.eof()&&(this.done=!0),this._more||(this.yytext=``,this.match=``);let e,t;for(let n of this.conditions[this.currentCondition].rules){let r=this.rules[n],i=this._input.slice(this.offset),a;if(typeof r==`function`){let e=r(i,this.currentCondition);switch(typeof e){case`string`:a=[e];break;case`number`:a=[i.slice(0,e)];break;default:a=e}}else a=i.match(r);if(a&&(!e||a[0].length>e[0].length)){e=a,t=n;break}}if(e)return this.test_match(e,t);if(this.eof())return 1;this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
53
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},lex(){let e;for(;!e;)e=this.next();return e},begin(e){this.currentCondition=e,this.conditionStack.push(e)},pushState(e){this.begin(e)},popState(){return this.conditionStack.pop(),this.currentCondition=this.conditionStack.length?this.conditionStack[this.conditionStack.length-1]:`INITIAL`},topState(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},stateStackSize(){return this.conditionStack.length}}})();function ZB(){this.yy={}}ZB.prototype={Parser:ZB,lexer:XB,symbols_:{error:2,root:3,block:4,EOF:5,definitions:6,e:7,def:8,$:9,";":10,":":11,$ident:12,ident:13,IDENT:14,$IDENT:15,condConsequent:16,"?":17,condAlternate:18,query:19,"=>":20,"(":21,")":22,functionArgs:23,compareFunction:24,NOT:25,NO:26,"-":27,"+":28,"|":29,IS:30,assertion:31,IN:32,HAS:33,NOTIN:34,HASNO:35,AND:36,OR:37,"??":38,"*":39,"/":40,"%":41,"=":42,"!=":43,"<":44,"<=":45,">":46,">=":47,"~=":48,queryRoot:49,relativePath:50,"@":51,"#":52,$$:53,STRING:54,NUMBER:55,REGEXP:56,LITERAL:57,template:58,object:59,array:60,"[":61,sliceNotation:62,"]":63,"method()":64,".":65,".(":66,".[":67,"..":68,"..(":69,"METHOD(":70,arguments:71,"$METHOD(":72,",":73,functionArg:74,templateString:75,templateStart:76,templateTail:77,templateEnd:78,templateContinue:79,TEMPLATE:80,TPL_START:81,TPL_CONTINUE:82,TPL_END:83,"{":84,"}":85,objectEntries:86,objectEntry:87,objectEntryKeyLiteral:88,"...":89,arrayElements:90,arrayElement:91,assertionTerm:92,assertionList:93,compareExpr:94,ORDER:95,sliceNotationComponent:96,$accept:0,$end:1},terminals_:{2:`error`,5:`EOF`,9:`$`,10:`;`,11:`:`,14:`IDENT`,15:`$IDENT`,17:`?`,20:`=>`,21:`(`,22:`)`,25:`NOT`,26:`NO`,27:`-`,28:`+`,29:`|`,30:`IS`,32:`IN`,33:`HAS`,34:`NOTIN`,35:`HASNO`,36:`AND`,37:`OR`,38:`??`,39:`*`,40:`/`,41:`%`,42:`=`,43:`!=`,44:`<`,45:`<=`,46:`>`,47:`>=`,48:`~=`,51:`@`,52:`#`,53:`$$`,54:`STRING`,55:`NUMBER`,56:`REGEXP`,57:`LITERAL`,61:`[`,63:`]`,65:`.`,66:`.(`,67:`.[`,68:`..`,69:`..(`,70:`METHOD(`,72:`$METHOD(`,73:`,`,80:`TEMPLATE`,81:`TPL_START`,82:`TPL_CONTINUE`,83:`TPL_END`,84:`{`,85:`}`,89:`...`,95:`ORDER`},productions_:[0,[3,2],[4,2],[4,1],[4,1],[4,0],[6,1],[6,2],[8,2],[8,4],[8,2],[8,4],[13,1],[12,1],[16,2],[16,1],[18,2],[18,1],[18,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,1],[7,2],[7,2],[7,2],[7,2],[7,3],[7,4],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[19,1],[19,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,3],[49,2],[49,2],[49,1],[49,1],[49,3],[49,4],[49,2],[49,2],[49,3],[49,3],[49,2],[49,2],[49,3],[49,2],[49,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[64,2],[64,3],[64,2],[64,3],[71,1],[71,3],[74,1],[23,1],[23,3],[58,1],[58,2],[77,1],[77,2],[77,2],[77,3],[75,1],[76,1],[79,1],[78,1],[59,2],[59,3],[59,4],[59,3],[59,4],[59,5],[86,1],[86,3],[88,1],[88,1],[88,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,3],[87,3],[87,3],[87,2],[87,2],[87,2],[87,5],[87,1],[87,2],[90,1],[90,3],[91,1],[91,1],[91,2],[60,2],[60,3],[60,4],[31,1],[31,2],[31,3],[31,4],[92,1],[92,1],[92,1],[92,1],[93,1],[93,3],[93,3],[24,1],[24,3],[94,2],[62,1],[62,2],[62,2],[62,3],[96,1],[96,2]],table:(function(e){function t(e){let t=e.match(/[\x20-\x2f]/g),n=t?Math.max(...t.map(e=>e.charCodeAt()-32)):-1;for(let t=n;t>=0;t--){let n=(32+t).toString(16),r;e=e.replace(RegExp(`\\[\\x`+n+`(.+?)\\]`),(e,t)=>r=t).replace(RegExp(`\\x`+n,`g`),r)}return e=e.replace(/<([^>]+?)>/g,(e,t)=>{let n=r[t[0]],i=1;return n>>5==1&&(n=n&31|r[t[1]]<<5,i=2),t.slice(i).repeat(n)}),e}function n(e){let t=[];for(let n=0;n<e.length;n++){let i=r[e[n]];if(i&32){let a=r[e[++n]];t.push(i&31|a<<5)}else t.push(i)}return t}let r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~|=`.split(``).reduce((e,t,n)=>(e[t]=n,e),Object.create(null)),[i,a,...o]=e.split(`=`).map(t),s=a.split(`;`).map(e=>{let t=[];for(let n=0;n<e.length;n++)for(let i=0,a=r[e[n]];i<3;i++)t.push(a>>i*2&3);return t}),c=o.map(n),l=n(i).map(e=>{let t=s[e],n=Object.create(null);for(let e=0;e<t.length;e++){let r=t[e];if(r!==0){let t=c[r-1].shift();n[e]=r===1?t:[r-1,t]}}return n});for(let e=0;e<c[3].length;e+=2)l[c[3][e]][c[3][e+1]]=[3];return l})(`ABCDEFGHIJKHHHHLL<NM>NOPMMQRSQRTMUVWXYYMZaEFTO<TH>PMbQRSQRcMMHdefgBhBiBHj[ BjBkBk]BFHFHlBMmBnBoBpBqBrBMMsBtBMMMMXMWMMuB[!lBMMuB]vBgBMMwBUMZMxByBzB0B1B2B3B4BH5<DB6>BvBXe7BXevBgBM<E8B>9B~ <DB|>BgCgC<EhC>gCMMiC<C!>cHdjCMfMkClClCMMmCnCnBoCpCMtBqCrCvBMMMvBMUMMsCMxBHtCHtCtCHuCvCTXHXvB<FM>cHhBhBMFFMpBpCnCqCMOOMMzBzB2BMsCwCtCtCxC7BcMrCrCHMHtCtC=A1[ V[!C["lmkCpqC]]]<FA>[#[$[%[&['UqqWJkq]K]C][([)FgCCAAE];]]A];Ag;AwU[*ClmkOpqC]<FA>[+[,U[-qqWJnqK]]C(A]wAA[.A[/kAMAqi]]<Fq>CAAAAD<JA>g;AwADwzwP8|D<GA>||DMz|PDAwDPw;AwA8AwAMA|z<F|>DAAAIjqCMAA8MAAw;AAE!<FA>#wA8AwgMA|z<F|>DAAAMz|DMAA8MAAw;AAVClmkapqC<FA>&S(AwA8AwAMA|z<F|>DAAAMz|DIAA8MAAw;AwAoAwAMA|z<F|>DAAAMz|DMAA8MAAw;AwA8AwAMA|z<F|>DAAAMz|DMAA8MAAw;AAEi"<FA>UqqWZmqKCFgCCgFEB;AAAChCACIAE<IA>C<KA>Q;AwAsAwBMA|z<F|>DAAAMz|DMAA8MAAw;AAAAk<QA>EAIC;AEV*<FA>#E <FA>+A <FA>#AE!<FA>%VlqCAAE;AARClC<MA>KCIEAICAAAYl;AwE~lmkOp6y<F|>X-OFg~OAA0;AwA|wzwP8|z<F|>D||DMz|PPAw|PAAw;AAEClmkKpqC<FA>'aC(AAADwzwD8|D<GA>||DMw|PDAw|D;M;AAEi"<FA>UqqWZmqKC)B;AwA8.<Fq>CAAAMz|DMAA8MAA<Cg;AAAAAA>AI<QA>I;<FA>kAIAqi<Fq>C<OA>g;AAU!<FA>$<HA>M<QA>M;AAA8AwgMA|z<F|>DAAAMw|DM<GA>w;AwA8A0AMA6jq|qqqCAAAMz|DMAA8MAAw;AwA8A0AMA|z||q||DAAAMz|DMAA8MAAw<C;AAAAAAAAAAAAAAAAAAAAAC>AAI;AAAg<RA>D<KA>B;AAAgAkAAAqi<Fq>CAAAADAAM<GA>gB;<VA>DAAM;AAEy"<FA>+AE!<FA>,O(AAAChCACA<KA>C<KA>Q;AAAChCACIAE<IA>C<KA>QB;<HA>I;AwA8AkAMA6i<Fq>CAAAMz|DMAA8MAAw;<FA>kAAAqi<Fq>C<JA>FoAAAg;<YA>IAAAI;AAQClC<MA>KCIEAICAAAYl;<YA>MAAAM;AAAo<UA>MAAAM;AAEq"<FA>&OFgCOAAE;AAEi"<FA>&OFgCOAAE;AAE!<FA>&OFgCOAAE;AAAg<UA>MAAAM;AAAClmECAgC<FA>&OFgCO;AAAw<UA>MAAAM;<FA>/<Fq>C<HA>M<GA>g;AwA8A0AMA6z||qqqCAAAMz|DMAA8MAAw;AwA8A0AMA6jqvqqqCAAAMz|DMAA8MAAw;AwA8A0AMA6jquqqqCAAAMz|DMAA8MAAw;AwA8A0AMA|z<F|>DAAAMz|DMAA8MAAw;AwA8A0AMA6z||qvqDAAAMz|DMAA8MAAw;AwA8A0AMA6z||q||DAAAMz|DMAA8MAAw;AAAgAkAAAqi<Fq><CCAAAA><FA>gB;<FA>C<SA>Q;<FA>kAAAqi<Fq>C<OA>g;AAAIAkAAAqi<Fq>C<OA>g;AAE!<FA>UqqWJmqKCFgCCgEE;<VA>D;AAAwAkAAAqi<Fq>CAAAAD<JA>g;<FA>kAAAqi<Fq>CAAAADAAM<GA>g;<HA>IAAAAK;<HA>MAAAAP;AAAClC<MA>KCIEAICAAAIl;<FA>kAAAqi<Fq>C<HA>MAAAMAAg;<FA>kAAAqi<Fq><CCAAAA><FA>g;<UA>IgqCMAAAM;AAAIAkAAAqi<Fq>C<HA>MAAAMAAg;AAAg=BC[ D[!E["[#F[$QhBgBG]][%[&['[(KRSbcd]iB]pBqB]T]]]]zB[)0B$%qC]y[*C[[,+[-0ChBgB]]G%]]5C4C#3C'6CpBqBT9*~*|*gD+pD-G(lD[.iBpBqB]nDqDToDzDtDuD2D4D5D6D 7D 8D9D~D gE|D"jE-G&hEiEkETpEF[/sEtEuE]oEqEvE1E+4E-G'3EpBqBT4E-G'6EpBqBTqC8E7!zD9EuD~E+|E+gF+hF+iF+jF+kF+lF+mF+nF+oF+pF+qF+rF+sF+tF+uF+vF+wF+xFzF-G(0F.ToD1F2F3F 4F 5F6F7F qC8F+qChG0B$%jG-G&iG<EqC>kG+lG+pGqCqGrG+sG+zDtGzDwGuDvGxG+qC1G)2G3GjE-G&4GiEkET0B/8GqEvE~G+gH+hH+jH,kHRSbcd.qCqCqCpH0B$%<UqC>qGqCvH+xH<EqC>4H-G&3HT5HqCqCzDwGuD6HqCqCjE-G&~HiEkETiItEuEgIvElI+qCmI+qCqCnI+qC5C4C"pI+qCqCqI+qCzDsIuDzDtIuD~G+iItEuEgIvE<FqC>xI+yI+qCqC=[ [!["P[#[$[%[&['tBIsBHJ]LMNO][(oB[)fUVWXYZae]]][*jBkBlBmBnBuBvBwBxB]]r]]B]y][+B[,![-[.sB|B~B][/1B2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC]]]rC]sCtCuCvCwCxCzC#B1CPtB7CsBHJ2CLMNO(*rB8C<EzC#B>hDiDjDkDzCrD%mD*rBsDyDxD1DwDvD0D3D<CtBuBvB!!>zC$mElErBrEtB1DyEzE0EwEuBvBnExEzC&)*rBzC'2ELMNO(*rBzC'5ELMNO(*rB-rC DxD1DwDvD0D<TzC#B>3DzCrD%yF*rBtBuBv<CB">BtBuBv+zC#B9F~F|FsBgG|B~B/rC!1CzC#B<C|B~B3B4B5B6BgChCiCjCkClCmCnCoCpC><CgChCiC><CzC#B>mGnGoGrDrD-rC<CzC#B>yDxD1DuG0DyDxD1DwDvD0DzC&)*rByGzG0G.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC,mElErCzC$mElErB6G5GrEtB1DyEzE0EwEuBvB7GxEhDiDzCjD9G#BzC|G#BzC#BiHzC#BzCtB1DsBlH(*rB.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpCmHnH-rCoHnH.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC!<E|B~BgChCiCjCkClCmCnCoCpC>|B~B3B4B5B6B9BgChCiCjCkClCmCnCoCpC|B~B3B4B5B6B7B9BgChCiCjCkClCmCnCoCpC|B~B3B4B5B6BgChCiCjCkClCmCnCoCp<CCgChCi><CC|B~BgChCiClCmCnCo><FC|B~BgChCi>ClCmCnCoCrD-qHrCrHsHtHuH-rCzC#BwHyHsBzH|B~B/rC-rC0H-rC1H-rCzC%2H*rBsDrD<C-rC>yDxD1DwDvD0D7H8H9H<C.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC>zC$mElErBhItB1DyEzE0EwEuBvB|HxEkIjI<CzC#B-rC>-rCzC#B-oIrCsCtCuCvCwCxC!zC#B.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC-rCzC#B-rCrI8H9H<CyDxD1DwDvD0D>zCuI#BhItB1DyEzE0EwEuBvBvIxE1H<D-rC>wI<C-rC><CzC#B><C-rC>=FDDDEEE<jBG><gBT><mBN><lBY><kB4B><kB6B><mB0B><mB1B><mB7E><mB2B><mB3B><mB5B><mB7B><mB8B><mB9B><mB~B><mB|B><mBgC><mBhC><lBS><mBlC><mBmC>FFF<mBlD><cP><5BM><mBrD><gBsD>BCCC<jBH><lBS><mB9E>FFF<PU><mB4B><mB6B>jDjDNNNiD<bN>iDN<WZ><Wa><jBb><jBc><jBI><jBK><mBtE>~EqEqEoEoEiFiFrErE<mBjC><mBwE><mB0E><mB1E><mB2E><mB3E><5BN><mBkC><cR><mBpC><mBqC><mBtC><mBuC><RwC><mBmD><mBnD><mBuD><gBtD><mBvD>1D1[ D6D6D7D7D]8D8D9D9D~D~DmEmE<D3D><D4D><D5D><RO><5B8C>gDgD<5B~C><Rd><mBf><agB><ahB><aiB><ajB><VkB><UlB><WmB><jBnB><jBoB><mBpB><mBqB><mBrB><dsB><dtB><hBuB><hBvB><hBwB><hBxB><dyB><mBzB><mByC><mB1C><mB2C><mB5C><mB6C><PV><mBnC><mB8E><mBiC><mBuE>|EgFjFjFsEsE<mBxE><D4E><RQ><mBrC><mBsC><mBvC><RxC><mBoD><mBpD><mBwD><mByD>iEiEjEjEkEkEnEnE<5B9C><5B|C><Re><mBzC><mB0C><mB3C><mB4C><mB7C><PW>kDkDiDiD<mBoC><jBJ><jBL><mBvE>pEpEqEqEhF<mByE><mBqD><mBxD>2D2 <mBzD>hEhE|D|DgEgEhDhD<PX><mBzE><D5E><D6E><mB0D>hEhElElE=BB`),defaultActions:{50:[2,1],201:[2,159],249:[2,161]},performAction(e,t,n,r,i,a,o){let s=a.length-1;switch(i){case 1:return r.buildResult(a[s-1]);case 2:this.$={type:`Block`,definitions:a[s-1],body:a[s],range:this._$.range};break;case 3:this.$={type:`Block`,definitions:a[s],body:{type:`Placeholder`,range:[o[s].range[1],o[s].range[1]]},range:this._$.range};break;case 4:this.$={type:`Block`,definitions:[],body:a[s],range:this._$.range};break;case 5:this.$={type:`Block`,definitions:[],body:{type:`Placeholder`,range:[o[s].range[1],o[s].range[1]]},range:this._$.range};break;case 6:case 96:case 99:case 101:case 117:case 136:case 152:case 155:this.$=[a[s]];break;case 7:a[s-1].push(a[s]);break;case 8:this.$={type:`Definition`,declarator:{type:`Declarator`,name:null,range:o[s-1].range},value:null,range:this._$.range};break;case 9:this.$={type:`Definition`,declarator:{type:`Declarator`,name:null,range:o[s-3].range},value:a[s-1],range:this._$.range};break;case 10:this.$={type:`Definition`,declarator:{type:`Declarator`,name:a[s-1].name,range:o[s-1].range},value:null,range:this._$.range};break;case 11:this.$={type:`Definition`,declarator:{type:`Declarator`,name:a[s-3].name,range:o[s-3].range},value:a[s-1],range:this._$.range};break;case 12:case 13:case 98:case 148:case 149:this.$={type:`Identifier`,name:a[s],range:this._$.range};break;case 14:case 16:case 163:this.$=a[s];break;case 15:case 17:this.$={type:`Placeholder`,range:[o[s].range[1],o[s].range[1]]};break;case 18:case 162:this.$=null;break;case 19:case 52:case 53:case 64:case 65:case 138:break;case 20:case 22:this.$={type:`Function`,arguments:[],body:a[s],range:this._$.range};break;case 21:this.$={type:`Function`,arguments:[{type:`Identifier`,name:a[s-2],range:o[s-2].range}],body:a[s],range:this._$.range};break;case 23:this.$={type:`Function`,arguments:a[s-3],body:a[s],range:this._$.range};break;case 24:this.$={type:`CompareFunction`,compares:a[s],range:this._$.range};break;case 25:case 26:case 27:case 28:case 67:this.$={type:`Prefix`,operator:a[s-1],argument:a[s],range:this._$.range};break;case 29:this.$={type:`Pipeline`,left:a[s-2],right:a[s],range:this._$.range};break;case 30:this.$={type:`Pipeline`,left:a[s-3],right:{type:`Block`,definitions:a[s-1],body:a[s]},range:this._$.range};break;case 31:this.$={type:`Postfix`,operator:a[s],argument:a[s-2],range:this._$.range};break;case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:this.$={type:`Binary`,operator:a[s-1],left:a[s-2],right:a[s],range:this._$.range};break;case 51:this.$={type:`Conditional`,test:a[s-2],consequent:a[s-1],alternate:a[s],range:this._$.range};break;case 54:this.$={type:`Data`,range:this._$.range};break;case 55:this.$={type:`Context`,range:this._$.range};break;case 56:this.$={type:`Current`,range:this._$.range};break;case 57:this.$={type:`Arg1`,range:this._$.range};break;case 58:this.$={type:`Reference`,name:a[s],range:this._$.range};break;case 59:case 60:case 61:case 62:case 107:case 108:case 109:case 110:case 119:case 120:case 121:this.$={type:`Literal`,value:a[s],range:this._$.range};break;case 63:this.$={type:`Template`,values:a[s],range:this._$.range};break;case 66:this.$={type:`SliceNotation`,value:null,arguments:a[s-1],range:this._$.range};break;case 68:this.$={type:`Conditional`,test:null,consequent:a[s-1],alternate:a[s],range:this._$.range};break;case 69:case 73:this.$={type:`GetProperty`,value:null,property:a[s],range:this._$.range};break;case 70:case 74:this.$={type:`MethodCall`,value:null,method:a[s],range:this._$.range};break;case 71:this.$={type:`Parentheses`,body:a[s-1],range:this._$.range};break;case 72:this.$={type:`Parentheses`,body:{type:`Block`,definitions:a[s-2],body:a[s-1]},range:this._$.range};break;case 75:this.$={type:`Map`,value:null,query:a[s-1],range:this._$.range};break;case 76:this.$={type:`Filter`,value:null,query:a[s-1],range:this._$.range};break;case 77:this.$={type:`MapRecursive`,value:null,query:{type:`GetProperty`,value:null,property:a[s]},range:this._$.range};break;case 78:this.$={type:`MapRecursive`,value:null,query:{type:`MethodCall`,value:null,method:a[s]},range:this._$.range};break;case 79:this.$={type:`MapRecursive`,value:null,query:a[s-1],range:this._$.range};break;case 80:this.$={type:`Pipeline`,left:null,right:a[s],range:this._$.range};break;case 81:this.$={type:`Pipeline`,left:null,right:{type:`Block`,definitions:a[s-1],body:a[s]},range:this._$.range};break;case 82:this.$={type:`Pick`,value:a[s-2],getter:null,range:this._$.range};break;case 83:this.$={type:`Pick`,value:a[s-3],getter:a[s-1],range:this._$.range};break;case 84:this.$={type:`SliceNotation`,value:a[s-3],arguments:a[s-1],range:this._$.range};break;case 85:this.$={type:`GetProperty`,value:a[s-2],property:a[s],range:this._$.range};break;case 86:this.$={type:`MethodCall`,value:a[s-2],method:a[s],range:this._$.range};break;case 87:this.$={type:`Map`,value:a[s-3],query:a[s-1],range:this._$.range};break;case 88:this.$={type:`Filter`,value:a[s-3],query:a[s-1],range:this._$.range};break;case 89:this.$={type:`MapRecursive`,value:a[s-2],query:{type:`GetProperty`,value:null,property:a[s]},range:this._$.range};break;case 90:this.$={type:`MapRecursive`,value:a[s-2],query:{type:`MethodCall`,value:null,method:a[s]},range:this._$.range};break;case 91:this.$={type:`MapRecursive`,value:a[s-3],query:a[s-1],range:this._$.range};break;case 92:this.$={type:`Method`,reference:{type:`Identifier`,name:a[s-1],range:[o[s-1].range[0],o[s-1].range[1]-1]},arguments:[],range:this._$.range},this._mn=a[s-1];break;case 93:this.$={type:`Method`,reference:{type:`Identifier`,name:a[s-2],range:[o[s-2].range[0],o[s-2].range[1]-1]},arguments:a[s-1],range:this._$.range},this._mn=a[s-2];break;case 94:this.$={type:`Method`,reference:{type:`Reference`,name:{type:`Identifier`,name:a[s-1],range:[o[s-1].range[0],o[s-1].range[1]-1]},range:[o[s-1].range[0],o[s-1].range[1]-1]},arguments:[],range:this._$.range},this._mn=a[s-1];break;case 95:this.$={type:`Method`,reference:{type:`Reference`,name:{type:`Identifier`,name:a[s-2],range:[o[s-2].range[0],o[s-2].range[1]-1]},range:[o[s-2].range[0],o[s-2].range[1]-1]},arguments:a[s-1],range:this._$.range},this._mn=a[s-2];break;case 97:case 100:case 118:case 137:case 156:a[s-2].push(a[s]);break;case 102:this.$=[a[s-1],...a[s]];break;case 103:case 158:this.$=[null,a[s]];break;case 104:case 160:this.$=[a[s-1],a[s]];break;case 105:this.$=[null,a[s-1],...a[s]];break;case 106:this.$=[a[s-2],a[s-1],...a[s]];break;case 111:case 114:this.$={type:`Object`,properties:[],range:this._$.range};break;case 112:this.$={type:`Object`,properties:a[s-1],range:this._$.range};break;case 113:this.$={type:`Object`,properties:a[s-2],range:this._$.range};break;case 115:this.$={type:`Block`,definitions:a[s-2],body:{type:`Object`,properties:a[s-1]},range:this._$.range};break;case 116:this.$={type:`Block`,definitions:a[s-3],body:{type:`Object`,properties:a[s-2]},range:this._$.range};break;case 122:this.$={type:`ObjectEntry`,key:{type:`Current`},value:null,range:this._$.range};break;case 123:this.$={type:`ObjectEntry`,key:{type:`Reference`,name:a[s]},value:null,range:this._$.range};break;case 124:case 126:this.$={type:`ObjectEntry`,key:a[s],value:null,range:this._$.range};break;case 125:this.$={type:`ObjectEntry`,key:{type:`Literal`,value:this._mn},value:a[s],range:this._$.range};break;case 127:case 128:this.$={type:`ObjectEntry`,key:a[s-2],value:a[s],range:this._$.range};break;case 129:this.$={type:`ObjectEntry`,key:{type:`Identifier`,name:`$`+a[s-2].name,range:o[s-2].range},value:a[s],range:this._$.range};break;case 130:this.$={type:`ObjectEntry`,key:a[s-1],value:{type:`Pipeline`,left:{type:`Reference`,name:a[s-1]},right:a[s]},range:this._$.range};break;case 131:this.$={type:`ObjectEntry`,key:a[s-1],value:{type:`Pipeline`,left:{type:`GetProperty`,value:null,property:a[s-1]},right:a[s]},range:this._$.range};break;case 132:this.$={type:`ObjectEntry`,key:{type:`Literal`,value:this._mn},value:{type:`Pipeline`,left:a[s-1],right:a[s]},range:this._$.range};break;case 133:this.$={type:`ObjectEntry`,key:a[s-3],value:a[s],range:this._$.range};break;case 134:this.$={type:`Spread`,query:null,array:!1,range:this._$.range};break;case 135:this.$={type:`Spread`,query:a[s],array:!1,range:this._$.range};break;case 139:this.$={type:`Spread`,query:null,array:!0,range:this._$.range};break;case 140:this.$={type:`Spread`,query:a[s],array:!0,range:this._$.range};break;case 141:this.$={type:`Array`,elements:[],range:this._$.range};break;case 142:this.$={type:`Array`,elements:a[s-1],range:this._$.range};break;case 143:this.$={type:`Array`,elements:a[s-2],range:this._$.range};break;case 144:this.$={type:`Assertion`,negation:!1,assertion:a[s],range:this._$.range};break;case 145:this.$={type:`Assertion`,negation:!0,assertion:a[s],range:this._$.range};break;case 146:this.$={type:`Assertion`,negation:!1,assertion:a[s-1],range:this._$.range};break;case 147:this.$={type:`Assertion`,negation:!0,assertion:a[s-1],range:this._$.range};break;case 150:this.$={type:`Method`,reference:{type:`Reference`,name:a[s]},arguments:[],range:this._$.range};break;case 151:this.$={type:`Identifier`,name:String(a[s]),range:this._$.range};break;case 153:case 154:a[s-2].push(a[s-1],a[s]);break;case 157:this.$={type:`Compare`,query:a[s-1],order:a[s],range:this._$.range};break;case 159:this.$=[null,a[s-1],a[s]];break;case 161:this.$=[a[s-2],a[s-1],a[s]]}},trace(...e){this.DEBUG&&Jison.print(...e)},parseError(e,t){if(t.recoverable)this.trace(e);else{let n=Error(e);throw n.hash=t,n}},parse(e,...t){let n=e=>{u.length-=2*e,d.length-=e,f.length-=e},r=()=>{let e=i.lex()||1;return typeof e!=`number`&&(e=this.symbols_[e]||e),e},i=Object.create(this.lexer),a=i.options&&i.options.ranges,o={...this.yy,parser:this,lexer:i};i.setInput(e,o),typeof o.parseError==`function`&&(this.parseError=o.parseError),i.yylloc===void 0&&(i.yylloc={});let s=this.table,c={},l=i.yylloc,u=[0],d=[null],f=[l],p=``,m=0,h=0,g=0,_,v;for(;;){let e=u[u.length-1],y;if(this.defaultActions[e]?y=this.defaultActions[e]:(_??=r(),y=s[e]&&s[e][_]),!y||!y[0]){let t,a=``;if(!g){let t=[];for(let n in s[e])n in this.terminals_&&n>2&&t.push(`'`+this.terminals_[n]+`'`);a=i.showPosition?`Parse error on line `+(m+1)+`:
|
|
54
|
+
`+i.showPosition()+`
|
|
55
|
+
Expecting `+t.join(`, `)+`, got '`+(this.terminals_[_]||_)+`'`:`Parse error on line `+(m+1)+`: Unexpected `+(_===1?`end of input`:`'`+(this.terminals_[_]||_)+`'`),this.parseError(a,{text:i.match,token:this.terminals_[_]||_,line:i.yylineno,loc:l,expected:t})}if(g===3){if(_===1||v===1)throw Error(a||`Parsing halted while starting to recover from another error.`);h=i.yyleng,p=i.yytext,m=i.yylineno,l=i.yylloc,_=r()}n(t),v=_==2?null:_,_=2,e=u[u.length-1],y=s[e]&&s[e][2],g=3}if(Array.isArray(y[0])&&y.length>1)throw Error(`Parse Error: multiple actions possible at state: `+e+`, token: `+_);switch(y[0]){case 1:u.push(_),d.push(i.yytext),f.push(i.yylloc),u.push(y[1]),_=null,v?(_=v,v=null):(h=i.yyleng,p=i.yytext,m=i.yylineno,l=i.yylloc,g>0&&g--);break;case 2:{let e=this.productions_[y[1]][1],r=f[f.length-(e||1)],i=f[f.length-1];c.$=d[d.length-e],c._$={first_line:r.first_line,last_line:i.last_line,first_column:r.first_column,last_column:i.last_column},a&&(c._$.range=[r.range[0],i.range[1]]);let l=this.performAction.call(c,p,h,m,o,y[1],d,f,...t);if(l!==void 0)return l;e&&n(e),u.push(this.productions_[y[1]][0]),d.push(c.$),f.push(c._$),u.push(s[u[u.length-2]][u[u.length-1]]);break}case 3:return!0}}}};var QB=(function(e){function t(e,t){Object.entries(t).forEach(([t,n])=>e[t]=n(e[t]))}let n=new Map([[`EOF`,[`<end of input>`]],[`IDENT`,[`ident`]],[`$IDENT`,[`$ident`]],[`NOT`,[`'not'`]],[`NO`,[`'no'`]],[`IS`,[`'is'`]],[`IN`,[`'in'`]],[`HAS`,[`'has'`]],[`NOTIN`,[`'not in'`]],[`HASNO`,[`'has no'`]],[`AND`,[`'and'`]],[`OR`,[`'or'`]],[`STRING`,[`string`]],[`TPL_START`,[`template`]],[`TEMPLATE`,[`template`]],[`NUMBER`,[`number`]],[`REGEXP`,[`regexp`]],[`LITERAL`,[`'true'`,`'false'`,`'null'`,`'undefined'`,`'NaN'`,`'Infinity'`]],[`ORDER`,[`'asc'`,`'desc'`,`'ascN'`,`'descN'`]],[`METHOD(`,[`'method('`]],[`$METHOD(`,[`'$method('`]]]),r=e=>n.get(e)||`'${e}'`,i=function(e,t={},n){if(t.recoverable)this.trace(e);else{if(Array.isArray(t.inside)){let e=n.lexer.offset-n.lexer.match.length;n.lexer.setMatch(e+t.inside[0],e+t.inside[1])}let i=n.lexer.yylloc,a=[e.split(/\n/)[0],``,n.lexer.showPosition()],o=Array.isArray(t.expected)?[...new Set([].concat(...t.expected.map(e=>r(e.slice(1,-1)))))]:null;o&&a.push(``,`Expecting `+o.join(`, `)+` got `+r(t.token));let s=SyntaxError(a.join(`
|
|
56
|
+
`));throw s.details={rawMessage:e,text:t.text,token:t.token,expected:o,loc:{range:i.range,start:{line:i.first_line,column:i.first_column,offset:i.range[0]},end:{line:i.last_line,column:i.last_column,offset:i.range[1]}}},s}},a=new Set([`
|
|
57
|
+
`,`\r`,`\u2028`,`\u2029`]),o=new Map([[`undefined`,void 0],[`null`,null],[`false`,!1],[`true`,!0],[`Infinity`,1/0],[`NaN`,NaN]]);Object.assign(e.lexer,{toLiteral:e=>o.get(e),toNumberLiteral(e,t,n=!1){if(t){let t=e.match(n?/(?:^|[^0-9a-fA-F])_|_(?:[^0-9a-fA-F]|$)/:/(?:^|\D)_|_(?:\D|$)/);if(t){let e=t[0],n=t.index+Number(e[1]===`_`),r=e===`__`?`Only one underscore is allowed`:`Wrong underscore`;this.parseError(r+` as numeric separator`,{inside:[n,n+1]})}e=e.replace(/_/g,``)}return n?parseInt(e,16):parseFloat(e)},toStringLiteral(e,t=!1,n=1){let r=e.length-n,i=``;for(let n=1;n<r;n++){if(!t&&a.has(e[n])&&this.parseError(`Invalid line terminator`,{inside:[n,n+1]}),e[n]!==`\\`){i+=e[n];continue}n===r-1&&this.parseError(`Invalid backslash`,{inside:[n,n+1]});let o=e[++n];switch(o){case`\r`:n+=e[n+1]===`
|
|
58
|
+
`;break;case`
|
|
59
|
+
`:case`\u2028`:case`\u2029`:break;case`0`:i+=`\0`;break;case`b`:i+=`\b`;break;case`n`:i+=`
|
|
60
|
+
`;break;case`r`:i+=`\r`;break;case`f`:i+=`\f`;break;case`t`:i+=` `;break;case`v`:i+=`\v`;break;case`u`:{let[t=``]=e.slice(n+1,n+5).match(/^[0-9a-f]*/i)||[];if(t.length===4){i+=String.fromCharCode(parseInt(t,16)),n+=4;break}this.parseError(`Invalid Unicode escape sequence`,{inside:[n-1,Math.min(n+1+t.length,r)]});break}case`x`:{let[t=``]=e.slice(n+1,n+3).match(/^[0-9a-f]*/i)||[];if(t.length===2){i+=String.fromCharCode(parseInt(t,16)),n+=2;break}this.parseError(`Invalid hexadecimal escape sequence`,{inside:[n-1,Math.min(n+1+t.length,r)]});break}default:i+=o}}return i},toRegExp(e){let t=e.lastIndexOf(`/`)+1,n=e.substr(t);return n.split(``).forEach((e,n,r)=>{let i=r.indexOf(e,n+1);i!==-1&&this.parseError(`Duplicate flag in regexp`,{inside:[t+i,t+i+1]})}),new RegExp(e.substr(1,e.lastIndexOf(`/`)-1),n)}}),t(e.lexer,{setInput:e=>function(t,n){let r=[];return n.commentRanges=r,n.buildResult=e=>({ast:e,commentRanges:r}),n.parseError=function(...e){return i.call(this,...e,n)},n.pks=()=>{this.eof()||this.begin(`preventKeyword`)},n.pps=()=>{this.eof()||this.begin(`preventPrimitive`)},this.bracketStack=[],this.prevToken=null,this.prevYylloc={first_line:1,last_line:1,first_column:0,last_column:0,range:[0,0]},e.call(this,t,n)}});let s=new e.Parser;s.lexer={...e.lexer},s.yy={...e.yy};let c=[`AND`,`OR`,`IN`,`NOTIN`,`HAS`,`HASNO`,`IS`],l=[...c,`NOT`,`NO`,`ORDER`],u=[`+`,`-`,`*`,`/`,`%`,`|`,`=`,`!=`,`~=`,`>=`,`<=`,`<`,`>`],d=[null,`?`,`:`,`;`,`,`,`.`,`..`,`(`,`.(`,`..(`,`METHOD(`,`$METHOD(`,`[`,`.[`,`=>`,...u,...c,`NOT`,`NO`],f=[`,`,`?`,`:`,`;`,`EOF`,`]`,`)`,`}`,`TPL_CONTINUE`,`TPL_END`,...u,...c,`ORDER`],p=new Map(d.map(e=>[e,new Set(f)]));for(let e of[`.(`,`..(`,`METHOD(`,`$METHOD(`])p.get(e).delete(`)`);for(let e of[`[`,`.[`])p.get(e).delete(`]`);t(s.lexer,{lex:e=>function(){let t=this.offset,n=e.call(this);if(p.has(this.prevToken)&&p.get(this.prevToken).has(n)){let e={first_line:this.prevYylloc.last_line,last_line:this.yylloc.first_line,first_column:this.prevYylloc.last_column,last_column:this.yylloc.first_column,range:[this.prevYylloc.range[1],this.yylloc.range[0]]};if(this.unput(this.match),this.pushState(`preventPrimitive`),this.done=!1,this.yytext=``,this.yylloc=this.prevYylloc=e,t!==this.offset&&l.includes(n))switch(this._input[t]){case` `:case` `:e.last_column--,e.range[1]--;break;case`
|
|
61
|
+
`:{let n=this._input.lastIndexOf(`
|
|
62
|
+
`,t-1);e.last_line--,e.last_column=n===-1?e.last_column-1:t-n,e.range[1]--;break}}return this.prevToken=`IDENT`}if(this.prevYylloc=this.yylloc,l.includes(n))switch(this._input[this.offset]){case` `:case` `:this.prevYylloc={...this.prevYylloc,last_column:this.prevYylloc.last_column+1,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]};break;case`
|
|
63
|
+
`:this.prevYylloc={...this.prevYylloc,last_line:this.prevYylloc.last_line+1,last_column:0,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]}}return this.prevToken=n}});let m=new Map([[`(`,`)`],[`.(`,`)`],[`..(`,`)`],[`METHOD(`,`)`],[`$METHOD(`,`)`],[`[`,`]`],[`.[`,`]`],[`{`,`}`],[`TPL_START`,`TPL_END`]]),h=new Set([`)`,`]`,`}`,`TPL_END`]),g=e=>function(){let t=e.call(this);if(h.has(t)){let e=this.bracketStack.pop();e!==t&&this.parseError(`Expected "${e}" got "${t}"`)}return m.has(t)&&this.bracketStack.push(m.get(t)),t};return t(e.lexer,{lex:g}),t(s.lexer,{lex:g}),{parse(t,n){return n?s.parse(t):e.parse(t)},*tokenize(t,n,r){let i=n?s:e,a=Object.create(i.lexer);for(a.setInput(t,{parser:i});!a.done;){let e={type:a.lex(),value:a.match,offset:a.yylloc.range[0]};r&&(e.loc={range:a.yylloc.range,start:{line:a.yylloc.first_line,column:a.yylloc.first_column},end:{line:a.yylloc.last_line,column:a.yylloc.last_column}}),yield e}}}})(new ZB),$B=s({compile:()=>eV,stringify:()=>nV,walk:()=>tV});function eV(e,t){let n=t.scope.arg1;t.put(typeof n==`string`?n:`undefined`)}function tV(){}function nV(e,t){t.put(`$$`)}var rV=s({compile:()=>aV,stringify:()=>sV,suggest:()=>iV,walk:()=>oV});function iV(e,t){e.elements.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function aV(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}function oV(e,t){t.list(e.elements)}function sV(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}var cV=s({compile:()=>uV,stringify:()=>fV,suggest:()=>lV,walk:()=>dV});function lV(e,t){Array.isArray(e.assertion)||(t.range(e.assertion.range,`var`),t.range(e.assertion.range,`assertion`))}function uV(e,t){if(Array.isArray(e.assertion)){t.put(e.negation?`!(`:`(`);for(let n=0;n<e.assertion.length;n++)if(n%2==0)t.node(e.assertion[n]);else switch(e.assertion[n]){case`and`:t.put(`&&`);break;case`or`:t.put(`||`);break;default:t.error(`Bad conjuction operator in assertion`,e)}t.put(`)`)}else switch(e.negation&&t.put(`!`),e.assertion.type){case`Identifier`:e.assertion.name?(t.put(`!!`),t.tolerant&&t.put(`(typeof `),t.put(`a[`),t.node(e.assertion),t.put(`]`),t.tolerant&&(t.put(`==="function"?a[`),t.node(e.assertion),t.put(`]`)),t.put(`.call(mctx,`),t.nodeOrCurrent(),t.put(`)`),t.tolerant&&t.put(`:false)`),t.usedAssertions.has(e.assertion.name)?t.usedAssertions.get(e.assertion.name).push(e.assertion.range):t.usedAssertions.set(e.assertion.name,e.assertion.range)):t.put(`false`);break;case`Method`:t.put(`!!`),t.node(e.assertion);break;default:t.error(`Unknown assertion node type "`+e.assertion.type+`"`,e.assertion)}}function dV(e,t){if(Array.isArray(e.assertion))for(let n=0;n<e.assertion.length;n++)n%2==0&&t.node(e.assertion[n]);else t.node(e.assertion)}function fV(e,t){if(e.negation&&t.put(`not `),Array.isArray(e.assertion)){t.put(`(`);for(let n=0;n<e.assertion.length;n++)n%2==0?t.node(e.assertion[n]):(t.put(` `),t.put(e.assertion[n]),t.put(` `));t.put(`)`)}else t.node(e.assertion)}var pV=s({compile:()=>_V,stringify:()=>yV,suggest:()=>gV,walk:()=>vV}),mV={in:`in`,"not in":`notIn`,has:`has`,"has no":`hasNo`,and:`and`,or:`or`,"??":`nullish`,"+":`add`,"-":`sub`,"*":`mul`,"/":`div`,"%":`mod`,"=":`eq`,"!=":`ne`,"<":`lt`,"<=":`lte`,">":`gt`,">=":`gte`,"~=":`match`};function hV(e,t,n){if(n.type===`Array`){if(n.elements.length===0){e.range([n.range[0]+1,n.range[1]-1],`value-subset`,t,!1);return}let r=[];for(let{type:e,range:t,value:i}of n.elements)t&&(e===`Literal`||e===`Identifier`)&&r.push(i);let i=r.length?e.literalList(r):!1;for(let{type:r,range:a,value:o}of n.elements)a&&(r===`Literal`||r===`Identifier`||r===`GetProperty`&&o===null)&&e.range(a,`value-subset`,t,i)}}function gV(e,t){switch(e.operator){case`in`:t.range(e.left.range,`in-value`,e.right,null),hV(t,e.left,e.right);break;case`not in`:hV(t,e.left,e.right);break;case`has`:t.range(e.right.range,`in-value`,e.left,null),hV(t,e.right,e.left);break;case`has no`:hV(t,e.right,e.left);break;case`=`:case`!=`:t.range(e.right.range,`value`,e.left,null)}}function _V(e,t){if(!(e.operator in mV)){t.error(`Unknown operator "`+e.operator+`"`,e);return}switch(e.operator){case`and`:t.put(`!`);case`or`:{let n=t.allocateVar();t.put(`${t.buildinFn(`bool`)}(${n}=`),t.node(e.left),t.put(`)?${n}:`),t.createScope(()=>t.node(e.right),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref);break}case`??`:{let n=t.allocateVar();t.put(`(${n}=`),t.node(e.left),t.put(`,${n}!==null&&${n}!==undefined)?${n}:`),t.createScope(()=>t.node(e.right),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref);break}case`has no`:t.put(`!`);case`has`:t.put(t.buildinFn(`in`)),t.put(`(`),t.node(e.right),t.put(`,`),t.node(e.left),t.put(`)`);break;default:t.put(t.buildinFn(mV[e.operator])),t.put(`(`),t.node(e.left),t.put(`,`),t.node(e.right),t.put(`)`)}}function vV(e,t){t.node(e.left),t.node(e.right)}function yV(e,t){t.node(e.left),/^[a-z]/i.test(e.operator)?(t.put(` `),t.put(e.operator),t.put(` `)):t.put(e.operator),t.node(e.right)}var bV=s({compile:()=>SV,stringify:()=>wV,suggest:()=>xV,walk:()=>CV});function xV(e,t){e.body===null&&t.queryRoot(e.range[1])}function SV(e,t){e.definitions.length?(t.put(`(()=>{`),t.createScope(()=>{for(let{declarator:n}of e.definitions)n.name&&t.scope.awaitInit.add(t.unescapeName(`$`+n.name,n));t.list(e.definitions),t.put(`return `),t.nodeOrCurrent(e.body)},e=>e+`;`,t.scope.$ref),t.put(`})()`)):e.body&&e.body.type===`Object`?(t.put(`(`),t.nodeOrCurrent(e.body),t.put(`)`)):t.nodeOrCurrent(e.body)}function CV(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}function wV(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}var TV=s({compile:()=>DV,stringify:()=>kV,walk:()=>OV}),EV={"":`cmp`,N:`cmpNatural`,A:`cmpAnalytical`,NA:`cmpNaturalAnalytical`,AN:`cmpNaturalAnalytical`};function DV(e,t){let n=e.order.startsWith(`desc`),r=EV[e.order.slice(n?4:3)]||EV[``];n&&t.put(`-`),t.put(t.buildinFn(r)),t.put(`((_q=$=>(`),t.createScope(()=>t.node(e.query),e=>e+`,`),t.put(`))(_a),_q(_b))`)}function OV(e,t){t.node(e.query)}function kV(e,t){t.node(e.query),t.put(` `),t.put(e.order)}var AV=s({compile:()=>jV,stringify:()=>NV,walk:()=>MV});function jV(e,t){t.put(`(_a, _b)=>{let _q;return `),t.list(e.compares,`||`),t.put(`||0}`)}function MV(e,t){t.list(e.compares)}function NV(e,t){t.list(e.compares,`,`)}var PV=s({compile:()=>FV,stringify:()=>LV,walk:()=>IV});function FV(e,t){t.put(t.buildinFn(`bool`)),t.put(`(`),t.nodeOrCurrent(e.test),t.put(`)?`),t.createScope(()=>t.nodeOrCurrent(e.consequent),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref),t.put(`:`),t.createScope(()=>{e.alternate?e.alternate.type===`Placeholder`?(t.put(`(`),t.node(e.alternate),t.put(`,undefined)`)):t.node(e.alternate):t.put(`undefined`)},e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref)}function IV(e,t){t.nodeOrNothing(e.test),t.nodeOrNothing(e.consequent),t.nodeOrNothing(e.alternate)}function LV(e,t){t.nodeOrNothing(e.test),t.put(`?`),t.nodeOrNothing(e.consequent),e.alternate&&(t.put(`:`),t.node(e.alternate))}var RV=s({compile:()=>zV,stringify:()=>VV,walk:()=>BV});function zV(e,t){t.put(`context`)}function BV(){}function VV(e,t){t.put(`#`)}var HV=s({compile:()=>WV,stringify:()=>KV,suggest:()=>UV,walk:()=>GV});function UV(e,t){e.range&&t.range(e.range,`var`)}function WV(e,t){t.put(t.scope.$ref)}function GV(){}function KV(e,t){t.put(`$`)}var qV=s({compile:()=>JV,stringify:()=>XV,walk:()=>YV});function JV(e,t){t.put(`data`)}function YV(){}function XV(e,t){t.put(`@`)}var ZV=s({compile:()=>QV,stringify:()=>eH,walk:()=>$V});function QV(e,t){e.name&&t.putIdent(`$`+t.unescapeName(e.name,e),e)}function $V(){}function eH(e,t){t.put(e.name?`$`+e.name:`$`)}function tH(e,t){return{type:`GetProperty`,value:e,property:t}}function nH(e){return{type:`Identifier`,name:e}}var rH=s({compile:()=>oH,stringify:()=>cH,suggest:()=>aH,walk:()=>sH}),iH=[`$data`,`$context`,`$ctx`,`$array`,`$idx`,`$index`];function aH(e,t){e.value===null&&t.range(e.declarator.range,`path`)}function oH(e,t){let n=e.declarator.name,r=n&&t.unescapeName(`$`+n,e);if(r===null){t.node(e.declarator),t.nodeOrCurrent(e.value),t.put(`;`);return}if(t.scope.own.has(r)){t.error(`Identifier "${r}" has already been declared`,e.declarator);return}if(iH.includes(r)){t.error(`Identifier "${r}" is reserved for future use`,e.declarator);return}t.put(`const `),t.node(e.declarator),t.put(`=`),t.node(e.value||tH(null,nH(n))),t.put(`;`),t.scope.add(r),t.scope.own.add(r),t.scope.awaitInit.delete(r)}function sH(e,t){t.node(e.declarator),t.nodeOrNothing(e.value)}function cH(e,t){t.node(e.declarator),e.value!==null&&(t.put(`:`),t.node(e.value)),t.put(`;`)}var lH=s({compile:()=>uH,stringify:()=>fH,walk:()=>dH});function uH(e,t){t.put(t.buildinFn(`filter`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function dH(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function fH(e,t){t.nodeOrNothing(e.value),t.put(`.[`),t.node(e.query),t.put(`]`)}var pH=s({compile:()=>mH,stringify:()=>gH,walk:()=>hH});function mH(e,t){let n=e.arguments.map(e=>t.unescapeName(`$`+e.name,e)),r=e.arguments.find((e,t)=>t>0&&n.lastIndexOf(`$`+e.name,t-1)!==-1);r&&t.error(`Duplicate parameter name "$`+r.name+`" is not allowed`,r),t.put(`function(`),t.put(String(n)||`$`),t.put(`){return `),t.createScope(()=>{t.scope.arg1=n[1]||`arguments[1]`,t.scope.$ref=n[0]||`$`;for(let e of n)t.scope.add(e);t.node(e.body)},e=>e+`,`),t.put(`}`)}function hH(e,t){t.node(e.body)}function gH(e,t){t.put(`=>`),t.node(e.body)}var _H=s({compile:()=>yH,stringify:()=>xH,suggest:()=>vH,walk:()=>bH});function vH(e,t){t.range(e.property.range,`path`,e.value||void 0,!e.value),e.value===null&&t.range(e.property.range,`var`),e.range&&e.value===null&&e.property.range[0]!==e.range[0]&&t.queryRoot(e.range[0])}function yH(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,`),t.node(e.property),t.put(`)`)}function bH(e,t){t.nodeOrNothing(e.value),t.node(e.property)}function xH(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.property)}var SH=s({compile:()=>CH,stringify:()=>TH,walk:()=>wH});function CH(e,t){t.put(JSON.stringify(t.unescapeName(e.name,e,!1)))}function wH(){}function TH(e,t){t.put(e.name)}var EH=s({compile:()=>DH,stringify:()=>kH,walk:()=>OH});function DH(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}function OH(){}function kH(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}var AH=s({compile:()=>jH,stringify:()=>NH,walk:()=>MH});function jH(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function MH(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function NH(e,t){t.nodeOrNothing(e.value),t.put(`.(`),t.node(e.query),t.put(`)`)}var PH=s({compile:()=>FH,stringify:()=>LH,walk:()=>IH});function FH(e,t){t.put(t.buildinFn(`mapRecursive`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function IH(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function LH(e,t){t.nodeOrNothing(e.value),t.put(`..`),t.isSimpleGetPropertyQuery(e.query)||t.isSimpleMethodCallQuery(e.query)?t.node(e.query):(t.put(`(`),t.node(e.query),t.put(`)`))}var RH=s({compile:()=>BH,stringify:()=>HH,suggest:()=>zH,walk:()=>VH});function zH(e,t){e.arguments.length===0&&t.queryRoot(e.range[1]-1)}function BH(e,t,n){let r=e.reference.type===`Identifier`;t.tolerant&&t.put(`(typeof `),r?(t.usedMethods.has(e.reference.name)?t.usedMethods.get(e.reference.name).push(e.reference.range):t.usedMethods.set(e.reference.name,[e.reference.range]),t.put(`m[`),t.node(e.reference),t.put(`]`)):t.node(e.reference),t.tolerant&&(t.put(`==="function"?`),r?(t.put(`m[`),t.node(e.reference),t.put(`]`)):t.node(e.reference)),t.put(r?`.call(mctx,`:`(`),t.nodeOrCurrent(n),e.arguments.length&&(t.put(`,`),t.list(e.arguments,`,`)),t.put(`)`),t.tolerant&&t.put(`:undefined)`)}function VH(e,t){t.node(e.reference),t.list(e.arguments)}function HH(e,t){t.node(e.reference),t.put(`(`),t.list(e.arguments,`,`),t.put(`)`)}var UH=s({compile:()=>WH,stringify:()=>KH,walk:()=>GH});function WH(e,t){t.node(e.method,e.value)}function GH(e,t){t.nodeOrNothing(e.value),t.node(e.method)}function KH(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.method)}var qH=s({compile:()=>YH,stringify:()=>ZH,suggest:()=>JH,walk:()=>XH});function JH(e,t){e.properties.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function YH(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}function XH(e,t){t.list(e.properties)}function ZH(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}var QH=s({compile:()=>tU,stringify:()=>rU,suggest:()=>eU,walk:()=>nU}),$H=new Set([`Literal`,`Identifier`,`Reference`,`Current`]);function eU(e,t){if(e.value===null)switch(e.key.type){case`Literal`:case`Identifier`:t.range(e.range,`path`),t.range(e.range,`var`);break;case`Current`:case`Reference`:t.range(e.range,`var`)}}function tU(e,t){let n=e.value;switch(e.key.type){case`Current`:t.put(`...null`);return;case`Literal`:t.node(e.key),n||=tH(null,nH(String(e.key.value)));break;case`Identifier`:t.node(e.key),n||=tH(null,e.key);break;case`Reference`:t.node(e.key.name),n||=e.key;break;default:t.put(`[`),t.node(e.key),t.put(`]`)}t.put(`:`),t.node(n)}function nU(e,t){t.node(e.key),t.nodeOrNothing(e.value)}function rU(e,t){if($H.has(e.key.type)){if(t.node(e.key),e.value===null)return}else t.put(`[`),t.node(e.key),t.put(`]`);t.put(`:`),t.node(e.value)}var iU=s({compile:()=>aU,stringify:()=>sU,walk:()=>oU});function aU(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}function oU(e,t){t.node(e.body)}function sU(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}var cU=s({compile:()=>uU,stringify:()=>fU,suggest:()=>lU,walk:()=>dU});function lU(e,t){if(e.getter===null){let n=e.range[1]-1;t.range([n,n],`key`,e.value,!1),t.queryRoot(n)}else(e.getter.type===`GetProperty`||e.getter.type===`Reference`||e.getter.type===`Literal`&&typeof e.getter.value==`string`)&&t.range(e.getter.range,`key`,e.value,!1)}function uU(e,t){t.put(t.buildinFn(`pick`)),t.put(`(`),t.node(e.value),e.getter&&(t.put(`,`),t.node(e.getter)),t.put(`)`)}function dU(e,t){t.node(e.value),e.getter!==null&&t.node(e.getter)}function fU(e,t){t.node(e.value),t.put(`[`),e.getter!==null&&t.node(e.getter),t.put(`]`)}var pU=s({compile:()=>mU,stringify:()=>gU,walk:()=>hU});function mU(e,t){t.put(`($=>(`),t.createScope(()=>t.node(e.right),e=>e+`,`),t.put(`))`),t.put(`(`),t.nodeOrCurrent(e.left),t.put(`)`)}function hU(e,t){t.node(e.left),t.node(e.right)}function gU(e,t){t.node(e.left),t.put(`|`),t.node(e.right)}var _U=s({compile:()=>yU,stringify:()=>xU,suggest:()=>vU,walk:()=>bU});function vU(e,t){t.queryRoot(e.range[1])}function yU(e,t){t.put(t.scope.$ref)}function bU(){}function xU(){}var SU=s({compile:()=>CU,stringify:()=>TU,walk:()=>wU});function CU(e,t){if(e.operator&&e.operator.type){t.put(`($=>(`),t.createScope(()=>t.node(e.operator),e=>e+`,`),t.put(`))`),t.put(`(`),t.node(e.argument),t.put(`)`);return}t.error(`Unknown operator "`+e.operator+`"`,e)}function wU(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function TU(e,t){t.node(e.argument),t.put(` `),t.node(e.operator)}var EU=s({compile:()=>DU,stringify:()=>kU,walk:()=>OU});function DU(e,t){switch(e.operator){case`no`:case`not`:t.put(`!`),t.put(t.buildinFn(`bool`)),t.put(`(`),t.node(e.argument),t.put(`)`);break;case`+`:case`-`:t.put(e.operator),t.node(e.argument);break;case`is`:t.put(`!!(`),t.node(e.argument),t.put(`)`);break;default:t.error(`Unknown operator "`+e.operator+`"`,e)}}function OU(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function kU(e,t){t.put(e.operator),e.operator!==`-`&&e.operator!==`+`&&t.put(` `),t.node(e.argument)}var AU=s({compile:()=>MU,stringify:()=>PU,suggest:()=>jU,walk:()=>NU});function jU(e,t){e.range&&t.range(e.range,`var`)}function MU(e,t){let n=e.name,r=t.unescapeName(`$`+n.name,n),i=t.scope.has(r),a=t.scope.awaitInit.has(r);if(!i||a){a?(t.put(`f.awaitInitRef(()=>`),t.putIdent(r,n),t.tolerant||(t.put(`,`),t.put(JSON.stringify(r)),t.put(`,`),t.put(JSON.stringify(n.range))),t.put(`)`)):t.tolerant?t.put(`undefined`):(t.putIdent(r,e),t.error(`${r} is not defined`,e));return}t.putIdent(r,n)}function NU(e,t){t.node(e.name)}function PU(e,t){t.put(`$`),t.node(e.name)}var FU=s({compile:()=>IU,stringify:()=>RU,walk:()=>LU});function IU(e,t){t.put(t.buildinFn(`slice`)),t.put(`(`),t.nodeOrCurrent(e.value),e.arguments.slice(0,3).forEach(e=>{t.put(`,`),e?t.node(e):t.put(`undefined`)}),t.put(`)`)}function LU(e,t){t.nodeOrNothing(e.value);for(let n of e.arguments.slice(0,3))n&&t.node(n)}function RU(e,t){let[n,r,i]=e.arguments;t.nodeOrNothing(e.value),t.put(`[`),n&&t.node(n),t.put(`:`),r&&t.node(r),i&&(t.put(`:`),t.node(i)),t.put(`]`)}var zU=s({compile:()=>VU,stringify:()=>UU,suggest:()=>BU,walk:()=>HU});function BU(e,t){e.query===null&&t.queryRoot(e.range[1])}function VU(e,t){if(e.array){t.put(`...`),t.put(t.buildinFn(`ensureArray`)),t.put(`(`),t.nodeOrCurrent(e.query),t.put(`)`);return}t.put(`...`),t.nodeOrCurrent(e.query)}function HU(e,t){t.nodeOrNothing(e.query)}function UU(e,t){t.put(`...`),t.nodeOrNothing(e.query)}var WU=s({compile:()=>KU,stringify:()=>JU,suggest:()=>GU,walk:()=>qU});function GU(e,t){for(let[n,r]of Object.entries(e.values))r===null&&t.queryRoot(e.values[Number(n)-1].range[1])}function KU(e,t){for(let[n,r]of Object.entries(e.values)){let e=Number(n);r!==null&&(e!==0&&t.put(`+`),e%2==0?t.put(`"`+ZU(r.value,YU)+`"`):(t.put(`(`),t.node(r),t.put(`)`)))}}function qU(e,t){for(let n of e.values)n!==null&&t.node(n)}function JU(e,t){let n=e.values.length-1;for(let[r,i]of Object.entries(e.values)){let e=Number(r);e%2==0?(t.put(e===0?"`":`}`),t.put(ZU(i.value,XU)),t.put(e===n?"`":"${")):i!==null&&t.node(i)}}var YU=new Map([[`\b`,`\\b`],[`
|
|
64
|
+
`,`\\n`],[`\r`,`\\r`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\u2028`,`\\u2028`],[`\u2029`,`\\u2029`],[`\\`,`\\\\`],[`"`,`\\"`]]),XU=new Map([[`\b`,`\\b`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\\`,`\\\\`],[`$`,`\\$`]]);function ZU(e,t){let n=``;for(let r=0;r<e.length;r++)n+=t.get(e[r])||e[r];return n}var QU={Arg1:$B,Array:rV,Assertion:cV,Binary:pV,Block:bV,Compare:TV,Conditional:PV,Context:RV,Current:HV,Data:qV,Declarator:ZV,Definition:rH,Filter:lH,Function:pH,GetProperty:_H,Identifier:SH,Literal:EH,Map:AH,MapRecursive:PH,Method:RH,MethodCall:UH,Object:qH,ObjectEntry:QH,Parentheses:iU,Pick:cU,Pipeline:pU,Placeholder:_U,Postfix:SU,Prefix:EU,Reference:AU,SliceNotation:FU,CompareFunction:AV,Spread:zU,Template:WU},$U=e=>new Map(Object.entries(QU).map(([t,n])=>[t,n[e]]).filter(([,e])=>typeof e==`function`)),eW={};$U(`build`).forEach((e,t)=>eW[t]=e);var tW=$U(`compile`),nW=$U(`walk`),rW=$U(`stringify`),iW=$U(`suggest`);function aW(e,t){function n(e){if(nW.has(e.type))i(e),nW.get(e.type)(e,r),a(e);else throw Error(`Unknown node type "`+e.type+`"`)}let r={node:n,nodeOrNothing(e){e!==null&&n(e)},list(e){e.forEach(n)}},i=()=>{},a=()=>{};typeof t==`function`&&(t={enter:t}),t&&(typeof t.enter==`function`&&(i=t.enter),typeof t.leave==`function`&&(a=t.leave)),n(e)}function oW(e,t){return t>=0&&t<e.length&&/[a-zA-Z_$0-9]/.test(e[t])}function sW(e,t){let n=e.charCodeAt(t);return n===9||n===10||n===13||n===32}function cW(e,t,n){for(;t<n;t++)if(!sW(e,t))return!1;return!0}function lW(e,t,n,r,i){let a=[];for(let n=0;n<r.length;n++){let[i,o]=r[n];if(i>=t)break;i<e||(a.push(e,i),e=o)}return(e!==n.length||!i)&&a.push(e,t),a}function uW(e,t,n,r){let i=[];for(let a=0;a<e.length;a++){let[o,s,c,l]=e[a];if(cW(t,o,s)){for(;o>=0&&sW(t,o-1);)o--;for(;s<t.length&&sW(t,s);)s++;if(oW(t,o-1)){if(o===s)continue;o++}if(oW(t,s)){if(o===s)continue;s--}}let u=lW(o,s,t,n,r);for(let e=0;e<u.length;e+=2)i.push([u[e],u[e+1],c,l])}return i}function dW(e){let t=null,n=[],r=Object.assign(new Map,{literalList:n}),i=(e,t)=>{r.has(e)?r.get(e).push(t):r.set(e,[t])},a={range(e,n,r=t,a=!0){i(r,[...e,n,a])},literalList(e){let t=`l`+n.length;return n.push([t,e]),t},queryRoot(e,n=e){i(t,[e,n,`var`,!0]),i(t,[e,n,`path`,!0])}};return aW(e,e=>{if(iW.has(e.type)){let n=t;t=e,iW.get(e.type)(e,a),t=n}}),r}function fW(e,{ast:t,commentRanges:n}){let r=dW(t),i=n.length&&n[n.length-1][1]===e.length&&!/[\r\n]$/.test(e);for(let[t,a]of r)r.set(t,uW(a,e,n,i));return r}function pW(e){return e.type===`GetProperty`}function mW(e){return e.type===`MethodCall`}function hW(e){function t(e){if(rW.has(e.type))rW.get(e.type)(e,r);else throw Error(`Unknown node type "`+e.type+`"`)}let n=[],r={isSimpleGetPropertyQuery:pW,isSimpleMethodCallQuery:mW,put(e){n.push(e)},node:t,nodeOrNothing(e){if(e!==null)return t(e),!0},list(e,n){if(!n){e.forEach(t);return}e.forEach((e,i)=>{i>0&&r.put(n),t(e)})}};return t(e),n.join(``)}function gW(e,t,n){let r=Object.assign(Object.create(SyntaxError.prototype),n),i=Error();return r.name=e,r.message=t,Object.defineProperty(r,"stack",{get:function(){return(i.stack||``).replace(/^(.+\n){1,3}/,e+`: `+t+`
|
|
65
|
+
`)}}),r}var _W=/^[\p{ID_Start}$_]$/u,vW=/^[\p{ID_Continue}$]$/u;function yW(e,t,n){return SW(e,`query`,t,n)}function bW(e,t,n){return SW(e,`method`,t,n)}var xW=class e extends Set{constructor(e,t=[],n=!1,r=`$`){super(e),this.own=new Set,this.awaitInit=new Set(t),this.firstCurrent=null,this.captureCurrent=[],this.arg1=n,this.$ref=r}spawn(t,n){return new e(this,this.awaitInit,t,n)}};function SW(e,t,n=!1,r=null){function i(e){let t=`s`+l.length;return l.push(e?[t,e]:[t]),t}function a(e){let t=u.get(e);return t||u.set(e,t=i()),t}function o(e,t,n,r,o){let s=[e,t,JSON.stringify(n)];if(n===`var`){if(!g.scope.size)return;s.push(JSON.stringify([...g.scope]))}else r||=i(),s.push(r),o&&s.push(typeof o==`string`?o:a(o));return f.push(s),r}function s(e,n,r=`$`){let i=g.scope,a=p.length-1,s=i.arg1||t===`method`&&`arguments[1]`;if(g.scope=i.spawn(s,r),e(),g.scope.captureCurrent.length){let e=`stat(`+g.scope.captureCurrent.reduce((e,t)=>o(...t,e),void 0)+`,`+g.scope.$ref+`)`;g.scope.firstCurrent?p[g.scope.firstCurrent]=e:p[a]+=n(e)}g.scope=i}function c(e,t){let n=!1;if(r!==null){if(r.has(e))for(let[t,i,s,c]of r.get(e))s===`var`?o(t,i,s):c===!0?g.scope.captureCurrent.push([t,i,s]):(n||(n=a(e),p.push(`stat(`+n+`,`)),s&&o(t,i,s,n,c));e.type===`Current`&&g.scope.firstCurrent===null&&(g.scope.firstCurrent=p.length)}if(tW.has(e.type))tW.get(e.type)(e,g,t);else throw Error(`Unknown node type "`+e.type+`"`);n&&p.push(`)`)}let l=[],u=new WeakMap,d=[],f=[],p=[{toString(){if(t===`query`)return[`((data,context)=>{`,...g.usedMethods.size||g.usedAssertions.size?[`const method = (name,...args)=>m[name].apply(mctx,args);`,`const assertion = (name,...args)=>a[name].apply(mctx,args);`,`const mctx = Object.freeze({context,method,assertion});`]:[]].join(`
|
|
66
|
+
`)+`
|
|
67
|
+
`;if(t===`method`)return[`(function(data){`,`const mctx = this;`,`const context = mctx.context;`].join(`
|
|
68
|
+
`)+`
|
|
69
|
+
`;throw Error(`Unknown kind: `+t)}},{toString(){return d.length>0?`let `+d+`;
|
|
70
|
+
`:``}},{toString(){return l.length>0?[`const stat=(s,v)=>(s.add(v),v);
|
|
71
|
+
`,`const `+l.map(([e,t])=>e+`=new Set(`+(t?JSON.stringify(t):``)+`)`)+`;
|
|
72
|
+
`].join(``):``}},{toString(){let e=r&&Array.isArray(r.literalList)&&r.literalList.map(([e,t])=>e+`=`+JSON.stringify(t));return e&&e.length?`const `+e+`;
|
|
73
|
+
`:``}},r===null?`return `:`return{
|
|
74
|
+
value: `],m={},h=new Set,g={tolerant:n,usedAssertions:new Map,usedMethods:new Map,suggestions:r!==null,buildinFn(e){return h.add(e),`f.`+e},scope:new xW,createScope:s,error(e,t){let r=SyntaxError(e);if(t&&t.range&&(r.details={loc:{range:t.range}}),!n)throw r;return r},allocateVar(){let e=`tmp`+d.length;return d.push(e),e},unescapeName(e,t,n=!0){return e.replace(/\\u[0-9a-fA-F]{4}/g,(e,r)=>{let i=String.fromCharCode(parseInt(e.slice(2),16)),a=r===0?_W:vW;return n&&!a.test(i)&&this.error(`Bad escape sequence in indentifier name (expected ${a})`,t&&{range:[t.range[0]+r,t.range[0]+r+6]}),i})},put:e=>p.push(e),putIdent(e,t){if(!/^[\p{ID_Start}$_][\p{ID_Continue}$]*$/u.test(e))throw this.error(`Bad identifier name `+JSON.stringify(e),t);this.put(e)},node:c,nodeOrCurrent(e,t){c(e||{type:`Current`},t)},list(e,t,n){e.forEach((e,r)=>{r>0&&p.push(t),c(e,n)})}};if(s(()=>c(e),e=>(p.push(`)`),`(`+e+`,`),`data`),!n){let{usedMethods:e,usedAssertions:t}=g;t.size&&(p.unshift(` this.assertAssertions(a)||`),m.assertAssertions=function(e){for(let[n,r]of t.entries())if(!zB(e,n))return()=>{throw Object.assign(Error(`Assertion "${n}" is not defined`),{details:{loc:{range:r}}})}}),e.size&&(p.unshift(` this.assertMethods(m)||`),m.assertMethods=function(t){for(let[n,r]of e.entries())if(!zB(t,n))return()=>{throw Object.assign(Error(`Method "${n}" is not defined. If that's a custom method make sure you added it with "methods" section in options`),{details:{loc:{range:r[0]}}})}})}return r!==null&&p.push(`,
|
|
75
|
+
stats: [`+f.map(e=>`[`+e+`]`)+`],
|
|
76
|
+
methods: m,
|
|
77
|
+
assertions: a
|
|
78
|
+
}`),CW(m,`return`+p.join(``)+`})`)}function CW(e,t){try{let n=Function(`f,m,a`,t);return Object.assign(n.bind(e),{toString(){return n.toString().replace(/^(\S+\s+)anonymous([^)\s]+)\s*\)/,`$1query$2)`)}})}catch(e){throw gW(`SyntaxError`,`Jora query compilation error`,{compiledSource:`function(f,m,a){\n${t}\n}`,details:e})}}var wW=1,TW=2,EW=3,DW=4,OW=5,kW=6,AW=7,jW=8;function MW(e){switch(typeof e){case`boolean`:return wW;case`number`:return e===e?EW:TW;case`string`:return DW;case`object`:return e===null?OW:kW;case`undefined`:return jW;default:return AW}}function NW(e,t){let n=MW(e),r=MW(t);return n===r?e<t?-1:+(e>t):n<r?-1:1}function PW(e,t){let n=MW(e),r=MW(t);return n===r?n===EW?t-e:e<t?-1:+(e>t):n<r?-1:1}function FW(e,t){let n=MW(e),r=MW(t);return(n===EW||n===DW)&&(r===EW||r===DW)?MA(e,t):n===r?e<t?-1:+(e>t):n<r?-1:1}function IW(e,t){let n=MW(e),r=MW(t);return(n===EW||n===DW)&&(r===EW||r===DW)?NA(e,t,!0):n===r?e<t?-1:+(e>t):n<r?-1:1}function LW(e,t){return e.length===1?(n,r)=>t(e(n),e(r)):e}var RW=Object.freeze({awaitInitRef:zW,ensureArray:BW,bool:YB,and:(e,t)=>YB(e)?t:e,or:(e,t)=>YB(e)?e:t,add:VW,sub:HW,mul:UW,div:WW,mod:GW,eq:KW,ne:qW,lt:JW,lte:YW,gt:XW,gte:ZW,in:QW,notIn:(e,t)=>!QW(e,t),has:(e,t)=>QW(t,e),hasNo:(e,t)=>!QW(t,e),cmp:NW,cmpAnalytical:PW,cmpNatural:FW,cmpNaturalAnalytical:IW,match:$W,pick:eG,indexOf:tG,lastIndexOf:rG,map:aG,mapRecursive:oG,some:sG,filter:cG,slice:lG});function zW(e,t,n){try{return e()}catch{if(t)throw Object.assign(ReferenceError(`Cannot access ${t} before initialization`),{details:{name:t,loc:{range:n}}})}}function BW(e){return qB(e)?e:[e]}function VW(e,t){return qB(e)||qB(t)?[...new Set([...qB(e)?e:[e],...qB(t)?t:[t]])]:e+t}function HW(e,t){if(qB(e)){let n=new Set(e);return qB(t)?t.forEach(e=>n.delete(e)):n.delete(t),[...n]}return e-t}function UW(e,t){return e*t}function WW(e,t){return e/t}function GW(e,t){return e%t}function KW(e,t){return Object.is(e,t)}function qW(e,t){return!Object.is(e,t)}function JW(e,t){return e<t}function YW(e,t){return e<=t}function XW(e,t){return e>t}function ZW(e,t){return e>=t}function QW(e,t){return WB(t)?zB(t,e):t?nG(t,e)!==-1:!1}function $W(e,t){return typeof t==`function`?sG(e,t):GB(t)?sG(e,t.test.bind(t)):t==null}function eG(e,t=()=>!0){if(e){if(typeof t==`function`){if(qB(e)||typeof e==`string`){for(let n=0;n<e.length;n++)if(YB(t(e[n],n)))return e[n]}for(let n in e)if(zB(e,n)&&YB(t(e[n],n)))return e[n];return}return qB(e)||typeof e==`string`?isFinite(t)?e[t<0?e.length+Number(t):Number(t)||0]:void 0:zB(e,t)?e[t]:void 0}}function tG(e,t,n){return e?nG(e,t,n):-1}function nG(e,t,n=0){if(Number.isNaN(t)&&KB(e)){for(let t=JB(n,0);t<e.length;t++)if(Number.isNaN(e[t]))return t}return typeof e.indexOf==`function`?e.indexOf(t,n):-1}function rG(e,t,n){return e?iG(e,t,n):-1}function iG(e,t,n){if(Number.isNaN(t)&&KB(e)){for(let t=JB(n,e.length-1);t>=0;t--)if(Number.isNaN(e[t]))return t}return typeof e.lastIndexOf==`function`?e.lastIndexOf(t,JB(n,e.length-1)):-1}function aG(e,t){let n=typeof t==`function`?t:e=>UB(e,t);return qB(e)?[...e.reduce((e,t)=>VB(e,n(t)),new Set)]:e===void 0?e:n(e)}function oG(e,t){let n=new Set;return VB(n,aG(e,t)),n.forEach(e=>VB(n,aG(e,t))),[...n]}function sG(e,t){return qB(e)?e.some(e=>YB(t(e))):YB(t(e))}function cG(e,t){return qB(e)?e.filter(e=>YB(t(e))):YB(t(e))?e:void 0}function lG(e,t,n,r=1){if(!KB(e))return[];if(t=JB(t,0),n=JB(n,e.length),r=JB(r,1)||1,t=t<0?Math.max(0,e.length+t):Math.min(e.length,t),n=n<0?Math.max(0,e.length+n):Math.min(e.length,n),t>=0&&n>=0&&t<=n&&r===1)return typeof e==`string`?e.slice(t,n):Array.prototype.slice.call(e,t,n);t>n&&([t,n]=[n,t],r=-r);let i=[];if(r>0)for(let a=t;a<n;a+=r)i.push(e[a]);else for(let a=n-1;a>=t;a+=r)i.push(e[a]);return typeof e==`string`?i.join(``):i}var uG=dG(20)?1/0:dG(10)?10:0;function dG(e){return Array.from({length:e},(e,t)=>({idx:t})).sort((e,t)=>e.idx%2-t.idx%2).every((t,n)=>n<e/2?t.idx>>1===n:Math.ceil(e/2)+(t.idx>>1)===n)}function fG(e,t){return e.length<=uG?e.slice().sort(t):e.map((e,t)=>({value:e,idx:t})).sort((e,n)=>(e.value===void 0?n.value!==void 0:n.value===void 0?-1:t(e.value,n.value))||e.idx-n.idx).map(e=>e.value)}var pG=(e,t)=>e-t,mG=(e,t)=>t-e,hG=class{constructor(e,t,n,r=!1){this.maxSize=e||1/0,this.compare=t||mG,this.accept=n||null,this.values=[],this.valuesSet=r?new Set:null}add(e){this.accept!==null&&!this.accept(e)||this.valuesSet!==null&&this.valuesSet.has(e)||(this.values.length<this.maxSize?(this.valuesSet!==null&&this.valuesSet.add(e),this.values.push(e),this.heapifyUp(this.values.length-1)):this.compare(this.values[0],e)>0&&(this.valuesSet!==null&&(this.valuesSet.delete(this.values[0]),this.valuesSet.add(e)),this.values[0]=e,this.heapifyDown()))}addArray(e){for(let t=0;t<e.length;t++)this.add(e[t])}extract(){let e=this.values[0],t=this.values.pop();return this.values.length>0&&(this.values[0]=t,this.heapifyDown()),this.valuesSet!==null&&this.valuesSet.delete(e),e}heapifyUp(e){let t=this.values,n=t[e];for(;e>0;){let r=e-1>>1,i=t[r];if(this.compare(i,n)>0)break;t[r]=n,t[e]=i,e=r}}heapifyDown(){let e=this.values,t=e.length,n=t>>1,r=0,i=e[r],a=r,o=i;for(;r<n;){let n=2*r+1,s=e[n],c=n+1;if(this.compare(s,i)>0&&(a=n,o=s),c<t){let t=e[c];this.compare(t,o)>0&&(a=c,o=t)}if(a===r)break;e[r]=o,e[a]=i,r=a,o=i}}[Symbol.iterator](){return this.values.slice().sort(this.compare)[Symbol.iterator]()}},gG=class extends hG{},_G=class extends hG{constructor(e,t,n,r){super(e,t?(e,n)=>-t(e,n):pG,n,r)}},vG=e=>e;function yG(e){return typeof e==`object`&&e?NaN:Number(e)}function bG(e,t,n){if(KB(e)){typeof t!=`function`&&(t=vG);for(let r of e){let e=t(r);e!==void 0&&n(yG(e))}}}function xG(e,t,n,r){if(e.length===0||!isFinite(t)||t<0||t>100)return;let i=0,a=t*(e.length-1)/100,o=Math.floor(a),s=Math.ceil(a),c=!1,l=t<50?new _G(s+1,r):new gG(e.length-o,r);if(bG(e,n,e=>{Number.isNaN(e)&&(c=!0),l.add(e),i++}),c)return NaN;if(e.length!==i){if(i===0)return;a=t*(i-1)/100,o=Math.floor(a),s=Math.ceil(a);let e=t<50?s+1:i-o;for(let t=l.values.length;t>e;t--)l.extract()}if(o!==s){let e=l.extract(),t=l.values[0];return e<=t?e+(t-e)*(a-o):t+(e-t)*(a-o)}return l.values[0]}var SG=e=>e;function CG(e,t){let n,r=0,i=0;return bG(e,t,e=>{if(i++,n===void 0)n=e;else{let t=n,i=Math.abs(t),a=Math.abs(e);n+=e,i!==1/0&&a!==1/0&&(r+=i>=a?t-n+e:e-n+t)}}),n!==void 0&&(n+=r),{sum:n,count:i}}function wG(e,t){let n=[];return bG(e,t,n.push.bind(n)),n}function TG(e,t){let n=0;if(KB(e)){typeof t!=`function`&&(t=SG);for(let r of e)t(r)!==void 0&&n++}return n}function EG(e,t){return CG(e,t).sum}function DG(e,t){let{sum:n,count:r}=CG(e,t);if(r>0)return n/r}function OG(e,t){let n=0,r=0,i=0;if(bG(e,t,e=>{n+=1;let t=e-r;r+=t/n,i+=t*(e-r)}),n>0)return i/n}function kG(e,t){let n=OG(e,t);if(n!==void 0)return Math.sqrt(n)}function AG(e,t=FW){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=LW(t,FW);for(let r=0;r<e.length;r++){let i=e[r];(n===void 0||t(i,n)<0)&&t(i,void 0)!==0&&(n=i)}}return n}function jG(e,t=FW){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=LW(t,FW);for(let r=0;r<e.length;r++){let i=e[r];(n===void 0||t(i,n)>=0)&&t(i,void 0)!==0&&(n=i)}}return n}function MG(e,t,n){if(KB(e))return xG(e,t,n)}function NG(e,t){return MG(e,50,t)}function PG(){}function FG(e){return e}function IG(e){return e===null?null:{matched:e.slice(),start:e.index,end:e.index+e[0].length,input:e.input,groups:e.groups||null}}function LG(e){let t=e.pop(),n=typeof t==`string`?null:t,r=n===null?t:e.pop(),i=e.pop();return{matched:e,start:i,end:i+e[0].length,input:r,groups:n}}var RG=String.prototype.replaceAll||function(e,t){return GB(e)?this.replace(e,t):this.split(e).join(String(t))},zG=Object.freeze({bool:RW.bool,filter:RW.filter,map:RW.map,pick:RW.pick,indexOf:RW.indexOf,lastIndexOf:RW.lastIndexOf,keys(e){return Object.keys(e||{})},values(e){let t=new Set;for(let n in e)zB(e,n)&&VB(t,e[n]);return[...t]},entries(e){let t=[];for(let n in e)zB(e,n)&&t.push({key:n,value:e[n]});return t},fromEntries(e){let t=Object.create(null);if(Array.isArray(e))for(let n of e)n&&(t[n.key]=n.value);return t},size(e){return WB(e)?Object.keys(e).length:e&&e.length||0},sort(e,t=NW){if(!qB(e))return e;if(typeof t==`function`&&t.length!==2){let e=t;t=(t,n)=>{if(t=e(t),n=e(n),Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return t.length<n.length?-1:1;for(let e=0;e<t.length;e++){let r=NW(t[e],n[e]);if(r!==0)return r}return 0}return NW(t,n)}}return fG(e,t)},reverse(e){return qB(e)?e.slice().reverse():e},slice(e,t,n){return typeof e==`string`||qB(e)?e.slice(t,n):Array.prototype.slice.call(e,t,n)},group(e,t,n){let r=new Map,i=[];typeof t!=`function`&&(t=PG),typeof n!=`function`&&(n=FG),qB(e)||(e=[e]);for(let i of e){let e=t(i);if(qB(e)){if(e.length>0){let t=n(i);for(let n of e)HB(r,n,t)}else HB(r,void 0,n(i))}else HB(r,e,n(i))}for(let[e,t]of r)i.push({key:e,value:[...t]});return i},join(e,t){return qB(e)?e.join(t):String(e)},match(e,t,n){let r=String(e),i=GB(t)?t.flags:``;if(n||i.includes(`g`)){let e=[],n=new RegExp(t,(i||``).replace(/g|$/,`g`)),a;for(;a=n.exec(r);)e.push(IG(a));return e}return IG(r.match(t))},reduce(e,t,n=void 0){return qB(e)?n===void 0?e.reduce((e,n)=>t(n,e)):e.reduce((e,n)=>t(n,e),n):t(e,n)},split(e,t){if(qB(e)){let n=typeof t==`function`?t:Object.is.bind(null,t),r=[],i=0,a=0;for(;a<e.length;a++)n(e[a])&&(r.push(e.slice(i,a)),i=a+1);return r.push(e.slice(i,a)),r}return String(e).split(t)},replace(e,t,n){if(qB(e)){let r=typeof t==`function`?t:Object.is.bind(null,t),i=[...e];for(let e=0;e<i.length;e++){let t=i[e];r(t)&&(i[e]=typeof n==`function`?n(t):n)}return i}return GB(t)&&!t.flags.includes(`g`)&&(t=new RegExp(t,t.flags+`g`)),RG.call(String(e),t,typeof n==`function`?(...e)=>n(LG(e)):n)},toLowerCase(e,t){return String(e).toLocaleLowerCase(t)},toUpperCase(e,t){return String(e).toLocaleUpperCase(t)},trim(e){return String(e).trim()},...`abs.acos.acosh.asin.asinh.atan.atan2.atanh.cbrt.ceil.clz32.cos.cosh.exp.expm1.floor.fround.hypot.imul.log10.log2.pow.round.sign.sin.sinh.sqrt.tan.tanh.trunc`.split(`.`).reduce((e,t)=>(e[t]=Math[t],e),{}),ln:Math.log,ln1p:Math.log1p,numbers:wG,count:TG,sum:EG,avg:DG,variance:OG,stdev:kG,min:AG,max:jG,percentile:MG,p:MG,median:NG}),BG=Object.freeze({function:e=>typeof e==`function`,symbol:e=>typeof e==`symbol`,primitive:e=>e===null||typeof e!=`object`&&typeof e!=`function`,string:e=>typeof e==`string`,number:e=>typeof e==`number`,int:Number.isInteger,finite:e=>Number.isFinite(e),nan:e=>Number.isNaN(e),infinity:e=>e===1/0||e===-1/0,boolean:e=>e===!0||e===!1,null:e=>e===null,undefined:e=>e===void 0,nullish:e=>e==null,object:WB,array:qB,regexp:GB,truthy:YB,falsy:e=>!YB(e)}),VG={path:`property`,key:`value`,value:`value`,"in-value":`value`,"value-subset":`value`,var:`variable`,assertion:`assertion`};function HG(e,t){Object.keys(e).forEach(t.add,t)}function UG(e,t,n,r=new Set){let i=e=>{switch(typeof e){case`string`:case`number`:r.add(e)}};switch(e){case`path`:{let e=new Set;for(let n of t)if(Array.isArray(n))for(let t of n)WB(t)&&HG(t,e);else WB(n)&&HG(n,e);e.forEach(r.add,r);break}case`key`:{let e=new Set;for(let n of t)typeof n==`object`&&n&&!Array.isArray(n)&&HG(n,e);e.forEach(r.add,r);break}case`value`:for(let e of t)i(e);break;case`in-value`:{let e=new Set;for(let n of t)qB(n)?n.forEach(i):WB(n)&&HG(n,e);e.forEach(r.add,r);break}case`var`:for(let e of t)r.add(e);break;case`value-subset`:{let e=new Set(n);for(let n of t)e.has(n)||i(n);break}}return r}function WG(e,t,n,r=!1){let i=[];for(let[a,o,s,c,l=null]of n)if(t>=a&&t<=o&&(r||c.size||c.length)){let n=e.substring(a,o);/\S/.test(n)||(a=o=t,n=``),i.push({context:s,from:a,to:o,text:n,values:c,related:l})}return i}function GG(e,t){return typeof e==`function`?e:e===!0&&t}function KG(e){if(/^(["']).*\1$/.test(e))try{return e[0]===`'`&&(e=`"${e.slice(1,-1).replace(/\\.|"/g,e=>e===`\\'`?`'`:e===`"`?`\\"`:e)}"`),JSON.parse(e)}catch{}return e}function qG(e){return t=>(typeof t==`string`?t:String(t)).toLowerCase().indexOf(e)!==-1}var JG=(e,{value:t,stats:n,assertions:r})=>({get value(){return t},stat(t,r){return WG(e,t,n,r)},suggestion(t,i){let{limit:a=1/0,sort:o,filter:s}=i||{};o=GG(o,RW.cmp),s=GG(s,qG);let c=o&&isFinite(a)?gG:Set,l=WG(e,t,n,!0),u=new Map,d=[];for(let e of l){let{context:t,text:n,from:i,to:l,values:d,related:f}=e,p=VG[t];if(!u.has(p)){let e;switch(c){case gG:e=new gG(a,o,s&&s(KG(n)),!0);break;case Set:e=new Set}u.set(p,{type:p,from:i,to:l,text:n,suggestions:e})}let{suggestions:m}=u.get(p);switch(t){case`assertion`:if(m.size===0||m.values&&m.values.length===0)for(let e of Object.keys(r))m.add(e);break;default:UG(t,d,f,m)}}if(c===Set)for(let e of u.values()){let{suggestions:t}=e;if(o&&(t=[...t].sort(o)),s||isFinite(a)){let n=[],r=s?s(KG(e.text)):()=>!0;for(let e of t)if(r(e)&&n.push(e)>=a)break;t=n}e.suggestions=t}for(let e of u.values())e.suggestions=Array.isArray(e.suggestions)?e.suggestions:[...e.suggestions],e.suggestions.length&&d.push(e);return d.length?d:null}}),YG=new Map,XG=new Map,ZG=new Map,QG=new Map;function $G(e,t,n,r,i){typeof n==`string`?Object.defineProperty(e,t,{configurable:!0,get(){let a=nK(n,`method`)(RW,r,i);return Object.defineProperty(e,t,{enumerable:!0,value:a}),a}}):typeof n==`function`&&Object.defineProperty(e,t,{enumerable:!0,value:n})}function eK(e,t){if(!e&&!t)return{queryMethods:zG,queryAssertions:BG};let n={...zG},r={...BG};for(let[t,i]of Object.entries(e||{})){if(zB(zG,t))throw Error(`Builtin method "${t}" can\'t be overridden`);$G(n,t,i,n,r)}for(let[e,i]of Object.entries(t||{})){if(zB(BG,e))throw Error(`Builtin assertion "${e}" can\'t be overridden`);$G(r,e,i,n,r)}return{queryMethods:n,queryAssertions:r}}function tK(e,t){console.log(`[${e}]`),typeof t==`string`?console.log(t):t!==void 0&&console.dir(t,{depth:null}),console.log()}function nK(e,t,n,r,i){i=typeof i==`function`?i:i?tK:!1,i&&(i(`=========================`),i(`Compile query from source`,e));let a=QB.parse(e,r);i&&(i(`AST`,a.ast),i(`Restored source`,hW(a.ast)));let o=n?fW(e,a):null;if(i&&o){let t=e=>JSON.stringify(e).slice(1,-1),n=[].concat(...[...o.entries()].map(([e,t])=>t.map(t=>[e,...t]))),r=[],a=null;i(`Stat/suggestion ranges`,n.sort((e,t)=>e[1]-t[1]).map(([n,...i])=>{let[o,s,c,l]=i,u;if(o===r[0]&&s===r[1])u=` `.repeat(a.length);else{let n=t(e.slice(0,o)).length,c=t(e.substring(o,s)).length;r=i,a=` `.repeat(n)+(c?`~`.repeat(c):`\\`)+` `+o+`:`+s,u=t(e)+`
|
|
79
|
+
`+a}return u+` [`+c+`] on `+n.type+(l===!0?` (current)`:l&&l.type?` & `+l.type:``)}).join(`
|
|
80
|
+
`))}let s=t===`method`?bW(a.ast,r,o):yW(a.ast,r,o);return i&&i(`Compiled code`,s.toString()),s}function rK(e,t){t||={};let n=!!t.stat,r=!!t.tolerant,i=n?r?QG:XG:r?ZG:YG,{methods:a,assertions:o}=t||{},{queryMethods:s,queryAssertions:c}=eK(a,o),l;return e=String(e),i.has(e)&&!t.debug?l=i.get(e):(l=nK(e,`query`,n,r,t.debug),i.set(e,l)),l=l(RW,s,c),n?Object.assign((t,n)=>JG(e,l(t,n)),{query:l}):l}function iK(e){let t=new Map,n=new Map,r=new Map,i=new Map,{methods:a,assertions:o}=e||{},{queryMethods:s,queryAssertions:c}=eK(a,o);return function(e,a){a||={};let o=!!a.stat,l=!!a.tolerant,u=o?l?i:n:l?r:t,d;if(e=String(e),u.has(e)&&!a.debug)d=u.get(e);else{let t=nK(e,`query`,o,l,a.debug)(RW,s,c);d=o?Object.assign((n,r)=>JG(e,t(n,r)),{query:t}):t,u.set(e,d)}return d}}var aK=Object.assign(rK,{version:RB,buildin:RW,methods:zG,assertions:BG,setup:iK,syntax:{tokenize:QB.tokenize,parse:QB.parse,suggest:fW,walk:aW,stringify:hW,compile:yW,compileMethod:bW}});function oK(e){if(!e||typeof e!=`object`)return`value is not an object`;let{name:t,test:n,decode:r}=e;return typeof t==`string`?typeof n==`function`?typeof r!=`function`&&`missed decode function`:`missed test function`:`missed name`}function sK(e){let t=oK(e);if(t)throw Error(`Bad encoding config${e?.name?` "${e.name}"`:``}: ${t}`);let{name:n,test:r,streaming:i,decode:a}=e;return Object.freeze(i?{name:n||`unknown`,test:r,streaming:!0,decode:a}:{name:n||`unknown`,test:r,streaming:!1,decode:a})}function cK(e){if(!e)return[];if(!Array.isArray(e))throw Error(`Encodings must be an array`);return e.map(sK)}function lK(e){return typeof e==`object`&&!!e&&(typeof e[Symbol.iterator]==`function`||typeof e[Symbol.asyncIterator]==`function`)}function uK(e,t,n,r){switch(n&&typeof n.toJSON==`function`&&(n=n.toJSON()),r!==null&&(n=r.call(e,String(t),n)),typeof n){case`function`:case`symbol`:n=void 0;break;case`object`:if(n!==null){let e=n.constructor;(e===String||e===Number||e===Boolean)&&(n=n.valueOf())}}return n}function dK(e){return typeof e==`function`?e:Array.isArray(e)?[...new Set(e.map(e=>{let t=e&&e.constructor;return t===String||t===Number?String(e):null}).filter(e=>typeof e==`string`))]:null}function fK(e){return typeof e==`number`?!Number.isFinite(e)||e<1?!1:` `.repeat(Math.min(e,10)):typeof e==`string`&&e.slice(0,10)||!1}function pK(e,t){(e===null||Array.isArray(e)||typeof e!=`object`)&&(e={replacer:e,space:t});let n=dK(e.replacer),r=Object.keys;if(Array.isArray(n)){let e=n;r=()=>e,n=null}return{...e,replacer:n,getKeys:r,space:fK(e.space)}}var mK=1,hK=2,gK=new TextDecoder;function _K(e,t){return e.name===`SyntaxError`&&t.jsonParseOffset&&(e.message=e.message.replace(/at position (\d+)/,(e,n)=>`at position `+(Number(n)+t.jsonParseOffset))),e}function vK(e,t){let n=e.length;e.length+=t.length;for(let r=0;r<t.length;r++)e[n+r]=t[r]}async function yK(e){let t=typeof e==`function`?e():e;if(lK(t)){let e=new bK;try{for await(let n of t){if(typeof n!=`string`&&!ArrayBuffer.isView(n))throw TypeError(`Invalid chunk: Expected string, TypedArray or Buffer`);e.push(n)}return e.finish()}catch(t){throw _K(t,e)}}throw TypeError(`Invalid chunk emitter: Expected an Iterable, AsyncIterable, generator, async generator, or a function returning an Iterable or AsyncIterable`)}var bK=class{constructor(){this.value=void 0,this.valueStack=null,this.stack=Array(100),this.lastFlushDepth=0,this.flushDepth=0,this.stateString=!1,this.stateStringEscape=!1,this.pendingByteSeq=null,this.pendingChunk=null,this.chunkOffset=0,this.jsonParseOffset=0}parseAndAppend(e,t){this.stack[this.lastFlushDepth-1]===mK?(t&&(this.jsonParseOffset--,e=`{`+e+`}`),Object.assign(this.valueStack.value,JSON.parse(e))):(t&&(this.jsonParseOffset--,e=`[`+e+`]`),vK(this.valueStack.value,JSON.parse(e)))}prepareAddition(e){let{value:t}=this.valueStack;if(Array.isArray(t)?t.length!==0:Object.keys(t).length!==0){if(e[0]===`,`)return this.jsonParseOffset++,e.slice(1);if(e[0]!==`}`&&e[0]!==`]`)return this.jsonParseOffset-=3,`[[]`+e}return e}flush(e,t,n){let r=e.slice(t,n);if(this.jsonParseOffset=this.chunkOffset+t,this.pendingChunk!==null&&(r=this.pendingChunk+r,this.jsonParseOffset-=this.pendingChunk.length,this.pendingChunk=null),this.flushDepth===this.lastFlushDepth)this.flushDepth>0?this.parseAndAppend(this.prepareAddition(r),!0):(this.value=JSON.parse(r),this.valueStack={value:this.value,prev:null});else if(this.flushDepth>this.lastFlushDepth){for(let e=this.flushDepth-1;e>=this.lastFlushDepth;e--)r+=this.stack[e]===mK?`}`:`]`;this.lastFlushDepth===0?(this.value=JSON.parse(r),this.valueStack={value:this.value,prev:null}):this.parseAndAppend(this.prepareAddition(r),!0);for(let e=this.lastFlushDepth||1;e<this.flushDepth;e++){let t=this.valueStack.value;if(this.stack[e-1]===mK){let e;for(e in t);t=t[e]}else t=t[t.length-1];this.valueStack={value:t,prev:this.valueStack}}}else{r=this.prepareAddition(r);for(let e=this.lastFlushDepth-1;e>=this.flushDepth;e--)this.jsonParseOffset--,r=(this.stack[e]===mK?`{`:`[`)+r;this.parseAndAppend(r,!1);for(let e=this.lastFlushDepth-1;e>=this.flushDepth;e--)this.valueStack=this.valueStack.prev}this.lastFlushDepth=this.flushDepth}push(e){if(typeof e!=`string`){if(this.pendingByteSeq!==null){let t=e;e=new Uint8Array(this.pendingByteSeq.length+t.length),e.set(this.pendingByteSeq),e.set(t,this.pendingByteSeq.length),this.pendingByteSeq=null}if(e[e.length-1]>127)for(let t=0;t<e.length;t++){let n=e[e.length-1-t];if(n>>6==3){t++,(t!==4&&n>>3==30||t!==3&&n>>4==14||t!==2&&n>>5==6)&&(this.pendingByteSeq=e.slice(e.length-t),e=e.slice(0,-t));break}}e=gK.decode(e)}let t=e.length,n=0,r=0;scan:for(let i=0;i<t;i++){if(this.stateString){for(;i<t;i++)if(this.stateStringEscape)this.stateStringEscape=!1;else switch(e.charCodeAt(i)){case 34:this.stateString=!1;continue scan;case 92:this.stateStringEscape=!0}break}switch(e.charCodeAt(i)){case 34:this.stateString=!0,this.stateStringEscape=!1;break;case 44:r=i;break;case 123:r=i+1,this.stack[this.flushDepth++]=mK;break;case 91:r=i+1,this.stack[this.flushDepth++]=hK;break;case 93:case 125:r=i+1,this.flushDepth--,this.flushDepth<this.lastFlushDepth&&(this.flush(e,n,r),n=r);break;case 9:case 10:case 13:case 32:n===i&&n++,r===i&&r++}}r>n&&this.flush(e,n,r),r<t&&(this.pendingChunk===null?this.pendingChunk=e.slice(r,t):this.pendingChunk+=e),this.chunkOffset+=t}finish(){return this.pendingChunk!==null&&(this.flush(``,0,0),this.pendingChunk=null),this.value}},xK=typeof Object.hasOwn==`function`?Object.hasOwn:(e,t)=>Object.hasOwnProperty.call(e,t),SK={8:`\\b`,9:`\\t`,10:`\\n`,12:`\\f`,13:`\\r`,34:`\\"`,92:`\\\\`},CK=Uint8Array.from({length:2048},(e,t)=>xK(SK,t)?2:t<32?6:t<128?1:2);function wK(e){return e>=55296&&e<=56319}function TK(e){return e>=56320&&e<=57343}function EK(e){if(!/[^\x20\x21\x23-\x5B\x5D-\x7F]/.test(e))return e.length+2;let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i<2048)t+=CK[i];else if(wK(i)){t+=6,n=!0;continue}else TK(i)?t=n?t-2:t+6:t+=3;n=!1}return t+2}function DK(e){let t=0;return e<0&&(t=1,e=-e),e>=1e9&&(t+=9,e=(e-e%1e9)/1e9),e>=1e4?e>=1e6?t+(e>=1e8?9:e>=1e7?8:7):t+(e>=1e5?6:5):t+(e>=100?e>=1e3?4:3:e>=10?2:1)}function OK(e){switch(typeof e){case`string`:return EK(e);case`number`:return Number.isFinite(e)?Number.isInteger(e)?DK(e):String(e).length:4;case`boolean`:return e?4:5;case`undefined`:case`object`:return 4;default:return 0}}function kK(e,...t){let{replacer:n,getKeys:r,...i}=pK(...t),a=!!i.continueOnCircular,o=i.space?.length||0,s=new Map,c=new Map,l=new Set,u=[],d={"":e},f=!1,p=0,m=0,h=0;return g(d,``,e),p===0&&(p+=9),{bytes:isNaN(p)?1/0:p+m,spaceBytes:o>0&&isNaN(p)?1/0:m,circular:[...l]};function g(e,t,i){if(!f){if(i=uK(e,t,i,n),typeof i!=`object`||!i)(i!==void 0||Array.isArray(e))&&(p+=OK(i));else{if(u.includes(i)){l.add(i),p+=4,a||(f=!0);return}if(c.has(i)){p+=c.get(i);return}h++;let e=h,t=p,n=0;if(u.push(i),Array.isArray(i)){n=i.length;for(let e=0;e<n;e++)g(i,e,i[e])}else{let e=p;for(let t of r(i))if(g(i,t,i[t]),e!==p){let r=s.get(t);r===void 0&&s.set(t,r=EK(t)+1),p+=r,n++,e=p}}p+=n===0?2:1+n,o>0&&n>0&&(m+=(Array.isArray(i)?0:n)+(1+u.length*o)*(n+1)-o),u.pop(),e!==h&&c.set(i,p-t)}}}}var AK=Object.freeze({name:`json`,test:()=>!0,streaming:!0,decode:yK}),jK=new Uint8Array([0,0,74,83,79,78,88,76]),MK=9,NK=268435455,PK=2,FK=4,IK=8,LK=16,RK=32,zK=64,BK=128,VK=0,HK=1,UK=2,WK=3,GK=4,KK=5,qK=6,JK=8,YK=9,XK=10,ZK=11,QK=12,$K=224,eq=7936,tq=0,nq=1,rq=2,iq=3,aq=4,oq=5,sq=6,cq=7,lq=8,uq=16,dq=32;~LK;var fq=PK|RK|zK,pq=new Uint8Array(256).map((e,t)=>{for(let n=0;n<8;n++)e+=t>>n&1;return e}),mq=new Uint32Array(16);mq.subarray(0,8),mq.subarray(8,16),new TextEncoder;var hq=new Uint8Array(33);for(let e=0;e<33;e++)hq[32-e]=Math.ceil(e/7)||1;function gq(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}var _q=new Map;Object.freeze({hasInlinedEntries:!1,columns:_q}),Object.freeze({hasInlinedEntries:!0,columns:_q}),vq();function vq(){return new Proxy(Object.create(null),{get(e,t){return Object.hasOwn(e,t)?Reflect.get(...arguments):e[t]=0}})}Object.hasOwnProperty;function yq(e,t,n,r=Array(n)){let i=t&15,a=t&48,o=n,s=0,c=0;switch(a){case uq:s=r[0]=e.readIntVar(),o--,c=1;break;case dq:s=e.readIntVar()}switch(i){case rq:for(let t=0;t<o;t++)r[c+t]=e.readVlq();break;case iq:for(let t=0;t<o;t++)r[c+t]=e.readIntVar();break;case aq:{let t=e.readBytes(Math.ceil(o/2));for(let n=0,i=0;n<o;n++)i=n&1?i>>4:t[n>>1],r[c+n]=i&8?e.readVlq()*8+(i&7):i&7;break}case oq:{let t=e.readBytes(Math.ceil(o/2));for(let n=0,i=0;n<o;n++){i=n&1?i>>4:t[n>>1];let a=i&4?-1:1;r[c+n]=i&8?a*(e.readVlq()*4+(i&3)):a*(i&3)}break}case sq:{let n=t>>8,i=(1<<n)-1,a=e.readBytes(Math.ceil(o*n/8)),s=0,l=0,u=0;for(let e=0;e<o;e++){for(;l<n;)u|=a[s++]<<l,l+=8;r[c+e]=u&i,u>>=n,l-=n}break}case cq:{let n=t>>8,i=(1<<n)-1,a=e.readBytes(Math.ceil(o*n/8)),s=0,l=0,u=0;for(let e=0;e<o;e++){for(;l<n;)u|=a[s++]<<l,l+=8;r[c+e]=u&1?-((u&i)>>1):(u&i)>>1,u>>=n,l-=n}break}case lq:{let t=r[0]=e.readIntVar(),i=e.readIntVar();for(let e=1;e<n;e++)r[e]=t+=i;break}case tq:case nq:{let n=i===nq,a=t>>8,s=n?t&eq|a&$K:a;if(pq[a]>1){let t=e.readTypeIndex(o,s);for(let n=0;n<o;n++)r[c+n]=e.readNumber(t[n])}else{let t=31-Math.clz32(s);for(let n=0;n<o;n++)r[c+n]=e.readNumber(t)}break}default:throw Error(`Unknown numeric array encoding method: ${i}`)}switch(a){case uq:r[0]=s;for(let e=1;e<n;e++)r[e]+=r[e-1];break;case dq:for(let e=0;e<n;e++)r[e]+=s}return r}function bq(e){let t=xq(e.readBytes(e.readVlq())),n=e.readNumericArray(),r=e.readNumericArray(),i=e.readNumericArray(),a=Array(n);for(let e=0,o=0,s=0,c=``;e<n.length;e++){let l=n[e],u=t(l>>2);l&2&&(u=c.slice(0,r[o++])+u),l&1&&(u+=c.slice(-i[s++])),a[e]=u,c=u}return a}function xq(e){function t(e){if(r!==null){let t=e;e=new Uint8Array(r.length+t.length),e.set(r),e.set(t,r.length),r=null}if(e[e.length-1]>127)for(let t=0;t<e.length;t++){let n=e[e.length-1-t];if(n>>6==3){t++,(t!==4&&n>>3==30||t!==3&&n>>4==14||t!==2&&n>>5==6)&&(r=e.slice(e.length-t),e=e.subarray(0,-t));break}}return n.decode(e)}let n=new TextDecoder(`utf8`,{ignoreBOM:!0}),r=null,i=0,a=``,o=0;return function(n){for(;n>a.length-o;)a=a.slice(o)+t(e.subarray(i,i+=16777216)),o=0;return a.slice(o,o+=n)}}var Sq=12;function Cq(e){return e===MK}function wq(e){try{let{version:t}=Tq(e);if(Cq(t))return!0;throw Error(`Unsupported jsonxl version "${t}", expected "${MK}"`)}catch{return!1}}function Tq(e){if(e.byteLength<Sq)throw Error(`Header length must be at least ${Sq} bytes`);let t=new Uint8Array(e.buffer,e.byteOffset,Sq);if(t.subarray(0,8).some((e,t)=>e!==jK[t]))throw Error(`Bad magic number`);let n=new DataView(t.buffer,t.byteOffset,Sq);return{version:n.getUint16(8,!0),flags:n.getUint16(10,!0),headerSize:Sq}}var Eq=class{constructor(e,t){this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.bytes=e,this.pos=0,typeof t==`function`&&t(this),this.consumeHeader(),this.loadStrings(),this.loadArrayLengths(),this.loadArrayHeaders(),this.loadObjectEntries()}consumeHeader(){let{version:e,flags:t,headerSize:n}=Tq(this.view);return this.pos+=n,{version:e,flags:t}}loadStrings(){this.strings=bq(this),this.stringRefs=this.readNumericArray(),this.stringRefsCursor=0}loadArrayHeaders(){this.arrayHeaders=this.readNumericArray(),this.arrayHeaderRefs=this.readNumericArray(),this.arrayHeaderRefsCursor=0}loadArrayLengths(){this.arrayLengths=this.readNumericArray(),this.arrayLengthsCursor=0}loadObjectEntries(){let e=this.readVlq(),t=this.readVlq();this.objectEntries=Array(e),this.objectKeys=t?this.stringRefs.slice(-t).map(e=>this.strings[e]):[];for(let t=0;t<e;t++)this.objectEntries[t]={dict:this.readNumericArray(),refs:this.readNumericArray(),cursor:0}}readString(){return this.strings[this.stringRefs[this.stringRefsCursor++]]}readArrayHeader(){return this.arrayHeaders[this.arrayHeaderRefs[this.arrayHeaderRefsCursor++]]}readArrayLength(){return this.arrayLengths[this.arrayLengthsCursor++]}readObjectEntry(e){let t=this.objectEntries[e],n=t.refs[t.cursor++],r=t.dict[n];return r===0?null:{key:this.objectKeys[r>>8],type:r&255}}readBytes(e){return this.bytes.subarray(this.pos,this.pos+=e)}readTypeIndex(e,t,n){let r=0,i=0,a=0;for(;t>0;)t&1&&(r|=a<<(i++<<2)),a++,t>>=1;let o=new Uint8Array(e),s=32-Math.clz32(i-1),c=(1<<s)-1,l=this.readBytes(Math.ceil(s*e/8)),u=0,d=0,f=0;for(let t=0;t<e;t++){f<s&&(d|=l[u++]<<f,f+=8);let e=r>>((d&c)<<2)&15;o[t]=n?1<<e:e,d>>=s,f-=s}return o}readVlq(){let e=this.view.getUint8(this.pos);if(!(e&1))e>>=1,this.pos+=1;else if(!(e&2))e=this.view.getUint8(this.pos+1)<<6|e>>2,this.pos+=2;else if(!(e&4))e=this.view.getUint16(this.pos+1,!0)<<5|e>>3,this.pos+=3;else{let t=this.view.getUint32(this.pos,!0);e=t>>>3&NK,this.pos+=4,t>>>31&&(e+=this.readUintVar()*(1<<28))}return e}readUintVar(){let e=this.view.getUint8(this.pos++),t=e&127,n=128;for(;e&128;)e=this.view.getUint8(this.pos++),t+=(e&127)*n,n*=128;return t}readIntVar(){let e=this.view.getUint8(this.pos++),t=e&128?this.readUintVar()*64:0,n=(e&127)>>1;return e&1?-(n+t):n+t}readUint8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readInt8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readUint16(){let e=this.view.getUint16(this.pos,!0);return this.pos+=2,e}readInt16(){let e=this.view.getInt16(this.pos,!0);return this.pos+=2,e}readUint24(){let e=this.view.getUint16(this.pos,!0)|this.view.getUint8(this.pos+2)<<16;return this.pos+=3,e}readInt24(){let e=this.view.getUint16(this.pos,!0),t=this.view.getUint8(this.pos+2),n=t&128?(t<<16|e)-16777216:t<<16|e;return this.pos+=3,n}readUint32(){let e=this.view.getUint32(this.pos,!0);return this.pos+=4,e}readInt32(){let e=this.view.getInt32(this.pos,!0);return this.pos+=4,e}readFloat32(){let e=this.view.getFloat32(this.pos,!0);return this.pos+=4,e}readFloat64(){let e=this.view.getFloat64(this.pos,!0);return this.pos+=8,e}readNumber(e){switch(e){case VK:return this.readUint8();case HK:return this.readUint16();case UK:return this.readUint24();case WK:return this.readUint32();case GK:return this.readUintVar();case JK:return this.readInt8();case YK:return this.readInt16();case XK:return this.readInt24();case ZK:return this.readInt32();case QK:return this.readIntVar();case KK:return this.readFloat32();case qK:return this.readFloat64()}}readNumericArrayEncoding(){let e=this.readUint8();switch(e&15){case tq:case nq:case sq:case cq:e|=this.readUint8()<<8}return e}readNumericArray(e=this.readVlq()){if(e===0)return[];let t=this.readNumericArrayEncoding();return this.readNumbers(t,e)}readNumbers(e,t,n){return yq(this,e,t,n)}};function Dq(e,t){function n(e={}){let t=0,n;for(;n=a.readObjectEntry(t++);)e[n.key]=i(n.type);return e}function r(e=wy.readArrayLength()){if(e===0)return[];let t=a.readArrayHeader(),i=t>>16,o=t&65535,s=i&1,c=i>>5&1,l=i>>9&1,u=i>>1&255|(i&1)<<4,d=Array(e),f=pq[u]>1?a.readTypeIndex(e,u,!0):null;if(u&fq){if(f===null)switch(u){case PK:d.fill(null);break;case RK:d.fill(!0);break;case zK:d.fill(!1)}else for(let t=0;t<e;t++)switch(f[t]){case PK:d[t]=null;break;case RK:d[t]=!0;break;case zK:d[t]=!1}}if(u&IK)for(let t=0;t<e;t++)(f===null||f[t]===IK)&&(d[t]=a.readString());if(u&FK){if(u===FK)a.readNumbers(o,e,d);else{let t=gq(f,FK),n=a.readNumbers(o,t);for(let t=0,r=0;t<e;t++)f[t]===FK&&(d[t]=n[r++])}}if(u&BK){if(l){let t=u===BK?e:gq(f,BK),n=a.readNumericArray(t),i=r();for(let t=0,r=0,a=0;t<e;t++)(f===null||f[t]===BK)&&(d[t]=i.slice(a,a+=n[r++]))}else for(let t=0;t<e;t++)(f===null||f[t]===BK)&&(d[t]=r())}if(u&LK){let t=u===LK?d:[];for(let n=0,r=0;n<e;n++)(f===null||f[n]===LK)&&(d[n]=t[r++]={});if(c){let e=a.readVlq(),n=Array(e);for(let t=0;t<e;t++)n[t]=a.readString();for(let i=0;i<e;i++){let e=n[i],a=r(t.length);for(let n=0;n<t.length;n++)a[n]!==void 0&&(t[n][e]=a[n])}}if(s)for(let e=0;e<t.length;e++)n(t[e])}return d}function i(e){switch(1<<(e&7)){case PK:return null;case IK:return a.readString();case FK:return a.readNumber(e>>3);case LK:return n();case RK:return!0;case zK:return!1;case BK:return r()}}let a=new Eq(e,t),o=i(a.readUint8());if(a.pos!==e.byteLength)throw Error(`End of input is not reached`);return o}var Oq=Object.freeze({name:`jsonxl/snapshot9`,test:wq,streaming:!1,decode:Dq}),kq=[{name:`gzip`,test:e=>e[0]===31&&e[1]===139&&e[2]===8,createTransformStream:()=>new DecompressionStream(`gzip`)},{name:`zlib`,test:e=>(e[0]&15)==8&&e[0]>>4<=7&&(e[0]<<8|e[1])%31==0,createTransformStream:()=>new DecompressionStream(`deflate`)}];function Aq(e){return e.reduce((e,t)=>e+t.byteLength,0)}function jq(e,t){switch(e.length){case 0:return;case 1:return e[0];default:{let n=new Uint8Array(t||Aq(e)),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}}}async function Mq(e){let t=[],n=0;for await(let r of e)t.push(r),n+=r.byteLength;return jq(t,n)}function Nq(e,t){if(typeof e!=`string`){for(let n of t)if(n.test(e))return n}return null}var Pq=class{#e;#t;#n;#r;constructor(e,t){this.#e=e,this.#t=t,this.#n=null,this.#r=null}transform(e,t){if(this.#r===null){let n=Nq(e,this.#e);if(n===null)this.#r=Promise.resolve();else{let{readable:e,writable:r}=n.createTransformStream();this.#n=r.getWriter(),this.#r=e.pipeTo(new WritableStream({write(e){t.enqueue(e)},close(){t.terminate()},abort(e){t.error(e)}})),typeof this.#t==`function`&&this.#t(n.name)}}if(this.#n!==null)return this.#n.write(e);t.enqueue(e)}async flush(){this.#n!==null&&(this.#n.close(),this.#n=null),this.#r!==null&&(await this.#r,this.#r=null)}},Fq=262144,Iq=class{#e;#t;#n;constructor(e,t=Fq){this.#e=e,this.#t=``,this.#n=t}async transform(e,t){if(typeof this.#t!=`string`&&await this.#i(t),typeof e==`string`){if(this.#t+=e,this.#r>=this.#n)return this.#i(t)}else this.#t=e,await this.#i(t)}async flush(e){await this.#i(e),await this.#e(!0)}get#r(){return this.#t.length}async#i(e){let t=this.#t;if(this.#r!==0){this.#t=``;for(let n=0;n<t.length;){let r=n===0&&t.length-n<this.#n*1.5?t:t.slice(n,n+this.#n);e.enqueue(r),n+=r.length,await this.#e(!1,r.length)}}}};function Lq(e){try{return new URL(e,location.origin).origin===location.origin}catch{return!1}}function Rq(e){return e.ok}function zq(e){return e.headers.get(`x-file-encoded-size`)||e.headers.get(`content-length`)}function Bq(e){return e.headers.get(`x-file-size`)||(Lq(e.url)&&!e.headers.get(`content-encoding`)?e.headers.get(`content-length`):void 0)}function Vq(e){return e.headers.get(`x-file-created-at`)||e.headers.get(`last-modified`)||void 0}function Hq(e){let t=e?Object.keys(e):[],n=[`name`,`createdAt`,`elapsedTime`,`data`];return!(t.length!==4||t.some(e=>!n.includes(e)))}function Uq(e,t,{size:n,compression:r,encoding:i}){let a=null;if(Hq(e)){let{data:n,...r}=e;e=n,t={...t,createdAt:n.createdAt},a=r}let o=e,s=a||{},{type:c,name:l,encoding:u,size:d,encodedSize:f,createdAt:p,...m}=t||{};return{resource:{type:c||`unknown`,name:l||`unknown`,compression:r,encoding:i,...Number.isFinite(n)?{size:n}:null,...Number.isFinite(f)?{encodedSize:f}:null,createdAt:new Date((typeof p==`string`?Date.parse(p):p)||Date.now()),...m},meta:s,data:o}}async function Wq(e,t,n,r){let i=Date.now(),a=[...cK(t),Oq,AK],o=0,s=!1,c=`unknown`,l=0;await r(`receiving`,d(!1));let u=e.pipeThrough(new TransformStream(new Iq(f))).pipeThrough(new TransformStream(new Pq(kq,e=>s=e))).getReader();try{let e=await u.read(),{value:t,done:n}=e;if(n)throw Error(`Empty payload`);for(let{name:n,test:r,streaming:i,decode:d}of a)if(r(t)){c=n;let t=p(u,e);return{data:await(i?d(t):Mq(t).then(m(d))),compression:s,encoding:c,size:l,decodingTime:o}}throw Error(`No matched encoding found for the payload`)}finally{u.releaseLock()}function d(e){return{done:e,elapsed:Date.now()-i,units:`bytes`,completed:l,total:n}}async function f(e,t=0){l+=t,await r(`receiving`,d(e))}async function*p(e,t){for(;;){let{value:n,done:r}=t||await e.read();if(t=void 0,r)break;let i=performance.now();yield n,o+=performance.now()-i}}function m(e){return async t=>{await r(`decoding`,void 0,c);let n=performance.now();try{return await e(t)}finally{o=performance.now()-n}}}}async function Gq(e,t){try{await t.asyncSet({stage:`request`});let n=new Date,{method:r,stream:i,resource:a,options:o,data:s}=await e(),c=new Date,l=a?.size,{encodings:u}=o||{},{data:d,compression:f=!1,encoding:p=`unknown`,size:m=void 0,decodingTime:h=0}=s?{data:s}:await Wq(i,u,Number(l)||0,(e,n,r)=>t.asyncSet({stage:e,progress:n,step:r}));await t.asyncSet({stage:`received`});let{data:g,resource:_,meta:v}=Uq(d,a,{size:m,compression:f,encoding:p}),y=new Date,b=Number(y)-Number(n),x=Math.round(h||0);return{loadMethod:r,resource:_,meta:v,data:g,timings:{time:b,start:n,end:y,loadingTime:b-x,decodingTime:x,requestTime:Number(c)-Number(n),requestStart:n,requestEnd:c,responseTime:Number(y)-Number(c),responseStart:c,responseEnd:y}}}catch(e){throw console.error(`[Discovery] Error loading data:`,e),await t.asyncSet({stage:`error`,error:e}),e}}function Kq(e,t){let n=new mz({stage:`inited`});return{state:n,dataset:e(n),...t}}function qq(e){return t=>Gq(e,t)}function Jq(e,t){return Kq(qq(()=>({method:`stream`,stream:e,resource:t?.resource,options:t})))}function Yq(e,t){let n=$q(e);return Kq(qq(()=>({method:`file`,stream:e.stream(),resource:t?.resource||n,options:t})),{title:`Load data from file: `+(n?.name||`unknown`)})}function Xq(e,t){let n=(e.dataTransfer||e.clipboardData||e.target)?.files?.[0];if(e.stopPropagation(),e.preventDefault(),!n)throw Error(`Can't extract a file from an event object`);return Yq(n,t)}function Zq(e,t){return t||={},Kq(qq(async()=>{let n=await fetch(e,t.fetch),r=$q(n,t);if(r&&n.body)return{method:`fetch`,stream:n.body,resource:t.resource||r,options:t};let i=n.headers.get(`content-type`)||``,a=await n.text();if(i.toLowerCase().startsWith(`application/json`))try{let e=JSON.parse(a);a=e.error||e}catch{}throw a=Error(a),a.isFetchError=!0,a.status=n.status,a.statusText=n.statusText,a.stack=null,a}),{title:`Load data from url: ${e}`})}function Qq(e){let t,n=new ReadableStream({start(e){t=e},cancel(){t=null}}),r,i=null,a=new Promise(t=>{r=r=>t({method:`push`,stream:n,resource:r?i=r:e?.resource,options:e})});return e||={},Kq(qq(()=>a),{start(e){r(e)},push(e){r(),t?.enqueue(e)},finish(e){t?.close(),t=null,e!==void 0&&isFinite(e)&&i!==null&&(i.encodedSize=Number(e)),i=null}})}function $q(e,t){if(e instanceof Response){let n=t?.isResponseOk||Rq,r=t?.getContentSize||Bq,i=t?.getContentEncodedSize||zq,a=t?.getContentCreatedAt||Vq;if(n(e))return{type:`url`,name:e.url,size:Number(r(e))||null,encodedSize:Number(i(e)),createdAt:a(e)}}if(e instanceof File)return{type:`file`,name:e.name,size:e.size,createdAt:e.lastModified};if(e instanceof Blob)return{size:e.size};if(ArrayBuffer.isView(e))return{size:e.byteLength};if(typeof e==`string`)return{size:e.length}}var eJ=class extends _z{#e;#t;static define(e,t,n){return e.#e.set(t,n),e.emit(`define`,t,n),n}constructor(e){super(),this.#e=new Map,this.#t=!!e}revoke(e){if(!this.#t)throw Error(`Entry revoking is not allowed`);this.#e.delete(e),this.emit(`revoke`,e)}isDefined(e){return this.#e.has(e)}has(e){return this.#e.has(e)}get(e){return this.#e.get(e)}get names(){return[...this.#e.keys()]}get keys(){return this.#e.keys()}get values(){return this.#e.values()}get entries(){return this.#e.entries()}};function tJ(e,t){let{ast:n}=aK.syntax.parse(t),r={view:e};if(n.type!==`Block`)throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): query root must be a "Block"`);if(n.body.type!==`Object`)throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): query root must return an "Object"`);for(let e of n.body.properties){if(e.type!==`ObjectEntry`)throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): unsupported object entry type "`+e.type+`"`);let t,n=e.value;switch(e.key.type){case`Literal`:t=e.key.value;break;case`Identifier`:t=e.key.name,n||=e.key;break;case`Reference`:t=e.key.name.name,n||=e.key;break;default:throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): unsupported object key type "`+e.key.type+`"`)}if(t===`view`||t===`postRender`)throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): set a value for "`+t+`" property in shorthand notation is prohibited`);t===`when`||t===`data`||t===`whenData`?r[t]=n.type===`Literal`&&typeof n.value!=`string`?n.value:aK.syntax.stringify(n):r[t]=n.type===`Literal`&&(typeof n.value!=`string`||n.value[0]!==`=`)?n.value:`=`+aK.syntax.stringify(n)}return r}var nJ=Object.freeze({type:void 0}),rJ=Object.freeze({view:``}),iJ=new WeakMap,aJ=new WeakMap,oJ=new Set([`view`,`when`,`context`,`data`,`whenData`,`postRender`]);function sJ(e){return typeof e==`string`||Array.isArray(e)||typeof e==`object`&&!!e&&typeof e.view==`string`}function cJ(e,t){return iJ.set(e,t),e}function lJ(){return{name:`config-error`,options:nJ,render(e,t){e.appendText(`[Error: ${t.reason}]`),`config`in t}}}function uJ(e,t,n,r,i,a,o,s){return!oz(n,e)||n[e]===void 0||t.host.queryBool(n[e]===!0?``:n[e],r,i)?!0:(t.viewEls.set(s,{skipped:e,config:n,inputData:a,inputDataIndex:o,data:r,context:i}),!1)}var dJ=class e{type;children;border;constructor(e=`inline`,t){if(this.type=e,this.children=[],this.border=null,Array.isArray(t))for(let e of t)this.append(e)}appendText(e){this.append(new fJ(e))}appendInlineBlock(){let t=new e(`inline-block`);return this.append(t),t}appendBlock(){let t=new e(`block`);return this.append(t),t}appendLine(){let t=new e(`line`);return this.append(t),t}append(e){return this.children.push(e),this}setBorder(e){if(!e){this.border=null;return}this.border=typeof e==`string`?new bJ(e,e,e,e):Array.isArray(e)?new bJ(...e):new bJ(e.top||null,e.right||null,e.bottom||null,e.left||null)}},fJ=class{value;constructor(e){this.value=String(e)}},pJ=class{node;constructor(){this.node=null}setNode(e){this.node=e}};function mJ(e,t=0,n=e.length-1){let r=e[t].length;for(let i=t+1;i<=n;i++)r=Math.max(r,e[i].length);return r}function hJ(e,t){return e.length>t?e.slice(0,t):e}function gJ(e,t=e,n=t,r=e){return(i,a)=>a===1?r:i===0?e:i+1===a?n:t}function _J(e){return Array.isArray(e)?gJ(...e):e}function vJ(e,t=e,n=t){return(r,i,a)=>`${e}${``.padStart(r+i+a-e.length-n.length,t)}${n}`}function yJ(e){return Array.isArray(e)?vJ(...e):e}var bJ=class{top;left;right;bottom;constructor(e=null,t=null,n=e,r=t){this.top=e||null,this.left=r||null,this.right=t||null,this.bottom=n||null}render(e,t,n){let r=_J(this.left),i=_J(this.right),a=yJ(this.top),o=yJ(this.bottom),s=mJ(e),c=0,l=0;if(r){if(typeof r==`function`){let t=e.map((t,n)=>String(r(n,e.length)??``));c=mJ(t),e=e.map((e,n)=>t[n].padEnd(c)+e)}else c=r.length,e=e.map(e=>r+e);if(c>0)for(let r=0;r<e.length;r++)t[r].unshift({length:c,node:n})}if(i){if(typeof i==`function`){let r=e.map((t,n)=>String(i(n,e.length)??``));if(l=mJ(r),l>0){for(let r=0;r<e.length;r++)t[r].push({length:c+s-e[r].length+l,node:n});e=e.map((e,t)=>e.padEnd(c+s)+r[t].padStart(l))}}else{l=i.length;for(let r=0;r<e.length;r++)t[r].push({length:c+s-e[r].length+l,node:n});e=e.map(e=>e.padEnd(c+s)+i)}}if(a||o){let r=s+c+l;if(a){let i=typeof a==`function`?a(s,c,l)||``:``.padStart(r,a);i&&(e.unshift(hJ(i,r)),t.unshift([{length:e[0].length,node:n}]))}if(o){let i=typeof o==`function`?o(s,c,l)||``:``.padStart(r,o);i&&(e.push(hJ(i,r)),t.push([{length:e[e.length-1].length,node:n}]))}}return{spans:t,lines:e}}};async function xJ(e,t,n,r,i,a,o,s,c){let l=new dJ(t.options.type||`inline`);t.options.border&&l.setBorder(t.options.border),await t.render(l,i,a,o),typeof r.postRender==`function`&&await r.postRender(l,r,a,o);let u={config:r,props:i,inputData:s,inputDataIndex:c,data:a,context:o};return e.viewEls.set(l,u),n.setNode(l),n}function SJ(e,t,n,r){return xJ(e,e.defaultRenderErrorRenderer,n,rJ,{type:`render`,reason:t,config:r})}function CJ(e,t){return{name:t,normalizeConfig:e.normalizeConfig.bind(e),ensureValidConfig:e.ensureValidConfig.bind(e),composeConfig:e.composeConfig.bind(e),propsFromConfig:e.propsFromConfig.bind(e),render:e.render.bind(e),listLimit:e.listLimit.bind(e),renderList:e.renderList.bind(e)}}async function wJ(e,t,n,r,i,a){if(Array.isArray(n))return Promise.all(n.map(n=>wJ(e,t,n,r,i,a))).then(e=>new dJ(`inline`,e));let o=r&&typeof i==`number`?r[i]:r,s=null;switch(typeof n.view){case`function`:s={name:!1,options:nJ,render:n.view};break;case`string`:s=e.get(n.view)||null}t||=new dJ;let c=new pJ;if(t.append(c),!s){let t=typeof n.view==`string`?"View `"+n.view+"` is not found":`Render is not a function`;return e.host.logger.error(t,n),SJ(e,t,c,n)}try{if(uJ(`when`,e,n,o,a,r,i,c)){let t=`context`in n?await e.host.query(n.context,o,a):a,l=`data`in n?await e.host.query(n.data,o,t):o;if(uJ(`whenData`,e,n,l,t,r,i,c))return await xJ(e,s,c,n,e.propsFromConfig(n,l,t),l,t,r,i)}return c}catch(t){return e.host.logger.error(`View render error:`,t.message),SJ(e,String(t),c,rJ)}}var TJ=class e extends eJ{host;defaultRenderErrorRenderer;viewEls;constructor(e){super(),this.host=e,this.defaultRenderErrorRenderer=lJ(),this.viewEls=new WeakMap}define(t,n,r){let i=sJ(n)||typeof n==`function`?{...r,render:n}:n,{render:a=[],...o}=i,{type:s,props:c}=o;return e.define(this,t,Object.freeze({name:t,options:Object.freeze({...i,type:typeof s==`string`||s===void 0?s:void 0,props:typeof c==`string`?this.host.queryFn(c):c}),render:typeof a==`function`?a.bind(CJ(this,t)):(e,t,n,r)=>this.render(e,a,n,r)}))}normalizeConfig(e){if(!e)return null;if(Array.isArray(e)){let t=[];for(let n of e){let e=this.normalizeConfig(n);e!==null&&(Array.isArray(e)?t.push(...e):t.push(e))}return t}if(typeof e==`string`){let[,t,n,r]=e.match(/^(\S+?)([:{])((?:.|\s)+)$/)||[];if(t){if(n===`{`)try{return cJ(tJ(t,n+r),e)}catch(t){return cJ(this.badConfig(e,t),e)}return cJ({view:t,data:r},e)}return cJ({view:e},e)}return typeof e==`function`?cJ({view:e},e):e}badConfig(e,t){let n=t?.message||`Unknown error`;return this.host.logger.error(n,{config:e,error:t}),{view:this.defaultRenderErrorRenderer.render,type:`config`,reason:n,config:e}}ensureValidConfig(e){return Array.isArray(e)?e.map(e=>this.ensureValidConfig(e)).flat():!e||!e.view?this.badConfig(e,Error(e?"Option `view` is missed":`Config is not a valid value`)):e}composeConfig(e,t){return e=this.normalizeConfig(e),t=this.normalizeConfig(t),e&&t?Array.isArray(e)?e.map(e=>cJ({...e,...t},[e,t])):cJ({...e,...t},[e,t]):e||t}propsFromConfig(e,t,n,r=this.get(e?.view)?.options.props){let i={};for(let[r,a]of Object.entries(e))oJ.has(r)||(i[r]=typeof a==`string`&&a.startsWith(`=`)?this.host.query(a.slice(1),t,n):a);if(typeof r==`function`){let e=r(t,{props:i,context:n});typeof e==`object`&&e&&e!==i&&(aJ.set(e,{props:i,fn:r}),i=e)}return i}textWidth(e){if(e===null)return 0;if(e instanceof dJ){let t=0;for(let n of e.children)t+=this.textWidth(n);return t}return e instanceof pJ?this.textWidth(e.node):e.value.length}cleanUpRenderTree(e){if(e===null)return null;if(e instanceof pJ)return this.cleanUpRenderTree(e.node);if(e instanceof dJ){let t=e.children.map(this.cleanUpRenderTree,this).filter(e=>e!==null);if(t.length===0)return null;let n=this.viewEls.get(e),r=e.border;e=new dJ(e.type,t),e.border=r,n&&this.viewEls.set(e,n)}else if(e.value===``)return null;return e}serialize(e){let t=this.cleanUpRenderTree(e),n=[],r=``;if(t!==null){let{lines:e,spans:i}=a(t,null),o=0;for(let e of i){for(let t of e)if(t.length>0){let e=o+t.length;n.push({range:[o,e],view:(t.node&&this.viewEls.get(t.node))??null}),o=e}o++}r=e.join(`
|
|
81
|
+
`)}return{text:r,ranges:n};function i(e,t,n,r,i){if(t<e.length&&e[t].length<n){let a=e[t],o=a.padEnd(n),s=r[t].at(-1);e[t]=o,s?s.length+=o.length-a.length:r[t].push({length:o.length,node:i})}}function a(e,t){if(e instanceof fJ){let n=e.value.split(/\r\n?|\n/);return{spans:n.map(e=>[{length:e.length,node:t}]),lines:n}}let n=[[]],r=[``],o=0;if(e instanceof dJ){let t=`none`;for(let s of e.children){let c=s instanceof dJ?s.type:`inline`,{lines:l,spans:u}=a(s,e);if(l.length>0){switch(c){case`block`:o=r.length-1,r[o]===``?o>0&&r[o]!==``?(n.push([]),r.push(``)):o===0&&(n.pop(),r.pop()):(n.push([]),r.push(``)),n.push(...u),r.push(...l),n.push([]),o=r.push(``)-1;break;case`line`:t===`block`||r[o]===``&&(n.pop(),r.pop()),n.push(...u),r.push(...l),n.push([]),o=r.push(``)-1;break;case`inline-block`:{t===`block`?(o=r.push(``)-1,n.push([])):(t===`inline`||t===`inline-block`)&&i(r,o,mJ(r,o)+1,n,e);let a=r[o].length;if(n[o].push(...u[0]),r[o]+=l[0],l.length>1){let t=l.length-(r.length-o);for(let e=0;e<t;e++)n.push([]),r.push(``);for(let t=1;t<l.length;t++)i(r,o+t,a,n,e),n[o+t].push(...u[t]),r[o+t]+=l[t]}break}case`inline`:if(t===`block`?(o=r.push(``)-1,n.push([])):t===`inline-block`&&i(r,o,mJ(r,o)+1,n,e),n[o].push(...u[0]),r[o]+=l[0],l.length>1)for(let e=1;e<l.length;e++)o=r.push(l[e])-1,n[o]=u[e]}t=c}}for(;t!==`inline`&&r[o]===``;)o--,n.pop(),r.pop();if(e.border)return e.border.render(r,n,e)}return{spans:n,lines:r}}}async render(e,t,n,r,i){return typeof e==`string`?e=new dJ(e):e||=new dJ,await wJ(this,e,this.ensureValidConfig(this.normalizeConfig(t)),n,i,r),e}async renderString(e,t,n,r,i){return this.serialize(await this.render(e,t,n,r,i))}listLimit(e,t){return e===!1?!1:!e||isNaN(e)?t:Math.max(parseInt(e,10),0)||t}renderList(e,t,n,r,i){let{offset:a=0,moreContainer:o,beforeItem:s,afterItem:c,beforeMore:l=s,afterMore:u=c}=i,{limit:d=!1}=i;d===!1&&(d=n.length);let f=Promise.all(n.slice(a,a+d).map((i,o,l)=>{s&&e.appendText(s);let u=this.render(e,t,n,{...r,index:a+o,array:n,sliceIndex:o,slice:l},a+o);return c&&e.appendText(c),u}));return this.maybeMore(o||e,null,n.length,a+d,l,u),f}maybeMore(e,t,n,r,i,a){if(n>r){let t=n-r;e.appendText((i||``)+`(`+t+` more…)`+(a||``))}}getViewConfigTransitionTree(e){let t=iJ.get(e)||[];return Array.isArray(t)||(t=[t]),{value:e,deps:t.map(this.getViewConfigTransitionTree,this)}}getViewPropsTransition(e){let t=aJ.get(e)||null;return t&&{props:t.props,fn:t.fn,query:t.fn.query||null}}},EJ=e=>({demo:`${e}:"hello world\\nsome text..."`}),DJ=s({default:()=>OJ});function OJ({textView:e}){e.define(`alert`,{type:`block`,usage:EJ,border:{top:[`╔`,`═`,`╗`],left:`║ `,right:` ║`,bottom:[`╚`,`═`,`╝`]},render(t,n,r,i){let{content:a=`text`}=n;return e.render(t,a,r,i)}})}var kJ=(e,t)=>({demo:{view:e,text:`hello world`},examples:[{title:`Variations`,demo:t.map(e=>[`${e}:"${e}"`,`${e}:"${e}\\nmulti-line"`,`${e}:"${e}\\nmulti-line\\nmore..."`]).flat()},{title:`Complex content`,highlightProps:[`content`],demo:{view:e,content:[`text:"text"`,`link:"#example"`,`text:"text"`]}}]}),AJ=s({default:()=>jJ});function jJ({textView:e}){let t={type:`inline-block`,usage:kJ,props:`is not array? | {
|
|
82
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
|
83
|
+
content: undefined,
|
|
84
|
+
prefix,
|
|
85
|
+
postfix
|
|
86
|
+
} | overrideProps()`,render(e,t,n,r){let{text:i,content:a,prefix:o,postfix:s}=t,c;return o&&e.appendText(String(o)+` `),a?c=this.render(e,a,n,r):e.appendText(String(i)),s&&e.appendText(` `+String(s)),c}};e.define(`badge`,{...t,border:{left:[`⎡`,`⎢`,`⎣`,`[`],right:[`⎤`,`⎥`,`⎦`,`]`]}}),e.define(`pill-badge`,{...t,border:{left:[`⎧`,`⎪`,`⎩`,`(`],right:[`⎫`,`⎪`,`⎭`,`)`]}})}var MJ=(e,t)=>({demo:`${e}:'just a text'`,examples:[{title:`Variations`,demo:t.map(e=>[`header:"${e}"`,`text:"…text…"`,`${e}:"⎡${e}⎦"`,`text:"…text…"`,`${e}:"⎡${e}\\nmulti-line⎦"`,`text:"…text…"`,`${e}:"⎡${e}\\nmulti-line\\nmore and more…⎦"`,`text:"…text…"`]).flat()},{title:`Variations with border`,demo:t.map(e=>[`header:"${e}"`,`text:"…text…"`,`${e}{ border: [null, " |", null, "| "], data:"⎡${e}⎦" }`,`text:"…text…"`,`${e}{ border: [null, " |", null, "| "], data:"⎡${e}\\nmulti-line⎦" }`,`text:"…text…"`,`${e}{ border: [null, " |", null, "| "], data:"⎡${e}\\nmulti-line\\nmore and more…⎦" }`,`text:"…text…"`]).flat()}]}),NJ=s({default:()=>PJ});function PJ({textView:e}){function t(t,n,r,i){let{content:a=`text`,border:o}=n;return o&&t.setBorder(o),e.render(t,a,r,i)}e.define(`inline`,{type:`inline`,usage:MJ,render:t}),e.define(`inline-block`,{type:`inline-block`,usage:MJ,render:t}),e.define(`block`,{type:`block`,usage:MJ,render:t}),e.define(`line`,{type:`line`,usage:MJ,render:t})}var FJ=e=>({demo:{view:e,content:[`text:"Blockquote text..."`,`blockquote:"Nested blockquote\\nmulti-line text..."`]},examples:[{title:`Variations`,demoData:`Blockquote text...`,demo:[{kind:``,text:`Default blockquote without any kind.`},{kind:`note`,text:`Useful information that users should know, even when skimming content.`},{kind:`tip`,text:`Helpful advice for doing things better or more easily.`},{kind:`important`,text:`Key information users need to know to achieve their goal.`},{kind:`warning`,text:`Urgent info that needs immediate user attention to avoid problems.`},{kind:`caution`,text:`Advises about risks or negative outcomes of certain actions.`}].map(({kind:t,text:n})=>t?`${e}{ kind: "${t}", data: ${JSON.stringify(n)} }`:`${e}:${JSON.stringify(n)}`)}]}),IJ=FJ,LJ=s({default:()=>RJ});function RJ({textView:e}){e.define(`blockquote`,function(t,n,r,i){let{content:a=`text`,kind:o}=n;return typeof o==`string`&&/\S/.test(o)&&t.appendLine().appendText(`[!${o.trim().toUpperCase()}]`),e.render(t,a,r,i)},{type:`block`,usage:IJ,border:{left:`> `}})}var zJ={beforeDemo:['md:"A non-visual view used to group views, manage their visibility, or explicitly define data and context for nested views. In the example, the `context` view sets up specific data and context, allowing nested views (`content`) to utilize these shared definitions directly:"'],demo:{view:`context`,data:{name:`World`,age:`1000 years`},context:`{ ...#, greeting: "Hello" }`,content:["text:`${#.greeting}, ${name}!`",`table`]}},BJ=s({default:()=>VJ});function VJ({textView:e}){e.define(`context`,function(t,n,r,i){let{content:a=[]}=n;return e.render(t,a,r,i)},{usage:zJ})}var HJ=(e,t)=>({demo:`${e}:"Header \\"${e}\\""`,examples:[{title:`Variations`,view:t.map(e=>`${e}:"Header \\"${e}\\""`)},{title:`Complex content`,demo:{view:e,content:[`text:"Text "`,`link:{ text: "Link" }`]}},{title:`Using anchor`,demo:[{view:e,anchor:`foo`,content:`text:"Explicit value for an anchor"`},{view:e,anchor:!0,content:`text:"Auto generated anchor based on text content of header"`}]}]}),UJ=s({default:()=>WJ});function WJ({textView:e}){function t(t){let n=`#`.repeat(t)+` `;return async function(t,r,i,a){let{content:o}=r;return t.appendText(n),e.render(t,o||`text`,i,a)}}e.define(`header`,t(1),{type:`block`,usage:HJ}),e.define(`h1`,t(1),{type:`block`,usage:HJ}),e.define(`h2`,t(2),{type:`block`,usage:HJ}),e.define(`h3`,t(3),{type:`block`,usage:HJ}),e.define(`h4`,t(4),{type:`block`,usage:HJ}),e.define(`h5`,t(5),{type:`block`,usage:HJ})}var GJ={demo:{view:`link`,text:`I am a link`,href:`#example`},examples:[{title:`Infering text ⇿ href`,highlightProps:[`text`,`href`,`data`],beforeDemo:['md:"When `text` is omitted but `href` is specified, or vice versa, the opposite component is inferred from the specified one"'],demo:[{view:`link`,text:`http://example1.com`},{view:`link`,href:`http://example2.com`},{view:`link`,data:`"http://example3.com"`}]}]},KJ=s({default:()=>JJ}),qJ=`is not array? | {
|
|
87
|
+
text: #.props.content is undefined ? is string ?: text,
|
|
88
|
+
content: undefined,
|
|
89
|
+
href
|
|
90
|
+
} | overrideProps() | {
|
|
91
|
+
$text; $href;
|
|
92
|
+
...,
|
|
93
|
+
text: $text | is not undefined or no $href ?: $href,
|
|
94
|
+
href: $href | is not undefined or no $text ?: $text
|
|
95
|
+
}`;function JJ({textView:e}){e.define(`link`,async function(t,n,r,i){let{text:a,content:o,href:s}=n;s&&t.appendText(`[`),o?await e.render(t,o,r,i):t.appendText(a),s&&t.appendText(`](${s})`)},{type:`inline-block`,props:qJ,usage:GJ})}var YJ=(e,t)=>({demo:{view:e,data:[`one`,`two`,`three`,`four`]},examples:[{title:`Variations`,demoData:[`foo`,`bar`,`baz`],demo:t.map(e=>[`header:'view: \\"${e}\\"'`,e]).flat()},{title:`Variations long lists`,demoData:Array.from({length:100},(e,t)=>`item#`+t),demo:t.map(e=>[`header:'view: \\"${e}\\"'`,{view:e,limit:3}]).flat()},{title:`Configure item's content`,demo:[{view:e,data:[`one`,`two`,`three`,`four`],item:[`text:"<item> "`,{view:`link`,data:`{ href: "#" + $ }`}]}]}]}),XJ=s({default:()=>ZJ});function ZJ({textView:e}){e.define(`list`,t(`line`,``),{type:`block`,usage:YJ}),e.define(`inline-list`,t(`inline-block`),{type:`inline-block`,usage:YJ}),e.define(`comma-list`,t(`inline-block`,``,`,`),{type:`inline-block`,usage:YJ}),e.define(`ol`,t(`line`,e=>1+e.index+`. `),{type:`block`,usage:YJ}),e.define(`ul`,t(`line`,`- `),{type:`block`,usage:YJ}),e.define(`list-item`,function(t,n,r,i){let{content:a=`text`,bullet:o,delim:s,renderType:c=`line`}=n,l=typeof o==`function`?o:o?(()=>o):null,u=typeof s==`function`?s:s?(()=>s):null;return t.type=c,(l||u)&&t.setBorder({left:l?(e=>e===0?l(i):``):null,right:u?(e=>e===0&&i.index!==i.array.length-1?u(i):``):null}),e.render(t,a,r,i)});function t(t,n,r){return async function(i,a,o,s){let{item:c,itemConfig:l,limit:u,emptyText:d}=a,f;return!Array.isArray(o)&&o&&(o=[o]),Array.isArray(o)&&o.length>0?f=e.renderList(i,this.composeConfig({view:`list-item`,content:c,bullet:n,delim:r,renderType:t},l),o,s,{limit:e.listLimit(u,25)}):i.appendText(String(d||`<empty list>`)),f}}}var QJ='let name = "world";\n\nconsole.log(`Hello, ${name}!`);',$J=Function(`return num => num + 5`)(),eY={demo:{view:`source`,syntax:`js`,source:QJ},examples:[{title:`Custom line numbers`,highlightProps:[`lineNum`],demo:[{view:`source`,source:QJ,syntax:`js`,lineNum:$J},{view:`source`,source:QJ,syntax:`js`,lineNum:`==> $ + 12345`}]},{title:`Hide line numbers`,highlightProps:[`lineNum`],beforeDemo:['md:"Pass falsy value to `lineNum` option to hide line numbers:"'],demo:{view:`source`,source:QJ,syntax:`js`,lineNum:!1}},{title:`Marks`,highlightProps:[`marks`],beforeDemo:{view:`md`,source:["The `marks` option allows injecting text marks at specific points in the source text. The `marks` value must be an array of objects with the following fields:",`
|
|
96
|
+
`,"- `offset` (required) - the offset in the source where the mark is injected.","- `content` - view config for content (e.g., `'text:\"hello\"'` or `{ view: 'name', ... }`)","- `prefix` - text to display before the content of mark","- `postfix` - text to display after the content of mark"]},demo:{view:`source`,source:`let demo = "mark";
|
|
97
|
+
|
|
98
|
+
if (expr) {
|
|
99
|
+
// do something
|
|
100
|
+
}`,syntax:`js`,marks:[{offset:4},{offset:4,content:`text:"mark"`},{offset:24,prefix:`self: `,content:`text:"123"`,postfix:`ms`}]}}]},tY=s({default:()=>rY}),nY=`is not array? | {
|
|
101
|
+
source: #.props has no 'source' ? is string ?: content is string ? content : source,
|
|
102
|
+
syntax,
|
|
103
|
+
lineNum is function ?: is not undefined ? bool() : true,
|
|
104
|
+
marks is array ?: null
|
|
105
|
+
} | overrideProps()`;function rY(e){e.textView.define(`source`,{type:`block`,props:nY,usage:eY,async render(t,n,r,i){let a=[],{source:o,syntax:s,lineNum:c=!0,marks:l}=n,u={...i,sourceViewProps:{source:o,syntax:s,lineNum:c,marks:l}};if(typeof o!=`string`)return;let d=typeof c==`function`?c:e=>e+1,f=c?o.split(/\r\n?|\n/g).map((e,t)=>String(d(t))):[];if(f.length>2){let e=f.reduce((e,t)=>Math.max(e,t.length),3);for(let t=0;t<f.length;t++)f[t].length<e&&(f[t]=f[t].padStart(e))}if(t.appendLine().appendText(`\`\`\`${s||``}`),t.appendText(p()),Array.isArray(l)){for(let t of l){if(!t||typeof t!=`object`){e.logger.warn(`Bad value for an entry in "source" view props.mark, must be an object`,{props:n,mark:t});return}let r=typeof t.offset==`number`&&isFinite(t.offset)?Math.max(0,Math.round(t.offset)):void 0;if(typeof r!=`number`){e.logger.warn(`Bad "offset" value for an entry in "source" view props.marks`,{props:n,mark:t});return}a.push({...t,offset:Math.max(0,Math.min(r,o.length))})}a.sort((e,t)=>e.offset-t.offset);let r=0;for(let e of a){let{offset:n,content:i=[],prefix:a=``,postfix:s=``}=e;n>r&&(m(o.slice(r,n)),r=n),t.appendText(`/* `+a),await this.render(t,i,e,u),t.appendText(s+` */`)}r<o.length&&m(o.slice(r))}else m(o);t.appendLine().appendText("```");function p(){let e=f.shift();return typeof e==`string`?e+` │ `:``}function m(e){let n=e.split(/\r\n?|\n/);t.appendText(n[0]);for(let e=1;e<n.length;e++)t.appendText(`
|
|
106
|
+
`+p()+n[e])}}})}var iY={demo:{view:`switch`,content:[{when:`expr`,content:'text:"Renders when `expr` is truthy"'},{content:'text:"Renders when all other `when` conditions are falsy"'}]}},aY=s({default:()=>oY});function oY(e){e.textView.define(`switch`,function(t,n,r,i){let{content:a}=n,o=`text:"<switch: no case choosen>"`;if(Array.isArray(a)){for(let t of a)if(t&&e.queryBool(t.when||!0,r,i)){o=`data`in t?{view:`context`,data:t.data,content:t.content}:t.content;break}}return e.textView.render(t,o,r,i)},{usage:iY})}function sY(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cY(e){return Array.isArray(e)||sY(e)}function lY(e){return az(e)===`[object Set]`}function uY(e){return az(e)===`[object RegExp]`}function dY(e){return typeof e==`object`&&!!e}var fY=typeof Symbol.toStringTag==`symbol`,pY=Error,mY=globalThis.DOMError,hY=typeof pY.isError==`function`?pY.isError:gY;function gY(e){if(!e||typeof e!=`object`&&typeof e!=`function`)return!1;if(!fY||!(Symbol.toStringTag in e)){let t=az(e);return t===`[object Error]`||t===`[object DOMException]`||t===`[object DOMError]`||t===`[object Exception]`}return mY!==void 0&&e instanceof mY||e instanceof Error}var _Y={demoData:[{name:`Alice`,age:34,occupation:`Engineer`},{name:`Bob`,age:42,occupation:`Doctor`},{name:`Charlie`,age:9,occupation:`Student`},{name:`David`,age:50,occupation:`Doctor`},{name:`Eve`,age:15,occupation:`Engineer`}],demo:{view:`table`,limit:2,cols:{age:{footer:`text:sum(=>age)`},occupation:{footer:{}}}}},vY=s({default:()=>xY});function yY(e,t){return{header:e,view:`table-cell`,data:t}}function bY(e,t,n){return typeof t==`string`&&(t={content:t}),oz(t,`content`)||oz(t,`data`)?{header:e,view:`table-cell`,...t}:{...yY(e,n),...t}}function xY(e){let t=e.queryFn(`is not object`);e.textView.define(`table`,async function(n,r,i,a){let{rows:o,cols:s,valueCol:c=!1,headerWhen:l=!0,footerWhen:u=!0,limit:d=25}=r,f=0;`rows`in r||(o=i),lY(o)&&(o=[...o]),cY(o)||(o=o?[o]:[]),d!==!1&&o.length>d&&(f=o.length-d,o=o.slice(0,d));let p=[];if(Array.isArray(s))s=s.map((t,n)=>typeof t==`string`?yY(t,e.pathToQuery([t])):{header:`col`+n,view:`table-cell`,...t});else{let n=new Set,r=s&&typeof s==`object`?s:{};s=[];for(let e of o)if(t(e))c=!0;else for(let t of Object.keys(e))n.add(t);for(let e of Object.keys(r))r[e]?n.add(e):n.delete(e);for(let t of n)s.push(oz(r,t)?bY(t,r[t],e.pathToQuery([t])):yY(t,e.pathToQuery([t])))}if(c&&s.unshift({header:`[value]`,view:`table-cell`,details:!1}),s=s.filter(t=>!oz(t,`colWhen`)||e.queryBool(t.colWhen,i,a)),!s.length)return n.appendText(`
|
|
107
|
+
<empty table>
|
|
108
|
+
`);let m=e.query(l,i,a),h=e.query(u,i,a),g=Array.from(o,()=>[]),_=[],v=[];for(let t of s){let n=String(t.header).trim(),r=0;if(m){let t=await this.render(null,`text`,n),i=e.textView.textWidth(t);r=Math.max(r,i),p.push({width:i,content:t})}for(let n=0;n<o.length;n++){let i=await this.render(null,t,o[n],a),s=e.textView.textWidth(i);r=Math.max(r,s),g[n].push({width:s,align:t.align,content:i})}if(h&&t.footer){let{align:n,...o}=typeof t.footer==`object`&&t.footer!==null&&!oz(t.footer,`view`)?t.footer:{content:t.footer},s=await this.render(null,this.composeConfig(`block`,o),i,a),c=e.textView.textWidth(s);r=Math.max(r,c),v.push({width:c,align:n,content:s})}else v.push(null);_.push(r)}y(_,`┌`,`┬`,`┐`),m&&(b(_,p),y(_,`├`,`┼`,`┤`));for(let e of g)b(_,e);if(f>0){let e=_.reduce((e,t)=>e+t+3,0)+1,t=` ${f} more rows… `,r=Math.max(1,e-t.length);n.appendLine().appendText(`${`~`.repeat(1)}${t}${`~`.repeat(Math.ceil(r-1))}`),h&&v.some(e=>e!==null)&&(y(_,`├`,`┼`,`┤`),b(_,v),y(_,`└`,`┴`,`┘`))}else h&&v.some(e=>e!==null)&&(y(_,`├`,`┼`,`┤`),b(_,v)),y(_,`└`,`┴`,`┘`);function y(e,t,r,i){let a=t+`─`.repeat((e[0]||0)+2);for(let t=1;t<e.length;t++)a+=r+`─`.repeat(e[t]+2);n.appendLine().appendText(a+i)}function b(e,t){let r=n.appendLine();for(let n=0;n<t.length;n++){let{width:i=0,align:a,content:o=``}=t[n]||{},s=e[n]-i+1;s>0&&a!==`right`?r.appendText(`│ `):r.appendText(`│`+` `.repeat(s)),r.append(o),s>0&&a===`right`?r.appendText(` `):r.appendText(` `.repeat(s))}r.appendText(`│`)}},{type:`block`,usage:_Y}),e.textView.define(`table-cell`,function(t,n,r,i){let{content:a,contentWhen:o=!0}=n,s=!a&&r!==null&&(Array.isArray(r)?r.length>0:typeof r==`object`)&&!(r instanceof RegExp);if(e.queryBool(o,r,i)){if(a)return e.textView.render(t,a,r,i);t.appendText(SY(r,s))}})}function SY(e,t){if(Array.isArray(e)||ArrayBuffer.isView(e))return e.length||``;if(t){for(let t in e)if(oz(e,t))return`{…}`;return`{}`}return e===void 0?``:String(e)}var CY={demo:`text:"just a text"`},wY=s({default:()=>TY});function TY({textView:e}){e.define(`text`,{props:`{ text: #.props has no 'text'? } | overrideProps()`,usage:CY,render(e,t){let{text:n}=t;e.appendText(String(n))}})}var EY=s({alert:()=>DJ,badge:()=>AJ,block:()=>NJ,blockquote:()=>LJ,context:()=>BJ,headerViews:()=>UJ,link:()=>KJ,listViews:()=>XJ,source:()=>tY,switchView:()=>aY,table:()=>vY,textViews:()=>wY}),DY=class e extends eJ{#e;constructor(){super(!0),this.#e=Object.create(null)}define(t,n){if(typeof n!=`function`)throw Error(`callback is not a function`);return this.#e=Object.freeze({...this.#e,[t]:n}),e.define(this,t,Object.freeze({name:t,callback:n}))}revoke(e){if(this.has(e)){let t={...this.#e};delete t[e],this.#e=Object.freeze(t)}super.revoke(e)}get actionMap(){return this.#e}call(e,...t){let n=this.get(e);if(n===void 0)throw Error(`action "${e}" doesn't exist`);let{callback:r}=n;return r(...t)}},OY=new Map,kY=null;function AY(e){kY=null;for(let[t,n]of OY.entries())e.warn.groupCollapsed(`${t} (${n.length})`,n);OY.clear()}function jY(e,t,...n){kY===null&&OY.size===0&&(kY=setTimeout(()=>AY(e),1));let r=OY.get(t);r===void 0?OY.set(t,[n]):r.push(n)}function MY(e,t,n){switch(typeof t){case`function`:return t;case`string`:return Object.assign(e=>e&&oz(e,t)?e[t]:void 0,{getterFromString:`object[${JSON.stringify(t)}]`});default:throw Error(`[Discovery] Bad type "${typeof t}" for ${n} in object marker "${e}" config (must be a string or a function)`)}}function NY(e,t,n,r){let i=t&&oz(t,n)?t[n]:void 0;return i===void 0?r:MY(e,i,`"${n}" option`)}function PY(e,t,n){return(Array.isArray(t[n])&&t[n]||[]).map(t=>MY(e,t,`"${n}" option`))}function FY(e,t=!1){return e===null?!1:t?typeof e==`object`:typeof e==`object`||typeof e==`number`||typeof e==`string`}function IY(e,t){let{name:n,indexRefs:r,lookupRefs:i,annotateScalars:a,page:o,getRef:s,getTitle:c}=t;s!==null&&r.unshift(s),o&&s===null&&e.warn(`Option "ref" for "${n}" marker must be specified when "page" options is defined ("page" option ignored)`),r.length>0&&i.unshift(e=>e);let l=new Set,u=new Map,d=new Map,f=new WeakMap;return{name:n,page:s===null?null:o,mark:t=>{if(typeof t!=`object`||!t){e.warn(`Invalid value used for "${n}" marker (should be an object)`);return}l.add(t);for(let i of r){let r=i(t);if(FY(r)){if(!u.has(r)){u.set(r,t);continue}u.get(r)!==t&&jY(e,`The same reference value used for different objects for "${n}" marker`,`Reference value "${r}"`,{refGetter:i.getterFromString||i,ref:r,currentObject:u.get(r),newObject:t})}}},lookup:(e,t=!1)=>{if(!FY(e,t?!a:!1))return null;let r=typeof e==`object`,p=r?f.get(e):d.get(e);if(p!==void 0)return p;let m=null;if(r&&l.has(e))m=e;else for(let t of i){let n=t(e),r=u.get(n);if(r!==void 0){m=r;break}}if(m===null)return null;let h=d.get(m);if(h!==void 0)return h;let g=s===null?null:s(m),_=Object.freeze({type:n,object:m,ref:g,title:c(m),href:o!==null&&g!==null?`#${encodeURIComponent(o)}:${encodeURIComponent(g)}`:null});return d.set(m,_),e!==m&&(r?f.set(e,_):d.set(e,_)),_},reset:()=>{l.clear(),u.clear(),d.clear(),f=new WeakMap}}}var LY=class e extends eJ{constructor(e){super(),this.logger=e}#e=!1;lock(){this.#e=!0}define(t,n){if(this.#e)throw Error(`Object marker definition is not allowed after setup`);if(this.isDefined(t))throw Error(`Object marker "${t}" is already defined, new definition ignored`);n||={};let r=PY(t,n,`refs`),i=PY(t,n,`lookupRefs`),a=!!n.annotateScalars,o=n.page,s=typeof o==`string`?o:null,c=NY(t,n,`ref`,null),l=NY(t,n,`title`,c||(()=>null));return e.define(this,t,Object.freeze(IY(this.logger,{name:t,indexRefs:r,lookupRefs:i,annotateScalars:a,page:s,getRef:c,getTitle:l})))}reset(){for(let{reset:e}of this.values)e()}markerMap(){return Object.fromEntries([...this.entries].map(([e,t])=>[e,t.mark]))}lookup(e,t){if(typeof t==`string`)return this.get(t)?.lookup(e)||null;for(let{lookup:t}of this.values){let n=t(e);if(n!==null)return n}return null}lookupAll(e){let t=[];for(let{lookup:n}of this.values){let r=n(e);r!==null&&t.push(r)}return t}};function RY(e,t,n){let r=String(e),[i,a]=r.match(/^(?:\S+\s+)?(\S+)\(/)||[];if(i!==`function`&&i!==`function*`&&a===n.trim().slice(0,-1)&&(n=``),r.indexOf(`
|
|
109
|
+
`)===-1)return n+r;let o=r.split(/\n/),s=o[o.length-1].match(/^\s*/)?.[0].length||0,c=RegExp(`^\\s{0,`+s+`}`);return n+o.map((e,n)=>n&&e.length?e.replace(c,t):e).join(`
|
|
110
|
+
`)}function zY(e,t,n){return typeof e==`function`?RY(e,t,n):e instanceof Date?`${n}new Date("${e.toISOString()}")`:Array.isArray(e)?`${n}[${e.join(`, `)}]`:n+String(e)}var BY=new Set([`[object Function]`,`[object RegExp]`,`[object Date]`]);function VY(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function HY(e,t,n=4){let r=[];return String(JSON.stringify(e,t||function(e,t){return typeof t==`string`&&az(this[e])===`[object Date]`&&(t=this[e]),t!==null&&(BY.has(az(t))||VY(t))?(r.push(t),`{{{__placeholder__}}}`):t},n)).replace(/"((?:\\.|[^"])*)"(:?)/g,(e,t,n)=>n&&/^[a-z$_][a-z$_\d]*$/i.test(t)?t+n:`'${t.replace(/\\"/g,`"`).replace(/'/g,`\\'`)}'`+n).replace(/(^|\n)([ \t]*)(.*?)([a-zA-Z$_][a-zA-Z0-9$_]+:\s*)?'{{{__placeholder__}}}'/g,(e,t,n,i,a)=>t+n+i+zY(r.shift(),n,a))}function UY(...e){try{return JSON.parse(...e)}catch(e){return e}}function WY(...e){try{return JSON.stringify(...e)??`null`}catch(e){return String(e)}}var GY=new TextEncoder,KY=new TextDecoder,[qY,JY]=(()=>{let e=new Uint8Array(64),t=new Uint8Array(256);for(let n=0;n<64;n++){let r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charCodeAt(n);t[r]=n,e[n]=r}return[e,t]})();function YY(e){return KY.decode(XY(e))}function XY(e){typeof e==`string`&&(e=GY.encode(e));let t=new Uint8Array(Math.ceil(e.length/3)*4),n=0,r=0,i=0;for(let a=0;a<e.length;a++)for(r=r<<8|e[a],i+=8;i>=6;){let e=r>>(i-=6);t[n++]=qY[e],r-=e<<i}for(i!==0&&(t[n++]=qY[r<<6-i]);n<t.length;)t[n++]=61;return t}function ZY(e){return KY.decode(QY(e))}function QY(e){let t=e.length;for(;t>0&&e[t-1]===`=`;)t--;let n=new Uint8Array(3*Math.ceil(t/4)),r=0,i=0,a=0;for(let o=0;o<t;o++)if(i=i<<6|JY[e.charCodeAt(o)&255],a+=6,a>8){let e=i>>(a-=8);n[r++]=e,i-=e<<a}return a!==0&&(n[r++]=i),n.subarray(0,(t>>2)*3+(t%4*6>>3))}var $Y=/^data:image\/([a-z\+]+?(?:;base64)?),/,eX=/^([a-z\-]+:|\.{0,2}\/)/i;function tX(e){return e.includes(`http://www.w3.org/2000/svg`)?/(?:<|%3[cC])svg[:\s]/.test(e):!1}function nX(e){return typeof e==`string`&&$Y.test(e)}function rX(e){let t=sX(e);if(t!==null)return`data:image/${t.type},${t.content}`}function iX(e){return typeof e==`string`&&eX.test(e)&&(nX(e)||!oX(e))}function aX(e){if(typeof e==`string`)return iX(e)?e:rX(e)}function oX(e){return sX(e)!==null}function sX(e){if(typeof e==`string`&&e.length>100){let t=null,n=null;switch(e.charCodeAt(0)){case 47:e.startsWith(`/9j/`)&&(t=`jpeg;base64`,n=e);break;case 37:case 60:tX(e)&&(t=`svg+xml`,n=e);break;case 65:(e.startsWith(`AAAB`)||e.startsWith(`AAAC`))&&(t=`ico;base64`,n=e);break;case 80:(e.startsWith(`PD94bWwg`)||e.startsWith(`PHN2`))&&tX(ZY(e))&&(t=`svg+xml;base64`,n=e);break;case 82:(e.startsWith(`R0lGODdh`)||e.startsWith(`R0lGODlh`))&&(t=`gif;base64`,n=e);break;case 100:if(e.startsWith(`data:image/`)){let r=e.match($Y);r!==null&&(t=r[1],n=e.slice(r[0].length))}break;case 105:if(e.startsWith(`iVBORw0KGg`))t=`png;base64`,n=e;else if(e.startsWith(`image/`)){let r=e.match(/^image\/([a-z\+]+?(;base64)?),/);r!==null&&(t=r[1],n=e.slice(r[0].length))}}if(t!==null&&n!==null)return{type:t,content:n}}return null}var cX={overrideProps:lX,jsonInfo:kK,jsonParse:UY,jsonStringify:WY,imagecontent:sX,imagedatauri:rX,imagesrc:aX};function lX(e,t=this.context.props){if(!t)return e;let n={...e};for(let e of Object.keys(n))oz(t,e)&&(n[e]=t[e]);return n}var uX={error:hY,imagecontent:oX,imagedatauri:nX,imagesrc:iX};function dX(e,t){return{before(){e.objectMarkers.reset()},contextApi:{markers:e.objectMarkers.markerMap(),setWorkTitle:t?.setPrepareWorkTitle||(()=>Promise.resolve()),rejectData(e,t){throw Object.assign(Error(e),{renderContent:t})}}}}function fX(e,t){let n=e.objectMarkers,r={setPrepare:e.setPrepare.bind(e),defineObjectMarker:c,addQueryHelpers(t){return e.logger.warn(`addQueryHelpers() is deprecated, use addQueryMethods() instead`),o(t)},addQueryMethods:o,addQueryAssertions:s},i={...cX,query:e.query.bind(e),pageLink:(t,n,r,i)=>e.encodePageHash(n,t,r,i),marker:n.lookup.bind(n),markerAll:n.lookupAll.bind(n),callAction:l,actionHandler:(t,...n)=>e.action.has(t)?()=>l(t,...n):void 0},a={...uX};typeof t==`function`&&t(r),n.lock(),e.queryFnFromString=aK.setup({methods:i,assertions:a});function o(e){i={...i,...e}}function s(e){a={...a,...e}}function c(e,t){let{mark:r,lookup:i}=n.define(e,t);return i?r:()=>{}}function l(t,...n){let r=n[n.length-1],i=null;typeof r==`function`&&(i=r,n.pop());let a=e.action.call(t,...n);return a&&i&&typeof a.then==`function`?a.then(i):i?i(a):a}}function pX(e,t){let n=new LY(e.logger),r=[],i=[],a={setWorkTitle:t?.setPrepareWorkTitle||(()=>Promise.resolve()),rejectData(e,t){throw Object.assign(Error(e),{renderContent:t})},defineObjectMarker:d,lookupObjectMarker:f,lookupObjectMarkerAll:p,addValueAnnotation:m,addQueryHelpers(t){return e.logger.warn(`addQueryHelpers() is deprecated, use addQueryMethods() instead`),l(t)},addQueryMethods:l,addQueryAssertions:u,query(t,...n){return e.queryFn.call({queryFnFromString:c},t)(...n)}},o={...cX,query:e.query.bind(e),pageLink:(t,n,r,i)=>e.encodePageHash(n,t,r,i),marker:f,markerAll:p,callAction:h,actionHandler:(t,...n)=>e.action.has(t)?()=>h(t,...n):void 0},s={...uX},c=aK.setup({methods:o,assertions:s});return{contextApi:a,after(e){Object.assign(e,{objectMarkers:n,linkResolvers:r,annotations:i,queryFnFromString:c})}};function l(e){c=aK.setup({methods:o={...o,...e}})}function u(e){c=aK.setup({assertions:s={...s,...e}})}function d(t,i){let{page:a,mark:o,lookup:s}=n.define(t,i)||{};if(!s)return()=>{};if(a!==null){if(!e.page?.isDefined(a))return e.logger.error(`Page reference "${a}" doesn't exist`),()=>{};r.push(e=>{let t=s(e);return t&&{type:a,text:t.title,href:t.href,entity:t.object}})}return m((e,n)=>{let r=s(e,!0);if(r!==null&&r.object!==n.host)return{place:`before`,style:`badge`,text:t,href:r.href}}),o}function f(e,t){return n.lookup(e,t)}function p(e){return n.lookupAll(e)}function m(e,t=!1){typeof t==`boolean`&&(t={debug:t}),i.push({query:e,...t})}function h(t,...n){let r=n[n.length-1],i=null;typeof r==`function`&&(i=r,n.pop());let a=e.action.call(t,...n);return a&&i&&typeof a.then==`function`?a.then(i):i?i(a):a}}var mX=new WeakMap,hX=[`variable`,`property`,`value`,`assertion`,`method`],gX=(e,t)=>hX.indexOf(e.type)-hX.indexOf(t.type),_X=e=>{let t=e.toLowerCase();return n=>n!==e&&(typeof n==`string`?n:String(n)).toLowerCase().indexOf(t)!==-1};function vX(e,t){return typeof e==`string`?(e=JSON.stringify(e),t[0]===`'`?`'${e.slice(1,-1).replace(/\\.|'/g,e=>e===`\\"`?`"`:e===`'`?`\\'`:e)}'`:e):String(e)}function yX(e,t,n){if(t===n)return!0;let r=e.stat(t)||[],i=e.stat(n)||[];if(r.length!==i.length)return!1;for(let e=0;e<r.length;e++){let t=r[e],n=i[e];for(let e of Object.keys(t))if(t[e]!==n[e])return!1}return!0}function bX(e,t,n,r,i){try{let a=mX.get(e);if((!a||a.query!==t||a.data!==r||a.context!==i)&&(mX.set(e,a={query:t,data:r,context:i,offset:-1,suggestions:null,api:null}),a.api=e.queryFnFromString(t,{tolerant:!0,stat:!0})(r,i)),a.api===null)return null;if(a.offset!==-1&&yX(a.api,a.offset,n))return a.suggestions;let o=a.api.suggestion(a.offset=n,{sort:!0,filter:_X,limit:50});if(o){a.suggestions=[];for(let e of o.sort(gX))a.suggestions.push(...e.suggestions.map(t=>({type:e.type,from:e.from,to:e.to,text:e.text,value:e.type===`value`?vX(t,e.text):t})))}else a.suggestions=null;return a.suggestions}catch(t){return e.logger.error(`Error while attempting to retrieve suggestions for the query:`,t.message),null}}var xX=new Proxy({},{get:()=>()=>{}}),SX=[`silent`,`error`,`warn`,`info`,`perf`,`debug`],CX={error:[`error`,`error`],warn:[`warn`,`warn`],info:[`info`,`info`],perf:[`log`,`perf`],log:[`log`,`any`],debug:[`debug`,`debug`]},wX=class{#e;#t;#n;error;warn;info;perf;debug;log;constructor(e=``,t=`debug`,n=console){this.#t=e,this.#n=n||xX,this.logLevel=t}shouldLogLevel(e){let t=SX.indexOf(e);return this.#e!==`silent`&&t!==-1&&t<=SX.indexOf(this.#e)}get logLevel(){return this.#e}set logLevel(e){if(SX.indexOf(e)===-1&&console.error(this.#t,`Bad log level "${e}", supported: ${SX.join(`, `)}`),e!==this.#e){let t=this.#n,n=this.#t,r=e=>Function.prototype.bind.call(this.#n[e],this.#n,...this.#t?[this.#t]:[]),i=(e,r)=>(i,a)=>{t[r?`groupCollapsed`:`group`](`${n} ${i}`);let o=typeof a==`function`?a():a;if(Array.isArray(o))for(let n of o)t[e](...Array.isArray(n)?n:[n]);t.groupEnd()};this.#e=e;for(let[e,[t,n]]of Object.entries(CX))this[e]=n===`any`||this.shouldLogLevel(n)?Object.assign(r(t),{group:i(t,!1),groupCollapsed:i(t,!0)}):Object.assign(()=>{},{group:()=>()=>{},groupCollapsed:()=>()=>{}})}}},TX=(e,t)=>EX(e,t,TX);function EX(e,t,n=Object.is){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;for(let r in e)if(oz(e,r)&&(!oz(t,r)||!n(e[r],t[r])))return!1;for(let n in t)if(oz(t,n)&&!oz(e,n))return!1;return!0}var DX=()=>void 0,OX=`[Discovery]`,kX=e=>/^[a-zA-Z_][a-zA-Z_$0-9]*$/.test(e)&&!AX.includes(e),AX=[`and`,`or`,`in`,`has`,`is`,`not`,`no`,`asc`,`ascN`,`ascA`,`ascNA`,`ascAN`,`desc`,`descN`,`descA`,`descNA`,`descAN`],jX=(e,t)=>({...t,encodings:Array.isArray(t?.encodings)?[...t.encodings,...e.encodings]:e.encodings}),MX=class extends _z{options;info;logger;action;objectMarkers;linkResolvers;encodings;datasets;data;#e;prepare;#t;#n;textView;constructor(e){super(),this.options=e||{};let{name:t,version:n,description:r,icon:i,logLevel:a=`warn`,logger:o=console,extensions:s,encodings:c,context:l,setup:u}=e||{};this.info={name:t||`Untitled model`,version:n||null,description:r||null,icon:i||null},this.logger=new wX(OX,a,o),this.action=new DY,this.objectMarkers=new LY(this.logger),this.linkResolvers=[],this.datasets=[],this.encodings=cK(c),this.data=void 0,this.#e=l,this.prepare=e=>e,this.#t=!0,this.textView=new TJ(this),this.apply(s),typeof u==`function`?(this.#t=!1,fX(this,u)):fX(this,()=>{}),this.apply(EY);for(let{page:e,lookup:t}of this.objectMarkers.values)e&&this.linkResolvers.push(n=>{let r=t(n);return r&&{type:e,text:r.title,href:r.href,entity:r.object}})}apply(e){Array.isArray(e)?e.forEach(e=>this.apply(e)):typeof e==`function`?e.call(null,this):e&&this.apply(Object.values(e))}log(){this.logger.error(`Model#log() is deprecated, use Model#logger interface instead`)}get legacyPrepare(){return this.#t}setPrepare(e){if(typeof e!=`function`)throw Error(`An argument should be a function`);this.prepare=e}get context(){return this.#e}set context(e){this.setContext(e,!0)}setContext(e,t=!1){let n=this.#e;if(t)this.#e=e;else{let t={...this.#e,...e};EX(t,n)||(this.#e=t)}Object.is(this.#e,n)||this.emit(`context`,n,this.#e)}getContext(){return{model:this.info,actions:this.action.actionMap,datasets:this.datasets,data:this.data,...this.context}}setData(e,t){t||={};let n=Symbol();this.#n=n;let r=Date.now(),i=()=>{if(this.#n!==n)throw Error(`Prevented by another setData()`)},a=this.#t?pX(this,t):dX(this,t);return Promise.resolve().then(()=>(i(),a.before?.(this),this.prepare.call(null,e,a.contextApi)||e)).then(e=>{i(),this.datasets=[{...t.dataset,data:e}],this.data=e,a.after?.(this),this.emit(`data`),this.logger.perf(`Data prepared in ${Date.now()-r}ms`)})}async trackLoadDataProgress(e){let t=Date.now(),n=await e.dataset;return this.logger.perf(`Data loaded in ${Date.now()-t}ms`),this.setData(n.data,{dataset:n})}loadDataFromStream(e,t){return this.trackLoadDataProgress(Jq(e,jX(this,t)))}loadDataFromEvent(e,t){return this.trackLoadDataProgress(Xq(e,jX(this,t)))}loadDataFromFile(e,t){return this.trackLoadDataProgress(Yq(e,jX(this,t)))}loadDataFromUrl(e,t){return this.trackLoadDataProgress(Zq(e,jX(this,t)))}unloadData(){this.hasDatasets()&&(this.datasets=[],this.data=void 0,this.emit(`unloadData`))}hasDatasets(){return this.datasets.length!==0}getQueryEngineInfo(){return{name:`jora`,version:aK.version,link:`https://discoveryjs.github.io/jora/#article:jora-syntax`}}queryFnFromString(){return DX}queryFn(e){switch(typeof e){case`function`:return e;case`string`:return Object.assign(this.queryFnFromString(e),{query:e})}}query(e,t,n){switch(typeof e){case`function`:return e(t,n);case`string`:return this.queryFn(e)(t,n);default:return e}}queryBool(e,t,n){return aK.buildin.bool(this.query(e,t,n))}querySuggestions(e,t,n,r){return bX(this,e,t,n,r)}pathToQuery(e){let t=``,n=e=>t+=t===``?e[0]===`[`?`$`+e:e:e[0]===`[`?e:`.`+e;for(let t of e)t===`*`?n(`values()`):typeof t==`number`?n(`[${t}]`):kX(t)?n(t):n(`["${t}"]`);return t}stripAnchorFromHash(e){return typeof e==`string`?e.replace(/(^|&)!anchor(=[^&]+|(?=&|$))/g,``):e}encodePageHash(e=null,t=null,n,r=null){let i=n;return i&&(typeof i==`string`?i=this.stripAnchorFromHash(i):(Array.isArray(i)||(i=Object.entries(i)),i=i.filter(([e])=>e!==`!anchor`).map(e=>e.map(encodeURIComponent).join(`=`)).join(`&`))),`#${e?encodeURIComponent(e):``}${typeof t==`string`&&t||typeof t==`number`?`:`+encodeURIComponent(t):``}${i?`&`+i:``}${r?`&!anchor=`+encodeURIComponent(r):``}`}decodePageHash(e,t=()=>Object.fromEntries){let n=(e.indexOf(`&`)+1||e.length+1)-1,[r,i=null]=e.substring(+(e[0]===`#`),n).split(`:`).map(decodeURIComponent),a=[],o=null;for(let t of e.slice(n+1).split(`&`).filter(Boolean)){let e=t.indexOf(`=`),n,r;e===-1?(n=decodeURIComponent(t),r=!0):(n=decodeURIComponent(t.slice(0,e)),r=decodeURIComponent(t.slice(e+1))),n===`!anchor`?o=r&&r!==!0?r:null:a.push([n,r])}return{pageId:r,pageRef:i,pageParams:t(r)(a),pageAnchor:o}}resolveValueLinks(e){let t=[],n=typeof e;if(e&&(n===`object`||n===`string`))for(let n of this.linkResolvers){let r=n(e);r&&t.push(r)}return t.length?t:null}};async function NX(e,t){let n=$(`style`,null,`:host{display:none}`),r=new Set;Array.isArray(t)&&(e.append(...t.map(e=>{switch(typeof e==`string`&&(e={type:`style`,content:e}),e.type){case`style`:case`inline`:return $(`style`,{media:e.media},e.content);case`link`:case`external`:{let t,n,i=new Promise((e,r)=>{t=e,n=r});return r.add(i),$(`link`,{rel:`stylesheet`,href:e.href,media:e.media,onerror(e){r.delete(i),n(e)},onload(){r.delete(i),t()}})}default:throw Error(`Unknown type "${e.type}" for a style descriptor`)}})),r.size&&(e.append(n),await Promise.all(r),n.remove()))}var PX=LX(`localStorage`),FX=RX(`localStorage`),IX=new Map;function LX(e){let t=zX(e),n=new Map;return function(e){let r=n.get(e);return r===void 0&&(r=new VX(t,e),n.set(e,r),BX(t,n)),r}}function RX(e){let t=zX(e);return function(e){return t?.getItem(e)??null}}function zX(e){let t=`__storage_test__`+Math.random(),n;try{n=window[e]}catch{return null}try{n.setItem(t,t),n.removeItem(t)}catch(e){if(!(e instanceof DOMException&&(e.code===22||e.code===1014||e.name===`QuotaExceededError`||e.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&n.length!==0))return null}return n}function BX(e,t){e!==null&&!IX.has(e)&&(IX.set(e,t),IX.size===1&&addEventListener(`storage`,e=>{let t=IX.get(e.storageArea);if(t!==void 0){let n=t.get(e.key);n&&n.forceSync()}}))}var VX=class extends mz{#e;#t;constructor(e,t){super(e?.getItem(t)??null),this.#e=e,this.#t=t}#n(){return this.#e?.getItem(this.#t)??null}get storage(){return this.#e}get key(){return this.#t}get(){return this.value}set(e){return this.#e&&e!==this.#n()?(this.#e.setItem(this.#t,e),super.set(e)):!1}delete(){this.#e&&this.#e.removeItem(this.#t)}forceSync(){return this.#e?super.set(this.#n()):!1}},HX=`discoveryjs:color-scheme`,UX=Object.freeze([`auto`,`light`,`dark`]),WX=Object.freeze([`auto`,`light`,`dark`,`light-only`,`dark-only`]);function GX(e){return UX.includes(e)}function KX(){return matchMedia(`(prefers-color-scheme:dark)`)}function qX(e,t){let n=e;switch(e){case!0:e=`dark`;break;case!1:e=`light`;break;case`disabled`:case`disable`:case`off`:e=`light-only`;break;case`only`:e=`dark-only`}if(n!==e&&console.warn(`Used legacy value "${n}" for ColorSheme, value replaced for "${e}"`),e!==`light-only`&&e!==`dark-only`&&t){let t=FX(HX);GX(t)&&(e=t)}return e}function JX(e){switch(e){case`light`:case`dark`:return`manual`;case`light-only`:case`dark-only`:return`only`;case`auto`:return`auto`;default:return e}}function YX(e){let t=XX(e);return t===`auto`?KX().matches?`dark`:`light`:t}function XX(e){switch(e){case`auto`:return`auto`;case`dark`:case`dark-only`:return`dark`;default:return`light`}}var ZX=class{#e;#t;#n;#r;#i;#a;persistent;state;value;serializedValue;mode;constructor(e=`auto`,t=!1){this.#e=t?PX(HX):null,this.#r=[],this.#i=qX(e,t),this.#a=YX(this.#i),Object.defineProperties(this,{persistent:{get:()=>this.#e!==null},state:{get:()=>this.#i},value:{get:()=>this.#a},serializedValue:{get:()=>XX(this.#i)},mode:{get:()=>JX(this.#i)}}),this.#t=this.#e?.subscribe(e=>{GX(e)&&e!==this.serializedValue&&this.mode!==`only`&&this.set(e)}),this.#n=()=>{let e=KX(),t=()=>{this.state===`auto`&&this.set(`auto`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}}subscribe(e,t=!1){let n={fn:e};return this.#r.push(n),t&&n.fn(this.#a,this.#i),()=>{let e=n===null?-1:this.#r.indexOf(n);n=null,e!==-1&&this.#r.splice(e,1)}}destroy(){this.#t?.(),this.#t=void 0,this.#n?.(),this.#n=void 0}set(e){let t=this.serializedValue,n=this.#a,r=this.#i;if(!WX.includes(e)){console.warn(`Bad value "${e}" for ColorScheme#state, value ignored`);return}this.#i=e,this.#a=YX(e),this.serializedValue!==t&&this.#e?.set(this.serializedValue),(this.#i!==r||this.#a!==n)&&this.#r.forEach(({fn:e})=>e(this.#a,this.#i))}toggle(e=!1){switch(this.#i){case`auto`:this.set(KX().matches?`dark`:`light`);return;case`dark`:this.set(e&&!KX().matches?`auto`:`light`);return;case`light`:this.set(e&&KX().matches?`auto`:`dark`);return}console.warn(`ColorScheme is locked for changes (mode=${this.#i})`)}},QX=class{items;host;baseConfig;constructor(e,t){this.host=e,this.baseConfig=t,this.items=[]}insert(e,t,n){switch(t){case`after`:t=this.items.findIndex(e=>e.name===n),t===-1?t=this.items.length:t++;break;case`before`:t=this.items.findIndex(e=>e.name===n),t===-1&&(t=this.items.length);break;default:(t===void 0||isNaN(t)||!isFinite(t))&&(t=this.items.length)}t=Math.max(0,Math.min(this.items.length,t));let r=this.host.view.composeConfig(this.baseConfig,e);this.items.splice(t,0,r)}prepend(e){this.insert(e,0)}append(e){this.insert(e)}before(e,t){this.insert(t,`before`,e)}after(e,t){this.insert(t,`after`,e)}replace(e,t){let n=this.items.findIndex(t=>t.name===e);n===-1?this.insert(t):this.items[n]=this.host.view.composeConfig(this.baseConfig,t)}remove(e){let t=this.items.findIndex(t=>t.name===e);if(t!==-1)return this.items.splice(t,1)[0]}},$X=class extends QX{host;popup;data;context;config;primary;secondary;menu;contentRect;constructor(e,t=`nav-button`){super(e,t);let n=$(`div`,`powered-by-discoveryjs`,[`powered by `,$(`a`,{class:`view-link`,href:`https://github.com/discoveryjs/discovery`,target:`_blank`},`Discovery.js`),` ${LB}`]);this.host=e,this.popup=null,this.data=null,this.context=null,this.primary=new QX(e,`nav-button`),this.secondary=this,this.menu=new QX(e,`menu-item`),this.config=[this.secondary.items,{view:`nav-button`,name:`burger`,whenData:!0,data:async()=>{let e=lz();return await this.host.view.render(e,this.menu.items,this.host.data,{...this.context,hide:()=>this.popup?.hide()}),[...e.childNodes].filter(e=>e.nodeType===1||e.nodeType===3)},onClick:(e,t)=>{let r=this.popup||new this.host.view.Popup({className:`discovery-nav-popup`});this.popup||(this.popup=r,r.el.addEventListener(`click`,({target:e})=>{e.closest(`a[href]`)&&setTimeout(()=>r.hide(),50)},!0)),r.toggle(e,e=>e.append(...t,n))}},this.primary.items],this.contentRect=new gz,this.contentRect.subscribe(t=>{let{container:n}=e.dom;if(n&&t){let{width:e,height:r}=t;n.style.setProperty(`--discovery-nav-width`,e+`px`),n.style.setProperty(`--discovery-nav-height`,r+`px`)}})}render(e,t,n){this.contentRect.observe(e),e&&(this.data=t,this.context={...n,widget:this.host},this.host.view.setViewRoot(e,`nav`,{config:this.config,data:this.data,context:this.context}),e.innerHTML=``,this.host.view.render(e,this.config,this.data,this.context))}},eZ=Object.freeze({tag:void 0}),tZ=Object.freeze({view:``}),nZ=new WeakMap,rZ=new WeakMap,iZ=new WeakMap,aZ=new WeakMap,oZ=new Set([`view`,`when`,`context`,`data`,`whenData`,`postRender`,`className`,`tooltip`]);function sZ(e){return typeof e==`string`||Array.isArray(e)||typeof e==`object`&&!!e&&typeof e.view==`string`}function cZ(e){let{base:t,tolerance:n,start:r,startTolerance:i}=typeof e==`object`&&e?e:{base:e,start:e};return(typeof n!=`number`||!Number.isInteger(n)||n<=0)&&(n=0),i===void 0?i=n:(typeof i!=`number`||!Number.isInteger(n)||n<=0)&&(n=0),(typeof t!=`number`||Number.isNaN(t))&&(t=t===!1?1/0:10),(typeof r!=`number`||Number.isNaN(r))&&(r=r===void 0?t:r===!1?1/0:10),{base:t,tolerance:n,start:r,startTolerance:i}}function lZ(e,t,n){return t+n>=e?e:t}function uZ(e,t){return iZ.set(e,t),e}function dZ(e,t,n,r){if(t===null||r.has(t))return;let i=e.fragmentEls.get(t);if(i!==void 0)for(let e of i){let t=n.children.find(t=>t.view===e);t?n=t:n.children.push(n={node:null,parent:n,view:e,children:[]})}let a=rZ.get(t);if(a!==void 0)n.children.push(n={node:t,parent:n,viewRoot:a,children:[]});else{let r=e.viewEls.get(t);r!==void 0&&n.children.push(n={node:t,parent:n,view:r,children:[]})}if(t.nodeType===1)for(let i=t.firstChild;i;i=i.nextSibling)dZ(e,i,n,r)}function fZ(e){return{name:`config-error`,options:eZ,render(t,n){if(t.className=`discovery-buildin-view-render-error`,t.dataset.type=n.type,t.textContent=n.reason,`config`in n){let r=t.appendChild(document.createElement(`span`));r.className=`toggle-config`,r.textContent=`show config...`,r.addEventListener(`click`,()=>{t.classList.toggle(`expanded`)?(r.textContent=`hide config...`,e.render(t,{view:`struct`,expanded:1},n.config)):(r.textContent=`show config...`,t.lastChild?.remove())})}}}}function pZ(e,t,n,r,i,a,o,s){return!oz(n,e)||n[e]===void 0||t.host.queryBool(n[e]===!0?``:n[e],r,i)?!0:(t.viewEls.set(s,{skipped:e,config:n,inputData:a,inputDataIndex:o,data:r,context:i}),!1)}function mZ(e,t,n,r){let i=t;return typeof i==`string`&&i.startsWith(`=`)&&(i=e.queryFn(i.slice(1))),typeof i==`function`&&(i=i(n,r)),typeof i==`string`&&(i=i.trim().split(/\s+/)),Array.isArray(i)&&(i=i.map(e=>typeof e==`function`?e(n,r):e).filter(Boolean),i.length)?i:null}function hZ(e,t,n,r,i){let a=n?mZ(e,n,r,i):null;a!==null&&t.classList.add(...a)}async function gZ(e,t,n,r,i,a,o,s,c){let{tag:l}=t.options,u=l===null?document.createDocumentFragment():document.createElement(l||`div`);await t.render(u,i,a,o),typeof r.postRender==`function`&&await r.postRender(u,r,a,o);let d={config:r,props:i,inputData:s,inputDataIndex:c,data:a,context:o};if(!cz(u))e.viewEls.set(u,d),t.name&&u.classList.add(`view-${t.name}`),hZ(e.host,u,r.className,a,o),r.tooltip&&yZ(e.host,u,r.tooltip,a,o);else for(let t of u.childNodes){let n=e.fragmentEls.get(t);n===void 0?e.fragmentEls.set(t,[d]):n.unshift(d)}n.replaceWith(u)}function _Z(e,t,n,r){return gZ(e,e.defaultRenderErrorRenderer,n,tZ,{type:`render`,reason:t,config:r})}function vZ(e,t){return{name:t,normalizeConfig:e.normalizeConfig.bind(e),ensureValidConfig:e.ensureValidConfig.bind(e),composeConfig:e.composeConfig.bind(e),propsFromConfig:e.propsFromConfig.bind(e),computeClassName:mZ.bind(null,e),applyComputedClassName:hZ.bind(null,e),render:e.render.bind(e),listLimit:e.listLimit.bind(e),renderList:e.renderList.bind(e),maybeMoreButtons:e.maybeMoreButtons.bind(e),renderMoreButton:e.renderMoreButton.bind(e),tooltip(t,n,r,i){t&&t.nodeType===1?yZ(e.host,t,n,r,i):e.host.logger.warn(`A tooltip can be attached to a HTML element only`)}}}function yZ(e,t,n,r,i){t.classList.add(`discovery-view-has-tooltip`),nZ.set(t,{config:n,data:r,context:i}),e.view.tooltip===null&&(e.view.tooltip=SZ(e))}function bZ(e){return!!e&&!Array.isArray(e)&&typeof e!=`string`&&typeof e!=`function`&&!e.view}function xZ(e,t){return Number.isFinite(e)?Number(e):t}function SZ(e){let t=null,n=new e.view.Popup({className:`discovery-buildin-view-tooltip`,hoverTriggers:`.discovery-view-has-tooltip`,position:`pointer`,showDelay(e){let{config:t}=nZ.get(e)||{};return bZ(t)?t.showDelay??!0:!0},render(r,i){let{config:a,data:o,context:s}=nZ.get(i)||{},c=`pointer`,l=`natural`,u=3,d=3,f=!1,p=a;return t!==null&&(r.classList.remove(...t),t=null),bZ(a)&&(t=mZ(e,a.className,o,s),t!==null&&r.classList.add(...t),c=a.position||c,l=a.positionMode||l,u=xZ(a.pointerOffsetX,u),d=xZ(a.pointerOffsetY,d),f=!!a.hideOnTriggerClick,p=a.content),n.position=c,n.positionMode=l,n.pointerOffsetX=u,n.pointerOffsetY=d,n.hideOnTriggerClick=f,p?e.view.render(r,p,o,s):e.view.render(r,{view:e.view.defaultRenderErrorRenderer.render,reason:`Element marked as having a tooltip but related data is not found`})}});return n}async function CZ(e,t,n,r,i,a){if(Array.isArray(n)){await Promise.all(n.map(n=>CZ(e,t,n,r,i,a)));return}let o=r&&typeof i==`number`?r[i]:r,s=null;switch(typeof n.view){case`function`:s={name:!1,options:eZ,render:n.view};break;case`string`:if(n.view===`render`){let{config:t=``,context:i=``}=e.propsFromConfig(n,r,a);s={name:!1,options:{tag:null},render(n,r,s){let c=t===``?s:e.host.query(t,o,a),l=e.host.query(i,a,o);return e.render(n,c,s===c?o:s,l)}}}else if(n.view.startsWith(`preset/`)){let t=n.view.substr(7);s={name:!1,options:{tag:null},render:e.host.preset.isDefined(t)?e.host.preset.get(t).render:()=>{}}}else s=e.get(n.view)||null}t||=document.createDocumentFragment();let c=t.appendChild(document.createComment(``));if(!s){let t=typeof n.view==`string`?"View `"+n.view+"` is not found":`Render is not a function`;return e.host.logger.error(t,n),_Z(e,t,c,n)}try{if(pZ(`when`,e,n,o,a,r,i,c)){let t=`context`in n?await e.host.query(n.context,o,a):a,l=`data`in n?await e.host.query(n.data,o,t):o;if(pZ(`whenData`,e,n,l,t,r,i,c))return await gZ(e,s,c,n,e.propsFromConfig(n,l,t),l,t,r,i)}}catch(t){return e.host.logger.error(`View render error:`,t.message),_Z(e,String(t),c,tZ)}}var wZ=class{el;position;positionMode;pointerOffsetX;pointerOffsetY;hideOnTriggerClick;constructor(){}toggle(){}async show(){}hide(){}},TZ=class e extends eJ{host;defaultRenderErrorRenderer;viewEls;fragmentEls;tooltip;Popup=wZ;constructor(e){super(),this.host=e,this.defaultRenderErrorRenderer=fZ(this),this.viewEls=new WeakMap,this.fragmentEls=new WeakMap,this.tooltip=null}define(t,n,r){let i=sZ(n)||typeof n==`function`?{...r,render:n}:n,{render:a=[],...o}=i,{tag:s,props:c}=o;return e.define(this,t,Object.freeze({name:t,options:Object.freeze({...i,tag:typeof s==`string`||s===void 0?s:null,props:typeof c==`string`?this.host.queryFn(c):c}),render:typeof a==`function`?a.bind(vZ(this,t)):(e,t,n,r)=>this.render(e,a,n,r)}))}normalizeConfig(e){if(!e)return null;if(Array.isArray(e)){let t=[];for(let n of e){let e=this.normalizeConfig(n);e!==null&&(Array.isArray(e)?t.push(...e):t.push(e))}return t}if(typeof e==`string`){let[,t,n,r]=e.match(/^(\S+?)([:{])((?:.|\s)+)$/)||[];if(t){if(n===`{`)try{return uZ(tJ(t,n+r),e)}catch(t){return uZ(this.badConfig(e,t),e)}return uZ({view:t,data:r},e)}return uZ({view:e},e)}return typeof e==`function`?uZ({view:e},e):e}badConfig(e,t){let n=t?.message||`Unknown error`;return this.host.logger.error(n,{config:e,error:t}),{view:this.defaultRenderErrorRenderer.render,type:`config`,reason:n,config:e}}ensureValidConfig(e){return Array.isArray(e)?e.map(e=>this.ensureValidConfig(e)).flat():!e||!e.view?this.badConfig(e,Error(e?"Option `view` is missed":`Config is not a valid value`)):e}composeConfig(e,t){return e=this.normalizeConfig(e),t=this.normalizeConfig(t),e&&t?Array.isArray(e)?e.map(e=>uZ({...e,...t},[e,t])):uZ({...e,...t},[e,t]):e||t}propsFromConfig(e,t,n,r=this.get(e?.view)?.options.props){let i={};for(let[r,a]of Object.entries(e))oZ.has(r)||(i[r]=typeof a==`string`&&a.startsWith(`=`)?this.host.query(a.slice(1),t,n):a);if(typeof r==`function`){let e=r(t,{props:i,context:n});typeof e==`object`&&e&&e!==i&&(aZ.set(e,{props:i,fn:r}),i=e)}return i}render(e,t,n,r,i){return CZ(this,e,this.ensureValidConfig(this.normalizeConfig(t)),n,i,r)}renderError(e,t,n){let r=e instanceof Comment?e:e.appendChild(document.createComment(``));return _Z(this,t,r,n)}listLimit(e,t){return e===!1?!1:typeof e==`object`&&e?e.base===void 0?{...e,base:t}:e:!e||isNaN(e)?t:Math.max(parseInt(e,10),0)||t}renderList(e,t,n,r,i=0,a=!1,o){let s=o instanceof HTMLElement||o&&`nodeType`in o?{moreContainer:o}:o||{},{moreContainer:c,onSliceRender:l}=s,u=cZ(a),d=e.appendChild(document.createComment(``)),f=document.createDocumentFragment(),p=n.length,m=p-i,h=i===0?lZ(m,u.start,u.startTolerance):lZ(m,u.base,u.tolerance),g=lZ(m-h,u.base,u.tolerance),_=Promise.all(n.slice(i,i+h).map((e,a,o)=>this.render(f,t,n,{...r,index:i+a,array:n,sliceIndex:a,slice:o},i+a))).then(()=>d.replaceWith(f));return typeof l==`function`&&_.then(()=>l(m-h,i,g,p)),this.maybeMoreButtons(c||e,null,p,i+h,g,(i,a)=>this.renderList(e,t,n,r,i,a===u.base?u:{...u,base:a},s)),_}maybeMoreButtons(e,t,n,r,i,a){if(n<=r)return null;let o=n-r,s=document.createElement(`span`);return o>i&&this.renderMoreButton(s,`Show `+i+` more...`,()=>a(r,i)),o>0&&this.renderMoreButton(s,`Show all the rest `+o+` items...`,()=>a(r,1/0)),s!==null&&(s.className=`more-buttons`,e.insertBefore(s,t)),s}renderMoreButton(e,t,n){let r=document.createElement(`button`);r.className=`more-button`,r.innerHTML=t,r.addEventListener(`click`,()=>{e.remove(),n()}),e.appendChild(r)}attachTooltip(e,t,n,r){yZ(this.host,e,t,n,r)}adoptFragment(e,t){let n=this.fragmentEls.get(t);if(n)for(let t of e.childNodes)this.fragmentEls.set(t,n)}setViewRoot(e,t,n){rZ.set(e,{name:t,...n})}getViewTree(e){let t=new Set(e||[]),n=[];return dZ(this,this.host.dom?.container||null,{parent:null,children:n},t),n}getViewStackTrace(e){let{container:t}=this.host.dom;if(!t||!(e instanceof Node)||!t.contains(e))return null;let n=[],r=e;for(;r!==null&&r!==t;){let e=this.viewEls.get(r);e!==void 0&&n.push(e),r=r.parentNode}return n.length===0?null:n.reverse()}getViewConfigTransitionTree(e){let t=iZ.get(e)||[];return Array.isArray(t)||(t=[t]),{value:e,deps:t.map(this.getViewConfigTransitionTree,this)}}getViewPropsTransition(e){let t=aZ.get(e)||null;return t&&{props:t.props,fn:t.fn,query:t.fn.query||null}}},EZ=Symbol(`config`),DZ={name:`not-found`,render:(e,{name:t})=>{e.style.cssText=`color:#a00`,e.innerText=`Page \`${t}\` not found`}},OZ=class e extends eJ{#e;#t;#n;lastPage;lastPageRef;pageOverscrolled;setPageOverscroll;constructor(e,t){if(super(),this.#e=e,this.#t=t,this.#n=null,this.lastPage=null,this.lastPageRef=null,this.pageOverscrolled=new mz(!1),this.setPageOverscroll=()=>{},typeof IntersectionObserver==`function`){let t=$(`div`,{style:`position:absolute`}),n=e.dom?.content||null,r=()=>{};if(n!==null){let e=new IntersectionObserver(e=>this.pageOverscrolled.set(!e[e.length-1].isIntersecting),{root:n});this.setPageOverscroll=n=>{e.unobserve(t),r(),n&&(n.prepend(t),e.observe(t),r=this.pageOverscrolled.subscribeSync(e=>{n.classList.toggle(`page_overscrolled`,e)}))}}}}define(t,n,r){let{render:i,...a}=sZ(n)||typeof n==`function`?{...r,render:n}:n;if(i===void 0)throw Error(`Page "${t}" requires a specified render option`);return e.define(this,t,Object.freeze({name:t,render:typeof i==`function`?i.bind(this.#t):(e,t,n)=>this.#t.render(e,i,t,n),options:Object.freeze(a),[EZ]:i}))}render(e,t,n,r){let i=this.get(t);i||(i=this.get(`not-found`)||DZ,n={name:t});let{reuseEl:a,init:o,keepScrollOffset:s=!0}=i.options||{},c=this.#e.pageRef,l=this.lastPage!==t,u=this.lastPageRef!==c,d=a&&!l?e:$(`article`,`page page-${CSS.escape(t)}`);this.#n=d,this.lastPage=t,this.lastPageRef=c,l&&typeof o==`function`&&o(d);let f=new Promise(async(t,a)=>{try{if(await i.render(d,n,r),this.#n!==d){a(Error(`Aborted by new page render`));return}d!==e&&(e.replaceWith(d),this.setPageOverscroll(d));let o=d.parentNode;o!==null&&(l||u||!s)&&(o.scrollTop=0),t()}catch(e){d.replaceChildren(),this.#t.render(d,`alert-danger`,String(e)+` (see details in console)`),a(e)}});return{pageEl:d,config:i[EZ],renderState:f}}},kZ=class e extends eJ{#e;constructor(e){super(),this.#e=e}define(t,n){return n=JSON.parse(JSON.stringify(n)),e.define(this,t,Object.freeze({name:t,render:(e,t,r,i)=>this.#e.render(e,n,r,i),config:n}))}render(e,t,n,r){let i=this.get(t);if(!i){let n="Preset `"+t+"` is not found";console.error(n,t);let r=e.appendChild(document.createElement(`div`));return r.className=`discovery-buildin-view-config-error`,r.textContent=n,Promise.resolve()}return i.render(e,null,n,r)}},AZ=(()=>{let e=new mz({x:0,y:0},(e,t)=>e.x!==t.x||e.y!==t.y);return document.addEventListener(`pointermove`,({x:t,y:n})=>e.set({x:t,y:n}),uz),e.readonly})();function jZ(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function MZ(e,t){if(typeof e!=`function`)throw TypeError(`Expected a function`);if(typeof t==`number`&&(t={wait:t}),!jZ(t)){let t;return Object.assign(function(...n){return t=e.apply(this,n)},{cancel(){},flush(){return t},pending(){return!1}})}let n=Math.max(0,Number(t.wait)||0),r=!!t.leading,i=`maxWait`in t,a=i?Math.max(Number(t.maxWait)||0,n):1/0,o=`trailing`in t?!!t.trailing:!0,s,c,l,u,d,f=0;function p(t){let n=s,r=c;return s=c=void 0,f=t,l=e.apply(r,n),l}function m(e,t){return setTimeout(e,t)}function h(e){clearTimeout(e)}function g(e){return f=e,u=m(y,n),r?p(e):l}function _(e,t){let r=e-t,i=e-f,o=n-r;return Math.min(o,a-i)}function v(e,t){let r=e-t,i=e-f;return r>=n||r<0||i>=a}function y(){let e=Date.now();if(d===void 0||v(e,d))return b(e);u=m(y,_(e,d))}function b(e){return u=void 0,o&&s?p(e):(s=c=void 0,l)}function x(){u!==void 0&&h(u),f=0,s=d=c=u=void 0}function S(){return u===void 0?l:b(Date.now())}function C(){return u!==void 0}return Object.assign(function(...e){let t=Date.now(),r=d===void 0||v(t,d);if(s=e,c=this,d=t,r){if(u===void 0)return g(d);if(i)return u=m(y,n),p(d)}return u===void 0&&(u=m(y,n)),l},{cancel:x,flush:S,pending:C})}var NZ=0,PZ=[{view:`badge`,when:`view.data != parent.(view or viewRoot).data or "data" in view.config`,data:{text:`D`},tooltip:`text:"Data value was changed"`},{view:`badge`,when:`view.context != parent.(view or viewRoot).context`,data:{text:`C`},tooltip:`text:"Context value was changed"`}];function FZ(e){let t=Ez(e),n=Oz(e,t),{scrollTop:r,scrollLeft:i,clientWidth:a,clientHeight:o}=t,s=r+0,c=i+0,l=i+a,u=r+o,d=r+n.top,f=i+n.left,p=f+n.width,m=r,h=i;(d<s||d>u)&&(m=d-0),f<c?h=f-0:p>l&&(h=Math.max(f,i-(p-l))-0),t?.scrollTo(h,m)}function IZ(){NZ=0}function LZ(e,{selectTreeViewLeaf:t,detailsSidebarLeafExpanded:n}){return{view:`tree`,when:`#.selectedView`,data:`$[0]`,className:`sidebar`,limitLines:!1,itemConfig:{collapsible:`=not viewRoot`,expanded:e=>e.viewRoot||n.has(e),onToggle:(e,t,r)=>e?n.add(r):n.delete(r)},item:{view:`switch`,content:[{when:`viewRoot`,content:{view:`block`,className:`view-root`,content:`text:viewRoot.name`}},{when:`$ = #.selectedView`,content:[{view:`block`,className:[e=>e.view?.skipped?`skipped`:!1,`selected`],content:`text:view.config.view or "#root" | is string ?: "ƒn"`,postRender(t){requestAnimationFrame(()=>{e.querySelector(`.sidebar`).scrollTop=NZ,FZ(t)})}},...PZ]},{content:[{view:`link`,className:e=>e.view?.skipped?`skipped`:!1,data:`{ text: view.config.view or "#root" | is string ?: "ƒn", href: false, view, self: $ }`,onClick(n,r){NZ=e.querySelector(`.sidebar`)?.scrollTop||0,t(r.self)}},...PZ]}]}}}function RZ(e){e=e.replace(/^(?:\s*[\n]+)+?([ \t]*)/,`$1`).trimRight(),e=e.replace(/\n[ \t]+(?=\n)/g,`
|
|
111
|
+
`);let t=e.split(/\n+/),n=Number(e.match(/^\s/)===null),r=1e3;for(var i=n;i<t.length;i++){let e=t[i].match(/^\s*/);if(e[0].length<r&&(r=e[0].length),r==0)break}return r>0&&(e=e.replace(RegExp(`^ {`+r+`}`,`gm`),``)),e}var zZ={view:`block`,className:[`content`,`props-config`],data:`#.view | view or viewRoot`,content:[{view:`block`,className:`content-section skip`,when:`skipped`,content:`block{ content: "badge:{ text: skipped }" }`},{view:`block`,className:`content-section render`,when:`config.view is not string`,content:`source:{ content: config.view + "", syntax: "js" }`},{view:`block`,when:`props != undefined`,className:`content-section props`,content:[{view:`struct`,expanded:1,data:`props`},{view:`context`,data:(e,t)=>t.host.view.getViewPropsTransition(e.props),whenData:!0,content:[{view:`block`,className:`transition-fn`,data:e=>({...e,query:typeof e.query==`string`?RZ(e.query):void 0}),content:{view:`switch`,content:[{when:`query is string`,content:{view:`source`,data:`{ content: query, syntax: "jora", lineNum: false }`}},{content:`struct:fn`}]}},{view:`struct`,expanded:2,data:`props`}]}]},{view:`block`,className:`content-section config`,content:[{view:`struct`,expanded:1,data:`config`},{view:`tree`,data:(e,t)=>t.host.view.getViewConfigTransitionTree(e.config).deps,whenData:!0,expanded:3,children:`deps`,item:{view:`struct`,expanded:1,data:`value`}}]}]},BZ={view:`list`,className:`data-flow-transitions`,limit:1,when:`.[view]`,data:`
|
|
112
|
+
[null] // to show empty list on first render
|
|
113
|
+
+ .[view] // filter viewRoot
|
|
114
|
+
.(
|
|
115
|
+
$parent;
|
|
116
|
+
$parentName: parent.view.config.view;
|
|
117
|
+
$queryData: view | inputDataIndex != undefined ? inputData[inputDataIndex] : inputData;
|
|
118
|
+
|
|
119
|
+
view | [
|
|
120
|
+
...'data' in config ? { inputData: $queryData, transition: config.data, name: config.view, view: $, $parent } : [],
|
|
121
|
+
...inputDataIndex != undefined ? { inputData, transition: \`$[\${inputDataIndex}]\`, name: \`\${$parentName} → \${config.view}\`, view: $, $parent } : []
|
|
122
|
+
]
|
|
123
|
+
)
|
|
124
|
+
`,whenData:`size() > 1`,itemConfig:{when:!0},item:[{view:`block`,className:`root-data`,when:`inputData = ..parent.viewRoot[].data`,content:`badge:"Root data"`},{view:`struct`,data:`inputData`},{view:`block`,className:`data-flow-transition`,content:[{view:`switch`,content:[{when:`transition is (string or undefined)`,content:{view:`context`,data(e){return{content:RZ(e.transition),refs:[]}},content:{view:`source`,data:`{
|
|
125
|
+
...,
|
|
126
|
+
syntax: "jora",
|
|
127
|
+
lineNum: false
|
|
128
|
+
}`}}},{content:{view:`struct`,data:`transition`}}]},{view:`block`,className:`view-name`,content:`text:name`}]}]},VZ={view:`block`,className:`content-section data`,data:`#.view`,content:[{view:`context`,data:`..parent`,content:BZ},{view:`context`,content:{...BZ,limit:!1}},{view:`block`,className:`root-data`,when:`view or viewRoot | data = ([@] + @..parent).viewRoot[].data`,content:`badge:"Root data"`},{view:`struct`,expanded:1,data:`view or viewRoot | data`}]};function HZ(e,t){if(e===null)return!0;for(let n of[`top`,`left`,`width`,`height`])if(e[n]!==t[n])return!0;return!1}var UZ=e=>{let t=!1,n=null,r=null,i=null,a=null,o,s=new Set,c=new Map,l=new Map,u=$(`div`,`cancel-hint view-alert view-alert-warning`),d=$(`div`,{class:`discovery-view-inspector-overlay`,onclick:t=>{if((t.metaKey||t.ctrlKey)&&r){let t=r.view.config.view;g(),e.setPage(`views-showcase`,t);return}_(r&&!i?r:null)}},[u]),f=MZ(()=>{if(!t||i!==null)return;let n=e.view.getViewTree([b.el]),r=new Set([...l.keys()]);(function e(t,n){for(let i of t){if(!i.node||!i.view&&!i.viewRoot){i.children.length&&e(i.children,n);continue}let t=Oz(i.node,n),a=l.get(i.node)||null;a===null?(a={el:n.appendChild($(`div`,i.viewRoot?`overlay view-root`:`overlay`)),box:null},i.node.nodeType===1&&(a.el.style.zIndex=getComputedStyle(i.node).zIndex),i.viewRoot&&i.viewRoot.inspectable!==!1&&(a.el.dataset.inspectable=!0),l.set(i.node,a),c.set(a.el,i)):r.delete(i.node),HZ(a.box,t)&&(a.el.style.top=`${t.top}px`,a.el.style.left=`${t.left}px`,a.el.style.width=`${t.width}px`,a.el.style.height=`${t.height}px`,a.box=t),i.children.length&&(i.node.nodeType===1&&(a.el.style.overflow=getComputedStyle(i.node).overflow===`visible`?`visible`:`hidden`),e(i.children,a.el))}})(n,d);for(let e of r)l.get(e).el.remove(),l.delete(e);p()},{maxWait:0,wait:50}),p=()=>{let{x:t,y:n}=AZ.value;y([...e.dom.container.parentNode.elementsFromPoint(t|0,n|0)||[]].find(e=>c.has(e))||null)},m=t=>{(t.key===`Escape`||t.keyCode===27||t.which===27)&&e.inspectMode.set(!1)},h=()=>{t||(t=!0,document.addEventListener(`scroll`,f,uz),document.addEventListener(`keydown`,m,!0),AZ.subscribe(f),o=setInterval(f,500),e.dom.container.append(d),f(),e.inspectMode.set(!0))},g=()=>{t&&(t=!1,clearInterval(o),document.removeEventListener(`scroll`,f,uz),document.removeEventListener(`keydown`,m,!0),AZ.unsubscribe(f),x=!1,delete u.dataset.alt,d.remove(),d.replaceChildren(u),l.clear(),v(),e.inspectMode.set(!1))},_=t=>{if(i=t||null,t){let{innerWidth:e,innerHeight:n}=window,{left:r,top:i,width:o,height:s}=b.el.getBoundingClientRect();b.el.style.top=`${i}px`,b.el.style.left=`${r}px`,b.el.style.right=`${e-(r+o)}px`,b.el.style.bottom=`${n-(i+s)}px`,b.frozen=!0,requestAnimationFrame(()=>{y(l.get(t.node)?.el||null),clearTimeout(a),b.show(),b.freeze()}),delete u.dataset.alt}else x?e.inspectMode.set(!1):(s.clear(),IZ(),v(),f())},v=()=>{n&&n.classList.remove(`hovered`),n=null,r=null,i=null,b.hide()},y=e=>{if(e===n)return;if(n!==null&&n.classList.remove(`hovered`),n=e,e===null){a=setTimeout(v,100);return}e.classList.add(`hovered`);let t=c.get(e)||null;if(t===null){r=null;return}(r===null||t.view!==r.view)&&(r=t,clearTimeout(a),b.show())},b=new e.view.Popup({className:`discovery-inspect-details-popup`,position:`pointer`,hideIfEventOutside:!1,hideOnResize:!1,render(t){let n=i||r,a=[],o=n;for(;o!==null&&(o.view||o.viewRoot);)o!==n&&i!==null&&s.add(o),a.unshift(o),o=o.parent;return e.view.render(t,{view:`context`,modifiers:[LZ(t,{selectTreeViewLeaf:_,detailsSidebarLeafExpanded:s})],content:{view:`context`,modifiers:{view:`block`,className:`toolbar`,content:[{view:`toggle-group`,className:`stack-view-chain`,name:`view`,data:`.({ value: $ })`,value:`=$[-1].value`,toggleConfig:{className:[e=>e.value.viewRoot?`view-root`:!1,e=>e.value.view&&e.value.view.skipped?`skipped`:!1],content:[`text:value | viewRoot.name or view.config.view | is string ?: "ƒn"`]}},{view:`button`,when:i!==null,content:`text:"Close inspector"`,onClick(){e.inspectMode.set(!1)}}]},content:[zZ,{view:`block`,className:[`content`,`data-context`],content:[VZ,{view:`block`,className:`content-section context`,data:`$[-1] | view or viewRoot`,content:{view:`struct`,expanded:1,data:`context`}}]}]}},a,{selectedView:i,host:e})}});e.action.define(`startInspect`,h),e.action.define(`stopInspect`,g),e.inspectMode.subscribeSync(e=>e?h():g());let x=!1},WZ=(e,t)=>({demo:{view:e,text:`Button`,onClick:Function(`return () => alert("Hello world!")`)()},examples:[{title:`Variations`,demo:t.map(e=>`${e}{ text: "${e}" }`)},{title:`Disabled state`,demo:t.map(e=>({view:e,disabled:!0,text:e}))},{title:`Complex content`,demo:{view:`button`,content:[`text:"Example "`,`pill-badge:123`]}},{title:`Button as a link`,demo:{view:`button`,text:`Click me`,href:`#url`,external:!0}},{title:`Using data as source of options`,beforeDemo:{view:`md`,source:[`The following properties are taken from the data when the appropriate options are not specified for a legacy reasons (is subject to remove in the future):`,"- `text`","- `href`","- `external`"].join(`
|
|
129
|
+
`)},highlightProps:[`data`],demo:{view:e,data:{text:`demo`,href:`#example`,external:!0}}}]}),GZ=`is not array? | {
|
|
130
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
|
131
|
+
content: undefined,
|
|
132
|
+
disabled: false,
|
|
133
|
+
href,
|
|
134
|
+
external,
|
|
135
|
+
onClick: undefined
|
|
136
|
+
} | overrideProps()`;function KZ(e){function t(t,n,r,i){let{text:a,content:o,disabled:s,href:c,external:l,onClick:u}=n;if(t.classList.add(`view-button`),s?t.disabled=!0:typeof u==`function`?(t.addEventListener(`click`,()=>u(t,r,i)),t.classList.add(`onclick`)):typeof c==`string`&&t.addEventListener(`click`,()=>{let t=$(`a`,{href:c,target:l?`_blank`:``});e.dom.root.append(t),t.click(),t.remove()}),o)return e.view.render(t,o,r,i);t.textContent=a}e.view.define(`button`,t,{tag:`button`,props:GZ,usage:WZ}),e.view.define(`button-primary`,t,{tag:`button`,props:GZ,usage:WZ}),e.view.define(`button-danger`,t,{tag:`button`,props:GZ,usage:WZ}),e.view.define(`button-warning`,t,{tag:`button`,props:GZ,usage:WZ})}var qZ={demo:{view:`checkbox-list`,checkbox:{content:`text`},data:[`one`,`two`,`three`]}};function JZ(e){e.view.define(`checkbox-list`,function(t,n,r,i){let{name:a=`filter`,checkbox:o,checkboxValue:s=`$`,emptyText:c,limit:l,onChange:u,onInit:d}=n,f=new Set;if(c!==!1&&c!==``&&t.setAttribute(`emptyText`,c||`Empty list`),!Array.isArray(r)&&r&&(r=[r]),Array.isArray(r))return e.view.renderList(t,this.composeConfig({view:`checkbox`,...o,onInit:(t,n,r,i)=>{t&&f.add(e.query(s,r,i))},onChange:(t,n,r,i)=>{let o=f.size,c=e.query(s,r,i);t?f.add(c):f.delete(c),o!==f.size&&typeof u==`function`&&u([...f],a)}}),r,i,0,e.view.listLimit(l,25)).then(()=>{typeof d==`function`&&d([...f],a)})},{usage:qZ})}var YZ={demo:{view:`checkbox`,content:`text:"checkbox caption"`},examples:[{title:`Checked state`,beforeDemo:"Checked state is set up with `checked` property. Its value can be a query",demo:[{view:`checkbox`,checked:!0,content:`text:"should be checked"`},{view:`checkbox`,checked:`=1 > 5`,content:`text:"shouldn't be checked"`},{view:`checkbox`,checked:`=1 < 5`,content:`text:"should be checked"`}]},{title:`Readonly checkbox`,demo:{view:`checkbox`,readonly:!0,content:`text:"checkbox caption"`}},{title:`On change`,demo:{view:`checkbox`,onChange:Function("return (value, name, data, context) => alert(`Changed to ${value}!`)")(),content:`text:"click me!"`}}]},XZ=`#.props | {
|
|
137
|
+
name: undefined,
|
|
138
|
+
checked: undefined,
|
|
139
|
+
readonly: undefined,
|
|
140
|
+
content: undefined,
|
|
141
|
+
onInit: undefined,
|
|
142
|
+
onChange: undefined
|
|
143
|
+
} | overrideProps() | {
|
|
144
|
+
...,
|
|
145
|
+
checked is truthy,
|
|
146
|
+
readonly is truthy
|
|
147
|
+
}`;function ZZ(e){function t(t,n,r,i,a,o){if(t===null)return;let s=a?{...i,[a]:o.checked}:i;return t.innerHTML=``,e.view.render(t,n,r,s)}e.view.define(`checkbox`,function(e,n,r,i){let{name:a,checked:o,readonly:s,content:c,onInit:l,onChange:u}=n,d=e.appendChild($(`input`)),f=c?e.appendChild($(`span`,`view-checkbox__label`)):null;return d.type=`checkbox`,d.checked=o,d.readOnly=s,d.addEventListener(`click`,e=>{s&&e.preventDefault()}),d.addEventListener(`change`,()=>{typeof u==`function`&&(u(d.checked,a,r,i),t(f,c,r,i,a,d))}),typeof l==`function`&&l(d.checked,a,r,i),t(f,c,r,i,a,d)},{tag:`label`,props:XZ,usage:YZ})}var QZ={demo:{view:`content-filter`,data:[`foo`,`bar`,`baz`],content:{view:`list`,data:`.[$ ~= #.filter]`}},examples:[{title:`Using with text-match`,demo:{view:`content-filter`,data:[{name:`foo`},{name:`bar`},{name:`baz`}],name:`customName`,content:{view:`list`,data:`.[name ~= #.customName]`,item:`text-match:{ text: name, match: #.customName }`}}}]};function $Z(e){e.view.define(`content-filter`,function(t,n,r,i){let{name:a=`filter`,type:o=`regexp`,placeholder:s,content:c,onInit:l,onChange:u,debounce:d}=n;return e.view.render(t,{view:`context`,modifiers:{view:`input`,name:a,type:o,placeholder:s||`Filter`,debounce:d},content:{view:`block`,className:`content`,content:c,onInit:l,onChange:u}},r,i)},{usage:QZ})}var eQ={demo:{view:`context`,modifiers:{view:`dropdown`,name:`demo`,value:{foo:`two`,bar:`hello`},resetValue:{foo:`one`,bar:``},caption:"text:`${#.demo.foo} / ${#.demo.bar}`",content:[{view:`select`,name:`foo`,data:[`one`,`two`,`three`,`four`]},{view:`input`,name:`bar`}]},content:[{view:`block`,content:`text:"Modified context (see values in \\"demo\\" section):"`},{view:`struct`,expanded:1,data:`#`}]}};function tQ(e,t){if(!e||!t||typeof e!=`object`||typeof t!=`object`)return e===t;for(let n in e)if(oz(e,n)&&e[n]!==t[n])return!1;for(let n in t)if(oz(t,n)&&e[n]!==t[n])return!1;return!0}function nQ(e){e.view.define(`dropdown`,function(t,n,r,i){function a(e,t){return typeof h==`function`?h(e,t):tQ(e,t)}function o(){return b.innerHTML=``,e.view.render(b,p||`text`,r,{...i,[l||`__self`]:v})}function s(e){v=e,typeof _==`function`&&_(v,l,r,i),y.hide(),o()}function c(t,n){if(x){let r={changed:!a(t,n)};x.innerHTML=``,e.view.render(x,[{view:`button-primary`,disabled:`=not changed`,content:`text:"Apply"`,onClick(e,t,n){s(n)}},{view:`button`,when:()=>u&&!a(u,v),content:`text:"Reset"`,onClick(){s(u)}},{view:`button`,disabled:`=not changed`,content:`text:"Cancel"`,onClick(){y.hide()}}],r,n)}}let{name:l,resetValue:u,value:d,placeholder:f,caption:p,content:m,compare:h,onInit:g,onChange:_}=n,v=`value`in n?d:i[l],y=null,b=t.appendChild(document.createElement(`div`)),x;return f&&(t.dataset.placeholder=f),t.tabIndex=0,t.addEventListener(`click`,()=>{y===null&&(y=new e.view.Popup({className:`view-dropdown-popup`}));let n={...v},a;y.toggle(t,t=>e.view.render(t,[{view:`block`,className:`content`,content:e.view.composeConfig(m,{onInit(e,t){n[t]=e},onChange(e,t){n[t]=e,c(a,n)}})},{view:`block`,className:`confirm`,postRender(e){x=e}}],r,{...i,...v}).then(()=>{a={...n},c(a,n)}))}),b.className=`view-dropdown__caption`,typeof g==`function`&&g(v,l,r,i),o()},{usage:eQ})}function rQ(e,t){try{return RegExp(`((?:`+e+`)+)`,t)}catch{}return RegExp(`((?:`+e.replace(/[\[\]\(\)\?\+\*\{\}\\]/g,`\\$&`)+`)+)`,t)}function iQ(e,t=`i`){return Object.assign(rQ(e,t),{rawSource:e})}var aQ=Function("return (value) => alert(`Changed to ${value}!`)")(),oQ={examples:[{title:`Input with value`,demo:{view:`input`,value:`"value"`}},{title:`Input with placeholder`,demo:{view:`input`,placeholder:`placeholder`}},{title:`Input type number with min and max`,demo:{view:`input`,htmlType:`number`,htmlMin:10,htmlMax:20}},{title:`Input with onChange`,demo:{view:`input`,onChange:aQ}},{title:`Input with onChange debounced`,demo:{view:`input`,onChange:aQ,debounce:300}}]},sQ=`#.props | {
|
|
148
|
+
name,
|
|
149
|
+
value: $ has no 'value' and name is string ? #.context[name] : value | is (string or number) ?: '',
|
|
150
|
+
type ?: 'text',
|
|
151
|
+
placeholder,
|
|
152
|
+
onInit,
|
|
153
|
+
onChange,
|
|
154
|
+
htmlType ?: 'text',
|
|
155
|
+
htmlMin,
|
|
156
|
+
htmlMax,
|
|
157
|
+
htmlStep,
|
|
158
|
+
debounce
|
|
159
|
+
}`;function cQ(e){let t={regexp:e=>e?iQ(e):null,text:e=>e};e.view.define(`input`,function(e,n,r,i){let{name:a,value:o,type:s,placeholder:c,onInit:l,onChange:u,htmlType:d,htmlMin:f,htmlMax:p,htmlStep:m,debounce:h}=n,g=t[s]||t.text,_=e.appendChild(document.createElement(`input`)),v=o;Number.isFinite(f)&&(_.min=f),Number.isFinite(p)&&(_.max=p),Number.isFinite(m)&&(_.step=m),_.type=d,_.value=v,_.placeholder=[c||``,g===t.text?``:`(`+s+`)`].filter(Boolean).join(` `),_.addEventListener(`input`,MZ(()=>{let e=_.value.trim();v!==e&&(v=e,typeof u==`function`&&u(g(e),a,r,i))},h)),typeof l==`function`&&l(g(_.value.trim()),a,r,i)},{usage:oQ,props:sQ})}var lQ={demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}]},examples:[{title:`With limit`,demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}],limit:2}},{title:`With custom item`,demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}],item:`h1:text`}},{title:`On chage handler`,demo:{view:`menu`,onChange:Function("return (value) => alert(`Changed to ${value.text}!`)")(),data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}]}}]};function uQ(e){e.view.define(`menu`,function(t,n,r,i){let{name:a=`filter`,item:o,itemConfig:s,limit:c,emptyText:l,onClick:u,onInit:d,onChange:f}=n;if(l!==!1&&l!==``&&t.setAttribute(`emptyText`,l||`No items`),Array.isArray(r)){let n=this.composeConfig({view:`menu-item`,content:o,onClick:typeof u==`function`?u:typeof f==`function`?e=>f(e,a):void 0},s);return e.view.renderList(t,n,r,i,0,e.view.listLimit(c,25)).then(()=>{typeof d==`function`&&d(r.find(e=>e.selected),a)})}},{usage:lQ})}var dQ={demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}]},examples:[{title:`Preselected item`,demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`,selected:!0},{text:`three`,href:`#`}]}},{title:`Disabled item`,demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`,disabled:!0},{text:`three`,href:`#`}]}},{title:`External links`,demo:{view:`menu`,data:[{text:`one`,external:!0,href:`https://github.com/discoveryjs/discovery`},{text:`two`,external:!0,href:`https://github.com/discoveryjs/discovery`},{text:`three`,external:!0,href:`https://github.com/discoveryjs/discovery`}]}}]};function fQ(e){e.view.define(`menu-item`,function(t,n,r,i){let{content:a,onClick:o}=n,{text:s,selected:c=!1,disabled:l=!1,href:u,external:d}=r||{};if(l?t.classList.add(`disabled`):typeof o==`function`?(t.addEventListener(`click`,()=>o(r,i)),t.classList.add(`onclick`)):u&&(t.href=u,t.target=d?`_blank`:``),c&&t.classList.add(`selected`),a)return e.view.render(t,a,r,i);t.textContent=typeof r==`string`?r:s||`Untitled item`},{tag:`a`,usage:dQ})}var pQ={demo:{view:`nav-button`,data:{text:`I am nav button`}},examples:[{title:`With href`,demo:{view:`nav-button`,data:{text:`I am nav button`,href:`#`}}},{title:`External link`,demo:{view:`nav-button`,data:{text:`I am nav button`,external:!0,href:`https://github.com/discoveryjs/discovery`}}},{title:`On click handler`,demo:{view:`nav-button`,data:{text:`I am nav button`},onClick:()=>alert(`changed!`)}}]},mQ=`is not array? | {
|
|
160
|
+
name: undefined,
|
|
161
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
|
162
|
+
content: undefined,
|
|
163
|
+
disabled: false,
|
|
164
|
+
href,
|
|
165
|
+
external,
|
|
166
|
+
onClick: undefined
|
|
167
|
+
} | overrideProps()`;function hQ(e){e.view.define(`nav-button`,function(t,n,r,i){let{name:a,text:o,content:s,disabled:c,href:l,external:u,onClick:d}=n;if(a&&(t.dataset.name=a),c?t.classList.add(`disabled`):typeof d==`function`?(t.addEventListener(`click`,e=>d(t,r,i,e)),t.classList.add(`onclick`)):l&&(t.href=l,t.target=u?`_blank`:``),s)return e.view.render(t,s,r,i);t.textContent=o},{tag:`a`,props:mQ,usage:pQ})}var gQ={demo:{view:`progress`,progress:.5,content:`text:"Loading..."`},examples:[{title:`With no label (content)`,demo:{view:`progress`,progress:.25}},{title:`Custom color`,demo:{view:`progress`,progress:.85,color:`#bdab77`,content:`text:"Yellow progress"`}}]};function _Q(e){e.view.define(`progress`,function(t,n,r,i){let{content:a,progress:o,color:s}=n;if(t.append($(`div`,{class:`progress`,style:`--progress: ${Math.max(0,Math.min(1,Number(o)))};--color: ${s||`unset`};`})),a){let n=$(`div`,`content`);return t.prepend(n),e.view.render(n,a,r,i)}},{usage:gQ})}var vQ={demo:{view:`select`,data:[`one`,`two`,`three`,`four`]},examples:[{title:`Select with value`,demo:{view:`select`,value:`"three"`,data:[`one`,`two`,`three`,`four`]}},{title:`Select with reset option`,demo:{view:`select`,resetItem:!0,value:`"three"`,data:[`one`,`two`,`three`,`four`]}},{title:`Select with placeholder`,demo:{view:`select`,placeholder:`placeholder`,data:[`one`,`two`,`three`,`four`]}},{title:`Select with onChange`,demo:{view:`select`,onChange:Function("return (value) => alert(`Changed to ${value}!`)")(),data:[`one`,`two`,`three`,`four`]}},{title:`Select with custom options`,demo:{view:`select`,item:`h1:text`,data:[`one`,`two`,`three`,`four`]}}]};function yQ(e){let t=`{ value: $, text: #.selectVariantTextQuery.query($, #) }`,n=new e.view.Popup({className:`view-select-popup`});e.view.define(`select`,function(r,i,a,o){function s(){if(r.innerHTML=``,x!==void 0)return e.view.render(r,e.view.composeConfig({view:`menu-item`,data:t,content:h},g),x,S)}let{name:c,value:l,text:u=`$`,placeholder:d,limit:f,minItemsFilter:p=10,resetItem:m=!1,item:h=`text-match:{ text, match: #.filter }`,itemConfig:g,beforeItems:_,afterItems:v,onInit:y,onChange:b}=i,x=l?e.query(l,a,o):o[c],S={...o,selectMinItemsFilter:p,selectCurrentValue:x,selectVariantTextQuery:u,selectResetItem:m?[{value:void 0,text:``,...m,resetItem:!0}]:[]},C=[];return _&&C.push(e.view.composeConfig(_,{onInit:y,onChange:b})),C.push({view:`context`,data:`.(${t})`,modifiers:{view:`input`,when:`size() >= #.selectMinItemsFilter`,type:`regexp`,name:`filter`,className:`view-select__filter`,placeholder:`Filter`},content:{view:`menu`,className:`view-select__variants`,data:`#.selectResetItem + .[no #.filter or text~=#.filter]`,limit:f,itemConfig:e.view.composeConfig({className:[e=>e.resetItem?`reset-item`:``,e=>e.value===x?`selected`:``]},g),item:h,onClick(e){n.hide(),x!==e.value&&(x=e.value,S={...S,selectCurrentValue:x},s(),typeof b==`function`&&b(e.value,c,e,o))}}}),v&&C.push(e.view.composeConfig(v,{onInit:y,onChange:b})),d&&(r.dataset.placeholder=d),r.tabIndex=0,r.addEventListener(`click`,()=>{n.toggle(r,t=>e.view.render(t,C,a,S).then(()=>(t.querySelector(`.view-select__filter input`)||{focus(){}}).focus()))}),typeof y==`function`&&y(x,c,a,o),s()},{usage:vQ})}var bQ={demo:{view:`tabs`,name:`tabs`,value:`two`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}},examples:[{title:`Value is default text`,demo:{view:`tabs`,name:`tabsValue`,tabs:[`foo`,`bar`,`baz`],content:`struct:#.tabsValue`}},{title:`With before and after content`,demo:{view:`tabs`,name:`example`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],beforeTabs:`text:"<Content before tabs>"`,afterTabs:`text:"<Content after tabs>"`,content:`text:"Selected: " + #.example`}},{title:`On change handler`,demo:{view:`tabs`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],onChange:Function(`return (value) => alert("changed to " + value)`)(),content:`text:"Selected: " + #.filter`}}]},xQ=`undefined | {
|
|
168
|
+
name,
|
|
169
|
+
value,
|
|
170
|
+
tabs,
|
|
171
|
+
tabConfig,
|
|
172
|
+
content,
|
|
173
|
+
beforeTabs,
|
|
174
|
+
afterTabs,
|
|
175
|
+
onInit,
|
|
176
|
+
onChange
|
|
177
|
+
} | overrideProps() | {
|
|
178
|
+
...,
|
|
179
|
+
name is string ?: 'filter',
|
|
180
|
+
value: value is not undefined ? value :
|
|
181
|
+
name is string and name in #.context ? #.context[name]
|
|
182
|
+
}`;function SQ(e){e.view.define(`tabs`,function(t,n,r,i){async function a(t){let n=y?u:l;if(b===t)return;let a=s||c||o?{...i,[d]:t}:null;b=t,y=!0,Array.isArray(p)&&(h.innerHTML=``,s&&(_.innerHTML=``,await e.view.render(_,s,r,a),h.appendChild(_)),await Promise.all(p.map(t=>e.view.render(h,e.view.composeConfig(t,{active:t.value===b}),r,i))),c&&(v.innerHTML=``,await e.view.render(v,c,r,a),h.appendChild(v))),o&&(g.innerHTML=``,await e.view.render(g,o,r,a)),typeof n==`function`&&n(b,d,r,i)}let{content:o,beforeTabs:s,afterTabs:c,onInit:l,onChange:u}=n,{name:d,value:f,tabs:p,tabConfig:m}=n,h=t.appendChild(document.createElement(`div`)),g=null,_=null,v=null,y=!1,b=NaN;return m=e.view.composeConfig({view:`tab`,onClick:a},m),h.className=`view-tabs-buttons`,s&&(_=document.createElement(`div`),_.className=`view-tabs-buttons-before`),c&&(v=document.createElement(`div`),v.className=`view-tabs-buttons-after`),o&&(g=t.appendChild(document.createElement(`div`)),g.className=`view-tabs-content`),p=Array.isArray(p)?p.map(t=>{let n=typeof t;return(n===`string`||n===`number`||n===`boolean`)&&(t={value:t}),(f===void 0||t.active)&&(f=t.value),e.view.composeConfig(m,t)}):[],a(f)},{usage:bQ,props:xQ})}var CQ=()=>alert(`clicked!`),wQ={demo:{view:`tabs`,name:`tabs`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}},examples:[{title:`Active & disabled tab`,demo:{view:`tabs`,name:`tabs`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`,active:!0},{value:`three`,text:`Three`,disabled:!0}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}}},{title:`On click handler`,demo:{view:`tabs`,name:`tabs`,tabs:[{value:`one`,text:`One`,onClick:CQ},{value:`two`,text:`Two`,onClick:CQ},{value:`three`,text:`Three`,onClick:CQ}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}}}]},TQ=`is not array? | {
|
|
183
|
+
value,
|
|
184
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?,
|
|
185
|
+
content: undefined,
|
|
186
|
+
active: undefined,
|
|
187
|
+
disabled: undefined,
|
|
188
|
+
onClick: undefined
|
|
189
|
+
} | overrideProps() | {
|
|
190
|
+
...,
|
|
191
|
+
text: text is not undefined ? text : value,
|
|
192
|
+
active is truthy,
|
|
193
|
+
disabled is truthy
|
|
194
|
+
}`;function EQ(e){e.view.define(`tab`,function(t,n,r,i){let{value:a,text:o,content:s,active:c,disabled:l,onClick:u}=n;if(l?t.classList.add(`disabled`):typeof u==`function`&&(t.addEventListener(`click`,()=>u(a)),t.classList.add(`onclick`)),c&&t.classList.add(`active`),s)return e.view.render(t,s,r,i);t.textContent=String(o)},{usage:wQ,props:TQ})}var DQ={demo:{view:`context`,modifiers:{view:`toggle-group`,name:`toggleValue`,data:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}]},content:{view:`switch`,content:[{when:`#.toggleValue="one"`,content:`text:"One"`},{when:`#.toggleValue="two"`,content:`text:"Two"`},{when:`#.toggleValue="three"`,content:`text:"Three"`}]}},examples:[{title:`With before and after content`,demo:{view:`toggle-group`,data:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],beforeToggles:`text:"<Content before toggles>"`,afterToggles:`text:"<Content after toggles>"`}},{title:`On change handler`,demo:{view:`toggle-group`,name:`example`,onChange:Function(`return (value) => alert("changed to " + value)`)(),data:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}]}}]};function OQ(e){e.view.define(`toggle`,function(t,n,r,i){let{content:a,disabled:o=!1,onToggle:s,value:c,text:l=String(c).replace(/^./,e=>e.toUpperCase())}=n,{checked:u=!1}=n;if(o?t.classList.add(`disabled`):typeof s==`function`&&(t.addEventListener(`click`,()=>{u=!u,s(u,c)}),t.classList.add(`onclick`)),u&&t.classList.add(`checked`),a)return e.view.render(t,a,r,i);t.textContent=l},{usage:DQ})}function kQ(e){e.view.define(`toggle-group`,function(t,n,r,i){async function a(n,a){let d=h?l:c;g!==a&&(g=a,h=!0,Array.isArray(f)&&(t.innerHTML=``,o&&(p.innerHTML=``,await e.view.render(p,o,r,{...i,[u]:a}),t.appendChild(p)),s&&(m.innerHTML=``,await e.view.render(m,s,r,{...i,[u]:a}),t.appendChild(m)),await Promise.all(f.map((n,a)=>e.view.render(t,e.view.composeConfig(n,{checked:n.value===g}),r[a],i)))),typeof d==`function`&&d(g,u,r,i))}let{beforeToggles:o,afterToggles:s,onInit:c,onChange:l}=n,{name:u,toggleConfig:d}=n,f=[],p=null,m=null,h=!1,g=NaN,_=`value`in n?n.value:u in i?i[u]:void 0;return d=e.view.composeConfig({view:`toggle`,onToggle:a},d),o&&(p=document.createElement(`div`),p.className=`view-toggle-group-before`),s&&(m=document.createElement(`div`),m.className=`view-toggle-group-after`),typeof u!=`string`&&(u=`filter`),Array.isArray(r)&&(f=r.map(t=>{let n=typeof t;return(n===`string`||n===`number`||n===`boolean`)&&(t={value:t}),(_===void 0||t.active)&&(_=t.value),e.view.composeConfig(d,t)})),a(!0,_)},{usage:DQ})}var AQ={beforeDemo:['md:"A block has no its own look. It\'s using for wrapping some content with a `className` (btw `className` is a common property for any view when appropriate)"'],demo:{view:`block`,className:`foo`,content:[`text:"Content inside block"`]}};function jQ(e){e.view.define(`block`,function(t,n,r,i){let{content:a=[],onInit:o,onChange:s}=n,c=typeof o!=`function`&&typeof s!=`function`?a:this.composeConfig(a,{onInit:o,onChange:s});return e.view.render(t,c,r,i)},{usage:AQ})}var MQ={demo:{view:`columns`,data:[`one`,`two`,`three`,`four`],column:`text`}};function NQ(e){e.view.define(`column`,function(t,n,r,i){let{content:a=[]}=n;return e.view.render(t,a,r,i)},{usage:MQ})}function PQ(e){e.view.define(`columns`,function(t,n,r,i){let{column:a,columnConfig:o,emptyText:s,limit:c}=n;if(s!==!1&&s!==``&&t.setAttribute(`emptyText`,s||`Empty`),!Array.isArray(r)&&r&&(r=[r]),Array.isArray(r))return e.view.renderList(t,this.composeConfig({view:`column`,content:a},o),r,i,0,e.view.listLimit(c,25))},{usage:MQ})}var FQ={demo:{view:`expand`,header:`text:"Expand me!"`,content:`text:"Content"`}},IQ=`is not array? | {
|
|
195
|
+
header: undefined,
|
|
196
|
+
content: undefined,
|
|
197
|
+
expanded: false,
|
|
198
|
+
onToggle: undefined
|
|
199
|
+
} | overrideProps() | {
|
|
200
|
+
...,
|
|
201
|
+
expanded.bool()
|
|
202
|
+
}`;function LQ(e){e.view.define(`expand`,function(t,n,r,i){async function a(){t.classList.toggle(`expanded`,o),o?(f=$(`div`,`content`),await e.view.render(f,c,r,i).then(()=>t.appendChild(f))):f!==null&&(f.remove(),f=null)}let{expanded:o,header:s,content:c,onToggle:l}=n,u=t.appendChild($(`div`,`header`)),d=u.appendChild($(`div`,`header-content`)),f=null;return u.appendChild($(`div`,`trigger`)),u.addEventListener(`click`,()=>{o=!o;let e=a();typeof l==`function`&&l(o,{el:t,finish:e,data:r,context:i})}),Promise.all([e.view.render(d,s||`text:"\xA0"`,r,i),a()])},{usage:FQ,props:IQ})}var RQ={demo:{view:`hstack`,content:[`button:{text:"First button"}`,`button-primary:{text:"Second button"}`]}};function zQ(e){e.view.define(`hstack`,function(t,n,r,i){let{content:a=[]}=n;return e.view.render(t,a,r,i)},{usage:RQ})}function BQ(e){e.view.define(`list-item`,function(t,n,r,i){let{content:a=`text`}=n;return e.view.render(t,a,r,i)},{tag:`li`})}var VQ=(e,t)=>({demo:{view:e,data:[`one`,`two`,`three`,`four`]},examples:[{title:`Variations`,demo:{view:`context`,data:[`foo`,`bar`,`baz`],content:t.map(e=>[`header{ content: 'md:${JSON.stringify('`view: \\"'+e+'\\"`')}' }`,e])}},{title:`Configure item's content`,demo:[{view:e,data:[`one`,`two`,`three`,`four`],item:[`text:"<item> "`,{view:`link`,data:`{ href: "#" + $ }`}]}]},{title:`Configure item's config`,demo:{view:e,data:[`one`,`two`,`three`,`four`],itemConfig:{className:`special`},item:{view:`text`,data:`"prefix-" + $`}}}]});function HQ(e){function t(t,n,r,i){let{item:a,itemConfig:o,limit:s,emptyText:c}=n;if(c!==!1&&c!==``&&t.setAttribute(`emptyText`,c||`Empty list`),!Array.isArray(r)&&r&&(r=[r]),Array.isArray(r))return e.view.renderList(t,this.composeConfig({view:`list-item`,content:a},o),r,i,0,e.view.listLimit(s,25))}e.view.define(`list`,t,{usage:VQ}),e.view.define(`inline-list`,t,{usage:VQ}),e.view.define(`comma-list`,t,{usage:VQ}),e.view.define(`ol`,t,{tag:`ol`,usage:VQ}),e.view.define(`ul`,t,{tag:`ul`,usage:VQ})}var UQ=e=>({beforeDemo:[`md:"A special view to be used as the first view in the body of the page. This view stays in place as the page scrolls (although it may move slightly to the top of the page at the start of the scroll), so that the most relevant information and important action elements can remain accessible despite page scrolling."`],demoFixed:100,demo:`${e}:"That's a \\"${e}\\""`,examples:[{title:`Prelude`,demoFixed:150,highlightProps:[`prelude`],demo:{view:e,prelude:[`badge:{ text: "demo" }`,`badge:{ text: "demo", prefix: "prelude", postfix: "postfix" }`],content:`h1:"Header"`}}]});function WQ(e){e.view.define(`page-header`,function(t,n,r,i){let{prelude:a,content:o,onInit:s,onChange:c}=n,l=t.appendChild($(`div`,`view-page-header__prelude`)),u=t.appendChild($(`div`,`view-page-header__content`)),d=e=>typeof s!=`function`&&typeof c!=`function`?e:this.composeConfig(e,{onInit:s,onChange:c});return Promise.all([e.view.render(l,d(a||[]),r,i),e.view.render(u,d(o||`text`),r,i)])},{usage:UQ})}var GQ=[!1,`popup-hover`,`trigger-click`],KQ=300;function qQ(e){return!e||e.getRootNode({composed:!0})===document}function JQ(e,t){return typeof e==`function`&&(e=e(t)),typeof e==`number`?XQ(e):typeof e==`boolean`&&e?KQ:0}function YQ(e,t){e.lastChild!==t&&e.appendChild(t)}function XQ(e,t=0){return Number.isFinite(e)?e:t}function ZQ(e){return GQ.includes(e)}function QQ(e){let t=[],n=new Set,r=[],i=new Set,a=null,o=e=>{a===null&&(a=setTimeout(()=>u(e),0))},s=()=>{a!==null&&(clearTimeout(a),a=null)},c=null,l=()=>{c===null&&(c=[e.addHostElEventListener(`mouseenter`,({target:e})=>{for(let t of r){let n=p(t,e),r=n?n.el:e.closest(t.hoverTriggers);r&&(t.hideTimer!==null&&(clearTimeout(t.hideTimer),t.hideTimer=null),r!==t.lastHoverTriggerEl&&((!n||!n.hoverPinned)&&(t.lastHoverTriggerEl=r),n||(t.hoverPinned=!1,t.el.classList.remove(`pinned`),t.show(r))))}},uz),e.addHostElEventListener(`mouseleave`,({target:e})=>{for(let t of r)t.lastHoverTriggerEl===e&&(m(t),t.lastHoverTriggerEl=null,t.hideTimer=setTimeout(t.hide,100))},uz),e.addGlobalEventListener(`scroll`,o,uz),e.addHostElEventListener(`scroll`,e=>{s(),u(e)},uz),e.addGlobalEventListener(`click`,o,!0),e.addHostElEventListener(`click`,e=>{s(),u(e),setTimeout(d,50);for(let t of r)t.hoverPin===`trigger-click`&&t.lastHoverTriggerEl&&t.lastTriggerEl?.contains(e.target)&&(t.lastHoverTriggerEl=null,t.hoverPinned=!0,t.el.classList.add(`pinned`),e.stopPropagation())},!0)])};AZ.subscribe(()=>{for(let e of t)e.position===`pointer`&&!e.hoverPinned&&!e.frozen&&!i.has(e)&&e.updatePosition();for(let e of n){let{showDelayArgs:t}=e;h(e,t?.[0],t?.[1])}}),e.inspectMode.subscribe(e=>e?t.forEach(e=>i.add(e)):i.clear());function u(e){t.slice().forEach(t=>t.hideIfEventOutside(e))}function d(){t.slice().forEach(e=>e.hideOnTriggerHasLeftDocument())}function f(){t.slice().forEach(e=>e.hideOnResize())}function p(e,t){return e.el.contains(t)?e:e.relatedPopups.find(e=>p(e,t))||null}function m(e){e.showDelayTimer!==null&&clearTimeout(e.showDelayTimer),e.showDelayTimer=null,e.showDelayArgs=null,n.delete(e)}function h(e,t,r){e.showDelayTimer!==null&&clearTimeout(e.showDelayTimer),e.showDelayTimer=setTimeout(()=>e.show(t,r,!0),JQ(e.showDelay,t)),e.showDelayArgs=[t,r],n.add(e)}class g{el;showDelayTimer;showDelayArgs;showDelay;#e;lastHoverTriggerEl;render;position;positionMode;pointerOffsetX;pointerOffsetY;hideOnTriggerClick;hoverTriggers;hoverPin;hideIfEventOutsideDisabled;hideOnResizeDisabled;hideTimer;hoverPinned;frozen;lastRenderMarker;constructor(e){let{render:t,showDelay:n=!1,position:i=`trigger`,positionMode:a=`safe`,pointerOffsetX:o,pointerOffsetY:s,hoverTriggers:c,hoverPin:u,hideIfEventOutside:d=!0,hideOnResize:f=!0,hideOnTriggerClick:p=!1,className:m}=e||{};this.el=document.createElement(`div`),this.el.classList.add(`discovery-view-popup`),this.showDelayTimer=null,this.showDelayArgs=null,this.showDelay=n,this.hideTimer=null,this.hide=this.hide.bind(this),this.#e=null,this.lastHoverTriggerEl=null,this.hoverPinned=!1,this.frozen=!1,this.render=t,this.lastRenderMarker=null,this.position=i,this.positionMode=a,this.pointerOffsetX=XQ(o,3),this.pointerOffsetY=XQ(s,3),this.hoverTriggers=c||null,this.hoverPin=ZQ(u)?u:!1,this.hideIfEventOutsideDisabled=!d,this.hideOnResizeDisabled=!f,this.hideOnTriggerClick=!!p,m&&this.el.classList.add(m),this.hoverTriggers&&(this.el.classList.add(`show-on-hover`),this.el.dataset.pinMode=this.hoverPin||`none`,r.push(this),l())}get relatedPopups(){return t.filter(e=>this.el.contains(e.lastTriggerEl))}get visible(){return t.includes(this)}get lastTriggerEl(){return this.#e}set lastTriggerEl(e){this.#e!==null&&this.#e.classList.remove(`discovery-view-popup-active`),this.#e=e&&e instanceof Element?e:null,this.#e!==null&&this.#e.classList.add(`discovery-view-popup-active`)}toggle(...e){this.visible?this.hide():this.show(...e)}async show(n,r=this.render,a=!1){if(!this.visible&&!a&&JQ(this.showDelay,n)>0){h(this,n,r);return}let o=e.dom.container;if(i.delete(this),n&&!o.contains(n)){this.hide();return}if(m(this),this.relatedPopups.forEach(e=>e.hide()),this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null),this.lastTriggerEl=n||null,this.el.classList.toggle(`inspect`,e.inspectMode.value),e.view.setViewRoot(this.el,`popup`,{config:r}),this.visible||(t.push(this),t.length===1&&window.addEventListener(`resize`,f)),typeof r==`function`){this.el.innerHTML=``;let e=Symbol();if(this.lastRenderMarker=e,requestAnimationFrame(()=>{this.lastRenderMarker===e&&(YQ(o,this.el),this.updatePosition())}),await r(this.el,n,this.hide),this.lastRenderMarker!==e)return;this.lastRenderMarker=null}YQ(o,this.el),this.updatePosition()}updatePosition(){if(!this.visible)return;let t=this.position===`pointer`,n=t?null:this.lastTriggerEl;if(t?this.frozen:!n)return;let r=e.dom.container,i=Tz(r.firstChild),a=kz(window,i),{x:o,y:s}=AZ.value,{pointerOffsetX:c,pointerOffsetY:l}=this,u=n?Oz(n,r):{left:Math.round(o)-c,right:Math.round(o)+c,top:Math.round(s)-l,bottom:Math.round(s)+l},d=t?u.left:u.right,f=t?u.right:u.left,p=u.top-a.top-3,m=a.bottom-u.bottom-3,h=d-a.left-3,g=a.right-f-3,_=g>=h,v=m>=p;if(v||(this.el.style.maxHeight=p+`px`,this.el.style.top=`auto`,this.el.style.bottom=a.bottom-u.top+`px`,this.el.dataset.vTo=`top`),_||(this.el.style.left=`auto`,this.el.style.right=a.right-d+`px`,this.el.style.maxWidth=h+`px`,this.el.dataset.hTo=`left`),this.positionMode===`natural`&&(!_||!v)){let{height:e,width:t}=Oz(this.el);v=e<=m,_=t<=g}v&&(this.el.style.maxHeight=m+`px`,this.el.style.top=u.bottom-a.top+`px`,this.el.style.bottom=`auto`,this.el.dataset.vTo=`bottom`),_&&(this.el.style.left=f-a.left+`px`,this.el.style.right=`auto`,this.el.style.maxWidth=g+`px`,this.el.dataset.hTo=`right`),this.relatedPopups.forEach(e=>e.updatePosition())}freeze(){this.frozen=!0,this.el.classList.add(`frozen`)}unfreeze(){this.frozen=!1,this.el.classList.remove(`frozen`),this.updatePosition()}hide(){this.lastRenderMarker=null,this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null),m(this),this.visible&&!i.has(this)&&(this.relatedPopups.forEach(e=>e.hide()),t.splice(t.indexOf(this),1),this.lastTriggerEl=null,this.el.remove(),this.unfreeze(),t.length===0&&window.removeEventListener(`resize`,f))}hideIfEventOutside({target:e,type:t}){this.hideIfEventOutsideDisabled||i.has(this)||this.lastTriggerEl&&this.lastTriggerEl.contains(e)&&(!this.hideOnTriggerClick||t!==`click`)||p(this,e)||this.hide()}hideOnTriggerHasLeftDocument(){(!qQ(this.lastHoverTriggerEl)||!qQ(this.lastTriggerEl))&&this.hide()}hideOnResize(){this.hideOnResizeDisabled||i.has(this)||this.hide()}destroy(){i.delete(this),m(this);let e=r.indexOf(this);e!==-1&&r.splice(e,1),this.hide(),this.el=null,this.lastTriggerEl=null,this.lastHoverTriggerEl=null}}e.view.Popup=g}var $Q={demo:{view:`section`,header:`text:"I am section"`,content:[`text:"content"`]}};function e$(e){e.view.define(`section`,function(t,n,r,i){let{header:a,content:o=[],onInit:s,onChange:c}=n,l=e=>typeof s!=`function`&&typeof c!=`function`?e:this.composeConfig(e,{onInit:s,onChange:c});return e.view.render(t,[{view:`header`,content:l(a)},l(o)],r,i)},{usage:$Q})}function t$(e){e.view.define(`toc-section`,function(t,n,r,i){let{header:a,content:o}=n;return e.view.render(t,[{view:`block`,className:`header`,content:a},{view:`block`,className:`content`,content:o}],r,i)},{tag:`section`})}var n$=(e,t)=>({demo:{view:e,data:`"Alert"`},examples:[{title:`Variations`,demo:t.map(e=>`${e}:"${e}"`)},{title:`Complex content`,demo:{view:e,content:[`h3:"Some header"`,`text:"Hello world!"`]}}]});function r$(e){function t(t,n,r,i){let{content:a=`text`}=n;return t.classList.add(`view-alert`),e.view.render(t,a,r,i)}e.view.define(`alert`,t,{usage:n$}),e.view.define(`alert-primary`,t,{usage:n$}),e.view.define(`alert-success`,t,{usage:n$}),e.view.define(`alert-danger`,t,{usage:n$}),e.view.define(`alert-warning`,t,{usage:n$})}function i$(){return[performance.timeOrigin.toString(16),(1e4*performance.now()).toString(16),Math.random().toString(16).slice(2)].join(`-`)}var a$=Symbol(`stop-match`);function o$(e,t,n=0){let r=n===0?e.search(t):e.slice(n).search(t);return r===-1?null:{offset:n+r,length:RegExp.lastMatch.length}}function s$(e,t,n){let r=e.indexOf(t,n);return r===-1?null:{offset:r,length:t.length}}function c$(e,t,n,r,i=!1){if(!uY(t)&&typeof t!=`string`){n(e,!0);return}let a=String(e);i&&(typeof t==`string`?(a=a.toLowerCase(),t=t.toLowerCase()):t.ignoreCase||(t=new RegExp(t,t.flags+`i`)));let o=0,s=!1;do{let i=s?null:typeof t==`string`?s$(a,t,o):o$(a,t,o);if(i===null||i.length===0&&i.offset===o){n(o>0?e.slice(o):e,!0);break}i.length!==0&&(i.offset!==o&&n(e.slice(o,i.offset),!1),s=r(e.substr(i.offset,i.length),a$)===a$),o=i.offset+i.length}while(o!==e.length)}function l$(e){let t=$(`div`,{style:[`position: fixed`,`overflow: hidden`,`font-size: 1px`,`width: 1px`,`height: 1px`,`top: 0`,`left: 0`,`white-space: pre`].join(`;`)});document.body.append(t);try{let n=window.getSelection(),r=document.createRange();t.append(e),r.selectNodeContents(t),n?.removeAllRanges(),n?.addRange(r),document.execCommand(`copy`)}finally{t.remove()}}async function u$(e){try{if(navigator.clipboard)try{let t=await navigator.permissions.query({name:`clipboard-write`});if(t.state===`granted`||t.state===`prompt`)return navigator.clipboard.writeText(e)}catch(t){if(t instanceof TypeError)return navigator.clipboard.writeText(e)}}catch{}l$(e)}var d$={demo:{view:`app-header`,name:`My app`,version:`1.2.3`,description:`The best of the best app`},examples:[{title:`Variations`,demo:[`app-header`,`app-header{ name: "Only name" }`,`app-header{ name: "Name and version", version: "1.2.3" }`,`app-header{ name: "Name and description", description: "Some description" }`,`app-header{ name: "Everything set", version: "1.2.3", description: "Very useful description" }`]}]},f$=`is not array? | {
|
|
203
|
+
name: name or "Untitled app",
|
|
204
|
+
icon,
|
|
205
|
+
version,
|
|
206
|
+
description
|
|
207
|
+
} | overrideProps() | {
|
|
208
|
+
...,
|
|
209
|
+
icon is string and $ ~= /\\S/?,
|
|
210
|
+
version is string and $ ~= /\\S/?,
|
|
211
|
+
description is string and $ ~= /\\S/?
|
|
212
|
+
}`;function p$(e){e.view.define(`app-header`,function(e,t){let{name:n,icon:r,version:i,description:a}=t,o=$(`h1`,null,i?[n,$(`span`,`version`,i)]:[n]);r&&e.style.setProperty(`--icon`,/^(?:\.|\/|data:|https?:)/.test(r)?`url(${JSON.stringify(r)})`:r),e.append($(`div`,`icon`),$(`div`,`content`,a?[o,$(`div`,`description`,a)]:[o]))},{props:f$,usage:d$})}function m$(e){e.view.define(`auto-link`,function(t,n,r,i){let{content:a,fallback:o,href:s}=n;if(!r)return;let c=e.resolveValueLinks(r),l=c?(typeof s==`function`?s:e=>e)(c[0].href,r,i):null;return l?e.view.render(t,{view:`link`,content:a},{...c[0],href:l},i):e.view.render(t,o||a||`text`,r,i)},{tag:!1})}var h$=(e,t)=>({demo:{view:e,text:`hello world`},examples:[{title:`Variations`,demo:t.map(e=>`${e}:"${e}"`)},{title:`Displaying content`,beforeDemo:{view:`md`,source:[`There are several ways to specify the main content of a badge:`,"- `content` option – allows to specify any renderable content and has the highest precedence","- `text` option – used when `content` is omitted or falsy; it renders as plain text","- When both `content` and `text` options are omitted, the `data` is used for content:"," - If `data` is a string, a number, or a boolean value, it is used as the `text` value"," - If `data` is an object, the value of `text` property of `data` coerced to a string is used",` - Otherwise, render an undefined`].join(`
|
|
213
|
+
`)},demo:[{view:e,data:`"data"`,text:`text`,content:`text:"RENDER"`},{view:e,data:`"data"`,text:`RENDER`,content:`=undefined`},{view:e,data:`"data"`,content:`=undefined`},{view:e,data:`"data"`,text:`RENDER`},{view:e,data:`"data"`,text:`=undefined`},{view:e,data:`"RENDER"`},{view:e,data:`{ text: "RENDER" }`},{view:e,data:`{}`},{view:e,data:[1,2,3]}]},{title:`Using data as source of options`,beforeDemo:{view:`md`,source:[`The following properties are taken from the data when the appropriate options are not specified for a legacy reasons (is subject to remove in the future):`,"- `color`","- `textColor`","- `darkColor`","- `darkTextColor`","- `text`","- `href`","- `external`","- `prefix`","- `postfix`"].join(`
|
|
214
|
+
`)},highlightProps:[`data`],demo:{view:e,data:{text:`demo`,href:`#example`}}},{title:`Custom colors`,beforeDemo:{view:`md`,source:[`Data properties to setup a custom colors:`,"* `color` – default background color","* `textColor` – default text color","* `darkColor` – background color in dark mode","* `darkTextColor` – text color in dark mode"].join(`
|
|
215
|
+
`)},demo:{view:e,text:`Colored badge`,color:`rgba(237, 177, 9, 0.35)`,textColor:`orange`,darkColor:`#ffff00`,darkTextColor:`black`}},{title:`As a link`,highlightProps:[`href`,`external`],demo:{view:e,text:`Link to something`,href:`#`,external:!0}},{title:`Using onClick handler`,highlightProps:[`onClick`],demo:{view:e,text:`Show "Hello world"`,onClick:Function(`return () => alert("Hello world!")`)()}},{title:`Prefix and postfix`,highlightProps:[`prefix`,`postfix`],demo:{view:e,prefix:`prefix`,text:`link`,postfix:`postfix`}},{title:`Complex content`,highlightProps:[`content`],demo:{view:e,content:[`text:"text "`,`link{ href: "#example" }`]}}]}),g$=`is not array? | {
|
|
216
|
+
color,
|
|
217
|
+
textColor,
|
|
218
|
+
darkColor,
|
|
219
|
+
darkTextColor,
|
|
220
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
|
221
|
+
content: undefined,
|
|
222
|
+
href,
|
|
223
|
+
external,
|
|
224
|
+
onClick: undefined,
|
|
225
|
+
prefix,
|
|
226
|
+
postfix
|
|
227
|
+
} | overrideProps()`;function _$(e,t,n){if(!n)return;let r=e.appendChild(document.createElement(`span`));r.className=t,r.textContent=n}function v$(e){function t(e,t,n,r){let{color:i,textColor:a,darkColor:o,darkTextColor:s,text:c,content:l,href:u,external:d,onClick:f,prefix:p,postfix:m}=t,h;return i&&e.style.setProperty(`--discovery-view-badge-color`,i),o&&e.style.setProperty(`--discovery-view-badge-dark-color`,o),a&&e.style.setProperty(`--discovery-view-badge-text-color`,a),s&&e.style.setProperty(`--discovery-view-badge-dark-text-color`,s),u&&(e.href=u),d&&e.setAttribute(`target`,`_blank`),typeof f==`function`&&(e.classList.add(`onclick`),e.addEventListener(`click`,t=>{t.preventDefault(),f(e,n,r)})),_$(e,`prefix`,p),l?h=this.render(e,l,n,r):e.append(document.createTextNode(c)),_$(e,`postfix`,m),h}e.view.define(`badge`,t,{tag:`a`,props:g$,usage:h$}),e.view.define(`pill-badge`,t,{tag:`a`,props:g$,usage:h$})}function y$(e){function t(t,n,r,i){let{content:a=`text`,kind:o}=n;return typeof o==`string`&&/\S/.test(o)&&(t.dataset.kind=o.trim()),e.view.render(t,a,r,i)}e.view.define(`blockquote`,{tag:`blockquote`,render:t,usage:FJ})}var b$=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;Object.hasOwnProperty;function x$(e,t){return typeof e==`string`?(t||(e=e.toLowerCase()),e.replace(b$,``).replace(/ /g,`-`)):``}var S$=(e,t)=>({demo:`${e}:"Header \\"${e}\\""`,examples:[{title:`Variations`,view:t.map(e=>`${e}:"Header \\"${e}\\""`)},{title:`Complex content`,demo:{view:e,content:[`text:"Text "`,`link:{ text: "Link" }`]}},{title:`Using anchor`,demo:[{view:e,anchor:`foo`,content:`text:"Explicit value for an anchor"`},{view:e,anchor:!0,content:`text:"Auto generated anchor based on text content of header"`}]}]});function C$(e){async function t(t,n,r,i){let{content:a,anchor:o=!1}=n;if(t.classList.add(`view-header`),await e.view.render(t,a||`text`,r,i),o){let n=x$(o===!0?t.textContent:String(o)),r=e.encodePageHash(e.pageId,e.pageRef,e.pageParams,n);t.prepend($(`a`,{class:`view-header__anchor`,id:`!anchor:${n}`,href:r}))}}e.view.define(`header`,t,{tag:`h4`,usage:S$}),e.view.define(`h1`,t,{tag:`h1`,usage:S$}),e.view.define(`h2`,t,{tag:`h2`,usage:S$}),e.view.define(`h3`,t,{tag:`h3`,usage:S$}),e.view.define(`h4`,t,{tag:`h4`,usage:S$}),e.view.define(`h5`,t,{tag:`h5`,usage:S$})}var w$={demo:{view:`html`,data:`"<h1>I am inner HTML</h1>"`}};function T$(e){let t=document.createElement(`div`);e.view.define(`html`,function(e,n,r){t.innerHTML=r,e.append(...t.childNodes)},{tag:null,usage:w$})}var E$=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjggMTI4Ij4KICAgIDxyZWN0IHg9IjY1LjYiIHk9IjI0LjYiIHRyYW5zZm9ybT0ibWF0cml4KDAuOTM5NyAtMC4zNDIgMC4zNDIgMC45Mzk3IC05Ljk0MjYgMzEuODI4KSIgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9IjM5LjMiIGhlaWdodD0iMzkiPjwvcmVjdD4KICAgIDxyZWN0IHg9IjcwLjYiIHk9IjUyLjciIHRyYW5zZm9ybT0ibWF0cml4KC0wLjkzOTcgMC4zNDIgLTAuMzQyIC0wLjkzOTcgMTk0Ljc4NTIgODEuMTIwNCkiIGZpbGw9IiNDN0Q3RTIiIHdpZHRoPSIzOS4zIiBoZWlnaHQ9IjEwIj48L3JlY3Q+CiAgICA8cGF0aCBmaWxsPSIjOThCRUQ4IiBkPSJNMTExLjUsNTQuNmwtMS4xLDEuMUw5Ny4xLDE5LjFsMS41LDAuMmM4LDAuOSwxNC43LDYuMiwxNy40LDEzLjdsMCwwQzExOC44LDQwLjQsMTE3LDQ4LjgsMTExLjUsNTQuNnoiPjwvcGF0aD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik03My41LDcyLjJjLTEuMiwwLTIuNC0wLjgtMi44LTJMNTcuMywzMy41Yy0wLjMtMC43LTAuMi0xLjYsMC4xLTIuM2MwLjMtMC43LDAuOS0xLjMsMS43LTEuNmwzNi45LTEzLjRjMS42LTAuNiwzLjMsMC4yLDMuOCwxLjhsMTMuMywzNi42YzAuMywwLjcsMC4yLDEuNi0wLjEsMi4zYy0wLjMsMC43LTAuOSwxLjMtMS43LDEuNkw3NC41LDcyQzc0LjIsNzIuMSw3My44LDcyLjIsNzMuNSw3Mi4yek02NCwzNC4zbDExLjMsMzFsMzEuMy0xMS40bC0xMS4zLTMxTDY0LDM0LjN6Ij48L3BhdGg+CiAgICA8cmVjdCB4PSIzNSIgeT0iNDYuNyIgdHJhbnNmb3JtPSJtYXRyaXgoMC45Mzk3IC0wLjM0MiAwLjM0MiAwLjkzOTcgLTE2LjIwMTEgMjAuOTg4KSIgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9IjMyLjgiIGhlaWdodD0iMTkuNSI+PC9yZWN0PgogICAgPHJlY3QgeD0iMzcuMyIgeT0iNTkuOCIgdHJhbnNmb3JtPSJtYXRyaXgoLTAuOTM5NyAwLjM0MiAtMC4zNDIgLTAuOTM5NyAxMjUuNjc2MyAxMDMuMzk0NikiIGZpbGw9IiNDN0Q3RTIiIHdpZHRoPSIzMi44IiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik0zOS40LDc0LjJjLTAuNCwwLTAuOS0wLjEtMS4zLTAuM2MtMC43LTAuMy0xLjMtMC45LTEuNi0xLjdsLTYuNy0xOC4zYy0wLjMtMC43LTAuMi0xLjYsMC4xLTIuM2MwLjMtMC43LDAuOS0xLjMsMS43LTEuNmwzMC44LTExLjJjMC43LTAuMywxLjYtMC4yLDIuMywwLjFjMC43LDAuMywxLjMsMC45LDEuNiwxLjdMNzMsNTljMC42LDEuNi0wLjIsMy4zLTEuOCwzLjhMNDAuNCw3NEM0MCw3NC4xLDM5LjcsNzQuMiwzOS40LDc0LjJ6IE0zNi41LDU0LjdsNC42LDEyLjdsMjUuMi05LjJsLTQuNi0xMi43TDM2LjUsNTQuN3oiPjwvcGF0aD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik03MCwxMTguOWMtMS4yLDAtMi40LTAuNy0yLjgtMS45bC0xNC0zNy4ybC04LjQsMy4xbC0xNy4yLDM0LjRjLTAuNywxLjUtMi41LDIuMS00LDEuM2MtMS41LTAuNy0yLjEtMi41LTEuMy00TDQwLDc5YzAuMy0wLjcsMC45LTEuMiwxLjctMS41TDU0LDczLjFjMS41LTAuNiwzLjMsMC4yLDMuOCwxLjhsMTUsNDBjMC42LDEuNi0wLjIsMy4zLTEuOCwzLjlDNzAuNywxMTguOCw3MC40LDExOC45LDcwLDExOC45eiI+PC9wYXRoPgogICAgPHBhdGggZmlsbD0iIzQ1NEI1NCIgZD0iTTEzLjYsODAuMWMtMS4yLDAtMi40LTAuOC0yLjgtMkw2LjMsNjUuOWMtMC42LTEuNiwwLjItMy4zLDEuOC0zLjhjMS42LTAuNiwzLjMsMC4yLDMuOCwxLjhsNC40LDEyLjJjMC42LDEuNi0wLjIsMy4zLTEuOCwzLjhDMTQuMyw4MC4xLDE0LDgwLjEsMTMuNiw4MC4xeiI+PC9wYXRoPgogICAgPHBhdGggZmlsbD0iIzQ1NEI1NCIgZD0iTTEzLjIsNzMuM2MtMS4yLDAtMi40LTAuOC0yLjgtMmMtMC42LTEuNiwwLjItMy4zLDEuOC0zLjhMMzUsNTkuMmMxLjYtMC42LDMuMywwLjIsMy44LDEuOGMwLjYsMS42LTAuMiwzLjMtMS44LDMuOGwtMjIuOCw4LjNDMTMuOSw3My4zLDEzLjYsNzMuMywxMy4yLDczLjN6Ij48L3BhdGg+Cjwvc3ZnPgo=`,D$={demo:{view:`image`,src:E$,height:100},examples:[{title:`Src is not defined`,demo:`image`},{title:`Bad url`,demo:`image{ src: "<bad url>" }`}]},O$=`{
|
|
228
|
+
...#.props,
|
|
229
|
+
src: #.props has no 'src' ? imagesrc()
|
|
230
|
+
} | overrideProps()`;function k$(e){e.view.define(`image`,function(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&(e[n]=r);e.onerror=()=>e.classList.add(`error`),e.onload=()=>e.classList.add(`loaded`)},{tag:`img`,props:O$,usage:D$})}var A$={beforeDemo:['md:"Similar to the `image` view but displays as a block with the image centered. The block has a checkered background to highlight image transparency."'],demo:{view:`image-preview`,src:E$,height:100},examples:[{title:`Src is not defined`,demo:`image-preview`},{title:`Bad url`,demo:`image-preview{ src: "<bad url>" }`}]};function j$(e){e.view.define(`image-preview`,function(e,t,n,r){this.render(e,{view:`image`,...t},n,r)},{usage:A$})}var M$={demo:{view:`indicator`,data:{label:`Label`,value:`1234`}},examples:[{title:`Indicator as link`,demo:{view:`indicator`,data:{label:`Label`,value:`4321`,href:`#`}}}]};function N$(e){e.view.define(`indicator`,function(t,n,r,i){let{value:a,label:o}=n,{href:s}=r||{},c=document.createElement(`div`),l=document.createElement(`div`);return c.className=`value`,l.className=`label`,s&&(t.href=s),Promise.all([e.view.render(c,a||`text:value`,r,i),e.view.render(l,o||`text:label`,r,i)]).then(()=>t.append(c,l))},{tag:`a`,usage:M$})}var P$={demo:{view:`link`,text:`I am a link`,href:`#example`},examples:[{title:`Link opened in new tab`,highlightProps:[`external`],demo:{view:`link`,text:`Discovery github`,href:`https://github.com/discoveryjs/discovery`,external:!0}},{title:`Infering text ⇿ href`,highlightProps:[`text`,`href`,`data`],beforeDemo:['md:"When `text` is omitted but `href` is specified, or vice versa, the opposite component is inferred from the specified one"'],demo:[{view:`link`,text:`http://example1.com`},{view:`link`,href:`http://example2.com`},{view:`link`,data:`"http://example3.com"`}]},{title:`Using onClick handler`,highlightProps:[`onClick`],demo:{view:`link`,text:`Show "Hello world"`,onClick:Function(`return () => alert("Hello world!")`)()}},{title:`Using data as source of options`,beforeDemo:{view:`md`,source:[`The following properties are taken from the data when the appropriate options are not specified for a legacy reasons (is subject to remove in the future):`,"- `text`","- `href`","- `external`"].join(`
|
|
231
|
+
`)},highlightProps:[`data`],demo:{view:`link`,data:{text:`demo`,href:`#example`}}},{title:`Complex content`,highlightProps:[`content`],demo:{view:`link`,href:`#example`,content:[`text:"text "`,`html:"<b>bold</b>"`]}}]},F$=`is not array? | {
|
|
232
|
+
text: #.props.content is undefined ? is string ?: text,
|
|
233
|
+
content: undefined,
|
|
234
|
+
href,
|
|
235
|
+
external,
|
|
236
|
+
onClick: undefined
|
|
237
|
+
} | overrideProps() | {
|
|
238
|
+
$text; $href;
|
|
239
|
+
...,
|
|
240
|
+
text: $text | is not undefined or no $href ?: $href,
|
|
241
|
+
href: $href | is not undefined or no $text ?: $text
|
|
242
|
+
}`;function I$(e){e.view.define(`link`,function(t,n,r,i){let{text:a,content:o,href:s,external:c,onClick:l}=n;if(s&&(t.href=s),c&&t.setAttribute(`target`,`_blank`),typeof l==`function`&&(t.classList.add(`onclick`),t.addEventListener(`click`,e=>{e.preventDefault(),l(t,r,i)})),o)return e.view.render(t,o,r,i);t.textContent=a},{tag:`a`,props:F$,usage:P$})}function L$(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R$=L$();function z$(e){R$=e}var B$=/[&<>"']/,V$=new RegExp(B$.source,`g`),H$=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,U$=new RegExp(H$.source,`g`),W$={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},G$=e=>W$[e];function K$(e,t){if(t){if(B$.test(e))return e.replace(V$,G$)}else if(H$.test(e))return e.replace(U$,G$);return e}var q$=/(^|[^\[])\^/g;function J$(e,t){let n=typeof e==`string`?e:e.source;t||=``;let r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(q$,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function Y$(e){try{e=encodeURI(e).replace(/%25/g,`%`)}catch{return null}return e}var X$={exec:()=>null};function Z$(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,`|`);return n}function Q$(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function $$(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function e1(e,t,n,r){let i=t.href,a=t.title?K$(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:K$(o)}}function t1(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
|
|
243
|
+
`).map(e=>{let t=e.match(/^\s+/);if(t===null)return e;let[n]=t;return n.length>=r.length?e.slice(r.length):e}).join(`
|
|
244
|
+
`)}var n1=class{options;rules;lexer;constructor(e){this.options=e||R$}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^(?: {1,4}| {0,3}\t)/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Q$(e,`
|
|
245
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=t1(e,t[3]||``);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=Q$(e,`#`);(this.options.pedantic||!t||/ $/.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Q$(t[0],`
|
|
246
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Q$(t[0],`
|
|
247
|
+
`).split(`
|
|
248
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(/^ {0,3}>/.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
249
|
+
`),c=s.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
|
250
|
+
$1`).replace(/^ {0,3}>[ \t]?/gm,``);n=n?`${n}\n${s}`:s,r=r?`${r}\n${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i[i.length-1];if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
251
|
+
`+e.join(`
|
|
252
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
253
|
+
`+e.join(`
|
|
254
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i[i.length-1].raw.length).split(`
|
|
255
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
256
|
+
`,1)[0].replace(/^\t+/,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
257
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(/[^ ]/),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&/^[ \t]*$/.test(l)&&(r+=l+`
|
|
258
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),a=RegExp(`^ {0,${Math.min(3,d-1)}}#`),o=RegExp(`^ {0,${Math.min(3,d-1)}}<(?:[a-z].*>|!--)`,`i`);for(;e;){let f=e.split(`
|
|
259
|
+
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g,` `),p=l):p=l.replace(/\t/g,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(/[^ ]/)>=d||!l.trim())s+=`
|
|
260
|
+
`+p.slice(d);else{if(u||c.replace(/\t/g,` `).search(/[^ ]/)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
261
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
262
|
+
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:/\n[ \t]*\n[ \t]*$/.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=/^\[[ xX]\] /.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(/^\[[ xX]\] +/,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g,` `),n=t[2]?t[2].replace(/^<(.*)>$/,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=Z$(t[1]),r=t[2].replace(/^\||\| *$/g,``).split(`|`),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(`
|
|
263
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)/^ *-+: *$/.test(e)?a.align.push(`right`):/^ *:-+: *$/.test(e)?a.align.push(`center`):/^ *:-+ *$/.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Z$(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
264
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:K$(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=Q$(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=$$(t[2],`()`);if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),e1(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(/\s+/g,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return e1(n,e,n[0],this.lexer)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g,` `),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=K$(e,!0),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=K$(t[1]),n=`mailto:`+e):(e=K$(t[1]),n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=K$(t[0]),n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=K$(t[0]),n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:K$(t[0]),{type:`text`,raw:t[0],text:e}}}},r1=/^(?:[ \t]*(?:\n|$))+/,i1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,a1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,o1=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,s1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,c1=/(?:[*+-]|\d{1,9}[.)])/,l1=J$(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,c1).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),u1=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,d1=/^[^\n]+/,f1=/(?!\s*\])(?:\\.|[^\[\]\\])+/,p1=J$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,f1).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),m1=J$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,c1).getRegex(),h1=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,g1=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_1=J$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,g1).replace(`tag`,h1).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v1=J$(u1).replace(`hr`,o1).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,h1).getRegex(),y1={blockquote:J$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,v1).getRegex(),code:i1,def:p1,fences:a1,heading:s1,hr:o1,html:_1,lheading:l1,list:m1,newline:r1,paragraph:v1,table:X$,text:d1},b1=J$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,o1).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,h1).getRegex(),x1={...y1,table:b1,paragraph:J$(u1).replace(`hr`,o1).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,b1).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,h1).getRegex()},S1={...y1,html:J$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,g1).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:J$(u1).replace(`hr`,o1).replace(`heading`,` *#{1,6} *[^
|
|
265
|
+
]`).replace(`lheading`,l1).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},C1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,w1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,T1=/^( {2,}|\\)\n(?!\s*$)/,E1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,D1=`\\p{P}\\p{S}`,O1=J$(/^((?![*_])[\spunctuation])/,`u`).replace(/punctuation/g,D1).getRegex(),k1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,A1=J$(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,`u`).replace(/punct/g,D1).getRegex(),j1=J$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])`,`gu`).replace(/punct/g,D1).getRegex(),M1=J$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])`,`gu`).replace(/punct/g,D1).getRegex(),N1=J$(/\\([punct])/,`gu`).replace(/punct/g,D1).getRegex(),P1=J$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),F1=J$(g1).replace(`(?:-->|$)`,`-->`).getRegex(),I1=J$(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,F1).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),L1=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R1=J$(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace(`label`,L1).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),z1=J$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,L1).replace(`ref`,f1).getRegex(),B1=J$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,f1).getRegex(),V1={_backpedal:X$,anyPunctuation:N1,autolink:P1,blockSkip:k1,br:T1,code:w1,del:X$,emStrongLDelim:A1,emStrongRDelimAst:j1,emStrongRDelimUnd:M1,escape:C1,link:R1,nolink:B1,punctuation:O1,reflink:z1,reflinkSearch:J$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,z1).replace(`nolink`,B1).getRegex(),tag:I1,text:E1,url:X$},H1={...V1,link:J$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,L1).getRegex(),reflink:J$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,L1).getRegex()},U1={...V1,escape:J$(C1).replace(`])`,`~|])`).getRegex(),url:J$(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},W1={...U1,br:J$(T1).replace(`{2,}`,`*`).getRegex(),text:J$(U1.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},G1={normal:y1,gfm:x1,pedantic:S1},K1={normal:V1,gfm:U1,breaks:W1,pedantic:H1},q1=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R$,this.options.tokenizer=this.options.tokenizer||new n1,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:G1.normal,inline:K1.normal};this.options.pedantic?(t.block=G1.pedantic,t.inline=K1.pedantic):this.options.gfm&&(t.block=G1.gfm,t.inline=this.options.breaks?K1.breaks:K1.gfm),this.tokenizer.rules=t}static get rules(){return{block:G1,inline:K1}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
266
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.options.pedantic&&(e=e.replace(/\t/g,` `).replace(/^ +$/gm,``));let r,i,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
|
267
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
|
|
268
|
+
`+r.raw,i.text+=`
|
|
269
|
+
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
|
|
270
|
+
`+r.raw,i.text+=`
|
|
271
|
+
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(a=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){i=t[t.length-1],n&&i?.type===`paragraph`?(i.raw+=`
|
|
272
|
+
`+r.raw,i.text+=`
|
|
273
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),n=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&i.type===`text`?(i.raw+=`
|
|
274
|
+
`+r.raw,i.text+=`
|
|
275
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,a=e,o,s,c;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)e.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+`++`+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(c=``),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,a,c)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),n.raw.slice(-1)!==`_`&&(c=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},J1=class{options;parser;constructor(e){this.options=e||R$}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(/^\S*/)?.[0],i=e.replace(/\n$/,``)+`
|
|
276
|
+
`;return r?`<pre><code class="language-`+K$(r)+`">`+(n?i:K$(i,!0))+`</code></pre>
|
|
277
|
+
`:`<pre><code>`+(n?i:K$(i,!0))+`</code></pre>
|
|
278
|
+
`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>
|
|
279
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
280
|
+
`+r+`</`+i+`>
|
|
281
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
282
|
+
<thead>
|
|
283
|
+
`+t+`</thead>
|
|
284
|
+
`+r+`</table>
|
|
285
|
+
`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Y$(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+t+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n}){let r=Y$(e);if(r===null)return n;e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=`>`,i}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}},Y1=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},X1=class e{options;renderer;textRenderer;constructor(e){this.options=e||R$,this.options.renderer=this.options.renderer||new J1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Y1}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
286
|
+
`+this.renderer.text(i);n+=t?this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o}]}):o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t){t||=this.renderer;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Z1=class{options;block;constructor(e){this.options=e||R$}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?q1.lex:q1.lexInline}provideParser(){return this.block?X1.parse:X1.parseInline}},Q1=class{defaults=L$();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=X1;Renderer=J1;TextRenderer=Y1;Lexer=q1;Tokenizer=n1;Hooks=Z1;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new J1(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new n1(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Z1;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Z1.passThroughHooks.has(n)?e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return q1.lex(e,t??this.defaults)}parser(e,t){return X1.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?q1.lex:q1.lexInline,s=i.hooks?i.hooks.provideParser():e?X1.parse:X1.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
287
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+K$(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},$1=new Q1;function e0(e,t){return $1.parse(e,t)}e0.options=e0.setOptions=function(e){return $1.setOptions(e),e0.defaults=$1.defaults,z$(e0.defaults),e0},e0.getDefaults=L$,e0.defaults=R$,e0.use=function(...e){return $1.use(...e),e0.defaults=$1.defaults,z$(e0.defaults),e0},e0.walkTokens=function(e,t){return $1.walkTokens(e,t)},e0.parseInline=$1.parseInline,e0.Parser=X1,e0.parser=X1.parse,e0.Renderer=J1,e0.TextRenderer=Y1,e0.Lexer=q1,e0.lexer=q1.lex,e0.Tokenizer=n1,e0.Hooks=Z1,e0.parse=e0,e0.options,e0.setOptions,e0.use,e0.walkTokens,e0.parseInline,X1.parse,q1.lex;var t0=class extends J1{heading({tokens:e,depth:t,text:n}){let{discoveryjs:{host:r,useAnchors:i}}=this.options,a=x$(n.replace(/<!--.*?-->/g,``)),o=``;if(i){let e=r.encodePageHash(r.pageId,r.pageRef,r.pageParams,a);o=`<a class="view-header__anchor" id="!anchor:${fz(a)}" href="${e}"></a>`}return`<h${t} class="view-header view-h${t}" data-slug="${a}">${o}${this.parser.parseInline(e)}</h${t}>
|
|
288
|
+
`}blockquote({tokens:e}){let t=this.parser.parse(e),n=null,r=t.match(/^(<p>)?\[!([a-z]+)\]\s*(<\/p>)?\n/i);return r&&(n=r[2],t=(r[3]?``:r[1]||``)+t.slice(r[0].length)),`<blockquote class="view-blockquote"${n?` data-kind=${JSON.stringify(n.toLowerCase())}`:``}>${t}</blockquote>`}code({text:e,lang:t}){let{discoveryjs:{codes:n}}=this.options;return`<code class="discoveryjs-code" data-id="${n.push({syntax:t,source:e})-1}"></code>`}link({tokens:e,href:t,title:n}){let r=this.parser.parseInline(e);if(t===null)return r;let i=`<a class="view-link md-rendered-link" href="`+fz(t)+`"`;return n&&(i+=` title="`+fz(n)+`"`),i+=`>`+r+`</a>`,i}checkbox({checked:e}){return`<label class="view-checkbox"><input type="checkbox" disabled`+(e?` checked`:``)+`/></label> `}list({items:e,ordered:t,start:n}){let r=t?`ol`:`ul`;return`<${r} class="view-${r}"${t&&n!==1?` start="${n}"`:``}>
|
|
289
|
+
`+e.map(this.listitem,this).join(`
|
|
290
|
+
`)+`
|
|
291
|
+
</${r}>
|
|
292
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});if(e.loose){let t=e.tokens[0];t?.type===`paragraph`?(t.text=n+t.text,Array.isArray(t.tokens)&&t.tokens[0]?.type===`text`&&(t.tokens[0].text=n+t.tokens[0].text)):e.tokens.unshift({type:`text`,raw:n,text:n})}else t+=n}return`<li class="view-list-item${e.task?` check-list-item`:``}">${t}${this.parser.parse(e.tokens,!!e.loose)}</li>
|
|
293
|
+
`}table({header:e,rows:t}){let n=t.map(e=>`<tr class="view-table-row">`+e.map(this.tablecell,this).join(``)+`</tr>`).join(`
|
|
294
|
+
`);return`<table class="view-table">
|
|
295
|
+
<thead>
|
|
296
|
+
`+e.map(this.tablecell,this).join(``)+`
|
|
297
|
+
</thead>
|
|
298
|
+
`+(n?`<tbody>
|
|
299
|
+
`+n+`
|
|
300
|
+
</tbody>
|
|
301
|
+
`:``)+`</table>
|
|
302
|
+
`}tablecell({tokens:e,header:t,align:n}){let r=t?`th`:`td`;return`<${r} class="${t?`view-table-header-cell`:`view-table-cell`}"${n?` align="${n}"`:``}>`+this.parser.parseInline(e)+`</${r}>
|
|
303
|
+
`}},n0={demo:{view:`markdown`,source:`# Markdown example
|
|
304
|
+
|
|
305
|
+
> NOTE: The \`markdown\` view is based on [marked](https://github.com/markedjs/marked) package
|
|
306
|
+
|
|
307
|
+
Markdown is good because:
|
|
308
|
+
* You'll get **formatted** *text* with _no tags_
|
|
309
|
+
* It's much simpler than \`HTML\`
|
|
310
|
+
|
|
311
|
+
\`\`\`html
|
|
312
|
+
<b>bold</b><i>italic</i>
|
|
313
|
+
\`\`\`
|
|
314
|
+
[Read more](https://guides.github.com/features/mastering-markdown/)`},examples:[{title:`Inline config`,demo:'markdown{ source: "**Hello** `world`!" }'},{title:`Shorthand syntax`,beforeDemo:['md:"You can use `md` as an alias for `markdown` with a string as data. That\'s a **shortest** definition for a marked text"'],demo:'md:"**Hello** `world`!"'},{title:`Array of strings as a source`,beforeDemo:['md:"Array of strings might be passed as a value for `source` property which is useful for a long sources\\n> NOTE: This doesn\'t work a source passed via data"'],demo:{view:`markdown`,source:[`Array`,`of`,"`strings`"]}},{title:`Interpolation`,beforeDemo:['md:"Interpolation can be used almost anywhere in a markdown to embed the result of a jora query into resulting HTML. Just place a jora query between `{{`{{`}}` and `{{`}`+`}`}}`:"'],demo:{view:`md`,source:["Simple evaluation: 2 + 2 = `{{ 2 + 2 }}`",``,`Markdown view has {{ #.options.usage.examples.size() }} examples`]}},{title:`Disable anchors for headers`,highlightProps:[`anchors`],beforeDemo:`Hover a header to see a chain icon on the left side of header when anchors are enabled:`,demo:[{view:`markdown`,source:`## header with default settings`},{view:`markdown`,anchors:!1,source:`## header with disabled anchor`}]},{title:`Sections prelude and postlude`,highlightProps:[`sectionPrelude`,`sectionPostlude`],demo:{view:`markdown`,source:`Section without a header
|
|
315
|
+
|
|
316
|
+
## Header level 2
|
|
317
|
+
|
|
318
|
+
Section 1
|
|
319
|
+
|
|
320
|
+
### Header level 3
|
|
321
|
+
|
|
322
|
+
Section 2
|
|
323
|
+
|
|
324
|
+
## Header level 2
|
|
325
|
+
|
|
326
|
+
Section 3`,sectionPrelude:`struct:#.section`,sectionPostlude:{view:`link`,href:`#top`,text:`Scroll to top ↑`}}},{title:`Configuration for code blocks`,highlightProps:[`codeConfig`],beforeDemo:['md:"Use `codeConfig` to specify any settings for code blocks available for `source` view."'],demo:{view:`markdown`,source:`# Header 1
|
|
327
|
+
|
|
328
|
+
\`\`\`js
|
|
329
|
+
console.log("Hello world")
|
|
330
|
+
\`\`\`
|
|
331
|
+
|
|
332
|
+
## Header 2
|
|
333
|
+
|
|
334
|
+
text
|
|
335
|
+
|
|
336
|
+
## Header 3
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
\`\`\`jora
|
|
341
|
+
foo.bar.baz
|
|
342
|
+
\`\`\``,codeConfig:{prelude:{view:`block`,content:[`badge:syntax`,`text:"Length: " + #.sourceViewProps.source.size()`]},postlude:`struct:#.section`,actionButtons:[{view:`button`,text:`Say "Hello world"`,onClick:Function(`return () => alert("Hello world!")`)()}]}}},{title:`Showcase`,demo:{view:`markdown`,source:`# Header level 1
|
|
343
|
+
## Header level 2
|
|
344
|
+
### Header level 3
|
|
345
|
+
#### Header level 4
|
|
346
|
+
##### Header level 5
|
|
347
|
+
* One
|
|
348
|
+
* Two
|
|
349
|
+
* Three
|
|
350
|
+
|
|
351
|
+
4. Four
|
|
352
|
+
5. Five
|
|
353
|
+
6. Six
|
|
354
|
+
- [{{ true }}] Task 1
|
|
355
|
+
- [x] Task 2
|
|
356
|
+
|
|
357
|
+
Interpolation in text: 2 + 2 = \`{{ 2 + 2 }}\`, or in attribute: [link](#dummy-link/{{"exam" + "ple"}} "{{ "example" + " title" }}")
|
|
358
|
+
|
|
359
|
+
Paragraph **bold** __bold__ *italic* _italic_ ~line-through~ \`code\` [link](#href)
|
|
360
|
+
|
|
361
|
+
>Blockquote
|
|
362
|
+
> > Line 2
|
|
363
|
+
|
|
364
|
+
> [!NOTE]
|
|
365
|
+
> Useful information that users should know, even when skimming content.
|
|
366
|
+
|
|
367
|
+
> [!TIP]
|
|
368
|
+
> Helpful advice for doing things better or more easily.
|
|
369
|
+
|
|
370
|
+
> [!IMPORTANT]
|
|
371
|
+
> Key information users need to know to achieve their goal.
|
|
372
|
+
|
|
373
|
+
> [!WARNING]
|
|
374
|
+
> Urgent info that needs immediate user attention to avoid problems.
|
|
375
|
+
|
|
376
|
+
> [!CAUTION]
|
|
377
|
+
> Advises about risks or negative outcomes of certain actions.
|
|
378
|
+
|
|
379
|
+
\`\`\`js
|
|
380
|
+
var some = "code";
|
|
381
|
+
\`\`\`
|
|
382
|
+
|
|
383
|
+
foo | bar
|
|
384
|
+
----|-----
|
|
385
|
+
1 | A
|
|
386
|
+
2 | C
|
|
387
|
+
3 | E`.split(/\n/)}}]};function r0(e,t){let{nodeValue:n}=e,r=n.replace(/{{(\d+)}}/gs,(e,n)=>t[n]);r!==n&&(e.nodeValue=r)}function i0(e,t){for(let n of e.childNodes)switch(n.nodeType){case document.ELEMENT_NODE:if(!n.classList.contains(`view-source`)){i0(n,t);for(let e of n.attributes)r0(e,t)}break;case document.TEXT_NODE:r0(n,t)}}function a0(e){let t=new Map,n={after:e.prepend.bind(e)},r={next:null,data:{sectionIdx:0,slug:null,text:null,href:null}};t.set(n,r);for(let i of[...e.querySelectorAll(`:scope > :is(h1, h2, h3, h4, h5, h6)`)]){i===e.firstElementChild&&(t.delete(n),n=i,r=null);let a=i.querySelector(`:scope > a[id^="!anchor:"]`),o={next:null,data:{sectionIdx:t.size,slug:i.dataset.slug,text:i.textContent.trim(),href:a?.hash}};t.set(i,o),r&&(r.next=i),r=o}return{sectionByHeaderEl:t,findSectionByEl(r){let i=t.get(n);for(;r!==null&&r!==e;){if(t.has(r)){i=t.get(r);break}r=r.previousSibling||r.parentNode}return i?.data||null}}}var o0=`is not array? | {
|
|
388
|
+
source: #.props has no 'source' ? is (string or array) ?,
|
|
389
|
+
anchors: true,
|
|
390
|
+
sectionPrelude: undefined,
|
|
391
|
+
sectionPostlude: undefined,
|
|
392
|
+
codeConfig: undefined
|
|
393
|
+
} | overrideProps()`;function s0(e){let t=new Q1().setOptions({smartLists:!0,renderer:new t0});function n(n,r,i,a){let o=new Map,s=[],c=[],{anchors:l=!0,sectionPrelude:u,sectionPostlude:d}=r,{source:f,codeConfig:p}=r;if(Array.isArray(f)&&(f=f.join(`
|
|
394
|
+
`)),f=f.replace(/{{(.+?)}}/gs,(e,t)=>(t=t.trim(),o.has(t)||o.set(t,o.size),`{{${o.get(t)}}}`)),n.classList.add(`view-markdown`),n.innerHTML=t.parse(f,{discoveryjs:{host:e,useAnchors:l,codes:s}}),o.size>0){let t=Array(o.size);for(let[n,r]of o.entries())try{t[r]=e.query(n,i,a)}catch(t){e.logger.error(`Interpolation query error in markdown:`,t.message)}i0(n,t)}for(let e of n.querySelectorAll(`.md-rendered-link`))e.getAttribute(`href`).startsWith(`#`)||e.setAttribute(`target`,`_blank`);let{sectionByHeaderEl:m,findSectionByEl:h}=s.length||u||d?a0(n):{sectionByHeaderEl:new Map,findSectionByEl:()=>null};p=typeof p==`object`?{view:`source`,...p}:p||`source`;for(let e of[...n.querySelectorAll(`.discoveryjs-code`)]){let t=h(e),n=document.createDocumentFragment(),{syntax:r,source:i}=s[e.dataset.id];c.push(this.render(n,p,{syntax:r,source:i},{...a,section:t}).then(()=>e.replaceWith(n)))}if(u||d){let e=(e,t,n)=>{let r=document.createDocumentFragment();c.push(this.render(r,e,i,{...a,section:t.data}).then(()=>n(r)))};for(let[t,r]of m)u&&e(u,r,e=>t.after(e)),d&&e(d,r,e=>r.next?r.next.before(e):n.append(e))}return Promise.all(c)}e.view.define(`markdown`,n,{props:o0,usage:n0}),e.view.define(`md`,n,{props:o0,usage:n0})}var c0=o(((e,t)=>{function n(e,t){switch(e.charCodeAt(t)){default:return 0;case 10:return 1;case 13:return t+1<e.length&&e.charCodeAt(t+1)===10?2:1}}t.exports={newLineLength:n}})),l0=o(((e,t)=>{var{newLineLength:n}=c0();t.exports=(e,t)=>{let r=1,i=0;for(let a=0;a<e.length;a++){let o=n(e,a);o!==0&&(t(i,a+o,r++),i=a+o,a+=o-1)}t(i,e.length,r++)}})),u0=o(((e,t)=>{var{newLineLength:n}=c0();t.exports=(e,t)=>{let r=1,i=0;for(let a=0;a<e.length;a++){let o=n(e,a);o!==0&&(t(i,a,r++),i=a+o,a+=o-1)}t(i,e.length,r++)}})),d0=o(((e,t)=>{t.exports=function(e){if(e instanceof RegExp){let t=e.flags.indexOf(`g`)===-1?e.flags+`g`:e.flags,n=new RegExp(e,t);return function(e,t){let r;for(;r=n.exec(e);)t(r.index,r.index+r[0].length)}}return e=String(e),function(t,n){let r=-1;for(;r=t.indexOf(e,r+1),r!==-1;)n(r,r+e.length)}}})),f0=o(((e,t)=>{var{newLineLength:n}=c0();t.exports=(e,t)=>{let r=1;for(let i=0;i<e.length;i++){let a=n(e,i);a!==0&&(t(i,i+a,r++),i+=a-1)}}})),p0=o(((e,t)=>{t.exports={lines:l0(),lineContents:u0(),matches:d0(),newlines:f0()}})),m0=o(((e,t)=>{function n(e){return r.call(null,e)}function r(e){let t=this===globalThis?{}:this||{},n={};return Object.assign(n,t,e,{fork:r.bind(n),ranges:Object.assign({},t.ranges,e&&e.ranges)}),typeof n.createHook!=`function`&&(n.createHook=e=>e()),n}function i(e){let t=Object.assign({},this);for(let r in e){let i=e[r];if(!(!i||typeof i!=`object`)){if(hasOwnProperty.call(t,r)){let n=t[r];t[r]=n&&typeof n.fork==`function`?n.fork(e[r]):n}else t[r]=n(e[r])}}return t.fork=i.bind(t),t}t.exports={createPrinter:n,forkPrinter:r,forkPrinterSet:i}})),h0=o(((e,t)=>{t.exports=m0().createPrinter()})),g0=o(((e,t)=>{var{createPrinter:n}=m0();t.exports=n({print:e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)})})),_0=o(((e,t)=>{var{forkPrinterSet:n}=m0();t.exports=n.call({},{noop:h0(),html:g0(),tty:h0()})})),v0=o(((e,t)=>{t.exports=function(e,t){let n=[];return t.forEach(({generate:t,marker:r})=>t(e,(e,t,i)=>n.push({type:r,start:e,end:t,data:i}))),n}})),y0=o(((e,t)=>{var n=()=>``,r=function(){};function i(e,t){return typeof e==`function`?e:t||r}t.exports=function(e,t,r){let a=i(r.print,e=>e),o=Object.assign(Object.defineProperties(Object.create(null),{offset:{get:()=>f},line:{get:()=>p},column:{get:()=>m},start:{get:()=>c.start},end:{get:()=>c.end},data:{get:()=>c.data}}),i(r.createContext)()),s=[],c={start:0,end:e.length},l=r.ranges||{},u=[],d=1/0,f=0,p=1,m=1,h=``;h+=i(r.open,n)(o),l=[].concat(Object.getOwnPropertyNames(l),Object.getOwnPropertySymbols(l)).reduce((e,t)=>{let o=l[t];return typeof o==`function`&&(l[t]=o=r.createHook(o)),o&&(u.push(t),e[t]={open:i(o.open,n),close:i(o.close,n),print:i(o.print,a)}),e},{}),t=t.slice().sort((e,t)=>e.start-t.start||t.end-e.end||u.indexOf(e.type)-u.indexOf(t.type));let g=e=>l[(c=s[e]).type].open(o)||``,_=e=>l[(c=s[e]).type].close(o)||``,v=t=>{if(f!==t){let n=e.substring(f,t),r=s.length?l[s[s.length-1].type].print:a;for(let n=f;n<t;n++){let t=e.charCodeAt(n);t===10||t===13&&(n>=e.length||e.charCodeAt(n+1)!==10)?(p++,m=1):m++}h+=r(n,o),f=t}},y=e=>{for(;d<=e;){v(d);for(let e=s.length-1;e>=0&&s[e].end===d;e--)h+=_(e),s.pop();d=1/0;for(let e=0;e<s.length;e++)s[e].end<d&&(d=s[e].end)}};for(let e=0;e<t.length;e++){let n=t[e],r=0;if(l.hasOwnProperty(n.type)!==!1&&!(n.start>n.end||!Number.isFinite(n.start)||!Number.isFinite(n.end))){for(y(n.start),v(n.start),r=0;r<s.length;r++)if(s[r].end<n.end){for(let e=s.length-1;e>=r;e--)h+=_(e);break}for(s.splice(r,0,n);r<s.length;r++)h+=g(r);n.end<d&&(d=n.end)}}y(e.length),v(e.length);for(let e=s.length-1;e>=0;e--)h+=_(e);return h+=i(r.close,n)(o)||``,h}})),b0=o(((e,t)=>{var n=p0(),r=_0(),i=v0(),a=y0();function o(e,t){return{marker:e,generate:t}}function s(e,t){let n={};for(let r in t)n[r]={ranges:{[e]:t[r]}};return n}function c(e,t,n){let l=(o,s)=>{let c=t[s||n]||r.noop;return a(o,i(o,e),c)};return Object.assign(l,{print:l,generateRanges(t){return i(t,e)},use(r,i){let a=Symbol(r.name),u=r.ranges||r,d=Array.isArray(u)?(e,t)=>u.forEach(e=>t(...e)):u;return typeof d!=`function`||(i||=r.printer,!i)?l:c(e.concat(o(a,d)),t.fork(s(a,i)),n)},printer(n){return c(e,t,n)}})}function l(e,t,n){let i=c([],n||r,t);return Array.isArray(e)&&(i=e.reduce((e,t)=>Array.isArray(t)?e.use(...t):e.use(t),i)),i}t.exports=Object.assign(l,{gen:n,printer:Object.assign((...e)=>l().printer(...e),r),use(...e){return l().use(...e)}})})),x0=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(vz()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){e.defineMode(`css`,function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode(`text/css`));var i=t.indentUnit,a=n.tokenHooks,o=n.documentTypes||{},s=n.mediaTypes||{},c=n.mediaFeatures||{},l=n.mediaValueKeywords||{},u=n.propertyKeywords||{},d=n.nonStandardPropertyKeywords||{},f=n.fontProperties||{},p=n.counterDescriptors||{},m=n.colorKeywords||{},h=n.valueKeywords||{},g=n.allowNested,_=n.lineComment,v=n.supportsAtComponent===!0,y=t.highlightNonStandardPropertyKeywords!==!1,b,x;function S(e,t){return b=t,e}function C(e,t){var n=e.next();if(a[n]){var r=a[n](e,t);if(r!==!1)return r}if(n==`@`)return e.eatWhile(/[\w\\\-]/),S(`def`,e.current());if(n==`=`||(n==`~`||n==`|`)&&e.eat(`=`))return S(null,`compare`);if(n==`"`||n==`'`)return t.tokenize=w(n),t.tokenize(e,t);if(n==`#`)return e.eatWhile(/[\w\\\-]/),S(`atom`,`hash`);if(n==`!`)return e.match(/^\s*\w*/),S(`keyword`,`important`);if(/\d/.test(n)||n==`.`&&e.eat(/\d/))return e.eatWhile(/[\w.%]/),S(`number`,`unit`);if(n===`-`){if(/[\d.]/.test(e.peek()))return e.eatWhile(/[\w.%]/),S(`number`,`unit`);if(e.match(/^-[\w\\\-]*/))return e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?S(`variable-2`,`variable-definition`):S(`variable-2`,`variable`);if(e.match(/^\w+-/))return S(`meta`,`meta`)}else if(/[,+>*\/]/.test(n))return S(null,`select-op`);else if(n==`.`&&e.match(/^-?[_a-z][_a-z0-9-]*/i))return S(`qualifier`,`qualifier`);else if(/[:;{}\[\]\(\)]/.test(n))return S(null,n);else if(e.match(/^[\w-.]+(?=\()/))return/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=T),S(`variable callee`,`variable`);else if(/[\w\\\-]/.test(n))return e.eatWhile(/[\w\\\-]/),S(`property`,`word`);else return S(null,null)}function w(e){return function(t,n){for(var r=!1,i;(i=t.next())!=null;){if(i==e&&!r){e==`)`&&t.backUp(1);break}r=!r&&i==`\\`}return(i==e||!r&&e!=`)`)&&(n.tokenize=null),S(`string`,`string`)}}function T(e,t){return e.next(),t.tokenize=e.match(/^\s*[\"\')]/,!1)?null:w(`)`),S(null,`(`)}function E(e,t,n){this.type=e,this.indent=t,this.prev=n}function D(e,t,n,r){return e.context=new E(n,t.indentation()+(r===!1?0:i),e.context),n}function O(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function k(e,t,n){return j[n.context.type](e,t,n)}function A(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return k(e,t,n)}function ee(e){var t=e.current().toLowerCase();x=h.hasOwnProperty(t)?`atom`:m.hasOwnProperty(t)?`keyword`:`variable`}var j={};return j.top=function(e,t,n){if(e==`{`)return D(n,t,`block`);if(e==`}`&&n.context.prev)return O(n);if(v&&/@component/i.test(e))return D(n,t,`atComponentBlock`);if(/^@(-moz-)?document$/i.test(e))return D(n,t,`documentTypes`);if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return D(n,t,`atBlock`);if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,`restricted_atBlock_before`;if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return`keyframes`;if(e&&e.charAt(0)==`@`)return D(n,t,`at`);if(e==`hash`)x=`builtin`;else if(e==`word`)x=`tag`;else if(e==`variable-definition`)return`maybeprop`;else if(e==`interpolation`)return D(n,t,`interpolation`);else if(e==`:`)return`pseudo`;else if(g&&e==`(`)return D(n,t,`parens`);return n.context.type},j.block=function(e,t,n){if(e==`word`){var r=t.current().toLowerCase();return u.hasOwnProperty(r)?(x=`property`,`maybeprop`):d.hasOwnProperty(r)?(x=y?`string-2`:`property`,`maybeprop`):g?(x=t.match(/^\s*:(?:\s|$)/,!1)?`property`:`tag`,`block`):(x+=` error`,`maybeprop`)}return e==`meta`?`block`:!g&&(e==`hash`||e==`qualifier`)?(x=`error`,`block`):j.top(e,t,n)},j.maybeprop=function(e,t,n){return e==`:`?D(n,t,`prop`):k(e,t,n)},j.prop=function(e,t,n){if(e==`;`)return O(n);if(e==`{`&&g)return D(n,t,`propBlock`);if(e==`}`||e==`{`)return A(e,t,n);if(e==`(`)return D(n,t,`parens`);if(e==`hash`&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current()))x+=` error`;else if(e==`word`)ee(t);else if(e==`interpolation`)return D(n,t,`interpolation`);return`prop`},j.propBlock=function(e,t,n){return e==`}`?O(n):e==`word`?(x=`property`,`maybeprop`):n.context.type},j.parens=function(e,t,n){return e==`{`||e==`}`?A(e,t,n):e==`)`?O(n):e==`(`?D(n,t,`parens`):e==`interpolation`?D(n,t,`interpolation`):(e==`word`&&ee(t),`parens`)},j.pseudo=function(e,t,n){return e==`meta`?`pseudo`:e==`word`?(x=`variable-3`,n.context.type):k(e,t,n)},j.documentTypes=function(e,t,n){return e==`word`&&o.hasOwnProperty(t.current())?(x=`tag`,n.context.type):j.atBlock(e,t,n)},j.atBlock=function(e,t,n){if(e==`(`)return D(n,t,`atBlock_parens`);if(e==`}`||e==`;`)return A(e,t,n);if(e==`{`)return O(n)&&D(n,t,g?`block`:`top`);if(e==`interpolation`)return D(n,t,`interpolation`);if(e==`word`){var r=t.current().toLowerCase();x=r==`only`||r==`not`||r==`and`||r==`or`?`keyword`:s.hasOwnProperty(r)?`attribute`:c.hasOwnProperty(r)?`property`:l.hasOwnProperty(r)?`keyword`:u.hasOwnProperty(r)?`property`:d.hasOwnProperty(r)?y?`string-2`:`property`:h.hasOwnProperty(r)?`atom`:m.hasOwnProperty(r)?`keyword`:`error`}return n.context.type},j.atComponentBlock=function(e,t,n){return e==`}`?A(e,t,n):e==`{`?O(n)&&D(n,t,g?`block`:`top`,!1):(e==`word`&&(x=`error`),n.context.type)},j.atBlock_parens=function(e,t,n){return e==`)`?O(n):e==`{`||e==`}`?A(e,t,n,2):j.atBlock(e,t,n)},j.restricted_atBlock_before=function(e,t,n){return e==`{`?D(n,t,`restricted_atBlock`):e==`word`&&n.stateArg==`@counter-style`?(x=`variable`,`restricted_atBlock_before`):k(e,t,n)},j.restricted_atBlock=function(e,t,n){return e==`}`?(n.stateArg=null,O(n)):e==`word`?(x=n.stateArg==`@font-face`&&!f.hasOwnProperty(t.current().toLowerCase())||n.stateArg==`@counter-style`&&!p.hasOwnProperty(t.current().toLowerCase())?`error`:`property`,`maybeprop`):`restricted_atBlock`},j.keyframes=function(e,t,n){return e==`word`?(x=`variable`,`keyframes`):e==`{`?D(n,t,`top`):k(e,t,n)},j.at=function(e,t,n){return e==`;`?O(n):e==`{`||e==`}`?A(e,t,n):(e==`word`?x=`tag`:e==`hash`&&(x=`builtin`),`at`)},j.interpolation=function(e,t,n){return e==`}`?O(n):e==`{`||e==`;`?A(e,t,n):(e==`word`?x=`variable`:e!=`variable`&&e!=`(`&&e!=`)`&&(x=`error`),`interpolation`)},{startState:function(e){return{tokenize:null,state:r?`block`:`top`,stateArg:null,context:new E(r?`block`:`top`,e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||C)(e,t);return n&&typeof n==`object`&&(b=n[1],n=n[0]),x=n,b!=`comment`&&(t.state=j[t.state](b,e,t)),x},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),a=n.indent;return n.type==`prop`&&(r==`}`||r==`)`)&&(n=n.prev),n.prev&&(r==`}`&&(n.type==`block`||n.type==`top`||n.type==`interpolation`||n.type==`restricted_atBlock`)?(n=n.prev,a=n.indent):(r==`)`&&(n.type==`parens`||n.type==`atBlock_parens`)||r==`{`&&(n.type==`at`||n.type==`atBlock`))&&(a=Math.max(0,n.indent-i))),a},electricChars:`}`,blockCommentStart:`/*`,blockCommentEnd:`*/`,blockCommentContinue:` * `,lineComment:_,fold:`brace`}});function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}var n=[`domain`,`regexp`,`url`,`url-prefix`],r=t(n),i=[`all`,`aural`,`braille`,`handheld`,`print`,`projection`,`screen`,`tty`,`tv`,`embossed`],a=t(i),o=`width.min-width.max-width.height.min-height.max-height.device-width.min-device-width.max-device-width.device-height.min-device-height.max-device-height.aspect-ratio.min-aspect-ratio.max-aspect-ratio.device-aspect-ratio.min-device-aspect-ratio.max-device-aspect-ratio.color.min-color.max-color.color-index.min-color-index.max-color-index.monochrome.min-monochrome.max-monochrome.resolution.min-resolution.max-resolution.scan.grid.orientation.device-pixel-ratio.min-device-pixel-ratio.max-device-pixel-ratio.pointer.any-pointer.hover.any-hover.prefers-color-scheme.dynamic-range.video-dynamic-range`.split(`.`),s=t(o),c=[`landscape`,`portrait`,`none`,`coarse`,`fine`,`on-demand`,`hover`,`interlace`,`progressive`,`dark`,`light`,`standard`,`high`],l=t(c),u=`align-content.align-items.align-self.alignment-adjust.alignment-baseline.all.anchor-point.animation.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-timing-function.appearance.azimuth.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.binding.bleed.block-size.bookmark-label.bookmark-level.bookmark-state.bookmark-target.border.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-decoration-break.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.color.color-profile.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.content.counter-increment.counter-reset.crop.cue.cue-after.cue-before.cursor.direction.display.dominant-baseline.drop-initial-after-adjust.drop-initial-after-align.drop-initial-before-adjust.drop-initial-before-align.drop-initial-size.drop-initial-value.elevation.empty-cells.fit.fit-content.fit-position.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.float-offset.flow-from.flow-into.font.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-size.font-size-adjust.font-stretch.font-style.font-synthesis.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.gap.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-gap.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-gap.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphens.icon.image-orientation.image-rendering.image-resolution.inline-box-align.inset.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.left.letter-spacing.line-break.line-height.line-height-step.line-stacking.line-stacking-ruby.line-stacking-shift.line-stacking-strategy.list-style.list-style-image.list-style-position.list-style-type.margin.margin-bottom.margin-left.margin-right.margin-top.marks.marquee-direction.marquee-loop.marquee-play-count.marquee-speed.marquee-style.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.move-to.nav-down.nav-index.nav-left.nav-right.nav-up.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-style.overflow-wrap.overflow-x.overflow-y.padding.padding-bottom.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.page-policy.pause.pause-after.pause-before.perspective.perspective-origin.pitch.pitch-range.place-content.place-items.place-self.play-during.position.presentation-level.punctuation-trim.quotes.region-break-after.region-break-before.region-break-inside.region-fragment.rendering-intent.resize.rest.rest-after.rest-before.richness.right.rotate.rotation.rotation-point.row-gap.ruby-align.ruby-overhang.ruby-position.ruby-span.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-type.shape-image-threshold.shape-inside.shape-margin.shape-outside.size.speak.speak-as.speak-header.speak-numeral.speak-punctuation.speech-rate.stress.string-set.tab-size.table-layout.target.target-name.target-new.target-position.text-align.text-align-last.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-height.text-indent.text-justify.text-orientation.text-outline.text-overflow.text-rendering.text-shadow.text-size-adjust.text-space-collapse.text-transform.text-underline-position.text-wrap.top.touch-action.transform.transform-origin.transform-style.transition.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-select.vertical-align.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.volume.white-space.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.z-index.clip-path.clip-rule.mask.enable-background.filter.flood-color.flood-opacity.lighting-color.stop-color.stop-opacity.pointer-events.color-interpolation.color-interpolation-filters.color-rendering.fill.fill-opacity.fill-rule.image-rendering.marker.marker-end.marker-mid.marker-start.paint-order.shape-rendering.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-rendering.baseline-shift.dominant-baseline.glyph-orientation-horizontal.glyph-orientation-vertical.text-anchor.writing-mode`.split(`.`),d=t(u),f=`accent-color.aspect-ratio.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.content-visibility.margin-block.margin-block-end.margin-block-start.margin-inline.margin-inline-end.margin-inline-start.overflow-anchor.overscroll-behavior.padding-block.padding-block-end.padding-block-start.padding-inline.padding-inline-end.padding-inline-start.scroll-snap-stop.scrollbar-3d-light-color.scrollbar-arrow-color.scrollbar-base-color.scrollbar-dark-shadow-color.scrollbar-face-color.scrollbar-highlight-color.scrollbar-shadow-color.scrollbar-track-color.searchfield-cancel-button.searchfield-decoration.searchfield-results-button.searchfield-results-decoration.shape-inside.zoom`.split(`.`),p=t(f),m=t([`font-display`,`font-family`,`src`,`unicode-range`,`font-variant`,`font-feature-settings`,`font-stretch`,`font-weight`,`font-style`]),h=t([`additive-symbols`,`fallback`,`negative`,`pad`,`prefix`,`range`,`speak-as`,`suffix`,`symbols`,`system`]),g=`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkgrey.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkslategrey.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dimgrey.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightgrey.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightslategrey.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.slategrey.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`),_=t(g),v=`above.absolute.activeborder.additive.activecaption.afar.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.amharic.amharic-abegede.antialiased.appworkspace.arabic-indic.armenian.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.binary.bengali.blink.block.block-axis.blur.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.brightness.bullets.button.buttonface.buttonhighlight.buttonshadow.buttontext.calc.cambodian.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.cjk-earthly-branch.cjk-heavenly-stem.cjk-ideographic.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.conic-gradient.contain.content.contents.content-box.context-menu.continuous.contrast.copy.counter.counters.cover.crop.cross.crosshair.cubic-bezier.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.devanagari.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.drop-shadow.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic.ethiopic-abegede.ethiopic-abegede-am-et.ethiopic-abegede-gez.ethiopic-abegede-ti-er.ethiopic-abegede-ti-et.ethiopic-halehame-aa-er.ethiopic-halehame-aa-et.ethiopic-halehame-am-et.ethiopic-halehame-gez.ethiopic-halehame-om-et.ethiopic-halehame-sid-et.ethiopic-halehame-so-et.ethiopic-halehame-ti-er.ethiopic-halehame-ti-et.ethiopic-halehame-tig.ethiopic-numeric.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.georgian.grayscale.graytext.grid.groove.gujarati.gurmukhi.hand.hangul.hangul-consonant.hard-light.hebrew.help.hidden.hide.higher.highlight.highlighttext.hiragana.hiragana-iroha.horizontal.hsl.hsla.hue.hue-rotate.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.japanese-formal.japanese-informal.justify.kannada.katakana.katakana-iroha.keep-all.khmer.korean-hangul-formal.korean-hanja-formal.korean-hanja-informal.landscape.lao.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-alpha.lower-armenian.lower-greek.lower-hexadecimal.lower-latin.lower-norwegian.lower-roman.lowercase.ltr.luminosity.malayalam.manipulation.match.matrix.matrix3d.media-play-button.media-slider.media-sliderthumb.media-volume-slider.media-volume-sliderthumb.medium.menu.menulist.menulist-button.menutext.message-box.middle.min-intrinsic.mix.mongolian.monospace.move.multiple.multiple_mask_images.multiply.myanmar.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.octal.opacity.open-quote.optimizeLegibility.optimizeSpeed.oriya.oromo.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.persian.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeating-conic-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturate.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.searchfield.searchfield-cancel-button.searchfield-decoration.searchfield-results-button.searchfield-results-decoration.self-start.self-end.semi-condensed.semi-expanded.separate.sepia.serif.show.sidama.simp-chinese-formal.simp-chinese-informal.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.somali.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.square-button.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.tamil.telugu.text.text-bottom.text-top.textarea.textfield.thai.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.tibetan.tigre.tigrinya-er.tigrinya-er-abegede.tigrinya-et.tigrinya-et-abegede.to.top.trad-chinese-formal.trad-chinese-informal.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-alpha.upper-armenian.upper-greek.upper-hexadecimal.upper-latin.upper-norwegian.upper-roman.uppercase.urdu.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`),y=t(v),b=n.concat(i).concat(o).concat(c).concat(u).concat(f).concat(g).concat(v);e.registerHelper(`hintWords`,`css`,b);function x(e,t){for(var n=!1,r;(r=e.next())!=null;){if(n&&r==`/`){t.tokenize=null;break}n=r==`*`}return[`comment`,`comment`]}e.defineMIME(`text/css`,{documentTypes:r,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:h,colorKeywords:_,valueKeywords:y,tokenHooks:{"/":function(e,t){return e.eat(`*`)?(t.tokenize=x,x(e,t)):!1}},name:`css`}),e.defineMIME(`text/x-scss`,{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:_,valueKeywords:y,fontProperties:m,allowNested:!0,lineComment:`//`,tokenHooks:{"/":function(e,t){return e.eat(`/`)?(e.skipToEnd(),[`comment`,`comment`]):e.eat(`*`)?(t.tokenize=x,x(e,t)):[`operator`,`operator`]},":":function(e){return e.match(/^\s*\{/,!1)?[null,null]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?[`variable-2`,`variable-definition`]:[`variable-2`,`variable`]},"#":function(e){return e.eat(`{`)?[null,`interpolation`]:!1}},name:`css`,helperType:`scss`}),e.defineMIME(`text/x-less`,{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:_,valueKeywords:y,fontProperties:m,allowNested:!0,lineComment:`//`,tokenHooks:{"/":function(e,t){return e.eat(`/`)?(e.skipToEnd(),[`comment`,`comment`]):e.eat(`*`)?(t.tokenize=x,x(e,t)):[`operator`,`operator`]},"@":function(e){return e.eat(`{`)?[null,`interpolation`]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?[`variable-2`,`variable-definition`]:[`variable-2`,`variable`])},"&":function(){return[`atom`,`atom`]}},name:`css`,helperType:`less`}),e.defineMIME(`text/x-gss`,{documentTypes:r,mediaTypes:a,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:h,colorKeywords:_,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return e.eat(`*`)?(t.tokenize=x,x(e,t)):!1}},name:`css`,helperType:`gss`})})})),S0=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(vz()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode(`xml`,function(r,i){var a=r.indentUnit,o={},s=i.htmlMode?t:n;for(var c in s)o[c]=s[c];for(var c in i)o[c]=i[c];var l,u;function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return r==`<`?e.eat(`!`)?e.eat(`[`)?e.match(`CDATA[`)?n(m(`atom`,`]]>`)):null:e.match(`--`)?n(m(`comment`,`-->`)):e.match(`DOCTYPE`,!0,!0)?(e.eatWhile(/[\w\._\-]/),n(h(1))):null:e.eat(`?`)?(e.eatWhile(/[\w\._\-]/),t.tokenize=m(`meta`,`?>`),`meta`):(l=e.eat(`/`)?`closeTag`:`openTag`,t.tokenize=f,`tag bracket`):r==`&`?(e.eat(`#`)?e.eat(`x`)?e.eatWhile(/[a-fA-F\d]/)&&e.eat(`;`):e.eatWhile(/[\d]/)&&e.eat(`;`):e.eatWhile(/[\w\.\-:]/)&&e.eat(`;`))?`atom`:`error`:(e.eatWhile(/[^&<]/),null)}d.isInText=!0;function f(e,t){var n=e.next();if(n==`>`||n==`/`&&e.eat(`>`))return t.tokenize=d,l=n==`>`?`endTag`:`selfcloseTag`,`tag bracket`;if(n==`=`)return l=`equals`,null;if(n==`<`){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+` tag error`:`tag error`}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),`word`)}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return`string`};return t.isInAttribute=!0,t}function m(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e){return function(t,n){for(var r;(r=t.next())!=null;)if(r==`<`)return n.tokenize=h(e+1),n.tokenize(t,n);else if(r==`>`){if(e==1){n.tokenize=d;break}return n.tokenize=h(e-1),n.tokenize(t,n)}return`meta`}}function g(e){return e&&e.toLowerCase()}function _(e,t,n){this.prev=e.context,this.tagName=t||``,this.indent=e.indented,this.startOfLine=n,(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&=e.context.prev}function y(e,t){for(var n;;){if(!e.context||(n=e.context.tagName,!o.contextGrabbers.hasOwnProperty(g(n))||!o.contextGrabbers[g(n)].hasOwnProperty(g(t))))return;v(e)}}function b(e,t,n){return e==`openTag`?(n.tagStart=t.column(),x):e==`closeTag`?S:b}function x(e,t,n){return e==`word`?(n.tagName=t.current(),u=`tag`,T):o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,T(e,t,n)):(u=`error`,x)}function S(e,t,n){if(e==`word`){var r=t.current();return n.context&&n.context.tagName!=r&&o.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&v(n),n.context&&n.context.tagName==r||o.matchClosing===!1?(u=`tag`,C):(u=`tag error`,w)}return o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,C(e,t,n)):(u=`error`,w)}function C(e,t,n){return e==`endTag`?(v(n),b):(u=`error`,C)}function w(e,t,n){return u=`error`,C(e,t,n)}function T(e,t,n){if(e==`word`)return u=`attribute`,E;if(e==`endTag`||e==`selfcloseTag`){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,e==`selfcloseTag`||o.autoSelfClosers.hasOwnProperty(g(r))?y(n,r):(y(n,r),n.context=new _(n,r,i==n.indented)),b}return u=`error`,T}function E(e,t,n){return e==`equals`?D:(o.allowMissing||(u=`error`),T(e,t,n))}function D(e,t,n){return e==`string`?O:e==`word`&&o.allowUnquoted?(u=`string`,T):(u=`error`,T(e,t,n))}function O(e,t,n){return e==`string`?O:T(e,t,n)}return{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return e!=null&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;l=null;var n=t.tokenize(e,t);return(n||l)&&n!=`comment`&&(u=null,t.state=t.state(l||n,e,t),u&&(n=u==`error`?n+` error`:u)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return o.multilineTagIndentPastTag===!1?t.tagStart+a*(o.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(o.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;i;)if(i.tagName==s[2]){i=i.prev;break}else if(o.implicitlyClosed.hasOwnProperty(g(i.tagName)))i=i.prev;else break;else if(s)for(;i;){var c=o.contextGrabbers[g(i.tagName)];if(c&&c.hasOwnProperty(g(s[2])))i=i.prev;else break}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+a:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:`<!--`,blockCommentEnd:`-->`,configuration:o.htmlMode?`html`:`xml`,helperType:o.htmlMode?`html`:`xml`,skipAttribute:function(e){e.state==D&&(e.state=T)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:e.type==`closeTag`}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}}),e.defineMIME(`text/xml`,`xml`),e.defineMIME(`application/xml`,`xml`),e.mimeModes.hasOwnProperty(`text/html`)||e.defineMIME(`text/html`,{name:`xml`,htmlMode:!0})})})),C0=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(vz()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){e.defineMode(`diff`,function(){var e={"+":`positive`,"-":`negative`,"@":`meta`};return{token:function(t){var n=t.string.search(/[\t ]+?$/);if(!t.sol()||n===0)return t.skipToEnd(),(`error `+(e[t.string.charAt(0)]||``)).replace(/ $/,``);var r=e[t.peek()]||t.skipToEnd();return n===-1?t.skipToEnd():t.pos=n,r}}}),e.defineMIME(`text/x-diff`,`diff`)})})),w0=l(b0(),1);x0(),S0(),C0();var T0='let name = "world";\n\nconsole.log(`Hello, ${name}!`);',E0=Function(`return num => num + 5`)(),D0=Function(`return () => alert("Hello world!")`)(),O0=`/src/views/text/source.js`,k0=`diff --git a${O0} b${O0}
|
|
395
|
+
index 302b02e..62ea1be 100644
|
|
396
|
+
--- a${O0}
|
|
397
|
+
+++ b${O0}
|
|
398
|
+
@@ -18,7 +18,8 @@ CodeMirror.modeToMime = {
|
|
399
|
+
html: 'text/html',
|
|
400
|
+
css: 'text/css',
|
|
401
|
+
scss: 'text/x-scss',
|
|
402
|
+
- less: 'text/x-less'
|
|
403
|
+
+ less: 'text/x-less',
|
|
404
|
+
+ diff: 'text/x-diff'
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
function codeMirrorHighlight(modespec, host) {`;function A0(){let e=new Set,t=new Map,n=e=>{let n=yz.default.resolveMode(e);return[...t.keys()].find(e=>EX(e,n))||(t.set(n,{name:new Set,mime:new Set}),n)};for(let[r,i]of Object.entries(yz.default.modeToMime)){let a=t.get(n(i));a.mime.add(i),a.name.add(r),e.add(r)}for(let[r,i]of Object.entries(yz.default.mimeModes)){let a=t.get(n(r));a.mime.add(r),typeof i==`string`&&(a.name.add(i),e.add(i))}for(let[n]of Object.entries(yz.default.modes))if(!e.has(n)){let e=yz.default.modes[n];t.has(e)||t.set(e,{name:new Set,mime:[]}),t.get(e).name.add(n)}return[...t.values()].map(e=>({name:[...e.name],mime:[...e.mime]}))}var j0={demo:{view:`source`,syntax:`js`,source:T0},examples:[{title:`Supported syntaxes`,beforeDemo:['md:"Following values (for both `name` and `mime`) are supported for `syntax` option:"',`html:"<br>"`,{view:`table`,data:A0,cols:{name:{content:`comma-list:name`},mime:{content:`comma-list:mime`}}},`html:"<br>"`,`md:"More syntaxes may be added via \`import 'codemirror/mode/[name]/[name]';\`"`],source:!1},{title:`Diff syntax example`,demo:{view:`source`,syntax:`diff`,source:k0}},{title:`Max content size for syntax highlight`,highlightProps:[`maxSourceSizeToHighlight`],beforeDemo:['md:"By default a syntax highlighing is not appling to a source longer than 250Kb. Option `maxSourceSizeToHighlight` is using to change max size of source to be syntax highlighted."'],demo:{view:`source`,source:T0,syntax:`js`,maxSourceSizeToHighlight:4}},{title:`Custom line numbers`,highlightProps:[`lineNum`],demo:[{view:`source`,source:T0,syntax:`js`,lineNum:E0},{view:`source`,source:T0,syntax:`js`,lineNum:`==> $ + 12345`}]},{title:`Hide line numbers`,highlightProps:[`lineNum`],beforeDemo:['md:"Pass falsy value to `lineNum` option to hide line numbers:"'],demo:{view:`source`,source:T0,syntax:`js`,lineNum:!1}},{title:`Customise copy source button`,beforeDemo:['md:"By default, the `source` view includes a \\"copy to clipboard\\" button. To customize its behavior use the `actionCopySource` option, which accepts the following values:\\n- `true` (default) – displays a button that copies the entire source to the clipboard;\\n- A function `({ source, syntax, lineNum, refs, ... }) => string` – displays a button that calls the provided function on click to determine the text to copy;\\n- Anything else – hides the copy button, i.e. the button is not rendered."'],highlightProps:[`actionCopySource`],demo:[{view:`source`,actionCopySource:`==> source[0:10]`,source:`// In this example, the copy button copies only the first 10 characters of the source`},{view:`source`,actionCopySource:!1,source:`// This example demonstrates how to disable the default copy button`}]},{title:`Additional action buttons`,highlightProps:[`actionButtons`],demo:{view:`source`,actionButtons:[{view:`button`,content:`text:"Say \\"Hello world\\""`,onClick:D0}],source:T0,syntax:`js`}},{title:`Prelude and postlude slots`,highlightProps:[`prelude`,`postlude`],demo:{view:`source`,prelude:[`text:"Prelude:"`,`struct:{ data: $, context: # }`],postlude:[`text:"Postlude:"`,`struct:{ data: $, context: # }`],source:T0,syntax:`js`}},{title:`Highlight ranges`,highlightProps:[`ranges`],beforeDemo:{view:`md`,source:["The `ranges` option (formerly `refs`) allows highlighting specific parts of the source text or turning them into links. The `ranges` value must be an array of objects with the following fields:",`
|
|
408
|
+
`,"- `range` (required) - an array of two numbers representing the start and end offsets of the span","- `className` - class name(s) for the wrapping element. This can be a string (a space-separated list of class names) or an array of strings. Predefined class names include `def`, `ref`, `global-ref`, and `error`, each specifying a particular style for the span.","- `href` - when specified, the range becomes a link (`<a>`), otherwise, the range is a regular span (`<span>`)","- `tooltip` - config for a [tooltip](#views-showcase&!anchor=tooltips), similar to tooltips in other views","- `marker` - a value added to the wrapping element as a `data-marker` attribute"]},demo:{view:`source`,source:`let span = "def + ref + global-ref + error";
|
|
409
|
+
let link = "def + ref + global-ref + error";
|
|
410
|
+
|
|
411
|
+
// span with tooltip`,syntax:`js`,ranges:[{range:[4,8]},{range:[12,15],className:`def`},{range:[18,21],className:`ref`},{range:[24,34],className:`global-ref`},{range:[37,42],className:`error`},{range:[49,53],href:`#`},{range:[57,60],href:`#`,className:`def`},{range:[63,66],href:`#`,className:`ref`},{range:[69,79],href:`#`,className:`global-ref`},{range:[82,87],href:`#`,className:`error`},{range:[104,111],href:`#example`,tooltip:{position:`trigger`,content:"text:`Link to ${href}`"}}]}},{title:`Marks`,highlightProps:[`marks`],beforeDemo:{view:`md`,source:["The `marks` option allows injecting visual or text marks at specific points in the source text. The `marks` value must be an array of objects with the following fields:",`
|
|
412
|
+
`,"- `offset` (required) - the offset in the source where the mark is injected.","- `kind` - the type of mark, which can be one of the following: `span` (default), `dot`, `self` (self value), `nested` (nested value), `total` (total value), or `none`","- `className` - class name(s) for the wrapping element. This can be a string (a space-separated list of class names) or an array of strings. Predefined class names include `def`, `ref`, `global-ref`, `error`, and `inactive`, each specifying a particular style for the mark.","- `href` - when specified, the mark becomes a link (`<a>`), otherwise, it is a regular span (`<span>`)","- `content` - view config for content (e.g., `'text:\"hello\"'` or `{ view: 'name', ... }`). If not specified, `kind` is ignored and defaults to `dot` (since content is optional for marks of type `dot`)","- `prefix` (ignored when `kind` is `dot`) - text to display before the content of mark, styled with a dimmed color ","- `postfix` (ignored when `kind` is `dot`) - text to display after the content of mark, styled with a dimmed color","- `tooltip` - config for a [tooltip](#views-showcase&!anchor=tooltips), similar to tooltips in other views","- `marker` - a value added to the wrapping element as a `data-marker` attribute"]},demo:{view:`source`,source:`let span = "def + ref + global-ref + error";
|
|
413
|
+
let link = "def + ref + global-ref + error";
|
|
414
|
+
|
|
415
|
+
// kinds: self nested total none
|
|
416
|
+
// kind="dot": default def ref global-ref error inactive
|
|
417
|
+
// kind="dot" with tooltip:
|
|
418
|
+
// kind="dot" with href:
|
|
419
|
+
// mark with tooltip`,syntax:`js`,marks:[{offset:4},{offset:4,kind:`dot`,content:`text:"dot with text"`},{offset:4,content:`text:"mark"`},{offset:12,className:`def`,content:`text:"def"`},{offset:18,className:`ref`,content:`text:"ref"`},{offset:24,className:`global-ref`,content:`text:"global-ref"`},{offset:37,className:`error`,content:`text:"error"`},{offset:49,href:`#`},{offset:49,href:`#`,kind:`dot`,content:`text:"dot with text"`},{offset:49,href:`#`,content:`text:"link"`},{offset:57,href:`#`,className:`def`,content:`text:"def"`},{offset:63,href:`#`,className:`ref`,content:`text:"ref"`},{offset:69,href:`#`,className:`global-ref`,content:`text:"global-def"`},{offset:82,href:`#`,className:`error`,content:`text:"error"`},{offset:101,kind:`self`,content:`text:"123"`,href:`#`,postfix:`ms`},{offset:106,kind:`nested`,content:`text:"123"`,postfix:`ms`},{offset:113,kind:`total`,content:`text:"123"`,postfix:`ms`},{offset:119,kind:`none`,content:`text:"none"`},{offset:123,kind:`none`,content:`text:"⚠️"`},{offset:123,kind:`none`,content:`text:"none"`,prefix:`prefix`,postfix:` postfix`,href:`#test`},{offset:139,kind:`dot`},{offset:147,kind:`dot`,className:`def`},{offset:151,kind:`dot`,className:`ref`},{offset:155,kind:`dot`,className:`global-ref`},{offset:166,kind:`dot`,className:`error`},{offset:172,kind:`dot`,className:`inactive`},...[``,`def`,`ref`,`global-ref`,`error`,`inactive`].map(e=>({offset:209,kind:`dot`,className:e,tooltip:`text:`+JSON.stringify(e||`default`)})),...[``,`def`,`ref`,`global-ref`,`error`,`inactive`].map(e=>({offset:235,kind:`dot`,className:e,href:`#`+(e||`default`)})),{offset:256,href:`#example`,content:`text:"show tooltip"`,tooltip:{position:`trigger`,content:"text:`Link to ${href}`"}}]}}]};yz.default.modeToMime={js:`application/javascript`,ts:`application/typescript`,typescript:`application/typescript`,json:`application/json`,html:`text/html`,css:`text/css`,scss:`text/x-scss`,less:`text/x-less`};function M0(e,t){let n=yz.default.getMode(yz.default.defaults,{name:yz.default.modeToMime[e]||e,isDiscoveryViewDefined:e=>t.view.isDefined(e)||t.textView.isDefined(e)});return(e,t)=>{let r=yz.default.startState(n),i=e.split(/(\n|\r\n?)/),a=0;for(let e=0;e<i.length;e++){if(e%2==0){let o=new yz.default.StringStream(i[e],4,{lookAhead:t=>i[e+t],baseToken:function(){}});for(;!o.eol();){let e=n.token(o,r);e&&t(a+o.start,a+o.pos,e),o.start=o.pos}}a+=i[e].length}}}function N0(e,t){let n=e&&e.className,r=Array.isArray(n)?n.join(` `):typeof n==`string`&&n,i=t&&r?[t,r].join(` `):t||r||``;return i?` class="${i}"`:``}function P0(e,t=`spotlight`){return`${N0(e,t)}${e.marker?` data-marker="${e.marker}"`:``}${typeof e.tooltipId==`number`?` data-tooltip-id="${e.tooltipId}"`:``}`}function F0(e,t=`mark`){let n=e.prefix??([`self`,`nested`,`total`].includes(e.kind)?e.kind[0].toUpperCase():void 0),r=e.postfix??void 0;return P0(e,t)+` data-render-id=${e.renderId}${e.kind?` data-kind="${e.kind}"`:``}${n===void 0?``:` data-prefix="${fz(String(n))}"`}${r===void 0?``:` data-postfix="${fz(String(r))}"`}`}var I0={html:{open({data:e}){switch(e.type){case`link`:return`<a href=${JSON.stringify(e.href)}${P0(e,`spotlight`)}>`;case`span`:case`spotlight`:return`<span${P0(e,`spotlight`)}>`}},close({data:e}){switch(e.type){case`link`:return`</a>`;case`span`:case`spotlight`:return`</span>`}}}},L0={html:{open({data:e}){switch(e.type){case`link`:return`<a href=${JSON.stringify(e.href)}${F0(e,`mark`)}>`;case`span`:return`<span${F0(e,`mark`)}>`}},close({data:e}){switch(e.type){case`link`:return`</a>`;case`span`:return`</span>`}}}},R0=`is not array? | {
|
|
420
|
+
source: #.props has no 'source' ? is string ?: content is string ? content : source,
|
|
421
|
+
syntax,
|
|
422
|
+
lineNum is function ?: is not undefined ? bool() : true,
|
|
423
|
+
ranges: #.props.refs or refs | is array ?: undefined,
|
|
424
|
+
marks is array ?: null,
|
|
425
|
+
maxSourceSizeToHighlight is number ?: 250 * 1024, // 250Kb
|
|
426
|
+
actionButtons: undefined,
|
|
427
|
+
actionCopySource is undefined ? true,
|
|
428
|
+
prelude: undefined,
|
|
429
|
+
postlude: undefined
|
|
430
|
+
} | overrideProps()`;function z0(e){e.view.define(`source`,async function(t,n,r,i){let a=t.appendChild($(`div`,`view-source__prelude`)),o=t.appendChild($(`div`,`view-source__content`)),s=t.appendChild($(`div`,`view-source__postlude`)),c=new Map,l=new Map,u=[],d=[],{source:f,syntax:p,lineNum:m=!0,ranges:h,marks:g,maxSourceSizeToHighlight:_,actionButtons:v,actionCopySource:y,prelude:b,postlude:x}=n,S=typeof r==`string`?{source:r}:r,C={...i,sourceViewProps:{source:f,syntax:p,lineNum:m,ranges:h,marks:g,maxSourceSizeToHighlight:_}};if(typeof f!=`string`)return;f.length<_&&d.push([M0(p,e),{html:{open({data:e}){return`<span class="token `+e+`">`},close(){return`</span>`}}}]),Array.isArray(h)&&d.push([(t,r)=>h.forEach(t=>{if(!t||typeof t!=`object`){e.logger.warn(`Bad value for an entry in "source" view props.ranges, must be an object`,{props:n,entry:t});return}let i=t.type?t.type===`spotlight`?`span`:t.type:t.href?`link`:`span`,a=t.range,o;if(![`link`,`span`].includes(i)){e.logger.warn(`Bad type "${i}" of an entry in "source" view props.ranges`,{props:n,ref:t});return}if(!a){e.logger.warn(`Missed range for an entry in "source" view props.ranges`,{props:n,entry:t});return}t.tooltip&&c.set(o=c.size,t),r(t.range[0],t.range[1],{...t,type:i,tooltipId:o})}),I0]),Array.isArray(g)&&d.push([(t,r)=>g.forEach(t=>{if(!t||typeof t!=`object`){e.logger.warn(`Bad value for an entry in "source" view props.mark, must be an object`,{props:n,mark:t});return}let i=t.content?!t.kind||[`dot`,`self`,`nested`,`total`,`none`].includes(t.kind)?t.kind||`span`:void 0:`dot`,a=typeof t.offset==`number`&&isFinite(t.offset)?Math.max(0,Math.round(t.offset)):void 0,o;if(typeof i!=`string`){e.logger.warn(`Bad "kind" value for an entry in "source" view props.marks`,{props:n,mark:t});return}if(typeof a!=`number`){e.logger.warn(`Bad "offset" value for an entry in "source" view props.marks`,{props:n,mark:t});return}t.tooltip&&c.set(o=c.size,t);let s={...t,type:typeof t.href==`string`?`link`:`span`,kind:i,renderId:l.size,tooltipId:o};l.set(s.renderId,s),r(a,a,s)}),L0]);let w=typeof m==`function`?m:e=>e+1;if(o.innerHTML=(m?`<div class="view-source__lines">`+f.split(/\r\n?|\n/g).map((e,t)=>`<span>`+w(t)+`</span>`).join(``)+`</div>`:``)+`<div class="view-source__source">${(0,w0.default)(d,`html`)(f)}</div>`,l.size)for(let e of o.querySelectorAll(`.mark[data-render-id]`)){let t=l.get(Number(e.dataset.renderId));t.content&&u.push(this.render(e,t.content,t,C))}let T=$(`div`,`view-source__action-buttons`),E=y===!0?({source:e})=>e:typeof y==`function`?y:null,D=typeof E==`function`?{view:`button`,className:`copy`,content:[],async onClick(e){clearTimeout(e.copiedTimer),await u$(String(E(C.sourceViewProps))),e.classList.add(`copied`),e.copiedTimer=setTimeout(()=>e.classList.remove(`copied`),1250)}}:null;o.prepend(T),await e.view.render(T,[v,D],S,C);for(let e of o.querySelectorAll(`:scope [data-tooltip-id]`)){let t=c.get(Number(e.dataset.tooltipId));delete e.dataset.tooltipId,this.tooltip(e,t.tooltip,t,i)}b&&await e.view.render(a,b,S,C),x&&await e.view.render(s,x,S,C),u.length&&await Promise.all(u)},{props:R0,usage:j0,tag:`pre`})}var B0={demo:{view:`text`,data:`"Hello world!"`},examples:[{title:`Shorthand usage`,view:`text:"Hello world!"`}]},V0=`{
|
|
431
|
+
text: #.props has no 'text'?
|
|
432
|
+
} | overrideProps()`;function H0(e){e.view.define(`text`,function(e,{text:t}){e.appendChild(document.createTextNode(String(t)))},{tag:!1,props:V0,usage:B0})}var U0=[`char`,`word`,`wordws`,`sentence`,`line`],W0=[`both`,`added`,`removed`],G0=`The sun is shining brightly. Birds are singing in the trees.`,K0=`The quick brown fox jumps over the lazy dog. It lands softly and runs away.
|
|
433
|
+
`+G0,q0=`A quick brown fox jumped over a lazy dog. It landed softly, then ran away.
|
|
434
|
+
`+G0,J0={demo:{view:`text-diff`,before:`Hello world!`,after:`Hello Discovery.js!`},examples:[{title:`Types`,demoData:U0.map(e=>({type:e,before:K0,after:q0})),demo:{view:`table`,cols:[{header:`Type`,content:[`text:type`,{view:`text`,when:`type="wordws"`,text:` (default)`}]},{header:`Preview`,content:`text-diff{ type }`}]}},{title:`Delta kinds`,demoData:W0.map(e=>({delta:e,before:K0,after:q0})),demo:{view:`table`,cols:[{header:`Type`,content:[`text:delta`,{view:`text`,when:`delta="both"`,text:` (default)`}]},{header:`Preview`,content:`text-diff{ delta }`}]}}]},Y0=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},X0=new class extends Y0{};function Z0(e,t,n){return X0.diff(e,t,n)}function Q0(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function $0(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function e2(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function t2(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function n2(e,t){return e2(e,t,``)}function r2(e,t){return t2(e,t,``)}function i2(e,t){return t.slice(0,a2(e,t))}function a2(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function o2(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function s2(e,t){if(t)return l2(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function c2(e,t){if(t)return l2(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function l2(e,t){if(!t)return[c2(e),s2(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=o2(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var u2=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,d2=RegExp(`[${u2}]+|\\s+|[^${u2}]`,`ug`),f2=new class extends Y0{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=o2(e,r)}else n=e.match(d2)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&m2(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&m2(n,i,r,null,t.intlSegmenter),e}};function p2(e,t,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?g2(e,t,n):f2.diff(e,t,n)}function m2(e,t,n,r,i){if(t&&n){let[a,o]=l2(t.value,i),[s,c]=l2(n.value,i);if(e){let r=Q0(a,s);e.value=t2(e.value,s,r),t.value=n2(t.value,r),n.value=n2(n.value,r)}if(r){let e=$0(o,c);r.value=e2(r.value,c,e),t.value=r2(t.value,e),n.value=r2(n.value,e)}}else if(n){if(e){let e=c2(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=c2(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=c2(r.value,i),[a,o]=l2(t.value,i),s=Q0(n,a);t.value=n2(t.value,s);let c=$0(n2(n,s),o);t.value=r2(t.value,c),r.value=e2(r.value,n,c),e.value=t2(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=c2(r.value,i),n=i2(s2(t.value,i),e);t.value=r2(t.value,n)}else if(e){let n=i2(s2(e.value,i),c2(t.value,i));t.value=n2(t.value,n)}}var h2=new class extends Y0{tokenize(e){let t=RegExp(`(\\r?\\n)|[${u2}]+|[^\\S\\n\\r]+|[^${u2}]`,`ug`);return e.match(t)||[]}};function g2(e,t,n){return h2.diff(e,t,n)}var _2=new class extends Y0{constructor(){super(...arguments),this.tokenize=y2}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
435
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
436
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
437
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
438
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function v2(e,t,n){return _2.diff(e,t,n)}function y2(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
439
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function b2(e){return e==`.`||e==`!`||e==`?`}var x2=new class extends Y0{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(b2(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}};function S2(e,t,n){return x2.diff(e,t,n)}new class extends Y0{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Y0{constructor(){super(...arguments),this.tokenize=y2}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(C2(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function C2(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=C2(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=C2(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Y0{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var w2={char:Z0,word:p2,wordws:g2,sentence:S2,line:v2},T2=`is not array? | {
|
|
440
|
+
before,
|
|
441
|
+
after,
|
|
442
|
+
delta: undefined,
|
|
443
|
+
type: undefined
|
|
444
|
+
} | overrideProps() | {
|
|
445
|
+
before is string ?: '',
|
|
446
|
+
after is string ?: '',
|
|
447
|
+
delta | $ in ['added', 'removed', 'both'] ?: 'both',
|
|
448
|
+
type | $ in ${JSON.stringify(Object.keys(w2))} ?: 'wordws'
|
|
449
|
+
}`;function E2(e){e.view.define(`text-diff`,function(e,t){let{type:n,before:r,after:i,delta:a}=t,o=w2[n](r,i),s=a===`both`||a===`added`,c=a===`both`||a===`removed`;for(let{added:t,removed:n,value:r}of o){let i=e;if(t||n){if(t?!s:!c)continue;i=e.appendChild($(`span`,t?`added`:`removed`))}i.append(r)}},{props:T2,usage:J0})}var D2={demo:{view:`text-match`,data:{text:`I am matched text or a text with matches!`,match:/match/}},examples:[{title:`Raw string as match`,demo:{view:`text-match`,data:{text:`I am matched text or a text with matches!`,match:`match`}}},{title:`Using with a link`,demo:{view:`link`,data:{href:`#`},content:`text-match:{ text: "Test link", match: /\\w+/i }`}},{title:`Various configurations`,demo:{view:`table`,cols:[{header:`text-match`,content:`text-match`},{header:`Config`,content:`struct`}],data:[null,{},{},{match:`test`},{match:`Test`},{match:`test`,ignoreCase:!0},{match:`Test`,ignoreCase:!0},{match:/test/},{match:/test/g},{match:/test/i},{match:/test/,ignoreCase:!0},{match:/test/g,ignoreCase:!0}].map((e,t)=>t>1?{text:`test Test`,...e}:e)}}]},O2=$(`span`,`view-text-match`),k2=`is not array? | {
|
|
450
|
+
text: #.props has no 'text' ? text,
|
|
451
|
+
match,
|
|
452
|
+
ignoreCase: ignoreCase or false
|
|
453
|
+
} | overrideProps()`;function A2(e){e.view.define(`text-match`,function(e,t){let{text:n,match:r,ignoreCase:i}=t;c$(String(n),r,t=>e.append(t),t=>e.appendChild(O2.cloneNode()).append(t),i)},{tag:!1,props:k2,usage:D2})}var j2={demo:{view:`text-numeric`,data:'"Like a `text` view but adds a thousands separator to integer part of numbers, e.g. 12345678 or 12345.67890"'},examples:[{title:`Shorthand usage`,view:`text-numeric:1234567`}]},M2=`{
|
|
454
|
+
text: #.props has no 'text'?
|
|
455
|
+
} | overrideProps()`;function N2(e){e.view.define(`text-numeric`,function(e,{text:t}){e.innerHTML=pz(t)},{tag:`span`,props:M2,usage:j2})}var P2={beforeDemo:['md:"A non-visual view used to group views, manage their visibility, or explicitly define data and context for nested views. In the example, the `context` view sets up specific data and context, allowing nested views (`content`) to utilize these shared definitions directly:"'],demo:{view:`context`,data:{name:`World`,age:`1000 years`},context:`{ ...#, greeting: "Hello" }`,content:["text:`${#.greeting}, ${name}!`",`table`]},examples:[{title:`Using with modifiers`,demo:{view:`context`,modifiers:[`h2:"Modifiers"`,{view:`input`,name:`inputValue`},{view:`select`,name:`selectValue`,data:[`foo`,`bar`,`baz`]}],content:[`h2:"Values"`,`struct{ expanded: 1, data: # }`]}}]},F2=`#.props | {
|
|
456
|
+
modifiers is array ?: is truthy ? [$] : [],
|
|
457
|
+
content,
|
|
458
|
+
proxy.bool(),
|
|
459
|
+
onInit,
|
|
460
|
+
onChange
|
|
461
|
+
}`;function I2(e){e.view.define(`context`,async function(t,n,r,i){let{modifiers:a=[],content:o=[],proxy:s,onInit:c,onChange:l}=n,u=i,d=null,f=!1;await this.render(t,this.composeConfig(a,{onInit:g,onChange:g}),r,i);let p=t.appendChild(document.createComment(`{ view: "context" } content start`)),m=t.appendChild(document.createComment(`{ view: "context" } content end`));s&&(c||l)&&(o=this.composeConfig(o,{onInit:c,onChange:l})),f=!0,await h();async function h(){let t=m.previousSibling;for(;t&&t!==p;)t=t.previousSibling,t.nextSibling.remove();let n=d=document.createDocumentFragment();await e.view.render(n,o,r,u),n===d&&(e.view.adoptFragment(n,p),p.after(n),d=null)}function g(e,t){t&&(!oz(u,t)||u[t]!==e)&&(u={...u,[t]:e},f?(h(),s&&typeof l==`function`&&l(e,t)):typeof c==`function`&&c(e,t))}},{tag:!1,props:F2,usage:P2})}var L2={beforeDemo:['md:"A non-visual view that conditionally renders a single matching section from the provided content. It sequentially evaluates each item\'s `when` expression and renders the content of the first truthy condition. If an item has no `when` property, its condition defaults to truthy, enabling unconditional rendering, often used as a fallback or default content."'],demo:{view:`switch`,content:[{when:`expr`,content:'text:"Renders when `expr` is truthy"'},{content:'text:"Renders when all other `when` conditions are falsy"'}]},examples:[{title:`Using with context and a modifier`,demo:{view:`context`,modifiers:{view:`tabs`,tabs:[`foo`,`bar`,`baz`],name:`section`},content:{view:`switch`,content:[{when:`#.section="foo"`,content:'text:"Content for `foo`"'},{when:`#.section="bar"`,content:'text:"Content for `bar`"'},{content:'text:"No content is found for `" + #.section + "`"'}]}}}]};function R2(e){e.view.define(`switch`,function(t,n,r,i){let{content:a}=n,o=`alert-warning:"No case choosen"`;if(Array.isArray(a))for(let t=0;t<a.length;t++){let n=a[t];if(n&&e.queryBool(n.when||!0,r,i)){o=`data`in n?{view:`context`,data:n.data,content:n.content}:n.content;break}}return e.view.render(t,o,r,i)},{tag:!1,usage:L2})}var z2={beforeDemo:['md:"The `text-render` view renders data as text using the `Model#textView` API. For a full list of available text views, refer to the [`text`](#views-showcase&render=text) section."'],demo:{view:`text-render`,content:[`text:"hello!"`,{view:`ul`,data:[1,2,3,4],item:`text:"item #" + $`},{view:`table`,data:[{name:`foo`,size:1e3},{name:`bar`,size:123},{name:`baz`,size:34555}]}]}};function B2(e){e.view.define(`text-render`,async function(t,n,r,i){let{content:a}=n,o=await e.textView.render(`block`,a,r,i);t.append(e.textView.serialize(o).text)},{tag:`pre`,usage:z2}),e.view.define(`text-render-tree`,async function(t,n,r,i){let{content:a,expanded:o=2}=n,s=await e.textView.render(`block`,a,r,i);return this.render(t,{view:`struct`,expanded:o},e.textView.cleanUpRenderTree(s))},{tag:!1})}function V2(e,t,n){for(let r in e){if(!oz(e,r))continue;let i;n.dictMode?(i=n.dictMode,i.count++,i.keys.add(r)):n.properties.has(r)?(i=n.properties.get(r),i.count++):(i={count:1,map:Object.create(null)},n.properties.set(r,i)),H2(e[r],t-1,i.map)}}function H2(e,t,n=Object.create(null)){let r=e===null?`null`:cY(e)?`array`:lY(e)?`set`:typeof e;switch(r){default:r in n||(n[r]=new Map),n[r].set(e,(n[r].get(e)||0)+1);break;case`object`:`object`in n||(n.object=new Map,n.object.count=0,n.object.properties=t?new Map:null,n.object.dictMode=null,n.object.sortKeys=!1),n.object.count++,n.object.has(e)?n.object.set(e,n.object.get(e)+1):(n.object.set(e,1),t&&V2(e,t,n.object));break;case`array`:`array`in n||(n.array=new Map,n.array.count=0,n.array.map=Object.create(null)),n.array.count++,n.array.set(e,(n.array.get(e)||0)+1);for(let r=0;r<e.length;r++)H2(e[r],t,n.array.map);break;case`set`:`set`in n||(n.set=new Map,n.set.count++,n.set.map=Object.create(null)),n.set.count++,n.set.set(e,(n.set.get(e)||0)+1);for(let r of e)H2(r,t,n.set.map)}return n}var U2=[`rgba(83,211,75,0.75)`,`rgba(241,235,44,0.75)`,`rgba(244,152,99,0.75)`,`rgba(148,99,244,0.75)`,`rgba(44,132,241,0.75)`,`rgba(233,117,117,0.75)`,`rgba(85,187,155,0.75)`,`rgba(151,147,99,0.75)`,`rgba(216,107,196,0.75)`,`rgba(108,204,227,0.75)`,`rgba(164,164,164,0.75)`],W2=[`null`,`undefined`,`string`,`number`,`bigint`,`boolean`,`symbol`,`function`,`array`,`set`,`object`];function G2(e,t,n,r,i=[],a=``,o=null){Object.keys(t).sort((e,t)=>W2.indexOf(e)-W2.indexOf(t)).forEach((s,c,l)=>{switch(c>0&&e.append(` | `),s){default:{let a=e.appendChild($(`span`,`type`,s));n.set(a,{type:`type`,context:r,path:i,stat:t,name:s});break}case`object`:{let c=t[s],{properties:u,dictMode:d,sortKeys:f}=c;if(u===null){n.set(e.appendChild($(`span`,`expand`,`{…}`)),{type:`expand`,context:r,path:i,stat:t,map:t[s],offset:a});break}if(u.size===0){e.appendChild($(`span`,`object`,`{}`));break}let p=c.size,m=d?[[`[key]`,d]]:[...u.entries()],h=a+` `,g=e.appendChild($(`span`,`object`,[`{`,$(`span`,{"data-action":`collapse`})])),_=$(`div`,{class:`object-entries`,style:`--object-entries-offset: ${a.length}`});u.size>1&&(g.appendChild($(`span`,{title:`Toggle dictionary mode (collapse all the values in a single signature)`,"data-action":`dict-mode`,"data-enabled":d!==null})),m.some(([e],t)=>t!==0&&e<m[t-1][0])&&g.appendChild($(`span`,{title:`Toggle keys sorting`,"data-action":`sort-keys`,"data-enabled":f})),f&&m.sort(([e],[t])=>e<t?-1:+(e>t))),n.set(g,{type:`shape`,context:r,path:i,map:t[s],offset:a}),(p>1||l.length>1||o!==null&&Object.keys(o).length>1)&&(g.appendChild($(`span`,`count`)).dataset.value=String(p));for(let[e,{count:a,map:o}]of m){let s=$(`span`,`property`,[e]);n.set(s,{type:`property`,context:r,path:i,stat:t,name:e,map:o}),_.append(h),_.append(s),a!==p&&d===null&&s.append($(`span`,`optional`,`?`)),_.append(`: `),G2(_,o,n,r,i.concat(d?`*`:e),h),_.append(`;
|
|
462
|
+
`)}g.append(_),g.append(a,`}`);break}case`array`:e.append(`[`),G2(e,t[s].map,n,r,i,a),e.append(`]`);break;case`set`:e.append(`Set(`),G2(e,t[s].map,n,r,i,a),e.append(`)`)}})}function K2(e,t){return e.toFixed(t).replace(/\.?0+$/,``)}function q2(e){return[Math.cos(2*Math.PI*e),Math.sin(2*Math.PI*e)]}function J2(e){let t=0;return[`<svg viewBox="-1 -1 2 2" class="pie">`,...e.map(e=>{let[n,r]=q2(t),[i,a]=q2(t+=e.percent),o=+(e.percent>.5);return`<path d="${[`M ${n} ${r}`,`A 1 1 0 ${o} 1 ${i} ${a}`,`L 0 0`].join(` `)}" fill="${e.color}" stroke="black" stroke-width=".0025"/>`}),`</svg>`].join(`
|
|
463
|
+
`)}function Y2(e){let t=0;for(let n in e)e[n].forEach(e=>t+=e);return t}function X2(e){let t=Object.create(null);for(let n in e)t[n]=0,e[n].forEach(e=>t[n]+=e);return t}function Z2(e,t,n){let{context:r,path:i,stat:a,name:o}=t,s=a.object,{map:c,count:l}=s.dictMode||s.properties.get(o),u=s.dictMode?s.dictMode.count:s.size,d={name:o,path:n.pathToQuery(i),total:u,count:l,percent:K2(100*l/u,1)+`%`};n.view.render(e,[{view:`block`,when:`path`,className:`path`,content:`text:path`},{view:`h1`,className:`property`,content:[`text:name`,{view:`html`,when:`count != total`,data:`"<span class=\\"usage-stat optional\\">" + (
|
|
464
|
+
"(in <span class=\\"num\\">" + count + "</span> of <span class=\\"num\\">" + total + "</span> objects, <span class=\\"num\\">" + percent + "</span>)"
|
|
465
|
+
) + "</span>"`}]}],d,r),Q2(e,{context:r,map:c,count:l},n)}function Q2(e,{context:t,map:n,count:r},i){let a=X2(n),o=[],s=W2.filter(e=>e in n);Object.entries(a).sort(([,e],[,t])=>t-e).forEach(([e,t],n)=>{o.push({name:fz(e),count:t,percent:t/r,percent100:K2(100*t/r,1),color:U2[n]})}),i.view.render(e,{view:`block`,when:`typeStat.size() > 1`,data:`typeStat`,className:`pie-stat`,content:[{view:`block`,content:{view:`html`,data:J2}},{view:`block`,content:[`html:"<span class=\\"list-header\\">Types usage:</span>"`,{view:`list`,item:`html:
|
|
466
|
+
"<span class=\\"dot\\" style=\\"--size: 10px; background-color: " + color + "\\"></span> " +
|
|
467
|
+
"<span class=\\"caption\\">" + name + "</span>" +
|
|
468
|
+
"<span class=\\"times\\"> × " + count + " (" + percent100 + "%)</span>"
|
|
469
|
+
`}]}]},o,t),s.forEach(r=>$2(e,{context:t,name:r,stat:n},i))}function $2(e,t,n){let r=t.context,i=t.stat[t.name],a=Y2(t.stat),o=[],s=[],c;switch(t.name){case`number`:{let e=[],n=0,r=0,a=0,s=1/0,l=-1/0;i.forEach((t,i)=>{e.push({count:t,value:i}),n+=i*t,r+=t,t>1&&a++,i<s&&(s=i),i>l&&(l=i)}),c={type:t.name,count:r,distinct:i.size,duplicated:a,min:s,max:l,sum:n,avg:K2(n/r,3),values:e.sort((e,t)=>t.count-e.count||e.value-t.value)},c.distinct>1&&o.push({view:`block`,className:`overview-stat`,content:`html:
|
|
470
|
+
"range: (min) <span class=\\"num\\">" + min + "</span> ... " +
|
|
471
|
+
"<span class=\\"num\\">" + max + "</span> (max), " +
|
|
472
|
+
"avg: <span class=\\"num\\">" + avg + "</span>"
|
|
473
|
+
`});break}default:{let e=[],n=0,r=0;i.forEach((t,i)=>{e.push({count:t,value:i}),n+=t,t>1&&r++}),c={type:t.name,count:n,distinct:i.size,duplicated:r,values:t.name===`object`||t.name===`array`||t.name===`set`?e.sort((e,t)=>t.count-e.count):e.sort((e,t)=>t.count-e.count||e.value>t.value||-(e.value<t.value))};break}}if(t.name!==`undefined`&&t.name!==`null`){if(o.unshift({view:`block`,className:`overview-stat`,content:[`html:"<span class=\\"num\\">" + count + "</span> " + (count > 1 ? "values, " : "value")`,{view:`switch`,when:`count > 1`,content:[{when:`distinct = 1`,content:`text:"a single unique value:"`},{when:`distinct = count`,content:`text:"all unique, no duplicates"`},{content:[`html:"<span class=\\"num\\">" + distinct + "</span> unique, "`,`html:duplicated = distinct ? "all occur more than once" : "<span class=\\"num\\">" + duplicated + "</span> occur more than once"`]}]}]}),c.values.length>1&&c.duplicated&&t.name!==`object`&&t.name!==`set`&&t.name!==`array`){let e=[],t=c.values.length===10?10:Math.min(9,c.values.length),r=0;for(let n=0;n<t;n++){let{count:t,value:i}=c.values[n];r+=t,e.push({name:fz(String(i)),count:t,percent:t/c.count,percent100:K2(100*t/c.count,1),color:U2[n]})}if(e.length){let t=c.count-r;t>0&&e.push({name:`...`,count:t,percent:t/c.count,percent100:K2(100*t/c.count,1),color:U2[e.length]}),s.push({view:`button`,className:`group`,when:`#.actions | queryAcceptChanges and querySubquery`,onClick(e,t,r){let i=t.path?[...t.path]:[],a=i.pop(),o=n.pathToQuery(i),s=r.rootData;r.actions.queryAcceptChanges(s)&&r.actions.querySubquery(`${o}${o?`.group(`:`group(`}=>${n.pathToQuery([a])}).sort(value.size() desc)`,s)}}),o.push({view:`block`,className:`pie-stat`,data:e,content:[{view:`block`,content:{view:`html`,data:J2}},{view:`block`,content:[`html:"<span class=\\"list-header\\">Dominators:</span>"`,{view:`list`,item:`html:
|
|
474
|
+
"<span class=\\"dot\\" style=\\"--size: 10px; background-color: " + color + "\\"></span> " +
|
|
475
|
+
"<span class=\\"caption\\" title=\\"" + name + "\\">" + name + "</span>" +
|
|
476
|
+
"<span class=\\"times\\"> × " + count + " (" + percent100 + "%)</span>"
|
|
477
|
+
`}]}]})}}c.values.length>1?(t.name===`number`||t.name===`string`)&&o.push({view:`content-filter`,name:`filter`,data:`values.sort(value ascN)`,content:{view:t.name===`string`?`list`:`menu`,className:`struct-list`,data:`.[no #.filter or value~=#.filter]`,emptyText:`Nothing matched`,item:[t.name===`string`?{view:`struct`,data:`value`,match:`=#.filter`}:{view:`block`,className:`caption`,content:`text-match:{ text: value, match: #.filter }`},{view:`block`,when:`count > 1`,className:`count`,content:`text:" × " + count`}]}}):(t.name===`number`||t.name===`string`||t.name===`boolean`)&&o.push({view:`struct`,data:`values[].value`}),t.name===`object`&&o.push({view:`list`,className:`struct-list`,data:`values`,item:[`struct:value`,{view:`block`,when:`count > 1`,className:`count`,content:`text:" × " + count`}]}),(t.name===`array`||t.name===`set`)&&Object.keys(i.map).length&&o.push({view:`block`,className:t.name===`array`?`array-types`:`set-types`,postRender(e){Q2(e,{...i,context:r},n)}})}n.view.render(e,[{view:`block`,when:`path`,className:`path`,data:e=>n.pathToQuery(e.path),content:`text`},{view:`block`,className:`signature-action-buttons`,content:s},{view:`h1`,className:`type`,content:[`text:name`,`html:"<span class=\\"usage-stat\\">" + (
|
|
478
|
+
count = total
|
|
479
|
+
? "only this type is used"
|
|
480
|
+
: "used in <span class=\\"num\\">" + count + "</span> of <span class=\\"num\\">" + total + "</span> cases (<span class=\\"num\\">" + percent + "</span>)"
|
|
481
|
+
) + "</span>"`]},...o],{...c,name:t.name,path:t.path,total:a,percent:K2(100*c.count/a,1)+`%`},r)}var e4={beforeDemo:['md:"The `signature` view is used to output a type definition for current data using TypeScript like style:"'],demo:{view:`signature`,expanded:!0}};function t4(e){let t=new WeakMap;e.addHostElEventListener(`click`,({target:e})=>{let n=`expand`,r=e.closest(`
|
|
482
|
+
.view-signature .expand,
|
|
483
|
+
.view-signature [data-action]
|
|
484
|
+
`);if(!r)return;r.dataset.action&&(n=r.dataset.action,r=r.parentNode);let i=t.get(r);if(i){let{context:e,path:a,stat:o,map:s,offset:c}=i,l=document.createDocumentFragment();switch(n){case`sort-keys`:s.sortKeys=!s.sortKeys;break;case`dict-mode`:if(s.dictMode)s.dictMode=null;else{let e=s.dictMode={keys:new Set,count:0,map:Object.create(null)};s.forEach((t,n)=>{for(let t in n)oz(n,t)&&(e.keys.add(t),e.count++,H2(n[t],1,e.map))})}break;default:s.properties===null?(s.properties=new Map,s.forEach((e,t)=>V2(t,1,s))):s.properties=null}G2(l,{object:s},t,e,a,c,o),r.replaceWith(l)}},!1),new e.view.Popup({className:`signature-details`,hoverPin:`trigger-click`,hoverTriggers:`
|
|
485
|
+
.view-signature .property,
|
|
486
|
+
.view-signature .type
|
|
487
|
+
`,render(n,r){let i=t.get(r);switch(i.type){case`property`:return Z2(n,i,e);case`type`:return $2(n,i,e)}}}),e.view.define(`signature`,function(e,n,r,i){let{expanded:a,path:o}=n,s=H2(r,a),c=Array.isArray(o)?o:void 0,l=`rootData`in n?n.rootData:!c||c.length===0?r:void 0;G2(e,s,t,{...i,rootData:l},c)},{usage:e4})}var n4=/^(?:https?:)?\/\/(?:[a-z0-9\-]+(?:\.[a-z0-9\-]+)+|\d+(?:\.\d+){3})(?:\:\d+)?(?:\/\S*?)?$/i;function r4(e,t){return`<span class="${e}">${t}</span>`}function i4(e){return r4(`more`,`\u2026 ${pz(e)} more`)}function a4(e){return fz(o4(e))}function o4(e){return/[^\x20\x21\x23-\x5B\x5D-\uD799]/.test(e)?JSON.stringify(e).slice(1,-1):e}function s4(e,t,n){switch(typeof e){case`boolean`:case`undefined`:return r4(`keyword`,String(e));case`number`:case`bigint`:return r4(`number`,pz(e));case`symbol`:return r4(`symbol`,String(e));case`function`:return`ƒn`;case`string`:{let r=e.length,i=t?n.maxCompactStringLength:n.maxStringLength,a=r>i+n.allowedExcessStringLength,o=``,s=``,c=``;if(a){if(n.match){let t=[],r=i>30?10:5,a=i-r,l=0,u=-1;if(c$(e,n.match,e=>{l+=e.length},(e,n)=>{if(u===-1&&(u=l+a),l<u&&t.push({start:l,end:l+e.length}),l+=e.length,l>u)return n}),t.length>0){let n=t[0].start,a=i;if(n!==0){let t=o4(e.slice(0,n));if(n>r){let e=r-2;s=r4(`more prefix`,``),o=t.slice(-e),a-=r}else o=t}for(let n=0;n<t.length&&a>0;n++){let{start:r,end:i}=t[n],s=Math.min(i-r,a);if(o+=r4(`match`,a4(e.slice(r,r+s))),a-=s,a>0){let r=n+1>=t.length,s=r?e.length:t[n+1].start,l=Math.min(s-i,a);if(r){let t=e.length-(i+l);t>0&&(c=r4(`more suffix`,pz(t)))}l>0&&(o+=a4(e.slice(i,i+l)),a-=l)}}}}o===``&&(o=a4(e.slice(0,i)),c=r4(`more suffix`,pz(r-i)))}else n.match?c$(e,n.match,e=>{o+=a4(e)},e=>{o+=r4(`match`,a4(e))}):o=a4(e);return r4(`string`,!t&&(e[0]===`h`||e[0]===`/`)&&n4.test(e)?`"${s}<a href="${fz(e)}" target="_blank">${o}</a>${c}"`:`"${s}${o}${c}"`)}case`object`:{if(e===null)return r4(`keyword`,`null`);if(cY(e)){let t=e.length,r=n.limitCollapsed===!1||n.limitCollapsed>t?t:n.limitCollapsed,i=Array.from({length:r},(t,r)=>s4(e[r],!0,n));return t>r&&i.push(`${i4(t-r)} `),`[${i.join(`, `)}]`}if(hY(e))return`<span class="error-value"><span class="error-value__name">${fz(e.name)}</span>`+(t?``:`<span class="error-value__message">${fz(e.message)}</span>`)+`</span>`;switch(az(e)){case`[object Set]`:{let t=e.size,r=n.limitCollapsed===!1||n.limitCollapsed>t?t:n.limitCollapsed,i=e.values(),a=Array.from({length:r},()=>s4(i.next().value,!0,n));return t>r&&a.push(`${i4(t-r)} `),`[${a.join(`, `)}]`}case`[object Date]`:return r4(`date`,String(e));case`[object RegExp]`:return r4(`regexp`,String(e))}if(t&&n.limitCompactObjectEntries===0){for(let t in e)if(oz(e,t))return`{…}`;return`{}`}let r=t?n.limitCompactObjectEntries===!1?1/0:n.limitCompactObjectEntries:n.limitCollapsed===!1?1/0:n.limitCollapsed,i=[],a=0;for(let t in e)if(oz(e,t)){if(a<r){let r=fz(t.length>n.maxCompactPropertyLength?t.slice(0,n.maxCompactPropertyLength)+`…`:t);i.push(`${r4(`property`,r)}: ${s4(e[t],!0,n)}`)}a++}return a>r&&i.push(i4(a-r)),i.length?`{ ${i.join(`, `)} }`:`{}`}default:return`unknown type "${typeof e}"`}}var c4=(e,t,n,r,i,a,o)=>({target:s})=>{let c=`expand`,l=s.closest(`
|
|
488
|
+
.view-struct.struct-expand,
|
|
489
|
+
.view-struct .struct-expand-value,
|
|
490
|
+
.view-struct .struct-action-button
|
|
491
|
+
`);if(l)switch(l.dataset.action&&(c=l.dataset.action),c){case`expand`:l.classList.contains(`struct-expand`)&&(l=l.lastChild),e(l,0),n(),l.parentNode.classList.add(`struct-expanded-value`),i.has(l.parentNode)&&l.parentNode.classList.remove(`struct-expand`);break;case`collapse`:l=l.parentNode,t(l),n(),l.parentNode.classList.remove(`struct-expanded-value`),l.classList.remove(`view-as-table`),i.has(l.parentNode)&&l.parentNode.classList.add(`struct-expand`);break;case`show-signature`:o.show(l);break;case`value-actions`:a.show(l);break;case`toggle-sort-keys`:e(l.parentNode,0,l.parentNode.classList.toggle(`sort-keys`)),n();break;case`toggle-string-mode`:{l=l.parentNode;let e=l.classList.toggle(`string-value-as-text`);for(let t=l.querySelector(`.string-text`).firstChild;t!==null;t=t.nextSibling){let n=t.nodeType===3?t:t.firstChild,r=n.nodeValue;if(e)r.indexOf(`\\`)!==-1&&(n.nodeValue=JSON.parse(`"${r}"`));else{let e=o4(r);e!==r&&(n.nodeValue=e)}}break}case`toggle-view-as-table`:l=l.parentNode,l.classList.toggle(`view-as-table`)?r(l):l.querySelector(`:scope > .view-table`)?.remove()}};function l4(e){return e?`, `+pz(e)+` bytes`:``}function u4(e){for(;e.parent!==null;)e=e.parent;return e.host[``]}function d4(e,t,n,r){return new e.view.Popup({className:`view-struct-actions-popup`,render(i,a,o){let s=a.parentNode,c=t.get(s),l=[];if(typeof c==`string`)l=[{text:`Copy as quoted string`,action:()=>u$(JSON.stringify(c))},{text:`Copy as unquoted string`,action:()=>u$(JSON.stringify(c).slice(1,-1))},{text:`Copy a value (unescaped)`,action:()=>u$(c)}];else{let t=e.pathToQuery(r(s)),i=1073741824,a=!1,o=!1,u=0,d=0;try{let{bytes:e,spaceBytes:t,circular:n}=kK(c,{space:4});n.length?(a=`Converting circular structure to JSON`,o=`Converting circular structure to JSON`):(u=e-t,d=e+2,u>i&&(o=`Resulting JSON is over 1 Gb`),d>i&&(a=`Resulting JSON is over 1 Gb`))}catch(e){o=a=/Maximum call stack size|too much recursion/i.test(e.message)?`Too much nested structure`:e.message}if(o&&=`Can't be copied: `+o,a&&=`Can't be copied: `+a,t){l.push({text:`Copy path:`,notes:fz(t),action:()=>u$(t)});let r=u4(n.get(s));e.action.has(`queryAcceptChanges`)&&e.action.call(`queryAcceptChanges`,r)&&(e.action.has(`querySubquery`)&&l.push({groupStart:!0,text:`Create a subquery from the path`,action:()=>e.action.call(`querySubquery`,t,r)}),e.action.has(`queryAppend`)&&l.push({text:`Append path to current query`,action:()=>e.action.call(`queryAppend`,t,r)}))}l.push({groupStart:!0,text:`Copy as JSON`,notes:`(formatted${l4(d)})`,error:a,disabled:!!a,action:()=>u$(JSON.stringify(c,null,4))}),l.push({text:`Copy as JSON`,notes:`(compact${l4(u)})`,error:o,disabled:!!o,action:()=>u$(JSON.stringify(c))})}e.view.render(i,{view:`menu`,onClick(e){o(),e.action()},itemConfig:{className:`=groupStart ? "group-start" : null`},item:[`html:text`,{view:`block`,when:`notes`,className:`notes`,content:`html:notes`},{view:`block`,when:`error`,className:`error`,content:`text:error`}]},l)}})}var f4=[`none`,`default`,`badge`],p4=new WeakMap;function m4(e,t){return Array.isArray(e)?Array.isArray(t)?e.concat(t):e:t}function h4(e){return Array.isArray(e)&&e.length>0?e.map(e=>typeof e==`string`||typeof e==`function`?{query:e}:e):!1}function g4(e){if(typeof e==`string`&&e.length>64){let t=sX(e);if(t!==null)return{place:`before`,style:`badge`,text:`image`,imageContent:t,tooltip:{className:`view-struct_image-preview-tooltip`,content:"image-preview{ src: #.config.imageContent | `data:image/${type},${content}` }"}}}}function _4(e){return h4([...[...e.objectMarkers.values].map(({name:e,lookup:t})=>(n,r)=>{let i=t(n,!0);if(i!==null&&i.object!==r.host)return{place:`before`,style:`badge`,text:e,href:i.href}}),g4])}function v4(e,t){return m4(t,h4(e))}function y4(e){return f4.includes(e)}function b4(e){let t=Date.now()+8,n=0;for(;n<e.length&&!(Date.now()>t);n++){let{el:t,config:r,renderer:i,data:a,context:o}=e[n],{place:s=`after`,className:c,text:l,icon:u,href:d,external:f,tooltip:p}=r,m=y4(r.style)?r.style:s===`before`?`none`:`default`,h=l===void 0?typeof r==`object`?``:String(r):String(l),g=h!==``,_=[`value-annotation`,`style-`+m,s===`before`?`before`:`after`,g?`has-text`:``,c||``].join(` `),v=$(d?`a`:`span`,{class:_,href:typeof d==`string`?d:void 0,target:f?`_blank`:void 0});if(g&&(/\d{4}/.test(h)?v.innerHTML=pz(h):v.append(h)),typeof u==`string`&&(v.classList.add(`icon`),/^[a-z_$][a-z0-9_$-]*$/i.test(u)?v.classList.add(`icon-`+u):v.style.setProperty(`--annotation-image`,`url("${u}")`)),p&&i.tooltip(v,p,a,{...o,config:r}),s===`before`)t.before(v);else{let e=t.parentNode,n=p4.get(t);n===void 0&&(p4.set(t,n=$(`span`,`value-annotations`)),e.classList.contains(`struct-expanded-value`)?t.querySelector(`:scope > .value-size, :scope > .string-length`)?.after(n):e.append(n)),n.append(v)}}e.splice(0,n)}var x4={level_1:{level_2_1:{level_3_1:{level_4_1:{}},level_3_2:2,level_3_3:3,level_3_4:4,level_3_5:5,level_3_6:6},level_2_2:[{foo:1,bar:2},{foo:3}],level_2_3:3,level_2_4:4,level_2_5:5,level_2_6:6},level_1_2:2,level_1_3:3,level_1_4:4,level_1_5:5,level_1_6:6,level_1_7:7},S4={beforeDemo:[`md:"View to display the structure of any value. This is the simplest yet powerful way to enable data exploration."`],demo:{view:`struct`,data:{foo:`bar`,baz:[1,2,3]}},examples:[{title:`Default expanded depth`,highlightProps:[`expanded`],beforeDemo:['md:"By default `struct` view is collapsed in one line. The `expanded` option is using to specify an initial expanded depth. A value for the option can be a boolean (`false` → `0`, `true` → `1`) or a positive number."'],demoData:x4,demo:[`badge:"Default (expanded option is not used)"`,{view:`struct`},`badge:"expanded = true"`,{view:`struct`,expanded:!0},`badge:"expanded = 2"`,{view:`struct`,expanded:2}]},{title:`Annotations`,highlightProps:[`annotations`],beforeDemo:[{view:`md`,source:[`Clarity of data can be improved by adding annotations. An annotation is special marker before or after a value which displaying for expanded objects and arrays only.`,`Any number of annotations can be applied to a single value.`,``,"Annotations are adding with `annotations` option which should contain an array of strings (jora queries) and functions to compute an annotation config. An annotation config is an object with following fields:","```ts",`type AnnotationConfig = {`,` place?: "before" | "after"; // the placement of an annotation, "after" is by default`,` style?: "none" | "badge" | "default"; // appereance of annotation, "default" is by default`,` className?: string; // a class to add to an annotation element`,` text?: any; // text content of an annotation element`,` icon?: string; // name of icon or url to an image`,` href?: string; // annotation is a link and that's an URL`," external?: boolean; // open a link in new tab, make sence when `href` is specified only",` tooltip?: TooltipConfig; // configuration for a tooltip, the same as for any view`,`}`,"```",``,'An annotation is not displayed (not rendered) when computed annotation config is a falsy value. Any other value (truthy, but not an object) is used as value for `text` option, i.e. `"example"` is the same as `{ text: "example" }`.',``,"In addition to a string or function, an object can be used as an element of `annotations` array","* `query` – a string (jora query) or a function to compute an annotation config","* `debug` (optional) - when truthy a debug information is output to the console; when value is a string, it's used in debug message"]}],demoData:{items:[{id:1,value:`example`},{id:2,value:`bar`},{id:3,value:`baz`}],"annotation styles":[`none`,`default`,`badge`]},demo:{view:`struct`,expanded:3,annotations:[`#.key = "items" ? { place: "before", style: "badge", text: "view as table", tooltip: "table" } : null`,`$ ~= /az/ and "Value has 'az' substring!"`,`$ in ["none", "default", "badge"] and { style: $, place: "before", text: $ + " before" }`,`$ in ["none", "default", "badge"] and { style: $, text: $ + " after" }`]}},{title:`Limit number of array elements and object entries`,beforeDemo:{view:`md`,source:[`The following options define the maximum number of elements in array or entries in object:`,"* `limit` (default: `50`) – max number of elements/entries for expanded array/object","* `limitCollapsed` (default: `4`) – max of elements/entries for collapsed array/object","* `limitCompactObjectEntries` (default: `0`) – max number of entries in a object which appears in a collapsed array or object",``,"> Use `false` for any of these options to disable a limitation"]},highlightProps:[`limit`,`limitCollapsed`,`limitCompactObjectEntries`],demoData:x4,demo:{view:`struct`,limit:4,limitCollapsed:1,expanded:2}},{title:`Maximum length for strings`,beforeDemo:{view:`md`,source:[`The following options define the maximum string length in various cases:`,"* `maxStringLength` (default: `150`) – max string length when a host value is expanded","* `maxCompactStringLength` (default: `40`) – max of string length when a host value is collapsed",'* `allowedExcessStringLength` (default: `10`) – allowed excess in length before a string will be cut and \\"N more\\" label will be added',"* `maxPropertyLength` (default: `Infinity`) – max of property name length","* `maxCompactPropertyLength` (default: `35`) – max of property name length in collapsed objects",``,"> Expand and collapse `level2` branch to see difference in a value presentation"]},highlightProps:[`maxStringLength`,`maxCompactStringLength`,`allowedExcessStringLength`,`maxPropertyLength`,`maxCompactPropertyLength`],demo:{view:`struct`,maxStringLength:30,maxCompactStringLength:10,allowedExcessStringLength:5,maxPropertyLength:30,maxCompactPropertyLength:15,expanded:1},demoData:{stringsInExpandedObject:`Quite a long string value Quite a long string value`,string_34_chars:`String with 34 chars length demo x`,string_35_chars:`String with 35 chars length demo xx`,string_36_chars:`String with 36 chars length demo xxx`,very_very_very_very_very_very_very_very_very_very_long_property_name:`a property name should be truncated due to settings, but will not be by default`,level2:{stringsInCollapsedObject:`Quite a long string value Quite a long string value`,string_14_chars:`Short string x`,string_15_chars:`Short string xx`,string_16_chars:`Short string xxx`}}}]},C4={get collapse(){return $(`span`,{class:`struct-action-button struct-collapse-value`,"data-action":`collapse`})},get signature(){return $(`span`,{class:`struct-action-button show-signature`,"data-action":`show-signature`})},get actions(){return $(`span`,{class:`struct-action-button`,title:`Value actions`,"data-action":`value-actions`})},get stringMode(){return $(`span`,{class:`struct-action-button`,title:`Toggle string show mode`,"data-action":`toggle-string-mode`})},get viewAsTable(){return $(`span`,{class:`struct-action-button`,title:`Toggle view as table`,"data-action":`toggle-view-as-table`})},get sortKeys(){return $(`span`,{class:`struct-action-button`,title:`Toggle key sorting`,"data-action":`toggle-sort-keys`})}},w4=lz(`"`,C4.collapse,C4.actions,C4.stringMode,$(`span`,`string-length`),$(`span`,`string-text-wrapper`,[$(`span`,`string-text`)]),`"`),T4=lz(`[`,C4.collapse,C4.signature,C4.actions,C4.viewAsTable,$(`span`,`value-size`),`]`),E4=lz(`{`,C4.collapse,C4.signature,C4.actions,C4.viewAsTable,C4.sortKeys,$(`span`,`value-size`),`}`),D4=$(`div`,`entry-line`),O4=$(`span`,`value`),k4=$(`span`,`match`),A4=$(`span`,`label`,[`\xA0\xA0\xA0\xA0`,$(`span`,`property`),`:\xA0`]);function j4(e){for(;e.parent!==null;)e=e.parent;return e.host[``]}function M4(e,t,n,r,i){return new e.view.Popup({className:`view-struct-signature-popup`,hoverPin:`popup-hover`,hoverTriggers:`.view-struct .show-signature`,showDelay:50,render(a,o){let s=o.parentNode,c=t.get(s),l=n.get(s),u=r.get(s)||{};a.classList.add(`computing`),setTimeout(()=>{e.view.render(a,{view:`signature`,expanded:2,rootData:j4(l),path:i(s)},c,u.context).then(()=>a.classList.remove(`computing`))},16)}})}var N4=50,P4=4,F4=0,I4=150,L4=40,R4=10,z4=1/0,B4=35;function V4(e,t){return typeof e==`number`&&isFinite(e)&&e>=1?parseInt(e,10):t}function H4(e,t){if(typeof e==`string`)return e.length>t.maxStringLength||/[\r\n\f\t]/.test(e);if(cY(e))return e.length>0;if(typeof e==`object`&&e)switch(az(e)){case`[object Set]`:return e.size>0;case`[object Object]`:for(let t in e)if(oz(e,t))return!0}return!1}function U4(e){return!(typeof e==`string`||sY(e)||cY(e)&&e.every(e=>typeof e==`number`))}function W4(e,t){e.appendChild(document.createTextNode(t))}function G4(e,t,n){t>1&&(e.lastElementChild.innerHTML=pz(t)+` `+n)}function K4(e,t,n){t.length<2||t.every(([e],n)=>n===0||e>t[n-1][0])?e.querySelector(`[data-action="toggle-sort-keys"]`).remove():n&&t.sort(([e],[t])=>e<t?-1:+(e>t))}function q4(e,t,n){let r=A4.cloneNode(!0),i=t.length>n?t.slice(0,n)+`…`:t;W4(r.firstElementChild,i),e.appendChild(r)}function J4(e){function t(e){let t=f.get(e),n=u.get(e);e.classList.add(`struct-expand-value`),e.innerHTML=s4(n,!1,t),e.annotationsEl&&e.parentNode.append(e.annotationsEl)}function n(e,t,n){let a=u.get(e);if(e.classList.remove(`struct-expand-value`),typeof a==`string`){let t=f.get(e),n=w4.cloneNode(!0),r=n.lastChild.previousSibling,i=r.firstChild,o=r.previousSibling,c=o4(a);o.innerHTML=`length: ${pz(c.length)} chars`,t.match?c$(a,t.match,e=>i.append(JSON.stringify(e).slice(1,-1)),e=>i.appendChild(k4.cloneNode()).append(JSON.stringify(e).slice(1,-1))):W4(i,c),e.replaceChildren(n),s(e,o)}else if(cY(a)||lY(a)){let n=d.get(e),o=f.get(e),c=typeof a.size==`number`?a.size:a.length;e.replaceChildren(T4.cloneNode(!0)),G4(e,c,`elements`),s(e,e.lastElementChild),i(e,e.lastChild,a.values(),c,(e,i,s)=>{s>0&&s%10==9&&(e.dataset.index=s+1),r(e,i,t,o,Object.freeze({parent:n,host:a,key:s,index:s}))},0,o.limit)}else{let o=d.get(e),c=f.get(e),l=Object.entries(a);e.replaceChildren(E4.cloneNode(!0)),G4(e,l.length,`entries`),s(e,e.lastElementChild),K4(e,l,n),i(e,e.lastChild,l.values(),l.length,(e,[n,i],s)=>{s>0&&s%10==9&&(e.dataset.index=s+1),q4(e,n,c.maxPropertyLength),r(e,i,t,c,Object.freeze({parent:o,host:a,key:n,index:s}))},0,c.limit)}}function r(e,t,r,i,a){let o=H4(t,i),s=O4.cloneNode(!0);u.set(s,t),d.set(s,a),f.set(s,i),o&&U4(t)&&r?(e.classList.add(`struct-expanded-value`),n(s,r-1)):(o&&s.classList.add(`struct-expand-value`),s.innerHTML=s4(t,!1,i)),c(s,t,i,a),e.appendChild(s)}function i(t,n,r,a,o,s=0,c=N4){c===!1&&(c=1/0);let l=document.createDocumentFragment(),u=a-1,d=0;for(;d<c;d++,s++){let{done:e,value:t}=r.next();if(e)break;let n=D4.cloneNode(!0);o(n,t,s),s!==u&&W4(n,`,`),l.appendChild(n)}t.insertBefore(l,n),e.view.maybeMoreButtons(t,n,a,s,c,(e,s)=>i(t,n,r,a,o,e,s))}function a(t){let n=f.get(t),r=u.get(t);!cY(r)&&!lY(r)&&(r=Object.entries(r).map(([e,t])=>({"[key]":e,"[value]":t}))),e.view.render(t,`table`,r,n.context),t.append(t.lastChild.previousSibling)}function o(e){let t=[],n=d.get(e);for(;n!==null&&n.parent!==null;)t.unshift(n.key),n=n.parent;return t}function s(e,t){e.annotationsEl&&t.after(e.annotationsEl)}function c(t,n,r,i){if(r.annotations.length){for(let a of r.annotations)try{let{query:o,debug:s}=a,c={...i,context:r.context},l=e.query(o,n,c);s&&e.logger.info(`Compute struct view annotation${typeof s==`string`?` "${s}"`:``}:`,{data:n,context:c,query:o,queryResult:l}),l&&m.push(l.tooltip?{el:t,config:l,renderer:r.renderer,data:n,context:c}:{el:t,config:l})}catch(t){e.logger.error(t.message)}l()}}function l(){_===null&&m.length&&(_=Promise.resolve().then(()=>{_=null,b4(m),m.length&&l()}))}let u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakSet,m=[],h=_4(e),g=h,_=null,v=c4(n,t,l,a,p,d4(e,u,d,o),M4(e,u,d,f,o));return e.addHostElEventListener(`click`,v,!1),e.legacyPrepare||e.action.define(`setStructViewAnnotations`,e=>{g=m4(h,h4(e))}),e.view.define(`struct`,function(t,n,i,a){let{annotations:o,match:s,expanded:c,limit:u,limitCollapsed:d,limitCompactObjectEntries:f,maxStringLength:m,maxCompactStringLength:h,allowedExcessStringLength:_,maxPropertyLength:v,maxCompactPropertyLength:y}=n,b=v4(o,e.legacyPrepare?e.annotations:g),x={renderer:this,context:a,annotations:b||[],match:uY(s)||typeof s==`string`?s:null,limit:e.view.listLimit(u,N4),limitCollapsed:e.view.listLimit(d,P4),limitCompactObjectEntries:e.view.listLimit(f,F4),maxStringLength:V4(m,I4),maxCompactStringLength:V4(h,L4),allowedExcessStringLength:V4(_,R4),maxPropertyLength:V4(v,z4),maxCompactPropertyLength:V4(y,B4)};p.add(t),r(t,i,c,x,{parent:null,host:{"":i},key:``,index:0}),l(),(!c||!U4(i))&&H4(i,x)&&t.classList.add(`struct-expand`)},{usage:S4}),()=>{document.removeEventListener(`click`,v,!1)}}var Y4=[{name:`Alice`,age:34,occupation:`Engineer`},{name:`Bob`,age:42,occupation:`Doctor`},{name:`Charlie`,age:9,occupation:`Student`},{name:`David`,age:50,occupation:`Doctor`},{name:`Eve`,age:15,occupation:`Engineer`}],X4={beforeDemo:[`md:"A view to display tabular data, usually an array of objects. When no column setup is provided, it infers columns from all keys of objects in the input data and auto-detects sorting for scalar values."`],demo:{view:`table`},demoData:[{foo:1,bar:`bar`,baz:`zab`},{foo:2,baz:`xyz`},{foo:3,bar:`qux`,baz:`baz`},{foo:4,bar:`aaa`,baz:`abc`}],examples:[{title:`Columns setup`,beforeDemo:{view:`md`,source:["To set up columns, the `cols` property is used. When an array of objects is used for `cols`, it specifies the exact set of columns. Each object contains a configuration for the `table-cell` view with additional properties that apply at the table level:\n","- `header` – a text or config for the column header\n","- `footer` – a config for the footer cell\n","- `sorting` – a sorting function or query for the column\n"]},highlightProps:[`cols`,`header`,`footer`,`sorting`],demo:{view:`table`,cols:[{header:`Name`,sorting:`name asc`,data:`name`,footer:`text:"Total:"`},{header:`Age`,headerClassName:`age`,className:`number`,content:`text:age + " y.o."`,footer:{data:`size()`}}]},demoData:Y4},{title:`Adjastments of infered columns`,beforeDemo:{view:`md`,source:["In cases where adjustments are needed for inferred columns, an object can be used for the `cols` option, where each key is the name of a property from the objects:",`- If a key is missing from the inferred columns, a new column is added with the specified configuration.`,`- If a key matches one of the inferred columns:`," - If the specified configuration is falsy (i.e., `null`, `undefined`, or `false`), then the column is omitted.",` - Otherwise, options from the specified configuration override properties of the inferred configuration.`,``,"> When specified configuration is a string, it expands into object `{ content: value }`.",`The default inferred configuration:`,"```js",`{`,` header: key,`," sorting: `$[${JSON.stringify(key)}] ascN`,",` view: "table-cell",`,` data: value => value?.[key]`,`}`,"```"].join(`
|
|
492
|
+
`)},afterDemo:[`struct:#.id.pageLink(#.page, #.params)`],highlightProps:[`cols`],demo:{view:`table`,cols:{age:`text:age + " y.o."`,occupation:!1,extraColumn:{header:`Extra column`,content:`text:age >= 21 ? "Adult" : "Child"`}}},demoData:Y4},{title:`Sorting`,beforeDemo:{view:`md`,source:['To specify a sorting function, use the `sorting` property in the column options. When a value for `sorting` is set, the column becomes sortable, allowing users to toggle sorting by clicking the column header. The value can be a function `(a, b) => number` or a string representing a jora query that returns a [comparator function](https://discoveryjs.github.io/jora/#article:jora-syntax-functions&!anchor=comparator-functions) (e.g., "name asc, complex.expression desc"), otherwise the value ignores. The function should take two rows\' data (`a` and `b`) and return a negative number if `a` is less than `b`, a positive number if `a` is greater than `b`, or zero otherwise.',``,"> The `table` view automatically displays a sorting direction indicator (icon) on a column when a comparator function returns `<= 0` or `>= 0` for each pair of consecutive rows.",``,"> Note: A sorting (comparator) function has no access to the table's context, so any attempt to access context (`#`) values within a comparator function produced by a query will return `undefined`.",``,"The `table` view attempts to infer a sorting function for a column when the `sorting` option is not explicitly specified, by executing the following steps:","- Use `data` if it is a string or function to extract column values from row data; otherwise, use the row's data.",'- If `content` is a string formatted as `"view-name:query"`, use the `query` to extract a value from the previous step.',' > To prevent sorting inference from the `content` value, specify content in another format, often by wrapping it in an array, e.g., `{ content: "text:name" }` → `{ content: ["text:name"] }`.',`- If any condition is met, construct a sorting (comparator) function.`," > If neither `data` nor `content` options meet the conditions, a sorting function cannot be inferred, and the column becomes non-sortable.",``,`> Note: When inferring a comparator function, the when, whenData, and contentWhen options are not considered for now. If these options are needed to affect sorting, an explicit sorting function should be specified.`].join(`
|
|
493
|
+
`)},highlightProps:[`sorting`,`data`,`content`],demo:{view:`table`,cols:[{header:`Sorting from data`,data:`name`},{header:`Sorting from content`,content:`text:age`},{header:`Sorting from data&content`,data:`{ name, age }`,content:"text:`${age} ${name}`"},{header:`Explicit sorting`,sorting:`name asc, age desc`,content:["text:`${name} ${age}`"]}]},demoData:Y4},{title:`Displaying non-object values`,beforeDemo:['md:"When input data (an array) contains non-object values, such values are display using `struct` view in a single cell spanning all the columns"'],highlightProps:[`data`,`valueCol`],demo:[`h3:"Table with non-object values"`,{view:`table`,data:[123,`string`,null,{foo:1,bar:2},[1,2,3]]},`h3:"Enforce displaying of a [value] column"`,{view:`table`,valueCol:!0}],demoData:Y4},{title:`Setup cell display`,beforeDemo:{view:`md`,source:["To manage cell display, the following options are available in the `cols` setting:","- `colWhen` (similar to `when` and `whenData` options) allows disabling column rendering based on the table's data.","- `when` and `whenData` apply to `table-cell` and behave the same way as they do for any view, to disabling rendering of the cell itself.","- `contentWhen` (similar to `when` and `whenData` options) allows disabling cell content rendering based on the cell's data.","- `colSpan` allows setting a relevant attribute for a table cell. (Note: subsequent cells should be disabled using `when` or `whenData`).","- `align` specifies text alignment, supported values `'left'`, `'center'` and `'right'`"].join(`
|
|
494
|
+
`)},highlightProps:[`contentWhen`,`colWhen`,`colSpan`,`when`],demo:{view:`table`,data:`.({ name, age, fare: age > 21 ? "Full" : age > 12 ? "Half" })`,cols:{name:{contentWhen:`$ != "Bob"`},age:{colWhen:`size() > 10`},fare:{colSpan:`=fare ? 1 : 2`,content:{data:`fare`,view:`switch`,content:[{when:`$`,content:`text`},{content:`text:"Not applicable"`}]}},price:{when:`fare`,data:`fare = "Full" ? 50 : 25`,content:`text:"$" + $`}}},demoData:Y4},{title:`Cell details`,beforeDemo:{view:`md`,source:["Table cells can display an additional detail view of their content when clicked. Clicking the same cell again, or a different cell with details, will hide the view. To enable and customize the detail view, use the `details` option.",``,"By default, if the `details` option is not explicitly defined, it will automatically activate for cells containing an object or a non-empty array, as long as no custom `content` is specified. In this case, a default `struct` view will be used to display the data.",``,"You can control the visibility of detail views using the `detailsWhen` option. This option accepts a function that checks the cell's data and disables the details view if the function returns a falsy value."]},highlightProps:[`details`,`detailsWhen`],demo:{view:`table`,cols:[{header:`Group`,data:`group`},{header:`Default`,data:`peoples`},{header:`Custom details`,data:`peoples`,details:[`h2:"Custom detail views"`,`table`]},{header:`Disable default details`,data:`peoples`,details:!1},{header:`Conditional details`,data:`peoples`,detailsWhen:`size() > 2`}]},demoData:[{group:`Kids`,max:21},{group:`Adults`,min:21},{group:`All`}].map(({group:e,min:t=0,max:n=100})=>({group:e,peoples:Y4.filter(e=>e.age>t&&e.age<n)}))},{title:`Setup header cell display`,beforeDemo:{view:`md`,source:["A setup for header cells is simple as a setting up a string. However, a value for header can be a query string (i.e. `'=query'`), a config object or content views."]},highlightProps:[`header`],demoData:Y4,demo:{view:`table`,cols:[{header:`just a text`},{header:`=occupation has "Doctor" ? "Has doctor" : "-"`},{header:{className:`foo`,content:[`text-numeric:123456`],tooltip:"text:`Rows: ${size()}`"}},{header:{text:`text via config`}}]}},{title:`Setup footer cell display`,beforeDemo:{view:`md`,source:[`A setup for footer cell is similar to a [regular cell](#!setup-cell-display), the same set of options are supported: .`,``,"When value for the `footer` is an object without a `view` property, it's interpreted as a footer config. Otherwise, it is treated as footer cell content, equivalent to passing `{ content: value }`."]},highlightProps:[`footer`],demoData:Y4,demo:{view:`table`,cols:{name:{footer:`text:"Raw data"`},age:{footer:{colSpan:2}}}}},{title:`Setup header and footer display`,beforeDemo:{view:`md`,source:["You can use the `headerWhen` and `footerWhen` options to conditionally disable the rendering of the header and footer, respectively. The footer also is not rendering when no any footer cell is defined."]},highlightProps:[`headerWhen`,`footerWhen`],demoData:Y4,demo:[`h2:"No header and footer"`,{view:`table`,headerWhen:!1,footerWhen:`size() > 10`,cols:{name:{footer:`text:"footer"`}}},`h2:"With header and footer"`,{view:`table`,cols:{name:{footer:`text:"footer"`}}}]}]};function Z4(e,t){return{header:e,sorting:`${t} ascN`,view:`table-cell`,data:t}}function Q4(e,t,n){let r=``,i=``;if(`data`in e&&e.data!==void 0)switch(typeof e.data){case`string`:i=`(${e.data||`$`})`;break;case`function`:r=`$dataQuery;`,i=`$dataQuery(#)`;break;default:r=`$dataQuery;`,i=`$dataQuery`}if(typeof e.content==`string`){let n=e.content.indexOf(`:`),r=e.content.slice(0,n);if(n===-1||!t.view.has(r))return;let a=e.content.slice(n+1);a&&(i=i?`(${i} | ${a})`:`(${a})`)}return i?t.query(`${r} ${i} ascN`,{dataQuery:e.data},n):!1}function $4(e,t,n){return typeof t==`string`&&(t={content:t}),oz(t,`content`)||oz(t,`data`)?{header:e,view:`table-cell`,...t}:{...Z4(e,n),...t}}function e3(e){return Array.isArray(e)?e.length:e}function t3(e,t,n){if(typeof n!=`function`)return 0;let r=0;try{for(let e=1,i=e3(t[0]);e<t.length;e++){let a=e3(t[e]),o=Math.sign(n(i,a));if(o){if(r&&o!==r)return!1;r=o}i=a}}catch(t){return e.logger.error(`Error on column order detection in table view`,t),0}return-r||0}function n3(e){let t=e.queryFn(`is not object`);e.view.define(`table`,function(n,r,i,a){let{rows:o,cols:s,rowConfig:c,valueCol:l=!1,headerWhen:u=!0,footerWhen:d=!0,limit:f}=r,p;`rows`in r||(o=i),lY(o)&&(o=[...o]),cY(o)||(o=o?[o]:[]);let m=o,h=$(`tbody`),g=$(`tbody`,{class:`view-table-more-buttons`}),_=g.appendChild($(`tr`)).appendChild($(`td`)),v=()=>{if(!e.query(u,i,a))return;let t=s.map(e=>e.header),r=s.map(t=>oz(t,`sorting`)?e.query(t.sorting,null,a):Q4(t,e,a));return this.render(n,{view:`table-header`,cols:t,sortings:r,getRowsOrder:t=>t3(e,m,t),setSorting(e,t){if(typeof e==`function`){let n=o.slice().sort(e);t&&n.reverse(),b(n)}else b(o)}},i,a)},y=()=>{let t=s.map(e=>e.footer);if(!(!e.query(d,i,a)||!t.some(e=>e!==void 0)))return this.render(n,{view:`table-footer`,cols:t},i,a)},b=async t=>(m=t,h.innerHTML=``,_.innerHTML=``,n.append(h,g),e.view.renderList(h,p,m,{...a,cols:s},0,e.view.listLimit(f,25),{moreContainer:_,onSliceRender:e=>e===0&&g.remove()}));if(Array.isArray(s))s=s.map((t,n)=>typeof t==`string`?Z4(t,e.pathToQuery([t])):{header:`col`+n,view:`table-cell`,...t});else{let n=new Set,r=s&&typeof s==`object`?s:{};s=[];for(let e of o)if(t(e))l=!0;else for(let t of Object.keys(e))n.add(t);for(let e of Object.keys(r))r[e]?n.add(e):n.delete(e);for(let t of n)s.push(oz(r,t)?$4(t,r[t],e.pathToQuery([t])):Z4(t,e.pathToQuery([t])))}return l&&s.unshift({header:`[value]`,view:`table-cell`,sorting:`$ ascN`,colSpan:`=is not object ? #.cols.size() : 1`,content:`=is not object ? "struct"`,details:`=is object ? "struct"`}),s=s.filter(t=>!oz(t,`colWhen`)||e.queryBool(t.colWhen,i,a)),_.colSpan=s.length,p=this.composeConfig({view:`table-row`,cols:l?`=is not object ? [#.cols[]] : #.cols`:`=#.cols`},c),Promise.all([v(),b(o),y()])},{tag:`table`,usage:X4})}function r3(e,t,n){return e?r=>{r===`asc`?n(e,!0):r===`desc`&&!t?n():n(e)}:null}function i3(e){e.view.define(`table-header`,async function(e,t,n,r){let{cols:i,sortings:a,getRowsOrder:o,setSorting:s}=t,c=e.appendChild($(`tr`)),l=[],u=(e,t)=>{s(e,t);for(let e of c.children){let t=o(l[e.cellIndex]);e.classList.toggle(`asc`,t===1),e.classList.toggle(`desc`,t===-1)}};return Promise.all(i.map((e,t)=>{let i=a[t],s=o(i),d=s===0?null:i;return l.push(d),this.render(c,this.composeConfig({view:`table-header-cell`,initSorting:s,nextSorting:r3(d,s,u)},dY(e)?Array.isArray(e)||`view`in e?{content:e}:e:{text:e}),n,r)}))},{tag:`thead`})}function a3(e){e.view.define(`table-header-cell`,function(t,n,r,i){let{content:a,text:o,initSorting:s,nextSorting:c}=n;if(typeof c==`function`&&(t.classList.add(`sortable`),t.addEventListener(`click`,()=>c(t.classList.contains(`asc`)?`asc`:t.classList.contains(`desc`)?`desc`:`none`))),s&&t.classList.add(s>0?`asc`:`desc`),a)return e.view.render(t,a,r,i);t.textContent=o??``},{tag:`th`})}function o3(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];i!==void 0&&n.push({index:r,config:t({view:`table-footer-cell`},dY(i)&&typeof i.view!=`string`?i:{content:i})})}return n}function s3(e){e.view.define(`table-footer`,async function(t,n,r,i){let{cols:a}=n,o=o3(a,this.composeConfig),s=t.appendChild($(`tr`)),c=o.map(()=>lz()),l=await Promise.allSettled(o.map(({config:e},t)=>this.render(c[t],e,r,i))),u=()=>$(`td`,{class:`view-table-footer-cell`}),d=0,f=0;l.forEach((t,n)=>{let{index:r,config:i}=o[n],a=c[n].firstChild;if(t.status===`rejected`)e.view.renderError(s.appendChild(a=u()),t.reason,i),f++;else if(!a)s.append(a=u());else if(a.nodeType!==1||a.tagName!==`TD`){if(a.nodeType===8&&!a.nextSibling)return;if(a.classList?.contains?.(`discovery-buildin-view-render-error`)){let e=a;s.appendChild(a=u()).append(e),f++}else e.view.renderError(s.appendChild(a=u()),`non <td> element`,i),f++}else if(s.append(a),f++,d>r){let e=a.previousElementSibling;e.colSpan=r-e.cellIndex}else for(let e=r-d;e>0;e--)a.before(u());d=r+a.colSpan}),f===0&&t.classList.add(`no-cells-with-content`);for(let e=a.length-d;e>0;e--)s.append(u())},{tag:`tfoot`})}var c3={view:`struct`,expanded:1},l3=[`left`,`center`,`right`];function u3(e,t){let n=String(t);if(e.classList.add(`number`),!Number.isFinite(t)){e.classList.add(`keyword`),e.textContent=n;return}n.length>3?e.innerHTML=pz(n,!1):e.textContent=n}function d3(e,t,n){if(Array.isArray(t)||ArrayBuffer.isView(t)){t.length>0&&u3(e,t.length);return}if(n){e.classList.add(`complex`);for(let n in t)if(oz(t,n)){e.textContent=`{…}`;return}e.textContent=`{}`;return}if(t!==void 0){if(typeof t==`number`){u3(e,t);return}(t===null||t===!1||t===!0)&&e.classList.add(`keyword`),e.textContent=String(t)}}function f3(e,t,n,r,i){return()=>{let a=t.parentNode,o=a.parentNode,s=Array.from(o.querySelectorAll(`.view-table-cell.details-expanded`)).find(e=>e.parentNode.parentNode===o),c=null;if(s){let e=s.parentNode;if(s.classList.remove(`details-expanded`),s===t){a.nextSibling.remove();return}e===a?(c=a.nextSibling.firstChild,c.innerHTML=``):e.nextSibling.remove()}c===null&&(c=a.parentNode.insertBefore(document.createElement(`tr`),a.nextSibling).appendChild(document.createElement(`td`)),c.parentNode.className=`view-table-cell-details-row`,c.className=`view-cell-details-content`,c.colSpan=1e3),t.classList.add(`details-expanded`),e.view.render(c,n||c3,r,i)}}function p3(e,t){typeof t==`string`&&l3.includes(t)&&e.classList.add(`align-${t}`)}function m3(e){e.view.define(`table-footer-cell`,function(t,n,r,i){let{content:a,contentWhen:o=!0,details:s,detailsWhen:c=!0,colSpan:l,align:u}=n,d=!a&&r!==null&&(Array.isArray(r)?r.length>0:typeof r==`object`)&&!(r instanceof RegExp);if(t.classList.add(`view-table-cell`),typeof l==`number`&&l>1&&(t.colSpan=l),e.queryBool(o,r,i)){if(p3(t,u),(s||s===void 0&&d)&&e.queryBool(c,r,i)&&(t.classList.add(`details`),t.addEventListener(`click`,f3(e,t,s,r,i))),a)return e.view.render(t,a,r,i);d3(t,r,d)}},{tag:`td`})}function h3(e){e.view.define(`table-row`,function(t,n,r,i){let{cols:a}=n;if(Array.isArray(a))return Promise.all(a.map((n,a)=>e.view.render(t,n,r,{...i,colIndex:a})))},{tag:`tr`})}function g3(e){e.view.define(`table-cell`,function(t,n,r,i){let{content:a,contentWhen:o=!0,details:s,detailsWhen:c=!0,colSpan:l,align:u}=n,d=!a&&r!==null&&(Array.isArray(r)?r.length>0:typeof r==`object`)&&!(r instanceof RegExp);if(typeof l==`number`&&l>1&&(t.colSpan=l),e.queryBool(o,r,i)){if(p3(t,u),(s||s===void 0&&d)&&e.queryBool(c,r,i)&&(t.classList.add(`details`),t.addEventListener(`click`,f3(e,t,s,r,i))),a)return e.view.render(t,a,r,i);d3(t,r,d)}},{tag:`td`})}var _3=()=>alert(`toggled!`),v3=([e,...t],n=``)=>{let r=[];for(let i=0;i<e;i++){let e=n+`.`+(i+1);r.push({title:e,children:t.length?v3(t,e):null})}return r},y3={demo:{view:`tree`,item:`text:text`,data:{text:`Root`,children:[{text:`Child`},{text:`Another child`,children:[{text:`Lvl 2 child`},{text:`Lvl 2 child`}]}]}},examples:[{title:`Expanded tree`,highlightProps:[`expanded`],demo:{view:`tree`,item:`text:text`,expanded:999},demoData:{text:`Root`,children:[{text:`Child`},{text:`Another child`,children:[{text:`Lvl 2 child`},{text:`Lvl 2 child`}]}]}},{title:`With empty text`,highlightProps:[`emptyText`],demo:{view:`tree`,emptyText:`This tree is empty`,data:null}},{title:`With toggle handler`,highlightProps:[`onToggle`],demo:{view:`tree`,item:`text:text`,onToggle:_3},demoData:{text:`Root`,children:[{text:`Child`},{text:`Another child`,children:[{text:`Lvl 2 child`},{text:`Lvl 2 child`}]}]}},{title:`limitLines`,highlightProps:[`limitLines`],demoData:v3([5,3,3]),demo:{view:`tree`,item:`text:title`,limitLines:7}}]};function b3(e){function t(n,r,i,a,o,s){return s===!1&&(s=i.length),n.classList.add(`incomplete`),i.slice(o,o+s).reduce((t,n)=>t.then(()=>{let{container:t,itemConfig:i}=r;return e.view.render(t,e.view.composeConfig(i,{expanded:n.expanded,last:n.last,hasChildren:n.hasChildren,children:n.children}),n.data,a).then(()=>{if(n.expanded&&n.hasChildren){let n=t.lastChild.querySelector(`.view-tree-leaf-children`);n.classList.add(`incomplete`),r={container:n,itemConfig:e.view.composeConfig(i,i.itemConfig),prev:r}}else for(;n.shift--;)r.container.classList.remove(`incomplete`),r=r.prev})}),Promise.resolve()).then(()=>e.view.maybeMoreButtons(n,null,i.length,o+s,s,(e,o)=>t(n,r,i,a,e,o))||n.classList.remove(`incomplete`))}function n(t,n,r,i){function a(t,r,i,c=0){t.forEach((t,l,u)=>{let d=e.query(i.children,t,n),f=Array.isArray(d)&&d.length>0,p=l===u.length-1,m=s.has(t)?0:typeof r==`function`?r(t,n):r;s.add(t),o.push({data:t,expanded:m,last:p,hasChildren:f,children:m?null:i.children,shift:p&&(!m||!f)?c+1:0}),f&&m&&a(d,typeof r==`number`?r-1:r,e.view.composeConfig(i,i.itemConfig),p?c+1:0)})}let o=[],s=new Set;return a(t,i,r),o}e.view.define(`tree`,function(r,i,a,o){let{children:s=`children`,item:c=`text`,itemConfig:l,collapsible:u,emptyText:d,onToggle:f}=i,{expanded:p,limit:m,limitLines:h=!0}=i;if(d!==!1&&d!==``&&r.setAttribute(`emptyText`,d||`Empty tree`),!Array.isArray(a)&&a&&(a=[a]),Array.isArray(a)){if(m=e.view.listLimit(m,25),h=e.view.listLimit(h,25),p=typeof p==`function`?p:e.view.listLimit(p,1),h){let e=n(a,o,this.composeConfig({children:s},l),p);return t(r,{container:r,itemConfig:this.composeConfig({view:`tree-leaf`,itemConfig:l,content:c,collapsible:u,onToggle:f},l)},e,o,0,h)}return this.renderList(r,this.composeConfig({view:`tree-leaf`,itemConfig:l,content:c,collapsible:u,expanded:p,children:s,limit:m,onToggle:f},l),a,o,0,m)}},{tag:`ul`,usage:y3})}var x3=`#.props | {
|
|
495
|
+
$items: children.query(@, #.context) | is array?;
|
|
496
|
+
|
|
497
|
+
itemConfig,
|
|
498
|
+
content is not undefined ?: 'text',
|
|
499
|
+
collapsible is not undefined ?: true,
|
|
500
|
+
onToggle,
|
|
501
|
+
expanded,
|
|
502
|
+
last,
|
|
503
|
+
hasChildren: hasChildren or $items.size() > 0,
|
|
504
|
+
children,
|
|
505
|
+
$items,
|
|
506
|
+
limit: limit | $ = false or is int ?: 25
|
|
507
|
+
}`;function S3(e){let t=new WeakMap;e.addHostElEventListener(`click`,({target:e})=>{let n=e.closest(`.view-tree-leaf-toggle`);if(n){let e=t.get(n),r=!n.parentNode.classList.toggle(`collapsed`);typeof e.render==`function`&&e.render(),typeof e.onToggle==`function`&&e.onToggle(r,n.parentNode,e.data,e.context)}},!1),e.view.define(`tree-leaf`,async function(e,n,r,i){let{expanded:a,hasChildren:o,children:s,items:c,content:l,itemConfig:u,collapsible:d,last:f,limit:p,onToggle:m}=n,h=e.appendChild($(`span`,`view-tree-leaf-toggle`)),g=e.appendChild($(`span`,`view-tree-leaf-content`));if(f&&e.classList.add(`last`),d||e.classList.add(`non-collapsible`),await this.render(g,l,r,i),o){let n=e.appendChild($(`ul`,`view-tree-leaf-children`)),o={data:r,context:i,onToggle:m,render:null},f=(e,t)=>(typeof t==`number`&&t--,this.renderList(n,this.composeConfig({view:`tree-leaf`,expanded:t,itemConfig:u,content:l,collapsible:d,children:s,limit:p,onToggle:m},u),e,i,0,this.listLimit(p,25)));e.classList.add(`has-children`),t.set(h,o),(typeof a==`function`?a(r,i):a)?c&&await f(c,a):(e.classList.add(`collapsed`),c&&(o.render=()=>{o.render=null,f(c,a||1)}))}},{tag:`li`,props:x3})}var C3=s({alerts:()=>r$,appHeader:()=>p$,autoLink:()=>m$,badges:()=>v$,block:()=>jQ,blockquote:()=>y$,button:()=>KZ,checkbox:()=>ZZ,checkboxList:()=>JZ,column:()=>NQ,columns:()=>PQ,contentFilter:()=>$Z,context:()=>I2,dropdown:()=>nQ,editors:()=>Uz,expand:()=>LQ,headers:()=>C$,hstack:()=>zQ,html:()=>T$,image:()=>k$,imagePreview:()=>j$,indicator:()=>N$,input:()=>cQ,link:()=>I$,listItem:()=>BQ,lists:()=>HQ,markdown:()=>s0,menu:()=>uQ,menuItem:()=>fQ,navButton:()=>hQ,pageHeader:()=>WQ,popup:()=>QQ,progressbar:()=>_Q,section:()=>e$,select:()=>yQ,signature:()=>t4,source:()=>z0,struct:()=>J4,switchView:()=>R2,tab:()=>EQ,table:()=>n3,tableCell:()=>g3,tableFooter:()=>s3,tableFooterCell:()=>m3,tableHeader:()=>i3,tableHeaderCell:()=>a3,tableRow:()=>h3,tabs:()=>SQ,text:()=>H0,textDiff:()=>E2,textMatch:()=>A2,textNumeric:()=>N2,textRender:()=>B2,tocSection:()=>t$,toggle:()=>OQ,toggleGroup:()=>kQ,tree:()=>b3,treeItem:()=>S3});function w3(e){e.page.define(`default`,{view:`switch`,content:[{when:`no #.datasets`,content:`preset/welcome-block`},{content:[`page-header{ content: "h1:#.name" }`,{view:`struct`,expanded:1}]}]}),e.preset.define(`welcome-block`,{view:`block`,className:`welcome-block`,data:`#.model`,content:[`app-header`,{view:`block`,className:`upload-data`,when:`#.actions.uploadFile`,content:[`preset/upload`,{view:`block`,className:`upload-notes`,content:`html:name + " is a server-less application that securely opens and analyzes your data directly on your device,<br>ensuring all processing is done locally without transmitting your data elsewhere."`}]}]})}function T3(e){e.page.define(`not-found`,['alert-warning:"Page `" + name + "` not found"'])}function E3(e,t=``){return typeof e==`string`?e:t}var D3=[`query`,`graph`,`view`,`viewEditorHidden`,`title`,`dzen`,`noedit`],O3=[`q`,`graph`,`v`,`vh`,`title`,`dzen`,`noedit`];function k3(e){let{query:t,graph:n,view:r,viewEditorHidden:i,title:a,dzen:o,noedit:s,...c}=typeof e==`string`?{query:e}:e,l=[];o&&l.push([`dzen`]),s&&l.push([`noedit`]),a&&l.push([`title`,a]),t&&l.push([`q`,YY(t)]),n&&l.push([`graph`,YY(JSON.stringify(n))]),typeof r==`string`&&l.push(r?[`v`,YY(r)]:[`v`]),i&&l.push([`vh`]);for(let[e,t]of Object.keys(c||{}).sort())D3.includes(e)||l.push([e,e.endsWith(`-b64`)&&typeof t==`string`?YY(t):t]);return l}function A3(e){let t=Object.fromEntries(e),n={title:E3(t.title),query:ZY(E3(t.q)),graph:JSON.parse(ZY(E3(t.graph))||`null`),view:`v`in t?ZY(E3(t.v)):void 0,viewEditorHidden:`vh`in t,dzen:`dzen`in t,noedit:`noedit`in t};for(let[e,r]of Object.entries(t))O3.includes(e)||(n[e]=e.endsWith(`-b64`)&&typeof r==`string`?ZY(r):t[e]);return n}function j3(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!D3.includes(e)))}function M3(e,t,...n){for(let r of Object.keys(e))if(e[r]!==t[r]&&!n.includes(r))return!1;for(let r of Object.keys(t))if(e[r]!==t[r]&&!n.includes(r))return!1;return!0}function N3(e,t={}){let n={...e,params:j3(e.params)};return!M3(t,n,`params`,`actions`)||!M3(t.params,n.params)||!M3(t.actions,n.actions)?n:t}function P3(e){return e&&typeof e==`object`&&`params`in e?e.params:{}}function F3(e){return e.replace(/\\/g,`\\\\`).replace(/\t/g,`\\t`).replace(/\r/g,`\\r`).replace(/\n/g,`\\n`).replace(/'/g,`\\'`)}function I3(e){return`{
|
|
508
|
+
${Object.keys(e).reduce((t,n)=>typeof e[n]==`string`?t.concat(` ${n}: '${F3(e[n])}'`):(n===`graph`||typeof e[n]==`boolean`)&&e[n]?t.concat(` ${n}: ${JSON.stringify(e[n])}`):t,[]).join(`,
|
|
509
|
+
`)}
|
|
510
|
+
}`}function L3(e){if(e&&(typeof e==`number`||typeof e==`string`)){let t=new Date(e);return isNaN(Number(t))?null:t}return e instanceof Date?e:null}function R3(e){let t=L3(e);return t?t.toISOString().replace(/^(\d{4})-(\d{2})-(\d{2})T([\d:]+).*/,`$3/$2/$1 $4 UTC`):null}function z3(e,t){let n,r,i,a,o=new e.view.Popup({render:(t,n,r)=>e.view.render(t,{view:`menu`,data:()=>[{text:`Copy page permalink`,disabled:!e.action.has(`permalink`),action:async()=>u$(await e.action.call(`permalink`,e.pageHash))},{text:`Copy page hash`,action:()=>u$(e.pageHash)},{text:`Copy page as JSON`,action:()=>u$(I3(e.pageParams))}],onClick(e){r(),e.action()}})}),s=$(`div`,`discovery-actions`,[a=$(`button`,{class:`edit-mode discovery-hidden-in-dzen`,title:`Toggle edit mode`,onclick(){this.blur(),t({noedit:!e.pageParams.noedit})}}),$(`button`,{class:`share`,title:`Sharing`,onclick(){this.blur(),o.show(this)}}),$(`button`,{class:`toggle-fullscreen`,title:`Toggle full page mode`,onclick(){this.blur(),t({dzen:!e.pageParams.dzen})}})]),c=e=>{e.parentNode.dataset.title=e.value||e.placeholder};return{el:[s,$(`div`,`discovery-header`,[$(`div`,{class:`discovery-header-text`,"data-title":`\xA0`},[n=$(`input`,{class:`discovery-hidden-in-dzen`,placeholder:`Untitled discovery`,oninput(){c(this)},onchange(){c(this),t({title:this.value},!0)},onkeypress(e){e.key===`Enter`&&this.blur()}}),$(`span`,`timestamp`,[r=$(`span`,null,` `),i=$(`span`)])])])],render(e,t){let{title:o,noedit:s}=P3(t),l=R3(t?.datasets?.[0]?.resource?.createdAt);n.value=o||``,c(n),a.classList.toggle(`disabled`,s),r.innerText=l?`Data collected at `+l+` | `:``,i.innerText=`Rendered at `+R3(new Date)}}}function B3(e,t,n){return e.length?`${e.length} ${e.length===1?t:n}`:`empty`}function V3(e,t,n){return Math.min(n,Math.max(e,t))}function H3(e){return Array.isArray(e)?`Array (${B3(e,`element`,`elements`)})`:e&&typeof e==`object`?`Object (${B3(Object.keys(e),`entry`,`entries`)})`:`Scalar (${e===null?`null`:typeof e})`}function U3(e){return $(`span`,`num-delim-wrapper`,pz(e))}function W3(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,e);if(t)for(let[e,r]of Object.entries(t))n.setAttribute(e,String(r));return n}function G3(e,t,n){Array.isArray(t)||(t=[]);let r=t.map(e=>({type:e.resource?.type||`unknown`,name:e.resource?.name||`unknown`}));if(TX(r,n))return n;e.replaceChildren();for(let t of r)e.appendChild($(`div`,`dataset`,[$(`span`,`dataset__type`,t.type),$(`span`,`dataset__name`,t.name)]));return r}function K3(e,t,n,r){function i(){return e.appendChild($(`div`,`query-graph-layer`))}function a(){return $(`div`,{class:`query-graph-node`,tabindex:-1,"data-action":`select`},[$(`div`,`query-graph-node__dot`),$(`div`,`query-graph-node__label`)])}function o(e,t,n){let r=e.lastElementChild,{label:i,text:a}=s(n);e.dataset.path=t.join(` `),r.classList.toggle(`has-label`,i),r.textContent=a}function s(e){if(e.label)return{label:!0,text:e.label};let{query:t}=e;if(typeof t==`string`){let e=t.match(/^\s*\/\/![ \t]*(\S.*)/);return e?{label:!0,text:e[1].trim()}:{label:!1,text:t.trim()}}return{label:!1,text:``}}function c(e,t,s,m,h){Array.isArray(h)||(h=[]),e||(u.push(e=i()),d.set(e,[]),f.push(0),u.length===1&&e.append($(`button`,{class:`view-button`,tabindex:-1,"data-action":`new-root-node`},`+`)));let g=h.length===1,_=h.length>1,v=d.get(e)?.shift()||e.appendChild(a()),y=f[m.length-1],b={parent:s,children:[],node:t,nodeEl:v,layerIndex:m.length-1,layerPos:y,layerOptPos:y};if(l.push(b),f[m.length-1]++,o(v,m,g?{...t,...r}:t),v.classList.toggle(`target`,g),v.classList.toggle(`current`,_),n.view.attachTooltip(v,{className:`query-graph-tooltip`,hideOnTriggerClick:!0,content:g?`badge:"Current query"`:{view:`source`,syntax:`=query | trim() ? "jora" : false`,source:`=query | trim() ?: "<empty query>"`,actionCopySource:!1,lineNum:!1}},{query:t.query}),Array.isArray(t.children))for(let n=0;n<t.children.length;n++){let r=c(e.nextSibling,t.children[n],b,m.concat(n),h[1]===n?h.slice(1):[]);b.children.push(r),p.push([v.lastChild,r.nodeEl])}return b}let l=[],u=[...e.querySelectorAll(`:scope > .query-graph-layer`)],d=u.reduce((e,t)=>e.set(t,[...t.querySelectorAll(`:scope > .query-graph-node`)]),new Map),f=Array(d.size).fill(0),p=[],m=e.querySelector(`:scope > svg`)||e.appendChild(W3(`svg`));for(let e=0;e<t.children.length;e++)c(u[0],t.children[e],null,[e],t.current[0]===e?t.current:[]);for(let e of d.values())for(let t of e)t.remove();let h=f.reduce((e,t)=>Math.max(e,t)),g=f.map(()=>0);for(let e of l){let{parent:t}=e;if(t){let n=t.node.children?.length||1,r=g[e.layerIndex],i=h-(f[e.layerIndex]-e.layerPos),a=V3(t.layerPos-Math.floor((n-1)/2),r,i);if(e.children.length>0&&r>0){let t=V3(e.children[0].layerPos,Math.max(a,g[e.layerIndex+1]),i);a+=V3(t-a,0,2)}e.layerPos=a}e.nodeEl.style.setProperty(`--pad`,String(e.layerPos-g[e.layerIndex])),g[e.layerIndex]=e.layerPos+1}requestAnimationFrame(()=>{let t=parseInt(getComputedStyle(e).gap),n=[],r=[];for(let[e,i]of p){let a=Oz(e,m),o=Oz(i,m),s=a.right+2,c=Math.max(o.left-t-10,s),l=a.top+a.height/2,u=o.left-3,d=o.top+o.height/2,f=(u-c)/3,p=i.classList.contains(`current`)||i.classList.contains(`target`),h=l===d?W3(`line`,{stroke:`#888`,x1:s,y1:l,x2:u,y2:d}):W3(`path`,{stroke:`#888`,fill:`none`,d:`M ${s} ${l} H ${c} C ${c+2*f} ${l} ${u-2*f} ${d} ${u} ${d}`});p?(r.push(h),h.classList.add(`current`)):n.push(h)}m.replaceChildren(...n,...r)})}function q3(e){let t={current:Array.isArray(e.current)?e.current:[],children:Array.isArray(e.children)?e.children:[]};return t.current.length===0&&t.current.push(0),t.children.length===0&&t.children.push({}),t}function J3(e,t){let n=[],r=e;for(let e=0;e<t.length;e++)r=r.children?.[t[e]]||{},n.push(r);return n}function Y3(e,t,n={}){let r=e.indexOf(t);if(r!==-1){let t=r+1;return e.splice(t,0,n),t}return e.push({})-1}function X3(e,t){let n=e.view.QueryEditor,r={},i,a=NaN,o=!1,s=NaN,c,l,u=q3({}),d,f=[],p=null,m=[],h=[],g=null,_=[],v,y,b=new n((t,n,r,i)=>v.checked?e.querySuggestions(t,n,r,i):null).on(`change`,(n,r)=>{y.checked&&(r.origin!==`setValue`&&(h=h.slice(),e.cancelScheduledRender()),p&&=(p.clear(),null),t({query:n},!0))}),x=e.getQueryEngineInfo(),S=$(`div`,`query-graph-actions`),C=$(`div`,`buttons`),w=$(`div`,`query-input`),T=$(`div`,`query-input-details`),E=$(`div`,`data-query-result`),D=$(`div`,`data-query-result-details`),O=$(`div`,`query-datasets`),k=$(`div`,`query-graph`),A=$(`div`,`query-path`),ee=$(`div`,`form query-editor-form`,[O,k,A,$(`div`,`query-editor`,[b.el])]);b.inputPanelEl.append(S,w,T,$(`a`,{class:`view-link query-engine`,href:x.link,target:`_blank`},[`${x.name} ${x.version||``}`])),b.outputPanelEl.append(E,C,D);let j=e=>({position:`trigger`,className:`hint-tooltip`,showDelay:!0,content:{view:`context`,data:typeof e==`function`?e:()=>e,content:`md`}});function te(e=``){M(({nextGraph:t,last:n})=>(Array.isArray(n.children)||(n.children=[]),n.query=c,n.view=l,t.current.push(n.children.push({})-1),{query:e,view:void 0,graph:t}))}e.view.render(S,[{view:`button`,className:`subquery`,tooltip:j(`Create a new query for a result of current one`),onClick:te},{view:`button`,className:`stash`,tooltip:j(()=>u.current.length<2?`Stash current query and create a new empty root query`:`Stash current query and create a new empty query for current parent`),onClick(){M(({nextGraph:e,last:t,preLast:n})=>{let r=n.children||[];return t.query=c,t.view=l,e.current[e.current.length-1]=Y3(r,t),{query:``,view:void 0,graph:e}})}},{view:`button`,className:`clone`,tooltip:j(`Clone current query`),onClick(){M(({nextGraph:e,last:t,preLast:n})=>{let r=n.children||[];return t.query=c,t.view=l,e.current[e.current.length-1]=Y3(r,t),{graph:e}})}},{view:`button`,className:`delete`,tooltip:j(`Delete current query and all the descendants`),onClick(){M(({nextGraph:e,last:t,preLast:n})=>{let r=n.children?.indexOf(t)??-1,i=n.query,a=n.view;if(n.children?.splice(r,1),n.children?.length||(n.children=void 0),e.current.pop(),e.current.length===0){let t=Math.max(0,Math.min(r-1,(e.children?.length||0)-1));e.current.push(t),i=e.children?.[t]?.query}return{query:i,view:a,graph:e}})}}]),C.append($(`label`,{class:`view-checkbox suggestions`,tabindex:0},[v=$(`input`,{class:`live-update`,type:`checkbox`,checked:!0,onchange(){b.focus(),b.cm.showHint()}}),$(`span`,`view-checkbox__label`,`suggestions`)]),$(`label`,{class:`view-checkbox live-update`,tabindex:0},[y=$(`input`,{class:`live-update`,type:`checkbox`,checked:!0,onchange({target:e}){b.focus(),e.checked&&t({query:b.getValue()},!0)}}),$(`span`,`view-checkbox__label`,`process on input`)])),e.view.attachTooltip(v.parentNode,j(()=>v.checked?`Query suggestions enabled<br>(click to disable)`:`Query suggestions disabled<br>(click to enable)`)),e.view.attachTooltip(y.parentNode,j(()=>y.checked?`Auto-perform query enabled<br>(click to disable)`:`Auto-perform query disabled<br>(click to enable)`)),e.view.render(C,{view:`button-primary`,content:`text:"Process"`,onClick:()=>{m=m.slice(0,u.current.length-1),t({query:b.getValue()},!0),e.scheduleRender(`page`)}}),A.addEventListener(`click`,({target:e})=>{let t=e.closest(`.query-path > *`),n=[...A.children].indexOf(t);n!==-1&&M(({nextGraph:e,currentPath:t,last:r})=>(r.query=c,e.current=e.current.slice(0,n+1),{query:t[n+1].query,graph:e}))}),k.addEventListener(`click`,({target:e})=>{let t=e.closest(`[data-action]`);if(k.contains(t))switch(t?.dataset.action){case`new-root-node`:M(({nextGraph:e,last:t})=>(t.query=c,t.view=l,e.current=[e.children.push({})-1],{query:``,view:void 0,graph:e}));break;case`select`:let{path:e}=t.dataset;typeof e==`string`&&e!==u.current.join(` `)&&M(({nextGraph:t,last:n})=>{let r=e.split(` `).map(Number),i=J3(t,r),a=i[i.length-1],o=a.query,s=a.view;return a.query=void 0,a.view=void 0,n.query=c,n.view=l,t.current=r,{query:o,view:s,graph:t}},!1)}});function ne(e,n=!0,r=!1){t(e,r),n&&setTimeout(()=>{b.focus(),b.cm.setCursor(b.cm.lineCount(),0)},0)}function M(e,t=!0){let n=JSON.parse(JSON.stringify(u)),r=[n,...J3(n,n.current)],i=r[r.length-1],a=r[r.length-2];ne(e({nextGraph:n,currentPath:r,last:i,preLast:a}),t)}function re(e){w.innerHTML=``,w.append($(`div`,{class:`query-input-data`,tabindex:-1,onclick(){i=i===`data`?void 0:`data`,ie(e)}},[$(`span`,{class:`query-input-variable`,"data-name":`input`},[`@`]),e.state===`awaiting`?`Computing...`:e.state===`canceled`?`Not available (undefined)`:U3(H3(e.data))]),$(`div`,{class:`query-input-context`,tabindex:-1,onclick(){i=i===`context`?void 0:`context`,ie(e)}},[$(`span`,{class:`query-input-variable`,"data-name":`context`},[`#`]),e.state===`awaiting`?`Computing...`:e.state===`canceled`?`Not available (undefined)`:U3(H3(e.context))])),ie(e)}function ie(t){if(b.inputPanelEl.classList.toggle(`details-expanded`,i!==void 0),w.dataset.details=i,i){let n=t.state!==`awaiting`&&t.state!==`canceled`?t[i]:NaN;n!==a&&(a=n,t.state===`awaiting`?T.textContent=`<div class="state-message">Computing...</div>`:t.state===`canceled`?T.innerHTML=`<div class="state-message">Not available because one of ancestor queries failed<div>`:(T.innerHTML=``,e.view.render(T,[{view:`struct`,expanded:1}],a)))}else a=NaN,T.innerHTML=``}function ae(e,t,n){let r=[$(`span`,`query-output-message`,Array.isArray(n)?n:[n])];t&&r.unshift($(`span`,`query-output-prelude`,[t])),E.replaceChildren($(`div`,{class:`query-result-data`+(e.state===`failed`?` error`:``),tabindex:-1,onclick(){o=!o,P(e)}},r))}function N(e){switch(e.state){case`canceled`:b.setValue(e.query),ae(e,`Result`,`Not available`);break;case`awaiting`:b.setValue(e.query),ae(e,null,`Awaiting...`);break;case`computing`:b.setValue(e.query,e.data,e.context),ae(e,null,`Computing...`);break;case`successful`:b.setValue(e.query,e.data,e.context),ae(e,`Result`,[U3(H3(e.computed)),` in `,U3(Math.floor(e.duration)),`ms`]);break;case`failed`:{let{error:t}=e,n=t?.details?.loc?.range,r=b.cm.doc;if(t&&Array.isArray(n)&&n.length===2){let[i,a]=n;p=t.details?.token===`EOF`||i===a||e.query[i]===`
|
|
511
|
+
`?r.setBookmark(r.posFromIndex(i),{widget:$(`span`,`discovery-editor-error`,` `)}):r.markText(r.posFromIndex(i),r.posFromIndex(a),{className:`discovery-editor-error`})}b.setValue(e.query,e.data,e.context),ae(e,`Error`,[t?.message.split(/\n/)[0].replace(/^(Parse error|Bad input).+/s,`Parse error`)||`Error`]);break}}P(e)}function P(t){if(b.outputPanelEl.classList.toggle(`details-expanded`,o),o){let n=t.state!==`awaiting`&&t.state!==`canceled`&&t.state!==`computing`?t.error||t.computed:NaN;if(n!==s)switch(s=n,t.state){case`awaiting`:D.innerHTML=`<div class="state-message">Awaiting for all of ancestor queries done<div>`;break;case`canceled`:D.innerHTML=`<div class="state-message">Not available because one of ancestor queries failed<div>`;break;case`failed`:D.innerHTML=`<div class="discovery-error query-error">`+fz(t.error?.message||``)+`</div>`;break;case`successful`:D.innerHTML=``,e.view.render(D,{view:`struct`,expanded:1},s)}}else s=NaN,D.innerHTML=``}function F(e){let t=k.querySelector(`[data-path="${e.path}"]`);t&&(t.dataset.state=e.state),e===g&&(re(e),N(e))}function I(t,n,r,i,a=e=>{setTimeout(e,1)}){if(t!==h)return Promise.reject(`Computation plan is canceled`);for(let o=n,s=!1;o<t.length;o++){let n=t[o];if(n.state===`awaiting`&&(n.state=`computing`),s?n.state=`canceled`:n.state===`failed`&&(s=!0),n.state!==`computing`){if(r=n.computed,i=n.context,F(n),n===g)return Promise.resolve(n);continue}return new Promise((s,c)=>{n.data=r,n.context=i,F(n),a(()=>{if(t!==h)return Promise.reject(`Computation plan is canceled`);let a=Date.now();try{n.computed=e.query(n.query,n.data,n.context),n.state=`successful`}catch(e){n.error=e,n.state=`failed`}n.duration=Date.now()-a,setTimeout(()=>I(t,o,r,i).then(s,c),1)})})}return Promise.reject(`No target computation found`)}function oe(e,t,n,r){let i=e.current,a=J3(e,i),o=[],s=null;for(let e=0,l=Math.min(i.length,r.length);e<l;e++){let l=r[e],u=e===i.length-1?c:a[e].query||``;if(!Object.is(l.query,u)||!Object.is(l.data,t)||!Object.is(l.context,n))break;o.push(l),l.path=i.slice(0,e+1).join(` `),t=l.computed,s=l.error}for(let e=o.length;e<i.length;e++){let t=e===i.length-1?c:a[e].query||``,n=r[e]={state:s?`canceled`:`awaiting`,path:i.slice(0,e+1).join(` `),query:t||``,data:void 0,context:void 0,computed:void 0,error:null,duration:0};r[e]=n,o.push(n)}return o}function se(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function L(e,t,n){let r=oe(e,t,n,m),i=r[r.length-1],a=!se(h,r),o=!se(_,e.current);h=r,_=e.current,i!==g&&(g=i,F(i));let s=I(h,0,t,n,e=>requestAnimationFrame(()=>setTimeout(e,1)));if(a||o){let e=new Map(r.map(({path:e,state:t})=>[e,t]));for(let t of k.querySelectorAll(`[data-path]`)){let n=t,r=n.dataset.state,i=e.get(n.dataset.path);r!==i&&(typeof i==`string`?n.dataset.state=i:delete n.dataset.state)}let t=document.createComment(``);k.replaceWith(t),t.replaceWith(k)}return g!==i&&(g=i,F(g)),s}return{el:ee,createSubquery:te,appendToQuery(e){ne({query:typeof c==`string`&&c.trimRight()!==``?c.replace(/(\n[ \t]*)*$/,()=>`
|
|
512
|
+
| `+e):e},!0,!0)},perform(t,n){let i=N3(n,d),a=P3(n),o=a.query,s=a.view,p=q3({...a.graph||r});return S.classList.toggle(`root`,p.current.length<2),f=G3(O,i.datasets||[],f),K3(k,p,e,{query:o,view:s}),u=p,d=i,c=o,l=s,L(u,t,i)}}}function Z3(e){return!!(e&&e.nodeType===Node.TEXT_NODE)}function Q3(e,t=`
|
|
513
|
+
`){let n=``;for(let r of e.childNodes)!Z3(r)&&r.previousSibling&&!Z3(r.previousSibling)&&(n+=t),n+=$3(r,t);return n}function $3(e,t=`
|
|
514
|
+
`){switch(e.nodeType){case Node.ELEMENT_NODE:let[n,r=``]=e.cloneNode().outerHTML.split(/(?=<\/[^>]+>$)/);return n+(e.firstChild&&!Z3(e.firstChild)?t+` `:``)+Q3(e,t+` `)+(e.lastChild&&!Z3(e.lastChild)?t:``)+r;case Node.TEXT_NODE:return e.nodeValue;case Node.COMMENT_NODE:return`<!--`+e.nodeValue+`-->`;case Node.DOCUMENT_FRAGMENT_NODE:return Q3(e,t)}return``}function e6(e,t){let n=[],r=[...Array.isArray(e.highlight)?e.highlight:e.highlight?[e.highlight]:[]];Array.isArray(e.highlightProps)&&r.push(`(")?(?:${e.highlightProps.join(`|`)})\\1(?=:)`);for(let e of r){let r=new RegExp(e,`gm`),i=null;for(;i=r.exec(t);)n.push({range:[i.index,i.index+i[0].length]})}return n}var t6=e=>(t,n)=>{let r=n.params?.render===`text`?`text`:`web`,i=[...e.view.values],a=[...e.textView.values];return{...n,render:r,views:{webViews:i,textViews:a,selected:r===`text`?a:i}}};function n6(e){let t={view:`context`,modifiers:[{view:`switch`,when:`beforeDemo`,content:[{when:({beforeDemo:e})=>typeof e==`string`,content:`html:"<p>" + beforeDemo + "</p>"`},{content:{view:`render`,config:`beforeDemo`,context:`{ __demoContext: true, ...(viewDef | { name, group, options }) }`}}]},{view:`block`,when:`demo or view`,className:`usage-render`,postRender(e,{onInit:t},{demoFixed:n},r){n&&(e.classList.add(`demo-fixed`),e.style.height=n+`px`),e.dataset.renderType=r.render,t(e,`root`)},content:{view:`render`,config:`demo or view | #.render != "text" ?: [{ view: "text-render", content: $ }, { view: "text-render-tree", when: false, content: $ }]`,data:`demoData`,context:`{ __demoContext: true, ...(viewDef | { name, group, options }) }`}},{view:`switch`,when:`afterDemo`,content:[{when:({afterDemo:e})=>typeof e==`string`,content:`html:"<p>" + afterDemo + "</p>"`},{content:{view:`render`,config:`afterDemo`,context:`{ __demoContext: true, ...(viewDef | { name, group, options }) }`}}]}],content:{view:`tabs`,when:`source != false`,className:`usage-sources`,name:`code`,tabs:[{value:`config`,text:`Config (JS)`},{value:`config-json`,text:`Config (JSON)`},{value:`html`,text:`Rendered HTML`}],content:{view:`switch`,content:[{when:`#.code="config"`,content:[{view:`expand`,when:`"demoData" in $`,header:`text:"Input data"`,content:{view:`struct`,expanded:2,data:`demoData`}},{view:`source`,className:`first-tab`,data:e=>{let t=HY(e.demo||e.view);return{syntax:`discovery-view`,content:t,refs:e6(e,t)}}}]},{when:`#.code="config-json"`,content:[{view:`expand`,when:`"demoData" in $`,header:`text:"Input data"`,content:{view:`struct`,expanded:2,data:`demoData`}},{view:`source`,data:e=>{let t=JSON.stringify(e.demo||e.view,null,4);return{syntax:`json`,content:t,refs:e6(e,t)}}}]},{when:`#.code="html"`,content:{view:`source`,data:(e,t)=>({syntax:`html`,content:Q3(t.root)})}}]}}};return{view:`block`,className:`discovery-view-usage`,context:t6(e),data({name:e,options:t},n){let r=n.views.selected.filter(e=>e.options.usage===t.usage).map(e=>e.name);return r.includes(e)||r.unshift(e),n.viewDef={demo:{view:e,data:`"`+e+`"`},...typeof t.usage==`function`?t.usage(e,r):Array.isArray(t.usage)?{examples:t.usage}:t.usage,name:e,group:r,options:t}},content:[`h1:name`,t,{view:`list`,data:`examples`,whenData:!0,itemConfig:{className:`usage-section`},item:[`h2{ anchor: true, data: title }`,t]}]}}var r6=`{
|
|
515
|
+
view: 'struct',
|
|
516
|
+
expanded: 1
|
|
517
|
+
}`,i6=[{name:`Table`,content:HY({view:`table`})},{name:`Auto-link list`,content:HY({view:`ol`,item:`auto-link`})},{name:`Signature`,content:HY({view:`signature`,expanded:2})},{name:`Text render`,content:HY({view:`text-render`,content:[`table`]})}];function a6(e,t,n){return $(`div`,{class:`discovery-editor-tab`,onclick:()=>n({view:t})},e||`Untitled preset`)}function o6(e,t){let n=e.view.ViewEditor,r=i6,i={},a,o,s,c,l,u=new n().on(`change`,e=>l.checked&&t({view:e},!0)),d=$(`div`,`buttons`),f=$(`div`,`form view-editor-form`,[$(`div`,`view-editor-form-header`,[$(`div`,`discovery-editor-tabs view-mode`,c=[`Default`,`Custom`].map(e=>$(`div`,{class:`discovery-editor-tab`,"data-mode":e.toLowerCase(),onclick(){this.classList.contains(`active`)?t({viewEditorHidden:!f.classList.contains(`hide-editor`)},!0):t({view:e===`Default`?void 0:r6,viewEditorHidden:!1},!0)}},e===`Custom`?[e,$(`span`,`show-view-editor-toggle`)]:e))),$(`div`,`discovery-editor-tabs presets`,r.map(({name:e,content:n})=>a6(e,n,t))),$(`div`,`view-editor-form-header-links`,`<a href="#views-showcase" class="view-link">Views showcase</a>`)]),$(`div`,`view-editor-form-content`,[$(`button`,{class:`view-button formatting`,title:`Prettify (input should be a JSON)`,onclick(){u.focus();try{let e=u.getValue().trim();t({view:HY(Function(`return 0,`+e)())})}catch(t){e.logger.error(`View editor prettify failed:`,t)}}}),u.el,$(`div`,`editor-toolbar`,[a=$(`div`,`view-expand`,[$(`div`,{class:`header`,onclick(){a.classList.toggle(`expanded`),s.classList.toggle(`visible`)}},[o=$(`div`,`header-content`),$(`div`,`trigger`)]),s=$(`div`,`view-editor-view-list`)]),$(`label`,`view-checkbox`,[l=$(`input`,{class:`live-update`,type:`checkbox`,checked:!0,onchange(){this.checked&&t({view:u.getValue()},!0)}}),$(`span`,`view-checkbox__label`,`build on input`)]),d])])]);e.view.render(d,{view:`button-primary`,content:`text:"Build"`,onClick(){i={},t({view:u.getValue()},!0),e.scheduleRender(`page`)}}),new e.view.Popup({className:`view-editor-view-list-hint`,hoverTriggers:`.view-editor-view-list .item.with-usage`,render(t,n){e.view.render(t,n6(e),e.view.get(n?.textContent),{})}}),o.textContent=`Available ${[...e.view.entries].filter(([,e])=>e.options.usage).length} views`;let p=()=>s.innerHTML=`<a href="#views-showcase" class="view-link">Views showcase</a><br><br>`+[...e.view.entries].sort().map(([e,t])=>`<div><a class="item view-link${t.options.usage?` with-usage`:``}" ${t.options.usage?`href="#views-showcase:`+e+`"`:``}>${e}</a></div>`).join(``);return p(),e.view.on(`define`,MZ(p,100)),{el:f,render(t,n,r){let a=N3(n,i.context),o=P3(n),s=typeof o.view==`string`?`custom`:`default`,l=s==="default"||o.viewEditorHidden===!0,d=o.view,p=null;if(u.setValue(d),f.classList.toggle(`hide-editor`,l),c.forEach(e=>e.classList.toggle(`active`,e.dataset.mode===s)),!d&&s==="default"&&(d=r6),i.view!==d||i.data!==t||i.context!==a){r.innerHTML=``;try{p=Function(`return `+(d?`0,`+d:`null`))(),e.view.render(r,p,t,a)}catch(t){e.view.render(r,n=>{n.className=`discovery-error render-error`,n.innerHTML=fz(String(t))+`<br>(see details in console)`,e.logger.error(t)})}i={data:t,context:a,view:d}}}}}function s6(e){function t(t,n){return e.setPageParams({...e.pageParams,...t},n)}function n(){if(o!==null)return o;let n=z3(e,t),r=X3(e,t),i=o6(e,t),a=$(`div`,{class:`discovery-editor discovery-hidden-in-dzen`,hidden:!0},[r.el,i.el]),s=$(`div`,`discovery-render-content`);return o={header:n,queryEditor:r,viewEditor:i,discoverEditorEl:a,discoverContentEl:s,layout:[...n.el,a,s]}}function r(e){return e===s}function i(e,t){r(t)&&n().queryEditor.createSubquery(e)}function a(e,t){r(t)&&n().queryEditor.appendToQuery(e)}let o=null,s=NaN;e.on(`pageStateChange`,t=>{e.pageId!==t.id&&(e.pageId===e.discoveryPageId?(e.action.define(`queryAcceptChanges`,r),e.action.define(`querySubquery`,i),e.action.define(`queryAppend`,a)):(e.action.revoke(`queryAcceptChanges`),e.action.revoke(`querySubquery`),e.action.revoke(`queryAppend`)))}),e.page.define(`discovery`,function(e,t,r){let{header:i,queryEditor:a,viewEditor:o,discoverEditorEl:c,discoverContentEl:l}=n();c.hidden=r?.params.noedit,i.render(t,r),s=NaN,a.perform(t,r).then(e=>{if(e.error){o.el.hidden=!0,l.hidden=!0;return}s=e.computed,o.el.hidden=!1,l.hidden=!1,o.render(s,r,l)},()=>{})},{reuseEl:!0,init(e){n().layout.forEach(t=>e.appendChild(t))},encodeParams:k3,decodeParams:A3})}var c6=`
|
|
518
|
+
## Working with views
|
|
519
|
+
|
|
520
|
+
In Discovery.js, presentations are organized as a tree of views. Views are defined using object notation, where the \`view\` property specifies the type, and additional properties allow further customization.
|
|
521
|
+
|
|
522
|
+
\`\`\`discovery-view
|
|
523
|
+
{
|
|
524
|
+
view: "view-name"
|
|
525
|
+
}
|
|
526
|
+
\`\`\`
|
|
527
|
+
|
|
528
|
+
A view definition takes \`data\` and \`context\` values, which can be used to define properties and control rendering. Views can transform data and context (using the \`data\` and \`context\` properties) for use by the view and its descendant views, enabling clear data flow. Views are rendered by calling the render method:
|
|
529
|
+
|
|
530
|
+
\`\`\`js
|
|
531
|
+
discovery.render(containerEl, viewDefinition, data, context)
|
|
532
|
+
\`\`\`
|
|
533
|
+
|
|
534
|
+
Discovery.js is designed to be declarative. For dynamic calculations or event handling, [jora](https://discoveryjs.github.io/jora/) queries are preferred over JavaScript functions.
|
|
535
|
+
|
|
536
|
+
Each view can use the following properties:
|
|
537
|
+
|
|
538
|
+
- \`view\` (required) — Specifies the view type.
|
|
539
|
+
- \`when\` — Controls whether the view should be rendered. Evaluated before \`data\` transformation.
|
|
540
|
+
- \`context\` — Transforms the input context for the view and its nested views.
|
|
541
|
+
- \`data\` — Transforms the input data for the view and its nested views.
|
|
542
|
+
- \`whenData\` — Controls rendering based on the computed \`data\`. Evaluated after \`context\` and \`data\` are set.
|
|
543
|
+
- \`className\` — Adds CSS class name(s) to the root element of the view (see [ClassName](#!classname)).
|
|
544
|
+
- \`postRender\` — A function executed after rendering the view but before placing it in the DOM.
|
|
545
|
+
- \`tooltip\` — Sets up a tooltip for the view (only applicable to views with a container element, see [Tooltips](#!tooltips)).
|
|
546
|
+
|
|
547
|
+
The sequence of property evaluation during rendering (view render lifecycle):
|
|
548
|
+
|
|
549
|
+
\`\`\`
|
|
550
|
+
[start] render(data, context)
|
|
551
|
+
\\ | |
|
|
552
|
+
* when() | | stop rendering when value is falsy
|
|
553
|
+
|\\ | |
|
|
554
|
+
| * context() ------------|-----* (async) replace \`context\` with new value
|
|
555
|
+
| \\ | |
|
|
556
|
+
| * data() -------------* | (async) replace \`data\` with new value
|
|
557
|
+
| \\ | |
|
|
558
|
+
| * whenData() | | stop rendering when value is falsy
|
|
559
|
+
| |\\ | |
|
|
560
|
+
| | * (render) | | (async) main render logic
|
|
561
|
+
| | \\ | |
|
|
562
|
+
| | * postRender() | | do something once (render) is done
|
|
563
|
+
| | \\ | |
|
|
564
|
+
| | * className() | | compute className and apply to root element
|
|
565
|
+
| | \\ V V
|
|
566
|
+
+-----+-----> * [finish render]
|
|
567
|
+
\`\`\`
|
|
568
|
+
|
|
569
|
+
- \`context\` and \`data\` — Modify the flow of context or data based on the provided value:
|
|
570
|
+
- **String** — Treated as a jora query, and its result is used.
|
|
571
|
+
- **Function** (\`fn(data, context)\`) — The result of the function invocation is used.
|
|
572
|
+
- **Other values** — Directly used as a new value for data or context.
|
|
573
|
+
- \`when\` and \`whenData\` — Determine if a view should be rendered:
|
|
574
|
+
- **String** — Treated as a jora query.
|
|
575
|
+
- \`true\` — Evaluated as an empty query, meaning the data itself is tested for truthiness.
|
|
576
|
+
- \`undefined\` — Treated as not specified, allowing rendering.
|
|
577
|
+
- **Function** (\`fn(data, context)\`) or other values — Evaluated for truthiness.
|
|
578
|
+
> Note: In jora, empty arrays and objects with no own keys are falsy, unlike JavaScript where they are truthy.
|
|
579
|
+
|
|
580
|
+
\`\`\`discovery-view
|
|
581
|
+
{
|
|
582
|
+
view: 'list',
|
|
583
|
+
data: 'some.list.sort(name asc)', // Fetch an array for the list view, based on current data
|
|
584
|
+
whenData: 'size() > 0', // Check if the array has elements, skip rendering if empty
|
|
585
|
+
item: 'text:name' // Render each element as text, displaying the name
|
|
586
|
+
}
|
|
587
|
+
\`\`\`
|
|
588
|
+
|
|
589
|
+
## Computable property values
|
|
590
|
+
|
|
591
|
+
If a property starts with \`=\`, it indicates a jora query used to compute the property's value before a rendering.
|
|
592
|
+
|
|
593
|
+
\`\`\`discovery-view
|
|
594
|
+
{
|
|
595
|
+
view: 'list',
|
|
596
|
+
limit: '=size() <= 12 ? false : 10' // Dynamically computes the limit based on flow data
|
|
597
|
+
}
|
|
598
|
+
\`\`\`
|
|
599
|
+
|
|
600
|
+
> To pass a literal string that starts with \`=\`, use a query like \`'="=some string"'\`.
|
|
601
|
+
|
|
602
|
+
## Shorthand notations
|
|
603
|
+
|
|
604
|
+
Discovery.js supports shorthand notations for defining views, making the configuration more concise:
|
|
605
|
+
|
|
606
|
+
| Shorthand notation | Expanded form |
|
|
607
|
+
| --------------------------------------- | -------------------------------------------------- |
|
|
608
|
+
| \`'name'\` | \`{ view: 'name' }\` |
|
|
609
|
+
| \`'name:<query>'\` | \`{ view: 'name', data: '<query>' }\` |
|
|
610
|
+
| \`'name{ foo: size() / 2, bar: "qux" }'\` | \`{ view: 'name', foo: '=size() / 2', bar: 'qux' }\` |
|
|
611
|
+
|
|
612
|
+
## Lists of views
|
|
613
|
+
|
|
614
|
+
Multiple views can be combined into a list using an array:
|
|
615
|
+
|
|
616
|
+
\`\`\`discovery-view
|
|
617
|
+
{
|
|
618
|
+
view: 'list',
|
|
619
|
+
item: [ // render two views as a content of a list item
|
|
620
|
+
'text:name',
|
|
621
|
+
{ view: 'badge', data: 'something.size()' }
|
|
622
|
+
]
|
|
623
|
+
}
|
|
624
|
+
\`\`\`
|
|
625
|
+
|
|
626
|
+
## ClassName
|
|
627
|
+
|
|
628
|
+
The \`className\` property uses a sequence of transformations to convert its input into a final array of class names. This process can start from different input forms — such as a jora query, a function, a string, or an array — and move through each step until a definitive result is obtained. At each stage, the current value is examined and transformed if applicable; if not, the process continues to the next step:
|
|
629
|
+
|
|
630
|
+
1. **Jora Query (String Starting with \`=\`)**
|
|
631
|
+
If the initial value begins with \`=\`, it is treated as a jora query and compiled into a function. That function is then processed as described in the next step.
|
|
632
|
+
|
|
633
|
+
\`\`\`discovery-view
|
|
634
|
+
{
|
|
635
|
+
view: "text",
|
|
636
|
+
className: "=isValid ? 'valid' : 'invalid'"
|
|
637
|
+
}
|
|
638
|
+
\`\`\`
|
|
639
|
+
<br>
|
|
640
|
+
|
|
641
|
+
2. **Function**
|
|
642
|
+
Once a function is available (either provided directly or obtained from a jora query) it is called with \`(data, context)\`. The return value can be a string or an array, otherwise discarded.
|
|
643
|
+
|
|
644
|
+
\`\`\`discovery-view
|
|
645
|
+
{
|
|
646
|
+
view: "text",
|
|
647
|
+
className: (data, context) => data.flag ? "highlighted" : null
|
|
648
|
+
}
|
|
649
|
+
\`\`\`
|
|
650
|
+
<br>
|
|
651
|
+
|
|
652
|
+
3. **String**
|
|
653
|
+
Any string (obtained from the previous steps or provided directly) is trimmed and split by whitespace to produce an array of class names, excluding empty entries.
|
|
654
|
+
|
|
655
|
+
\`\`\`discovery-view
|
|
656
|
+
{
|
|
657
|
+
view: "text",
|
|
658
|
+
className: "primary emphasized"
|
|
659
|
+
}
|
|
660
|
+
\`\`\`
|
|
661
|
+
<br>
|
|
662
|
+
|
|
663
|
+
4. **Array**
|
|
664
|
+
When the value is or becomes an array, each element is processed:
|
|
665
|
+
- If an element is a function, it is called with \`(data, context)\` and its result replaces the function.
|
|
666
|
+
- All falsy or empty results are removed.
|
|
667
|
+
|
|
668
|
+
\`\`\`discovery-view
|
|
669
|
+
{
|
|
670
|
+
view: "text",
|
|
671
|
+
className: [
|
|
672
|
+
"base-class",
|
|
673
|
+
data => data.error && "error-indicator",
|
|
674
|
+
""
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
\`\`\`
|
|
678
|
+
|
|
679
|
+
If \`data.error\` is true, this may result in \`class="base-class error-indicator"\`. If \`data.error\` is false, the array would become \`["base-class", false, ""]\`, and after filtering out falsy and empty values, it results in \`class="base-class"\`.
|
|
680
|
+
|
|
681
|
+
If, after all steps, there are no valid class names, the \`class\` attribute is not applied. This cascading process ensures any initial input — jora query, function, string, or array — is consistently transformed into a meaningful final list of class names.
|
|
682
|
+
|
|
683
|
+
## Tooltips
|
|
684
|
+
|
|
685
|
+
Tooltips can be configured using a simple view definition or an object with additional settings. When the \`tooltip\` value is a view definition, it becomes the \`content\` of the tooltip.
|
|
686
|
+
|
|
687
|
+
\`\`\`discovery-view
|
|
688
|
+
{
|
|
689
|
+
view: 'button',
|
|
690
|
+
tooltip: 'md:"Some **content**"'
|
|
691
|
+
}
|
|
692
|
+
\`\`\`
|
|
693
|
+
|
|
694
|
+
\`\`\`discovery-view
|
|
695
|
+
{
|
|
696
|
+
view: 'button',
|
|
697
|
+
tooltip: {
|
|
698
|
+
position: 'trigger',
|
|
699
|
+
content: 'md:"Some **content**"'
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
\`\`\`
|
|
703
|
+
|
|
704
|
+
| Tooltip value | Normalized tooltip config |
|
|
705
|
+
| --------------------------------- | ---------------------------------------------- |
|
|
706
|
+
| \`'shorthand-view-notation'\` | \`{ content: 'shorthand-view-notation' }\` |
|
|
707
|
+
| \`{ view: 'name', ... }\` | \`{ content: { view: 'name', ... } }\` |
|
|
708
|
+
| \`['view', { view: 'name', ... }]\` | \`{ content: ['view', { view: 'name', ... }] }\` |
|
|
709
|
+
|
|
710
|
+
Tooltip options:
|
|
711
|
+
|
|
712
|
+
- \`className\` — Additional class names for the tooltip element.
|
|
713
|
+
- \`position\` — Where the tooltip is positioned. Options are \`'trigger'\` or \`'pointer'\` (default).
|
|
714
|
+
- \`positionMode\` — Positioning mode. Options are \`'natural'\` (default) or \`'safe'\`.
|
|
715
|
+
- \`pointerOffsetX\` — Horizontal offset from the pointer (default: 3).
|
|
716
|
+
- \`pointerOffsetY\` — Vertical offset from the pointer (default: 3).
|
|
717
|
+
- \`hideOnTriggerClick\` – Hide the tooltip when click a trigger element.
|
|
718
|
+
- \`showDelay\` — Delay before showing the tooltip. Options are \`true\` (300ms, default), \`false\` (0ms), a number, or a function that returns a boolean or numeric value.
|
|
719
|
+
- \`content\` — View configuration for tooltip content.
|
|
720
|
+
`,l6=`
|
|
721
|
+
## Working with text views
|
|
722
|
+
|
|
723
|
+
Text views in Discovery.js adhere to the same underlying principles as standard web-based views but are simplified due to the constraints of textual representation (e.g., lack of interactivity and styling).
|
|
724
|
+
|
|
725
|
+
Text views are managed through the \`Model#textView\` interface, enabling text rendering for any model type (\`Model\`, \`ViewModel\`, \`ScriptModel\`, etc.):
|
|
726
|
+
|
|
727
|
+
\`\`\`js
|
|
728
|
+
model.textView.define('text-view-name', render);
|
|
729
|
+
// ...
|
|
730
|
+
const renderTree = model.textView.render(null, 'text-view-name:...', data, context);
|
|
731
|
+
const { text } = model.textView.serialize(renderTree);
|
|
732
|
+
|
|
733
|
+
console.log(text);
|
|
734
|
+
\`\`\`
|
|
735
|
+
|
|
736
|
+
Each text view supports a limited set of properties compared to regular views, but these retain the same semantics:
|
|
737
|
+
|
|
738
|
+
- \`view\` (required) — Specifies the view type.
|
|
739
|
+
- \`when\` — Controls whether the view should be rendered. Evaluated before \`data\` transformation.
|
|
740
|
+
- \`context\` — Transforms the input context for the view and its nested views.
|
|
741
|
+
- \`data\` — Transforms the input data for the view and its nested views.
|
|
742
|
+
- \`whenData\` — Controls rendering based on the computed \`data\`. Evaluated after \`context\` and \`data\` are set.
|
|
743
|
+
|
|
744
|
+
## Layout model
|
|
745
|
+
|
|
746
|
+
The text renderer builds a render tree composed of **box nodes** and **text nodes**.
|
|
747
|
+
|
|
748
|
+
- **Text nodes**: Represent direct text strings. Their values can include newline characters.
|
|
749
|
+
- **Box nodes**: Define the layout of their content and can optionally render a "border" around it. The content is generated by rendering child nodes, which can be a mix of box and text nodes. Box nodes support several display types:
|
|
750
|
+
- \`inline\` — Inserts its content lines as-is.
|
|
751
|
+
- \`inline-block\` — Ensures that whitespace is added before and after its content to prevent merging with adjacent boxes. If the content spans multiple lines, subsequent lines align with the first line.
|
|
752
|
+
- \`line\` — Places the box's content on a new line within its parent box.
|
|
753
|
+
- \`block\` — Similar to \`line\`, but also adds an extra empty line before and after the content when needed.
|
|
754
|
+
|
|
755
|
+
\`\`\`render:text
|
|
756
|
+
[
|
|
757
|
+
'text:"…text…"',
|
|
758
|
+
'inline:"<inline\\\\nwith multi-line\\\\ntext...>"',
|
|
759
|
+
'text:"…text…"',
|
|
760
|
+
'inline-block:"<inline-block\\\\nwith multi-line\\\\ntext...>"',
|
|
761
|
+
'text:"…text…"',
|
|
762
|
+
'line:"<line\\\\nwith multi-line\\\\ntext...>"',
|
|
763
|
+
'text:"…text…"',
|
|
764
|
+
'block:"<block\\\\nwith multi-line\\\\ntext...>"',
|
|
765
|
+
'text:"…text…"'
|
|
766
|
+
]
|
|
767
|
+
\`\`\`
|
|
768
|
+
|
|
769
|
+
## Box border
|
|
770
|
+
|
|
771
|
+
A box border is an optional decorative frame that can be drawn around a box node’s content. Although termed a "border", its appearance is highly customizable and might not resemble a traditional border. A border can consist of up to four sides – top, right, bottom, and left – and by default, boxes have no border.
|
|
772
|
+
|
|
773
|
+
There are slight differences in how vertical (left and right) and horizontal (top and bottom) borders are defined, though the corresponding pairs behave similarly.
|
|
774
|
+
|
|
775
|
+
### Vertical sides (left and right)
|
|
776
|
+
|
|
777
|
+
Left and right borders specify the characters to be prepended or appended to each line of the box’s content, effectively drawing vertical lines along the sides. The value for these borders can be defined in several ways:
|
|
778
|
+
|
|
779
|
+
- **Falsy value:** A falsy value (e.g., \`null\`, empty string) means no border is drawn.
|
|
780
|
+
- **String:** A static string that is added to the beginning (for \`left\`) or end (for \`right\`) of each line. For the \`right\` border, lines are padded with spaces to ensure consistent line lengths.
|
|
781
|
+
- **Function:** A function with the signature \`(index, total) => string | undefined\` for fine-tuned control. This allows different characters for the first, middle, and last lines. For example:
|
|
782
|
+
|
|
783
|
+
\`\`\`js
|
|
784
|
+
const leftBorder = (index, total) =>
|
|
785
|
+
total === 1 ? '[' :
|
|
786
|
+
index === 0 ? '⎡' :
|
|
787
|
+
index + 1 === total ? '⎣' : '⎢';
|
|
788
|
+
\`\`\`
|
|
789
|
+
|
|
790
|
+
If the function returns strings of varying lengths, they are padded with spaces (from the start for \`left\` and from the end for \`right\`) to equalize their lengths.
|
|
791
|
+
- **Array of strings:** An array of 1 to 4 strings representing \`start\`, \`middle\`, \`end\`, and \`single\` cases, respectively. For example:
|
|
792
|
+
|
|
793
|
+
\`\`\`js
|
|
794
|
+
const leftBorder = ['⎡', '⎢', '⎣', '['];
|
|
795
|
+
\`\`\`
|
|
796
|
+
|
|
797
|
+
This form is equivalent to a function that selects the appropriate border based on the line index and total number of lines:
|
|
798
|
+
|
|
799
|
+
\`\`\`ts
|
|
800
|
+
function borderLR(start: string, mid = start, end = mid, single = start) {
|
|
801
|
+
return (idx: number, total: number) =>
|
|
802
|
+
total === 1 ? single : idx === 0 ? start : idx + 1 === total ? end : mid;
|
|
803
|
+
}
|
|
804
|
+
\`\`\`
|
|
805
|
+
|
|
806
|
+
### Horizontal Sides (top and bottom)
|
|
807
|
+
|
|
808
|
+
Top and bottom borders define the first and last lines of the box after the left and right borders have been applied. Their value can be set in one of the following ways:
|
|
809
|
+
|
|
810
|
+
- **Falsy value:** No border is drawn if the value is falsy.
|
|
811
|
+
- **String:** A static string that is repeated to achieve the required total length (\`midLen + leftLen + rightLen\`).
|
|
812
|
+
- **Function:** A function with the signature \`(midLen, leftLen, rightLen) => string | undefined\` that returns a string. If the returned string is non-empty, it is truncated to match the total length. For example:
|
|
813
|
+
|
|
814
|
+
\`\`\`js
|
|
815
|
+
const topBorder = (midLength, leftLen, rightLen) =>
|
|
816
|
+
\`\${<}\${''.padEnd(midLength + leftLen + rightLen, '-')}\${>}\`;
|
|
817
|
+
\`\`\`
|
|
818
|
+
|
|
819
|
+
- **Array of strings:** An array of 1 to 3 strings representing \`start\`, \`middle\`, and \`end\` segments. This is equivalent to a function that constructs the border by concatenating the start, a repeated middle, and the end string. For example:
|
|
820
|
+
|
|
821
|
+
\`\`\`js
|
|
822
|
+
const topBorder = ['<', '-', '>'];
|
|
823
|
+
\`\`\`
|
|
824
|
+
|
|
825
|
+
This form is equivalent to a call the function:
|
|
826
|
+
|
|
827
|
+
\`\`\`ts
|
|
828
|
+
function borderTB(start: string, mid = start, end = mid) {
|
|
829
|
+
return (m: number, l: number, r: number) =>
|
|
830
|
+
\`\${start}\${''.padStart(m + l + r - start.length - end.length, mid)}\${end}\`;
|
|
831
|
+
}
|
|
832
|
+
\`\`\`
|
|
833
|
+
|
|
834
|
+
### Using borders in views
|
|
835
|
+
|
|
836
|
+
Most view definitions include a preset border that cannot be modified. However, any content can be wrapped in a basic box view (\`inline\`, \`inline-block\`, \`line\`, or \`block\`) to add a border.
|
|
837
|
+
|
|
838
|
+
For example, a full border definition using array notation for sides:
|
|
839
|
+
|
|
840
|
+
\`\`\`render:text
|
|
841
|
+
{
|
|
842
|
+
view: 'inline-list',
|
|
843
|
+
data: [1, 2, 3, 4, 5],
|
|
844
|
+
item: {
|
|
845
|
+
view: 'inline-block',
|
|
846
|
+
data: '$seq:=>?[...$ - 1 | $seq(), "line " + $]:[];$seq().join("\\\\n")',
|
|
847
|
+
border: {
|
|
848
|
+
top: ['←', '-', '→'],
|
|
849
|
+
left: ['↑ ', '|', '↓', '[ '],
|
|
850
|
+
right: [' ↑', '|', '↓', ' ]'],
|
|
851
|
+
bottom: ['←', '-', '→']
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
\`\`\`
|
|
856
|
+
|
|
857
|
+
Borders can also be specified in a compact array notation following the TRBL (top, right, bottom, left) order, similar to CSS:
|
|
858
|
+
|
|
859
|
+
\`\`\`render:text
|
|
860
|
+
{
|
|
861
|
+
view: 'block',
|
|
862
|
+
border: ['T', 'R', 'B', 'L'],
|
|
863
|
+
content: 'text:" \\\\n "'
|
|
864
|
+
}
|
|
865
|
+
\`\`\`
|
|
866
|
+
|
|
867
|
+
If the bottom border element is undefined, it inherits the top border value (if defined). Similarly, if the left border is undefined while the right border is specified, the left border adopts the right border value. This mechanism allows you to define vertical and horizontal borders with just two elements.
|
|
868
|
+
|
|
869
|
+
\`\`\`render:text
|
|
870
|
+
{
|
|
871
|
+
view: 'block',
|
|
872
|
+
border: ['-', '|'],
|
|
873
|
+
content: 'text:" \\\\n "'
|
|
874
|
+
}
|
|
875
|
+
\`\`\`
|
|
876
|
+
|
|
877
|
+
The following example demonstrates the difference between \`undefined\` and a falsy value (such as \`null\`):
|
|
878
|
+
|
|
879
|
+
\`\`\`render:text
|
|
880
|
+
{
|
|
881
|
+
view: 'block',
|
|
882
|
+
border: [['+', '-', '+'], '|', undefined, null],
|
|
883
|
+
content: 'text:" \\\\n "'
|
|
884
|
+
}
|
|
885
|
+
\`\`\`
|
|
886
|
+
|
|
887
|
+
Each element in the concise notation accepts any value applicable for a side in object notation, i.e. a string, a function or array of strings.
|
|
888
|
+
`,u6={view:`switch`,content:[{when:`syntax="render:text"`,content:{view:`block`,className:`view-render`,content:[{view:`block`,className:`view-render__source`,content:`source{ syntax: "discovery-view", source }`},{view:`block`,className:`view-render__result`,data:e=>({...e,config:{view:e.syntax===`render:text`?`text-render`:`context`,content:Function(`return `+e.source)()}}),content:`render{ config }`}]}},{content:`source`}]};function d6(e){e.on(`pageAnchorChange`,t=>{if(e.pageId===`views-showcase`&&t&&!e.pageAnchor){let t=e.dom.content.querySelector(`.page-views-showcase > .content`);t&&(t.scrollTop=0)}}),e.page.define(`views-showcase`,{view:`context`,context:t6(e),data:`#.views.selected`,modifiers:[{view:`block`,className:`sidebar`,content:[{view:`block`,className:`sidebar-header`,content:[{view:`link`,className:`="index-page-link" + (#.id ? " view-selected" : "")`,href:`="".pageLink(#.page, #.params.render |? { render: $ })`,text:`Intro`},{view:`context`,content:{view:`toggle-group`,className:`render-toggle`,beforeToggles:`text:"Render:"`,value:`=#.render`,onChange(t){e.setPageParams(t===`text`?{render:`text`}:{})},data:[{value:`web`},{value:`text`}]}}]},{view:`content-filter`,content:{view:`menu`,name:`view`,limit:!1,emptyText:`Nothing matched`,item:`text-match:{ text: name, match: #.filter }`,itemConfig:{postRender(e,t,n){e.dataset.name=n.name}},context:(t,n)=>({...n,selectedViewId:e.pageRef}),data:`
|
|
889
|
+
.[name ~= #.filter]
|
|
890
|
+
.sort(name asc)
|
|
891
|
+
.({ ..., disabled: no options.usage, selected: name = #.selectedViewId })
|
|
892
|
+
`}}]}],content:{view:`block`,className:`content`,data:`$[=> name=(#.view.name or #.id)]`,content:{view:`switch`,context(t,n){return e.overridePageHashStateWithAnchor({ref:t?.name,anchor:e.pageRef===(t?.name||null)?e.pageAnchor:null}),e.cancelScheduledRender(),setTimeout(()=>{let n=e.dom.root.querySelector(`article > .view-block.sidebar .index-page-link`),r=e.dom.root.querySelector(`article > .view-block.sidebar > .view-content-filter > .content`);n&&n.classList.toggle(`view-selected`,e.pageRef),r&&(r.querySelector(`:scope .view-menu-item.selected`)?.classList?.remove(`selected`),r.querySelector(`:scope .view-menu-item[data-name=${CSS.escape(t?.name)}]`)?.classList?.add(`selected`))},50),{...n,id:e.pageRef}},content:[{when:`no $ and #.id`,content:`alert-warning:"View \\"" + #.id + "\\" not found"`},{when:`no $`,content:[`h1:#.render = "text" ? "Model's text views" : "Model's views"`,`alert:"← Select a view to get details"`,{view:`markdown`,when:`#.render = "web"`,source:c6,codeConfig:u6},{view:`markdown`,when:`#.render = "text"`,source:l6,codeConfig:u6}]},{content:[n6(e)]}]}}},{sidebar:!1})}var f6=s({default:()=>w3,discovery:()=>s6,notFound:()=>T3,viewsShowcase:()=>d6}),p6=[`nav`,`sidebar`,`page`],m6=()=>{},h6=e=>e,g6=e=>Object.fromEntries(e);function _6(e,t,n){n?e.dataset[t]=n:delete e.dataset[t]}function v6(e,t,n,r){let i=e.page.get(t)?.options;return i!==void 0&&oz(i,n)?i[n]:r}function y6(e,t,n,r){let i=v6(e,t,n,r);return typeof i==`function`?i:r}var b6=class extends MX{compact;colorScheme;inspectMode;view;nav;preset;page;#e;#t;defaultPageId;discoveryPageId;reportToDiscoveryRedirect;pageId;pageRef;pageParams;pageAnchor;pageHash;dom;queryExtensions;constructor(e){let{container:t,styles:n,extensions:r,logLevel:i,compact:a,darkmode:o=`light-only`,darkmodePersistent:s=!1,colorScheme:c=o,colorSchemePersistent:l=s,defaultPage:u,defaultPageId:d,discoveryPageId:f,reportToDiscoveryRedirect:p=!0,inspector:m=!1}=e||{};super({...e,logLevel:i||`perf`,extensions:void 0}),(`darkmode`in e||`darkmodePersistent`in e)&&this.logger.warn(`ViewModel "darkmode" option is deprecated, use "colorScheme" instead`),this.compact=!!a,this.colorScheme=new ZX(c,l),this.inspectMode=new mz(!1),this.initDom(n),this.view=new TZ(this),this.nav=new $X(this),this.preset=new kZ(this.view),this.page=new OZ(this,this.view),this.#e=new Set,this.#t=16,this.defaultPageId=d||`default`,this.discoveryPageId=f||`discovery`,this.reportToDiscoveryRedirect=!!p,this.pageId=this.defaultPageId,this.pageRef=null,this.pageParams={},this.pageAnchor=null,this.pageHash=this.encodePageHash(this.pageId,this.pageRef,this.pageParams,this.pageAnchor),this.apply(C3),this.apply(f6),u&&this.page.define(this.defaultPageId,u),m&&this.apply(UZ),this.apply(r),this.setPageHash(this.pageHash),this.setContainer(t),this.scheduleRender();for(let{name:e,page:t}of this.objectMarkers.values)t&&!this.page.isDefined(t)&&this.logger.error(`Page reference "${t}" in object marker "${e}" doesn't exist`)}initRenderTriggers(){this.on(`context`,()=>this.scheduleRender()),this.on(`unloadData`,()=>this.scheduleRender()),this.on(`pageStateChange`,()=>this.scheduleRender(`nav`,`page`)),this.on(`pageAnchorChange`,()=>this.applyPageAnchor()),this.action.on(`define`,()=>this.scheduleRender(`nav`,`page`)).on(`revoke`,()=>this.scheduleRender(`nav`,`page`)),this.page.on(`define`,e=>{this.pageId===e&&(this.setPageHash(this.pageHash),this.scheduleRender(`page`))})}async setData(e,t){let{render:n=!0}=t||{};await super.setData(e,t),n&&this.scheduleRender()}async setDataProgress(e,t,n){let{dataset:r,progressbar:i}=n||{};this.cancelScheduledRender(),this.emit(`startSetData`,(...e)=>i?.subscribeSync(...e)||(()=>{})),await i?.setState({stage:`prepare`}),await this.setData(e,{dataset:r,setPrepareWorkTitle:i?.setStateStep.bind(i),render:!1}),await i?.setState({stage:`initui`}),this.scheduleRender(),await Promise.all([!this.dom.wrapper.parentNode||this.dom.ready,this.enforceScheduledRenders()]),i?.finish()}initDom(e){let t=$(`div`,`discovery`),n=t.attachShadow({mode:`open`}),r=n.appendChild($(`div`)),i=$(`article`),a=$(`div`,`discovery-nav discovery-hidden-in-dzen`),o=$(`nav`,`discovery-sidebar discovery-hidden-in-dzen`),s=$(`main`,`discovery-content`,[i]),c=NX(n,this.info.icon?e?.concat(`.discovery-root{--discovery-app-icon:url(${JSON.stringify(this.info.icon)}`):e);this.dom={ready:c,wrapper:t,root:n,container:r,nav:a,sidebar:o,content:s,pageContent:i,detachColorScheme:this.colorScheme.subscribe(e=>r.classList.toggle(`discovery-root-darkmode`,e===`dark`),!0)},r.classList.add(`discovery-root`,`discovery`),r.append(a,o,s),n.addEventListener(`click`,e=>{let t=e.target?.closest(`a`);!t||t.getAttribute(`target`)||t.origin===location.origin&&t.pathname===location.pathname&&(e.preventDefault(),e.stopPropagation(),t.classList.contains(`ignore-href`)||this.setPageHash(t.hash)||this.applyPageAnchor())},!0)}setContainer(e){e instanceof HTMLElement?e.append(this.dom.wrapper):this.dom.wrapper.remove()}disposeDom(){typeof this.dom.detachColorScheme==`function`&&(this.dom.detachColorScheme(),this.dom.detachColorScheme=null),this.dom.container.remove(),this.dom=null}addGlobalEventListener(e,t,n){return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}addHostElEventListener(e,t,n){let r=this.dom.container;return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}scheduleRender(...e){let t=!1;e.length===0&&(t=!0,e=[...p6]);for(let t of e)this.#e.add(t);this.#e.timer&&clearTimeout(this.#e.timer),this.#e.timer=setTimeout(()=>this.enforceScheduledRenders(),this.#t),this.logger.debug(`Scheduled renders: ${[...this.#e].join(`, `)} (requested: ${t?`all`:e.join(`, `)})`)}async enforceScheduledRenders(){let e=[...this.#e];this.logger.debug(`Enforce scheduled renders: ${e.join(`, `)||`none`}`),this.cancelScheduledRender();for(let t of e)switch(t){case`nav`:await this.renderNav();break;case`sidebar`:await this.renderSidebar();break;case`page`:await this.renderPage()}this.initRenderTriggers!==m6&&(this.initRenderTriggers(),this.initRenderTriggers=m6,this.#t=0)}cancelScheduledRender(e){let t=[...this.#e];e?this.#e.delete(e):this.#e.clear(),this.#e.size===0&&this.#e.timer&&(clearTimeout(this.#e.timer),this.#e.timer=null),this.#e.size!==t.length&&this.logger.debug(`Canceled renders: ${t.join(`, `)}`)}getRenderContext(){return{page:this.pageId,id:this.pageRef,params:this.pageParams,...this.getContext()}}renderNav(){return this.cancelScheduledRender(`nav`),this.nav.render(this.dom.nav,this.data,this.getRenderContext())}renderSidebar(){if(this.cancelScheduledRender(`sidebar`),this.hasDatasets()&&this.view.isDefined(`sidebar`)){let e=Date.now(),t=this.data,n=this.getRenderContext();return this.view.setViewRoot(this.dom.sidebar,`sidebar`,{data:t,context:n}),this.dom.sidebar.innerHTML=``,this.view.render(this.dom.sidebar,`sidebar`,t,n).finally(()=>this.logger.perf(`Sidebar rendered in ${Date.now()-e}ms`))}}encodePageHash(e,t=null,n,r=null){let i=e||this.defaultPageId,a=y6(this,e,`encodeParams`,h6)(n||{});return super.encodePageHash(i===this.defaultPageId?``:i,t,a,r)}decodePageHash(e){let{pageId:t,pageRef:n,pageParams:r,pageAnchor:i}=super.decodePageHash(e,e=>y6(this,e||this.defaultPageId,`decodeParams`,g6));return{pageId:t||this.defaultPageId,pageRef:n,pageParams:r,pageAnchor:i}}setPageHashState(e={},t=!1){return this.setPageHashStateWithAnchor({...e,anchor:null},t)}overridePageHashState(e,t=!1){return this.setPageHashState({...this.getPageHashState(),...e},t)}getPageHashState(){return{id:this.pageId,ref:this.pageRef,params:this.pageParams}}setPageHashStateWithAnchor(e,t=!1){let{id:n=null,ref:r=null,params:i={},anchor:a=null}=e;return this.setPageHash(this.encodePageHash(n||this.defaultPageId,r,i,a),t)}overridePageHashStateWithAnchor(e,t=!1){return this.setPageHashStateWithAnchor({...this.getPageHashStateWithAnchor(),...e},t)}getPageHashStateWithAnchor(){return{...this.getPageHashState(),anchor:this.pageAnchor}}setPage(e,t,n,r=!1){return this.setPageHashState({id:e,ref:t,params:n},r)}setPageRef(e=null,t=!1){return this.overridePageHashStateWithAnchor({ref:e},t)}setPageParams(e,t=!1){return this.overridePageHashStateWithAnchor({params:e},t)}setPageAnchor(e,t=!1){return this.overridePageHashStateWithAnchor({anchor:e},t)}setPageHash(e,t=!1){e.startsWith(`#`)||(e=`#`+e),e.startsWith(`#!`)&&(e=this.stripAnchorFromHash(this.pageHash)+(e.length>2?`&!anchor=`+e.slice(2):``));let{pageId:n,pageRef:r,pageParams:i,pageAnchor:a}=this.decodePageHash(e);if(this.reportToDiscoveryRedirect&&n===`report`&&this.discoveryPageId!==`report`&&setTimeout(()=>this.pageId===`report`&&this.setPageHashStateWithAnchor({id:this.discoveryPageId,ref:r,params:i,anchor:a},!0)),this.pageId!==n||this.pageRef!==r||!TX(this.pageParams,i)){let e=this.getPageHashState();this.pageId=n,this.pageRef=r,this.pageParams=i,this.emit(`pageStateChange`,e)}if(a!==this.pageAnchor){let e=this.pageAnchor;this.pageAnchor=a,this.emit(`pageAnchorChange`,e)}return e!==this.pageHash&&(this.pageHash=e,this.emit(`pageHashChange`,t),!0)}applyPageAnchor(e=!1){let t=this.dom.pageContent;if(this.pageAnchor){let e=t.querySelector(`#`+CSS.escape(`!anchor:`+this.pageAnchor));if(e){let n=t.querySelector(`.view-page-header`);e.style.scrollMargin=n?n.offsetHeight+`px`:``,e.scrollIntoView(!0)}}else e||(this.dom.content.scrollTop=0)}renderPage(){this.cancelScheduledRender(`page`);let{data:e,pageId:t,pageParams:n,compact:r}=this,i=this.getRenderContext();this.logger.debug(`Start page "${t}" rendering...`);let a=Date.now(),{pageEl:o,renderState:s,config:c}=this.page.render(this.dom.pageContent,t,e,i);return this.view.setViewRoot(o,`Page: ${t}`,{inspectable:!1,config:c,data:e,context:i}),this.dom.pageContent=o,_6(this.dom.container,`page`,t),_6(this.dom.container,`dzen`,!!n.dzen),_6(this.dom.container,`compact`,!!r),s.then(async()=>{await this.dom.ready,this.applyPageAnchor(!0)}).catch(e=>{this.logger.error(`Page "${t}" render error:`,e)}),s.finally(()=>{this.logger.perf(`Page "${t}" render done in ${Date.now()-a}ms`)})}};Object.assign(S6(),{setup:S6});var x6=e=>/^\./.test(e);function S6(e){return e={accept:`application/json,application/jsonxl,.json,.jsonxl`,useAcceptForFilePicker:!1,dragdrop:!0,clipboard:!1,...e},function(t){let n=!!e.useAcceptForFilePicker,r=!!e.dragdrop,i=!!e.clipboard,a=String(e.accept),o=a.split(`,`);r&&(t.dom.container.addEventListener(`drop`,e=>{t.loadDataFromEvent(e)},!0),t.dom.container.addEventListener(`dragover`,e=>{e.stopPropagation(),e.preventDefault()},!0),document.addEventListener(`paste`,e=>{let{files:n}=e.clipboardData||{files:[]};n?.length>0&&t.loadDataFromEvent(e)})),t.preset.define(`upload`,[{view:`button-primary`,text:'=`Open file${#.actions.uploadFile.fileExtensions |? " (" + join(", ") + ")" : "" | size() > 1 and size() <= 17 ?: "…"}`',onClick:`=#.actions.uploadFile`},{view:`context`,when:`#.actions.uploadDataFromClipboard`,content:[`html:"<span style=\\"color: #888; padding: 0 1ex\\"> or </span>"`,{view:`button`,text:`Paste from clipboard`,onClick:`=#.actions.uploadDataFromClipboard`}]},{view:`context`,when:`#.actions.uploadFile.dragdrop`,content:[`html:"<span style=\\"color: #888; padding: 0 1ex\\"> or </span>"`,`text:"drop a file on the page"`]}]),t.action.define(`unloadData`,()=>{t.unloadData()}),t.action.define(`uploadFile`,Object.assign(()=>{$(`input`,{type:`file`,accept:n?a:void 0,onchange:e=>t.loadDataFromEvent(e)}).click()},{fileExtensions:o.filter(e=>x6(e)),mimeTypes:o.filter(e=>!x6(e)),dragdrop:r,clipboard:i})),i&&t.action.define(`uploadDataFromClipboard`,async()=>{let e=await navigator.clipboard.readText();t.loadDataFromStream(new Blob([e]).stream())})}}Object.assign(D6(),{setup:D6});var C6=()=>{},w6=[`primary`,`secondary`,`menu`],T6=[`insert`,`prepend`,`append`,`before`,`after`,`replace`,`remove`];function E6(e,t,n){let r=Array.isArray(n)?n:[];return JSON.parse(JSON.stringify(e),(e,n)=>typeof n==`string`&&r.includes(n)?()=>t(`navMethod`,n):n)}function D6(e){let t=e?.hostId||i$(),n=e?.postponeMessages,r=typeof e?.onNotify==`function`?e.onNotify:()=>{};return function(e){let i=null,a=C6,o=t=>{i?.finish(),i=null,t&&e.logger.debug(`Cancel chunked data load from host with error:`,t)},s=window.parent,c=new Map,l=(e,n)=>{let r={from:`discoveryjs-app`,id:t,type:e,payload:n};s.postMessage(r,`*`)},u=e=>{a=()=>{e!==null&&(a=C6,e())}},d=t=>{e.trackLoadDataProgress(t).catch(()=>{})},f=({data:n})=>{let{id:a,type:s,payload:u}=n||{};if(a===t)switch(s){case`notification`:{let{name:e,details:t}=u;r(e,t);break}case`defineAction`:{let t=u;e.action.define(t,(...e)=>new Promise((n,r)=>{let i=i$();c.set(i,{resolve:n,reject:r}),setTimeout(()=>{c.delete(i),r(Error(`Timeout`))},3e4),l(`action`,{callId:i,name:t,args:e})}));break}case`actionResult`:{let{callId:t}=u;if(!c.has(t)){e.logger.error(`[Discovery.js] Unknown action call id "${t}"`);break}let{resolve:n,reject:r}=c.get(t);`error`in u?r(u.error):n(u.value);break}case`setPageHash`:{let{replace:t,hash:n}=u||{};e.setPageHash(n||``,t||!1);break}case`setPageHashState`:{let{replace:t,id:n,ref:r,params:i}=u||{};e.setPageHashState({id:n,ref:r,params:i},t);break}case`setPageHashStateWithAnchor`:{let{replace:t,id:n,ref:r,params:i,anchor:a}=u||{};e.setPageHashStateWithAnchor({id:n,ref:r,params:i,anchor:a},t);break}case`setPage`:{let{replace:t,id:n,ref:r,params:i}=u||{};e.setPage(n,r,i,t);break}case`setPageRef`:{let{replace:t,ref:n}=u||{};e.setPageRef(n,t);break}case`setPageParams`:{let{replace:t,params:n}=u||{};e.setPageParams(n,t);break}case`setPageAnchor`:{let{replace:t,anchor:n}=u||{};e.setPageAnchor(n,t);break}case`setColorSchemeState`:{let t=u;if(!WX.includes(t)){e.logger.warn(`Wrong value for colorScheme "${t}", supported values: ${WX.map(e=>JSON.stringify(e)).join(`, `)}`);break}e.colorScheme.set(t);break}case`setRouterPreventLocationUpdate`:e.action.call(`setPreventLocationUpdate`,!!u);break;case`changeNavButtons`:{let{section:t=`primary`,action:n=`unknown`}=u;if(!w6.includes(t)){e.logger.warn(`Wrong value for nav button place "${t}", supported values: ${w6.map(e=>JSON.stringify(e)).join(`, `)}`);break}switch(u.action){case`insert`:{let{name:n,position:r,config:i,commands:a}=u;e.nav[t].insert(E6(i,l,a),r,n);break}case`prepend`:case`append`:{let{config:n,commands:r}=u;e.nav[t][u.action](E6(n,l,r));break}case`before`:case`after`:case`replace`:{let{name:n,config:r,commands:i}=u;e.nav[t][u.action](n,E6(r,l,i));break}case`remove`:{let{name:n}=u;e.nav[t].remove(n);break}default:e.logger.warn(`Wrong value for nav button action "${n}", supported values: ${T6.map(e=>JSON.stringify(e)).join(`, `)}`)}break}case`unloadData`:o(),e.unloadData();break;case`dataStream`:{let{stream:e,resource:t}=u;o(),d(Jq(e,{resource:t}));break}case`startChunkedDataUpload`:{let{acceptToken:e,resource:t}=u;o(),i=Object.assign(Qq({resource:t}),{acceptToken:e}),d(i);break}case`cancelChunkedDataUpload`:{let{acceptToken:e,error:t}=u;i?.acceptToken===e&&o(t)}case`dataChunk`:{let{acceptToken:t}=u;if(i===null){e.logger.warn(`Loading data is not inited`);break}if(i.acceptToken!==t){e.logger.warn(`Bad accept token`);break}`value`in u&&u.value!==void 0&&i.push(u.value),`done`in u&&u.done&&o();break}default:e.logger.warn(`Got a post-message addressed to discovery app but with unknown "${s}" type`)}};s!==window&&(e.on(`pageHashChange`,t=>{l(`pageHashChanged`,{replace:t,hash:e.pageHash||`#`,id:e.pageId,ref:e.pageRef,params:e.pageParams,anchor:e.pageAnchor})}),e.on(`startLoadData`,e=>{a(),u(e(e=>l(`loadingState`,e)))}),e.on(`startSetData`,e=>{a(),u(e(e=>l(`loadingState`,e)))}),e.on(`data`,()=>{l(`data`,null)}),e.on(`unloadData`,()=>{a(),l(`unloadData`,null)}),e.colorScheme.subscribe((e,t)=>l(`colorSchemeChanged`,{state:t,value:XX(t)})),Array.isArray(n)&&Promise.resolve().then(()=>{for(let e of n)f({data:e})}),addEventListener(`message`,f,!1),addEventListener(`unload`,()=>l(`destroy`,null),!1),l(`ready`,{page:{hash:e.pageHash||`#`,id:e.pageId,ref:e.pageRef,params:e.pageParams,anchor:e.pageAnchor},colorScheme:{state:e.colorScheme.state,value:e.colorScheme.serializedValue}}))}}var O6=`.view-button{box-sizing:border-box;color:var(--discovery-view-button-color);background-color:var(--discovery-view-button-background-color);border:1px solid var(--discovery-view-button-border-color);font-family:inherit;font-size:inherit;text-align:center;cursor:pointer;--discovery-view-button-color:var(--discovery-color);--discovery-view-button-background-color:#ffffff1a;--discovery-view-button-border-color:#7f7f7f66;--discovery-view-button-hover-background-color:#dddddd4d;--discovery-view-button-hover-border-color:#aaa9;--discovery-view-button-active-background-color:#83838340;--discovery-view-button-active-border-color:var(--discovery-view-button-border-color);--discovery-view-button-focus-background-color:var(--discovery-view-button-background-color);--discovery-view-button-focus-border-color:#80808099;border-radius:3px;outline:none;margin:0;padding:8px 12px;line-height:1.2;display:inline-block;position:relative}.view-button:empty:before{content:"";float:left}.view-button:focus-visible{background-color:var(--discovery-view-button-focus-background-color);border-color:var(--discovery-view-button-focus-border-color);z-index:1;box-shadow:0 0 1px 3px #0af3}.view-button:hover,.view-button.discovery-view-popup-active{background-color:var(--discovery-view-button-hover-background-color);border-color:var(--discovery-view-button-hover-border-color)}.view-button:active{background-color:var(--discovery-view-button-active-background-color);border-color:var(--discovery-view-button-active-border-color)}.view-button[disabled]{opacity:.5;pointer-events:none;cursor:default}.view-button+.view-button{margin-left:1ex}.view-button-primary{--discovery-view-button-color:white;--discovery-view-button-background-color:#0af;--discovery-view-button-border-color:transparent;--discovery-view-button-hover-background-color:#009cf0;--discovery-view-button-hover-border-color:transparent;--discovery-view-button-active-background-color:#008ee0;--discovery-view-button-focus-border-color:transparent}.discovery-root-darkmode .view-button-primary{--discovery-view-button-color:#fffd;--discovery-view-button-background-color:#006aa3e6;--discovery-view-button-hover-background-color:#0074b3e6;--discovery-view-button-active-background-color:#006aa3d0}.view-button-danger{--discovery-view-button-color:white;--discovery-view-button-background-color:#ff6163;--discovery-view-button-border-color:transparent;--discovery-view-button-hover-background-color:#f05456;--discovery-view-button-hover-border-color:transparent;--discovery-view-button-active-background-color:#e34449;--discovery-view-button-focus-border-color:transparent}.discovery-root-darkmode .view-button-danger{--discovery-view-button-color:#fffd;--discovery-view-button-background-color:#c32224bf;--discovery-view-button-hover-background-color:#d02528bf;--discovery-view-button-active-background-color:#c32224a6}.view-button-warning{--discovery-view-button-color:#000000d6;--discovery-view-button-background-color:#ffcf21;--discovery-view-button-border-color:transparent;--discovery-view-button-hover-background-color:#fcbd00;--discovery-view-button-hover-border-color:transparent;--discovery-view-button-active-background-color:#f7ad00;--discovery-view-button-focus-border-color:transparent}.discovery-root-darkmode .view-button-warning{--discovery-view-button-color:#eeee;--discovery-view-button-background-color:#ffd40199;--discovery-view-button-hover-background-color:#ffd91aa6;--discovery-view-button-active-background-color:#ffd4018e}.view-checkbox-list>.view-checkbox{display:block}.view-checkbox{--discovery-checkbox-size:max(1em, 14px);padding-left:var(--discovery-checkbox-size)}.view-checkbox>input{appearance:none;content:"";font-size:inherit;box-sizing:border-box;height:var(--discovery-checkbox-size);width:var(--discovery-checkbox-size);margin:0;margin-left:calc(-1 * var(--discovery-checkbox-size));background-color:#fff3;background-position:50%;background-repeat:no-repeat;background-size:calc(.57 * var(--discovery-checkbox-size));border:1px solid #97a2aca6;border-radius:3px;outline:none;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;display:inline-block;position:relative;top:2px}.view-checkbox>input:checked{background-color:#0079e8ad;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 8 8\\">%0A <path fill=\\"%23fff\\" d=\\"M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z\\"/>%0A</svg>%0A");border-color:#0000}.view-checkbox>input:focus-visible{box-shadow:0 0 1px 3px #0af3}.view-checkbox>input:focus-visible:not(:checked){border-color:#008dffbf}.view-checkbox>input:active{background-color:#198bec99;border-color:#0000}.view-checkbox>input[readonly],.view-checkbox>input:disabled{box-shadow:none;background-color:#a5a5a54d;border-color:#a5a5a51a}.view-checkbox__label{margin-left:5px;margin-right:15px}.view-content-filter>.view-input{margin-bottom:1em;line-height:1}.view-content-filter>.view-input input{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 50 50\\">%0A <path fill=\\"rgba(150, 150, 150, 0.65)\\" d=\\"M 21 3 C 11.601563 3 4 10.601563 4 20 C 4 29.398438 11.601563 37 21 37 C 24.355469 37 27.460938 36.015625 30.09375 34.34375 L 42.375 46.625 L 46.625 42.375 L 34.5 30.28125 C 36.679688 27.421875 38 23.878906 38 20 C 38 10.601563 30.398438 3 21 3 Z M 21 7 C 28.199219 7 34 12.800781 34 20 C 34 27.199219 28.199219 33 21 33 C 13.800781 33 8 27.199219 8 20 C 8 12.800781 13.800781 7 21 7 Z \\"></path>%0A</svg>%0A");background-position:100%;background-repeat:no-repeat;background-size:32px 16px;padding-right:30px}.view-content-filter>.content{flex:1;overflow:auto}.view-content-filter>.content .view-list:before{padding:5px 10px;display:block}.view-dropdown{box-sizing:border-box;min-width:10ex;max-width:100%;color:var(--discovery-color);background-color:#ffffff1a;border:1px solid #7f7f7f66;border-radius:3px;outline:none;flex-shrink:0;align-items:center;padding-right:1.2em;line-height:1.2;display:inline-flex;position:relative;overflow:hidden}.view-dropdown:after{content:"";color:#999;pointer-events:none;cursor:pointer;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 28 28\\">%0A <path fill=\\"%23888\\" d=\\"M19,15.9393398 L24.4696699,10.4696699 C24.7625631,10.1767767 25.2374369,10.1767767 25.5303301,10.4696699 C25.8232233,10.7625631 25.8232233,11.2374369 25.5303301,11.5303301 L19.5303301,17.5303301 C19.2374369,17.8232233 18.7625631,17.8232233 18.4696699,17.5303301 L12.4696699,11.5303301 C12.1767767,11.2374369 12.1767767,10.7625631 12.4696699,10.4696699 C12.7625631,10.1767767 13.2374369,10.1767767 13.5303301,10.4696699 L19,15.9393398 Z\\" />%0A</svg>%0A");background-position:50%;background-size:1em;flex-shrink:0;align-items:center;width:1em;height:1em;display:flex;position:absolute;right:7px}.view-dropdown.discovery-view-popup-active,.view-dropdown:focus{z-index:1;border-color:#80808099;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33}.view-dropdown:hover{background-color:#dddddd4d;border-color:#aaa9}.view-dropdown:active{background-color:#83838340}.view-dropdown__caption{padding:8px 8px 8px 12px}.view-dropdown:not([data-placeholder]):empty .view-dropdown__caption:before{content:"|";visibility:hidden;padding:8px 0}.view-dropdown[data-placeholder]:empty .view-dropdown__caption:before{content:attr(data-placeholder);visibility:visible;color:#bbb;padding:8px 8px 8px 12px}.view-dropdown>*{pointer-events:none}.discovery-view-popup.view-dropdown-popup{flex-direction:column;display:flex;overflow:hidden}.discovery-view-popup.view-dropdown-popup>.content{flex-direction:column;flex:1;gap:5px;padding:8px;display:flex;overflow:hidden scroll}.discovery-view-popup.view-dropdown-popup>.confirm{text-align:right;background-color:#0003;padding:8px;font-size:80%}.discovery-view-popup.view-dropdown-popup>.confirm .view-button{padding-top:4px;padding-bottom:4px}.view-input input{box-sizing:border-box;width:100%;font-family:inherit;font-size:inherit;color:var(--discovery-color);background-color:#ffffff0d;border:1px solid #99999980;border-radius:3px;outline:0;margin:0;padding:8px 12px;line-height:1.2;position:relative}.view-input input:hover{border-color:#999999bf}.view-input input:focus{z-index:1;border-color:#00aaffa6;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33}.view-menu-item{color:inherit;cursor:pointer;padding:4px 12px;text-decoration:none;display:block}.view-menu-item:empty:before{content:"";float:left}.view-menu-item:hover,.view-menu-item.discovery-view-popup-active{background:#83838340}.view-menu-item.selected{cursor:default;background:#b2ddf84d}.view-menu-item.disabled{opacity:.65;pointer-events:none;background:0 0}.view-menu-item:not(.onclick):not([href]){pointer-events:none}.view-menu:empty:before{content:attr(emptyText);color:#888;padding:4px 12px;display:block}.view-menu>.more-buttons{margin:2px 12px 8px}.view-nav-button{vertical-align:top;color:#444;cursor:pointer;background-color:#9b9b9b26;outline:none;min-height:1.6em;padding:5px 15px 6px;font-size:12px;text-decoration:none;display:inline-block}.view-nav-button:hover,.view-nav-button:focus,.view-nav-button.discovery-view-popup-active{color:#000;background-color:#9797974d}.view-nav-button+.view-nav-button{margin-left:1px}.view-nav-button.disabled,.view-nav-button:not(.onclick):not([href]){pointer-events:none}.discovery-root-darkmode .view-nav-button{color:inherit}.view-progress{z-index:1;pointer-events:none;max-width:300px}.view-progress.skip-fast-track{transition:opacity .25s var(--appearance-delay,.5s);will-change:opacity;contain:paint}@starting-style{.view-progress.skip-fast-track{opacity:0}}.view-progress.skip-fast-track.done:not(.error){display:none}.view-progress>.progress{content:"";box-sizing:border-box;background:#c6c6c64d;border-radius:2px;height:3px;margin-top:4px;display:block;position:relative;overflow:hidden}.view-progress>.progress:before{content:"";width:100%;height:100%;transform:scaleX(var(--progress,0));transform-origin:0;background-color:var(--color,#1f7ec5);display:block;position:absolute;top:0;left:0}.view-progress>.content.main-secondary{white-space:nowrap;gap:1ex;display:flex}.view-progress>.content>.secondary{text-overflow:ellipsis;color:#888;flex:1;overflow:hidden}.view-select{box-sizing:border-box;min-width:10ex;max-width:100%;color:var(--discovery-color);background-color:#ffffff1a;border:1px solid #7f7f7f66;border-radius:3px;outline:none;flex-shrink:0;align-items:center;padding-right:1.2em;line-height:1.2;display:inline-flex;position:relative;overflow:hidden}.view-select:after{content:"";color:#999;pointer-events:none;cursor:pointer;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 28 28\\">%0A <path fill=\\"%23888\\" d=\\"M19,15.9393398 L24.4696699,10.4696699 C24.7625631,10.1767767 25.2374369,10.1767767 25.5303301,10.4696699 C25.8232233,10.7625631 25.8232233,11.2374369 25.5303301,11.5303301 L19.5303301,17.5303301 C19.2374369,17.8232233 18.7625631,17.8232233 18.4696699,17.5303301 L12.4696699,11.5303301 C12.1767767,11.2374369 12.1767767,10.7625631 12.4696699,10.4696699 C12.7625631,10.1767767 13.2374369,10.1767767 13.5303301,10.4696699 L19,15.9393398 Z\\" />%0A</svg>%0A");background-position:50%;background-size:1em;flex-shrink:0;align-items:center;width:1em;height:1em;display:flex;position:absolute;right:7px}.view-select.discovery-view-popup-active,.view-select:focus{z-index:1;border-color:#80808099;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33}.view-select:hover{background-color:#dddddd4d;border-color:#aaa9}.view-select:active{background-color:#83838340}.view-select .view-menu-item{padding-top:8px;padding-bottom:8px;padding-right:8px}.view-select:empty:not([data-placeholder]):before{content:"|";visibility:hidden;padding:8px 0}.view-select:empty[data-placeholder]:before{content:attr(data-placeholder);visibility:visible;opacity:.3;padding:8px 8px 8px 12px}.view-select>*{pointer-events:none}.discovery-view-popup.view-select-popup{flex-direction:column;display:flex;overflow:hidden}.discovery-view-popup.view-select-popup>.view-select__variants{flex-direction:column;flex:1;min-width:100%;display:flex;overflow:auto}.discovery-view-popup.view-select-popup>.view-select__variants:not(:last-child){border-bottom:1px solid #cacacaa6}.discovery-view-popup.view-select-popup>.view-select__filter{border-bottom:1px solid #cacacaa6;margin:0}.discovery-view-popup.view-select-popup>:not(.view-tabs)+.view-select__filter{border-top:1px solid #cacacaa6}.discovery-view-popup.view-select-popup>.view-select__filter input,.discovery-view-popup.view-select-popup>.view-select__filter input:focus{box-shadow:none;border:none;outline:none}.discovery-view-popup.view-select-popup .reset-item{color:#aaa}.discovery-view-popup.view-select-popup .reset-item:empty:before{content:"(nothing selected)";visibility:visible}.view-tab{border-bottom:var(--discovery-view-tabs-border);cursor:pointer;white-space:nowrap;text-transform:capitalize;padding:3px 11px;font-size:13px;display:inline-block;position:relative}.view-tab.active{z-index:10;cursor:default;border-bottom:none;padding-bottom:4px}.view-tab.active:before{content:"";z-index:-1;border:var(--discovery-view-tabs-border);pointer-events:none;border-bottom:none;border-radius:5px 5px 0 0;position:absolute;inset:0}.view-tab.disabled{color:#aaa}.view-tab.disabled,.view-tab:not(.onclick){pointer-events:none}.view-tabs-buttons{--discovery-view-tabs-border:1px solid #aaa6;flex-wrap:wrap;align-items:flex-end;margin-top:2px;display:flex}.view-tabs-buttons:before,.view-tabs-buttons:after{content:"";border-bottom:var(--discovery-view-tabs-border);width:6px}.view-tabs-buttons:after{flex:1}.view-tabs-buttons-before,.view-tabs-buttons-after{border-bottom:var(--discovery-view-tabs-border);color:#888;padding:0 6px 3px;font-size:13px}.view-tabs-content{overflow:auto}.view-toggle-group{flex-wrap:wrap;align-items:baseline;display:inline-flex}.view-toggle-group-before{padding-right:1ex}.view-toggle-group-after{order:1000;padding-left:1ex}.view-toggle-group .view-toggle+.view-toggle{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:1px}.view-toggle-group .view-toggle:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.view-toggle{cursor:pointer;white-space:nowrap;background:#c8c8c833;border-radius:4px;padding:3px 12px;font-size:13px;display:inline-block;position:relative}.view-toggle:hover{background-color:#4ebbff33}.view-toggle.checked{cursor:default;background-color:#4ebbff4d}.view-toggle.disabled{color:#aaa}.view-toggle.disabled,.view-toggle:not(.onclick){pointer-events:none}.CodeMirror{color:#000;direction:ltr;height:300px;font-family:monospace}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{white-space:nowrap;background-color:#f7f7f7;border-right:1px solid #ddd}.CodeMirror-linenumber{text-align:right;color:#999;white-space:nowrap;min-width:20px;padding:0 3px 0 5px}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;width:auto;border:0!important}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection{background:0 0}.cm-fat-cursor .CodeMirror-line>span::selection{background:0 0}.cm-fat-cursor .CodeMirror-line>span>span::selection{background:0 0}.cm-fat-cursor .CodeMirror-line::-moz-selection{background:0 0}.cm-fat-cursor .CodeMirror-line>span::-moz-selection{background:0 0}.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:0 0}.cm-fat-cursor{caret-color:#0000}@keyframes blink{50%{background-color:#0000}}.cm-tab{-webkit-text-decoration:inherit;text-decoration:inherit;display:inline-block}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute;top:0;bottom:0}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{background:#fff;position:relative;overflow:hidden}.CodeMirror-scroll{z-index:0;outline:none;height:100%;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;position:relative;overflow:scroll!important}.CodeMirror-sizer{border-right:50px solid #0000;position:relative}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{z-index:6;outline:none;display:none;position:absolute}.CodeMirror-vscrollbar{top:0;right:0;overflow:hidden scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow:scroll hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{z-index:3;min-height:100%;position:absolute;top:0;left:0}.CodeMirror-gutter{white-space:normal;vertical-align:top;height:100%;margin-bottom:-50px;display:inline-block}.CodeMirror-gutter-wrapper{z-index:4;position:absolute;background:0 0!important;border:none!important}.CodeMirror-gutter-background{z-index:4;position:absolute;top:0;bottom:0}.CodeMirror-gutter-elt{cursor:default;z-index:4;position:absolute}.CodeMirror-gutter-wrapper ::selection{background-color:#0000}.CodeMirror-gutter-wrapper ::selection{background-color:#0000}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{font-family:inherit;font-size:inherit;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual;background:0 0;border-width:0;border-radius:0;margin:0;position:relative;overflow:visible}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{z-index:0;position:absolute;inset:0}.CodeMirror-linewidget{z-index:2;padding:.1px;position:relative}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{box-sizing:content-box}.CodeMirror-measure{visibility:hidden;width:100%;height:0;position:absolute;overflow:hidden}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;z-index:3;position:relative}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection{background:#d7d4f0}.CodeMirror-line>span::selection{background:#d7d4f0}.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection{background:#d7d4f0}.CodeMirror-line>span::-moz-selection{background:#d7d4f0}.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:0 0}.cm-s-neo.CodeMirror{color:#2e383c;background-color:#fff;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{background-color:#0000;border:none;border-right:10px solid #0000}.cm-s-neo .CodeMirror-linenumber{color:#e0e2e5;padding:0}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo .CodeMirror-cursor{z-index:1;background:#9b9da25e;border:0;width:auto}.discovery-view-editor-hints-popup{z-index:1000;box-sizing:border-box;color:#000;min-width:200px;max-height:20em;font-family:var(--discovery-monospace-font-family);background:#fff;border:1px solid #b0b0b0a6;border-radius:2px;margin:0;padding:0;font-size:12px;line-height:18px;list-style:none;position:absolute;overflow:hidden auto;box-shadow:2px 3px 5px #0003}.discovery-root-darkmode .discovery-view-editor-hints-popup{color:#ccc;background:#323232}.discovery-view-editor-hint{white-space:pre;cursor:pointer;align-items:baseline;margin:0;padding:2px 6px;display:flex}.discovery-view-editor-hint:hover{background-color:#b4b4b433}.discovery-view-editor-hint .name{flex:1}.discovery-view-editor-hint .match{color:#06c}.discovery-root-darkmode .discovery-view-editor-hints-popup .discovery-view-editor-hint .match{color:#4d8bca}.discovery-view-editor-hint.active{background:#0af3}.discovery-view-editor-hint:before{content:"?";aspect-ratio:1;color:#888;text-align:center;border:1px solid;border-radius:3px;place-self:center;height:1em;margin-left:-2px;margin-right:4px;padding:2px;font-size:8px;line-height:1;display:inline-block}.discovery-view-editor-hint.type-variable:before{content:"$"}.discovery-view-editor-hint.type-property:before{content:"P"}.discovery-view-editor-hint.type-value:before{content:"V"}.discovery-view-editor-hint.type-method:before{content:"M"}.discovery-view-editor-hint.type-assertion:before{content:"A"}.discovery-view-editor{--editor-border-color:#7c7c7ca6;border:1px solid var(--editor-border-color);background-color:var(--discovery-background-color);border-radius:3px;flex-direction:column;margin-bottom:5px;display:flex}.discovery-view-editor:focus-within{--editor-border-color:#008dffbf;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33!important}.discovery-view-editor .discovery-view-editor__input-panel{order:0}.discovery-view-editor .discovery-view-editor__output-panel{order:2}.discovery-view-editor .CodeMirror{height:auto;font-family:var(--discovery-monospace-font-family);background-color:var(--discovery-input-bg-color);order:1;padding:2px 8px;font-size:12px;transition:background-color .25s ease-in,color .25s ease-in;overflow-y:hidden!important}.discovery-root-darkmode .discovery-view-editor .CodeMirror{color:#d1c7c3}.discovery-view-editor .CodeMirror-scroll{cursor:text;height:auto;min-height:6.5em;overflow-y:hidden!important}.discovery-view-editor.empty-value:not(:focus-within) .CodeMirror .CodeMirror-lines>div[role=presentation]:before{content:attr(data-placeholder);color:#666;position:absolute}.discovery-view-editor .CodeMirror .CodeMirror-line,.discovery-view-editor .CodeMirror .CodeMirror-line-like{padding:0}.discovery-view-editor .CodeMirror-cursor{border-left:1px solid var(--discovery-color,black);background:0 0}.discovery-view-editor .CodeMirror-focused .CodeMirror-selected{background-color:#00aaff38}.discovery-view-editor .CodeMirror-selected{background-color:#7e7e7e4d}.discovery-view-editor .CodeMirror .cm-comment{color:var(--discovery-fmt-comment-color)}.discovery-view-editor .CodeMirror .cm-keyword{color:var(--discovery-fmt-keyword-color)}.discovery-view-editor .CodeMirror .cm-property{color:var(--discovery-fmt-property-color)}.discovery-view-editor .CodeMirror .cm-atom{color:var(--discovery-fmt-atom-color)}.discovery-view-editor .CodeMirror .cm-number{color:var(--discovery-fmt-number-color)}.discovery-view-editor .CodeMirror .cm-type{color:var(--discovery-fmt-type-color)}.discovery-view-editor .CodeMirror .cm-node,.discovery-view-editor .CodeMirror .cm-tag{color:#9c3328}.discovery-view-editor .CodeMirror .cm-string,.discovery-view-editor .CodeMirror .cm-string-2{color:var(--discovery-fmt-string-color)}.discovery-view-editor .CodeMirror .cm-variable,.discovery-view-editor .CodeMirror .cm-variable-2,.discovery-view-editor .CodeMirror .cm-def,.discovery-view-editor .CodeMirror .cm-qualifier{color:var(--discovery-fmt-variable-color)}.discovery-view-editor .CodeMirror .cm-discovery-view-name{background-color:var(--discovery-fmt-string-highlight-color);border-bottom:1px dashed}.view-inline-list>.view-list-item,.view-comma-list>.view-list-item{list-style:none;display:inline-block}.view-comma-list>.view-list-item>*{margin-right:0}.view-comma-list>.view-list-item:after{content:", ";white-space:pre}.view-comma-list>.view-list-item:last-child:after{content:""}.view-list{list-style:none;display:block}.view-ul,.view-ol{margin:0;padding-left:0}.view-ul:not(:empty),.view-ol:not(:empty){padding-left:20px}:is(.view-list,.view-ul,.view-ol)+:is(.view-list,.view-ul,.view-ol),.view-list-item>:is(.view-list,.view-ul,.view-ol){margin-top:0;margin-bottom:2px}.view-inline-list,.view-comma-list{display:inline-block}.view-list:empty:before,.view-inline-list:empty:before,.view-ul:empty:before,.view-ol:empty:before{content:attr(emptyText);color:#888}.view-alert{color:#383d41;background-color:#8b8f9740;background-clip:padding-box;border:1px solid #989da566;border-radius:.25rem;margin-bottom:1rem;padding:.75rem 1.25rem;position:relative}.discovery-root-darkmode .view-alert{color:var(--discovery-color)}.view-alert:last-child{margin-bottom:0}.view-alert>:first-child{margin-top:0}.page>.view-alert:first-child,.page>.view-alert-success:first-child,.page>.view-alert-danger:first-child,.page>.view-alert-warning:first-child{margin-top:15px}.view-alert-primary{color:#004085;background-color:#3397ff40;border-color:#4da2ff66}.discovery-root-darkmode .view-alert-primary{color:#6a96c6}.view-alert-success{color:#155724;background-color:#53b76b40;border-color:#69c07d66}.discovery-root-darkmode .view-alert-success{color:#5fab70}.view-alert-danger{color:#721c24;background-color:#e35f6b40;border-color:#e6707d66}.discovery-root-darkmode .view-alert-danger{color:#c7888e}.view-alert-warning{color:#856404;background-color:#ffcf3740;border-color:#ffd45266}.discovery-root-darkmode .view-alert-warning{color:#bdab77}.view-app-header{align-items:center;gap:10px;display:flex}.view-app-header:not(:last-child){margin-bottom:30px}.view-app-header .icon{--icon:var(--discovery-app-icon);float:left;aspect-ratio:1;vertical-align:middle;background:50% no-repeat;background-image:var(--icon,var(--discovery-app-icon));background-color:#f4f4f4;background-size:48px;border-radius:3px;width:48px;padding:4px;line-height:1;display:inline-block}.discovery-root-darkmode .view-app-header .icon{background-color:#2b2b2b}.view-app-header h1{margin:0;font-family:Helvetica Neue,Helvetica,Tahoma,Arial,sans-serif;font-size:30px;font-weight:200;line-height:31px}.view-app-header .version{vertical-align:top;opacity:.4;margin-left:1ex;font-size:12px;line-height:18px;display:inline-block}.view-app-header .version:hover{opacity:.75}.view-app-header .description{color:#aaa;font-size:12px;line-height:19px}.view-badge,.view-pill-badge{--discovery-view-badge-color:#87878733;--discovery-view-badge-text-color:var(--discovery-color);text-shadow:1px 1px #ffffff59;background:var(--discovery-view-badge-color);color:var(--discovery-view-badge-text-color);white-space:nowrap;border-radius:3px;margin-right:1ex;padding:1px 6px 3px;font-size:85%;text-decoration:none}.view-pill-badge{border-radius:9px}.discovery-root-darkmode .view-badge,.discovery-root-darkmode .view-pill-badge{background:var(--discovery-view-badge-dark-color,var(--discovery-view-badge-color));color:var(--discovery-view-badge-dark-text-color,var(--discovery-view-badge-text-color));text-shadow:1px 1px #0000001a}.view-badge[href]:hover,.view-badge.onclick:hover,.view-pill-badge[href]:hover,.view-pill-badge.onclick:hover{color:var(--discovery-color);cursor:pointer;background-image:linear-gradient(#0000001a,#0000001a)}.view-badge>.prefix{background-color:#0000001f;border-radius:3px 0 0 3px;margin:-1px 6px -3px -6px;padding:1px 6px 3px}.view-badge>.postfix{background-color:#0000001f;border-radius:0 3px 3px 0;margin:-1px -6px -3px 6px;padding:1px 6px 3px}.view-pill-badge>.prefix{background-color:#0000001f;border-radius:8px 0 0 8px;margin:-1px 6px -3px -6px;padding:1px 6px 3px}.view-pill-badge>.postfix{background-color:#0000001f;border-radius:0 8px 8px 0;margin:-1px -6px -3px 6px;padding:1px 6px 3px}.discovery-buildin-view-tooltip .view-badge,.discovery-buildin-view-tooltip .view-pill-badge{margin:0 0 3px -5px;padding-top:0;padding-bottom:1px;line-height:19px;display:inline-block}.view-blockquote{border-left:.25em solid var(--color,#bfc5c580);margin:1px 0;padding:0 0 0 1em}.view-blockquote:not([data-kind]){color:#6a737d}.discovery-root-darkmode .view-blockquote:not([data-kind]){color:#808993}.view-blockquote[data-kind]{padding-top:.4em;padding-bottom:.4em}.view-blockquote[data-kind]:before{content:var(--blockquote-title-text,attr(data-kind));background-image:var(--blockquote-title-icon);color:var(--blockquote-title-color);text-transform:capitalize;background-position:0;background-repeat:no-repeat;background-size:1.1em;margin-bottom:.2em;padding-left:calc(1em + .9ex);display:block}.view-blockquote[data-kind=note]{--color:#1f6feb;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%234493f8\\">%0A <path d=\\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\\"/>%0A</svg>%0A");--blockquote-title-color:#4493f8}.view-blockquote[data-kind=tip]{--color:#238636;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%233fb950\\">%0A <path d=\\"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z\\"/>%0A</svg>%0A");--blockquote-title-color:#3fb950}.view-blockquote[data-kind=important]{--color:#8957e5;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%23ab7df8\\">%0A <path d=\\"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\\"/>%0A</svg>%0A");--blockquote-title-color:#ab7df8}.view-blockquote[data-kind=warning]{--color:#9e6a03;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%23d29922\\">%0A <path d=\\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\\"/>%0A</svg>%0A");--blockquote-title-color:#d29922}.view-blockquote[data-kind=caution]{--color:#da3633;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%23f85149\\">%0A <path d=\\"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\\"/>%0A</svg>%0A");--blockquote-title-color:#f85149}.view-header{font-size:120%;font-weight:400;position:relative}.view-header>.view-header__anchor{text-align:center;width:22px;color:inherit;opacity:0;background:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" fill=\\"%23888\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z\\"/>%0A <path d=\\"M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z\\"/>%0A</svg>%0A") 50%/20px no-repeat content-box content-box;margin-left:-22px;padding-top:2px;font-weight:400;transition:opacity .25s;display:inline-block;position:absolute}.view-header:hover>.view-header__anchor{opacity:1}.view-header>.view-header__anchor:before{content:"§";visibility:hidden;width:0;display:inline-block}.view-h1{margin:.812em 0 .65em;font-size:220%;font-weight:400}.view-h2{margin:.78em 0;font-size:150%;font-weight:400}.view-h3{margin:.73em 0;font-size:135%;font-weight:400}.view-h4{margin:.73em 0;font-size:120%;font-weight:400}.view-h5{margin:.68em 0;font-size:110%;font-weight:400}.view-link{color:var(--discovery-link-color,#09d);text-decoration-skip:ink;-webkit-text-decoration-color:var(--discovery-link-underline-color,#09d6);text-decoration-color:var(--discovery-link-underline-color,#09d6)}.view-link.onclick{cursor:pointer;text-decoration-line:underline}.view-link:hover{color:var(--discovery-link-hover-color,#07b);text-decoration-color:currentColor}.view-image{background:50%/20px no-repeat}.view-image:not(.error):not(.loaded){background-color:#8d8d8d4d;transition:background-color 1ms ease-in .125s}@starting-style{.view-image:not(.error):not(.loaded){background-color:#0000}}.view-image.error,.view-image:not([src]){background-color:#8d46464d;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" fill=\\"%23888\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z\\"/>%0A <path d=\\"M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z\\"/>%0A</svg>%0A");width:32px;height:32px}.discovery-root-darkmode .view-image{opacity:.85}.view-image-preview{--image-preview-bg-color:#77777720;background-image:repeating-conic-gradient(transparent 0% 25%,var(--image-preview-bg-color) 0% 50%);background-position:0 0,10px 10px;background-size:20px 20px;background-attachment:fixed;justify-content:center;padding:16px;display:flex}.view-image-preview .view-image{opacity:1}.view-indicator{text-align:center;background:#b5b5b526;flex-direction:column;justify-content:center;width:150px;height:100px;margin:0 1px 1px 0;text-decoration:none;display:inline-flex}.view-indicator[href]:hover{background:#a5a5a54d}.view-indicator>.value{color:#666;font-size:40px;line-height:1.2}.view-indicator[href]>.value{color:#1f7ec5}.view-indicator>.label{color:#888;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;padding:0 8px;font-size:14px;overflow:hidden}.view-markdown:first-child>:first-child{margin-top:0}.view-markdown:last-child>:last-child{margin-bottom:0}.view-markdown :is(p,blockquote,ul,ol,dl,pre,code){margin:0}.view-markdown :is(p,blockquote,ul,ol,dl,table,pre):not(:first-child){margin-top:15px}.view-markdown :is(ul,ol)+:is(ul,ol),.view-markdown li>:is(ul,ol){margin-top:0!important}.view-markdown code{font-family:var(--discovery-monospace-font-family);background-color:#d2dce633;border-radius:3px;padding:.2em .4em;font-size:90%}.discovery-root-darkmode .view-markdown blockquote code{background-color:#747e8833}.view-markdown kbd{--border-color:#ddd;--bg-color:#f8f8f8;font-family:var(--discovery-monospace-font-family);border:1px solid var(--border-color,#888);box-shadow:0 -1px var(--border-color,#888) inset;background-color:var(--bg-color);border-radius:6px;padding:.15em .4em;font-size:90%}.discovery-root-darkmode .view-markdown kbd{--border-color:#484848;--bg-color:#181818}.view-markdown sup{vertical-align:top}.view-markdown sub{vertical-align:bottom}.view-markdown pre:not(.view-source){font-family:var(--discovery-monospace-font-family);word-break:normal;background-color:#9b9b9b1a;border-radius:3px;font-size:90%;line-height:1.25;overflow:auto}.view-markdown pre:not(.view-source) code{text-shadow:none;color:inherit;background:0 0;border-radius:0;padding:0;font-family:inherit;font-size:100%}.view-markdown .check-list-item{list-style:none}.view-markdown .check-list-item>.view-checkbox:first-child{width:20px;margin-left:-20px}.view-source{color:var(--discovery-color);font-family:var(--discovery-font-family);white-space:normal;tab-size:4;background-color:#cdcdcd1a;border-radius:3px;grid-template:"prelude""content"1fr"postlude";margin:0;font-size:12px;line-height:1.6;display:grid}.view-source+.view-source{margin-top:1px}.view-source__prelude{border-top-left-radius:inherit;border-top-right-radius:inherit;grid-area:prelude;overflow:hidden}.view-source__postlude{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;grid-area:postlude;overflow:hidden}.view-source__content{white-space:pre;grid-area:content;align-items:flex-start;padding:8px;display:flex;position:relative;overflow:auto}.view-source__action-buttons{font-family:var(--discovery-font-family);order:2;gap:4px;margin-bottom:-8px;margin-left:1ex;font-size:12px;line-height:1.6;display:flex;position:sticky;top:0;right:0;translate:3px -3px}.view-source__action-buttons .view-button{opacity:.25;margin:0;padding:4px 6px;line-height:14px;transition:opacity .5s}.view-source__content:hover>.view-source__action-buttons .view-button{opacity:1;transition-duration:.25s}.view-source__action-buttons .view-button.copied{opacity:1}.view-source__action-buttons .view-button.copy:before{content:"";vertical-align:top;visibility:visible;background-color:currentColor;width:12px;height:12px;transition:scale .1s .25s,opacity .1s .25s;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"16\\" height=\\"16\\" fill=\\"%23000\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M3.5 2a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5v-12a.5.5 0 0 0-.5-.5H12a.5.5 0 0 1 0-1h.5A1.5 1.5 0 0 1 14 2.5v12a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 14.5v-12A1.5 1.5 0 0 1 3.5 1H4a.5.5 0 0 1 0 1h-.5Z\\"/>%0A <path d=\\"M10 .5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5.5.5 0 0 1-.5.5.5.5 0 0 0-.5.5V2a.5.5 0 0 0 .5.5h5A.5.5 0 0 0 11 2v-.5a.5.5 0 0 0-.5-.5.5.5 0 0 1-.5-.5Z\\"/>%0A</svg>%0A") 50%/12px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"16\\" height=\\"16\\" fill=\\"%23000\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M3.5 2a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5v-12a.5.5 0 0 0-.5-.5H12a.5.5 0 0 1 0-1h.5A1.5 1.5 0 0 1 14 2.5v12a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 14.5v-12A1.5 1.5 0 0 1 3.5 1H4a.5.5 0 0 1 0 1h-.5Z\\"/>%0A <path d=\\"M10 .5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5.5.5 0 0 1-.5.5.5.5 0 0 0-.5.5V2a.5.5 0 0 0 .5.5h5A.5.5 0 0 0 11 2v-.5a.5.5 0 0 0-.5-.5.5.5 0 0 1-.5-.5Z\\"/>%0A</svg>%0A") 50%/12px no-repeat}.view-source__action-buttons .view-button:after{content:"";vertical-align:top;background-color:#6a9c11;width:12px;height:12px;margin-left:-12px;transition:scale .1s .25s,opacity .1s .25s;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"16\\" height=\\"16\\" fill=\\"%23000\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z\\"/>%0A</svg>%0A") 50%/16px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"16\\" height=\\"16\\" fill=\\"%23000\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z\\"/>%0A</svg>%0A") 50%/16px no-repeat}.view-source__action-buttons .view-button.copied:before,.view-source__action-buttons .view-button:not(.copied):after{opacity:0;transition-duration:.2s;transition-delay:0s;scale:0}.view-source__lines{float:left;text-align:right;color:#969696a6;min-width:3ex;font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);border-right:1px solid #aaa6;margin-right:1.5ex;padding-right:1ex}.view-source__lines>span{display:block}.view-source__source{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);color:var(--discovery-fmt-color);flex-grow:1}.view-source__source .spotlight,.view-source__source .mark{--bg-color:var(--lightningcss-light,#f5e69a)var(--lightningcss-dark,#515143);--color:var(--lightningcss-light,#948634)var(--lightningcss-dark,#bdb06a);background:#f5e69a;background:var(--bg-color);color:var(--color);background-image:linear-gradient(90deg,var(--lightningcss-light,#fafafa80)var(--lightningcss-dark,#0000),var(--lightningcss-light,#fafafa80)var(--lightningcss-dark,#0000));margin:0 -1px;padding:1px 1px 2px}.view-source__source .mark{font-family:var(--discovery-font-family);border:.5px solid;border-color:color-mix(in srgb,currentColor 65%,var(--bg-color));background-color:var(--lightningcss-light,#e4e4e4)var(--lightningcss-dark,#2b2b2b);background-clip:padding-box;border-radius:4px;margin-left:0;margin-right:2px;padding:3px .35em;font-size:83%;line-height:1;text-decoration-thickness:1px;display:inline-block}.view-source__source .mark[data-kind=none]{color:var(--discovery-color);background-clip:border-box;border-color:#0000}.view-source__source .mark[data-kind=dot]:before{--dot-color:var(--color);content:"";vertical-align:middle;background-color:color-mix(in srgb,var(--dot-color) 85%,var(--discovery-background-color));border-radius:4px;margin:-2px 4px 0 1px;padding:4px;font-size:0;display:inline-block}.view-source__source .mark[data-kind=dot]:empty{background-color:#0000;border:none;padding-left:1px;padding-right:1px}.view-source__source .mark[data-kind=dot]:empty:before{margin-right:1px}.view-source__source .mark[data-kind=self]{--color:var(--lightningcss-light,#4c934c)var(--lightningcss-dark,#6eae6e)}.view-source__source .mark[data-kind=nested]{--color:var(--lightningcss-light,#96944d)var(--lightningcss-dark,#aead6e)}.view-source__source .mark[data-kind=total]{--color:var(--lightningcss-light,#9580bf)var(--lightningcss-dark,#aa92da)}.view-source__source .mark[data-prefix]:not([data-kind=dot]):before{content:attr(data-prefix);color:color-mix(in srgb,currentColor 50%,var(--bg-color));padding:0 3px 0 1px;display:inline-block}.view-source__source .mark[data-postfix]:not([data-kind=dot]):after{content:attr(data-postfix);color:color-mix(in srgb,currentColor 50%,var(--bg-color));display:inline-block}.view-source__source .mark.inactive{--color:#888}.view-source__source .spotlight.error,.view-source__source .mark.error{--bg-color:var(--lightningcss-light,#ffc9c9)var(--lightningcss-dark,#603c3c);--color:var(--lightningcss-light,#bb6665)var(--lightningcss-dark,#ed9e9d)}.view-source__source .spotlight.def,.view-source__source .mark.def{--bg-color:var(--lightningcss-light,#d3e7fb)var(--lightningcss-dark,#3a5066);--color:var(--lightningcss-light,#668fb8)var(--lightningcss-dark,#8cbae7)}.view-source__source .spotlight.ref,.view-source__source .mark.ref{--bg-color:var(--lightningcss-light,#cee99b)var(--lightningcss-dark,#415220);--color:var(--lightningcss-light,#7a9a3b)var(--lightningcss-dark,#95ca2c)}.view-source__source .spotlight.global-ref,.view-source__source .mark.global-ref{--bg-color:var(--lightningcss-light,#ffd8a3)var(--lightningcss-dark,#61492a);--color:var(--lightningcss-light,#9a7f59)var(--lightningcss-dark,#d8b381)}.view-source__source a.spotlight,.view-source__source a.mark{-webkit-text-decoration-color:color-mix(in srgb,currentcolor 45%,transparent);text-decoration-color:color-mix(in srgb,currentcolor 45%,transparent);text-underline-offset:1.5px;position:relative}.view-source__source a.spotlight:hover,.view-source__source a.mark:hover{-webkit-text-decoration-color:color-mix(in srgb,currentcolor 75%,transparent);text-decoration-color:color-mix(in srgb,currentcolor 75%,transparent);background-image:linear-gradient(90deg,var(--lightningcss-light,#0000)var(--lightningcss-dark,#35353580),var(--lightningcss-light,#0000)var(--lightningcss-dark,#35353580))}.view-source__source a.mark:hover,.view-source__source .mark.discovery-view-has-tooltip:hover{border-color:currentColor}.view-source__source a.mark[data-kind=dot]:empty:before,.view-source__source .mark.discovery-view-has-tooltip[data-kind=dot]:empty:before{outline:1px solid color-mix(in srgb,var(--dot-color) 45%,transparent);outline-offset:1px}.view-source__source a.mark[data-kind=dot]:hover:before,.view-source__source .mark.discovery-view-has-tooltip[data-kind=dot]:hover:before{outline-color:var(--dot-color)}.view-source__source .spotlight-ignore{background:#ddd repeating-linear-gradient(-45deg,#0000,#0000 6px,#e17d001a 6px 12px,#0000 12px)}.view-source__source .token{background:0 0}.view-source__source .spotlight .token{color:inherit!important}.view-source__source .token.comment,.view-source__source .token.prolog,.view-source__source .token.doctype,.view-source__source .token.cdata,.view-source__source .token.quote{color:var(--discovery-fmt-comment-color)}.view-source__source .token.punctuation{color:var(--discovery-fmt-punctuation-color)}.view-source__source .token.namespace{opacity:.7}.view-source__source .token.boolean,.view-source__source .token.atom{color:var(--discovery-fmt-atom-color)}.view-source__source .token.number{color:var(--discovery-fmt-number-color)}.view-source__source .token.selector,.view-source__source .token.attr-value,.view-source__source .token.string,.view-source__source .token.string-2,.view-source__source .token.char,.view-source__source .token.builtin,.view-source__source .token.inserted{color:var(--discovery-fmt-string-color)}.view-source__source .token.property,.view-source__source .token.tag,.view-source__source .token.constant,.view-source__source .token.symbol,.view-source__source .token.deleted,.view-source__source .token.header{color:var(--discovery-fmt-property-color)}.view-source__source .token.regex,.view-source__source .token.important,.view-source__source .token.def,.view-source__source .token.variable,.view-source__source .token.variable-2{color:var(--discovery-fmt-variable-color)}.view-source__source .token.keyword,.view-source__source .token.atrule,.view-source__source .token.link,.view-source__source .token.url{color:var(--discovery-fmt-keyword-color)}.view-source__source .token.qualifier,.view-source__source .token.function,.view-source__source .token.attribute,.view-source__source .token.attr-name,.view-source__source .token.class-name{color:var(--discovery-fmt-qualifier-color)}.view-source__source .token.entity{color:var(--discovery-fmt-entity-color)}.view-source__source .token.image,.view-source__source .token.type{color:var(--discovery-fmt-type-color)}.view-source__source .token.meta{color:var(--discovery-fmt-meta-color)}.view-source__source .token.negative{color:var(--discovery-fmt-negative-color);background-color:color-mix(in srgb,currentcolor 10%,transparent);padding:1px 0}.view-source__source .token.positive{color:var(--discovery-fmt-positive-color);background-color:color-mix(in srgb,currentcolor 10%,transparent);padding:1px 0}.view-source__source .token.discovery-view-name{background-color:var(--discovery-fmt-string-highlight-color);box-shadow:0 0 0 1px var(--discovery-fmt-string-highlight-color);color:#6a9c11}.view-text-diff{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);white-space:pre-wrap;word-break:break-word;display:inline-block}.view-text-diff .added{background-color:color-mix(in srgb,#92da92 70%,var(--discovery-background-color));color:#000000bf;padding:1.5px 0}.view-text-diff .removed{background-color:color-mix(in srgb,#de6666 65%,var(--discovery-background-color));color:#000000bf;padding:1.5px 0}.view-text-match{background:#ffe80538;border-bottom:2px solid #d5be0fcc;line-height:1.2}.view-text-numeric .num-delim{padding-left:.14em}.view-text-render{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5)}.view-column{min-width:150px;padding-right:40px}.view-column:last-child{padding-right:0}.view-columns{flex-wrap:wrap;display:flex}.view-columns:empty:before{content:attr(emptyText);color:#888}.view-list>.view-list-item>.view-expand{margin-bottom:1px}.view-expand+.view-expand{margin-top:1px}.view-list>.view-list-item:not(:last-child)>.view-expand.expanded{margin-bottom:4px}.view-expand.expanded+.view-expand{margin-top:4px}.view-expand>.header{--discovery-view-expand-trigger-size:22px;background-color:#c0c0c02d;background-color:color-mix(in srgb,var(--discovery-background-color),silver 17.5%);cursor:pointer;margin-left:calc(var(--discovery-view-expand-trigger-size) + 1px);font-size:12px;display:flex}.view-expand.trigger-outside>.header{margin-left:0}.view-expand>.header:hover{background-color:#a5a5a54d;background-color:color-mix(in srgb,var(--discovery-background-color),#a5a5a5 30%)}.view-expand>.header>.header-content{text-overflow:ellipsis;pointer-events:none;flex:1;padding:2px 8px;overflow:hidden}.view-expand>.header>.trigger{width:var(--discovery-view-expand-trigger-size,20px);margin-left:calc(-1 * var(--discovery-view-expand-trigger-size) - 1px);text-align:center;background-color:inherit;background-image:linear-gradient(#96969626,#96969626);order:-1}.view-expand>.header>.trigger:before{vertical-align:middle;content:"";background:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M 3.71875 7.78125 L 2.28125 9.21875 L 11.28125 18.21875 L 12 18.90625 L 12.71875 18.21875 L 21.71875 9.21875 L 20.28125 7.78125 L 12 16.0625 Z \\"/>%0A</svg>%0A") 50%/12px no-repeat;width:12px;height:100%;transition:transform .15s ease-in;display:inline-block;transform:rotate(-90deg)}.view-expand.expanded>.header>.trigger:before{transform:rotate(0)}.view-hstack{flex-wrap:wrap;gap:20px 40px;display:flex}.view-hstack>*{min-width:240px}.view-page-header{z-index:100;padding:23px var(--discovery-page-padding-right) 6px var(--discovery-page-padding-left);margin:calc(-1 * var(--discovery-page-padding-top)) calc(-1 * var(--discovery-page-padding-right)) 20px calc(-1 * var(--discovery-page-padding-left));background-color:#ffffffeb;transition:background-color .25s ease-in;position:sticky;top:-15px;left:0}.discovery-root-darkmode .view-page-header{background-color:#242424eb}.page_overscrolled>.view-page-header{transition-property:background-color,box-shadow;box-shadow:0 0 3px #0003}.discovery-root-darkmode .page_overscrolled>.view-page-header{box-shadow:0 0 3px #00000080}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.view-page-header{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fffc}.discovery-root-darkmode .view-page-header{background-color:#242424cc}}.view-page-header:before{content:"x";visibility:hidden;float:right;width:var(--discovery-nav-width,200px);margin-left:10px}.view-page-header__prelude .view-badge,.view-page-header__prelude .view-pill-badge{padding:3px 8px;display:inline-block}.view-page-header__prelude .view-badge .prefix,.view-page-header__prelude .view-badge .postfix,.view-page-header__prelude .view-pill-badge .prefix,.view-page-header__prelude .view-pill-badge .postfix{margin:-3px 6px -3px -8px;padding:5px 8px 6px}.view-page-header__prelude .view-badge .postfix,.view-page-header__prelude .view-pill-badge .postfix{margin:-3px -8px -3px 6px;padding:5px 8px 6px}.view-page-header .view-header{margin:0}.view-toc-section>.header{z-index:1;text-transform:capitalize;background-color:#fafafaeb;border:1px solid #5553;border-width:1px 0;margin:0 0 -1px;padding:9px 12px;font-size:14px;line-height:1;transition:background-color .25s ease-in;position:sticky;top:0}.discovery-root-darkmode .view-toc-section>.header{background-color:#323232eb;border-color:#00000040}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.view-toc-section>.header{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fafafacc}.discovery-root-darkmode .view-toc-section>.header{background-color:#323232cc;border-color:#00000040}}.view-toc-section>.header .view-badge,.view-toc-section>.header .view-pill-badge{text-transform:none;margin-left:4px;margin-right:0;font-weight:400}.view-toc-section>.content{white-space:nowrap;padding:8px 0 8px 12px}.discovery-view-popup{box-sizing:border-box;z-index:300;background-color:var(--discovery-background-color);border:1px solid #b0b0b0a6;min-width:200px;min-height:20px;transition-property:background-color;transition-duration:.25s;transition-timing-function:ease-in;position:fixed;overflow:hidden auto;box-shadow:3px 3px 18px #0003}.discovery-view-popup.inspect{z-index:2002}.discovery-view-popup.show-on-hover:not([data-pin-mode=popup-hover]):not(.pinned){pointer-events:none}.discovery-view-popup:not(.pinned)[data-pin-mode=trigger-click]:before,.discovery-view-popup:not(.pinned)[data-pin-mode=trigger-click]:after{content:"Click to pin this popup";visibility:hidden;z-index:100;background-color:var(--discovery-background-color);color:#888;text-align:center;background-image:linear-gradient(#0000000d,#0000000d);padding:2px 8px;font-size:10px;display:block;left:0;right:0}.discovery-view-popup:not(.pinned)[data-pin-mode=trigger-click][data-v-to=top]:before{visibility:visible;position:absolute;bottom:0}.discovery-view-popup:not(.pinned)[data-pin-mode=trigger-click][data-v-to=bottom]:after{visibility:visible;position:absolute;top:0}.view-section{margin-bottom:30px}.view-signature [data-action]{vertical-align:middle;color:#aaa6;cursor:pointer;background-color:#c3c3c30d;border:.85px solid #8d8d8d26;border-radius:3px;margin-top:max(1px - .333333em,-4px);margin-left:.222222em;padding:min(.333333em,5px) min(3px + .333333em,8px);font-size:.75em;line-height:1;display:inline-block}.discovery-root-darkmode .view-signature [data-action]{--discovery-view-signature-hover-color:#aaa;--discovery-view-signature-toggle-color:#72b372}.view-signature [data-action][data-enabled=true],.view-signature [data-action][data-enabled=true]:hover{color:var(--discovery-view-signature-toggle-color,#333);background:#97df9740;border-color:#89b18966}.view-signature [data-action=collapse]:before{content:"–"}.view-signature [data-action=dict-mode]:before{content:"dict"}.view-signature [data-action=sort-keys]:before{content:"keys ↓"}.view-signature [data-action]:hover{color:var(--discovery-view-signature-hover-color,#333);background:#bbbbbb40;border-color:#89898966}.discovery-view-popup.signature-details{min-width:340px;padding:10px}.discovery-view-popup.signature-details>*{max-width:450px}.discovery-view-popup.signature-details .signature-action-buttons{float:right;clear:both;z-index:1;margin-top:2px;position:relative}.discovery-view-popup.signature-details .signature-action-buttons .view-button{padding:0}.discovery-view-popup.signature-details .signature-action-buttons .view-button:after{content:"";vertical-align:top;aspect-ratio:1;opacity:.85;background-color:currentColor;width:23px;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z\\"/>%0A <path d=\\"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\\"/>%0A</svg>%0A") 50%/14px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z\\"/>%0A <path d=\\"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\\"/>%0A</svg>%0A") 50%/14px no-repeat}.discovery-view-popup.signature-details .signature-action-buttons .group:after{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z\\"/>%0A <path d=\\"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\\"/>%0A</svg>%0A");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z\\"/>%0A <path d=\\"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\\"/>%0A</svg>%0A")}.discovery-view-popup.signature-details .path{color:var(--discovery-fmt-property-color);opacity:.8;margin-bottom:-2px;font-size:12px;position:relative;top:-4px}.discovery-view-popup.signature-details .view-h1{margin:20px 0 15px;font-size:180%;line-height:1}.discovery-view-popup.signature-details .view-h1.property{color:var(--discovery-fmt-property-color)}.discovery-view-popup.signature-details .view-h1.type{color:var(--discovery-fmt-type-color);margin-bottom:8px}.discovery-view-popup.signature-details :is(.path,.signature-action-buttons)+.view-h1,.discovery-view-popup.signature-details .view-h1:first-child{margin-top:0}.discovery-view-popup.signature-details .view-h1:last-child{margin-bottom:0}.discovery-view-popup.signature-details .usage-stat{color:#aaa;padding:0 2ex 0 1ex;font-size:12px;font-weight:400;display:inline-block}.discovery-view-popup.signature-details .usage-stat.optional:before{content:"optional ";color:var(--discovery-fmt-flag-color)}.discovery-view-popup.signature-details .num{color:var(--discovery-fmt-atom-color)}.discovery-view-popup.signature-details .pie-stat{align-items:center;margin:10px 0;display:flex}.discovery-view-popup.signature-details .pie-stat .list-header{color:#aaa;font-size:11px}.discovery-view-popup.signature-details .pie-stat>.view-block:last-child{padding-right:10px;overflow:hidden}.discovery-view-popup.signature-details .pie-stat .view-list-item{white-space:nowrap;align-items:baseline;display:flex}.discovery-view-popup.signature-details .pie-stat .dot{min-width:var(--size);height:var(--size);border-radius:50%;display:inline-block}.discovery-view-popup.signature-details .pie-stat .caption{text-overflow:ellipsis;margin:0 5px;overflow:hidden}.discovery-view-popup.signature-details .pie-stat .caption:empty:before{content:"empty string";color:#888;background:#b4b4b433;border-radius:3px;padding:2px 4px 3px;font-size:11px}.discovery-view-popup.signature-details .pie-stat .times{color:#aaa;font-size:11px}.discovery-view-popup.signature-details .pie-stat .pie{height:var(--size,100px);width:var(--size,100px);border-radius:50%;margin:0 20px 0 10px;transform:rotate(-90deg)}.discovery-view-popup.signature-details .overview-stat{color:#aaa;font-size:12px}.discovery-view-popup.signature-details .overview-stat+.view-content-filter{margin-top:8px}.discovery-view-popup.signature-details .view-content-filter>.view-input{margin-bottom:4px}.discovery-view-popup.signature-details .view-menu-item{align-items:baseline;display:flex}.discovery-view-popup.signature-details .view-menu-item>.caption{flex:1}.discovery-view-popup.signature-details .view-menu-item>.caption:empty:before{content:"[empty string]";color:#888}.discovery-view-popup.signature-details .view-menu-item>.count{color:#aaa;font-size:11px}.discovery-view-popup.signature-details .struct-list>.view-list-item{position:relative}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct{overflow:hidden}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct.struct-expanded-value{overflow-x:auto}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct>.value:not(.struct-expanded-value)>.string:only-child{white-space:normal;word-break:break-all}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct>.value>.string-text-wrapper{margin-left:4px;padding-left:6px;overflow-x:auto}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct>.string-value-as-text .string-text{white-space:pre;display:inline-block}.discovery-view-popup.signature-details .struct-list>.view-list-item>.count{color:#aaa;background:var(--discovery-background-color);opacity:.9;border-radius:3px 0 0 3px;padding:0 4px 1px;font-size:11px;position:absolute;top:7px;right:0}.discovery-view-popup.signature-details .array-types,.discovery-view-popup.signature-details .set-types{border-left:2px solid #0070b2cc;margin-top:4px;padding:8px 0 8px 12px}.discovery-view-popup.signature-details .array-types:before,.discovery-view-popup.signature-details .set-types:before{float:left;color:#fff;background:#0070b2cc;padding:2px 4px;font-size:10px;line-height:12px;display:block;position:relative;top:-8px;left:-12px}.discovery-view-popup.signature-details .array-types:before{content:"Array value types"}.discovery-view-popup.signature-details .set-types:before{content:"Set value types"}.view-signature{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);color:var(--discovery-fmt-color);white-space:pre;background:#cdcdcd1a;margin:1px 0;padding:7px 32px 7px 8px;position:relative;overflow:auto}.discovery-view-popup .view-signature{background:0 0}.view-signature .expand{margin:0 -2px;padding:2px}.view-signature .expand:hover{color:var(--discovery-fmt-hover-color);cursor:pointer;background-color:#bbbbbb40;border-radius:4px}.view-signature .count{vertical-align:middle;color:#99999980;padding-bottom:2px;padding-left:6px;font-size:.916em;line-height:1;display:inline-block}.view-signature .count:before{content:attr(data-value)}.view-signature .count:hover{color:inherit}.view-signature .object-entries{background-image:linear-gradient(#bbbbbb26,#bbbbbb26);background-size:1px calc(100% - 3px);background-position:calc(3px + 1.15ex * var(--object-entries-offset,0)) 1px;background-repeat:no-repeat;background-attachment:local;background-origin:content-box}.view-signature .property{color:var(--discovery-fmt-property-color);cursor:pointer;margin:0 -2px;padding:2px}.view-signature .property.discovery-view-popup-active,.view-signature .property:hover{background-color:#aaa3}.view-signature .optional{color:var(--discovery-fmt-flag-color);padding-left:2px}.view-signature .type{color:var(--discovery-fmt-type-color);cursor:pointer;margin:0 -2px;padding:2px}.view-signature .type.discovery-view-popup-active,.view-signature .type:hover{background-color:#aaa3}.view-signature .type.discovery-view-popup-active{z-index:1;position:relative}.view-struct .entry-line{white-space:nowrap;padding-left:4ch}.view-struct .entry-line[data-index]:before{content:attr(data-index);border-left:1px solid #bbbbbb26;border-color:color-mix(in srgb,color-mix(in srgb,var(--discovery-background-color),#cdcdcd 10%),#bbb 15%);transform-origin:0 0;color:#99999959;padding-top:4px;padding-bottom:4px;padding-left:4px;font-size:10px;line-height:10px;position:absolute;transform:translate(-26px,18px)rotate(-90deg)}.view-struct .label{margin-left:-4ch}.view-struct .property{color:var(--discovery-fmt-property-color)}.view-struct .value{white-space:normal;vertical-align:top}.view-struct .keyword{color:var(--discovery-fmt-atom-color)}.view-struct .value>.number{color:var(--discovery-fmt-number-color)}.view-struct .value>.number .num-delim{padding-left:2px}.view-struct .value>.string,.view-struct .value>.string a{color:var(--discovery-fmt-string-color);-webkit-text-decoration-color:var(--discovery-fmt-string-underline-color);text-decoration-color:var(--discovery-fmt-string-underline-color);white-space:pre}.view-struct .value>.string a:hover{color:var(--discovery-fmt-string-hover-color);text-decoration-color:currentColor}.view-struct .value>.regexp{color:var(--discovery-fmt-string-color);white-space:pre}.view-struct .value-size,.view-struct .string-length{vertical-align:middle;color:#99999980;padding-bottom:2px;padding-left:6px;font-size:.916em;line-height:1;display:inline-block}.view-struct .value-size:hover,.view-struct .string-length:hover{color:inherit}.view-struct .value-size>.num-delim,.view-struct .string-length>.num-delim{padding-left:2px}.view-struct .string-text-wrapper{padding:4px 4px 4px 5.5ex;display:block}.view-struct .string-text{white-space:pre-wrap;background:var(--discovery-fmt-string-highlight-color);color:var(--discovery-fmt-string-color);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:2px 4px 1.5px;display:inline}.view-struct .string-value-as-text .string-text{white-space:pre-wrap;color:var(--discovery-fmt-color);background:#9191911a;padding-top:0;padding-bottom:0;display:block}.view-struct .view-as-table>.entry-line,.view-struct .view-as-table>.more-buttons{display:none}.view-struct .more{color:#7f7f7fcc;white-space:nowrap}.view-struct .more>.num-delim{padding-left:2px}.view-struct .string>.more.suffix{margin:0 1px 0 3px}.view-struct .string>.more.suffix:before{content:"…";padding-right:calc(1ch - 4px)}.view-struct .string>.more.suffix:after{content:" more"}.view-struct .string>.more.prefix{padding:0 .6ch 0 .4ch}.view-struct .string>.more.prefix:after{content:"…"}.view-struct .value>.more-buttons{padding-left:4ch}.view-struct .string>.match,.view-struct .string-text>.match{background-color:var(--lightningcss-light,#f5e69a)var(--lightningcss-dark,#565638);border-bottom:1px solid var(--lightningcss-light,#0000)var(--lightningcss-dark,#a7a73b);padding-top:1px}.view-struct .error-value{vertical-align:text-top;--bg-color:var(--lightningcss-light,#ffe0e0)var(--lightningcss-dark,#622b29);background-color:var(--bg-color);color:var(--lightningcss-light,#d23b3b)var(--lightningcss-dark,color-mix(in srgb,#a00 25%,var(--discovery-color)));border:1px solid var(--lightningcss-light,#f8c1c1)var(--lightningcss-dark,#0004);border-radius:3px;margin-top:-1px;font-size:84%;line-height:1.5;display:inline-block}.view-struct .error-value__name{vertical-align:top;padding:0 4px}.view-struct .error-value__message{background-color:var(--lightningcss-light,#fff1f1)var(--lightningcss-dark,#443232);padding:0 4px;display:inline-block}.view-struct .value>.view-table{font-family:var(--discovery-font-family);background-color:var(--discovery-background-color);color:var(--discovery-color);margin-top:2px;margin-left:4ch;margin-right:4px;padding:0 1px 1px}.view-struct .value>.view-table .more-buttons{margin:2px 5px 4px}.view-struct .struct-action-button{vertical-align:middle;color:#aaa6;cursor:pointer;background-color:#c3c3c30d;border:.85px solid #8d8d8d26;border-radius:3px;margin-top:max(1px - .333333em,-4px);margin-left:.222222em;padding:min(.333333em,5px) min(3px + .333333em,8px);font-size:.75em;line-height:1;display:inline-block}.discovery-root-darkmode .view-struct .struct-action-button{--discovery-view-struct-hover-color:#aaa;--discovery-view-struct-toggle-color:#72b372}.view-struct .struct-action-button:hover,.view-struct .discovery-view-popup-active{color:var(--discovery-view-struct-hover-color,#333);background-color:#bbbbbb40;border-color:#89898966}.view-struct .sort-keys>.struct-action-button[data-action=toggle-sort-keys],.view-struct .string-value-as-text>.struct-action-button[data-action=toggle-string-mode],.view-struct .view-as-table>.struct-action-button[data-action=toggle-view-as-table]{color:var(--discovery-view-struct-toggle-color,#686);background-color:#97df9740;border-color:#89b18966}.view-struct .struct-action-button[data-action=show-signature]{cursor:default}@media (hover:none),(hover:on-demand){.view-struct .struct-action-button{color:#333;background-color:#fff;border-color:#64646433;padding:3px 20px}.discovery-root-darkmode .view-struct .struct-action-button{color:#aaa;background-color:#50505080}.view-struct .struct-action-button[data-action=show-signature]{cursor:pointer}}.discovery-view-popup:not(.discovery-inspect-details-popup) .view-struct .struct-action-button[data-action=show-signature],.view-struct .view-as-table>.struct-action-button[data-action=toggle-sort-keys]{display:none}.view-struct .struct-action-button[data-action=collapse]:before{content:"–"}.view-struct .struct-action-button[data-action=show-signature]:before{content:"𝕊"}.view-struct .struct-action-button[data-action=value-actions]:before{content:"ƒ"}.view-struct .struct-action-button[data-action=toggle-sort-keys]:before{content:"keys ↓"}.view-struct .struct-action-button[data-action=toggle-string-mode]:before{content:"as text"}.view-struct .struct-action-button[data-action=toggle-view-as-table]:before{content:"as table"}.discovery-view-popup.view-struct-actions-popup .notes{color:#666;display:inline}.discovery-view-popup.view-struct-actions-popup .notes:before{content:" "}.view-struct .value-annotations{margin-left:6px}.view-struct .value+.value-annotations{margin-left:1.5ex}.view-struct .value-annotation{vertical-align:middle;color:#aaa;border-radius:3px;margin-top:-.166667em;padding:0 .4em;font-size:.85em;line-height:1.6;display:inline-block}.view-struct .value-annotation+.value-annotation{margin-left:2px}.view-struct .value-annotation[href]:focus-visible{background-color:#bbbbbb40;outline:none;box-shadow:0 0 0 3px #bbbbbb40}.view-struct .value-annotation.icon:before{content:"";vertical-align:text-bottom;background:var(--annotation-image, ) var(--annotation-image-position,50% center) no-repeat;background-size:var(--annotation-image-size,14px);width:14px;height:14px;display:inline-block}.view-struct .value-annotation.icon.has-text:before{margin-right:var(--annotation-image-margin,2px)}.view-struct .value-annotation.before+.value{margin-left:2px}.view-struct .value-annotation.style-none,.view-struct .value-annotation.style-default{--annotation-bg-gradient-from:white;--annotation-bg-gradient-to:#fff0}.discovery-root-darkmode .view-struct .value-annotation.style-default{--annotation-bg-gradient-from:#21212180;--annotation-bg-gradient-to:#21212100}.view-struct .value-annotation.before.style-default{background:linear-gradient(to left,var(--annotation-bg-gradient-from),var(--annotation-bg-gradient-to));border-right:1px solid}.view-struct .value-annotation.after.style-default{background:linear-gradient(to right,var(--annotation-bg-gradient-from),var(--annotation-bg-gradient-to));border-left:1px solid}.view-struct .value-annotation.style-badge{color:#999;-webkit-user-select:none;user-select:none;background-color:#9b9b9b26;border-radius:3px;text-decoration:none}.view-struct .value-annotation.style-badge.discovery-view-has-tooltip:hover{box-shadow:0 0 0 .5px #888}.view-struct .value-annotation.style-badge[href]{background-color:#379be629}.view-struct .value-annotation.style-badge[href]:hover{color:#89a0bd;-webkit-text-decoration:underline #89a0bd88;text-decoration:underline #89a0bd88}.view-struct .value-annotation .num-delim{padding-left:2px}.view-struct_image-preview-tooltip{padding:0!important}.view-struct_image-preview-tooltip .view-image-preview{min-width:160px}.view-struct{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);color:var(--discovery-fmt-color);white-space:nowrap;background-color:#cdcdcd1a;margin:1px 0;padding:7px 8px;position:relative;overflow:auto}.view-struct.struct-expand{cursor:pointer}.view-struct .struct-expand-value{vertical-align:top;cursor:pointer;border-radius:4px;display:inline-block;white-space:nowrap!important}.view-struct.struct-expand:hover,.view-struct.struct-expanded-value .struct-expand-value:hover{color:var(--discovery-fmt-hover-color);background-color:#bbbbbb40}.view-struct.struct-expanded-value,.view-struct .struct-expanded-value{background-image:linear-gradient(#bbbbbb26,#bbbbbb26);background-position:3px 18px;background-repeat:no-repeat;background-size:1px calc(100% - 36px);background-attachment:local;background-origin:content-box}.discovery-view-popup.view-struct-actions-popup .error{color:#d61f1fc4;text-shadow:.2px 0 .3px #fffc;font-size:11px}.discovery-root-darkmode .discovery-view-popup.view-struct-actions-popup .error{color:#e66;text-shadow:none}.discovery-view-popup.view-struct-actions-popup .num-delim{padding-left:3px}.discovery-view-popup.view-struct-actions-popup .view-menu-item+.view-menu-item.group-start:not(:first-child){border-top:1px solid #8888}.discovery-view-popup.view-struct-signature-popup.computing{padding:8px;line-height:1px;animation:.5s linear forwards view-struct-signature-computing}@keyframes view-struct-signature-computing{0%{opacity:0}}.discovery-view-popup.view-struct-signature-popup.computing:before{--color:#f6f61cb5;content:"";vertical-align:top;border:2px solid var(--color);clip-path:inset(0 0 50% 50%);border-radius:50%;width:10px;height:10px;animation:.65s linear infinite forwards view-struct-signature-computing-spinner;display:inline-block}@keyframes view-struct-signature-computing-spinner{to{rotate:360deg}}.view-table-cell{padding:var(--table-cell-padding-top) var(--table-cell-padding-right) var(--table-cell-padding-bottom) var(--table-cell-padding-left);vertical-align:top;height:19px}.view-table-cell.number{text-align:right}.view-table-cell .num-delim{padding-left:2px}.view-table-cell.complex,.view-table-cell.keyword{color:#888}.view-table-cell.align-left{text-align:left}.view-table-cell.align-center{text-align:center}.view-table-cell.align-right{text-align:right}.view-table-cell.details{background-clip:padding-box;padding-left:14px;position:relative}.view-table-cell.details:before{content:".";color:#0000;opacity:.5;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M 3.71875 7.78125 L 2.28125 9.21875 L 11.28125 18.21875 L 12 18.90625 L 12.71875 18.21875 L 21.71875 9.21875 L 20.28125 7.78125 L 12 16.0625 Z \\"/>%0A</svg>%0A");background-position:50%;background-repeat:no-repeat;background-size:9px;width:9px;transition:transform .12s ease-in,opacity .12s ease-in;display:inline-block;position:absolute;top:3px;left:3px;transform:rotate(-90deg)}.view-table-cell.details:hover{cursor:pointer;background-color:#b4b4b433}.view-table-cell.details-expanded{background-image:linear-gradient(#0000,#aaa3),linear-gradient(#0000,#aaa3);background-position:0 0,100% 0;background-repeat:no-repeat;background-size:1px 100%;border-bottom:none!important}.view-table-cell.details-expanded:hover{background-color:#b4b4b433}.view-table-cell.details.details-expanded:before{opacity:1;transform:rotate(0)}.view-table-cell-details-row>.view-cell-details-content{border:1px solid #aaaaaa40;border-top:none;padding:1px}.view-table-cell-details-row>.view-cell-details-content>:first-child{margin-top:0!important}.view-table-cell-details-row>.view-cell-details-content>:last-child{margin-bottom:0!important}.view-table-cell>.view-struct,.view-table-cell>.view-struct:hover{margin:calc(-1*max(calc(var(--table-cell-padding-top) - 1px),0px)) calc(-1*max(calc(var(--table-cell-padding-right) - 1px),0px)) calc(-1 * var(--table-cell-padding-bottom)) calc(-1 * var(--table-cell-padding-left));padding:var(--table-cell-padding-top) var(--table-cell-padding-right) max(calc(var(--table-cell-padding-bottom) - 1px),0px) var(--table-cell-padding-left)}.view-table-cell>.view-struct{background-color:#0000}.view-table-header{z-index:1;position:sticky;top:0}.view-table-header-cell{padding:var(--table-cell-padding-top) var(--table-cell-padding-right) var(--table-cell-padding-bottom) var(--table-cell-padding-left);border:solid var(--discovery-background-color);text-align:left;background:#8d8d8d26 right 1px center no-repeat;background-color:color-mix(in srgb,var(--discovery-background-color),#8d8d8d 15%);background-size:16px;background-clip:padding-box;border-width:1px 1px 1px 0;font-weight:400}.view-table-header-cell:last-child{border-right:none}.view-table-header-cell.sortable{cursor:pointer;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 172 172\\">%0A <path fill=\\"rgba(153, 153, 153, 0.4)\\" d=\\"M86,11.21192l-64.03808,64.03808h128.07617zM86,26.41308l38.08692,38.08692h-76.17383zM21.96192,86l64.03808,64.03808l64.03808,-64.03808zM47.91308,96.75h76.17383l-38.08692,38.08692z\\"/>%0A</svg>%0A");padding-right:18px}.view-table-header-cell.sortable:not(.asc):not(.desc){background-position:right 2px center;background-size:14px}.view-table-header-cell.sortable.asc{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\\"/>%0A</svg>%0A")}.view-table-header-cell.sortable.desc{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" preserveAspectRatio=\\"xMidYMid meet\\">%0A <path fill=\\"%23888\\" d=\\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\\" />%0A</svg>%0A")}.view-table-header-cell.sortable:hover{background-color:#8d8d8d4d;background-color:color-mix(in srgb,var(--discovery-background-color),#8d8d8d 30%)}.view-table-footer.no-cells-with-content{display:none}.view-table-footer-cell{padding:var(--table-cell-padding-top) max(calc(var(--table-cell-padding-right) - 1px),0px) var(--table-cell-padding-bottom) var(--table-cell-padding-left);border:solid var(--discovery-background-color);color:#888;background-color:color-mix(in srgb,var(--discovery-background-color),#8d8d8d 8%);background-clip:padding-box;border-width:1px 1px 1px 0;border-top-color:#0000}.view-table-footer-cell:last-child{border-right:0}.view-table{--table-cell-padding-top:2px;--table-cell-padding-right:8px;--table-cell-padding-bottom:2px;--table-cell-padding-left:8px;border-spacing:0;font-size:12px;line-height:19px}.view-table>tbody>.view-table-row:not(:last-child)>td,.view-table>tbody:not(:last-child)>.view-table-row:last-child>td,.view-table>.view-table-more-buttons:not(:last-child)>tr>td:not(:empty){border-bottom:1px solid #aaa3}.view-table>tbody.view-table-more-buttons>tr>td>.more-buttons{margin-bottom:2px}.view-table>tbody.view-table-more-buttons>tr>td:empty{padding:0}.view-table-cell-details-row>.view-cell-details-content>.view-table:first-child{margin-top:-1px!important}.view-tree-leaf{--view-leaf-lines-offset:0;background-image:linear-gradient(90deg,#99999980,#99999980),linear-gradient(90deg,#99999980,#99999980);background-size:1px calc(1em - 7px * var(--view-leaf-lines-offset,0)),1px 100%;background-position:5px top,5px calc(1em + 6px * var(--view-leaf-lines-offset,0));background-repeat:no-repeat;grid-template-columns:20px auto;grid-template-areas:"toggle content""toggle children";display:grid;position:relative}.view-tree-leaf.has-children:not(.non-collapsible),.view-tree-leaf.has-children.collapsed{--view-leaf-lines-offset:1}.view-tree-leaf.last,:not(.incomplete)>.view-tree-leaf:last-child{background-image:linear-gradient(90deg,#99999980,#99999980)}.view-tree-leaf-toggle{visibility:hidden;text-align:center;color:#7f7f7fcc;cursor:pointer;border:1px solid;border-radius:2px;grid-area:toggle;width:9px;height:9px;margin-top:-3px;margin-right:9px;font-size:10px;line-height:8px;display:inline-block;position:relative;top:1em}.view-tree-leaf-toggle:hover{color:gray}.view-tree-leaf.has-children>.view-tree-leaf-toggle{visibility:visible}.view-tree-leaf.non-collapsible:not(.collapsed)>.view-tree-leaf-toggle{visibility:hidden}.view-tree-leaf-toggle:before{content:"–"}.view-tree-leaf.collapsed>.view-tree-leaf-toggle:before{content:"+"}.view-tree-leaf-toggle:after{content:"";visibility:visible;pointer-events:none;background-color:#99999980;height:1px;position:absolute;top:4px;left:5px;right:-6px}.view-tree-leaf.has-children:not(.non-collapsible)>.view-tree-leaf-toggle:after,.view-tree-leaf.has-children.collapsed>.view-tree-leaf-toggle:after{left:11px}.view-tree-leaf-content{grid-area:content;display:inline-block}.view-tree-leaf-content:before{content:"";float:left}.view-tree-leaf-content:empty:before{content:"<empty>";color:#888}.view-tree-leaf-children{grid-area:children;margin:0;padding:0;list-style:none}.view-tree-leaf.collapsed>.view-tree-leaf-children{display:none}.view-tree{margin:0;padding:0;font-size:13px;line-height:24px;list-style:none}.view-tree:empty:before{content:attr(emptyText);color:#888}.more-buttons{flex-wrap:wrap;gap:5px;margin-top:2px;display:flex}.more-buttons .more-button{vertical-align:top;color:var(--discovery-color,black);min-height:0;font-size:11px;line-height:12px;font-family:var(--discovery-ui-font-family);cursor:pointer;background-color:#ffffff1a;border:1px solid #7f7f7f66;border-radius:3px;margin:0;padding:4px 8px}@supports not (gap:5px){.more-buttons{margin-top:0}.more-buttons .more-button{margin-top:4px;margin-right:5px}}.more-buttons .more-button:hover,.more-buttons .more-button:active,.more-buttons .more-button:focus{background-color:#dddddd4d;border-color:#aaa9;outline:none}.more-buttons .more-button:active{background-color:#83838340;border-color:#7f7f7f66}.page-default h1.no-data-loaded{margin-top:0}.page-default h1.no-data-loaded:before{vertical-align:middle;content:"";background:var(--discovery-app-icon) no-repeat center;background-size:42px;width:42px;height:42px;margin-right:10px;display:inline-block;position:relative;top:-5px}.welcome-block{margin-top:-10px}.welcome-block .upload-data{background-color:#00000008;border:1px dashed #a8a8a8;border-radius:7px;max-width:620px;margin-top:1.5em;margin-left:-13px;padding:12px}.discovery-root-darkmode .welcome-block .upload-data{background-color:#00000014;border-color:#555}.welcome-block .upload-notes{color:#aaa;padding:10px 0 0 3px;font-size:82%}.page-discovery>.discovery-header{z-index:100;padding:22px calc(210px + var(--discovery-page-padding-right)) 7px var(--discovery-page-padding-left);padding:22px calc(var(--discovery-page-padding-right) + 6px + max(42px * 3,var(--discovery-nav-width,0px))) 7px var(--discovery-page-padding-left);margin:0 calc(-1 * var(--discovery-page-padding-right)) 18px calc(-1 * var(--discovery-page-padding-left));background-color:#ffffffeb;flex-direction:row;line-height:1.2;transition:background-color .25s ease-in;display:flex;position:sticky;top:-2px}.discovery-root-darkmode .page-discovery>.discovery-header{background-color:#242424eb}.page-discovery.page_overscrolled>.discovery-header{transition-property:background-color,box-shadow;box-shadow:0 0 3px #0003}.discovery-root-darkmode .page-discovery.page_overscrolled>.discovery-header{box-shadow:0 0 3px #00000080}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.page-discovery>.discovery-header{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fffc}.discovery-root-darkmode .page-discovery>.discovery-header{background-color:#242424cc}}.page-discovery>.discovery-header .discovery-header-text{flex:1;font-size:220%;position:relative}.page-discovery>.discovery-header .discovery-header-text:before{content:attr(data-title);white-space:pre}.page-discovery>.discovery-header .discovery-header-text:focus-within:before{visibility:hidden}.page-discovery>.discovery-header .discovery-header-text input{font:inherit;color:inherit;opacity:.0001;background-color:#0000;border:1px solid #0000;border-bottom-color:#aaa;width:100%;margin:-1px;padding:0;transition:box-shadow .15s ease-out;position:absolute;top:0;left:0}.page-discovery>.discovery-header .discovery-header-text input:hover,.page-discovery>.discovery-header .discovery-header-text input:focus{opacity:1}.page-discovery>.discovery-header .discovery-header-text input:focus{border-bottom-color:#0af;outline:0;box-shadow:0 3px #0af3!important}.page-discovery>.discovery-header .discovery-header-text .timestamp{color:#99999980;margin-top:4px;font-size:10px;display:block}.page-discovery>.discovery-actions{z-index:101;pointer-events:none;justify-content:flex-end;margin-top:19px;margin-bottom:-61px;transition:top .25s;display:flex;position:sticky;top:34px}.page-discovery>.discovery-actions button{text-indent:-500px;cursor:pointer;opacity:.5;pointer-events:auto;background:50% no-repeat;border:none;border-radius:5px;outline:none;width:42px;height:42px;overflow:hidden}.page-discovery>.discovery-actions button.discovery-view-popup-active,.page-discovery>.discovery-actions button:hover,.page-discovery>.discovery-actions button:focus{opacity:1;background-color:#00000008}.page-discovery>.discovery-actions button.toggle-fullscreen{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 50 50\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" fill=\\"%23888\\" d=\\"M -3 8 C -2.734375 8 -2.48046875 8.10546875 -2.29296875 8.29296875 C -2.10546875 8.48046875 -2 8.734375 -2 9 L -2 26.265625 C -2.29296875 26.09765625 -2.63671875 26 -3 26 L -4 26 L -4 10 L -46 10 L -46 44 L -29.999998092651367 44 L -29.999998092651367 45 C -29.999998092651367 45.36328125 -29.902341842651367 45.70703125 -29.734373092651367 46 L -47 46 C -47.265625 46 -47.51953125 45.89453125 -47.70703125 45.70703125 C -47.89453125 45.51953125 -48 45.265625 -48 45 L -48 9 C -48 8.734375 -47.89453125 8.48046875 -47.70703125 8.29296875 C -47.51953125 8.10546875 -47.265625 8 -47 8 Z M -36 13 C -35.640625 12.99609375 -35.3046875 13.18359375 -35.12109375 13.49609375 C -34.94140625 13.80859375 -34.94140625 14.19140625 -35.12109375 14.50390625 C -35.3046875 14.81640625 -35.640625 15.00390625 -36 15 L -39.5859375 15 L -29.292966842651367 25.29296875 C -29.031248092651367 25.54296875 -28.925779342651367 25.91796875 -29.019529342651367 26.265625 C -29.109373092651367 26.6171875 -29.382810592651367 26.890625 -29.734373092651367 26.98046875 C -30.082029342651367 27.07421875 -30.457029342651367 26.96875 -30.707029342651367 26.70703125 L -41 16.4140625 L -41 20 C -40.99609375 20.359375 -41.18359375 20.6953125 -41.49609375 20.87890625 C -41.80859375 21.05859375 -42.19140625 21.05859375 -42.50390625 20.87890625 C -42.81640625 20.6953125 -43.00390625 20.359375 -43 20 L -43 13 Z M -3 28 C -2.44921875 28 -2 28.44921875 -2 29 L -2 45 C -2 45.55078125 -2.44921875 46 -3 46 L -26.999998092651367 46 C -27.550779342651367 46 -27.999998092651367 45.55078125 -27.999998092651367 45 L -27.999998092651367 29 C -27.999998092651367 28.44921875 -27.550779342651367 28 -26.999998092651367 28 Z M -4 30 L -25.999998092651367 30 L -25.999998092651367 44 L -4 44 Z\\" transform=\\"matrix(1 0 0 1 50 0)\\" />%0A</svg>%0A");background-size:25px}.page-discovery>.discovery-actions button.edit-mode{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 128 128\\">%0A <path d=\\"M84.7,39.1l-37.3,64.4c-3.1,5.4-7.4,10-12.6,13.4L24,124l0.8-12.9c0.4-6.2,2.2-12.2,5.3-17.6l37.3-64.4\\" style=\\"fill:%23FFFFFF;\\"></path>%0A <path d=\\"M60.4,44.1c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1l7-12c0.8-1.4,2.7-1.9,4.1-1.1s1.9,2.7,1.1,4.1l-7,12C62.4,43.5,61.4,44.1,60.4,44.1z\\" style=\\"fill:%23FFFFFF;\\"></path>%0A <path d=\\"M77.7,54.1c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1l7-12c0.8-1.4,2.7-1.9,4.1-1.1c1.4,0.8,1.9,2.7,1.1,4.1l-7,12C79.7,53.5,78.7,54.1,77.7,54.1z\\" style=\\"fill:%23FFFFFF;\\"></path>%0A <path d=\\"M47.2,94.8c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1l25-43.4c0.8-1.4,2.6-1.8,4.1-1.1c5.6,2.7,5.6,2.7,5.6,2.7L49.9,93.4C49.3,94.4,48.2,94.8,47.2,94.8z\\" style=\\"fill:%23FCCA3D;\\"></path>%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M24,127c-0.5,0-1-0.1-1.5-0.4c-1-0.6-1.6-1.6-1.5-2.8l0.8-12.9c0.4-6.6,2.4-13.2,5.7-18.9l30.3-52.4c0.8-1.4,2.7-1.9,4.1-1.1c1.4,0.8,1.9,2.7,1.1,4.1L32.7,95c-2.9,4.9-4.5,10.6-4.9,16.3l-0.4,6.9l5.8-3.8C38,111.3,42,107,44.9,102l30.3-52.4c0.8-1.4,2.7-1.9,4.1-1.1c1.4,0.8,1.9,2.7,1.1,4.1L50,105c-3.3,5.8-8,10.7-13.5,14.4l-10.8,7.1C25.2,126.8,24.6,127,24,127z\\"></path>%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M89,127H49c-1.7,0-3-1.3-3-3s1.3-3,3-3h40c1.7,0,3,1.3,3,3S90.7,127,89,127z\\"></path>%0A <circle fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\".5\\" cx=\\"104\\" cy=\\"124\\" r=\\"3\\"></circle>%0A <path d=\\"M87.7,36.7c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1c0.9-1.6,1.2-3.5,0.7-5.3s-1.6-3.3-3.3-4.2c-1.6-0.9-3.5-1.2-5.3-0.7s-3.3,1.6-4.3,3.3c-0.8,1.4-2.7,1.9-4.1,1.1s-1.9-2.7-1.1-4.1c3.6-6.2,11.6-8.3,17.8-4.8c3,1.7,5.2,4.5,6.1,7.9s0.4,6.9-1.3,9.9C89.7,36.2,88.7,36.7,87.7,36.7z\\" style=\\"fill:%23FF5576;\\"></path>%0A <path d=\\"M87.7,33.7c2.8-4.8,1.1-10.9-3.7-13.7l0,0c-4.8-2.8-10.9-1.1-13.7,3.7l-3.7,6.5l17.3,10L87.7,33.7z\\" style=\\"fill:%23FF5576;\\"></path>%0A <path d=\\"M83.9,43.2c-0.5,0-1-0.1-1.5-0.4l-17.3-10c-0.7-0.4-1.2-1.1-1.4-1.8c-0.2-0.8-0.1-1.6,0.3-2.3l3.7-6.5c3.6-6.2,11.6-8.3,17.8-4.8c3,1.7,5.2,4.5,6.1,7.9s0.4,6.9-1.3,9.9l-3.7,6.5c-0.4,0.7-1.1,1.2-1.8,1.4C84.4,43.2,84.2,43.2,83.9,43.2z M70.7,29.1l12.1,7l2.2-3.9l0,0c0.9-1.6,1.2-3.5,0.7-5.3s-1.6-3.3-3.3-4.2c-3.3-1.9-7.6-0.8-9.6,2.6L70.7,29.1z\\" style=\\"fill:%23FF5576;\\"></path>%0A <path d=\\"M83.9,43.2c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1l3.7-6.5c1-1.8,1.2-4,0.5-6c-0.6-1.6,0.2-3.3,1.8-3.9c1.6-0.6,3.3,0.2,3.9,1.8c1.4,3.7,1,7.7-0.9,11.1l-3.7,6.5C86,42.7,85,43.2,83.9,43.2z\\" style=\\"fill:%23D32F56;\\"></path>%0A</svg>%0A");background-size:20px}.page-discovery>.discovery-actions button.edit-mode:not(.disabled){opacity:1}.page-discovery>.discovery-actions button.edit-mode.disabled{filter:grayscale()}.page-discovery>.discovery-actions button.share{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 50 50\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" fill=\\"%23888\\" d=\\"M 28.875 11 C 28.371094 11.0625 27.996094 11.492188 28 12 L 28 19.0625 C 16.488281 19.414063 10.28125 25.507813 7.21875 31.5625 C 4.113281 37.699219 4.003906 43.683594 4 43.875 C 4 43.875 4 43.9375 4 43.9375 L 4 44 C 3.984375 44.550781 4.417969 45.015625 4.96875 45.03125 C 5.519531 45.046875 5.984375 44.613281 6 44.0625 C 6 44.0625 6 44 6 44 C 6.007813 43.90625 6.230469 40.878906 9.09375 37.65625 C 11.90625 34.496094 17.394531 31.308594 28 31.09375 L 28 38 C 28 38.382813 28.21875 38.734375 28.566406 38.902344 C 28.914063 39.070313 29.324219 39.023438 29.625 38.78125 L 45.625 25.78125 C 45.863281 25.589844 46 25.304688 46 25 C 46 24.695313 45.863281 24.410156 45.625 24.21875 L 29.625 11.21875 C 29.414063 11.046875 29.144531 10.96875 28.875 11 Z M 30 14.09375 L 43.40625 25 L 30 35.90625 L 30 30 C 30 29.449219 29.550781 29 29 29 C 17.246094 29 10.910156 32.613281 7.59375 36.34375 C 7.46875 36.484375 7.398438 36.609375 7.28125 36.75 C 7.703125 35.375 8.257813 33.90625 9 32.4375 C 11.917969 26.671875 17.488281 21 29 21 C 29.550781 21 30 20.550781 30 20 Z \\" />%0A</svg>%0A");background-size:25px}.discovery[data-dzen] .page-discovery>.discovery-actions{top:20px}.discovery[data-dzen] .page-discovery>.discovery-actions button.toggle-fullscreen{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 50 50\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" fill=\\"%23888\\" d=\\"M -3 8 C -2.734375 8 -2.48046875 8.10546875 -2.29296875 8.29296875 C -2.10546875 8.48046875 -2 8.734375 -2 9 L -2 26.265625 C -2.29296875 26.09765625 -2.63671875 26 -3 26 L -4 26 L -4 10 L -46 10 L -46 44 L -29.999998092651367 44 L -29.999998092651367 45 C -29.999998092651367 45.36328125 -29.902341842651367 45.70703125 -29.734373092651367 46 L -47 46 C -47.265625 46 -47.51953125 45.89453125 -47.70703125 45.70703125 C -47.89453125 45.51953125 -48 45.265625 -48 45 L -48 9 C -48 8.734375 -47.89453125 8.48046875 -47.70703125 8.29296875 C -47.51953125 8.10546875 -47.265625 8 -47 8 Z M -35.98592758178711 27.01408576965332 C -36.34530258178711 27.01799201965332 -36.68124008178711 26.83049201965332 -36.86483383178711 26.51799201965332 C -37.04452133178711 26.20549201965332 -37.04452133178711 25.82267951965332 -36.86483383178711 25.51017951965332 C -36.68124008178711 25.19767951965332 -36.34530258178711 25.01017951965332 -35.98592758178711 25.01408576965332 L -32.39999008178711 25.01408576965332 L -42.692962646484375 14.721118927001953 C -42.954681396484375 14.471118927001953 -43.060150146484375 14.096118927001953 -42.966400146484375 13.748462677001953 C -42.876556396484375 13.396900177001953 -42.603118896484375 13.123462677001953 -42.251556396484375 13.033618927001953 C -41.903900146484375 12.939868927001953 -41.528900146484375 13.045337677001953 -41.278900146484375 13.307056427001953 L -30.98592185974121 23.60002326965332 L -30.98592185974121 20.01408576965332 C -30.98982810974121 19.65471076965332 -30.80232810974121 19.31877326965332 -30.48982810974121 19.13517951965332 C -30.17732810974121 18.95549201965332 -29.79451560974121 18.95549201965332 -29.48201560974121 19.13517951965332 C -29.16951560974121 19.31877326965332 -28.98201560974121 19.65471076965332 -28.98592185974121 20.01408576965332 L -28.98592185974121 27.01408576965332 Z M -3 28 C -2.44921875 28 -2 28.44921875 -2 29 L -2 45 C -2 45.55078125 -2.44921875 46 -3 46 L -26.999998092651367 46 C -27.550779342651367 46 -27.999998092651367 45.55078125 -27.999998092651367 45 L -27.999998092651367 29 C -27.999998092651367 28.44921875 -27.550779342651367 28 -26.999998092651367 28 Z M -4 30 L -25.999998092651367 30 L -25.999998092651367 44 L -4 44 Z\\" transform=\\"matrix(1 0 0 1 50 -7.10543e-15)\\" />%0A</svg>%0A")}.page-discovery>.discovery-editor .discovery-editor-tabs{vertical-align:top;display:inline-block;overflow:hidden}.page-discovery>.discovery-editor .data-query-result:before,.page-discovery>.discovery-editor .discovery-editor-tabs:before{text-align:right;box-sizing:border-box;color:#8d8d8dbf;width:40px;padding:3px 4px;font-size:11px}.page-discovery>.discovery-editor .discovery-editor-tab{-webkit-user-select:none;user-select:none;cursor:pointer;background:#c8c8c833;margin:0 1px 1px 0;padding:2px 12px;font-size:12px;display:inline-block}.page-discovery>.discovery-editor .discovery-editor-tab.active{cursor:default;background:#6cbcf126;margin-bottom:0}.page-discovery>.discovery-editor .discovery-editor-tab:not(.active):hover{background:#bbb6}.page-discovery>.discovery-editor .discovery-editor-tab:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}.page-discovery>.discovery-editor .discovery-editor-tab:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}.page-discovery>.discovery-editor .editor-toolbar{flex-direction:row;justify-content:flex-end;align-items:baseline;gap:10px;display:flex}.page-discovery>.discovery-editor .editor-toolbar label{white-space:nowrap;margin:0 1ex;padding:4px}.page-discovery>.discovery-editor .editor-toolbar .syntax-hint{color:#8d8d8dbf;flex:1;align-self:start;padding-left:10px;font-size:12px}.page-discovery>.discovery-editor .editor-toolbar .view-checkbox__label{margin-right:0}.page-discovery>.discovery-editor .discovery-editor-error{background:#ffd7d14d;border-bottom:1px solid #f009}.page-discovery>.discovery-editor textarea{box-sizing:border-box;width:100%;min-height:9em;font-family:var(--discovery-monospace-font-family);resize:vertical;border-color:#aaa;border-radius:3px;padding:8px;font-size:12px;line-height:18px;box-shadow:inset 0 1px 1px #8e8e8e33}.page-discovery>.discovery-editor textarea:focus{border-color:#0af;outline:0;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33!important}.page-discovery>.discovery-editor .query-datasets{flex-wrap:wrap;gap:4px;margin-top:-8px;margin-bottom:11px;display:none}.page-discovery>.discovery-editor .query-datasets .dataset{font-family:var(--discovery-monospace-font-family);background-color:#0a66b92e;border:1px solid #2e4155;border-radius:6px;padding:2px 8px 2px 32px;line-height:1.3;display:inline-block;position:relative;box-shadow:1px 1px 1px #0006}.page-discovery>.discovery-editor .query-datasets .dataset:before{content:"";background-color:color-mix(in srgb,#769ec8,var(--discovery-color));opacity:.7;width:32px;height:100%;position:absolute;top:0;left:0;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke-width=\\".1\\" d=\\"M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5 8 5.961 14.154 3.5zM15 4.239l-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464z\\"/>%0A</svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke-width=\\".1\\" d=\\"M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5 8 5.961 14.154 3.5zM15 4.239l-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464z\\"/>%0A</svg>");-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:20px;mask-size:20px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.page-discovery>.discovery-editor .query-datasets .dataset__type{color:#597898;font-size:9px;display:block}.page-discovery>.discovery-editor .query-datasets .dataset__name{color:color-mix(in srgb,#769ec8,var(--discovery-color));font-size:12px;display:block}.page-discovery>.discovery-editor .query-datasets:empty:before{content:"No datasets";color:#888}.page-discovery>.discovery-editor .query-graph{margin:1px calc(-1 * var(--discovery-page-padding-right)) 1px calc(-1 * var(--discovery-page-padding-left));padding:1px var(--discovery-page-padding-right) 12px calc(1px + var(--discovery-page-padding-left));flex-flow:row;gap:30px;display:flex;position:relative;overflow-x:auto}.page-discovery>.discovery-editor .query-graph .query-graph-layer{flex-direction:column;align-items:flex-start;gap:4px;display:flex}.page-discovery>.discovery-editor .query-graph .query-graph-layer>.view-button{font-family:var(--discovery-monospace-font-family);text-align:center;order:1;margin:0 -1px;padding:3px 12px;font-size:10px;line-height:1}.page-discovery>.discovery-editor .query-graph .query-graph-node{--color:#8888;cursor:pointer;margin-top:calc(var(--pad,0) * 22px);align-items:center;gap:3px;display:flex}.page-discovery>.discovery-editor .query-graph .query-graph-node.target{pointer-events:none}.page-discovery>.discovery-editor .query-graph .query-graph-node>.query-graph-node__dot{background-color:var(--color);outline:.75px solid var(--discovery-background-color);outline-offset:-3px;background-clip:content-box;border-radius:50%;width:10px;height:10px;padding:3px;transition:box-shadow .2s ease-in-out,background-color .2s ease-in-out;display:block;position:relative}.page-discovery>.discovery-editor .query-graph .query-graph-node>.query-graph-node__label{z-index:-1;--overlap-dot:20px;padding:0 6px;padding-left:calc(-1px + var(--overlap-dot));margin-left:calc(-1 * var(--overlap-dot));outline:.5px solid color-mix(in srgb,var(--color),transparent 35%);text-overflow:ellipsis;white-space:nowrap;min-width:40px;max-width:180px;font-family:var(--discovery-monospace-font-family);color:color-mix(in srgb,var(--discovery-color),var(--color) 30%);background-color:color-mix(in srgb,var(--discovery-background-color),var(--color) 30%);border:1px solid #0000;border-radius:9px;font-size:10px;position:relative;overflow:hidden}.page-discovery>.discovery-editor .query-graph .query-graph-node:is(:hover,.target)>.query-graph-node__label{outline-color:var(--color);outline-width:1px}.page-discovery>.discovery-editor .query-graph .query-graph-node>.query-graph-node__label:is(:empty,:not(.has-label)){color:color-mix(in srgb,#888 65%,var(--color))}.page-discovery>.discovery-editor .query-graph .query-graph-node>.query-graph-node__label:empty:before{content:"<empty query>"}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing]{--color:var(--lightningcss-light,#b1ac1a)var(--lightningcss-dark,#f6f61cb5)}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing],.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing]>.query-graph-node__dot,.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing]>.query-graph-node__label{transition-property:background-color,outline-color,border-color,box-shadow,color}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing]>.query-graph-node__dot:before{content:"";aspect-ratio:1;border:2px solid var(--color);clip-path:inset(0 0 50% 50%);border-radius:50%;width:12px;margin:-3px 0 0 -3px;animation:.65s linear infinite forwards discovery-graph-computing,.1s linear forwards discovery-graph-computing-appear;display:block;position:absolute}@keyframes discovery-graph-computing{to{rotate:360deg}}@keyframes discovery-graph-computing-appear{0%{opacity:0}99%{opacity:0}to{opacity:1}}@keyframes discovery-graph-await-computing{to{background-color:#0000}}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=successful]{--color:#4da32fcf}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=successful],.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=successful]>.query-graph-node__dot,.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=successful]>.query-graph-node__label{transition:none}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=failed]{--color:#d84343}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=canceled]>.query-graph-node__dot{--color:#d84343;--color-dash:color-mix(in srgb, var(--discovery-background-color), #888 15%);--dash-start:7px;--dash-end:9px;background-color:color-mix(in srgb,var(--color),#8888);background-image:linear-gradient(to right,transparent var(--dash-start),var(--color-dash) var(--dash-start),var(--color-dash) var(--dash-end),transparent var(--dash-end));outline:none;rotate:45deg}.page-discovery>.discovery-editor .query-graph .query-graph-node.target>.query-graph-node__dot{cursor:default}.page-discovery>.discovery-editor .query-graph .query-graph-node.target:not([data-state=computing])>.query-graph-node__dot{box-shadow:0 0 0 2px var(--color) inset,0 0 0 3px var(--discovery-background-color) inset}.page-discovery>.discovery-editor .query-graph .query-graph-node:not(.target):hover>.query-graph-node__dot{box-shadow:0 0 0 2px color-mix(in srgb,var(--color),var(--discovery-color) 35%) inset,0 0 0 3px var(--discovery-background-color) inset;opacity:1;transition:none}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=awaiting]>.query-graph-node__dot{background-color:var(--lightningcss-light,#b1ac1a)var(--lightningcss-dark,#f6f61cb5)}.page-discovery>.discovery-editor .query-graph>svg{z-index:-1;pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.page-discovery>.discovery-editor .query-graph>svg :is(line,path){stroke:var(--lightningcss-light,#bbb)var(--lightningcss-dark,#666)}.page-discovery>.discovery-editor .query-graph>svg :is(line,path).current{stroke-width:1.25px;stroke:var(--lightningcss-light,#666)var(--lightningcss-dark,#bbb)}.query-graph-actions{gap:1px;display:flex}.query-graph-actions .view-button{background-color:#c0c0c02d;background-position:50%;background-repeat:no-repeat;border:none;border-radius:0;width:23.5px;padding:0;margin:0!important}.query-graph-actions .view-button:hover{background-color:#a5a5a54d}.query-graph-actions .view-button.clone{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <path d=\\"M 13.5 5 C 11.458 5 9.737 5.82 8.629 7.066 C 7.521 8.313 7 9.917 7 11.5 C 7 13.083 7.521 14.687 8.629 15.934 C 9.439 16.845 10.65 17.394 12 17.695 L 12 30.305 C 10.65 30.606 9.439 31.155 8.629 32.066 C 7.521 33.313 7 34.917 7 36.5 C 7 38.083 7.521 39.687 8.629 40.934 C 9.737 42.18 11.458 43 13.5 43 C 17.072 43 20 40.072 20 36.5 C 20 33.596 18.03 31.21 15.387 30.385 C 15.439 30.313 15.421 30.166 15.486 30.098 C 15.806 29.763 16.385 29.433 17.23 29.168 C 18.921 28.637 21.526 28.421 24.229 28.006 C 26.931 27.591 29.792 26.971 32.111 25.252 C 34.185 23.716 35.591 21.178 35.881 17.719 C 38.775 17.064 41 14.583 41 11.5 C 41 7.928 38.072 5 34.5 5 C 32.458 5 30.737 5.82 29.629 7.066 C 28.521 8.313 28 9.917 28 11.5 C 28 13.083 28.521 14.687 29.629 15.934 C 30.397 16.798 31.531 17.329 32.791 17.652 C 32.54 20.191 31.712 21.815 30.326 22.842 C 28.708 24.041 26.319 24.648 23.771 25.039 C 21.224 25.431 18.579 25.601 16.332 26.307 C 15.869 26.452 15.43 26.645 15 26.855 L 15 17.695 C 17.835 16.997 20 14.541 20 11.5 C 20 7.928 17.072 5 13.5 5 Z\\" transform=\\"matrix(0, 1, -1, 0, 48, 0)\\"/>%0A</svg>%0A");background-size:17.5px 17.5px}.query-graph-actions.root .view-button.clone{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <ellipse cx=\\"23.652\\" cy=\\"10.385\\" rx=\\"6.462\\" ry=\\"6.462\\"/>%0A <ellipse cx=\\"23.617\\" cy=\\"37.467\\" rx=\\"6.462\\" ry=\\"6.462\\"/>%0A <rect x=\\"22.18\\" y=\\"16.245\\" width=\\"2.959\\" height=\\"16.643\\"/>%0A</svg>%0A")}.query-graph-actions .view-button.stash{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <path d=\\"M 13.5 5 C 11.458 5 9.737 5.82 8.629 7.066 C 7.521 8.313 7 9.917 7 11.5 C 7 13.083 7.521 14.687 8.629 15.934 C 9.439 16.845 10.65 17.394 12 17.695 L 12 30.305 C 10.65 30.606 9.439 31.155 8.629 32.066 C 7.521 33.313 7 34.917 7 36.5 C 7 38.083 7.521 39.687 8.629 40.934 C 9.737 42.18 11.458 43 13.5 43 C 17.072 43 20 40.072 20 36.5 C 20 33.596 18.03 31.21 15.387 30.385 C 15.439 30.313 15.421 30.166 15.486 30.098 C 15.806 29.763 16.385 29.433 17.23 29.168 C 18.921 28.637 21.526 28.421 24.229 28.006 C 26.931 27.591 29.792 26.971 32.111 25.252 C 34.185 23.716 35.591 21.178 35.881 17.719 C 38.775 17.064 41 14.583 41 11.5 C 41 7.928 38.072 5 34.5 5 C 32.458 5 30.737 5.82 29.629 7.066 C 28.521 8.313 28 9.917 28 11.5 C 28 13.083 28.521 14.687 29.629 15.934 C 30.397 16.798 31.531 17.329 32.791 17.652 C 32.54 20.191 31.712 21.815 30.326 22.842 C 28.708 24.041 26.319 24.648 23.771 25.039 C 21.224 25.431 18.579 25.601 16.332 26.307 C 15.869 26.452 15.43 26.645 15 26.855 L 15 17.695 C 17.835 16.997 20 14.541 20 11.5 C 20 7.928 17.072 5 13.5 5 Z M 34.5 8 C 36.451 8 38 9.549 38 11.5 C 38 13.42 36.493 14.935 34.586 14.982 C 34.527 14.979 34.467 14.979 34.408 14.982 C 33.182 14.958 32.413 14.551 31.871 13.941 C 31.313 13.313 31 12.417 31 11.5 C 31 10.583 31.313 9.687 31.871 9.059 C 32.43 8.43 33.208 8 34.5 8 Z\\" transform=\\"matrix(0, 1, -1, 0, 48, 0)\\"/>%0A</svg>%0A");background-size:17.5px 17.5px}.query-graph-actions.root .view-button.stash{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <path d=\\"M 24.5 5 C 22.458 5 20.737 5.82 19.629 7.066 C 18.521 8.313 18 9.917 18 11.5 C 18 13.083 18.521 14.687 19.629 15.934 C 20.439 16.845 21.65 17.394 23 17.695 L 23 30.305 C 21.65 30.606 20.439 31.155 19.629 32.066 C 18.521 33.313 18 34.917 18 36.5 C 18 38.083 18.521 39.687 19.629 40.934 C 20.737 42.18 22.458 43 24.5 43 C 28.072 43 31 40.072 31 36.5 C 31 33.596 28.671 31.193 26.028 30.368 C 26.08 30.296 26 17.695 26 17.695 C 28.835 16.997 31 14.541 31 11.5 C 31 7.928 28.072 5 24.5 5 Z M 24.5 8 C 26.451 8 28 9.549 28 11.5 C 28 13.42 26.493 14.935 24.586 14.982 C 24.527 14.979 24.467 14.979 24.408 14.982 C 23.182 14.958 22.413 14.551 21.871 13.941 C 21.313 13.313 21 12.417 21 11.5 C 21 10.583 21.313 9.687 21.871 9.059 C 22.43 8.43 23.208 8 24.5 8 Z\\" style=\\"transform-origin: 24.5px 24px;\\" transform=\\"matrix(-1, 0, 0, -1, 0, 0)\\"/>%0A</svg>%0A")}.query-graph-actions .view-button.subquery{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <path d=\\"M 24.5 5 C 22.458 5 20.737 5.82 19.629 7.066 C 18.521 8.313 18 9.917 18 11.5 C 18 13.083 18.521 14.687 19.629 15.934 C 20.439 16.845 21.65 17.394 23 17.695 L 23 30.305 C 21.65 30.606 20.439 31.155 19.629 32.066 C 18.521 33.313 18 34.917 18 36.5 C 18 38.083 18.521 39.687 19.629 40.934 C 20.737 42.18 22.458 43 24.5 43 C 28.072 43 31 40.072 31 36.5 C 31 33.596 28.671 31.193 26.028 30.368 C 26.08 30.296 26 17.695 26 17.695 C 28.835 16.997 31 14.541 31 11.5 C 31 7.928 28.072 5 24.5 5 Z M 24.5 8 C 26.451 8 28 9.549 28 11.5 C 28 13.42 26.493 14.935 24.586 14.982 C 24.527 14.979 24.467 14.979 24.408 14.982 C 23.182 14.958 22.413 14.551 21.871 13.941 C 21.313 13.313 21 12.417 21 11.5 C 21 10.583 21.313 9.687 21.871 9.059 C 22.43 8.43 23.208 8 24.5 8 Z\\" transform=\\"matrix(0, 1, -1, 0, 48.499998, -0.499998)\\"/>%0A</svg>%0A");background-size:18.5px 18.5px}.query-graph-actions .view-button.delete{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%23888\\">%0A <path d=\\"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z\\"/>%0A</svg>%0A");background-size:12.5px 12.5px}.discovery-buildin-view-tooltip.hint-tooltip{padding:1px 6px;font-size:12px}.discovery-buildin-view-tooltip.hint-tooltip>.view-markdown{padding:2px 4px}.query-graph-tooltip{margin:4px}.query-graph-tooltip .view-source{background:0 0;margin:-5px -10px}.query-graph-tooltip>.view-badge{vertical-align:top;font-size:12px;margin:0 -5px!important;padding:4px 8px!important}.page-discovery>.discovery-editor .query-path{opacity:.35}.page-discovery>.discovery-editor .query-path .query{font-family:var(--discovery-monospace-font-family);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;background:#eee;border:1px solid #888;border-bottom-width:0;border-radius:4px 4px 0 0;margin-bottom:-4px;padding:2px 8px 6px;font-size:10px;line-height:16px;overflow:hidden}.discovery-root-darkmode .page-discovery>.discovery-editor .query-path .query{background:#333}.page-discovery>.discovery-editor .query-path .query:last-child{padding-bottom:7px}.page-discovery>.discovery-editor .query-path .query:empty:before{content:"<empty query>"}.page-discovery>.discovery-editor .query-path .query:hover{background:#ccc}.discovery-root-darkmode .page-discovery>.discovery-editor .query-path .query:hover{background:#444}.page-discovery>.discovery-editor .query-editor{position:relative}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__input-panel{background-color:var(--discovery-background-color);border-radius:1px 1px 0 0;grid-template-columns:auto 1fr auto;grid-template-areas:"actions input engine""details details details";gap:0 1px;margin:1px 0;padding:0 1px;display:grid}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__input-panel.details-expanded{border-bottom:1px solid var(--editor-border-color,#888);gap:1px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-engine{color:var(--discovery-color);background-color:#c0c0c02d;grid-area:engine;padding:1px 8px 3px;font-size:12px;text-decoration:none}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-engine:hover{background-color:#a5a5a54d}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-engine:before{content:"Syntax: ";color:#888}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input{grid-area:input;gap:1px;font-size:12px;display:flex}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-data,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-context{cursor:pointer;background-color:#c0c0c02d;flex:1;padding:1px 8px 3px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-data:hover,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-context:hover{background-color:#a5a5a54d!important}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input[data-details=data] .query-input-data,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input[data-details=context] .query-input-context{background-color:#cdcdcd1a;background-clip:padding-box;border-bottom:1px solid #cdcdcd1a;margin-bottom:-1px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-variable{color:var(--discovery-fmt-variable-color);font-family:var(--discovery-monospace-font-family);padding-right:14px;position:relative}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .num-delim-wrapper .num-delim{padding-left:1.25px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-variable:before{content:"";aspect-ratio:1;background:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M 3.71875 7.78125 L 2.28125 9.21875 L 11.28125 18.21875 L 12 18.90625 L 12.71875 18.21875 L 21.71875 9.21875 L 20.28125 7.78125 L 12 16.0625 Z \\"/>%0A</svg>%0A") 50%/12px no-repeat;height:100%;margin-right:2px;transition:transform .15s ease-in;position:absolute;top:0;right:0;transform:rotate(-90deg)}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input[data-details=data] .query-input-data .query-input-variable:before,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input[data-details=context] .query-input-context .query-input-variable:before{transform:rotate(0)}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-variable:after{content:" (" attr(data-name) ") ";color:#888;font-family:var(--discovery-font-family)}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-details{grid-area:details;max-height:max(30vh,150px);display:none;overflow:auto}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .discovery-view-editor__input-panel.details-expanded .query-input-details{margin-bottom:1px;display:block}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-details>.view-struct{margin:0}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel{border-radius:0 0 1px 1px;grid-template-columns:1fr auto;grid-template-areas:"result buttons";gap:1px;margin:1px;display:grid;overflow:hidden}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel.details-expanded{grid-template-areas:"result buttons""details details"}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons{grid-area:buttons;gap:1px;display:flex}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-button{border-radius:0;padding:3px 16px 4px;font-size:12px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox{cursor:pointer;background-color:#c0c0c02d;align-content:center;padding:2px 6px;font-size:12px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox input{display:none}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox .view-checkbox__label{content:"";aspect-ratio:1;color:#0000;background-color:var(--lightningcss-light,#c8c8c8)var(--lightningcss-dark,#6b6b6b);width:16px;margin:0;display:block;overflow:hidden;-webkit-mask:none 50%/16px no-repeat;mask:none 50%/16px no-repeat}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox.suggestions .view-checkbox__label{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 4 172 176\\">%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\"1.5\\" d=\\"M25.86719,12.84961l-7.64257,7.64257l3.82128,3.7793l7.60059,7.60058l3.77929,3.82129l7.64258,-7.64258l-3.82129,-3.77929l-7.60058,-7.60059zM146.13281,12.84961l-3.77929,3.82128l-11.37989,11.37989l7.60058,7.64258l3.7793,-3.82129l11.37987,-11.37989zM86,21.5c-23.68359,0 -43,19.31641 -43,43c0,14.86524 6.50879,23.43165 11.75781,30.73828c5.29102,7.26465 9.74219,13.4375 9.74219,28.38672v10.75c0,6.97071 4.57715,12.93359 10.83399,15.11719c-0.042,0.33594 -0.08399,0.67188 -0.08399,1.00781c0,5.9209 4.8291,10.75 10.75,10.75c5.9209,0 10.75,-4.8291 10.75,-10.75c0,-0.33594 0,-0.67187 -0.04199,-1.00781c6.25683,-2.22558 10.79199,-8.14648 10.79199,-15.11719v-10.75c0,-14.94922 4.45118,-21.12207 9.74219,-28.38672c5.24902,-7.30664 11.75781,-15.87304 11.75781,-30.73828c0,-23.68359 -19.31641,-43 -43,-43zM86,32.25c17.88868,0 32.25,14.36133 32.25,32.25c0,12.00977 -4.24121,16.88086 -9.74219,24.35547c-4.74511,6.59277 -9.44824,15.87305 -10.75,29.39453h-23.51562c-1.30176,-13.52148 -6.00489,-22.80176 -10.75,-29.39453c-5.50098,-7.4746 -9.74219,-12.3457 -9.74219,-24.35547c0,-17.88867 14.36133,-32.25 32.25,-32.25zM10.75,64.5v10.75h21.5v-10.75zM139.75,64.5v10.75h21.5v-10.75zM33.42578,104.05665l-3.77929,3.82128l-7.60059,7.60059l-3.82128,3.77929l7.64257,7.60058l11.37989,-11.37987l3.82129,-3.7793zM138.57422,104.05665l-7.60058,7.64257l15.15918,15.15918l7.60058,-7.60058l-11.37987,-11.37989zM75.25,129h21.5v5.375c0,3.02344 -2.35156,5.375 -5.375,5.375h-10.75c-3.02344,0 -5.375,-2.35156 -5.375,-5.375z\\" />%0A</svg>%0A");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 4 172 176\\">%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\"1.5\\" d=\\"M25.86719,12.84961l-7.64257,7.64257l3.82128,3.7793l7.60059,7.60058l3.77929,3.82129l7.64258,-7.64258l-3.82129,-3.77929l-7.60058,-7.60059zM146.13281,12.84961l-3.77929,3.82128l-11.37989,11.37989l7.60058,7.64258l3.7793,-3.82129l11.37987,-11.37989zM86,21.5c-23.68359,0 -43,19.31641 -43,43c0,14.86524 6.50879,23.43165 11.75781,30.73828c5.29102,7.26465 9.74219,13.4375 9.74219,28.38672v10.75c0,6.97071 4.57715,12.93359 10.83399,15.11719c-0.042,0.33594 -0.08399,0.67188 -0.08399,1.00781c0,5.9209 4.8291,10.75 10.75,10.75c5.9209,0 10.75,-4.8291 10.75,-10.75c0,-0.33594 0,-0.67187 -0.04199,-1.00781c6.25683,-2.22558 10.79199,-8.14648 10.79199,-15.11719v-10.75c0,-14.94922 4.45118,-21.12207 9.74219,-28.38672c5.24902,-7.30664 11.75781,-15.87304 11.75781,-30.73828c0,-23.68359 -19.31641,-43 -43,-43zM86,32.25c17.88868,0 32.25,14.36133 32.25,32.25c0,12.00977 -4.24121,16.88086 -9.74219,24.35547c-4.74511,6.59277 -9.44824,15.87305 -10.75,29.39453h-23.51562c-1.30176,-13.52148 -6.00489,-22.80176 -10.75,-29.39453c-5.50098,-7.4746 -9.74219,-12.3457 -9.74219,-24.35547c0,-17.88867 14.36133,-32.25 32.25,-32.25zM10.75,64.5v10.75h21.5v-10.75zM139.75,64.5v10.75h21.5v-10.75zM33.42578,104.05665l-3.77929,3.82128l-7.60059,7.60059l-3.82128,3.77929l7.64257,7.60058l11.37989,-11.37987l3.82129,-3.7793zM138.57422,104.05665l-7.60058,7.64257l15.15918,15.15918l7.60058,-7.60058l-11.37987,-11.37989zM75.25,129h21.5v5.375c0,3.02344 -2.35156,5.375 -5.375,5.375h-10.75c-3.02344,0 -5.375,-2.35156 -5.375,-5.375z\\" />%0A</svg>%0A")}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox.live-update .view-checkbox__label{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"-16 0 172 156\\">%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\"1.5\\" d=\\"M32.08203,10.75l-21.5,86h29.05859l-17.46875,53.75h23.89355l50.68457,-86h-32.37598l21.5,-53.75zM127.65625,10.75l-20.15625,53.75h12.09375l4.03125,-10.75h21.5l4.03125,10.75h12.09375l-20.15625,-53.75zM40.48047,21.5h29.52051l-21.5,53.75h29.43652l-38.00293,64.5h-2.98145l17.46875,-53.75h-30.06641zM134.375,25.11133l6.71875,17.88867h-13.4375z\\" />%0A</svg>%0A");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"-16 0 172 156\\">%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\"1.5\\" d=\\"M32.08203,10.75l-21.5,86h29.05859l-17.46875,53.75h23.89355l50.68457,-86h-32.37598l21.5,-53.75zM127.65625,10.75l-20.15625,53.75h12.09375l4.03125,-10.75h21.5l4.03125,10.75h12.09375l-20.15625,-53.75zM40.48047,21.5h29.52051l-21.5,53.75h29.43652l-38.00293,64.5h-2.98145l17.46875,-53.75h-30.06641zM134.375,25.11133l6.71875,17.88867h-13.4375z\\" />%0A</svg>%0A")}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox :checked+.view-checkbox__label{background-color:var(--lightningcss-light,#008dffbf)var(--lightningcss-dark,#b8b8b8)}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox:hover{background-color:#a5a5a54d}.page-discovery>.discovery-editor .data-query-result .query-result-data{cursor:pointer;background-color:#c0c0c02d;flex:1;padding:2px 8px;font-size:12px;display:flex}.page-discovery>.discovery-editor .data-query-result .query-result-data:hover{background-color:#a5a5a54d}.page-discovery>.discovery-editor .data-query-result .query-result-data>.query-output-message{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.page-discovery>.discovery-editor .data-query-result .query-result-data>.query-output-prelude{color:#888;padding-right:20px;display:inline-block;position:relative}.page-discovery>.discovery-editor .data-query-result .query-result-data>.query-output-prelude:before{content:"";aspect-ratio:1;background:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M 3.71875 7.78125 L 2.28125 9.21875 L 11.28125 18.21875 L 12 18.90625 L 12.71875 18.21875 L 21.71875 9.21875 L 20.28125 7.78125 L 12 16.0625 Z \\"/>%0A</svg>%0A") 50%/12px no-repeat;height:100%;margin-right:2px;transition:transform .15s ease-in;position:absolute;top:0;right:0;transform:rotate(-90deg)}.page-discovery>.discovery-editor .data-query-result .query-result-data.error{background-color:#ff2d2836}.page-discovery>.discovery-editor .discovery-view-editor__output-panel.details-expanded .data-query-result .query-result-data>.query-output-prelude:before{transform:rotate(0)}.page-discovery>.discovery-editor .data-query-result{grid-area:result;overflow:hidden}.page-discovery>.discovery-editor .data-query-result>*{overflow:hidden}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel .data-query-result-details{grid-area:details;max-height:max(50vh,200px);overflow:auto}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel:not(.details-expanded) .data-query-result-details{display:none}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel .data-query-result-details>.view-struct{margin:0}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-details>.state-message,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel .data-query-result-details .state-message{color:#888;background-color:#cdcdcd1a;padding:4px 8px;font-size:12px}.page-discovery>.discovery-editor .view-editor-form{margin:12px calc(-1 * var(--discovery-page-padding-right)) 12px calc(-1 * var(--discovery-page-padding-left))}.page-discovery>.discovery-editor .view-editor-form-header{margin-right:var(--discovery-page-padding-right);flex-wrap:wrap-reverse;display:flex}.page-discovery>.discovery-editor .view-editor-form-header-links{text-align:right;flex:1;margin:2px 0 0 10px;font-size:12px}.page-discovery>.discovery-editor .discovery-editor-tabs.view-mode:before{content:"View:";display:inline-block}.page-discovery>.discovery-editor .discovery-editor-tab[data-mode=default]{border-top-left-radius:4px}.page-discovery>.discovery-editor .view-editor-form:not(.hide-editor) .discovery-editor-tab[data-mode=default]{border-bottom-left-radius:0}.page-discovery>.discovery-editor .discovery-editor-tab[data-mode=custom]{cursor:pointer}.page-discovery>.discovery-editor .view-editor-form:not(.hide-editor) .discovery-editor-tab[data-mode=custom]{border-bottom-right-radius:0;padding-bottom:3px}.page-discovery>.discovery-editor .discovery-editor-tabs .discovery-editor-tab:not(.active) .show-view-editor-toggle{pointer-events:none}.page-discovery>.discovery-editor .discovery-editor-tabs .show-view-editor-toggle{vertical-align:middle;cursor:pointer;margin:-3px -9px -7px 1px;display:inline-block}.page-discovery>.discovery-editor .discovery-editor-tabs .show-view-editor-toggle:before{content:"";aspect-ratio:1;background-color:var(--lightningcss-light,#aaa)var(--lightningcss-dark,#aaac);width:20px;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z\\"/>%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8\\"/>%0A</svg>%0A") 50%/12px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z\\"/>%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8\\"/>%0A</svg>%0A") 50%/12px no-repeat}.page-discovery>.discovery-editor .discovery-editor-tabs .discovery-editor-tab.active:hover .show-view-editor-toggle:before{background-color:#fff;background-color:var(--lightningcss-light,#008dff)var(--lightningcss-dark,#ccc)}.page-discovery>.discovery-editor .view-editor-form.hide-editor .discovery-editor-tabs .show-view-editor-toggle:before{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z\\"/>%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4\\"/>%0A</svg>%0A");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z\\"/>%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4\\"/>%0A</svg>%0A")}.page-discovery>.discovery-editor .discovery-editor-tabs.presets{margin-left:3ex}.page-discovery>.discovery-editor .discovery-editor-tabs.presets:before{content:"View presets:"}.page-discovery>.discovery-editor .discovery-editor-tabs.presets .discovery-editor-tab:first-child{border-bottom-left-radius:4px}.page-discovery>.discovery-editor .view-editor-form.hide-editor .view-editor-form-content{display:none}.page-discovery>.discovery-editor .view-editor-form-content{padding:8px var(--discovery-page-padding-right) 8px var(--discovery-page-padding-left);background-color:#6cbcf126;margin-bottom:1px}.page-discovery>.discovery-editor .view-editor-form-content .formatting{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 172 172\\">%0A <path fill=\\"%23888\\" d=\\"M26.875,21.5c-8.84221,0 -16.125,7.28279 -16.125,16.125v96.75c0,8.84221 7.28279,16.125 16.125,16.125h37.625v-10.75h-37.625c-3.02579,0 -5.375,-2.34921 -5.375,-5.375v-96.75c0,-3.02579 2.34921,-5.375 5.375,-5.375h118.25c3.02579,0 5.375,2.34921 5.375,5.375v26.875h10.75v-26.875c0,-8.84221 -7.28279,-16.125 -16.125,-16.125zM78.35742,43l-24.37646,83.54345l-0.23096,2.45655h10.68701l6.27783,-21.5h15.09619l10.75,-10.75h-22.69678l12.19873,-41.76123l11.73682,40.52246l8.6084,-8.6084l-12.63965,-43.90283zM137.46142,75.29199c-2.61253,0 -5.21878,0.97757 -7.18066,2.93945l-52.04932,52.07031c-3.92375,3.92375 -3.92375,10.43757 0,14.36132l24.35547,24.35547c3.92375,3.92375 10.43757,3.92375 14.36132,0l52.04932,-52.04932c3.94035,-3.91783 3.94035,-10.4645 0,-14.38232l-24.33447,-24.35547c-1.96187,-1.96188 -4.58912,-2.93945 -7.20166,-2.93945zM137.46142,86.25195l23.53662,23.53663l-21.81493,21.79394l-23.51562,-23.51563zM108.06689,115.66748l23.51563,23.51562l-21.81493,21.81493l-23.51563,-23.51562z\\"/>%0A</svg>%0A");background-position:50%;background-repeat:no-repeat;background-size:20px;border-color:#1562944d;width:30px;height:30px;font-size:0;position:absolute;left:5px}.page-discovery>.discovery-editor .view-editor-form-content .view-expand{width:100%;margin-top:5px}.page-discovery>.discovery-editor .view-editor-form-content .view-expand .header{background:0 0}.page-discovery>.discovery-editor .view-editor-form-content .view-expand .header:hover{background:#0000000d}.page-discovery>.discovery-editor .view-editor-form-content .view-editor-view-list{color:#aaa;column-count:8;column-width:150px;column-gap:20px;margin-right:-190px;padding:15px 8px;font-size:12px;display:none}.page-discovery>.discovery-editor .view-editor-form-content .view-editor-view-list.visible{display:block}.page-discovery>.discovery-editor .view-editor-form-content .view-editor-view-list .item:not([href]){color:#888}.discovery-view-popup.view-editor-view-list-hint{min-width:640px;min-height:100px;padding:20px}.discovery-view-popup.view-editor-view-list-hint>.discovery-view-usage>.view-header:first-child{background:#b4b4b433;margin:-36px -20px 0;padding:6px 20px;font-size:16px;line-height:24px}.page-discovery{padding-top:20px!important}.discovery:not([data-dzen]) .page-discovery>.discovery-render-content{min-height:calc(100vh - 121px)}.page-discovery>.discovery-editor .discovery-error,.page-discovery>.discovery-render-content>.discovery-error{white-space:pre-wrap;font-size:12px;font-family:var(--discovery-monospace-font-family);background:#e14b4b33 padding-box padding-box;border-left:3px solid #f00c;padding:8px 12px;font-size:11px;display:block;overflow:hidden}.page-discovery>.discovery-editor .discovery-error:before,.page-discovery>.discovery-render-content>.discovery-error:before{margin-bottom:.5em;font-size:16px;display:block}.page-discovery>.discovery-editor .query-error:before{content:"Query error"}.page-discovery>.discovery-render-content>.render-error:before{content:"Render error"}.discovery-view-usage{margin-top:16px}.discovery-view-usage>.view-header:first-child{margin-top:0;font-family:Helvetica Neue,Helvetica,Tahoma,Arial,sans-serif;font-weight:200}.discovery-view-usage .usage-render{z-index:0;border:2px solid #aaa3;border-radius:3px;margin:15px 0 10px;padding:30px 16px 16px;position:relative}.discovery-view-usage .usage-render[data-render-type=text]>.view-text-render{margin:-16px;padding:16px;overflow-x:auto}.discovery-view-usage .usage-render.demo-fixed{--image-preview-bg-color:#77777720;padding:var(--discovery-page-padding-top) var(--discovery-page-padding-right) var(--discovery-page-padding-bottom) var(--discovery-page-padding-left);background-clip:padding-box;background-image:linear-gradient(45deg,var(--image-preview-bg-color) 25%,transparent 0,transparent 75%,var(--image-preview-bg-color) 75%),linear-gradient(45deg,var(--image-preview-bg-color) 25%,transparent 0,transparent 75%,var(--image-preview-bg-color) 75%);background-position:0 0,10px 10px;background-size:20px 20px;border-top-left-radius:0;margin-top:29px}.discovery-view-usage .usage-render:before{content:"DEMO";background-color:#aaa3;border-bottom-right-radius:4px;padding:2px 24px 3px;font-size:9px;line-height:1;position:absolute;top:0;left:0}.discovery-view-usage .usage-render.demo-fixed:before{border-radius:4px 4px 0 0;padding-left:26px;top:-16px;left:-2px}.discovery-view-usage .usage-section>.view-h2{margin-top:1.2em;margin-bottom:.5em}.discovery-view-usage .usage-section>.view-h2 .view-header__anchor{scroll-margin:.5em}.discovery-view-usage .view-tabs.usage-sources .view-tabs-buttons:before{display:none}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content{border:1px solid #aaa6;border-top:none;border-radius:0 0 3px 3px;padding:2px;overflow:visible}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content .view-expand{margin-bottom:1px}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content .view-expand>.header{--discovery-view-expand-trigger-size:32px}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content .view-expand .view-struct.struct-expand{padding-left:28px}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content .view-expand .view-struct:not(.struct-expand){border-left:20px solid #cdcdcd1a}.discovery-view-usage .view-tabs.usage-sources .view-source{background:#9b9b9b1a;border-top-left-radius:0;border-top-right-radius:0}.discovery-view-usage .view-tabs.usage-sources .view-source.first-tab{border-top-left-radius:0}.discovery-view-usage .view-tabs.usage-sources .view-source .spotlight{margin:0 -2px;padding:3px 2px 2px}.discovery-root-darkmode .discovery-view-usage .view-tabs.usage-sources .view-source .spotlight{color:#b6aa6a;background:#92926654}.page-views-showcase{box-sizing:border-box;background-color:#fffc;border:1px solid #aaa6;border-radius:3px;flex-direction:row;flex:1;margin:35px 40px 20px;transition-property:background-color;transition-duration:.25s;transition-timing-function:ease-in;display:flex;overflow:hidden;padding:0!important}.discovery-root-darkmode .page-views-showcase{background-color:#242424cc}.page-views-showcase>.sidebar{border-right:1px solid #aaa3;flex-direction:column;width:220px;display:flex}.page-views-showcase>.sidebar>.sidebar-header{align-items:stretch;gap:1px;margin:1px;display:flex}.page-views-showcase>.sidebar>.sidebar-header .index-page-link{color:var(--discovery-color);text-align:center;flex:1;padding:3px 11px;font-size:13px;text-decoration:none;display:block}.page-views-showcase>.sidebar>.sidebar-header .index-page-link:not(.view-selected){cursor:default;background-color:#bd78ff40}.page-views-showcase>.sidebar>.sidebar-header .index-page-link.view-selected:hover{cursor:pointer;background-color:#83838340}.page-views-showcase>.sidebar>.sidebar-header .index-page-link:before{content:"↑ ";font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Tahoma,sans-serif}.page-views-showcase>.sidebar>.sidebar-header .index-page-link:not(.view-selected):before{content:""}.page-views-showcase>.sidebar>.sidebar-header .render-toggle{border-left:1px solid #aaa3;padding-left:8px;font-size:11px}.page-views-showcase>.sidebar>.sidebar-header .render-toggle .view-toggle{border-radius:0;padding-top:5px;padding-bottom:5px;font-size:11px}.page-views-showcase>.sidebar .view-content-filter{flex-direction:column;flex:1;display:flex;overflow:hidden}.page-views-showcase>.sidebar .view-content-filter>.view-input{margin:0}.page-views-showcase>.sidebar .view-content-filter>.view-input input{box-shadow:none;border:1px solid #aaa3;border-left:none;border-right:none;border-radius:0}.page-views-showcase>.sidebar .view-content-filter .view-block{flex:1;padding:1px;overflow:hidden scroll}.page-views-showcase>.sidebar .view-menu-item:not(.disabled){color:var(--discovery-link-color,#09d)}.page-views-showcase>.sidebar .view-menu-item.selected{background-color:#54768b4d}.page-views-showcase>.sidebar .view-menu-item:not(.selected):hover{color:var(--discovery-link-hover-color,#07b)}.page-views-showcase>.content{flex:1;padding:0 24px 20px;overflow:hidden scroll}.page-views-showcase>.content:not(:has(>.discovery-view-usage>.view-h1:first-child,>.view-h1:first-child)){padding-top:20px}.page-views-showcase>.content>.view-h1{margin-top:16px;font-family:Helvetica Neue,Helvetica,Tahoma,Arial,sans-serif;font-weight:200}.page-views-showcase .view-markdown .view-render{gap:2px;margin:8px 0;display:flex}.page-views-showcase .view-markdown .view-render__source:before,.page-views-showcase .view-markdown .view-render__result:before{content:"Discovery.js view";border-bottom:1px solid var(--discovery-background-color);background-color:color-mix(in srgb,currentcolor 15%,var(--discovery-background-color));padding:4px 8px;display:block}.page-views-showcase .view-markdown .view-render__result:before{content:"Render result"}.page-views-showcase .view-markdown .view-render__source{flex-direction:column;width:510px;max-width:49%;display:flex}.page-views-showcase .view-markdown .view-render__source>.view-source{flex:1}.page-views-showcase .view-markdown .view-render__result{flex-direction:column;flex:1;display:flex}.page-views-showcase .view-markdown .view-render__result>pre{flex:1;padding:8px 16px}.discovery-view-inspector-overlay{z-index:2000;background-color:#0000ff1a;position:fixed;inset:0}.discovery-view-inspector-overlay .cancel-hint{content:"Inspection mode is enabled. Press Esc to cancel";z-index:10;background-color:var(--discovery-background-color);opacity:.8;border-radius:25px;padding:2px 10px;font-size:12px;position:absolute;top:4px;left:50%;transform:translate(-50%)}.discovery-view-inspector-overlay .cancel-hint:before{content:"Inspection mode is enabled. Press Esc to cancel"}.discovery-view-inspector-overlay .cancel-hint[data-alt]:before{content:"Inspection mode is enabled. Unhold Alt to cancel"}.discovery-view-inspector-overlay .overlay{box-sizing:border-box;transition:background-color 15ms 25ms;position:absolute}.discovery-view-inspector-overlay .overlay.view-root:not([data-inspectable]){pointer-events:none}.discovery-view-inspector-overlay .overlay:not(.view-root){pointer-events:auto}.discovery-view-inspector-overlay .overlay.hovered{background-color:rgba(0,255,0,var(--discovery-background-alpha));outline-offset:-1px;--discovery-background-alpha:.3;outline:1px dashed #00800066}.discovery-view-inspector-overlay .overlay.view-root.hovered{background-color:rgba(106,0,204,var(--discovery-background-alpha));outline:1px dashed #36006666}.discovery-root-darkmode .discovery-view-inspector-overlay .overlay.hovered{--discovery-background-alpha:.2;outline-color:#80c880a6}.discovery-root-darkmode .discovery-view-inspector-overlay .overlay.view-root.hovered{outline-color:#6f4a98a6}@supports ((-webkit-backdrop-filter:grayscale(1)) or (backdrop-filter:grayscale(1))){.discovery-view-inspector-overlay .overlay.hovered{--discovery-background-alpha:.25;-webkit-backdrop-filter:grayscale();backdrop-filter:grayscale()}}.discovery-inspect-details-popup{pointer-events:none;z-index:2001;background:rgba(255,255,255,var(--discovery-background-alpha));--discovery-background-alpha:.95;--discovery-mate-background:#f0f0f080;--discovery-link-color:#333;--discovery-link-underline-color:#0002;--discovery-view-root-highlight-color:#6a00cc40;border-radius:2px;grid-template:"sidebar toolbar toolbar""sidebar props-config data-context"1fr/0 4fr 6fr;gap:1px;padding:1px;display:grid;max-width:650px!important}.discovery-root-darkmode .discovery-inspect-details-popup{background:rgba(36,36,36,var(--discovery-background-alpha));--discovery-background-alpha:.92;--discovery-mate-background:#34343480;--discovery-link-color:#aaa;--discovery-link-underline-color:#aaa2;--discovery-view-root-highlight-color:#bd78ff40}.discovery-inspect-details-popup.frozen{pointer-events:all;grid-template-rows:auto minmax(20%,1fr);grid-template-columns:minmax(290px,25%) 4fr 6fr;transition:top .125s,left .125s,right .125s,bottom .125s,grid-template-rows .125s,grid-template-columns .125s;max-width:none!important;max-height:none!important;inset:32px 20px 20px!important}.discovery-inspect-details-popup:not(.frozen){padding-bottom:21px}.discovery-inspect-details-popup:not(.frozen):after{content:"Cmd+Click (Mac) or Ctrl+Click (Win) opens the view description in a documentation";text-align:center;white-space:nowrap;border-top:1px solid var(--discovery-background-color);background-color:color-mix(in srgb,var(--discovery-background-color),var(--lightningcss-light,#000)var(--lightningcss-dark,#fff) 10%);color:#888;padding:.4em 1ex;font-size:11px;line-height:1;position:absolute;bottom:0;left:0;right:0}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.discovery-inspect-details-popup{--discovery-background-alpha:.65;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.discovery-root-darkmode .discovery-inspect-details-popup{--discovery-background-alpha:.4}}.discovery-inspect-details-popup .sidebar{overscroll-behavior:contain;background-color:var(--discovery-mate-background);grid-area:sidebar;padding:4px;overflow:auto}.discovery-inspect-details-popup .sidebar .view-tree-leaf-content{white-space:nowrap;padding-right:12px}.discovery-inspect-details-popup .sidebar .view-root{background-color:var(--discovery-view-root-highlight-color);border:1px solid #0000;border-width:1px 8px;margin-bottom:1px;margin-left:-6px;display:inline-block}.discovery-inspect-details-popup .sidebar .selected{background-color:#4ebbff4d;display:inline;box-shadow:0 0 0 3px #4ebbff4d}.discovery-inspect-details-popup .sidebar .skipped{opacity:.65;font-style:italic;text-decoration:line-through}.discovery-inspect-details-popup .sidebar>.view-tree-leaf:only-child{background:0 0;grid-template-columns:6px auto;margin:-4px 0 0 -4px}.discovery-inspect-details-popup .sidebar>.view-tree-leaf:only-child>.view-tree-leaf-toggle{display:none}.discovery-inspect-details-popup .sidebar .view-badge{vertical-align:top;border-radius:0;margin-left:1ex;margin-right:0;font-size:9px}.discovery-inspect-details-popup .sidebar .view-badge+.view-badge{margin-left:1px}.discovery-inspect-details-popup .toolbar{grid-area:toolbar;gap:1px;display:flex}.discovery-inspect-details-popup .stack-view-chain{background-color:var(--discovery-mate-background);flex:1;gap:1px}.discovery-inspect-details-popup .stack-view-chain .view-toggle{border-radius:0;margin:0;padding:5px 8px;line-height:16px}.discovery-inspect-details-popup .stack-view-chain .skipped{opacity:.65;font-style:italic;text-decoration:line-through}.discovery-inspect-details-popup .stack-view-chain .view-root:not(.checked):not(:hover){background-color:var(--discovery-view-root-highlight-color)}.discovery-inspect-details-popup .stack-view-chain .data-flow-changes{vertical-align:middle;text-align:center;text-transform:uppercase;gap:2px;margin:-5px -2px -2px 4px;font-size:7px;line-height:12px;display:inline-flex;position:relative}.discovery-inspect-details-popup .stack-view-chain .data-flow-changes>*{border-radius:8px;width:12px;height:12px;overflow:hidden;box-shadow:1px 1px 1px #0003}.discovery-inspect-details-popup .stack-view-chain .data-flow-changes .data{background:#1f841f80}.discovery-inspect-details-popup .stack-view-chain .data-flow-changes .context{background:#b1366f80;bottom:0}.discovery-inspect-details-popup .toolbar .view-button{box-shadow:none;border-radius:2px 1px 2px 2px;padding:5px 8px 7px;font-size:12px;line-height:12px}.discovery-inspect-details-popup .content{background-color:var(--discovery-mate-background);font-size:12px;line-height:14px;overflow:hidden}.discovery-inspect-details-popup.frozen .content{overflow:auto}.discovery-inspect-details-popup .content .view-struct{background-color:#0000;overflow:visible}.discovery-inspect-details-popup .content .view-source{background-color:#0000;font-size:11px;line-height:15px}.discovery-inspect-details-popup .content.props-config{grid-area:props-config}.discovery-inspect-details-popup .content.data-context{grid-area:data-context}.discovery-inspect-details-popup .content-section:before{content:var(--header);text-transform:uppercase;color:#444;border-bottom:2px solid #ddd;margin-left:7px;padding:8px 10px 2px 1px;font-size:10px;display:inline-block}.discovery-root-darkmode .discovery-inspect-details-popup .content-section:before{color:inherit;text-shadow:1px 1px #00000040;border-bottom:2px solid #666}.discovery-inspect-details-popup .content-section.skip{--header:"Not rendered reason"}.discovery-inspect-details-popup .content-section.skip .view-block{padding:6px 0 8px 6px;font-size:14px}.discovery-inspect-details-popup .content-section.render{--header:"Render function"}.discovery-inspect-details-popup .content-section.props{--header:"Render props"}.discovery-inspect-details-popup .content-section.config{--header:"Config"}.discovery-inspect-details-popup .content-section.props .transition-fn{border-left:1px solid #888;margin:-4px 0 -4px 11px;padding:16px 0 0 4px;position:relative}.discovery-inspect-details-popup .content-section.props .transition-fn .view-source__content{padding-bottom:6px}.discovery-inspect-details-popup .content-section.props .transition-fn:before{content:"";box-sizing:border-box;border:3.5px solid #0000;border-top:none;border-bottom:7px solid #888;width:7px;height:7px;position:absolute;top:-2px;left:-4px}.discovery-inspect-details-popup .content-section.props .transition-fn:after{content:"Normalize (view.options.props)";opacity:.75;background:#8885;padding:0 4px;font-size:10px;position:absolute;top:5px;left:0}.discovery-inspect-details-popup .content-section.config>.view-tree{margin-left:6px}.discovery-inspect-details-popup .content-section.config .view-tree-leaf-content>.view-struct{margin:-4px 0 -4px -4px}.discovery-inspect-details-popup .content-section.data{--header:"Data"}.discovery-inspect-details-popup .content-section.data .data-flow-transitions{flex-direction:column-reverse;display:flex}.discovery-inspect-details-popup .content-section.data .data-flow-transitions>.more-buttons{margin-top:0;margin-bottom:-4px;padding:6px 0 0 8px}.discovery-inspect-details-popup .content-section.data .data-flow-transitions>.more-buttons .more-button{padding-top:2px;padding-bottom:2px}.discovery-inspect-details-popup .content-section.data .root-data{pointer-events:none;margin-bottom:-6px;padding:6px 0 0 8px}.discovery-inspect-details-popup .content-section.data .root-data .view-badge{text-transform:uppercase;padding:2px 8px;font-size:9px}.discovery-inspect-details-popup .content-section.data .data-flow-transition{border-left:1px solid #888;margin:-4px 0 -2px 11px;padding:12px 0 0 4px;position:relative}.discovery-inspect-details-popup .content-section.data .data-flow-transition>.view-name{opacity:.75;background:#8885;padding:0 4px;font-size:10px;position:absolute;top:0;left:0}.discovery-inspect-details-popup .content-section.data .data-flow-transition:before{content:"";box-sizing:border-box;border:3.5px solid #0000;border-top:7px solid #888;border-bottom:none;width:7px;height:7px;position:absolute;bottom:-2px;left:-4px}.discovery-inspect-details-popup .content-section.context{--header:"Context"}:host{transition:opacity .2s}.discovery-root{all:initial;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light only;font-family:var(--discovery-font-family);-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;background-color:var(--discovery-background-color,white);color:var(--discovery-color,black);--discovery-app-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"-6 -4 136 140\\">%0A <rect x=\\"65.6\\" y=\\"24.6\\" transform=\\"matrix(0.9397 -0.342 0.342 0.9397 -9.9426 31.828)\\" fill=\\"%23FFFFFF\\" width=\\"39.3\\" height=\\"39\\"></rect>%0A <rect x=\\"70.6\\" y=\\"52.7\\" transform=\\"matrix(-0.9397 0.342 -0.342 -0.9397 194.7852 81.1204)\\" fill=\\"%23C7D7E2\\" width=\\"39.3\\" height=\\"10\\"></rect>%0A <path fill=\\"%2398BED8\\" d=\\"M111.5,54.6l-1.1,1.1L97.1,19.1l1.5,0.2c8,0.9,14.7,6.2,17.4,13.7l0,0C118.8,40.4,117,48.8,111.5,54.6z\\"></path>%0A <path fill=\\"%23454B54\\" d=\\"M73.5,72.2c-1.2,0-2.4-0.8-2.8-2L57.3,33.5c-0.3-0.7-0.2-1.6,0.1-2.3c0.3-0.7,0.9-1.3,1.7-1.6l36.9-13.4c1.6-0.6,3.3,0.2,3.8,1.8l13.3,36.6c0.3,0.7,0.2,1.6-0.1,2.3c-0.3,0.7-0.9,1.3-1.7,1.6L74.5,72C74.2,72.1,73.8,72.2,73.5,72.2zM64,34.3l11.3,31l31.3-11.4l-11.3-31L64,34.3z\\"></path>%0A <rect x=\\"35\\" y=\\"46.7\\" transform=\\"matrix(0.9397 -0.342 0.342 0.9397 -16.2011 20.988)\\" fill=\\"%23FFFFFF\\" width=\\"32.8\\" height=\\"19.5\\"></rect>%0A <rect x=\\"37.3\\" y=\\"59.8\\" transform=\\"matrix(-0.9397 0.342 -0.342 -0.9397 125.6763 103.3946)\\" fill=\\"%23C7D7E2\\" width=\\"32.8\\" height=\\"6\\"></rect>%0A <path fill=\\"%23454B54\\" d=\\"M39.4,74.2c-0.4,0-0.9-0.1-1.3-0.3c-0.7-0.3-1.3-0.9-1.6-1.7l-6.7-18.3c-0.3-0.7-0.2-1.6,0.1-2.3c0.3-0.7,0.9-1.3,1.7-1.6l30.8-11.2c0.7-0.3,1.6-0.2,2.3,0.1c0.7,0.3,1.3,0.9,1.6,1.7L73,59c0.6,1.6-0.2,3.3-1.8,3.8L40.4,74C40,74.1,39.7,74.2,39.4,74.2z M36.5,54.7l4.6,12.7l25.2-9.2l-4.6-12.7L36.5,54.7z\\"></path>%0A <path fill=\\"%23454B54\\" d=\\"M70,118.9c-1.2,0-2.4-0.7-2.8-1.9l-14-37.2l-8.4,3.1l-17.2,34.4c-0.7,1.5-2.5,2.1-4,1.3c-1.5-0.7-2.1-2.5-1.3-4L40,79c0.3-0.7,0.9-1.2,1.7-1.5L54,73.1c1.5-0.6,3.3,0.2,3.8,1.8l15,40c0.6,1.6-0.2,3.3-1.8,3.9C70.7,118.8,70.4,118.9,70,118.9z\\"></path>%0A <path fill=\\"%23454B54\\" d=\\"M13.6,80.1c-1.2,0-2.4-0.8-2.8-2L6.3,65.9c-0.6-1.6,0.2-3.3,1.8-3.8c1.6-0.6,3.3,0.2,3.8,1.8l4.4,12.2c0.6,1.6-0.2,3.3-1.8,3.8C14.3,80.1,14,80.1,13.6,80.1z\\"></path>%0A <path fill=\\"%23454B54\\" d=\\"M13.2,73.3c-1.2,0-2.4-0.8-2.8-2c-0.6-1.6,0.2-3.3,1.8-3.8L35,59.2c1.6-0.6,3.3,0.2,3.8,1.8c0.6,1.6-0.2,3.3-1.8,3.8l-22.8,8.3C13.9,73.3,13.6,73.3,13.2,73.3z\\"></path>%0A</svg>%0A");--discovery-font-family:Tahoma, Verdana, Arial, sans-serif;--discovery-monospace-font-family:SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;--discovery-monospace-font-size:12px;--discovery-monospace-line-height:1.5;--discovery-ui-font-family:system-ui, Arial, sans-serif;--discovery-background-color:white;--discovery-color:black;--discovery-input-bg-color:white;--discovery-input-color:black;--discovery-button-color:black;--discovery-button-bg-color:white;--discovery-button-border-color:#ccc;--discovery-button-hover-color:black;--discovery-button-hover-bg-color:#f5f5f5;--discovery-button-hover-border-color:#ccc;--discovery-fmt-color:#666;--discovery-fmt-hover-color:#333;--discovery-fmt-flag-color:#ff6e13;--discovery-fmt-variable-color:#047d65;--discovery-fmt-property-color:#bd6476;--discovery-fmt-keyword-color:#9150c5;--discovery-fmt-number-color:#07a;--discovery-fmt-atom-color:#07a;--discovery-fmt-type-color:#a7994b;--discovery-fmt-string-color:#690;--discovery-fmt-string-highlight-color:#23a5191a;--discovery-fmt-comment-color:#75787b;--discovery-fmt-qualifier-color:#dd4a68;--discovery-fmt-entity-color:#9a6e3a;--discovery-fmt-punctuation-color:#999;--discovery-fmt-meta-color:#9150c5;--discovery-fmt-negative-color:#ec2b2b;--discovery-fmt-positive-color:#690;--discovery-page-padding-top:35px;--discovery-page-padding-right:40px;--discovery-page-padding-bottom:30px;--discovery-page-padding-left:40px;font-size:14px;line-height:1.6;transition-property:background-color,color;transition-duration:.25s;transition-timing-function:ease-in;position:relative}.discovery-root-darkmode{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark only;--discovery-background-color:#242424;--discovery-color:#ccc;--discovery-link-color:#1c87d4;--discovery-link-underline-color:#2592e280;--discovery-link-hover-color:#4aa6e8;--discovery-input-bg-color:#343434;--discovery-input-color:#e8e8e8;--discovery-button-color:#ccc;--discovery-button-bg-color:#3a3a3a;--discovery-button-border-color:#ccc;--discovery-button-hover-color:black;--discovery-button-hover-bg-color:#f5f5f5;--discovery-button-hover-border-color:#ccc;--discovery-fmt-color:#999;--discovery-fmt-hover-color:#aaa;--discovery-fmt-flag-color:#ff8030;--discovery-fmt-variable-color:#16a78a;--discovery-fmt-property-color:#d17a8c;--discovery-fmt-keyword-color:#a783c4;--discovery-fmt-number-color:#0f8dc2;--discovery-fmt-atom-color:#0f8dc2;--discovery-fmt-string-color:#7faf20;--discovery-fmt-string-underline-color:#85ab51;--discovery-fmt-string-hover-color:#97cf26;--discovery-fmt-meta-color:#a783c4;--discovery-fmt-negative-color:#eb6969;--discovery-fmt-positive-color:#7faf20}.discovery[data-dzen] .discovery-hidden-in-dzen{display:none}.discovery{height:100%;display:flex;overflow:hidden}.discovery-content{z-index:10;flex-direction:column;flex:1;display:flex;position:relative;overflow:auto}.discovery-content>.page{padding:var(--discovery-page-padding-top) var(--discovery-page-padding-right) var(--discovery-page-padding-bottom) var(--discovery-page-padding-left)}.discovery[data-compact] .page{--discovery-page-padding-top:0;--discovery-page-padding-left:0;--discovery-page-padding-right:0;--discovery-page-padding-bottom:0}.discovery-sidebar{z-index:200;background:#6969691a;border-right:1px solid #5553;width:350px;position:relative;overflow:auto;transform:translateZ(0);box-shadow:2px 0 5px -3px #00000042}.discovery-sidebar:empty{display:none}.discovery-sidebar .view-tabs,.discovery-sidebar .view-tabs-content,.discovery-sidebar .view-content-filter{flex-direction:column;max-height:100%;display:flex}.discovery-sidebar .view-tabs{height:100%}.discovery-sidebar .view-tab.active:before{background-color:#fff;transition-property:background-color;transition-duration:.25s;transition-timing-function:ease-in}.discovery-root-darkmode .discovery-sidebar .view-tab.active:before{background-color:#363637}.discovery-sidebar .view-content-filter>.view-input{background-color:#fff;border-bottom:1px solid #aaa6;margin-bottom:-1px;transition-property:background-color;transition-duration:.25s;transition-timing-function:ease-in}.discovery-root-darkmode .discovery-sidebar .view-content-filter>.view-input{background-color:#363637}.discovery-sidebar .view-content-filter>.view-input input,.discovery-sidebar .view-content-filter>.view-input input:focus{box-shadow:none;background-color:#0000;border:none;border-radius:0;outline:none}.discovery-sidebar .view-content-filter>.content>.view-list{padding:8px 0 8px 12px}.discovery-sidebar .view-content-filter>.content>.view-tree{padding:4px 0 8px 8px}.discovery-sidebar .view-list-item:first-child .view-toc-section{margin-top:-8px}.discovery-sidebar .view-list-item:last-child .view-toc-section{margin-bottom:-8px}.discovery-sidebar .view-toc-section{margin-left:-12px}.discovery-sidebar .view-text-match{color:#282828d9;background:#ffffff73;border-bottom:2px solid orange;border-radius:3px;padding:0 1px;line-height:1.2;display:inline-block}.discovery-nav{z-index:102;top:0;right:var(--discovery-page-padding-right,40px);-webkit-user-select:none;user-select:none;background-color:#ffffffeb;border-radius:0 0 6px 6px;padding:0 1px 1px;transition:background-color .25s ease-in;position:absolute}.discovery-root-darkmode .discovery-nav{background-color:#242424eb}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.discovery-nav{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fffc}.discovery-root-darkmode .discovery-nav{background-color:#242424cc}}.discovery-nav>:first-child{border-bottom-left-radius:5px;transition:border-radius .25s ease-in-out}.discovery-nav>:last-child{border-bottom-right-radius:5px;transition:border-radius .25s ease-in-out}.discovery-nav .view-nav-button.discovery-view-popup-active:not(.discovery-view-has-tooltip){border-radius:0}.discovery-nav .view-nav-button[data-name=burger]{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 172 172\\">%0A <path fill=\\"%23888\\" d=\\"M21.5,35.83333c-2.58456,-0.03655 -4.98858,1.32136 -6.29153,3.55376c-1.30295,2.2324 -1.30295,4.99342 0,7.22582c1.30295,2.2324 3.70697,3.59031 6.29153,3.55376h129c2.58456,0.03655 4.98858,-1.32136 6.29153,-3.55376c1.30295,-2.2324 1.30295,-4.99342 0,-7.22582c-1.30295,-2.2324 -3.70697,-3.59031 -6.29153,-3.55376zM21.5,78.83333c-2.58456,-0.03655 -4.98858,1.32136 -6.29153,3.55376c-1.30295,2.2324 -1.30295,4.99342 0,7.22582c1.30295,2.2324 3.70697,3.59031 6.29153,3.55376h129c2.58456,0.03655 4.98858,-1.32136 6.29153,-3.55376c1.30295,-2.2324 1.30295,-4.99342 0,-7.22582c-1.30295,-2.2324 -3.70697,-3.59031 -6.29153,-3.55376zM21.5,121.83333c-2.58456,-0.03655 -4.98858,1.32136 -6.29153,3.55376c-1.30295,2.2324 -1.30295,4.99342 0,7.22582c1.30295,2.2324 3.70697,3.59031 6.29153,3.55376h129c2.58456,0.03655 4.98858,-1.32136 6.29153,-3.55376c1.30295,-2.2324 1.30295,-4.99342 0,-7.22582c-1.30295,-2.2324 -3.70697,-3.59031 -6.29153,-3.55376z\\" />%0A</svg>%0A");background-position:50%;background-repeat:no-repeat;background-size:18px}.discovery-nav .view-nav-button[data-name=inspect]:before{content:"";vertical-align:text-top;aspect-ratio:1;opacity:.85;background-color:currentColor;height:16px;margin:0 -8px;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 30 30\\">%0A <path fill=\\"currentColor\\" d=\\"M 15 2 C 8.3844239 2 3 7.3844287 3 14 C 3 20.615571 8.3844239 26 15 26 L 25 26 C 26.105 26 27 25.105 27 24 L 27 14 C 27 7.3844287 21.615576 2 15 2 z M 15 4 C 20.534697 4 25 8.465307 25 14 C 25 19.534693 20.534697 24 15 24 C 9.4653034 24 5 19.534693 5 14 C 5 8.465307 9.4653034 4 15 4 z M 15.953125 6.9863281 A 1.0001 1.0001 0 0 0 15.013672 7.8359375 L 13.013672 19.835938 A 1.0001 1.0001 0 1 0 14.986328 20.164062 L 16.986328 8.1640625 A 1.0001 1.0001 0 0 0 15.953125 6.9863281 z M 10.980469 9.9882812 A 1.0001 1.0001 0 0 0 10.167969 10.445312 L 8.1679688 13.445312 A 1.0001 1.0001 0 0 0 8.1679688 14.554688 L 10.167969 17.554688 A 1.0001 1.0001 0 1 0 11.832031 16.445312 L 10.201172 14 L 11.832031 11.554688 A 1.0001 1.0001 0 0 0 10.980469 9.9882812 z M 18.988281 9.9882812 A 1.0001 1.0001 0 0 0 18.167969 11.554688 L 19.798828 14 L 18.167969 16.445312 A 1.0001 1.0001 0 1 0 19.832031 17.554688 L 21.832031 14.554688 A 1.0001 1.0001 0 0 0 21.832031 13.445312 L 19.832031 10.445312 A 1.0001 1.0001 0 0 0 18.988281 9.9882812 z\\"/>%0A</svg>%0A") 50%/16px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 30 30\\">%0A <path fill=\\"currentColor\\" d=\\"M 15 2 C 8.3844239 2 3 7.3844287 3 14 C 3 20.615571 8.3844239 26 15 26 L 25 26 C 26.105 26 27 25.105 27 24 L 27 14 C 27 7.3844287 21.615576 2 15 2 z M 15 4 C 20.534697 4 25 8.465307 25 14 C 25 19.534693 20.534697 24 15 24 C 9.4653034 24 5 19.534693 5 14 C 5 8.465307 9.4653034 4 15 4 z M 15.953125 6.9863281 A 1.0001 1.0001 0 0 0 15.013672 7.8359375 L 13.013672 19.835938 A 1.0001 1.0001 0 1 0 14.986328 20.164062 L 16.986328 8.1640625 A 1.0001 1.0001 0 0 0 15.953125 6.9863281 z M 10.980469 9.9882812 A 1.0001 1.0001 0 0 0 10.167969 10.445312 L 8.1679688 13.445312 A 1.0001 1.0001 0 0 0 8.1679688 14.554688 L 10.167969 17.554688 A 1.0001 1.0001 0 1 0 11.832031 16.445312 L 10.201172 14 L 11.832031 11.554688 A 1.0001 1.0001 0 0 0 10.980469 9.9882812 z M 18.988281 9.9882812 A 1.0001 1.0001 0 0 0 18.167969 11.554688 L 19.798828 14 L 18.167969 16.445312 A 1.0001 1.0001 0 1 0 19.832031 17.554688 L 21.832031 14.554688 A 1.0001 1.0001 0 0 0 21.832031 13.445312 L 19.832031 10.445312 A 1.0001 1.0001 0 0 0 18.988281 9.9882812 z\\"/>%0A</svg>%0A") 50%/16px no-repeat}.discovery-nav .view-nav-button[data-name=inspect][data-suspend-seconds]:before{visibility:hidden}.discovery-nav .view-nav-button[data-name=inspect][data-suspend-seconds]:after{content:attr(data-suspend-seconds);text-align:center;width:24px;margin-left:-11px;display:inline-block;position:absolute}.discovery-nav>.view-nav-button[data-name=upload-from-clipboard]:before{content:"";vertical-align:text-top;aspect-ratio:1;opacity:.85;background-color:currentColor;height:15px;margin-left:-3px;margin-right:5px;display:inline-block;-webkit-mask:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABAoAMABAAAAAEAAABAAAAAAFSMbK4AAAIwaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj42NDwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj42NDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KK+qO+QAAATBJREFUeAHtl0kSgzAMBJ1U/v/lLEdceFGQZBl1bmDipdWaglL4QQACEIAABCCQlcDD8OBv5blN9vpU3uR20/1DVbuy2tBEZ0pvwEsbf2c+UWW+87iYhgGdis0OtSqrXUGTdTBgtswKz2kbobClUtIbAAAVjzaexPI9oJXaoXDRAqHKsWAz6Q2wzACvel7KmvQGAMDL06jreGSA9zeAKBNogahqeu0rvQEeGVAXU9Sj9Z9Pri9lTHoDAHCiVKpbKzKgBiztYdUMoQXqcmS7Tm9AhAxQ7WmpwekNAIBUmbs9HyEDRu8BphlBC9xNael50hsQIQNMe3xkBAaMCE2M1ym+tKIT+z08ggEHHD4XtTE+qzZWwYAGmN7trXq8d5DfWHoDRoAYhwAEIAABCEDgvgQ+7DUMfq3x1WcAAAAASUVORK5CYII=) 50%/17px no-repeat;mask:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABAoAMABAAAAAEAAABAAAAAAFSMbK4AAAIwaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj42NDwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj42NDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KK+qO+QAAATBJREFUeAHtl0kSgzAMBJ1U/v/lLEdceFGQZBl1bmDipdWaglL4QQACEIAABCCQlcDD8OBv5blN9vpU3uR20/1DVbuy2tBEZ0pvwEsbf2c+UWW+87iYhgGdis0OtSqrXUGTdTBgtswKz2kbobClUtIbAAAVjzaexPI9oJXaoXDRAqHKsWAz6Q2wzACvel7KmvQGAMDL06jreGSA9zeAKBNogahqeu0rvQEeGVAXU9Sj9Z9Pri9lTHoDAHCiVKpbKzKgBiztYdUMoQXqcmS7Tm9AhAxQ7WmpwekNAIBUmbs9HyEDRu8BphlBC9xNael50hsQIQNMe3xkBAaMCE2M1ym+tKIT+z08ggEHHD4XtTE+qzZWwYAGmN7trXq8d5DfWHoDRoAYhwAEIAABCEDgvgQ+7DUMfq3x1WcAAAAASUVORK5CYII=) 50%/17px no-repeat}.discovery-nav>.view-nav-button[data-name=upload-from-clipboard]:empty:before{margin-left:-7px;margin-right:-7px}.discovery-nav>.view-nav-button[data-name=github]:before{content:"";vertical-align:text-top;aspect-ratio:1;opacity:.85;background-color:currentColor;height:15px;margin-left:-3px;margin-right:5px;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 98 96\\">%0A <path d=\\"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z\\"/>%0A</svg>%0A") 50%/15px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 98 96\\">%0A <path d=\\"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z\\"/>%0A</svg>%0A") 50%/15px no-repeat}.discovery-nav>.view-nav-button[data-name=github]:empty:before{margin-left:-7px;margin-right:-7px}.discovery-nav-popup>.toggle-menu-item{padding:4px 4px 4px 12px}.discovery-nav-popup>.toggle-menu-item .view-toggle-group{align-items:center;display:flex}.discovery-nav-popup>.toggle-menu-item .view-toggle-group-before{flex:1}.discovery-nav-popup>.toggle-menu-item .view-toggle{padding-top:2px;padding-bottom:2px;font-size:11px}.discovery-nav-popup .powered-by-discoveryjs{opacity:.75;text-align:right;background-color:#8882;padding:2px 6px 4px;font-size:11px}.discovery>.loading-overlay{z-index:1000;background:var(--discovery-background-color);will-change:opacity,visibility;padding:35px 40px;position:absolute;inset:0}.discovery>.loading-overlay.error{flex-direction:column;gap:16px;display:flex;overflow:auto}.discovery>.loading-overlay>.view-app-header{will-change:opacity;contain:paint;transition:opacity .25s .5s}@starting-style{.discovery>.loading-overlay>.view-app-header{opacity:0}}.discovery>.loading-overlay.error>.view-app-header{transition:none!important}.discovery>.loading-overlay.done>.view-app-header{visibility:hidden}.discovery>.loading-overlay.error>.view-app-header:first-child{margin-top:-10px;margin-bottom:27px}.discovery>.loading-overlay.error>.action-buttons .view-button+.view-button{margin-left:2ex}.discovery>.loading-overlay.error>.error-message,.discovery>.loading-overlay.error>.warning-message{box-sizing:border-box;color:#d85a5a;background:#ff00002e;min-height:6.2em;padding:20px;overflow:auto}.discovery>.loading-overlay.error>.warning-message{color:#856404;background-color:#fff3d1}.discovery-root-darkmode>.loading-overlay.error>.error-message{color:#dc7c7c;background-color:#3f3333}.discovery-root-darkmode>.loading-overlay.error>.warning-message{color:#bdab77;background-color:#3c3627}.discovery>.loading-overlay.error>:is(.error-message,.warning-message) a{color:color-mix(in srgb,currentColor,var(--discovery-color) 35%);-webkit-text-decoration-color:color-mix(in srgb,currentColor,var(--discovery-background-color) 65%);text-decoration-color:color-mix(in srgb,currentColor,var(--discovery-background-color) 65%)}.discovery-root-darkmode>.loading-overlay.error>:is(.error-message,.warning-message) a{color:color-mix(in srgb,currentColor,var(--discovery-color) 45%);-webkit-text-decoration-color:color-mix(in srgb,currentColor,var(--discovery-background-color) 45%);text-decoration-color:color-mix(in srgb,currentColor,var(--discovery-background-color) 45%)}.discovery>.loading-overlay.error>:is(.error-message,.warning-message) a:hover{text-decoration-color:currentColor}.discovery>.loading-overlay.error>:is(.error-message,.warning-message) .error-type-badge{margin:-20px 0 15px -20px}.discovery>.loading-overlay.error>:is(.error-message,.warning-message) .error-type-badge:before{content:"Error" attr(data-stage);color:#992d2d;text-shadow:none;text-transform:uppercase;background-color:#ff9d9d;padding:1ex 20px;font-size:11px;display:inline-block}.discovery-root-darkmode>.loading-overlay.error>:is(.error-message,.warning-message) .error-type-badge:before{color:var(--discovery-color);background-color:#833939}.discovery>.loading-overlay.error>.warning-message .error-type-badge:before{color:inherit;background-color:#f9de91}.discovery-root-darkmode>.loading-overlay.error>.warning-message .error-type-badge:before{background-color:#5d502d}.discovery>.loading-overlay.done{opacity:0;visibility:hidden;pointer-events:none;transition:all .25s}.discovery>.loading-overlay .view-progress{max-width:none}.discovery>.loading-overlay .view-progress .progress{max-width:300px}.discovery-buildin-view-render-error{vertical-align:top;color:#c66;background-image:linear-gradient(#ff19191a 19px,#0000 0);background-clip:padding-box;border:1px solid #d4000066;border-radius:4px;margin:1px;padding:4px;font-size:10px;line-height:1;display:inline-block}.discovery-buildin-view-render-error:before{content:"ERROR";color:#ffffffd9;text-shadow:1px 1px #0003;background:#e2242466;border-radius:3px 0 0 3px;margin:-4px 1ex -4px -4px;padding:4px;display:inline-block}.discovery-buildin-view-render-error[data-type=config]:before{content:"CONFIG ERROR"}.discovery-buildin-view-render-error[data-type=render]:before{content:"RENDER ERROR"}.discovery-buildin-view-render-error.expanded:before{border-bottom-left-radius:0}.discovery-buildin-view-render-error .toggle-config{cursor:pointer;opacity:.65;color:#888;-webkit-user-select:none;user-select:none;margin-left:1ex}.discovery-buildin-view-render-error .toggle-config:hover{opacity:1}.discovery-buildin-view-render-error .view-struct{border-radius:0 0 3px 3px;margin:5px -4px -4px}.discovery-buildin-view-tooltip{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#ffffffbf;border:.5px solid #fff5;border-radius:3px;min-width:120px;padding:5px 10px;font-size:12px}.discovery-root-darkmode .discovery-buildin-view-tooltip{background:#242424cc}`,k6=`di-expand:`,A6=`di-edit:`;function j6(e){return A6+encodeURIComponent(JSON.stringify(e))}function M6(e){if(!e.startsWith(A6))return null;try{return JSON.parse(decodeURIComponent(e.slice(8)))}catch{return null}}function N6(e){return k6+encodeURIComponent(JSON.stringify(e))}function P6(e){if(!e.startsWith(k6))return null;try{return JSON.parse(decodeURIComponent(e.slice(10)))}catch{return null}}var F6=[],I6=new WeakMap,L6=new WeakMap,R6=new WeakMap,z6=new WeakMap,B6={function:`di-type-function`,Map:`di-type-map`,Set:`di-type-set`,Date:`di-type-date`,RegExp:`di-type-date`,URL:`di-type-date`,bigint:`di-type-other`,symbol:`di-type-other`,Error:`di-type-ref`,"getter-error":`di-type-ref`,Promise:`di-type-other`};function V6(e,t){return{text:t??e,className:`di-type-badge ${B6[e]??`di-type-other`}`}}function H6(e){return!!e&&typeof e==`object`&&(`$ref`in e||`$truncated`in e)}function U6(e,t,n,r,i){return e&&typeof e==`object`?(R6.set(e,t),!1):(i[r]=t,!0)}function W6(e,t,n=`i`){if(!e||typeof e!=`object`)return{value:e};if(Array.isArray(e))return K6(e,t,n);let r=e;return r.$truncated===`depth`&&Array.isArray(r.$path)?q6(r):typeof r.$type==`string`?J6(r,r.$type,t):X6(r,t)}function G6(e,t,n){return t.badge?t.value&&typeof t.value==`object`?(I6.set(t.value,t.badge),!1):(n[e]=t.badge,!0):!1}function K6(e,t,n){let r=Array.from({length:e.length}),i={},a={},o=!1,s=!1;return e.forEach((e,c)=>{let l=t&&!H6(e)?[...t,[n,c]]:null,u=W6(e,l);r[c]=u.value,l&&U6(u.value,l,r,c,a)&&(s=!0),G6(c,u,i)&&(o=!0)}),o&&L6.set(r,i),s&&z6.set(r,a),{value:r}}function q6(e){return{value:typeof e.$preview==`string`?e.$preview:`load deeper`,badge:{text:`load deeper`,className:`di-type-badge di-type-lazy`,href:N6([...F6,...e.$path])}}}function J6(e,t,n){switch(t){case`function`:{let t=typeof e.name==`string`&&e.name!==`(anonymous)`?e.name:``;return{value:t?`<function ${t}>`:`<function>`,badge:V6(`function`,`Function`)}}case`Map`:return{value:(e.value===void 0?W6(e.entries??{},null):W6(e.value,n)).value,badge:V6(`Map`,`Map(${e.size??`?`})`)};case`Set`:return{value:W6(e.values??[],n,`s`).value,badge:V6(`Set`,`Set(${e.size??`?`})`)};case`Date`:case`RegExp`:case`URL`:case`bigint`:case`symbol`:return{value:e.value,badge:V6(t,t===`bigint`?`BigInt`:t===`symbol`?`Symbol`:t)};case`Error`:{let t={...e};return delete t.$type,{value:t,badge:V6(`Error`)}}case`getter-error`:return{value:String(e.message??``),badge:V6(`getter-error`,`getter threw`)};default:return{value:`<${t}>`,badge:V6(t,typeof e.length==`number`?`${t}(${e.length})`:t)}}}function Y6(e,t,n){return e&&t!==`$truncated`&&!H6(n)?[...e,[`k`,t]]:null}function X6(e,t){let n={},r={},i={},a=!1,o=!1,s,c=t&&!H6(e)?t:null;for(let[t,l]of Object.entries(e)){if(t===`$class`&&typeof l==`string`){s={text:`class ${l}`,className:`di-type-badge di-type-class`};continue}let e=Y6(c,t,l),u=W6(l,e);n[t]=u.value,e&&U6(u.value,e,n,t,i)&&(o=!0),G6(t,u,r)&&(a=!0)}return a&&L6.set(n,r),o&&z6.set(n,i),{value:n,badge:s}}function Z6(e,t){let n=e;for(let[e,r]of t){if(!n||typeof n!=`object`)return;let t=n;switch(e){case`k`:n=t.$type===`Map`?t.value?.[r]:t[r];break;case`i`:n=Array.isArray(n)?n[r]:void 0;break;case`s`:n=t.$type===`Set`?t.values?.[r]:void 0;break;case`mk`:n=t.entries?.[r]?.key;break;case`mv`:n=t.entries?.[r]?.value}}return n}function Q6(e){return e.length?`$${e.map(([e,t])=>{switch(e){case`k`:return/^[a-z_$][\w$]*$/i.test(String(t))?`.${t}`:`["${t}"]`;case`i`:return`[${t}]`;case`s`:return`~set[${t}]`;case`mk`:return`~keys[${t}]`;case`mv`:return`~values[${t}]`;default:return``}}).join(``)}`:`$`}function $6(e,t=[],n=!1){F6=t;try{let r=W6(e,n&&!H6(e)?t:null);return r.badge&&r.value&&typeof r.value==`object`&&I6.set(r.value,r.badge),n&&r.value&&typeof r.value==`object`&&!H6(e)&&R6.set(r.value,t),r.value}finally{F6=[]}}var e8=`
|
|
893
|
+
:host, .discovery-root {
|
|
894
|
+
--discovery-background-color: var(--di-result-bg);
|
|
895
|
+
--discovery-color: var(--di-result-fg);
|
|
896
|
+
--discovery-page-padding-top: 0;
|
|
897
|
+
--discovery-page-padding-right: 0;
|
|
898
|
+
--discovery-page-padding-bottom: 0;
|
|
899
|
+
--discovery-page-padding-left: 0;
|
|
900
|
+
font-family: var(--font-mono, ui-monospace, monospace);
|
|
901
|
+
}
|
|
902
|
+
.view-struct .di-type-badge {
|
|
903
|
+
font-size: 10px;
|
|
904
|
+
line-height: 1.4;
|
|
905
|
+
padding: 0 5px;
|
|
906
|
+
border-radius: 999px !important;
|
|
907
|
+
border: 1px solid transparent;
|
|
908
|
+
background: color-mix(in srgb, var(--di-badge-color, #888) 14%, transparent) !important;
|
|
909
|
+
border-color: color-mix(in srgb, var(--di-badge-color, #888) 32%, transparent) !important;
|
|
910
|
+
color: var(--di-badge-color, #888) !important;
|
|
911
|
+
}
|
|
912
|
+
.di-type-function { --di-badge-color: #8a63d2; }
|
|
913
|
+
.di-type-class { --di-badge-color: #c98a1f; }
|
|
914
|
+
.di-type-map { --di-badge-color: #2f7fd0; }
|
|
915
|
+
.di-type-set { --di-badge-color: #0f9b8e; }
|
|
916
|
+
.di-type-date { --di-badge-color: #3f9c50; }
|
|
917
|
+
.di-type-ref { --di-badge-color: #c25577; }
|
|
918
|
+
.di-type-other { --di-badge-color: #7a8699; }
|
|
919
|
+
.di-type-lazy { --di-badge-color: #8a63d2; cursor: pointer; text-decoration: none; }
|
|
920
|
+
.di-type-lazy::before { content: '▸ '; }
|
|
921
|
+
.di-type-lazy:hover {
|
|
922
|
+
background: color-mix(in srgb, var(--di-badge-color) 26%, transparent) !important;
|
|
923
|
+
}
|
|
924
|
+
.di-type-lazy.di-lazy-loading { cursor: progress; opacity: 0.6; }
|
|
925
|
+
.di-type-lazy.di-lazy-error { --di-badge-color: #c25577; }
|
|
926
|
+
|
|
927
|
+
/* Edit affordance on writable-source nodes: quiet until hovered. */
|
|
928
|
+
.view-struct .di-type-edit {
|
|
929
|
+
--di-badge-color: #5f9e6e;
|
|
930
|
+
cursor: pointer;
|
|
931
|
+
text-decoration: none;
|
|
932
|
+
opacity: 0.3;
|
|
933
|
+
}
|
|
934
|
+
.view-struct .di-type-edit:hover {
|
|
935
|
+
opacity: 1;
|
|
936
|
+
background: color-mix(in srgb, var(--di-badge-color) 26%, transparent) !important;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/* Lazily fetched subtree, spliced in below its truncation marker. */
|
|
940
|
+
.di-lazy-children {
|
|
941
|
+
display: block;
|
|
942
|
+
margin: 2px 0 2px 1ch;
|
|
943
|
+
padding-left: 1ch;
|
|
944
|
+
border-left: 1px dashed color-mix(in srgb, var(--di-result-fg, #888) 25%, transparent);
|
|
945
|
+
}
|
|
946
|
+
.di-lazy-children-error {
|
|
947
|
+
display: block;
|
|
948
|
+
margin: 2px 0 2px 1ch;
|
|
949
|
+
color: #c25577;
|
|
950
|
+
font-size: 11px;
|
|
951
|
+
}
|
|
952
|
+
`;function t8(e){return e.closest(`.value-annotations`)??e.parentElement??e}function n8(e,t){if(e&&typeof e==`object`){if(typeof e.$ref==`string`)return{place:`after`,style:`badge`,text:`#Circular`,className:`di-type-badge di-type-ref`};let t=I6.get(e);return t?{place:`after`,style:`badge`,...t}:void 0}let n=t?.host;if(n&&typeof n==`object`&&t?.key!==void 0){let e=L6.get(n)?.[t.key];if(e)return{place:`after`,style:`badge`,...e}}}function r8(e,t,n={view:`struct`,expanded:2},r={},i,a){let o=un(null),s=null;function c(e,t){if(!a?.enabled())return;let n;if(e&&typeof e==`object`)n=R6.get(e);else{let e=t?.host;e&&typeof e==`object`&&t?.key!==void 0&&(n=z6.get(e)?.[t.key])}if(n)return{place:`after`,style:`badge`,text:`✎`,className:`di-type-badge di-type-edit`,href:j6(n),tooltip:{content:`text:"Edit this value"`}}}let l={annotations:[n8,c],...n};function u(e,t,n){e.addEventListener(`click`,e=>{let r=e.composedPath().find(e=>e instanceof HTMLElement&&e.matches(`a.di-type-lazy`));if(!r||(e.preventDefault(),e.stopPropagation(),r.classList.contains(`di-lazy-loading`)||r.dataset.diExpanded===`1`))return;let i=P6(r.getAttribute(`href`)??``);i&&(r.classList.add(`di-lazy-loading`),n(i).then(e=>{r.classList.remove(`di-lazy-loading`),r.dataset.diExpanded=`1`,r.classList.add(`di-lazy-done`);let n=document.createElement(`div`);n.className=`di-lazy-children`,t8(r).after(n),t.view.render(n,l,$6(e,i,a?.enabled()??!1))}).catch(e=>{r.classList.remove(`di-lazy-loading`),r.classList.add(`di-lazy-error`);let t=document.createElement(`div`);t.className=`di-lazy-children-error`,t.textContent=e instanceof Error?e.message:String(e),t8(r).after(t)}))})}function d(e,t){e.addEventListener(`click`,e=>{let n=e.composedPath().find(e=>e instanceof HTMLElement&&e.matches(`a.di-type-edit`));if(!n)return;e.preventDefault(),e.stopPropagation();let r=M6(n.getAttribute(`href`)??``);r&&t(r)})}Zi(async()=>{if(!e.value)return;let n=new b6({container:e.value,styles:[O6,e8],colorScheme:t.value,colorSchemePersistent:!1});n.page.define(`default`,l),i&&u(e.value,n,i.onExpand),a&&d(e.value,a.onEdit),(r.onQuerySubquery||r.onQueryAppend)&&(n.action.define(`queryAcceptChanges`,()=>!0),r.onQuerySubquery&&n.action.define(`querySubquery`,e=>r.onQuerySubquery?.(String(e))),r.onQueryAppend&&n.action.define(`queryAppend`,e=>r.onQueryAppend?.(String(e)))),await n.dom.ready,o.value=n,s&&=(await n.setData(s.data,{render:!0}),null)}),ta(()=>{o.value=null}),Er(t,e=>{o.value?.colorScheme.set(e)});let f;async function p(e){if(f=e,!o.value){s={data:e};return}await o.value.setData(e,{render:!0})}async function m(e){l.expanded=e,!(!o.value||f===void 0)&&(o.value.page.define(`default`,l),await o.value.setData(f,{render:!0}))}return{setData:p,setExpanded:m}}var i8={class:`flex flex-col h-full min-h-0 bg-base border-l border-base w-100`},a8={class:`flex items-center gap-2 px3 py2 border-b border-base select-none`},o8=[`title`],s8={class:`flex-1 min-h-0 overflow-auto px3 py2 flex flex-col gap-4 text-sm`},c8={key:0,class:`px-2.5 py-1.5 font-mono text-11px whitespace-pre-wrap rounded-lg border border-red-600/40 bg-red-500:8 color-red-700 dark:border-red-400/40 dark:color-red-300`},l8={key:1,class:`flex flex-col gap-2`},u8={class:`flex flex-wrap gap-1 p-0.5 bg-secondary rounded-lg self-start`,role:`tablist`},d8=[`onClick`],f8=[`placeholder`],p8={key:2,class:`flex items-center gap-2 text-xs cursor-pointer select-none`},m8={class:`font-mono`},h8={key:3,class:`text-xs color-faint font-mono select-none`},g8={key:2,class:`flex flex-col gap-2`},_8={class:`flex gap-2`},v8={key:3,class:`flex flex-col gap-2`},y8={class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},b8=[`placeholder`],x8={class:`flex flex-wrap gap-1 p-0.5 bg-secondary rounded-lg self-start`,role:`tablist`},S8=[`onClick`],C8={key:3,class:`flex items-center gap-2 text-xs cursor-pointer select-none`},w8={class:`font-mono`},T8={key:4,class:`text-xs color-faint font-mono select-none`},E8={key:4,class:`flex flex-col gap-2`},D8=W({__name:`EditPanel`,props:{path:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=jM(),a=[`string`,`number`,`boolean`,`null`,`undefined`,`json`],o=Q(()=>Z6(i.result.value,n.path)),s=Q(()=>Q6(n.path)),c=Q(()=>{let e=o.value;if(Array.isArray(e))return`array`;if(!e||typeof e!=`object`)return null;let t=e;return t.$type===`Map`?`map`:t.$type===`Set`?`set`:typeof t.$type==`string`||typeof t.$ref==`string`||t.$truncated!==void 0?null:`object`}),l=Q(()=>n.path[n.path.length-1]),u=Q(()=>l.value?.[0]===`k`),d=Q(()=>n.path.length>0),f=Q(()=>n.path.length>0),p=V(`string`),m=V(``),h=V(!0);function g(){let e=o.value;if(typeof e==`string`)p.value=`string`,m.value=e;else if(typeof e==`number`)p.value=`number`,m.value=String(e);else if(typeof e==`boolean`)p.value=`boolean`,h.value=e;else if(e===null)p.value=`null`,m.value=``;else if(e&&typeof e==`object`&&typeof e.$type==`string`&&typeof e.value==`string`)p.value=`string`,m.value=e.value;else{p.value=`json`;try{m.value=JSON.stringify(e,null,2)??``}catch{m.value=``}}}Er(()=>n.path,g,{immediate:!0});let _=un(null),v=un(!1);function y(e,t,n){switch(e){case`string`:return{kind:`json`,value:t};case`number`:{let e=Number(t);if(t.trim()===``||Number.isNaN(e))throw Error(`"${t}" is not a number`);return{kind:`json`,value:e}}case`boolean`:return{kind:`json`,value:n};case`null`:return{kind:`json`,value:null};case`undefined`:return{kind:`undefined`};case`json`:try{return{kind:`json`,value:JSON.parse(t)}}catch(e){throw Error(`invalid JSON: ${e instanceof Error?e.message:String(e)}`)}}}async function b(e,t){v.value=!0,_.value=null;let n=await i.applyEdit(e);if(v.value=!1,!n.ok){_.value=`${n.error.name}: ${n.error.message}`;return}t?.()}function x(){let e;try{e=y(p.value,m.value,h.value)}catch(e){_.value=e instanceof Error?e.message:String(e);return}b({op:`set`,path:n.path,value:e},()=>r(`close`))}let S=V(``);Er(l,e=>{S.value=e?.[0]===`k`?String(e[1]):``},{immediate:!0});function C(){S.value&&b({op:`rename`,path:n.path,key:{kind:`json`,value:S.value}},()=>r(`close`))}let w=V(``),T=V(`string`),E=V(``),D=V(!0),O=Q(()=>c.value===`array`?`Index (blank appends)`:c.value===`map`?`Key (JSON or plain string)`:`Key`);function k(){let e=w.value;if(c.value!==`set`){if(c.value===`array`){if(e.trim()===``)return;let t=Number(e);if(!Number.isInteger(t))throw Error(`an array index must be an integer`);return{kind:`json`,value:t}}if(c.value===`map`)try{return{kind:`json`,value:JSON.parse(e)}}catch{return{kind:`json`,value:e}}if(!e)throw Error(`a property key is required`);return{kind:`json`,value:e}}}function A(){let e,t;try{e=k(),t=y(T.value,E.value,D.value)}catch(e){_.value=e instanceof Error?e.message:String(e);return}b({op:`add`,path:n.path,key:e,value:t},()=>{w.value=``,E.value=``})}let ee=un(!1);function j(){if(!ee.value){ee.value=!0;return}ee.value=!1,b({op:`delete`,path:n.path},()=>r(`close`))}return(e,t)=>(K(),q(`div`,i8,[Y(`div`,a8,[t[10]||=Y(`span`,{class:`i-ph:pencil-simple-duotone color-active`},null,-1),t[11]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide`},` Edit `,-1),Y(`code`,{class:`font-mono text-xs color-muted truncate`,title:s.value},ke(s.value),9,o8),t[12]||=Y(`div`,{class:`flex-auto`},null,-1),X(vm,{class:`text-sm`,icon:`i-ph:x`,label:`Close`,tooltip:`Close the edit panel`,onClick:t[0]||=e=>r(`close`)})]),Y(`div`,s8,[_.value?(K(),q(`div`,c8,ke(_.value),1)):Z(``,!0),d.value?(K(),q(`section`,l8,[t[14]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Set value `,-1),Y(`div`,u8,[(K(),q(ss,null,ma(a,e=>Y(`button`,{key:e,type:`button`,class:ye([`px-2 py-0.5 rounded-md text-xs cursor-pointer`,p.value===e?`bg-base color-base shadow-sm`:`color-muted hover:color-base`]),onClick:t=>p.value=e},ke(e),11,d8)),64))]),p.value===`string`||p.value===`number`?gr((K(),q(`input`,{key:0,"onUpdate:modelValue":t[1]||=e=>m.value=e,placeholder:p.value===`number`?`42`:`text`,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full`,onKeydown:lu(x,[`enter`])},null,40,f8)),[[Kl,m.value]]):p.value===`json`?gr((K(),q(`textarea`,{key:1,"onUpdate:modelValue":t[2]||=e=>m.value=e,rows:`6`,placeholder:`{ }`,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full resize-y`},null,512)),[[Kl,m.value]]):p.value===`boolean`?(K(),q(`label`,p8,[gr(Y(`input`,{"onUpdate:modelValue":t[3]||=e=>h.value=e,type:`checkbox`},null,512),[[ql,h.value]]),Y(`code`,m8,ke(h.value),1)])):(K(),q(`div`,h8,ke(p.value),1)),X(nz,{class:`text-sm self-start`,icon:`i-ph:check`,disabled:v.value,loading:v.value,title:`Apply the new value`,onClick:x},{default:U(()=>[...t[13]||=[Y(`span`,null,`Apply`,-1)]]),_:1},8,[`disabled`,`loading`])])):Z(``,!0),u.value?(K(),q(`section`,g8,[t[16]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Rename key `,-1),Y(`div`,_8,[gr(Y(`input`,{"onUpdate:modelValue":t[4]||=e=>S.value=e,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base flex-1 min-w-0`,onKeydown:lu(C,[`enter`])},null,544),[[Kl,S.value]]),X(nz,{class:`text-sm`,icon:`i-ph:textbox-duotone`,disabled:v.value||!S.value,title:`Rename the key (the renamed key lands last)`,onClick:C},{default:U(()=>[...t[15]||=[Y(`span`,null,`Rename`,-1)]]),_:1},8,[`disabled`])])])):Z(``,!0),c.value?(K(),q(`section`,v8,[Y(`div`,y8,` Add to `+ke(c.value),1),c.value===`set`?Z(``,!0):gr((K(),q(`input`,{key:0,"onUpdate:modelValue":t[5]||=e=>w.value=e,placeholder:O.value,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full`},null,8,b8)),[[Kl,w.value]]),Y(`div`,x8,[(K(),q(ss,null,ma(a,e=>Y(`button`,{key:e,type:`button`,class:ye([`px-2 py-0.5 rounded-md text-xs cursor-pointer`,T.value===e?`bg-base color-base shadow-sm`:`color-muted hover:color-base`]),onClick:t=>T.value=e},ke(e),11,S8)),64))]),T.value===`string`||T.value===`number`?gr((K(),q(`input`,{key:1,"onUpdate:modelValue":t[6]||=e=>E.value=e,placeholder:`value`,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full`,onKeydown:lu(A,[`enter`])},null,544)),[[Kl,E.value]]):T.value===`json`?gr((K(),q(`textarea`,{key:2,"onUpdate:modelValue":t[7]||=e=>E.value=e,rows:`4`,placeholder:`{ }`,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full resize-y`},null,512)),[[Kl,E.value]]):T.value===`boolean`?(K(),q(`label`,C8,[gr(Y(`input`,{"onUpdate:modelValue":t[8]||=e=>D.value=e,type:`checkbox`},null,512),[[ql,D.value]]),Y(`code`,w8,ke(D.value),1)])):(K(),q(`div`,T8,ke(T.value),1)),X(nz,{class:`text-sm self-start`,icon:`i-ph:plus`,disabled:v.value,title:`Add the entry`,onClick:A},{default:U(()=>[...t[17]||=[Y(`span`,null,`Add`,-1)]]),_:1},8,[`disabled`])])):Z(``,!0),f.value?(K(),q(`section`,E8,[t[18]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Danger `,-1),X(nz,{class:`text-sm self-start`,icon:`i-ph:trash-duotone`,disabled:v.value,title:ee.value?`Click again to delete this node`:`Delete this node from its container`,onClick:j,onBlur:t[9]||=e=>ee.value=!1},{default:U(()=>[Y(`span`,null,ke(ee.value?`Confirm Delete?`:`Delete Key`),1)]),_:1},8,[`disabled`,`title`])])):Z(``,!0)])]))}}),O8={class:`flex flex-col h-full min-h-0`},k8={class:`flex items-center gap-1`},A8={class:`flex items-center gap-1`},j8={class:`flex items-center gap-1`},M8={class:`flex items-center gap-1`},N8={class:`flex items-center gap-1`},P8={key:1,class:`op-fade select-none`},F8={key:2,class:`flex items-center gap-1.5 color-faint`},I8=[`title`],L8={key:0,class:`mx-3 mt-2 px-3 py-2 font-mono text-xs whitespace-pre-wrap rounded-lg border border-red-600/40 bg-red-500:8 color-red-700 dark:border-red-400/40 dark:color-red-300`},R8={class:`flex-1 min-h-0 flex`},z8={key:1,class:`flex-1 grid place-items-center select-none`},B8=100,V8=W({__name:`ResultViewer`,props:{result:{},hasResult:{type:Boolean},stats:{},statsStale:{type:Boolean},error:{},running:{type:Boolean},lastRunAt:{},canEdit:{type:Boolean},editHint:{},expand:{type:Function}},emits:[`rerun`,`querySubquery`,`queryAppend`],setup(e,{emit:t}){let n=e,r=t,i=un(null),a=un(null),o=r8(a,OT,{view:`struct`,expanded:2},{onQuerySubquery:e=>r(`querySubquery`,e),onQueryAppend:e=>r(`queryAppend`,e)},{onExpand:e=>n.expand(e)},{enabled:()=>n.canEdit??!1,onEdit:e=>i.value=e});Er(()=>[n.result,n.canEdit],([e])=>{n.hasResult&&o.setData($6(e,[],n.canEdit??!1))}),Er(()=>n.canEdit,e=>{e||(i.value=null)});let s=Q(()=>n.editHint===`readonly-source`?`Read-only source: register it with writable: true to edit values`:n.editHint===`derived-view`?`Editing applies on the root view: clear the query (or run $) to edit`:``),c=un(!1),l;function u(){try{navigator.clipboard.writeText(JSON.stringify(n.result,null,2)),c.value=!0,clearTimeout(l),l=setTimeout(()=>c.value=!1,1200)}catch{}}return(t,n)=>(K(),q(`div`,O8,[Y(`div`,{class:ye([`flex items-center gap-3 px-3 py-1.5 border-b border-base min-h-9 text-xs ws-nowrap color-muted font-mono tabular-nums flex-wrap`,{"op-fade":e.statsStale}])},[e.stats?(K(),q(ss,{key:0},[Y(`span`,k8,[n[4]||=Y(`span`,{class:`op50`},`jora`,-1),n[5]||=Ts(),X(IB,{ms:e.stats.queryMs,colorize:``},null,8,[`ms`])]),n[14]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,A8,[n[6]||=Y(`span`,{class:`op50`},`norm`,-1),n[7]||=Ts(),X(IB,{ms:e.stats.normalize.ms,colorize:``},null,8,[`ms`])]),n[15]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,j8,[n[8]||=Y(`span`,{class:`op50`},`rpc`,-1),n[9]||=Ts(),X(IB,{ms:e.stats.rpcMs,colorize:``},null,8,[`ms`])]),n[16]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,M8,[X(MB,{bytes:e.stats.payloadBytes,colorize:``},null,8,[`bytes`])]),n[17]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,null,[Ts(ke(e.stats.normalize.nodes)+` `,1),n[10]||=Y(`span`,{class:`op50`},`nodes`,-1)]),e.stats.normalize.refs?(K(),q(ss,{key:0},[n[12]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,null,[Ts(ke(e.stats.normalize.refs)+` `,1),n[11]||=Y(`span`,{class:`op50`},`refs`,-1)])],64)):Z(``,!0),e.stats.normalize.truncatedEntries||e.stats.normalize.truncatedDepth?(K(),J($y,{key:1,color:12,text:`truncated`})):Z(``,!0),e.lastRunAt?(K(),q(ss,{key:2},[n[13]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,N8,[X(PB,{date:e.lastRunAt,live:``},null,8,[`date`])])],64)):Z(``,!0)],64)):(K(),q(`span`,P8,`no query run yet`)),n[19]||=Y(`div`,{class:`flex-auto`},null,-1),e.running?(K(),q(`span`,F8,[...n[18]||=[Y(`span`,{class:`i-ph:circle-notch animate-spin`},null,-1),Ts(` running `,-1)]])):Z(``,!0),e.editHint?(K(),q(`span`,{key:3,class:`flex items-center color-faint`,title:s.value},[Y(`span`,{class:ye(e.editHint===`readonly-source`?`i-ph:lock-simple-duotone`:`i-ph:pencil-simple-slash-duotone`)},null,2)],8,I8)):Z(``,!0),e.hasResult?(K(),J(vm,{key:4,class:`text-sm`,icon:`i-ph:arrows-out-line-vertical`,label:`Expand all`,tooltip:`Expand all levels`,onClick:n[0]||=e=>H(o).setExpanded(B8)})):Z(``,!0),e.hasResult?(K(),J(vm,{key:5,class:`text-sm`,icon:`i-ph:arrows-in-line-vertical`,label:`Collapse all`,tooltip:`Collapse to the top level`,onClick:n[1]||=e=>H(o).setExpanded(1)})):Z(``,!0),e.hasResult?(K(),J(vm,{key:6,class:`text-sm`,icon:c.value?`i-ph:check`:`i-ph:copy-duotone`,label:`Copy result as JSON`,tooltip:`Copy the result as JSON`,onClick:u},null,8,[`icon`])):Z(``,!0),X(vm,{class:`text-sm`,icon:e.running?`i-ph:arrows-clockwise animate-spin`:`i-ph:arrows-clockwise`,label:`Re-run query`,tooltip:`Re-run against the live object`,disabled:e.running,onClick:n[2]||=e=>r(`rerun`)},null,8,[`icon`,`disabled`])],2),e.error?(K(),q(`div`,L8,ke(e.error),1)):Z(``,!0),gr(Y(`div`,R8,[Y(`div`,{ref_key:`containerEl`,ref:a,class:`di-result-host flex-1 min-w-0 min-h-0 overflow-auto`},null,512),i.value&&e.canEdit?(K(),J(D8,{key:0,path:i.value,onClose:n[3]||=e=>i.value=null},null,8,[`path`])):Z(``,!0)],512),[[Uc,e.hasResult]]),e.hasResult?Z(``,!0):(K(),q(`div`,z8,[...n[20]||=[Y(`div`,{class:`flex flex-col items-center gap-2 color-faint`},[Y(`span`,{class:`i-ph:tree-structure-duotone text-3xl`}),Y(`span`,{class:`text-sm`},`Results render here, start typing a query`)],-1)]]))]))}}),H8={key:1},U8=W({__name:`ActionToggleGroup`,props:Fa({options:{},multiple:{type:Boolean,default:!1},iconOnly:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=ro(e,`modelValue`);return(n,r)=>(K(),J(H(RR),{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,type:e.multiple?`multiple`:`single`,class:`p-1 rounded-lg bg-sunken inline-flex gap-1 w-max`},{default:U(()=>[(K(!0),q(ss,null,ma(e.options,t=>(K(),J(H(BR),{key:t.value,value:t.value,disabled:t.disabled,"aria-label":t.label??t.value,class:ye([`text-sm color-muted outline-none rounded-md flex gap-1.5 transition items-center data-[state=on]:color-base hover:color-base data-[state=on]:bg-raised disabled:op50 focus-visible:ring-2 focus-visible:ring-primary-500/40 data-[state=on]:shadow-sm`,e.iconOnly?`p-1.5`:`px-3 py-1`])},{default:U(()=>[t.icon?(K(),q(`span`,{key:0,class:ye(t.icon),"aria-hidden":`true`},null,2)):Z(``,!0),e.iconOnly?Z(``,!0):(K(),q(`span`,H8,ke(t.label??t.value),1))]),_:2},1032,[`value`,`disabled`,`aria-label`,`class`]))),128))]),_:1},8,[`modelValue`,`type`]))}}),W8=[`type`,`placeholder`,`disabled`,`aria-invalid`],G8=W({__name:`FormTextInput`,props:Fa({icon:{},clearable:{type:Boolean},placeholder:{},type:{default:`text`},size:{default:`md`},disabled:{type:Boolean},invalid:{type:Boolean}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=ro(e,`modelValue`);return(n,r)=>(K(),q(`label`,{class:ye([`px-2 border rounded bg-raised inline-flex gap-2 transition items-center focus-within:ring-2`,[e.size===`sm`?`h-7 text-sm`:`h-9`,e.invalid?`border-red-500/60 focus-within:ring-red-500/40`:`border-base focus-within:ring-primary-500/40`,{"op50 pointer-events-none":e.disabled}]])},[e.icon?(K(),q(`span`,{key:0,class:ye([e.icon,`op-fade shrink-0`]),"aria-hidden":`true`},null,2)):Z(``,!0),G(n.$slots,`prefix`),gr(Y(`input`,{"onUpdate:modelValue":r[0]||=e=>t.value=e,type:e.type,placeholder:e.placeholder,disabled:e.disabled,"aria-invalid":e.invalid||void 0,class:`color-base outline-none bg-transparent flex-1 min-w-0 placeholder:op-mute`},null,8,W8),[[tu,t.value]]),e.clearable&&t.value?(K(),q(`button`,{key:1,type:`button`,class:`op-fade shrink-0 transition hover:op100`,"aria-label":`Clear`,onClick:r[1]||=e=>t.value=``},[...r[2]||=[Y(`span`,{class:`i-ph:x`,"aria-hidden":`true`},null,-1)]])):Z(``,!0),G(n.$slots,`suffix`)],2))}}),K8={class:`p-4 flex pointer-events-none items-center inset-0 justify-center fixed z-modal-content`},q8={key:0,class:`px-3 py-2 border-b border-base flex shrink-0 gap-2 items-start justify-between`},J8={class:`min-w-0`},Y8={class:`p-3 flex-1 overflow-auto`},X8={key:1,class:`px-2 py-2 border-t border-base flex shrink-0 gap-2 justify-end`},Z8=W({__name:`OverlayModal`,props:Fa({title:{},description:{}},{open:{type:Boolean},openModifiers:{}}),emits:[`update:open`],setup(e){let t=ro(e,`open`);return(n,r)=>(K(),J(H(TF),{open:t.value,"onUpdate:open":r[0]||=e=>t.value=e},{default:U(()=>[n.$slots.trigger?(K(),J(H(cI),{key:0,"as-child":``},{default:U(()=>[G(n.$slots,`trigger`)]),_:3})):Z(``,!0),X(H(oI),null,{default:U(()=>[X(H(iI),{class:`bg-[#ddd]/40 inset-0 fixed z-modal-backdrop backdrop-blur-sm dark:bg-black/40`,"data-af-animate":``}),Y(`div`,K8,[X(H(tI),{class:`outline-none border border-base rounded-lg bg-base flex flex-col max-h-full max-w-lg w-full pointer-events-auto shadow-xl overflow-hidden`,"data-af-modal":``},{default:U(()=>[e.title||e.description||n.$slots.header?(K(),q(`header`,q8,[Y(`div`,J8,[e.title?(K(),J(H(sI),{key:0,class:`color-base font-medium`},{default:U(()=>[Ts(ke(e.title),1)]),_:1})):Z(``,!0),e.description?(K(),J(H(nI),{key:1,class:`text-sm op-fade`},{default:U(()=>[Ts(ke(e.description),1)]),_:1})):Z(``,!0),G(n.$slots,`header`)]),X(H(EF),{class:`btn-icon shrink-0 h-7 w-7`,"aria-label":`Close`},{default:U(()=>[...r[1]||=[Y(`span`,{class:`i-ph:x`,"aria-hidden":`true`},null,-1)]]),_:1})])):Z(``,!0),Y(`div`,Y8,[G(n.$slots,`default`)]),n.$slots.footer?(K(),q(`footer`,X8,[G(n.$slots,`footer`)])):Z(``,!0)]),_:3})])]),_:3})]),_:3},8,[`open`]))}}),Q8={class:`flex flex-col gap-2 min-h-0`},$8={class:`flex items-center gap-2`},e5={key:0,class:`text-xs op-fade font-mono tabular-nums`},t5={key:0,class:`grid grid-cols-[repeat(auto-fit,minmax(15rem,1fr))] gap-1`},n5=[`title`,`onClick`],r5={class:`flex flex-col min-w-0`},i5={class:`text-sm truncate`},a5={key:0,class:`font-mono text-11px color-faint truncate`},o5=[`title`],s5={key:1,class:`text-xs color-faint px-1 select-none`},c5={class:`flex flex-col gap-3`},l5={class:`px-3 py-2 rounded-lg bg-secondary border border-base font-mono text-xs whitespace-pre-wrap break-all max-h-24 overflow-auto`},u5={class:`flex items-center gap-3 flex-wrap text-xs`},d5={class:`flex flex-col gap-1.5`},f5={class:`text-11px color-faint`},p5=W({__name:`SavedQueriesPanel`,props:{saved:{},suggested:{},currentQuery:{},currentFilters:{},readonly:{type:Boolean}},emits:[`load`,`remove`,`save`],setup(e,{emit:t}){let n=e,r=t,i=V(!1),a=V(``),o=V(``),s=V(`project`),c=[{value:`project`,label:`Just me`,icon:`i-ph:user-duotone`},{value:`workspace`,label:`Shared with team`,icon:`i-ph:users-three-duotone`}],l=Q(()=>[{label:`Exclude functions`,on:n.currentFilters.excludeFunctions},{label:`Exclude _ props`,on:n.currentFilters.excludeUnderscoreProps},{label:`Exclude $ props`,on:n.currentFilters.excludeDollarProps}]),u=Q(()=>[...n.suggested.map(e=>({key:`suggested:${e.query}`,recipe:e,icon:`i-ph:lightbulb-duotone`})),...n.saved.map(e=>({key:`${e.scope}:${e.id}`,recipe:e,icon:`i-ph:code-duotone`,saved:e}))]);function d(){a.value=``,o.value=``,i.value=!0}function f(){r(`save`,{title:a.value.trim()||void 0,description:o.value.trim()||void 0,scope:s.value}),i.value=!1}function p(e){let t=[];return e.excludeFunctions&&t.push({label:`no fn`,title:`Excludes functions`}),e.excludeUnderscoreProps&&t.push({label:`no _`,title:`Excludes _-prefixed props`}),e.excludeDollarProps&&t.push({label:`no $`,title:`Excludes $-prefixed props`}),t}return(t,n)=>(K(),q(`div`,Q8,[Y(`div`,$8,[n[6]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Saved Queries `,-1),e.saved.length+e.suggested.length?(K(),q(`span`,e5,`(`+ke(e.saved.length+e.suggested.length)+`)`,1)):Z(``,!0),n[7]||=Y(`div`,{class:`flex-1`},null,-1),e.readonly?Z(``,!0):(K(),J(nz,{key:1,class:`text-sm`,icon:`i-ph:bookmark-simple-duotone`,onClick:d},{default:U(()=>[...n[5]||=[Ts(` Save query `,-1)]]),_:1}))]),u.value.length?(K(),q(`div`,t5,[(K(!0),q(ss,null,ma(u.value,t=>(K(),q(`div`,{key:t.key,class:`group flex items-center gap-2 px1.5 py-1 border border-base rounded hover:bg-active cursor-pointer`,title:t.recipe.description??t.recipe.query,onClick:e=>r(`load`,t.recipe)},[Y(`span`,{class:ye([`shrink-0 color-active`,t.icon])},null,2),Y(`div`,r5,[Y(`span`,i5,ke(t.recipe.title??(t.recipe.query||`$ (entire object)`)),1),t.recipe.title||!t.recipe.query?(K(),q(`span`,a5,ke(t.recipe.query||`$`),1)):Z(``,!0)]),n[8]||=Y(`div`,{class:`flex-1`},null,-1),(K(!0),q(ss,null,ma(p(t.recipe),e=>(K(),q(`span`,{key:e.label,title:e.title,class:`shrink-0 font-mono text-10px color-muted bg-secondary border border-base rounded px-1.5 py-0.5 leading-none`},ke(e.label),9,o5))),128)),t.saved&&!e.readonly?(K(),J(vm,{key:0,icon:`i-ph:trash-duotone`,label:`Delete`,tooltip:`Delete`,class:`text-sm op0 group-hover:op100 transition-opacity`,onClick:su(e=>r(`remove`,t.saved),[`stop`])},null,8,[`onClick`])):Z(``,!0)],8,n5))),128))])):(K(),q(`div`,s5,` No queries yet. Compose one and hit "Save query". `)),X(Z8,{open:i.value,"onUpdate:open":n[4]||=e=>i.value=e,title:`Save query`,description:`Stores the query text together with the active filter options.`},{footer:U(()=>[X(nz,{onClick:n[3]||=e=>i.value=!1},{default:U(()=>[...n[11]||=[Ts(` Cancel `,-1)]]),_:1}),X(nz,{variant:`primary`,onClick:f},{default:U(()=>[...n[12]||=[Ts(` Save `,-1)]]),_:1})]),default:U(()=>[Y(`div`,c5,[Y(`div`,l5,ke(e.currentQuery.trim()||`$`),1),Y(`div`,u5,[n[9]||=Y(`span`,{class:`color-muted`},`Filters:`,-1),(K(!0),q(ss,null,ma(l.value,e=>(K(),q(`span`,{key:e.label,class:ye([`flex items-center gap-1`,e.on?`color-base`:`color-faint`])},[Y(`span`,{class:ye(e.on?`i-ph:check-circle-duotone color-active`:`i-ph:circle-duotone`)},null,2),Ts(` `+ke(e.label),1)],2))),128))]),X(G8,{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e,placeholder:`Title (optional, becomes the storage id)`},null,8,[`modelValue`]),X(G8,{modelValue:o.value,"onUpdate:modelValue":n[1]||=e=>o.value=e,placeholder:`Description (optional)`},null,8,[`modelValue`]),Y(`div`,d5,[n[10]||=Y(`span`,{class:`text-xs color-muted`},`Save location`,-1),X(U8,{modelValue:s.value,"onUpdate:modelValue":n[2]||=e=>s.value=e,options:c},null,8,[`modelValue`]),Y(`span`,f5,ke(s.value===`workspace`?`.devframe/, committed and shared with the team`:`node_modules/, this checkout only`),1)])])]),_:1},8,[`open`])]))}});function m5(){let e=V([]);async function t(){e.value=await _T().savedList()}async function n(e){let n=await _T().savedSave(e);return await t(),n}async function r(e){await _T().savedDelete(e.id,e.scope),await t()}return{saved:e,refresh:t,save:n,remove:r}}var h5={class:`h-100dvh flex flex-col bg-base color-base font-sans`},g5={class:`flex-1 min-h-0`},_5={class:`flex flex-col h-full overflow-hidden min-h-0`},v5={class:`flex-1 min-h-0 overflow-y-auto`},y5={class:`min-h-full flex flex-col`};_u(W({__name:`App`,setup(e){let t=kM(),n=m5();vr(AM,t),Od(()=>OT.value),Zi(async()=>{await ET(),hT.connected&&(await Promise.all([t.loadSources(),n.refresh()]),_T().onSourcesChanged(()=>void t.loadSources()),_T().onDataChanged(e=>t.handleDataChanged(e)),bT(`devframes:plugin:data-inspector`,e=>t.focusSource(e)),t.runNow(),t.loadSkeleton())});function r(e){n.save({...e,query:t.query.value,excludeFunctions:t.settings.excludeFunctions||void 0,excludeUnderscoreProps:t.settings.excludeUnderscoreProps||void 0,excludeDollarProps:t.settings.excludeDollarProps||void 0})}return(e,i)=>(K(),q(`div`,h5,[Y(`main`,g5,[X(Ed,{"storage-key":`data-inspector-panes`,class:`h-full`},{default:U(()=>[X(H(Td),{size:38,"min-size":`24`,class:`min-w-0`},{default:U(()=>[Y(`div`,_5,[X(jT),X(ez),Y(`div`,v5,[Y(`div`,y5,[X(iB),X(p5,{saved:H(n).saved.value,suggested:H(t).activeSource.value?.queries??[],"current-query":H(t).query.value,"current-filters":H(t).settings,readonly:H(hT).mode===`static`,class:`px3 py2`,onLoad:i[0]||=e=>H(t).applyRecipe(e),onRemove:i[1]||=e=>H(n).remove(e),onSave:r},null,8,[`saved`,`suggested`,`current-query`,`current-filters`,`readonly`])])])])]),_:1}),X(H(Td),{class:`min-w-0`},{default:U(()=>[X(V8,{result:H(t).result.value,"has-result":H(t).hasResult.value,stats:H(t).stats.value,"stats-stale":H(t).statsStale.value,error:H(t).serverError.value,running:H(t).running.value,"last-run-at":H(t).lastRunAt.value,"can-edit":H(t).canEdit.value,"edit-hint":H(t).editHint.value,expand:H(t).expandNode,onRerun:i[2]||=e=>H(t).runNow(),onQuerySubquery:i[3]||=e=>H(t).applySubquery(e),onQueryAppend:i[4]||=e=>H(t).appendPath(e)},null,8,[`result`,`has-result`,`stats`,`stats-stale`,`error`,`running`,`last-run-at`,`can-edit`,`edit-hint`,`expand`])]),_:1})]),_:1})])]))}})).mount(`#app`);
|