@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.
|
@@ -1,952 +0,0 @@
|
|
|
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`),N=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ie=/-\w/g,ae=N(e=>e.replace(ie,e=>e.slice(1).toUpperCase())),P=/\B([A-Z])/g,F=N(e=>e.replace(P,`-$1`).toLowerCase()),I=N(e=>e.charAt(0).toUpperCase()+e.slice(1)),oe=N(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=Te(e[r],t[r]);return n}function Te(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||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||!Te(e[n],t[n]))return!1}}return String(e)===String(t)}function Ee(e,t){return e.findIndex(e=>Te(e,t))}var De=e=>!!(e&&e.__v_isRef===!0),Oe=e=>D(e)?e:e==null?``:x(e)||k(e)&&(e.toString===ee||!E(e.toString))?De(e)?Oe(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>De(t)?ke(e,t.value):S(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:C(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:O(t)?Ae(t):k(t)&&!x(t)&&!ne(t)?String(t):t,Ae=(e,t=``)=>O(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var Me,Ne=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&&Me&&(Me.active?(this.parent=Me,this.index=(Me.scopes||(Me.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=Me;try{return Me=this,e()}finally{Me=t}}}on(){++this._on===1&&(this.prevScope=Me,Me=this)}off(){if(this._on>0&&--this._on===0){if(Me===this)Me=this.prevScope;else{let e=Me;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 Pe(e){return new Ne(e)}function R(){return Me}function Fe(e,t=!1){Me&&Me.cleanups.push(e)}var Ie,Le=new WeakSet,Re=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,Me&&(Me.active?Me.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Le.has(this)&&(Le.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||He(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rt(this),Ge(this);let e=Ie,t=$e;Ie=this,$e=!0;try{return this.fn()}finally{Ke(this),Ie=e,$e=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ye(e);this.deps=this.depsTail=void 0,rt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Le.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){qe(this)&&this.run()}get dirty(){return qe(this)}},ze=0,Be,Ve;function He(e,t=!1){if(e.flags|=8,t){e.next=Ve,Ve=e;return}e.next=Be,Be=e}function Ue(){ze++}function We(){if(--ze>0)return;if(Ve){let e=Ve;for(Ve=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Be;){let t=Be;for(Be=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 Ge(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ke(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ye(r),Xe(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function qe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Je(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Je(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===it)||(e.globalVersion=it,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!qe(e))))return;e.flags|=2;let t=e.dep,n=Ie,r=$e;Ie=e,$e=!0;try{Ge(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{Ie=n,$e=r,Ke(e),e.flags&=-3}}function Ye(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)Ye(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Xe(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Ze(e,t){e.effect instanceof Re&&(e=e.effect.fn);let n=new Re(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 Qe(e){e.effect.stop()}var $e=!0,et=[];function tt(){et.push($e),$e=!1}function nt(){let e=et.pop();$e=e===void 0||e}function rt(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Ie;Ie=void 0;try{t()}finally{Ie=e}}}var it=0,at=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}},ot=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(!Ie||!$e||Ie===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Ie)t=this.activeLink=new at(Ie,this),Ie.deps?(t.prevDep=Ie.depsTail,Ie.depsTail.nextDep=t,Ie.depsTail=t):Ie.deps=Ie.depsTail=t,st(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=Ie.depsTail,t.nextDep=void 0,Ie.depsTail.nextDep=t,Ie.depsTail=t,Ie.deps===t&&(Ie.deps=e)}return t}trigger(e){this.version++,it++,this.notify(e)}notify(e){Ue();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{We()}}};function st(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)st(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var ct=new WeakMap,lt=Symbol(``),ut=Symbol(``),dt=Symbol(``);function ft(e,t,n){if($e&&Ie){let t=ct.get(e);t||ct.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new ot),r.map=t,r.key=n),r.track()}}function pt(e,t,n,r,i,a){let o=ct.get(e);if(!o){it++;return}let s=e=>{e&&e.trigger()};if(Ue(),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===dt||!O(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(dt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(lt)),S(e)&&s(o.get(ut)));break;case`delete`:i||(s(o.get(lt)),S(e)&&s(o.get(ut)));break;case`set`:S(e)&&s(o.get(lt))}}We()}function mt(e,t){let n=ct.get(e);return n&&n.get(t)}function ht(e){let t=rn(e);return t===e?t:(ft(t,`iterate`,dt),tn(e)?t:t.map(on))}function z(e){return ft(e=rn(e),`iterate`,dt),e}function gt(e,t){return en(e)?sn($t(e)?on(t):t):on(t)}var _t={__proto__:null,[Symbol.iterator](){return vt(this,Symbol.iterator,e=>gt(this,e))},concat(...e){return ht(this).concat(...e.map(e=>x(e)?ht(e):e))},entries(){return vt(this,`entries`,e=>(e[1]=gt(this,e[1]),e))},every(e,t){return bt(this,`every`,e,t,void 0,arguments)},filter(e,t){return bt(this,`filter`,e,t,e=>e.map(e=>gt(this,e)),arguments)},find(e,t){return bt(this,`find`,e,t,e=>gt(this,e),arguments)},findIndex(e,t){return bt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return bt(this,`findLast`,e,t,e=>gt(this,e),arguments)},findLastIndex(e,t){return bt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return bt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return St(this,`includes`,e)},indexOf(...e){return St(this,`indexOf`,e)},join(e){return ht(this).join(e)},lastIndexOf(...e){return St(this,`lastIndexOf`,e)},map(e,t){return bt(this,`map`,e,t,void 0,arguments)},pop(){return B(this,`pop`)},push(...e){return B(this,`push`,e)},reduce(e,...t){return xt(this,`reduce`,e,t)},reduceRight(e,...t){return xt(this,`reduceRight`,e,t)},shift(){return B(this,`shift`)},some(e,t){return bt(this,`some`,e,t,void 0,arguments)},splice(...e){return B(this,`splice`,e)},toReversed(){return ht(this).toReversed()},toSorted(e){return ht(this).toSorted(e)},toSpliced(...e){return ht(this).toSpliced(...e)},unshift(...e){return B(this,`unshift`,e)},values(){return vt(this,`values`,e=>gt(this,e))}};function vt(e,t,n){let r=z(e),i=r[t]();return r!==e&&!tn(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var yt=Array.prototype;function bt(e,t,n,r,i,a){let o=z(e),s=o!==e&&!tn(e),c=o[t];if(c!==yt[t]){let t=c.apply(e,a);return s?on(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,gt(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 xt(e,t,n,r){let i=z(e),a=i!==e&&!tn(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=gt(e,t)),n.call(this,t,gt(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?gt(e,c):c}function St(e,t,n){let r=rn(e);ft(r,`iterate`,dt);let i=r[t](...n);return(i===-1||i===!1)&&nn(n[0])?(n[0]=rn(n[0]),r[t](...n)):i}function B(e,t,n=[]){tt(),Ue();let r=rn(e)[t].apply(e,n);return We(),nt(),r}var Ct=u(`__proto__,__v_isRef,__isVue`),wt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(O));function Tt(e){O(e)||(e=String(e));let t=rn(this);return ft(t,`has`,e),t.hasOwnProperty(e)}var Et=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?Kt:Gt:i?Wt:Ut).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=x(e);if(!r){let e;if(a&&(e=_t[t]))return e;if(t===`hasOwnProperty`)return Tt}let o=Reflect.get(e,t,cn(e)?e:n);if((O(t)?wt.has(t):Ct(t))||(r||ft(e,`get`,t),i))return o;if(cn(o)){let e=a&&M(t)?o:o.value;return r&&k(e)?Xt(e):e}return k(o)?r?Xt(o):Jt(o):o}},Dt=class extends Et{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=en(i);if(!tn(n)&&!en(n)&&(i=rn(i),n=rn(n)),!a&&cn(i)&&!cn(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:b(e,t),s=Reflect.set(e,t,n,cn(e)?e:r);return e===rn(r)&&s&&(o?se(n,i)&&pt(e,`set`,t,n,i):pt(e,`add`,t,n)),s}deleteProperty(e,t){let n=b(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&pt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!O(t)||!wt.has(t))&&ft(e,`has`,t),n}ownKeys(e){return ft(e,`iterate`,x(e)?`length`:lt),Reflect.ownKeys(e)}},Ot=class extends Et{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},kt=new Dt,At=new Ot,jt=new Dt(!0),Mt=new Ot(!0),Nt=e=>e,Pt=e=>Reflect.getPrototypeOf(e);function Ft(e,t,n){return function(...r){let i=this.__v_raw,a=rn(i),o=S(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Nt:t?sn:on;return!t&&ft(a,`iterate`,c?ut:lt),_(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 It(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Lt(e,t){let n={get(n){let r=this.__v_raw,i=rn(r),a=rn(n);e||(se(n,a)&&ft(i,`get`,n),ft(i,`get`,a));let{has:o}=Pt(i),s=t?Nt:e?sn:on;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&&ft(rn(t),`iterate`,lt),t.size},has(t){let n=this.__v_raw,r=rn(n),i=rn(t);return e||(se(t,i)&&ft(r,`has`,t),ft(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=rn(a),s=t?Nt:e?sn:on;return!e&&ft(o,`iterate`,lt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return _(n,e?{add:It(`add`),set:It(`set`),delete:It(`delete`),clear:It(`clear`)}:{add(e){let n=rn(this),r=Pt(n),i=rn(e),a=!t&&!tn(e)&&!en(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),pt(n,`add`,a,a)),this},set(e,n){!t&&!tn(n)&&!en(n)&&(n=rn(n));let r=rn(this),{has:i,get:a}=Pt(r),o=i.call(r,e);o||=(e=rn(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?se(n,s)&&pt(r,`set`,e,n,s):pt(r,`add`,e,n),this},delete(e){let t=rn(this),{has:n,get:r}=Pt(t),i=n.call(t,e);i||=(e=rn(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&pt(t,`delete`,e,void 0,a),o},clear(){let e=rn(this),t=e.size!==0,n=e.clear();return t&&pt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Ft(r,e,t)}),n}function Rt(e,t){let n=Lt(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 zt={get:Rt(!1,!1)},Bt={get:Rt(!1,!0)},Vt={get:Rt(!0,!1)},Ht={get:Rt(!0,!0)},Ut=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,Kt=new WeakMap;function qt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Jt(e){return en(e)?e:Qt(e,!1,kt,zt,Ut)}function Yt(e){return Qt(e,!1,jt,Bt,Wt)}function Xt(e){return Qt(e,!0,At,Vt,Gt)}function Zt(e){return Qt(e,!0,Mt,Ht,Kt)}function Qt(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=qt(te(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function $t(e){return en(e)?$t(e.__v_raw):!!(e&&e.__v_isReactive)}function en(e){return!!(e&&e.__v_isReadonly)}function tn(e){return!!(e&&e.__v_isShallow)}function nn(e){return e?!!e.__v_raw:!1}function rn(e){let t=e&&e.__v_raw;return t?rn(t):e}function an(e){return!b(e,`__v_skip`)&&Object.isExtensible(e)&&ce(e,`__v_skip`,!0),e}var on=e=>k(e)?Jt(e):e,sn=e=>k(e)?Xt(e):e;function cn(e){return e?e.__v_isRef===!0:!1}function V(e){return un(e,!1)}function ln(e){return un(e,!0)}function un(e,t){return cn(e)?e:new dn(e,t)}var dn=class{constructor(e,t){this.dep=new ot,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:rn(e),this._value=t?e:on(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||tn(e)||en(e);e=n?e:rn(e),se(e,t)&&(this._rawValue=e,this._value=n?e:on(e),this.dep.trigger())}};function fn(e){e.dep&&e.dep.trigger()}function H(e){return cn(e)?e.value:e}function pn(e){return E(e)?e():H(e)}var mn={get:(e,t,n)=>t===`__v_raw`?e:H(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return cn(i)&&!cn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function hn(e){return $t(e)?e:new Proxy(e,mn)}var gn=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new ot,{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 _n(e){return new gn(e)}function vn(e){let t=x(e)?Array(e.length):{};for(let n in e)t[n]=Sn(e,n);return t}var yn=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=rn(e);let r=!0,i=e;if(!x(e)||O(this._key)||!M(this._key))do r=!nn(i)||tn(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&&cn(this._raw[this._key])){let t=this._object[this._key];if(cn(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return mt(this._raw,this._key)}},bn=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 xn(e,t,n){return cn(e)?e:E(e)?new bn(e):k(e)&&arguments.length>1?Sn(e,t,n):V(e)}function Sn(e,t,n){return new yn(e,t,n)}var Cn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ot(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=it-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Ie!==this)return He(this,!0),!0}get value(){let e=this.dep.track();return Je(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function wn(e,t,n=!1){let r,i;return E(e)?r=e:(r=e.get,i=e.set),new Cn(r,i,n)}var Tn={GET:`get`,HAS:`has`,ITERATE:`iterate`},En={SET:`set`,ADD:`add`,DELETE:`delete`,CLEAR:`clear`},Dn={},On=new WeakMap,kn=void 0;function An(){return kn}function jn(e,t=!1,n=kn){if(n){let t=On.get(n);t||On.set(n,t=[]),t.push(e)}}function Mn(e,t,n=d){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:tn(e)||i===!1||i===0?Nn(e,1):Nn(e),u,f,m,h,g=!1,_=!1;if(cn(e)?(f=()=>e.value,g=tn(e)):$t(e)?(f=()=>l(e),g=!0):x(e)?(_=!0,g=e.some(e=>$t(e)||tn(e)),f=()=>e.map(e=>{if(cn(e))return e.value;if($t(e))return l(e);if(E(e))return c?c(e,2):e()})):f=E(e)?t?c?()=>c(e,2):e:()=>{if(m){tt();try{m()}finally{nt()}}let t=kn;kn=u;try{return c?c(e,3,[h]):e(h)}finally{kn=t}}:p,t&&i){let e=f,t=i===!0?1/0:i;f=()=>Nn(e(),t)}let y=R(),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(Dn):Dn,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=kn;kn=u;try{let e=[n,S===Dn?void 0:_&&S[0]===Dn?[]:S,h];S=n,c?c(t,3,e):t(...e)}finally{kn=e}}}else u.run()}};return s&&s(C),u=new Re(f),u.scheduler=o?()=>o(C,!1):C,h=e=>jn(e,!1,u),m=u.onStop=()=>{let e=On.get(u);if(e){if(c)c(e,4);else for(let t of e)t();On.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 Nn(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--,cn(e))Nn(e.value,t,n);else if(x(e))for(let r=0;r<e.length;r++)Nn(e[r],t,n);else if(C(e)||S(e))e.forEach(e=>{Nn(e,t,n)});else if(ne(e)){for(let r in e)Nn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Nn(e[r],t,n)}return e}var Pn=[];function Fn(e){Pn.push(e)}function In(){Pn.pop()}function Ln(e,t){}var Rn={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`},zn={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 Bn(e,t,n,r){try{return r?e(...r):e()}catch(e){Hn(e,t,n)}}function Vn(e,t,n,r){if(E(e)){let i=Bn(e,t,n,r);return i&&A(i)&&i.catch(e=>{Hn(e,t,n)}),i}if(x(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Vn(e[a],t,n,r));return i}}function Hn(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){tt(),Bn(a,null,10,[e,i,o]),nt();return}}Un(e,n,i,r,o)}function Un(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var Wn=[],Gn=-1,Kn=[],qn=null,Jn=0,Yn=Promise.resolve(),Xn=null;function Zn(e){let t=Xn||Yn;return e?t.then(this?e.bind(this):e):t}function Qn(e){let t=Gn+1,n=Wn.length;for(;t<n;){let r=t+n>>>1,i=Wn[r],a=ir(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function $n(e){if(!(e.flags&1)){let t=ir(e),n=Wn[Wn.length-1];!n||!(e.flags&2)&&t>=ir(n)?Wn.push(e):Wn.splice(Qn(t),0,e),e.flags|=1,er()}}function er(){Xn||=Yn.then(ar)}function tr(e){if(!x(e))qn&&e.id===-1?qn.splice(Jn+1,0,e):e.flags&1||(Kn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Kn.push(e[t]);er()}function nr(e,t,n=Gn+1){for(;n<Wn.length;n++){let t=Wn[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;Wn.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function rr(e){if(Kn.length){let e=[...new Set(Kn)].sort((e,t)=>ir(e)-ir(t));if(Kn.length=0,qn){for(let t=0;t<e.length;t++)qn.push(e[t]);return}for(qn=e,Jn=0;Jn<qn.length;Jn++){let e=qn[Jn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}qn=null,Jn=0}}var ir=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ar(e){try{for(Gn=0;Gn<Wn.length;Gn++){let e=Wn[Gn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Bn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Gn<Wn.length;Gn++){let e=Wn[Gn];e&&(e.flags&=-2)}Gn=-1,Wn.length=0,rr(e),Xn=null,(Wn.length||Kn.length)&&ar(e)}}var or,sr=[];function cr(e,t){or=e,or?(or.enabled=!0,sr.forEach(({event:e,args:t})=>or.emit(e,...t)),sr=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{cr(e,t)}),setTimeout(()=>{or||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,sr=[])},3e3)):sr=[]}var lr=null,ur=null;function dr(e){let t=lr;return lr=e,ur=e&&e.type.__scopeId||null,t}function fr(e){ur=e}function pr(){ur=null}var mr=e=>U;function U(e,t=lr,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ms(-1);let i=dr(t),a=us.length,o;try{o=e(...n)}finally{for(let e=us.length;e>a;e--)fs();dr(i),r._d&&ms(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function hr(e,t){if(lr===null)return e;let n=Qs(lr),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&&Nn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function gr(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&&(tt(),Vn(c,n,8,[e.el,s,e,t]),nt())}}function _r(e,t){if(Ps){let n=Ps.provides,r=Ps.parent&&Ps.parent.provides;r===n&&(n=Ps.provides=Object.create(r)),n[e]=t}}function vr(e,t,n=!1){let r=Fs();if(r||to){let i=to?to._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 yr(){return!!(Fs()||to)}var br=Symbol.for(`v-scx`),xr=()=>vr(br);function Sr(e,t){return Er(e,null,t)}function Cr(e,t){return Er(e,null,{flush:`post`})}function wr(e,t){return Er(e,null,{flush:`sync`})}function Tr(e,t,n){return Er(e,t,n)}function Er(e,t,n=d){let{immediate:r,deep:i,flush:a,once:o}=n,s=_({},n),c=t&&r||!t&&a!==`post`,l;if(Vs){if(a===`sync`){let e=xr();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=p,e.resume=p,e.pause=p,e}}let u=Ps;s.call=(e,t,n)=>Vn(e,u,t,n);let f=!1;a===`post`?s.scheduler=e=>{Fo(e,u&&u.suspense)}:a!==`sync`&&(f=!0,s.scheduler=(e,t)=>{t?e():$n(e)}),s.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let m=Mn(e,t,s);return Vs&&(l?l.push(m):c&&m()),m}function Dr(e,t,n){let r=this.proxy,i=D(e)?e.includes(`.`)?Or(r,e):()=>r[e]:e.bind(r,r),a;E(t)?a=t:(a=t.handler,n=t);let o=Rs(this),s=Er(i,a.bind(r),n);return o(),s}function Or(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 kr=new WeakMap,Ar=Symbol(`_vte`),jr=e=>e.__isTeleport,Mr=e=>e&&(e.disabled||e.disabled===``),Nr=e=>e&&(e.defer||e.defer===``),Pr=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Fr=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Ir=(e,t)=>{let n=e&&e.to;return D(n)?t?t(n):null:n},Lr={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=Mr(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=Mr(e.props),r=e.target=Ir(e.props,m),a=Hr(r,e,h,p);r&&(o!==`svg`&&Pr(r)?o=`svg`:o!==`mathml`&&Fr(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),Vr(e,!1)))},S=e=>{let t=()=>{if(kr.get(e)===t){if(kr.delete(e),Mr(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),Vr(e,!0)}x(e)}};kr.set(e,t),Fo(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Nr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),Vr(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=kr.get(e);if(u){u.flags|=8,kr.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Mr(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Pr(p)?o=`svg`:(o===`mathml`||Fr(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Ho(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):Rr(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=Ir(t.props,m);e&&(t.target=e,Rr(t,e,null,l,0))}else g&&Rr(t,p,h,l,1);Vr(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=Mr(f),m=a||!p,h=kr.get(e);if(h&&(h.flags|=8,kr.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:Rr,hydrate:zr};function Rr(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),!kr.has(e)&&(!d||Mr(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function zr(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=Ir(t.props,c),h=Mr(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||Hr(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||Hr(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),Vr(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var Br=Lr;function Vr(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 Hr(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[Ar]=o,e&&(r(a,e,i),r(o,e,i)),o}var Ur=Symbol(`_leaveCb`),Wr=Symbol(`_enterCb`);function Gr(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Xi(()=>{e.isMounted=!0}),$i(()=>{e.isUnmounting=!0}),e}var Kr=[Function,Array],qr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Kr,onEnter:Kr,onAfterEnter:Kr,onEnterCancelled:Kr,onBeforeLeave:Kr,onLeave:Kr,onAfterLeave:Kr,onLeaveCancelled:Kr,onBeforeAppear:Kr,onAppear:Kr,onAfterAppear:Kr,onAppearCancelled:Kr},Jr=e=>{let t=e.subTree;return t.component?Jr(t.component):t},Yr={name:`BaseTransition`,props:qr,setup(e,{slots:t}){let n=Fs(),r=Gr();return()=>{let i=t.default&&ri(t.default(),!0),a=i&&i.length?Xr(i):n.subTree?Z():void 0;if(!a)return;let o=rn(e),{mode:s}=o;if(r.isLeaving)return ei(a);let c=ti(a);if(!c)return ei(a);let l=$r(c,o,r,n,e=>l=e);c.type!==cs&&ni(c,l);let u=n.subTree&&ti(n.subTree);if(u&&u.type!==cs&&!_s(u,c)&&Jr(n).type!==cs){let e=$r(u,o,r,n);if(ni(u,e),s===`out-in`&&c.type!==cs)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},ei(a);s===`in-out`&&c.type!==cs?e.delayLeave=(e,t,n)=>{let i=Qr(r,u);i[String(u.key)]=u,e[Ur]=()=>{t(),e[Ur]=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 Xr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==cs){t=n;break}}return t}var Zr=Yr;function Qr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function $r(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=Qr(n,e),C=(e,t)=>{e&&Vn(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[Ur]&&t[Ur](!0);let i=S[b];i&&_s(e,i)&&i.el[Ur]&&i.el[Ur](),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[Wr]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[Wr]=void 0)};let c=t[Wr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[Wr]&&t[Wr](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[Ur]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[Ur]=void 0,S[i]===e&&delete S[i])};let o=t[Ur].bind(null,!1);S[i]=e,p?w(p,[t,o]):o()},clone(e){let a=$r(e,t,n,r,i);return i&&i(a),a}};return T}function ei(e){if(Ri(e))return e=Cs(e),e.children=null,e}function ti(e){if(!Ri(e))return jr(e.type)&&e.children?Xr(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 ni(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;ni(jr(n.type)&&ti(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 ri(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===os?(o.patchFlag&128&&i++,r=r.concat(ri(o.children,t,s))):(t||o.type!==cs)&&r.push(s==null?o:Cs(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 ii(){let e=Fs();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function ai(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function oi(e){let t=Fs(),n=ln(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 si(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var ci=new WeakMap;function li(e,t,n,r,i=!1){if(x(e)){e.forEach((e,a)=>li(e,t&&(x(t)?t[a]:t),n,r,i));return}if(Fi(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&li(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Qs(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=rn(f),h=f===d?m:e=>!si(u,e)&&b(p,e),g=(e,t)=>!(t&&si(u,t));if(l!=null&&l!==c){if(ui(t),D(l))u[l]=null,h(l)&&(f[l]=null);else if(cn(l)){let e=t;g(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(E(c))Bn(c,s,12,[o,u]);else{let t=D(c),r=cn(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(),ci.delete(e)};t.id=-1,ci.set(e,t),Fo(t,n)}else ui(e),s()}}}function ui(e){let t=ci.get(e);t&&(t.flags|=8,ci.delete(e))}var di=!1,fi=()=>{di||=(console.error(`Hydration completed but contains mismatches.`),!0)},pi=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,mi=e=>e.namespaceURI.includes(`MathML`),hi=e=>{if(e.nodeType===1){if(pi(e))return`svg`;if(mi(e))return`mathml`}},gi=e=>e.nodeType===8;function _i(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),rr(),t._vnode=e;return}d(t.firstChild,e,null,null,null),rr(),t._vnode=e},d=(n,r,s,l,u,h=!1)=>{h||=!!r.dynamicChildren;let b=gi(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 ss:E===3?(n.data!==r.children&&(fi(),n.data=r.children),D=a(n)):r.children===``?(c(r.el=i(``),o(n),n),D=n):D=x();break;case cs:y(n)?(D=a(n),v(r.el=n.content.firstChild,n,s)):D=E!==8||b?x():a(n);break;case ls: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 os: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):gi(n)&&n.data===`teleport start`?_(n,n.data,`teleport end`):a(n),t(r,e,null,s,l,hi(e),h),Fi(r)&&!r.type.__asyncResolved){let t;b?(t=X(os),t.anchor=D?D.previousSibling:e.lastChild):t=n.nodeType===3?ws(``):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,hi(o(n)),u,h,e,d))}return C!=null&&li(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&&gr(t,null,n,`created`);let c=!1;if(y(e)){c=Vo(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&&!Si(e,1)&&fi();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
|
-
`)&&(Si(e,0)||fi(),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(yi(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&&$t(u.style))for(let e in u.style)u.style[e]}let x;(x=u&&u.onVnodeBeforeMount)&&As(x,n,t),m&&gr(t,null,n,`beforeMount`),((x=u&&u.onVnodeMounted)||m||c)&&rs(()=>{x&&As(x,n,t),c&&g.enter(e),m&&gr(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]=Es(f[t]),g=h.type===ss;e?(g&&!u&&t+1<p&&Es(f[t+1]).type===ss&&(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,Si(r,1)||fi()),n(null,h,r,null,o,s,hi(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&&gi(f)&&f.data===`]`?a(t.anchor=f):(fi(),c(t.anchor=l(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(wi(e,t)||fi(),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,hi(d),c),r&&(r.vnode.el=t.el,go(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&gi(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 vi=new Set([`src`,`srcset`,`href`,`poster`]);function yi(e,t,n){return vi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var bi=`data-allow-mismatch`,xi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Si(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(bi);)e=e.parentElement;return Ci(e&&e.getAttribute(bi),t)}function Ci(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(xi[t])}}function wi(e,t){return Si(e.parentElement,1)||Ti(e)||Ei(t)}function Ti(e){return e.nodeType===1&&Ci(e.getAttribute(bi),1)}function Ei({props:e}){let t=e&&e[bi];return typeof t==`string`&&Ci(t,1)}var Di=fe().requestIdleCallback||(e=>setTimeout(e,1)),Oi=fe().cancelIdleCallback||(e=>clearTimeout(e)),ki=(e=1e4)=>t=>{let n=Di(t,{timeout:e});return()=>Oi(n)};function Ai(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 ji=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(Ai(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Mi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ni=(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 Pi(e,t){if(gi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(gi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Fi=e=>!!e.type.__asyncLoader;function Ii(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=>Pi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Ps;if(ai(e),u)return()=>Li(u,e);let t=t=>{l=null,Hn(t,e,13,!r)};if(s&&e.suspense||Vs)return p().then(t=>()=>Li(t,e)).catch(e=>(t(e),()=>r?X(r,{error:e}):null));let a=V(!1),c=V(),d=V(!!i),f,m;return ea(()=>{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&&Ri(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Li(u,e);if(c.value&&r)return X(r,{error:c.value});if(n&&!d.value)return Li(n,e)}}})}function Li(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 Ri=e=>e.type.__isKeepAlive,zi={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=Fs(),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),Fo(()=>{a.isDeactivated=!1,a.a&&L(a.a);let t=e.props&&e.props.onVnodeMounted;t&&As(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;Go(t.m),Go(t.a),l(e,f,null,1,s),Fo(()=>{t.da&&L(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&As(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){Gi(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=$s(Fi(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!_s(t,o))?p(t):o&&Gi(o),i.delete(e),a.delete(e)}Tr(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Bi(e,t)),t&&m(e=>!Bi(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(qo(n.subTree.type)?Fo(()=>{i.set(g,Ki(n.subTree))},n.subTree.suspense):i.set(g,Ki(n.subTree)))};return Xi(_),Qi(_),$i(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=Ki(t);if(e.type===i.type&&e.key===i.key){Gi(i);let e=i.component.da;e&&Fo(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(!gs(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=Ki(r);if(s.type===cs)return o=null,s;let c=s.type,l=$s(Fi(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Bi(u,l))||d&&l&&Bi(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=Cs(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&ni(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,qo(r.type)?r:s}}};function Bi(e,t){return x(e)?e.some(e=>Bi(e,t)):D(e)?e.split(`,`).includes(t):T(e)?(e.lastIndex=0,e.test(t)):!1}function Vi(e,t){Ui(e,`a`,t)}function Hi(e,t){Ui(e,`da`,t)}function Ui(e,t,n=Ps){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(qi(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ri(e.parent.vnode)&&Wi(r,t,n,e),e=e.parent}}function Wi(e,t,n,r){let i=qi(t,e,r,!0);ea(()=>{v(r[t],i)},n)}function Gi(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ki(e){return e.shapeFlag&128?e.ssContent:e}function qi(e,t,n=Ps,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{tt();let i=Rs(n),a=Vn(t,n,e,r);return i(),nt(),a};return r?i.unshift(a):i.push(a),a}}var Ji=e=>(t,n=Ps)=>{(!Vs||e===`sp`)&&qi(e,(...e)=>t(...e),n)},Yi=Ji(`bm`),Xi=Ji(`m`),Zi=Ji(`bu`),Qi=Ji(`u`),$i=Ji(`bum`),ea=Ji(`um`),ta=Ji(`sp`),na=Ji(`rtg`),ra=Ji(`rtc`);function ia(e,t=Ps){qi(`ec`,e,t)}var aa=`components`,oa=`directives`;function sa(e,t){return da(aa,e,!0,t)||e}var ca=Symbol.for(`v-ndc`);function la(e){return D(e)?da(aa,e,!1)||e:e||ca}function ua(e){return da(oa,e)}function da(e,t,n=!0,r=!1){let i=lr||Ps;if(i){let n=i.type;if(e===aa){let e=$s(n,!1);if(e&&(e===t||e===ae(t)||e===I(ae(t))))return n}let a=fa(i[e]||n[e],t)||fa(i.appContext[e],t);return!a&&r?n:a}}function fa(e,t){return e&&(e[t]||e[ae(t)]||e[I(ae(t))])}function pa(e,t,n,r){let i,a=n&&n[r],o=x(e);if(o||D(e)){let n=o&&$t(e),r=!1,s=!1;n&&(r=!tn(e),s=en(e),e=z(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?sn(on(e[n])):on(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 ma(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??={},lr.ce||lr.parent&&Fi(lr.parent)&&lr.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(os,null,[X(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=us.length;K();let c;try{let i=o&&ha(o(n)),s=n.key||a||i&&i.key;c=J(os,{key:(s&&!O(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=us.length;e>s;e--)fs();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function ha(e){return e.some(e=>!gs(e)||!(e.type===cs||e.type===os&&!ha(e.children)))?e:null}function ga(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:oe(r)]=e[r];return n}var _a=e=>e?Bs(e)?Qs(e):_a(e.parent):null,va=_(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=>_a(e.parent),$root:e=>_a(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ha(e),$forceUpdate:e=>e.f||=()=>{$n(e.update)},$nextTick:e=>e.n||=Zn.bind(e.proxy),$watch:e=>Dr.bind(e)}),ya=(e,t)=>e!==d&&!e.__isScriptSetup&&b(e,t),ba={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(ya(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 La&&(o[t]=0)}let l=va[t],u,f;if(l)return t===`$attrs`&&ft(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 ya(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)||ya(t,s)||b(a,s)||b(r,s)||b(va,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)}},xa=_({},ba,{get(e,t){if(t!==Symbol.unscopables)return ba.get(e,t,e)},has(e,t){return t[0]!==`_`&&!pe(t)}});function Sa(){return null}function Ca(){return null}function wa(e){}function Ta(e){}function Ea(){return null}function Da(){}function Oa(e,t){return null}function ka(){return ja(`useSlots`).slots}function Aa(){return ja(`useAttrs`).attrs}function ja(e){let t=Fs();return t.setupContext||=Zs(t)}function Ma(e){return x(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Na(e,t){let n=Ma(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 Pa(e,t){return!e||!t?e||t:x(e)&&x(t)?e.concat(t):_({},Ma(e),Ma(t))}function Fa(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function Ia(e){let t=Fs(),n=Vs,r=e();zs(),n&&Ls(!1);let i=()=>{Rs(t),n&&Ls(!0)},a=()=>{Fs()!==t&&t.scope.off(),zs(),n&&Ls(!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 La=!0;function Ra(e){let t=Ha(e),n=e.proxy,r=e.ctx;La=!1,t.beforeCreate&&Ba(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&&za(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=Jt(t))}if(La=!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)Va(s[e],r,n,e);if(c){let e=E(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{_r(t,e[t])})}u&&Ba(u,e,`c`);function M(e,t){x(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(M(Yi,d),M(Xi,f),M(Zi,m),M(Qi,h),M(Vi,g),M(Hi,_),M(ia,D),M(ra,w),M(na,T),M($i,y),M(ea,S),M(ta,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&&ai(e)}function za(e,t,n=p){x(e)&&(e=qa(e));for(let n in e){let r=e[n],i;i=k(r)?`default`in r?vr(r.from||n,r.default,!0):vr(r.from||n):vr(r),cn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Ba(e,t,n){Vn(x(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Va(e,t,n,r){let i=r.includes(`.`)?Or(n,r):()=>n[r];if(D(e)){let n=t[e];E(n)&&Tr(i,n)}else if(E(e))Tr(i,e.bind(n));else if(k(e)){if(x(e))e.forEach(e=>Va(e,t,n,r));else{let r=E(e.handler)?e.handler.bind(n):t[e.handler];E(r)&&Tr(i,r,e)}}}function Ha(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=>Ua(c,e,o,!0)),Ua(c,t,o)),k(t)&&a.set(t,c),c}function Ua(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Ua(e,a,n,!0),i&&i.forEach(t=>Ua(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Wa[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Wa={data:Ga,props:Xa,emits:Xa,methods:Ya,computed:Ya,beforeCreate:Ja,created:Ja,beforeMount:Ja,mounted:Ja,beforeUpdate:Ja,updated:Ja,beforeDestroy:Ja,beforeUnmount:Ja,destroyed:Ja,unmounted:Ja,activated:Ja,deactivated:Ja,errorCaptured:Ja,serverPrefetch:Ja,components:Ya,directives:Ya,watch:Za,provide:Ga,inject:Ka};function Ga(e,t){return t?e?function(){return _(E(e)?e.call(this,this):e,E(t)?t.call(this,this):t)}:t:e}function Ka(e,t){return Ya(qa(e),qa(t))}function qa(e){if(x(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ja(e,t){return e?[...new Set([].concat(e,t))]:t}function Ya(e,t){return e?_(Object.create(null),e,t):t}function Xa(e,t){return e?x(e)&&x(t)?[...new Set([...e,...t])]:_(Object.create(null),Ma(e),Ma(t??{})):t}function Za(e,t){if(!e)return t;if(!t)return e;let n=_(Object.create(null),e);for(let r in t)n[r]=Ja(e[r],t[r]);return n}function Qa(){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 $a=0;function eo(e,t){return function(n,r=null){E(n)||(n=_({},n)),r!=null&&!k(r)&&(r=null);let i=Qa(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:$a++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:ac,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,Qs(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Vn(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=to;to=c;try{return e()}finally{to=t}}};return c}}var to=null;function no(e,t,n=d){let r=Fs(),i=ae(t),a=F(t),o=ro(e,i),s=_n((o,s)=>{let c,l=d,u;return wr(()=>{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 ro=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${ae(t)}Modifiers`]||e[`${F(t)}Modifiers`];function io(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||d,i=n,a=t.startsWith(`update:`),o=a&&ro(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>D(e)?e.trim():e)),o.number&&(i=n.map(le)));let s,c=r[s=oe(t)]||r[s=oe(ae(t))];!c&&a&&(c=r[s=oe(F(t))]),c&&Vn(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,Vn(l,e,6,i)}}var ao=new WeakMap;function oo(e,t,n=!1){let r=n?ao: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=oo(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 so(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 co(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,_=dr(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Es(l.call(t,e,u,d,p,f,m)),y=s}else{let e=t;v=Es(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),y=t.props?s:uo(s)}}catch(t){us.length=0,Hn(t,e,1),v=X(cs)}let b=v;if(y&&h!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(g)&&(y=fo(y,a)),b=Cs(b,y,!1,!0))}return n.dirs&&(b=Cs(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ni(jr(b.type)&&ti(b)||b,n.transition),v=b,dr(_),v}function lo(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(gs(r)){if(r.type!==cs||r.children===`v-if`){if(n)return;n=r}}else return}return n}var uo=e=>{let t;for(let n in e)(n===`class`||n===`style`||h(n))&&((t||={})[n]=e[n]);return t},fo=(e,t)=>{let n={};for(let r in e)(!g(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function po(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?mo(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(ho(o,r,n)&&!so(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||mo(r,o,l):!!o;return!1}function mo(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(ho(t,e,a)&&!so(n,a))return!0}return!1}function ho(e,t,n){let r=e[n],i=t[n];return n===`style`&&k(r)&&k(i)?!Te(r,i):r!==i}function go({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 _o={},vo=()=>Object.create(_o),yo=e=>Object.getPrototypeOf(e)===_o;function bo(e,t,n,r=!1){let i={},a=vo();e.propsDefaults=Object.create(null),So(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Yt(i):e.type.props?i:a,e.attrs=a}function xo(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=rn(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(so(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=ae(o);i[t]=Co(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{So(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]=Co(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&&pt(e.attrs,`set`,``)}function So(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=ae(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:so(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=rn(n),r=s||d;for(let o=0;o<a.length;o++){let s=a[o];n[s]=Co(i,t,s,r[s],e,!b(r,s))}}return o}function Co(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=Rs(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 wo=new WeakMap;function To(e,t,n=!1){let r=n?wo: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]=To(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=ae(a[e]);Eo(t)&&(o[t]=d)}else if(a)for(let e in a){let t=ae(e);if(Eo(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 Eo(e){return e[0]!==`$`&&!re(e)}var Do=e=>e===`_`||e===`_ctx`||e===`$stable`,Oo=e=>x(e)?e.map(Es):[Es(e)],ko=(e,t,n)=>{if(t._n)return t;let r=U((...e)=>Oo(t(...e)),n);return r._c=!1,r},Ao=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Do(n))continue;let i=e[n];if(E(i))t[n]=ko(n,i,r);else if(i!=null){let e=Oo(i);t[n]=()=>e}}},jo=(e,t)=>{let n=Oo(t);e.slots.default=()=>n},Mo=(e,t,n)=>{for(let r in t)(n||!Do(r))&&(e[r]=t[r])},No=(e,t,n)=>{let r=e.slots=vo();if(e.vnode.shapeFlag&32){let e=t._;e?(Mo(r,t,n),n&&ce(r,`_`,e,!0)):Ao(t,r)}else t&&jo(e,t)},Po=(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:Mo(i,t,n):(a=!t.$stable,Ao(t,i)),o=t}else t&&(jo(e,t),o={default:1});if(a)for(let e in i)!Do(e)&&o[e]==null&&delete i[e]},Fo=rs;function Io(e){return Ro(e)}function Lo(e){return Ro(e,_i)}function Ro(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&&!_s(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 ss:y(e,t,n,r);break;case cs:b(e,t,n,r);break;case ls:e??x(t,n,r,o);break;case os: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?li(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&li(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,zo(e,c),l,d),_&&gr(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)&&As(p,i,e)}_&&gr(e,null,i,`beforeMount`);let v=Vo(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&Fo(()=>{try{p&&As(p,i,e),v&&g.enter(f),_&&gr(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||qo(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?Ds(e[l]):Es(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&&Bo(n,!1),(g=h.onVnodeBeforeUpdate)&&As(g,n,t,e),p&&gr(t,e,n,`beforeUpdate`),n&&Bo(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,zo(t,i),o):s||ie(e,t,c,null,n,r,zo(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)&&Fo(()=>{g&&As(g,n,t,e),p&&gr(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===os||!_s(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)&&Ho(e,t,!0)):ie(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=Ns(e,r,i);if(Ri(e)&&(s.ctx.renderer=me),Hs(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,M,o),!e.el){let r=s.subTree=X(cs);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(po(e,t,n)){if(r.asyncDep&&!r.asyncResolved){N(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=Wo(e);if(n){t&&(t.el=c.el,N(e,t,o)),n.asyncDep.then(()=>{Fo(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Bo(e,!1),t?(t.el=c.el,N(e,t,o)):t=c,n&&L(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&As(d,s,t,c),Bo(e,!0);let f=co(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),ue(p),e,i,a),t.el=f.el,u===null&&go(e,f.el),r&&Fo(r,i),(d=t.props&&t.props.onVnodeUpdated)&&Fo(()=>As(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=Fi(t);if(Bo(e,!1),l&&L(l),!m&&(o=c&&c.onVnodeBeforeMount)&&As(o,d,t),Bo(e,!0),s&&ge){let t=()=>{e.subTree=co(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=co(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Fo(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Fo(()=>As(o,d,e),i)}(t.shapeFlag&256||d&&Fi(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Fo(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Re(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=()=>$n(u),Bo(e,!0),l()},N=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,xo(e,t.props,r,n),Po(e,t.children,n),tt(),nr(e),nt()},ie=(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){ae(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))},ae=(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?Ds(t[p]):Es(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?Ds(t[l]):Es(t[l]);if(_s(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?Ds(t[p]):Es(t[p]);if(_s(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?Ds(t[l]):Es(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?Ds(t[l]):Es(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&&_s(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?Uo(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||Ko(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===os){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===ls){S(e,t,n);return}if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[Ur]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),Fo(()=>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[Ur];s._isLeaving&&s[Ur](!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&&(tt(),li(s,null,n,e,!0),nt()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Fi(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&As(_,t,e),u&6)ce(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&gr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,me,r):l&&!l.hasOnce&&(a!==os||d>0&&d&64)?le(l,t,n,!1,!0):(a===os&&d&384||!i&&u&16)&&le(c,t,n),r&&oe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Fo(()=>{_&&As(_,t,e),h&&gr(e,null,t,`unmounted`),v&&(e.el=null)},n)},oe=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===os){se(n,r);return}if(t===ls){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;Go(c),Go(l),r&&L(r),i.stop(),a&&(a.flags|=8,I(o,e,t,n)),s&&Fo(s,t),Fo(()=>{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[Ar];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,nr(r),rr(),!1)},me={p:v,um:I,m:F,r:oe,mt:te,mc:D,pc:ie,pbc:k,n:ue,o:e},he,ge;return t&&([he,ge]=t(me)),{render:pe,hydrate:he,createApp:eo(pe,he)}}function zo({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 Bo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Vo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ho(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]=Ds(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Ho(t,a)),a.type===ss&&(a.patchFlag===-1&&(a=i[e]=Ds(a)),a.el=t.el),a.type===cs&&!a.el&&(a.el=t.el)}}function Uo(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 Wo(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Wo(t)}function Go(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ko(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Ko(t.subTree):null}var qo=e=>e.__isSuspense,Jo=0,Yo={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)Zo(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}Qo(e,t,n,r,i,o,s,c,l)}},hydrate:es,normalize:ts};function Xo(e,t){let n=e.props&&e.props[t];E(n)&&n()}function Zo(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=$o(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?(Xo(e,`onPending`),Xo(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),is(f,e.ssFallback)):f.resolve(!1,!0)}function Qo(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,_s(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&(_||(c(m,p,n,r,i,null,a,o,s),is(d,p)))):(d.pendingId=Jo++,_?(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():(c(m,p,n,r,i,null,a,o,s),is(d,p))):m&&_s(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&&_s(m,f))c(m,f,n,r,i,d,a,o,s),is(d,f);else if(Xo(t,`onPending`),d.pendingBranch=f,d.pendingId=f.shapeFlag&512?f.component.suspenseId:Jo++,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 $o(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=as(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:Jo++,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),tr(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&&Fo(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,is(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&&tr(c),x.effects=[],v&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!n&&t.resolve()),Xo(r,`onResolve`)},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=x;Xo(t,`onFallback`);let o=m(n),l=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,e,i,o,r,null,a,s,c),is(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=>{Hn(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;zs(),e.asyncResolved=!0;let{vnode:s}=e;Ws(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)),go(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 es(e,t,n,r,i,a,o,s,c){let l=t.suspense=$o(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 ts(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=ns(r?n.default:n),e.ssFallback=r?ns(n.fallback):X(cs)}function ns(e){let t;if(E(e)){let n=ps&&e._c;n&&(e._d=!1,K()),e=e(),n&&(e._d=!0,t=ds,fs())}return x(e)&&(e=lo(e)),e=Es(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function rs(e,t){t&&t.pendingBranch?x(e)?t.effects.push(...e):t.effects.push(e):tr(e)}function is(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,go(r,i))}function as(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var os=Symbol.for(`v-fgt`),ss=Symbol.for(`v-txt`),cs=Symbol.for(`v-cmt`),ls=Symbol.for(`v-stc`),us=[],ds=null;function K(e=!1){us.push(ds=e?null:[])}function fs(){us.pop(),ds=us[us.length-1]||null}var ps=1;function ms(e,t=!1){ps+=e,e<0&&ds&&t&&(ds.hasOnce=!0)}function hs(e){return e.dynamicChildren=ps>0?ds||f:null,fs(),ps>0&&ds&&ds.push(e),e}function q(e,t,n,r,i,a){return hs(Y(e,t,n,r,i,a,!0))}function J(e,t,n,r,i){return hs(X(e,t,n,r,i,!0))}function gs(e){return e?e.__v_isVNode===!0:!1}function _s(e,t){return e.type===t.type&&e.key===t.key}function vs(e){}var ys=({key:e})=>e??null,bs=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:D(e)||cn(e)||E(e)?{i:lr,r:e,k:t,f:!!n}:e);function Y(e,t=null,n=null,r=0,i=null,a=e===os?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ys(t),ref:t&&bs(t),scopeId:ur,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:lr};return s?(Os(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=D(n)?8:16),ps>0&&!o&&ds&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&ds.push(c),c}var X=xs;function xs(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===ca)&&(e=cs),gs(e)){let r=Cs(e,t,!0);return n&&Os(r,n),ps>0&&!a&&ds&&(r.shapeFlag&6?ds[ds.indexOf(e)]=r:ds.push(r)),r.patchFlag=-2,r}if(ec(e)&&(e=e.__vccOpts),t){t=Ss(t);let{class:e,style:n}=t;e&&!D(e)&&(t.class=ye(e)),k(n)&&(nn(n)&&!x(n)&&(n=_({},n)),t.style=me(n))}let o=D(e)?1:qo(e)?128:jr(e)?64:k(e)?4:E(e)?2:0;return Y(e,t,n,r,i,o,a,!0)}function Ss(e){return e?nn(e)||yo(e)?_({},e):e:null}function Cs(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?ks(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&ys(l),ref:t&&t.ref?n&&a?x(a)?a.concat(bs(t)):[a,bs(t)]:bs(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!==os?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&&Cs(e.ssContent),ssFallback:e.ssFallback&&Cs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&ni(u,c.clone(u)),u}function ws(e=` `,t=0){return X(ss,null,e,t)}function Ts(e,t){let n=X(ls,null,e);return n.staticCount=t,n}function Z(e=``,t=!1){return t?(K(),J(cs,null,e)):X(cs,null,e)}function Es(e){return e==null||typeof e==`boolean`?X(cs):x(e)?X(os,null,e.slice()):gs(e)?Ds(e):X(ss,null,String(e))}function Ds(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Cs(e)}function Os(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),Os(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!yo(t)?t._ctx=lr:r===3&&lr&&(lr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(E(t)){if(r&65){Os(e,{default:t});return}t={default:t,_ctx:lr},n=32}else t=String(t),r&64?(n=16,t=[ws(t)]):n=8;e.children=t,e.shapeFlag|=n}function ks(...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 As(e,t,n,r=null){Vn(e,t,7,[n,r])}var js=Qa(),Ms=0;function Ns(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||js,a={uid:Ms++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ne(!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:To(r,i),emitsOptions:oo(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=io.bind(null,a),e.ce&&e.ce(a),a}var Ps=null,Fs=()=>Ps||lr,Is,Ls;{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)}};Is=t(`__VUE_INSTANCE_SETTERS__`,e=>Ps=e),Ls=t(`__VUE_SSR_SETTERS__`,e=>Vs=e)}var Rs=e=>{let t=Ps;return Is(e),e.scope.on(),()=>{e.scope.off(),Is(t)}},zs=()=>{Ps&&Ps.scope.off(),Is(null)};function Bs(e){return e.vnode.shapeFlag&4}var Vs=!1;function Hs(e,t=!1,n=!1){t&&Ls(t);let{props:r,children:i}=e.vnode,a=Bs(e);bo(e,r,a,t),No(e,i,n||t);let o=a?Us(e,t):void 0;return t&&Ls(!1),o}function Us(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ba);let{setup:r}=n;if(r){tt();let n=e.setupContext=r.length>1?Zs(e):null,i=Rs(e),a=Bn(r,e,0,[e.props,n]),o=A(a);if(nt(),i(),(o||e.sp)&&!Fi(e)&&ai(e),o){if(a.then(zs,zs),t)return a.then(n=>{Ls(!0);try{Ws(e,n,t)}finally{Ls(!1)}}).catch(t=>{Hn(t,e,0)});e.asyncDep=a}else Ws(e,a,t)}else Ys(e,t)}function Ws(e,t,n){E(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:k(t)&&(e.setupState=hn(t)),Ys(e,n)}var Gs,Ks;function qs(e){Gs=e,Ks=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,xa))}}var Js=()=>!Gs;function Ys(e,t,n){let r=e.type;if(!e.render){if(!t&&Gs&&!r.render){let t=r.template||Ha(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=Gs(t,s)}}e.render=r.render||p,Ks&&Ks(e)}{let t=Rs(e);tt();try{Ra(e)}finally{nt(),t()}}}var Xs={get(e,t){return ft(e,`get`,``),e[t]}};function Zs(e){return{attrs:new Proxy(e.attrs,Xs),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Qs(e){return e.exposed?e.exposeProxy||=new Proxy(hn(an(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in va)return va[n](e)},has(e,t){return t in e||t in va}}):e.proxy}function $s(e,t=!0){return E(e)?e.displayName||e.name:e.name||t&&e.__name}function ec(e){return E(e)&&`__vccOpts`in e}var Q=(e,t)=>wn(e,t,Vs);function tc(e,t,n){try{ms(-1);let r=arguments.length;return r===2?k(t)&&!x(t)?gs(t)?X(e,null,[t]):X(e,t):X(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&gs(n)&&(n=[n]),X(e,t,n))}finally{ms(1)}}function nc(){}function rc(e,t,n,r){let i=n[r];if(i&&ic(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function ic(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 ps>0&&ds&&ds.push(e),!0}var ac=`3.5.41`,oc=p,sc=zn,cc=or,lc=cr,uc={createComponentInstance:Ns,setupComponent:Hs,renderComponentRoot:co,setCurrentRenderingInstance:dr,isVNode:gs,normalizeVNode:Es,getComponentPublicInstance:Qs,ensureValidVNode:ha,pushWarningContext:Fn,popWarningContext:In},dc=void 0,fc=typeof window<`u`&&window.trustedTypes;if(fc)try{dc=fc.createPolicy(`vue`,{createHTML:e=>e})}catch{}var pc=dc?e=>dc.createHTML(e):e=>e,mc=`http://www.w3.org/2000/svg`,hc=`http://www.w3.org/1998/Math/MathML`,gc=typeof document<`u`?document:null,_c=gc&&gc.createElement(`template`),vc={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`?gc.createElementNS(mc,e):t===`mathml`?gc.createElementNS(hc,e):n?gc.createElement(e,{is:n}):gc.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>gc.createTextNode(e),createComment:e=>gc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>gc.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{_c.innerHTML=pc(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=_c.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]}},yc=`transition`,bc=`animation`,xc=Symbol(`_vtc`),Sc={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},Cc=_({},qr,Sc),wc=(e=>(e.displayName=`Transition`,e.props=Cc,e))((e,{slots:t})=>tc(Zr,Dc(e),t)),Tc=(e,t=[])=>{x(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ec=e=>e?x(e)?e.some(e=>e.length>1):e.length>1:!1;function Dc(e){let t={};for(let n in e)n in Sc||(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=Oc(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,jc(e,t?u:s),jc(e,t?l:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,jc(e,d),jc(e,p),jc(e,f),t&&t()},O=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);Tc(i,[t,o]),Mc(()=>{jc(t,e?c:a),Ac(t,e?u:s),Ec(i)||Pc(t,r,h,o)})};return _(t,{onBeforeEnter(e){Tc(v,[e]),Ac(e,a),Ac(e,o)},onBeforeAppear(e){Tc(C,[e]),Ac(e,c),Ac(e,l)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);Ac(e,d),e._enterCancelled?(Ac(e,f),Rc(e)):(Rc(e),Ac(e,f)),Mc(()=>{e._isLeaving&&(jc(e,d),Ac(e,p),Ec(x)||Pc(e,r,g,n))}),Tc(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),Tc(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),Tc(T,[e])},onLeaveCancelled(e){D(e),Tc(S,[e])}})}function Oc(e){if(e==null)return null;if(k(e))return[kc(e.enter),kc(e.leave)];{let t=kc(e);return[t,t]}}function kc(e){return ue(e)}function Ac(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[xc]||(e[xc]=new Set)).add(t)}function jc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[xc];n&&(n.delete(t),n.size||(e[xc]=void 0))}function Mc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Nc=0;function Pc(e,t,n,r){let i=e._endId=++Nc,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Fc(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 Fc(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${yc}Delay`),a=r(`${yc}Duration`),o=Ic(i,a),s=r(`${bc}Delay`),c=r(`${bc}Duration`),l=Ic(s,c),u=null,d=0,f=0;t===yc?o>0&&(u=yc,d=o,f=a.length):t===bc?l>0&&(u=bc,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?yc:bc:null,f=u?u===yc?a.length:c.length:0);let p=u===yc&&/\b(?:transform|all)(?:,|$)/.test(r(`${yc}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Ic(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Lc(t)+Lc(e[n])))}function Lc(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Rc(e){return(e?e.ownerDocument:document).body.offsetHeight}function zc(e,t,n){let r=e[xc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Bc=Symbol(`_vod`),Vc=Symbol(`_vsh`),Hc={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Bc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Uc(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),Uc(e,!0),r.enter(e)):r.leave(e,()=>{Uc(e,!1)}):Uc(e,t))},beforeUnmount(e,{value:t}){Uc(e,t)}};function Uc(e,t){e.style.display=t?e[Bc]:`none`,e[Vc]=!t}function Wc(){Hc.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}var Gc=Symbol(``);function Kc(e){let t=Fs();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Jc(e,n))},r=()=>{let r=e(t.proxy);t.ce?Jc(t.ce,r):qc(t.subTree,r),n(r)};Zi(()=>{tr(r)}),Xi(()=>{Tr(r,p,{flush:`post`});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),ea(()=>e.disconnect())})}function qc(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{qc(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Jc(e.el,t);else if(e.type===os)e.children.forEach(e=>qc(e,t));else if(e.type===ls){let{el:n,anchor:r}=e;for(;n&&(Jc(n,t),n!==r);)n=n.nextSibling}}function Jc(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=je(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[Gc]=r}}var Yc=/(?:^|;)\s*display\s*:/;function Xc(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]??Qc(r,t,``)}else for(let e in t)n[e]??Qc(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Qc(r,i,``):nl(e,i,!D(t)&&t?t[i]:void 0,o)||Qc(r,i,o)}}else if(i){if(t!==n){let e=r[Gc];e&&(n+=`;`+e),r.cssText=n,a=Yc.test(n)}}else t&&e.removeAttribute(`style`);Bc in e&&(e[Bc]=a?r.display:``,e[Vc]&&(r.display=`none`))}var Zc=/\s*!important$/;function Qc(e,t,n){if(x(n))n.forEach(n=>Qc(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=tl(e,t);Zc.test(n)?e.setProperty(F(r),n.replace(Zc,``),`important`):e[r]=n}}var $c=[`Webkit`,`Moz`,`ms`],el={};function tl(e,t){let n=el[t];if(n)return n;let r=ae(t);if(r!==`filter`&&r in e)return el[t]=r;r=I(r);for(let n=0;n<$c.length;n++){let i=$c[n]+r;if(i in e)return el[t]=i}return t}function nl(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&D(r)&&n===r}var rl=`http://www.w3.org/1999/xlink`;function il(e,t,n,r,i,a=Se(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(rl,t.slice(6,t.length)):e.setAttributeNS(rl,t,n):n==null||a&&!Ce(n)?e.removeAttribute(t):e.setAttribute(t,a?``:O(n)?String(n):n)}function al(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?pc(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 ol(e,t,n,r){e.addEventListener(t,n,r)}function sl(e,t,n,r){e.removeEventListener(t,n,r)}var cl=Symbol(`_vei`);function ll(e,t,n,r,i=null){let a=e[cl]||(e[cl]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=fl(t);r?ol(e,n,a[t]=gl(r,i),s):o&&(sl(e,n,o,s),a[t]=void 0)}}var ul=/(Once|Passive|Capture)$/,dl=/^on:?(?:Once|Passive|Capture)$/;function fl(e){let t,n;for(;(n=e.match(ul))&&!dl.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 pl=0,ml=Promise.resolve(),hl=()=>pl||=(ml.then(()=>pl=0),Date.now());function gl(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&&Vn(e,t,5,a)}}else Vn(r,t,5,[e])};return n.value=e,n.attached=hl(),n}var _l=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,vl=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?zc(e,r,o):t===`style`?Xc(e,n,r):h(t)?g(t)||ll(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):yl(e,t,r,o))?(al(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&il(e,t,r,o,a,t!==`value`)):e._isVueCE&&(bl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!D(r)))?al(e,ae(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),il(e,t,r,o))};function yl(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&_l(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 _l(t)&&D(n)?!1:t in e}function bl(e,t){let n=e._def.props;if(!n)return!1;let r=ae(t);return Array.isArray(n)?n.some(e=>ae(e)===r):Object.keys(n).some(e=>ae(e)===r)}var xl={};function Sl(e,t,n){let r=W(e,t);ne(r)&&(r=_({},r,t));class i extends Tl{constructor(e){super(r,e,n)}}return i.def=r,i}var Cl=((e,t)=>Sl(e,t,gu)),wl=typeof HTMLElement<`u`?HTMLElement:class{},Tl=class e extends wl{constructor(e,t={},n=hu){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!==hu?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,Zn(()=>{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))[ae(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(ae))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):xl,r=ae(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===xl?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),pu(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 El(e){let t=Fs();return t&&t.ce||null}function Dl(){let e=El();return e&&e.shadowRoot}function Ol(e=`$style`){{let t=Fs();if(!t)return d;let n=t.type.__cssModules;return n&&n[e]||d}}var kl=new WeakMap,Al=new WeakMap,jl=Symbol(`_moveCb`),Ml=Symbol(`_enterCb`),Nl=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:_({},Cc,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Fs(),r=Gr(),i,a;return Qi(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!Rl(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(Pl),i.forEach(Fl);let r=i.filter(Il);Rc(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;Ac(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[jl]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[jl]=null,jc(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=rn(e),s=Dc(o),c=o.tag||os;if(i=[],a)for(let e=0;e<a.length;e++){let t=a[e];t.el&&t.el instanceof Element&&!t.el[Vc]&&(i.push(t),ni(t,$r(t,s,r,n)),kl.set(t,Ll(t.el)))}a=t.default?ri(t.default()):[];for(let e=0;e<a.length;e++){let t=a[e];t.key!=null&&ni(t,$r(t,s,r,n))}return X(c,null,a)}}});function Pl(e){let t=e.el;t[jl]&&t[jl](),t[Ml]&&t[Ml]()}function Fl(e){Al.set(e,Ll(e.el))}function Il(e){let t=kl.get(e),n=Al.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 Ll(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Rl(e,t,n){let r=e.cloneNode(),i=e[xc];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}=Fc(r);return a.removeChild(r),o}var zl=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return x(t)?e=>L(t,e):t};function Bl(e){e.target.composing=!0}function Vl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Hl=Symbol(`_assign`),Ul=Symbol(`_initialValue`);function Wl(e,t,n){return t&&(e=e.trim()),n&&(e=le(e)),e}var Gl={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Ul]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Ul]=e.defaultValue.replace(/\r\n?/g,`
|
|
4
|
-
`))),e[Hl]=zl(i);let a=r||i.props&&i.props.type===`number`;ol(e,t?`change`:`input`,t=>{t.target.composing||e[Hl](Wl(e.value,n,a))}),(n||a)&&ol(e,`change`,()=>{e.value=Wl(e.value,n,a)}),t||(ol(e,`compositionstart`,Bl),ol(e,`compositionend`,Vl),ol(e,`change`,Vl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Ul];delete e[Ul],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Hl](Wl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Hl]=zl(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)}},Kl={deep:!0,created(e,t,n){e[Hl]=zl(n),ol(e,`change`,()=>{let t=e._modelValue,n=Zl(e),r=e.checked,i=e[Hl];if(x(t)){let e=Ee(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(Ql(e,r))})},mounted:ql,beforeUpdate(e,t,n){e[Hl]=zl(n),ql(e,t,n)}};function ql(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(x(t))i=Ee(t,r.props.value)>-1;else if(C(t))i=t.has(r.props.value);else{if(t===n)return;i=Te(t,Ql(e,!0))}e.checked!==i&&(e.checked=i)}var Jl={created(e,{value:t},n){e.checked=Te(t,n.props.value),e[Hl]=zl(n),ol(e,`change`,()=>{e[Hl](Zl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Hl]=zl(r),t!==n&&(e.checked=Te(t,r.props.value))}},Yl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ol(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?le(Zl(e)):Zl(e));e[Hl](e.multiple?C(e._modelValue)?new Set(t):t:t[0]),e._assigning=!0,Zn(()=>{e._assigning=!1})}),e[Hl]=zl(r)},mounted(e,{value:t}){Xl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Hl]=zl(n)},updated(e,{value:t}){e._assigning||Xl(e,t)}};function Xl(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=Zl(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ee(t,o)>-1}else a.selected=t.has(o)}else if(Te(Zl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Zl(e){return`_value`in e?e._value:e.value}function Ql(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var $l={created(e,t,n){tu(e,t,n,null,`created`)},mounted(e,t,n){tu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){tu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){tu(e,t,n,r,`updated`)}};function eu(e,t){switch(e){case`SELECT`:return Yl;case`TEXTAREA`:return Gl;default:switch(t){case`checkbox`:return Kl;case`radio`:return Jl;default:return Gl}}}function tu(e,t,n,r,i){let a=eu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function nu(){Gl.getSSRProps=({value:e})=>({value:e}),Jl.getSSRProps=({value:e},t)=>{if(t.props&&Te(t.props.value,e))return{checked:!0}},Kl.getSSRProps=({value:e},t)=>{if(x(e)){if(t.props&&Ee(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}},$l.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=eu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var ru=[`ctrl`,`shift`,`alt`,`meta`],iu={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)=>ru.some(n=>e[`${n}Key`]&&!t.includes(n))},au=(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=iu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ou={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},su=(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||ou[e]===r))return e(n)}))},cu=_({patchProp:vl},vc),lu,uu=!1;function du(){return lu||=Io(cu)}function fu(){return lu=uu?lu:Lo(cu),uu=!0,lu}var pu=((...e)=>{du().render(...e)}),mu=((...e)=>{fu().hydrate(...e)}),hu=((...e)=>{let t=du().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=vu(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,_u(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),gu=((...e)=>{let t=fu().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=vu(e);if(t)return n(t,!0,_u(t))},t});function _u(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function vu(e){return D(e)?document.querySelector(e):e}var yu=!1,bu=()=>{yu||(yu=!0,nu(),Wc())},xu=s({BaseTransition:()=>Zr,BaseTransitionPropsValidators:()=>qr,Comment:()=>cs,DeprecationTypes:()=>null,EffectScope:()=>Ne,ErrorCodes:()=>Rn,ErrorTypeStrings:()=>sc,Fragment:()=>os,KeepAlive:()=>zi,ReactiveEffect:()=>Re,Static:()=>ls,Suspense:()=>Yo,Teleport:()=>Br,Text:()=>ss,TrackOpTypes:()=>Tn,Transition:()=>wc,TransitionGroup:()=>Nl,TriggerOpTypes:()=>En,VueElement:()=>Tl,assertNumber:()=>Ln,callWithAsyncErrorHandling:()=>Vn,callWithErrorHandling:()=>Bn,camelize:()=>ae,capitalize:()=>I,cloneVNode:()=>Cs,compatUtils:()=>null,compile:()=>Su,computed:()=>Q,createApp:()=>hu,createBlock:()=>J,createCommentVNode:()=>Z,createElementBlock:()=>q,createElementVNode:()=>Y,createHydrationRenderer:()=>Lo,createPropsRestProxy:()=>Fa,createRenderer:()=>Io,createSSRApp:()=>gu,createSlots:()=>ma,createStaticVNode:()=>Ts,createTextVNode:()=>ws,createVNode:()=>X,customRef:()=>_n,defineAsyncComponent:()=>Ii,defineComponent:()=>W,defineCustomElement:()=>Sl,defineEmits:()=>Ca,defineExpose:()=>wa,defineModel:()=>Da,defineOptions:()=>Ta,defineProps:()=>Sa,defineSSRCustomElement:()=>Cl,defineSlots:()=>Ea,devtools:()=>cc,effect:()=>Ze,effectScope:()=>Pe,getCurrentInstance:()=>Fs,getCurrentScope:()=>R,getCurrentWatcher:()=>An,getTransitionRawChildren:()=>ri,guardReactiveProps:()=>Ss,h:()=>tc,handleError:()=>Hn,hasInjectionContext:()=>yr,hydrate:()=>mu,hydrateOnIdle:()=>ki,hydrateOnInteraction:()=>Ni,hydrateOnMediaQuery:()=>Mi,hydrateOnVisible:()=>ji,initCustomFormatter:()=>nc,initDirectivesForSSR:()=>bu,inject:()=>vr,isMemoSame:()=>ic,isProxy:()=>nn,isReactive:()=>$t,isReadonly:()=>en,isRef:()=>cn,isRuntimeOnly:()=>Js,isShallow:()=>tn,isVNode:()=>gs,markRaw:()=>an,mergeDefaults:()=>Na,mergeModels:()=>Pa,mergeProps:()=>ks,nextTick:()=>Zn,nodeOps:()=>vc,normalizeClass:()=>ye,normalizeProps:()=>be,normalizeStyle:()=>me,onActivated:()=>Vi,onBeforeMount:()=>Yi,onBeforeUnmount:()=>$i,onBeforeUpdate:()=>Zi,onDeactivated:()=>Hi,onErrorCaptured:()=>ia,onMounted:()=>Xi,onRenderTracked:()=>ra,onRenderTriggered:()=>na,onScopeDispose:()=>Fe,onServerPrefetch:()=>ta,onUnmounted:()=>ea,onUpdated:()=>Qi,onWatcherCleanup:()=>jn,openBlock:()=>K,patchProp:()=>vl,popScopeId:()=>pr,provide:()=>_r,proxyRefs:()=>hn,pushScopeId:()=>fr,queuePostFlushCb:()=>tr,reactive:()=>Jt,readonly:()=>Xt,ref:()=>V,registerRuntimeCompiler:()=>qs,render:()=>pu,renderList:()=>pa,renderSlot:()=>G,resolveComponent:()=>sa,resolveDirective:()=>ua,resolveDynamicComponent:()=>la,resolveFilter:()=>null,resolveTransitionHooks:()=>$r,setBlockTracking:()=>ms,setDevtoolsHook:()=>lc,setTransitionHooks:()=>ni,shallowReactive:()=>Yt,shallowReadonly:()=>Zt,shallowRef:()=>ln,ssrContextKey:()=>br,ssrUtils:()=>uc,stop:()=>Qe,toDisplayString:()=>Oe,toHandlerKey:()=>oe,toHandlers:()=>ga,toRaw:()=>rn,toRef:()=>xn,toRefs:()=>vn,toValue:()=>pn,transformVNodeArgs:()=>vs,triggerRef:()=>fn,unref:()=>H,useAttrs:()=>Aa,useCssModule:()=>Ol,useCssVars:()=>Kc,useHost:()=>El,useId:()=>ii,useModel:()=>no,useSSRContext:()=>xr,useShadowRoot:()=>Dl,useSlots:()=>ka,useTemplateRef:()=>oi,useTransitionState:()=>Gr,vModelCheckbox:()=>Kl,vModelDynamic:()=>$l,vModelRadio:()=>Jl,vModelSelect:()=>Yl,vModelText:()=>Gl,vShow:()=>Hc,version:()=>ac,warn:()=>oc,watch:()=>Tr,watchEffect:()=>Sr,watchPostEffect:()=>Cr,watchSyncEffect:()=>wr,withAsyncContext:()=>Ia,withCtx:()=>U,withDefaults:()=>Oa,withDirectives:()=>hr,withKeys:()=>su,withMemo:()=>rc,withModifiers:()=>au,withScopeId:()=>mr}),Su=()=>{};function Cu(e,t){return R()?(Fe(e,t),!0):!1}function wu(e){let t=!1,n,r=Pe(!0);return((...i)=>(t||=(n=r.run(()=>e(...i)),!0),n))}var Tu=new WeakMap,Eu=(...e)=>{let t=e[0],n=Fs()?.proxy??R();if(n==null&&!yr())throw Error(`injectLocal must be called in setup`);return n&&Tu.has(n)&&t in Tu.get(n)?Tu.get(n)[t]:vr(...e)},Du=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Ou=e=>e!==void 0,ku=Object.prototype.toString,Au=e=>ku.call(e)===`[object Object]`,ju=()=>{},Mu=Nu();function Nu(){var e,t;return Du&&!!((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 Pu(...e){if(e.length!==1)return xn(...e);let t=e[0];return typeof t==`function`?Xt(_n(()=>({get:t,set:ju}))):V(t)}function Fu(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 Iu=e=>e();function Lu(e=Iu,t={}){let{initialState:n=`active`}=t,r=Pu(n===`active`);function i(){r.value=!1}function a(){r.value=!0}return{isActive:Zt(r),pause:i,resume:a,eventFilter:(...t)=>{r.value&&e(...t)}}}function Ru(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function zu(e){return Array.isArray(e)?e:[e]}function Bu(e){return e||Fs()}function Vu(e){if(!Du)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=Pe(!0),n=r.run(()=>e(...a))),Cu(i),n))}function Hu(e,t=1e4){return _n((n,r)=>{let i=pn(e),a,o=()=>setTimeout(()=>{i=pn(e),r()},pn(t));return Cu(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function Uu(e,t,n={}){let{eventFilter:r=Iu,...i}=n;return Tr(e,Fu(r,t),i)}function Wu(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=Lu(r,{initialState:i});return{stop:Uu(e,t,{...a,eventFilter:o}),pause:s,resume:c,isActive:l}}function Gu(e,t){Bu(t)&&$i(e,t)}function Ku(e,t=!0,n){Bu(n)?Xi(e,n):t?e():Zn(e)}function qu(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=null,o=ln(!1);function s(){a&&=(clearInterval(a),null)}function c(){o.value=!1,s()}function l(){let n=pn(t);n<=0||(o.value=!0,i&&e(),s(),o.value&&(a=setInterval(e,n)))}return r&&Du&&l(),(cn(t)||typeof t==`function`)&&Cu(Tr(t,()=>{o.value&&Du&&l()})),Cu(c),{isActive:Zt(o),pause:c,resume:l}}function Ju(e,t,n){return Tr(e,t,{...n,immediate:!0})}var Yu=Du?window:void 0;Du&&window.document,Du&&window.navigator,Du&&window.location;function Xu(e){let t=pn(e);return t?.$el??t}function Zu(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=Q(()=>{let t=zu(pn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return Ju(()=>[n.value?.map(e=>Xu(e))??[Yu].filter(e=>e!=null),zu(pn(n.value?e[1]:e[0])),zu(H(n.value?e[2]:e[1])),pn(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=Au(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 Qu(){let e=ln(!1),t=Fs();return t&&Xi(()=>{e.value=!0},t),e}function $u(e){let t=Qu();return Q(()=>(t.value,!!e()))}function ed(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function td(...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=Yu,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=ed(t);return Zu(i,a,e=>{e.repeat&&pn(s)||c(e)&&n(e)},o)}var nd=Symbol(`vueuse-ssr-width`);function rd(){let e=yr()?Eu(nd,null):null;return typeof e==`number`?e:void 0}function id(e,t={}){let{window:n=Yu,ssrWidth:r=rd()}=t,i=$u(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=ln(typeof r==`number`),o=ln(),s=ln(!1);return Sr(()=>{if(a.value){a.value=!i.value;let t=pn(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>=Ru(n[1])),i&&a&&(a=r<=Ru(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(pn(e)),s.value=o.value.matches)}),Zu(o,`change`,e=>{s.value=e.matches},{passive:!0}),Q(()=>s.value)}function ad(e){return JSON.parse(JSON.stringify(e))}var od=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},sd=`__vueuse_ssr_handlers__`,cd=ld();function ld(){return sd in od||(od[sd]=od[sd]||{}),od[sd]}function ud(e,t){return cd[e]||t}function dd(e){return id(`(prefers-color-scheme: dark)`,e)}function fd(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 pd={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()}},md=`vueuse-storage`;function hd(e,t,n,r={}){let{flush:i=`pre`,deep:a=!0,listenToStorageChanges:o=!0,writeDefaults:s=!0,mergeDefaults:c=!1,shallow:l,window:u=Yu,eventFilter:d,onError:f=e=>{console.error(e)},initOnMounted:p}=r,m=(l?ln:V)(typeof t==`function`?t():t),h=Q(()=>pn(e));if(!n)try{n=ud(`getDefaultStorage`,()=>Yu?.localStorage)()}catch(e){f(e)}if(!n)return m;let g=pn(t),_=fd(g),v=r.serializer??pd[_],{pause:y,resume:b}=Wu(m,e=>C(e),{flush:i,deep:a,eventFilter:d});Tr(h,()=>T(),{flush:i});let x=!1;u&&o&&(n instanceof Storage?Zu(u,`storage`,e=>{p&&!x||T(e)},{passive:!0}):Zu(u,md,e=>{p&&!x||E(e)})),p?Ku(()=>{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(md,{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?Zn(b):b()}}}}function E(e){T(e.detail)}return m}var gd=`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function _d(e={}){let{selector:t=`html`,attribute:n=`class`,initialValue:r=`auto`,window:i=Yu,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=dd({window:i}),p=Q(()=>f.value?`dark`:`light`),m=c||(o==null?Pu(r):hd(o,r,a,{window:i,listenToStorageChanges:s})),h=Q(()=>m.value===`auto`?p.value:m.value),g=ud(`updateHTMLAttrs`,(e,t,n)=>{let r=typeof e==`string`?i?.document.querySelector(e):Xu(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(gd)),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)}Tr(h,v,{flush:`post`,immediate:!0}),Ku(()=>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 vd(e={}){let{valueDark:t=`dark`,valueLight:n=``}=e,r=_d({...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 yd(e,t,n={}){let{window:r=Yu,...i}=n,a,o=$u(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=Tr(Q(()=>{let t=pn(e);return Array.isArray(t)?t.map(e=>Xu(e)):[Xu(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 Cu(l),{isSupported:o,stop:l}}function bd(e,t,n={}){let{window:r=Yu}=n;return hd(e,t,r?.localStorage,n)}function xd(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=Fs(),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):ad(e):e,g=()=>Ou(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 Tr(()=>e[t],e=>{r||(r=!0,n.value=h(e),Zn(()=>r=!1))}),Tr(n,n=>{!r&&(n!==e[t]||l)&&_(n)},{deep:l}),n}return Q({get(){return g()},set(e){_(e)}})}var Sd=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=Aa(),a=ka(),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},N=!1,ie=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&&!N&&(N=!0,Zn(()=>{M(),P({addedPane:o.value[t]}),L(`pane-add`,{pane:o.value[t]}),N=!1}))},ae=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),Zn(()=>{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}))})};Tr(()=>r.firstSplitter,()=>M()),Tr(()=>r.horizontal,e=>Zn(()=>{n(`direction-changed`,{horizontal:e,panes:o.value.map(e=>({min:e.min,max:e.max,size:e.size}))})})),Xi(()=>{j(),M(),P(),L(`ready`),u.value=!0}),$i(()=>u.value=!1);let ce=()=>{let{class:e,...t}=i;return tc(`div`,{ref:l,class:[p.value,e],...t},a.default?.())};return _r(`panes`,o),_r(`indexedPanes`,s),_r(`horizontal`,Q(()=>r.horizontal)),_r(`requestUpdate`,re),_r(`onPaneAdd`,ie),_r(`onPaneRemove`,ae),_r(`onPaneClick`,S),(e,t)=>(K(),J(la(ce)))}}),Cd={__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=vr(`requestUpdate`),r=vr(`onPaneAdd`),i=vr(`horizontal`),a=vr(`onPaneRemove`),o=vr(`onPaneClick`),s=Fs()?.uid,c=vr(`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 Tr(()=>d.value,e=>n({uid:s,size:e})),Tr(()=>f.value,e=>n({uid:s,min:e})),Tr(()=>p.value,e=>n({uid:s,max:e})),Xi(()=>{r({id:s,el:u.value,min:f.value,max:p.value,givenSize:t.size===void 0?null:d.value,size:d.value})}),$i(()=>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))}},wd=W({__name:`LayoutSplitPane`,props:{horizontal:{type:Boolean},storageKey:{}},setup(e){let t=e,n=t.storageKey?bd(t.storageKey,[]):V([]);function r(e){n.value=e.panes.map(e=>e.size)}return(t,i)=>(K(),J(H(Sd),{horizontal:e.horizontal,onResized:r},{default:U(()=>[G(t.$slots,`default`,{sizes:H(n)})]),_:3},8,[`horizontal`]))}}),Td=Symbol(`antfu-design-color-scheme`);function Ed(e){let t=xn(e);return _r(Td,t),t}function Dd(e){let t=vr(Td,void 0);return Q(()=>e?.()??t?.value??`light`)}var Od=[`top`,`right`,`bottom`,`left`],kd=[`start`,`end`],Ad=Od.reduce((e,t)=>e.concat(t,t+`-`+kd[0],t+`-`+kd[1]),[]),jd=Math.min,Md=Math.max,Nd=Math.round,Pd=Math.floor,Fd=e=>({x:e,y:e}),Id={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ld(e,t,n){return Md(e,jd(t,n))}function Rd(e,t){return typeof e==`function`?e(t):e}function zd(e){return e.split(`-`)[0]}function Bd(e){return e.split(`-`)[1]}function Vd(e){return e===`x`?`y`:`x`}function Hd(e){return e===`y`?`height`:`width`}function Ud(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Wd(e){return Vd(Ud(e))}function Gd(e,t,n){n===void 0&&(n=!1);let r=Bd(e),i=Wd(e),a=Hd(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ef(o)),[o,ef(o)]}function Kd(e){let t=ef(e);return[qd(e),t,qd(t)]}function qd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Jd=[`left`,`right`],Yd=[`right`,`left`],Xd=[`top`,`bottom`],Zd=[`bottom`,`top`];function Qd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Yd:Jd:t?Jd:Yd;case`left`:case`right`:return t?Xd:Zd;default:return[]}}function $d(e,t,n,r){let i=Bd(e),a=Qd(zd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(qd)))),a}function ef(e){let t=zd(e);return Id[t]+e.slice(t.length)}function tf(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function nf(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:tf(e)}function rf(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 af(e,t,n){let{reference:r,floating:i}=e,a=Ud(t),o=Wd(t),s=Hd(o),c=zd(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=Bd(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function of(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}=Rd(t,e),p=nf(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=rf(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=rf(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 sf=50,cf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:of},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=af(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<sf&&(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}=af(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},lf=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}=Rd(e,t)||{};if(l==null)return{};let d=nf(u),f={x:n,y:r},p=Wd(i),m=Hd(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=jd(d[_],T),D=jd(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ld(E,k,O),ee=!c.arrow&&Bd(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 uf(e,t,n){return(e?[...n.filter(t=>Bd(t)===e),...n.filter(t=>Bd(t)!==e)]:n.filter(e=>zd(e)===e)).filter(n=>!e||Bd(n)===e||(t?qd(n)!==n:!1))}var df=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=Ad,autoAlignment:u=!0,...d}=Rd(e,t),f=c!==void 0||l===Ad?uf(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=Gd(m,n,await(a.isRTL==null?void 0:a.isRTL(o.floating))),_=[h[zd(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=Bd(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,Bd(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}}}}},ff=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}=Rd(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=zd(r),_=Ud(o),v=zd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ef(o)]:Kd(o)),x=p!==`none`;!d&&x&&b.push(...$d(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=Gd(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`||_===Ud(t)||T.every(e=>Ud(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=Ud(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 pf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mf(e){return Od.some(t=>e[t]>=0)}var hf=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Rd(e,t);switch(i){case`referenceHidden`:{let e=pf(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:mf(e)}}}case`escaped`:{let e=pf(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:mf(e)}}}default:return{}}}}},gf=new Set([`left`,`top`]);async function _f(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=zd(n),s=Bd(n),c=Ud(n)===`y`,l=gf.has(o)?-1:1,u=a&&c?-1:1,d=Rd(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 vf=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 _f(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}}}}},yf=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}=Rd(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ud(i),p=Vd(f),m=u[p],h=u[f],g=(e,t)=>Ld(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}}}}}},bf=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}=Rd(e,t),u={x:n,y:r},d=Ud(i),f=Vd(d),p=u[f],m=u[d],h=Rd(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=gf.has(zd(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}}}},xf=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}=Rd(e,t),c=await i.detectOverflow(t,s),l=zd(n),u=Bd(n),d=Ud(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=jd(p-c[m],g),y=jd(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*Md(c.left,c.right):S=p-2*Md(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 Sf(e){return e.ownerDocument?.defaultView||window}function Cf(e){return Sf(e).getComputedStyle(e)}var wf=Math.min,Tf=Math.max,Ef=Math.round;function Df(e){let t=Cf(e),n=parseFloat(t.width),r=parseFloat(t.height),i=e.offsetWidth,a=e.offsetHeight,o=Ef(n)!==i||Ef(r)!==a;return o&&(n=i,r=a),{width:n,height:r,fallback:o}}function Of(e){return Nf(e)?(e.nodeName||``).toLowerCase():``}var kf;function Af(){if(kf)return kf;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(kf=e.brands.map((e=>e.brand+`/`+e.version)).join(` `),kf):navigator.userAgent}function jf(e){return e instanceof Sf(e).HTMLElement}function Mf(e){return e instanceof Sf(e).Element}function Nf(e){return e instanceof Sf(e).Node}function Pf(e){return typeof ShadowRoot>`u`?!1:e instanceof Sf(e).ShadowRoot||e instanceof ShadowRoot}function Ff(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Cf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function If(e){return[`table`,`td`,`th`].includes(Of(e))}function Lf(e){let t=/firefox/i.test(Af()),n=Cf(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 Rf(){return!/^((?!chrome|android).)*safari/i.test(Af())}function zf(e){return[`html`,`body`,`#document`].includes(Of(e))}function Bf(e){return Mf(e)?e:e.contextElement}var Vf={x:1,y:1};function Hf(e){let t=Bf(e);if(!jf(t))return Vf;let n=t.getBoundingClientRect(),{width:r,height:i,fallback:a}=Df(t),o=(a?Ef(n.width):n.width)/r,s=(a?Ef(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}function Uf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Bf(e),o=Vf;t&&(r?Mf(r)&&(o=Hf(r)):o=Hf(e));let s=a?Sf(a):window,c=!Rf()&&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=Sf(a),t=r&&Mf(r)?Sf(r):r,n=e.frameElement;for(;n&&r&&t!==e;){let e=Hf(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=Sf(n).frameElement}}return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l,x:l,y:u}}function Wf(e){return((Nf(e)?e.ownerDocument:e.document)||window.document).documentElement}function Gf(e){return Mf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Kf(e){return Uf(Wf(e)).left+Gf(e).scrollLeft}function qf(e){if(Of(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Pf(e)&&e.host||Wf(e);return Pf(t)?t.host:t}function Jf(e){let t=qf(e);return zf(t)?t.ownerDocument.body:jf(t)&&Ff(t)?t:Jf(t)}function Yf(e,t){t===void 0&&(t=[]);let n=Jf(e),r=n===e.ownerDocument?.body,i=Sf(n);return r?t.concat(i,i.visualViewport||[],Ff(n)?n:[]):t.concat(n,Yf(n))}function Xf(e,t,n){return t===`viewport`?rf(function(e,t){let n=Sf(e),r=Wf(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Rf();(e||!e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}(e,n)):Mf(t)?rf(function(e,t){let n=Uf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=jf(e)?Hf(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)):rf(function(e){let t=Wf(e),n=Gf(e),r=e.ownerDocument.body,i=Tf(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Tf(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Kf(e),s=-n.scrollTop;return Cf(r).direction===`rtl`&&(o+=Tf(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(Wf(e)))}function Zf(e){return jf(e)&&Cf(e).position!==`fixed`?e.offsetParent:null}function Qf(e){let t=Sf(e),n=Zf(e);for(;n&&If(n)&&Cf(n).position===`static`;)n=Zf(n);return n&&(Of(n)===`html`||Of(n)===`body`&&Cf(n).position===`static`&&!Lf(n))?t:n||function(e){let t=qf(e);for(;jf(t)&&!zf(t);){if(Lf(t))return t;t=qf(t)}return null}(e)||t}function $f(e,t,n){let r=jf(t),i=Wf(t),a=Uf(e,!0,n===`fixed`,t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&n!==`fixed`){if((Of(t)!==`body`||Ff(i))&&(o=Gf(t)),jf(t)){let e=Uf(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=Kf(i))}return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}var ep={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=Yf(e).filter((e=>Mf(e)&&Of(e)!==`body`)),i=null,a=Cf(e).position===`fixed`,o=a?qf(e):e;for(;Mf(o)&&!zf(o);){let e=Cf(o),t=Lf(o);(a?t||i:t||e.position!==`static`||!i||![`absolute`,`fixed`].includes(i.position))?i=e:r=r.filter((e=>e!==o)),o=qf(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=a[0],s=a.reduce(((e,n)=>{let r=Xf(t,n,i);return e.top=Tf(r.top,e.top),e.right=wf(r.right,e.right),e.bottom=wf(r.bottom,e.bottom),e.left=Tf(r.left,e.left),e}),Xf(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=jf(n),a=Wf(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`)&&((Of(n)!==`body`||Ff(a))&&(o=Gf(n)),jf(n))){let e=Uf(n);s=Hf(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:Mf,getDimensions:function(e){return jf(e)?Df(e):e.getBoundingClientRect()},getOffsetParent:Qf,getDocumentElement:Wf,getScale:Hf,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e,i=this.getOffsetParent||Qf,a=this.getDimensions;return{reference:$f(t,await i(n),r),floating:{x:0,y:0,...await a(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Cf(e).direction===`rtl`},tp=(e,t,n)=>{let r=new Map,i={platform:ep,...n},a={...i.platform,_c:r};return cf(e,t,{...i,platform:a})},np={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 rp(e,t){let n=np.themes[e]||{},r;do r=n[t],typeof r>`u`?n.$extend?n=np.themes[n.$extend]||{}:(n=null,r=np[t]):n=null;while(n);return r}function ip(e){let t=[e],n=np.themes[e]||{};do n.$extend&&!n.$resetCss?(t.push(n.$extend),n=np.themes[n.$extend]||{}):n=null;while(n);return t.map(e=>`v-popper--theme-${e}`)}function ap(e){let t=[e],n=np.themes[e]||{};do n.$extend?(t.push(n.$extend),n=np.themes[n.$extend]||{}):n=null;while(n);return t}var op=!1;if(typeof window<`u`){op=!1;try{let e=Object.defineProperty({},"passive",{get(){op=!0}});window.addEventListener(`test`,null,e)}catch{}}var sp=!1;typeof window<`u`&&typeof navigator<`u`&&(sp=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);var cp=[`auto`,`top`,`bottom`,`left`,`right`].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),lp={hover:`mouseenter`,focus:`focus`,click:`click`,touch:`touchstart`,pointer:`pointerdown`},up={hover:`mouseleave`,focus:`blur`,click:`click`,touch:`touchend`,pointer:`pointerup`};function dp(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}function fp(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}var pp=[],mp=null,hp={};function gp(e){let t=hp[e];return t||=hp[e]=[],t}var _p=function(){};typeof window<`u`&&(_p=window.Element);function vp(e){return function(t){return rp(t.theme,e)}}var yp=`__floating-vue__popper`,bp=()=>W({name:`VPopper`,provide(){return{[yp]:{parentPopper:this}}},inject:{[yp]:{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:vp(`disabled`)},positioningDisabled:{type:Boolean,default:vp(`positioningDisabled`)},placement:{type:String,default:vp(`placement`),validator:e=>cp.includes(e)},delay:{type:[String,Number,Object],default:vp(`delay`)},distance:{type:[Number,String],default:vp(`distance`)},skidding:{type:[Number,String],default:vp(`skidding`)},triggers:{type:Array,default:vp(`triggers`)},showTriggers:{type:[Array,Function],default:vp(`showTriggers`)},hideTriggers:{type:[Array,Function],default:vp(`hideTriggers`)},popperTriggers:{type:Array,default:vp(`popperTriggers`)},popperShowTriggers:{type:[Array,Function],default:vp(`popperShowTriggers`)},popperHideTriggers:{type:[Array,Function],default:vp(`popperHideTriggers`)},container:{type:[String,Object,_p,Boolean],default:vp(`container`)},boundary:{type:[String,_p],default:vp(`boundary`)},strategy:{type:String,validator:e=>[`absolute`,`fixed`].includes(e),default:vp(`strategy`)},autoHide:{type:[Boolean,Function],default:vp(`autoHide`)},handleResize:{type:Boolean,default:vp(`handleResize`)},instantMove:{type:Boolean,default:vp(`instantMove`)},eagerMount:{type:Boolean,default:vp(`eagerMount`)},popperClass:{type:[String,Array,Object],default:vp(`popperClass`)},computeTransformOrigin:{type:Boolean,default:vp(`computeTransformOrigin`)},autoMinSize:{type:Boolean,default:vp(`autoMinSize`)},autoSize:{type:[Boolean,String],default:vp(`autoSize`)},autoMaxSize:{type:Boolean,default:vp(`autoMaxSize`)},autoBoundaryMaxSize:{type:Boolean,default:vp(`autoBoundaryMaxSize`)},preventOverflow:{type:Boolean,default:vp(`preventOverflow`)},overflowPadding:{type:[Number,String],default:vp(`overflowPadding`)},arrowPadding:{type:[Number,String],default:vp(`arrowPadding`)},arrowOverflow:{type:Boolean,default:vp(`arrowOverflow`)},flip:{type:Boolean,default:vp(`flip`)},shift:{type:Boolean,default:vp(`shift`)},shiftCrossAxis:{type:Boolean,default:vp(`shiftCrossAxis`)},noAutoFocus:{type:Boolean,default:vp(`noAutoFocus`)},disposeTimeout:{type:Number,default:vp(`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[yp]?.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(vf({mainAxis:this.distance,crossAxis:this.skidding}));let t=this.placement.startsWith(`auto`);if(t?e.middleware.push(df({alignment:this.placement.split(`-`)[1]??``})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(yf({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(ff({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(lf({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(xf({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 tp(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),mp&&this.instantMove&&mp.instantMove&&mp!==this.parentPopper){mp.$_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&&(mp=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 fp(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...Yf(this.$_referenceNode),...Yf(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<pp.length;n++)t=pp[n],t.showGroup!==e&&(t.hide(),t.$emit(`close-group`))}pp.push(this),document.body.classList.add(`v-popper--some-open`);for(let e of ap(this.theme))gp(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 fp(),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,dp(pp,this),pp.length===0&&document.body.classList.remove(`v-popper--some-open`);for(let e of ap(this.theme)){let t=gp(e);dp(t,this),t.length===0&&document.body.classList.remove(`v-popper--some-open--${e}`)}mp===this&&(mp=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 fp(),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,lp,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],lp,this.popperTriggers,this.popperShowTriggers,e);let t=e=>{e.usedByTooltip||this.hide({event:e})};this.$_registerTriggerListeners(this.$_targetNodes,up,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],up,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,op?{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(kp>=e.left&&kp<=e.right&&Ap>=e.top&&Ap<=e.bottom){let e=this.$_popperNode.getBoundingClientRect(),t=kp-Dp,n=Ap-Op,r=e.left+e.width/2-Dp+(e.top+e.height/2)-Op+e.width+e.height,i=Dp+t*r,a=Op+n*r;return jp(Dp,Op,i,a,e.left,e.top,e.left,e.bottom)||jp(Dp,Op,i,a,e.left,e.top,e.right,e.top)||jp(Dp,Op,i,a,e.right,e.top,e.right,e.bottom)||jp(Dp,Op,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(sp){let e=!op||{passive:!0,capture:!0};document.addEventListener(`touchstart`,e=>xp(e,!0),e),document.addEventListener(`touchend`,e=>Sp(e,!0),e)}else window.addEventListener(`mousedown`,e=>xp(e,!1),!0),window.addEventListener(`click`,e=>Sp(e,!1),!0);window.addEventListener(`resize`,Ep)}function xp(e,t){if(np.autoHideOnMousedown)Cp(e,t);else for(let t=0;t<pp.length;t++){let n=pp[t];try{n.mouseDownContains=n.popperNode().contains(e.target)}catch{}}}function Sp(e,t){np.autoHideOnMousedown||Cp(e,t)}function Cp(e,t){let n={};for(let r=pp.length-1;r>=0;r--){let i=pp[r];try{let r=i.containsGlobalTarget=i.mouseDownContains||i.popperNode().contains(e.target);i.pendingHide=!1,requestAnimationFrame(()=>{if(i.pendingHide=!1,!n[i.randomId]&&wp(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&&wp(a,a.containsGlobalTarget,e);)a.$_handleGlobalClose(e,t),a=a.parentPopper}})}catch{}}}function wp(e,t,n){return n.closeAllPopover||n.closePopover&&t||Tp(e,n)&&!t}function Tp(e,t){if(typeof e.autoHide==`function`){let n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function Ep(){for(let e=0;e<pp.length;e++)pp[e].$_computePosition()}var Dp=0,Op=0,kp=0,Ap=0;typeof window<`u`&&window.addEventListener(`mousemove`,e=>{Dp=kp,Op=Ap,kp=e.clientX,Ap=e.clientY},op?{passive:!0}:void 0);function jp(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 Mp={extends:bp()},Np=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};function Pp(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(Ss(e.slotData)))],2)}var Fp=Np(Mp,[[`render`,Pp]]);function Ip(){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 Lp;function Rp(){Rp.init||(Rp.init=!0,Lp=Ip()!==-1)}var zp={name:`ResizeObserver`,props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:[`notify`],mounted(){Rp(),Zn(()=>{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`,Lp&&this.$el.appendChild(e),e.data=`about:blank`,Lp||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&&(!Lp&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener(`resize`,this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}},Bp=mr(`data-v-b329ee4c`);fr(`data-v-b329ee4c`);var Vp={class:`resize-observer`,tabindex:`-1`};pr(),zp.render=Bp((e,t,n,r,i,a)=>(K(),J(`div`,Vp))),zp.__scopeId=`data-v-b329ee4c`,zp.__file=`src/components/ResizeObserver.vue`;var Hp=(e=`theme`)=>({computed:{themeClass(){return ip(this[e])}}}),Up=W({name:`VPopperContent`,components:{ResizeObserver:zp},mixins:[Hp()],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}}}),Wp=[`id`,`aria-hidden`,`tabindex`,`data-popper-placement`],Gp={ref:`inner`,class:`v-popper__inner`},Kp=[Y(`div`,{class:`v-popper__arrow-outer`},null,-1),Y(`div`,{class:`v-popper__arrow-inner`},null,-1)];function qp(e,t,n,r,i,a){let o=sa(`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]||=su(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`,Gp,[e.mounted?(K(),q(os,{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)},Kp,4)],4)],46,Wp)}var Jp=Np(Up,[[`render`,qp]]),Yp={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)}}},Xp=function(){};typeof window<`u`&&(Xp=window.Element);var Zp=W({name:`VPopperWrapper`,components:{Popper:Fp,PopperContent:Jp},mixins:[Yp,Hp(`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,Xp,Boolean],default:void 0},boundary:{type:[String,Xp],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 Qp(e,t,n,r,i,a){let o=sa(`PopperContent`),s=sa(`Popper`);return K(),J(s,ks({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 $p=Np(Zp,[[`render`,Qp]]);({...$p}),{...$p},{...$p};var em=W({name:`VTooltipDirective`,components:{Popper:bp(),PopperContent:Jp},mixins:[Yp],inheritAttrs:!1,props:{theme:{type:String,default:`tooltip`},html:{type:Boolean,default:e=>rp(e.theme,`html`)},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>rp(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}}}),tm=[`innerHTML`],nm=[`textContent`];function rm(e,t,n,r,i,a){let o=sa(`PopperContent`),s=sa(`Popper`);return K(),J(s,ks({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,tm)):(K(),q(`div`,{key:1,textContent:Oe(e.finalContent)},null,8,nm))]),_: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 im=Np(em,[[`render`,rm]]),am=`v-popper--has-tooltip`;function om(e,t){let n=e.placement;if(!n&&t)for(let e of cp)t[e]&&(n=e);return n||=rp(e.theme||`tooltip`,`placement`),n}function sm(e,t,n){let r,i=typeof t;return r=i===`string`?{content:t}:t&&i===`object`?t:{content:!1},r.placement=om(r,n),r.targetNodes=()=>[e],r.referenceNode=()=>e,r}var cm,lm,um=0;function dm(){if(cm)return;lm=V([]),cm=hu({name:`VTooltipDirectiveApp`,setup(){return{directives:lm}},render(){return this.directives.map(e=>tc(im,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});let e=document.createElement(`div`);document.body.appendChild(e),cm.mount(e)}function fm(e,t,n){dm();let r=V(sm(e,t,n)),i=V(!1),a={id:um++,options:r,shown:i};return lm.value.push(a),e.classList&&e.classList.add(am),e.$_popper={options:r,item:a,show(){i.value=!0},hide(){i.value=!1}}}function pm(e){if(e.$_popper){let t=lm.value.indexOf(e.$_popper.item);t!==-1&&lm.value.splice(t,1),delete e.$_popper,delete e.$_popperOldShown,delete e.$_popperMountTarget}e.classList&&e.classList.remove(am)}function mm(e,{value:t,modifiers:n}){let r=sm(e,t,n);if(!r.content||rp(r.theme||`tooltip`,`disabled`))pm(e);else{let i;e.$_popper?(i=e.$_popper,i.options.value=r):i=fm(e,t,n),typeof t.shown<`u`&&t.shown!==e.$_popperOldShown&&(e.$_popperOldShown=t.shown,t.shown?i.show():i.hide())}}var hm={beforeMount:mm,updated:mm,beforeUnmount(e){pm(e)}},gm=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)=>hr((K(),J(la(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(hm),e.tooltip]])}});function _m(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 vm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ym(e,t,n=[0,0,0]){let r=vm(e,t[0]),i=vm(e,t[1]),a=vm(e,t[2]);return n[0]=r,n[1]=i,n[2]=a,n}function bm(e){return xm(e)===`string`}function xm(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function Sm(e,{precision:t=16,unit:n}){return Cm(e)?`none`:(e=+Tm(e,t),e+(n??``))}function Cm(e){return e===null}function wm(e){return Cm(e)?0:e}function Tm(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 Em(e,t,n){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*n}function Dm(e,t,n){return(n-e)/(t-e)}function Om(e,t,n){return!e||!t||e===t||e[0]===t[0]&&e[1]===t[1]||isNaN(n)||n===null?n:Em(t[0],t[1],Dm(e[0],e[1],n))}function km(e,t,n){return Math.max(Math.min(n,t),e)}function Am(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function jm(e,t){return Am(Math.abs(e)**t,e)}function Mm(e,t){return t===0?0:e/t}function Nm(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 Pm(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 Fm=Object.freeze({__proto__:null,bisectLeft:Nm,clamp:km,copySign:Am,interpolate:Em,interpolateInv:Dm,isInstance:Pm,isNone:Cm,isString:bm,mapRange:Om,multiplyMatrices:_m,multiply_v3_m3x3:ym,serializeNumber:Sm,skipNone:wm,spow:jm,toPrecision:Tm,type:xm,zdiv:Mm}),Im=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)})}},Lm={gamut_mapping:`css`,precision:5,deltaE:`76`,verbose:!0,warn:function(e){this.verbose&&globalThis?.console?.warn?.(e)}},Rm=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()),Om(t,n,e)}serialize(e,t){let n=this.type===`<percentage>`?this.percentageRange(100):this.computedRange,r=this.unit;return e=Om(this.coordRange,n,e),Sm(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 Pm(e,this)?e:new this(e,t)}},zm=Symbol(`instance`),Bm=class e{type;name;spaceCoords;coords;id;alpha;constructor(e,t=e.space){e[zm]=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=>Rm.get(e,n))}))}serializeCoords(e,t,n){return n=e.map((e,t)=>Rm.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(Cm(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||Pm(t,this)?t:t[zm]?t[zm]:new e(t,...n)}},Vm={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function Hm(e){return Array.isArray(e)?e:Vm[e]}function Um(e,t,n,r={}){if(e=Hm(e),t=Hm(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(Im.run(`chromatic-adaptation-start`,i),i.M||(i.W1===Vm.D65&&i.W2===Vm.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Vm.D50&&i.W2===Vm.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Im.run(`chromatic-adaptation-end`,i),i.M)return ym(i.XYZ,i.M);throw TypeError(`Only Bradford CAT with white points D50 and D65 supported for now.`)}function Wm(e,t){let n={str:String(e)?.trim(),options:t};if(Im.run(`parse-start`,n),n.color)return n.color;n.parsed=Jm(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=Zm.findFormat({name:t,id:l,type:`function`}),!a){let t,a=r in Zm.registry?r:i;if(a in Zm.registry){let n=Zm.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(`--`)&&Lm.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(`--`)&&Lm.warn(`${o.name} is a standard space and supported in the CSS spec. Use color(${a.id}) instead of prefixed color(${r}).`)}else a=Zm.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 Zm.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=Cm(r.alpha)?r.alpha:r.alpha===void 0?1:km(0,r.alpha,1),r}var Gm={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},Km={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp(`(${Object.keys(Gm).join(`|`)})$`),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function qm(e){let t={},n=e.match(Km.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*Gm[n]):Km.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 Jm(e){if(!e)return;e=e.trim();let t=e.match(Km.function);if(t){let e=[],n=[],r=!1,i=t[1].toLowerCase(),a=t[2].replace(Km.singleArgument,(t,a)=>{let{value:o,meta:s}=qm(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 Ym(e,t){if(Array.isArray(e))return e.map(e=>Ym(e,t));if(!e)throw TypeError(`Empty color reference`);bm(e)&&(e=Wm(e,t));let n=e.space||e.spaceId;return typeof n==`string`&&(e.space=Zm.get(n)),e.alpha===void 0&&(e.alpha=1),e}var Xm=75e-6,Zm=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=Hm(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:Qm(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Im.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=Xm}={}){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(Cm(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=Bm.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=Ym(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>Cm(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=Ym(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||Pm(t,this))return t;if(xm(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=Bm.get(r,e);return t!==r&&(e.formats[r.name]=t),t}}return null}static resolveCoord(t,n){let r=xm(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=xm(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 Qm(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}var $m=new Zm({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`]}),eh=class extends Zm{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=$m,e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??=t=>{let n=ym(t,e.toXYZ_M);return this.white!==this.base.white&&(n=Um(this.white,this.base.white,n)),n},e.fromBase??=t=>(t=Um(this.base.white,this.white,t),ym(t,e.fromXYZ_M))),e.referred??=`display`,super(e)}};function th(e,t={}){if(Array.isArray(e))return e.map(e=>th(e,t));let{cssProperty:n=`background-color`,element:r,...i}=t,a=null;try{return Ym(e,i)}catch(e){a=e}let{CSS:o,getComputedStyle:s}=globalThis;if(bm(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 Ym(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 nh(e,t){e=Ym(e);let n=Zm.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=>Tm(e,r))}function rh(e,t){if(e=Ym(e),t===`alpha`)return e.alpha??1;let{space:n,index:r}=Zm.resolveCoord(t,e.space);return nh(e,n)[r]}function ih(e,t,n,r){return e=Ym(e),Array.isArray(t)&&([t,n,r]=[e.space,t,n]),t=Zm.get(t),e.coords=t===e.space?n.slice():t.to(e.space,n),r!==void 0&&(e.alpha=r),e}ih.returns=`color`;function ah(e,t,n){if(e=Ym(e),arguments.length===2&&xm(arguments[1])===`object`){let t=arguments[1];for(let n in t)ah(e,n,t[n])}else if(typeof n==`function`&&(n=n(rh(e,t))),t===`alpha`)e.alpha=n;else{let{space:r,index:i}=Zm.resolveCoord(t,e.space),a=nh(e,r);a[i]=n,ih(e,r,a)}return e}ah.returns=`color`;var oh=new Zm({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:$m,fromBase:e=>Um($m.white,`D50`,e),toBase:e=>Um(`D50`,$m.white,e)}),sh=216/24389,ch=24/116,lh=24389/27,uh=Vm.D50,dh=new Zm({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:uh,base:oh,fromBase(e){let t=e.map((e,t)=>e/uh[t]).map(e=>e>sh?Math.cbrt(e):(lh*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]>ch?i[0]**3:(116*i[0]-16)/lh,e[0]>8?((e[0]+16)/116)**3:e[0]/lh,i[2]>ch?i[2]**3:(116*i[2]-16)/lh].map((e,t)=>e*uh[t])},formats:{lab:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function fh(e){return typeof e==`number`?(e%360+360)%360:e}function ph(e,t){let[n,r]=t,i=Cm(n),a=Cm(r);if(i&&a)return[n,r];if(i?n=r:a&&(r=n),e===`raw`)return t;n=fh(n),r=fh(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 mh=new Zm({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:dh,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:fh(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 Cm(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>`]}}}),hh=25**7,gh=Math.PI,_h=180/gh,vh=gh/180;function yh(e){let t=e*e;return t*t*t*e}function bh(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=Ym([e,t]);let[a,o,s]=dh.from(e),c=mh.from(dh,[a,o,s])[1],[l,u,d]=dh.from(t),f=mh.from(dh,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=yh((c+f)/2),m=.5*(1-Math.sqrt(p/(p+hh))),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*gh),b<0&&(b+=2*gh),y*=_h,b*=_h;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:Lm.warn(`the unthinkable has happened`);let D=2*Math.sqrt(v*_)*Math.sin(E*vh/2),O=(a+l)/2,k=(_+v)/2,A=yh(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)*vh),M+=.24*Math.cos(2*ee*vh),M+=.32*Math.cos((3*ee+6)*vh),M-=.2*Math.cos((4*ee-63)*vh);let re=1+.015*k*M,N=30*Math.exp(-1*((ee-275)/25)**2),ie=2*Math.sqrt(A/(A+hh)),ae=-1*Math.sin(2*N*vh)*ie,P=(x/(n*te))**2;return P+=(S/(r*ne))**2,P+=(D/(i*re))**2,P+=ae*(S/(r*ne))*(D/(i*re)),Math.sqrt(P)}var xh=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Sh=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Ch=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],wh=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Th=new Zm({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:$m,fromBase(e){let t=ym(e,xh);return t[0]=Math.cbrt(t[0]),t[1]=Math.cbrt(t[1]),t[2]=Math.cbrt(t[2]),ym(t,Ch,t)},toBase(e){let t=ym(e,wh);return t[0]**=3,t[1]**=3,t[2]**=3,ym(t,Sh,t)},formats:{oklab:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function Eh(e,t){[e,t]=Ym([e,t]);let[n,r,i]=Th.from(e),[a,o,s]=Th.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}var Dh=75e-6;function Oh(e,t,{epsilon:n=Dh}={}){e=Ym(e),t||=e.space,t=Zm.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function kh(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Ah(e,t,n=`lab`){n=Zm.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return Cm(t)||Cm(r)?e:e+(r-t)**2},0))}function jh(e,t){return Ah(e,t,`lab`)}var Mh=Math.PI/180;function Nh(e,t,{l:n=2,c:r=1}={}){[e,t]=Ym([e,t]);let[i,a,o]=dh.from(e),[,s,c]=mh.from(dh,[i,a,o]),[l,u,d]=dh.from(t),f=mh.from(dh,[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;Cm(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*Mh)):.36+Math.abs(.4*Math.cos((c+35)*Mh));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 Ph=203,Fh=new Zm({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:$m,fromBase(e){return e.map(e=>e*Ph)},toBase(e){return e.map(e=>e/Ph)}}),Ih=1.15,Lh=.66,Rh=2610/2**14,zh=2**14/2610,Bh=3424/4096,Vh=2413/128,Hh=2392/128,Uh=1.7*2523/32,Wh=32/(1.7*2523),Gh=-.56,Kh=16295499532821565e-27,qh=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],Jh=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Yh=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Xh=[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]],Zh=new Zm({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:Fh,fromBase(e){let[t,n,r]=e,[i,a,o]=ym(ym([Ih*t-.1499999999999999*r,Lh*n- -.33999999999999997*t,r],qh).map(function(e){return jm((Bh+Vh*jm(e/1e4,Rh))/(1+Hh*jm(e/1e4,Rh)),Uh)}),Yh);return[.43999999999999995*i/(1+Gh*i)-Kh,a,o]},toBase(e){let[t,n,r]=e,[i,a,o]=ym(ym([(t+Kh)/(.43999999999999995-Gh*(t+Kh)),n,r],Xh).map(function(e){return 1e4*jm((Bh-jm(e,Wh))/(Hh*jm(e,Wh)-Vh),zh)}),Jh),s=(i+.1499999999999999*o)/Ih;return[s,(a+-.33999999999999997*s)/Lh,o]},formats:{jzazbz:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),Qh=new Zm({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:Zh,fromBase:mh.fromBase,toBase:mh.toBase,formats:{jzczhz:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}});function $h(e,t){[e,t]=Ym([e,t]);let[n,r,i]=Qh.from(e),[a,o,s]=Qh.from(t),c=n-a,l=r-o;Cm(i)&&Cm(s)?(i=0,s=0):Cm(i)?i=s:Cm(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 eg=3424/4096,tg=2413/128,ng=2392/128,rg=2610/16384,ig=2523/32,ag=16384/2610,og=32/2523,sg=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],cg=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],lg=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],ug=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],dg=new Zm({id:`ictcp`,name:`ICTCP`,coords:{i:{refRange:[0,1],name:`I`},ct:{refRange:[-.5,.5],name:`CT`},cp:{refRange:[-.5,.5],name:`CP`}},base:Fh,fromBase(e){return fg(ym(e,sg))},toBase(e){return ym(pg(e),ug)},formats:{ictcp:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function fg(e){return ym(e.map(function(e){return((eg+tg*(e/1e4)**rg)/(1+ng*(e/1e4)**rg))**ig}),cg)}function pg(e){return ym(e,lg).map(function(e){return 1e4*(Math.max(e**og-eg,0)/(tg-ng*e**og))**ag})}function mg(e,t){[e,t]=Ym([e,t]);let[n,r,i]=dg.from(e),[a,o,s]=dg.from(t);return 720*Math.sqrt((n-a)**2+.25*(r-o)**2+(i-s)**2)}function hg(e,t){[e,t]=Ym([e,t]);let[n,r,i]=Th.from(e),[a,o,s]=Th.from(t),c=n-a,l=2*(r-o),u=2*(i-s);return Math.sqrt(c**2+l**2+u**2)}var gg=Vm.D65,_g=.42,vg=1/_g,yg=2*Math.PI,bg=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],xg=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],Sg=[[460,451,288],[460,-891,-261],[460,-220,-6300]],Cg={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},wg={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},Tg=180/Math.PI,Eg=Math.PI/180;function Dg(e,t){return e.map(e=>{let n=jm(t*Math.abs(e)*.01,_g);return 400*Am(n,e)/(n+27.13)})}function Og(e,t){let n=100/t*27.13**vg;return e.map(e=>{let t=Math.abs(e);return Am(n*jm(t/(400-t),vg),e)})}function kg(e){let t=fh(e);t<=wg.h[0]&&(t+=360);let n=Nm(wg.h,t)-1,[r,i]=wg.h.slice(n,n+2),[a,o]=wg.e.slice(n,n+2),s=wg.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function Ag(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=wg.h.slice(n,n+2),[a,o]=wg.e.slice(n,n+2);return fh((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function jg(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=ym(o,bg),l=Cg[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=>Em(1,s/e,f)),a.dRgbInv=a.dRgb.map(e=>1/e);let p=Dg(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 Mg=jg(gg,64/Math.PI*.2,20,`average`,!1);function Ng(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?Ag(e.H)*Eg:fh(e.h)*Eg;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=jm(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=jm(o*(1.64-.29**t.n)**-.73,10/9),c=.25*(Math.cos(n+2)+3.8),l=t.aW*jm(a,2/t.c/t.z),u=5e4/13*t.nc*t.ncb*c,d=l/t.nbb,f=23*(d+.305)*Mm(s,23*u+s*(11*r+108*i));return ym(Og(ym([d,f*r,f*i],Sg).map(e=>e*1/1403),t.fl).map((e,n)=>e*t.dRgbInv[n]),xg).map(e=>e/100)}function Pg(e,t){let n=Dg(ym(e.map(e=>e*100),bg).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)%yg+yg)%yg,o=.25*(Math.cos(a+2)+3.8),s=jm(5e4/13*t.nc*t.ncb*Mm(o*Math.sqrt(r**2+i**2),n[0]+n[1]+1.05*n[2]+.305),.9)*(1.64-.29**t.n)**.73,c=jm(t.nbb*(2*n[0]+n[1]+.05*n[2])/t.aW,.5*t.c*t.z),l=100*jm(c,2),u=4/t.c*c*(t.aW+4)*t.flRoot,d=s*c,f=d*t.flRoot,p=fh(a*Tg),m=kg(p);return{J:l,C:d,h:p,s:50*jm(t.c*s/(t.aW+4),1/2),Q:u,M:f,H:m}}var Fg=new Zm({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:$m,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let t=Pg(e,Mg),n=Math.abs(t.M)<this.ε;return[t.J,n?0:t.M,n?null:t.h]},toBase(e){return Ng({J:e[0],M:e[1],h:e[2]},Mg)}}),Ig=Vm.D65,Lg=216/24389,Rg=24389/27;function zg(e){return 116*(e>Lg?Math.cbrt(e):(Rg*e+16)/116)-16}function Bg(e){return e>8?((e+16)/116)**3:e/Rg}function Vg(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=Bg(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=Ng({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 Ng({J:o,C:r,h:n},t)}function Hg(e,t){let n=zg(e[1]);if(n===0)return[0,0,0];let r=Pg(e,Ug);return[fh(r.h),r.C,n]}var Ug=jg(Ig,200/Math.PI*Bg(50),Bg(50)*100,`average`,!1),Wg=new Zm({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:$m,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let t=Hg(e);return t[1]<this.ε&&(t[1]=0,t[0]=null),t},toBase(e){return Vg(e,Ug)},formats:{color:{id:`--hct`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Gg=Math.PI/180,Kg=[1,.007,.0228];function qg(e){e[1]<0&&(e=Wg.fromBase(Wg.toBase(e)));let t=Math.log(Math.max(1+Kg[2]*e[1]*Ug.flRoot,1))/Kg[2],n=e[0]*Gg,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function Jg(e,t){[e,t]=Ym([e,t]);let[n,r,i]=qg(Wg.from(e)),[a,o,s]=qg(Wg.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var Yg={deltaE76:jh,deltaECMC:Nh,deltaE2000:bh,deltaEJz:$h,deltaEITP:mg,deltaEOK:Eh,deltaEOK2:hg,deltaEHCT:Jg};function Xg(e){return Math.max(parseFloat(`1e${(e?Math.floor(Math.log10(Math.abs(e))):0)-2}`),1e-6)}var Zg={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 Qg(e,{method:t=Lm.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a=void 0}={}){if(e=Ym(e),bm(arguments[1])?n=arguments[1]:n||=e.space,n=Zm.get(n),Oh(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=e_(e,{space:n});else{if(t!==`clip`&&!Oh(e,n)){Object.prototype.hasOwnProperty.call(Zg,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=Zg[t]);let s=bh;if(r!==``){for(let e in Yg)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=Yg[e];break}}i===0&&(i=1e-16);let c=Qg(t_(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(a&&Object.keys(a).length===3){let t=Zm.resolveCoord(a.channel),n=rh(t_(e,t.space),t.id);if(Cm(n)&&(n=0),n>=a.max)return t_({space:`xyz-d65`,coords:Vm.D65},e.space);if(n<=a.min)return t_({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=Zm.resolveCoord(t),c=r.space,l=r.id,u=t_(e,c);u.coords.forEach((e,t)=>{Cm(e)&&(u.coords[t]=0)});let d=(r.range||r.refRange)[0],f=Xg(i),p=d,m=rh(u,l);for(;m-p>f;){let e=kh(u);e=Qg(e,{space:n,method:`clip`}),s(u,e)-i<f?p=rh(u,l):m=rh(u,l),ah(u,l,(p+m)/2)}o=t_(u,n)}else o=c}else o=t_(e,n);if(t===`clip`||!Oh(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=t_(o,e.space)),e.coords=o.coords,e}Qg.returns=`color`;var $g={WHITE:{space:Th,coords:[1,0,0],alpha:1},BLACK:{space:Th,coords:[0,0,0],alpha:1}};function e_(e,{space:t}={}){let n=.02,r=1e-4;e=Ym(e),t||=e.space,t=Zm.get(t);let i=Zm.get(`oklch`);if(t.isUnbounded)return t_(e,t);let a=t_(e,i),o=a.coords[0];if(o>=1){let n=t_($g.WHITE,t);return n.alpha=e.alpha,t_(n,t)}if(o<=0){let n=t_($g.BLACK,t);return n.alpha=e.alpha,t_(n,t)}if(Oh(a,t,{epsilon:0}))return t_(a,t);function s(e){let n=t_(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 km(n,e,i)}return e}),n}let c=0,l=a.coords[1],u=!0,d=kh(a),f=s(d),p=Eh(f,d);if(p<n)return f;for(;l-c>r;){let e=(c+l)/2;if(d.coords[1]=e,u&&Oh(d,t,{epsilon:0}))c=e;else if(f=s(d),p=Eh(f,d),p<n){if(n-p<r)break;u=!1,c=e}else l=e}return f}function t_(e,t,{inGamut:n}={}){e=Ym(e),t=Zm.get(t);let r=t.from(e),i={space:t,coords:r,alpha:e.alpha};return n&&(i=Qg(i,n===!0?void 0:n)),i}t_.returns=`color`;function n_(e,t={}){let{precision:n=Lm.precision,format:r,inGamut:i=!0,coords:a,alpha:o,commas:s}=t,c,l=Ym(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)??Zm.findFormat(u)),r||(r=l.space.getFormat(`default`)??Zm.DEFAULT_FORMAT,u=r.name),r&&r.space&&r.space!==l.space&&(l=t_(l,r.space));let f=l.coords.slice();if(i||=r.toGamut,i&&!Oh(l)&&(f=Qg(kh(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=Sm(i,{precision:n,unit:e})}p=`${s?`,`:` /`} ${i}`}c=`${e}(${t.join(s?`, `:` `)}${p})`}return c}var r_=new eh({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]]}),i_=new eh({id:`rec2020`,name:`REC.2020`,base:r_,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)})}}),a_=new eh({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]]}),o_=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],s_=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],c_=new eh({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,toXYZ_M:o_,fromXYZ_M:s_}),l_={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]},u_=[,,,].fill(`<percentage> | <number>[0, 255]`),d_=[,,,].fill(`<number>[0, 255]`),f_=new eh({id:`srgb`,name:`sRGB`,base:c_,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:u_},rgb_number:{name:`rgb`,commas:!0,coords:d_,alpha:!1},color:{},rgba:{coords:u_,commas:!0,alpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:d_},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=l_.black,t.alpha=0):t.coords=l_[e],t.coords)return t}}}}),p_=new eh({id:`p3`,cssId:`display-p3`,name:`P3`,base:a_,fromBase:f_.fromBase,toBase:f_.toBase});Lm.display_space=f_;var m_;if(typeof CSS<`u`&&CSS.supports)for(let e of[dh,i_,p_]){let t=n_({space:e,coords:e.getMinCoords(),alpha:1});if(CSS.supports(`color`,t)){Lm.display_space=e;break}}function h_(e,{space:t=Lm.display_space,...n}={}){e=Ym(e);let r=n_(e,n);if(typeof CSS>`u`||CSS.supports(`color`,r)||!Lm.display_space)r=new String(r),r.color=e;else{let i=e;if((e.coords.some(Cm)||Cm(e.alpha))&&!(m_??=CSS.supports(`color`,`hsl(none 50% 50%)`))&&(i=kh(e),i.coords=i.coords.map(wm),i.alpha=wm(i.alpha),r=n_(i,n),CSS.supports(`color`,r)))return r=new String(r),r.color=i,r;i=t_(i,t),r=new String(n_(i,n)),r.color=i}return r}function g_(e,t,{space:n,hue:r=`shorter`}={}){e=Ym(e),n||=e.space,n=Zm.get(n);let i=Object.values(n.coords);[e,t]=[e,t].map(e=>t_(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]=ph(r,[e,a])),__(e,a)}),c=__(e.alpha,t.alpha);return{space:n,coords:s,alpha:c}}function __(e,t){return Cm(e)||Cm(t)?e===t?null:0:e-t}function v_(e,t){return e=Ym(e),t=Ym(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}function y_(e){return rh(e,[$m,`y`])}function b_(e,t){ah(e,[$m,`y`],t)}function x_(e){Object.defineProperty(e.prototype,"luminance",{get(){return y_(this)},set(e){b_(this,e)}})}var S_=Object.freeze({__proto__:null,getLuminance:y_,register:x_,setLuminance:b_});function C_(e,t){e=Ym(e),t=Ym(t);let n=Math.max(y_(e),0),r=Math.max(y_(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}var w_=.56,T_=.57,E_=.62,D_=.65,O_=.022,k_=1.414,A_=.1,j_=5e-4,M_=1.14,N_=.027,P_=1.14;function F_(e){return e>=O_?e:e+(O_-e)**k_}function I_(e){return(e<0?-1:1)*Math.abs(e)**2.4}function L_(e,t){t=Ym(t),e=Ym(e);let n,r,i,a,o,s;t=t_(t,`srgb`),[a,o,s]=t.coords.map(e=>Cm(e)?0:e);let c=I_(a)*.2126729+I_(o)*.7151522+I_(s)*.072175;e=t_(e,`srgb`),[a,o,s]=e.coords.map(e=>Cm(e)?0:e);let l=I_(a)*.2126729+I_(o)*.7151522+I_(s)*.072175,u=F_(c),d=F_(l),f=d>u;return Math.abs(d-u)<j_?r=0:f?(n=d**w_-u**T_,r=n*M_):(n=d**D_-u**E_,r=n*P_),i=Math.abs(r)<A_?0:r>0?r-N_:r+N_,i*100}function R_(e,t){e=Ym(e),t=Ym(t);let n=Math.max(y_(e),0),r=Math.max(y_(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}var z_=5e4;function B_(e,t){e=Ym(e),t=Ym(t);let n=Math.max(y_(e),0),r=Math.max(y_(t),0);return r>n&&([n,r]=[r,n]),r===0?z_:(n-r)/r}function V_(e,t){e=Ym(e),t=Ym(t);let n=rh(e,[dh,`l`]),r=rh(t,[dh,`l`]);return Math.abs(n-r)}var H_=216/24389,U_=24/116,W_=24389/27,G_=Vm.D65,K_=new Zm({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:G_,base:$m,fromBase(e){let t=e.map((e,t)=>e/G_[t]).map(e=>e>H_?Math.cbrt(e):(W_*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]>U_?t[0]**3:(116*t[0]-16)/W_,e[0]>8?((e[0]+16)/116)**3:e[0]/W_,t[2]>U_?t[2]**3:(116*t[2]-16)/W_].map((e,t)=>e*G_[t])},formats:{"lab-d65":{coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),q_=5**.5*.5+.5;function J_(e,t){e=Ym(e),t=Ym(t);let n=rh(e,[K_,`l`]),r=rh(t,[K_,`l`]),i=Math.abs(n**+q_-r**+q_)**(1/q_)*Math.SQRT2-40;return i<7.5?0:i}var Y_=Object.freeze({__proto__:null,contrastAPCA:L_,contrastDeltaPhi:J_,contrastLstar:V_,contrastMichelson:R_,contrastWCAG21:C_,contrastWeber:B_});function X_(e,t,n){bm(n)&&(n={algorithm:n});let{algorithm:r,...i}=n||{};if(!r){let e=Object.keys(Y_).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}e=Ym(e),t=Ym(t);for(let n in Y_)if(`contrast`+r.toLowerCase()===n.toLowerCase())return Y_[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}function Z_(e){let[t,n,r]=nh(e,$m),i=t+15*n+3*r;return[4*t/i,9*n/i]}function Q_(e){let[t,n,r]=nh(e,$m),i=t+n+r;return[t/i,n/i]}function $_(e){Object.defineProperty(e.prototype,"uv",{get(){return Z_(this)}}),Object.defineProperty(e.prototype,"xy",{get(){return Q_(this)}})}var ev=Object.freeze({__proto__:null,register:$_,uv:Z_,xy:Q_});function tv(e,t,n={}){bm(n)&&(n={method:n});let{method:r=Lm.deltaE,...i}=n;for(let n in Yg)if(`deltae`+r.toLowerCase()===n.toLowerCase())return Yg[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}function nv(e,t=.25){return ah(e,[Zm.get(`oklch`,`lch`),`l`],e=>e*(1+t))}function rv(e,t=.25){return ah(e,[Zm.get(`oklch`,`lch`),`l`],e=>e*(1-t))}nv.returns=`color`,rv.returns=`color`;var iv=Object.freeze({__proto__:null,darken:rv,lighten:nv});function av(e,t,n,r={}){return[e,t]=[Ym(e),Ym(t)],xm(n)===`object`&&([n,r]=[.5,n]),sv(e,t,r)(n??.5)}function ov(e,t,n={}){let r;cv(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]=[Ym(e),Ym(t)],sv(e,t,c));let l=tv(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=tv(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,tv(o,n.color),tv(o,i.color)),d.splice(t,0,{p:a,color:r(a)}),t++}}}return d=d.map(e=>e.color),d}function sv(e,t,n={}){if(cv(e)){let[n,r]=[e,t];return sv(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=Ym(e),t=Ym(t),e=kh(e),t=kh(t);let s={colors:[e,t],options:n};if(r=r?Zm.get(r):Zm.registry[Lm.interpolationSpace]||e.space,i=i?Zm.get(i):r,e=t_(e,r),t=t_(t,r),e=Qg(e),t=Qg(t),r.coords.h&&r.coords.h.type===`angle`){let i=n.hue=n.hue||`shorter`,a=[r,`h`],[o,s]=[rh(e,a),rh(t,a)];Cm(o)&&!Cm(s)?o=s:Cm(s)&&!Cm(o)&&(s=o),[o,s]=ph(i,[o,s]),ah(e,a,o),ah(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 Em(e,i,n)}),c=Em(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=t_(l,i)),l},{rangeArgs:s})}function cv(e){return xm(e)===`function`&&!!e.rangeArgs}Lm.interpolationSpace=`lab`;function lv(e){e.defineFunction(`mix`,av,{returns:`color`}),e.defineFunction(`range`,sv,{returns:`function<color>`}),e.defineFunction(`steps`,ov,{returns:`array<color>`})}var uv=Object.freeze({__proto__:null,isRange:cv,mix:av,range:sv,register:lv,steps:ov}),dv=new Zm({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:f_,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}}}),fv=new Zm({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:f_,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>`]}}}),pv=new Zm({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:fv,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>`]}}}),mv=new eh({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]]}),hv=new eh({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:mv,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))}),gv=new eh({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:oh,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]]}),_v=1/512,vv=16/512,yv=new eh({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:gv,toBase(e){return e.map(e=>{let t=e<0?-1:1,n=e*t;return n<vv?e/16:t*n**1.8})},fromBase(e){return e.map(e=>{let t=e<0?-1:1,n=e*t;return n>=_v?t*n**(1/1.8):16*e})}}),bv=1.09929682680944,xv=.018053968510807,Sv=new eh({id:`--rec2020-oetf`,name:`REC.2020_Scene_Referred`,base:r_,referred:`scene`,toBase(e){return e.map(function(e){let t=e<0?-1:1,n=e*t;return n<xv*4.5?e/4.5:t*((n+bv-1)/bv)**(1/.45)})},fromBase(e){return e.map(function(e){let t=e<0?-1:1,n=e*t;return n>=xv?t*(bv*n**.45-.09929682680944008):4.5*e})}}),Cv=new Zm({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:Th,fromBase:mh.fromBase,toBase:mh.toBase,formats:{oklch:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),wv=2*Math.PI,Tv=[[4.076741636075958,-3.307711539258063,.2309699031821043],[-1.2684379732850315,2.609757349287688,-.341319376002657],[-.0041960761386756,-.7034186179359362,1.7076146940746117]],Ev=[[[-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]]],Dv=Number.MAX_VALUE,Ov=.206,kv=.03,Av=1.206/1.03;function jv(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 Mv(e){return .5*(Av*e-Ov+Math.sqrt((Av*e-Ov)*(Av*e-Ov)+4*kv*Av*e))}function Nv(e){return(e**2+Ov*e)/(Av*(e+kv))}function Pv(e){let[t,n]=e;return[n/t,n/(1-t)]}function Fv(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 Iv(e,t){let n=ym(e,wh);return n[0]**=3,n[1]**=3,n[2]**=3,ym(n,t,n)}function Lv(e,t,n,r){let i=Bv(e,t,n,r),a=Iv([1,i*e,i*t],n),o=jm(1/Math.max(...a),1/3);return[o,o*i]}function Rv(e,t,n,r,i,a,o,s){let c;if(s===void 0&&(s=Lv(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=jv(wh[0].slice(1),[e,t]),d=jv(wh[1].slice(1),[e,t]),f=jv(wh[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=jv(a[0],[x,S,C])-1,ee=jv(a[0],[w,T,E]),j=jv(a[0],[D,O,k]),te=ee/(ee*ee-.5*A*j),ne=-A*te,M=jv(a[1],[x,S,C])-1,re=jv(a[1],[w,T,E]),N=jv(a[1],[D,O,k]),ie=re/(re*re-.5*M*N),ae=-M*ie,P=jv(a[2],[x,S,C])-1,F=jv(a[2],[w,T,E]),I=jv(a[2],[D,O,k]),oe=F/(F*F-.5*P*I),se=-P*oe;ne=te>=0?ne:Dv,ae=ie>=0?ae:Dv,se=oe>=0?se:Dv,c+=Math.min(ne,Math.min(ae,se))}return c}function zv(e,t,n){let[r,i,a]=e,o=Lv(i,a,t,n),s=Rv(i,a,r,1,r,t,n,o),c=Pv(o),l=s/Math.min(r*c[0],(1-r)*c[1]),u=Fv(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 Bv(e,t,n,r){let i,a,o,s,c,l,u,d;jv(r[0][0],[e,t])>1?([i,a,o,s,c]=r[0][1],[l,u,d]=n[0]):jv(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=jv(wh[0].slice(1),[e,t]),m=jv(wh[1].slice(1),[e,t]),h=jv(wh[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 Vv(e,t,n){let[r,i,a]=e,o=Nv(a),s=null,c=null;if(r=fh(r)/360,o!==0&&o!==1&&i!==0){let e=Math.cos(wv*r),a=Math.sin(wv*r),[l,u,d]=zv([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 Hv(e,t,n){let r=e[0],i=0,a=Mv(r),o=Math.sqrt(e[1]**2+e[2]**2),s=.5+Math.atan2(-e[2],-e[1])/wv;if(a!==0&&a!==1&&o!==0){let[a,s,c]=zv([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=fh(s*360),[s,i,a]}var Uv=new Zm({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:Th,gamutSpace:`self`,fromBase(e){return Hv(e,Tv,Ev)},toBase(e){return Vv(e,Tv,Ev)},formats:{color:{id:`--okhsl`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Wv=new Zm({id:`oklrab`,name:`Oklrab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:Th,fromBase(e){return[Mv(e[0]),e[1],e[2]]},toBase(e){return[Nv(e[0]),e[1],e[2]]},formats:{color:{coords:[`<percentage> | <number>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}}),Gv=new Zm({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:Wv,fromBase:mh.fromBase,toBase:mh.toBase,formats:{color:{coords:[`<percentage> | <number>`,`<number> | <percentage>[0,1]`,`<number> | <angle>`]}}});function Kv(e,t,n){let[r,i,a]=e;r=fh(r)/360;let o=Nv(a),s=null,c=null;if(o!==0&&i!==0){let e=Math.cos(wv*r),l=Math.sin(wv*r),[u,d]=Pv(Lv(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,_=Nv(m),v=h*_/m,y=Nv(o);g=g*y/o,o=y;let[b,x,S]=Iv([_,e*v,l*v],t),C=jm(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 qv(e,t,n){let r=e[0],i=0,a=Mv(r),o=Math.sqrt(e[1]**2+e[2]**2),s=.5+Math.atan2(-e[2],-e[1])/wv;if(r!==0&&r!==1&&o!==0){let s=e[1]/o,c=e[2]/o,[l,u]=Pv(Lv(s,c,t,n)),d=.5,f=1-d/l,p=u/(o+r*u),m=p*r,h=p*o,g=Nv(m),_=h*g/m,[v,y,b]=Iv([g,s*_,c*_],t),x=jm(1/Math.max(Math.max(v,y),Math.max(b,0)),1/3);r/=x,o/=x,o=o*Mv(r)/r,r=Mv(r),a=r/m,i=(d+u)*h/(u*d+u*f*h)}return s=Math.abs(i)<1e-4||a===0?null:fh(s*360),[s,i,a]}var Jv=new Zm({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:Th,gamutSpace:`self`,fromBase(e){return qv(e,Tv,Ev)},toBase(e){return Kv(e,Tv,Ev)},formats:{color:{id:`--okhsv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Yv=Vm.D65,Xv=216/24389,Zv=24389/27,[Qv,$v]=Z_({space:$m,coords:Yv}),ey=new Zm({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:Yv,base:$m,fromBase(e){let t=[wm(e[0]),wm(e[1]),wm(e[2])],n=t[1],[r,i]=Z_({space:$m,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=Xv?Zv*n:116*Math.cbrt(n)-16;return[a,13*a*(r-Qv),13*a*(i-$v)]},toBase(e){let[t,n,r]=e;if(t===0||Cm(t))return[0,0,0];n=wm(n),r=wm(r);let i=n/(13*t)+Qv,a=r/(13*t)+$v,o=t<=8?t/Zv:((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>`]}}}),ty=new Zm({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:ey,fromBase:mh.fromBase,toBase:mh.toBase,formats:{color:{id:`--lchuv`,coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),ny=216/24389,ry=24389/27,iy=s_[0][0],ay=s_[0][1],oy=s_[0][2],sy=s_[1][0],cy=s_[1][1],ly=s_[1][2],uy=s_[2][0],dy=s_[2][1],fy=s_[2][2];function py(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function my(e){let t=(e+16)**3/1560896,n=t>ny?t:e/ry,r=n*(284517*iy-94839*oy),i=n*(838422*oy+769860*ay+731718*iy),a=n*(632260*oy-126452*ay),o=n*(284517*sy-94839*ly),s=n*(838422*ly+769860*cy+731718*sy),c=n*(632260*ly-126452*cy),l=n*(284517*uy-94839*fy),u=n*(838422*fy+769860*dy+731718*uy),d=n*(632260*fy-126452*dy);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 hy(e,t){let n=t/360*Math.PI*2,r=py(e.r0s,e.r0i,n),i=py(e.r1s,e.r1i,n),a=py(e.g0s,e.g0i,n),o=py(e.g1s,e.g1i,n),s=py(e.b0s,e.b0i,n),c=py(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var gy=new Zm({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:ty,gamutSpace:f_,fromBase(e){let[t,n,r]=[wm(e[0]),wm(e[1]),wm(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/hy(my(t),r)*100,[r,i,t]},toBase(e){let[t,n,r]=[wm(e[0]),wm(e[1]),wm(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=hy(my(r),t)/100*n,[r,i,t]},formats:{color:{id:`--hsluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}});s_[0][0],s_[0][1],s_[0][2],s_[1][0],s_[1][1],s_[1][2],s_[2][0],s_[2][1],s_[2][2];function _y(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function vy(e){let t=_y(e.r0s,e.r0i),n=_y(e.r1s,e.r1i),r=_y(e.g0s,e.g0i),i=_y(e.g1s,e.g1i),a=_y(e.b0s,e.b0i),o=_y(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var yy=new Zm({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:ty,gamutSpace:`self`,fromBase(e){let[t,n,r]=[wm(e[0]),wm(e[1]),wm(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/vy(my(t))*100,[r,i,t]},toBase(e){let[t,n,r]=[wm(e[0]),wm(e[1]),wm(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=vy(my(r))/100*n,[r,i,t]},formats:{color:{id:`--hpluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),by=new eh({id:`rec2100-linear`,name:`Linear REC.2100`,white:`D65`,toBase:r_.toBase,fromBase:r_.fromBase}),xy=203,Sy=2610/2**14,Cy=2**14/2610,wy=2523/32,Ty=32/2523,Ey=3424/4096,Dy=2413/128,Oy=2392/128,ky=new eh({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:by,toBase(e){return e.map(function(e){return(Math.max(e**Ty-Ey,0)/(Dy-Oy*e**Ty))**Cy*1e4/xy})},fromBase(e){return e.map(function(e){let t=Math.max(e*xy/1e4,0);return((Ey+Dy*t**Sy)/(1+Oy*t**Sy))**wy})}}),Ay=.17883277,jy=.28466892,My=.55991073,Ny=3.7743,Py=new eh({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:by,toBase(e){return e.map(function(e){return e<=.5?e**2/3*Ny:(Math.exp((e-My)/Ay)+jy)/12*Ny})},fromBase(e){return e.map(function(e){return e/=Ny,e<=1/12?jm(3*e,.5):Ay*Math.log(12*e-jy)+My})}}),Fy={};Im.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=Ly(e.W1,e.W2,e.options.method))}),Im.add(`chromatic-adaptation-end`,e=>{e.M||=Ly(e.W1,e.W2,e.options.method)});function Iy({id:e,toCone_M:t,fromCone_M:n}){Fy[e]=arguments[0]}function Ly(e,t,n=`Bradford`){let r=Fy[n],[i,a,o]=_m(r.toCone_M,e),[s,c,l]=_m(r.toCone_M,t),u=_m([[s/i,0,0],[0,c/a,0],[0,0,l/o]],r.toCone_M);return _m(r.fromCone_M,u)}Iy({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]]}),Iy({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]]}),Iy({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]]}),Iy({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(Vm,{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]}),Vm.ACES=[.32168/.33767,1,.34065/.33767];var Ry=new eh({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:Vm.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]]}),zy=2**-16,By=-.35828683,Vy=(Math.log2(65504)+9.72)/17.52,Hy=new eh({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[By,Vy],name:`Red`},g:{range:[By,Vy],name:`Green`},b:{range:[By,Vy],name:`Blue`}},referred:`scene`,base:Ry,toBase(e){return e.map(function(e){return e<=-.3013698630136986?(2**(e*17.52-9.72)-zy)*2:e<Vy?2**(e*17.52-9.72):65504})},fromBase(e){return e.map(function(e){return e<=0?(Math.log2(zy)+9.72)/17.52:e<zy?(Math.log2(zy+e*.5)+9.72)/17.52:(Math.log2(e)+9.72)/17.52})}}),Uy=Object.freeze({__proto__:null,A98RGB:hv,A98RGB_Linear:mv,ACEScc:Hy,ACEScg:Ry,CAM16_JMh:Fg,HCT:Wg,HPLuv:yy,HSL:dv,HSLuv:gy,HSV:fv,HWB:pv,ICTCP:dg,JzCzHz:Qh,Jzazbz:Zh,LCH:mh,LCHuv:ty,Lab:dh,Lab_D65:K_,Luv:ey,OKLCH:Cv,OKLab:Th,OKLrCH:Gv,OKLrab:Wv,Okhsl:Uv,Okhsv:Jv,P3:p_,P3_Linear:a_,ProPhoto:yv,ProPhoto_Linear:gv,REC_2020:i_,REC_2020_Linear:r_,REC_2020_Scene_Referred:Sv,REC_2100_HLG:Py,REC_2100_Linear:by,REC_2100_PQ:ky,XYZ_ABS_D65:Fh,XYZ_D50:oh,XYZ_D65:$m,sRGB:f_,sRGB_Linear:c_}),Wy=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=Ym(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:Zm.get(n),writable:!1,enumerable:!0,configurable:!0}),this.coords=r?r.slice():[0,0,0],this.alpha=Cm(i)?i:i===void 0?1:km(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=h_(this,...t);return n.color=new e(n.color),n}static get(t,...n){return Pm(t,this)?t:new e(t,...n)}static try(t,n){if(Pm(t,this))return t;let r=th(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])}};Wy.defineFunctions({get:rh,getAll:nh,set:ah,setAll:ih,to:t_,equals:v_,inGamut:Oh,toGamut:Qg,distance:Ah,deltas:g_,toString:n_}),Object.assign(Wy,{util:Fm,hooks:Im,WHITES:Vm,Space:Zm,spaces:Zm.registry,parse:Wm,defaults:Lm});for(let e of Object.keys(Uy))Zm.register(Uy[e]);for(let e in Zm.registry)Gy(e,Zm.registry[e]);Im.add(`colorspace-init-end`,e=>{Gy(e.id,e),e.aliases?.forEach(t=>{Gy(t,e)})});function Gy(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty(Wy.prototype,n,{get(){let n=this.getAll(e);if(typeof Proxy>`u`)return n;let r=new Proxy(n,{has:(e,n)=>{try{return Zm.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}=Zm.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}=Zm.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})}Wy.extend(Yg),Wy.extend({deltaE:tv}),Object.assign(Wy,{deltaEMethods:Yg}),Wy.extend(iv),Wy.extend({contrast:X_}),Wy.extend(ev),Wy.extend(S_),Wy.extend(uv),Wy.extend(Y_);function Ky(e,t=1,n=!1){return`hsla(${e}, ${n?50:65}%, ${n?60:40}%, ${t})`}function qy(e,t=1,n=!1){let r=0;for(let t=0;t<e.length;t++)r=e.charCodeAt(t)+((r<<5)-r);return Ky((r%360+360)%360,t,n)}var Jy=[`vite-plugin-`,`rollup-plugin-`,`webpack-plugin-`,`unplugin-`,`nuxt-`,`eslint-plugin-`,`postcss-`,`vite:`,`rollup:`,`rolldown:`,`webpack:`,`__`];function Yy(e){let t=e.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`);return RegExp(`^(?:@[^/]+\\/)?(?:${t})`)}Yy(Jy);function Xy(e,t){let[n,r,i]=new Wy(e).to(`srgb`).coords.map(e=>Math.round(Math.max(0,Math.min(1,e??0))*255));return`rgba(${n}, ${r}, ${i}, ${t})`}var Zy=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=Dd(()=>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 Ky(e,1,i.value);if(typeof e==`string`&&n(e))return e;if(e===!0&&r)return qy(r,1,i.value)}),s=Q(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return Ky(e,t.variant===`solid`?1:.12,i.value);if(typeof e==`string`&&n(e))return t.variant===`solid`?e:Xy(e,.12);if(e===!0&&r)return qy(r,t.variant===`solid`?1:.12,i.value)}),c=Q(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return Ky(e,.2,i.value);if(typeof e==`string`&&n(e))return t.variant===`solid`?e:Xy(e,.2);if(e===!0&&r)return qy(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(la(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`,{},()=>[ws(Oe(e.text),1)])]),_:3},8,[`class`,`style`]))}}),Qy={key:0,class:`flex-1 min-w-0`},$y={key:1,class:`flex gap-1 items-center`},eb=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`,Qy,[G(t.$slots,`search`)])):Z(``,!0),t.$slots.end?(K(),q(`div`,$y,[G(t.$slots,`end`)])):Z(``,!0)],2))}});function tb(...e){return e.filter(Boolean).join(` `)}var nb={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 rb(e,t){if(e===`connected`)return null;let n=nb[e];return{label:n.label,dot:tb(`inline-block size-1.5 rounded-full shrink-0`,n.dot),class:tb(`flex items-center gap-1.5 shrink-0 text-xs color-muted select-none`,t)}}var ib={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`}},ab=`__connection.json`,ob=`__DEVFRAME_CONNECTION__`,sb=`x-birpc-session`,cb=`__rpc-dump/index.json`,lb=`devframe:services`,ub=`devframe_otp`,db=`devframe_auth_token`;ib.postMessage.remoteAssetsError;function fb(e){return typeof e==`string`?`'${e}'`:new gb().serialize(e)}var pb=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,mb=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[pb.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function hb(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&&mb[n]?mb[n]:n+128,s=a<128&&mb[a]?mb[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 gb=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?hb(e,t):n===`number`&&r===`number`?e-t:hb(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(hb),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 _b(e,t){return e===t||fb(e)===fb(t)}var vb=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],yb=[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],bb=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,xb=[],Sb=class{_data=new Cb;_hash=new Cb([...vb]);_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)xb[n]=e[t+n]|0;else{let e=xb[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=xb[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;xb[n]=t+xb[n-7]+i+xb[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+yb[n]+xb[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=Cb.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 Cb(t,i)}},Cb=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(bb.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 wb(e){return new Sb().finalize(e).toBase64()}function Tb(e){return wb(fb(e))}function Eb(e){return Tb(e)}var Db=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>Eb(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 Ob(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 kb={blue:Ob(34,39),cyan:Ob(36,39),gray:Ob(90,39),green:Ob(32,39),red:Ob(31,39),yellow:Ob(33,39),bold:Ob(1,22),dim:Ob(2,22),reset:Ob(0,0),underline:Ob(4,24)};function Ab(e,...t){return typeof e==`function`?e(...t):e}var jb=Error.captureStackTrace,Mb=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,jb?.(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 Nb(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}function Pb(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||Nb(r,i),s=(e={},n={})=>{let r=new Mb({code:i,why:Ab(a.why,e),fix:Ab(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 Fb(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 Ib=Fb(kb);function Lb(e,{method:t=`warn`}={}){console[t](Ib(e))}function Rb(e){return Pb({...e,reporters:[Lb,...e.reporters??[]]})}var zb=Rb({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 Bb(e,t){let n=e[`~standard`].validate(t);return n instanceof Promise?await n:n}function Vb(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 Hb(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 Bb(i,n[r]);if(a.issues)throw zb.DF0043({name:e,index:r,issues:Vb(a.issues)})}return r}async function Ub(e,t,n){if(!t)return n;let r=await Bb(t,n);if(r.issues)throw zb.DF0044({name:e,issues:Vb(r.issues)});return n}async function Wb(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 Gb(e,t){let n=e.handler;if(!n){let r=await Wb(e,t);if(!r.handler)throw zb.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 Hb(e.name,r,t),o=await a(...n);return await Ub(e.name,i,o)}}var Kb=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 Gb(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 zb.DF0021({name:e.name});qb(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 zb.DF0022({name:e.name});qb(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 Gb(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw zb.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 qb(e){if(e.agent&&e.jsonSerializable!==!0)throw zb.DF0019({name:e.name})}function Jb(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 Yb(t,`undefined`,r,e);return n}if(i===null)return n;if(typeof i==`bigint`)throw Yb(t,`BigInt`,r,e);if(typeof i==`object`){if(i instanceof Map)throw Yb(t,`Map`,r,e);if(i instanceof Set)throw Yb(t,`Set`,r,e);if(i instanceof Date)throw Yb(t,`Date`,r,e);if(Array.isArray(i))return n;let a=Object.getPrototypeOf(i);if(a!==null&&a!==Object.prototype)throw Yb(t,i.constructor?.name??`class instance`,r,e)}return n})}function Yb(e,t,n,r){let i=Xb(n,r);return zb.DF0020({name:e||`<anonymous>`,type:t,path:i})}function Xb(e,t){return Array.isArray(e)?`[${t}]`:t===``?`<root>`:t}function Zb(){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 Qb=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,$b=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,ex=/^([/\\]\s*){2,}[^/\\]/,tx=/\/$|\/\?|\/#/,nx=/^\.?\//;function rx(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?Qb.test(e):$b.test(e)||(t.acceptRelative?ex.test(e):!1)}function ix(e=``,t){return t?tx.test(e):e.endsWith(`/`)}function ax(e=``,t){if(!t)return(ix(e)?e.slice(0,-1):e)||`/`;if(!ix(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 ox(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(ix(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 sx(e,t){if(cx(t)||rx(e))return e;let n=ax(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return ux(n,e)}function cx(e){return!e||e===`/`}function lx(e){return e&&e!==`/`}function ux(e,...t){let n=e||``;for(let e of t.filter(e=>lx(e)))if(n){let t=e.replace(nx,``);n=ox(n)+t}else n=e;return n}function dx(e,t){let n=e.match($b);return n||=e.match(/^\/{2,}/),n?t+e.slice(n[0].length):t+e}var fx=`__DEVFRAME_CONNECTION_META__`,px=`__DEVFRAME_CONNECTION_AUTH_TOKEN__`;function mx(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 hx(){return mx(ob)}function gx(){return mx(fx)}function _x(e){if(e)return e;try{let e=localStorage.getItem(px);if(e)return e}catch{}return mx(px)}function vx(e){globalThis[ob]=e,globalThis[fx]={...e.connectionMeta,baseUrl:e.metaBaseUrl},e.authToken&&yx(e.authToken)}function yx(e){try{localStorage.setItem(px,e)}catch{}globalThis[px]=e;let t=hx();t&&(globalThis[ob]={...t,authToken:e})}function bx(e){let t=sx(ab,e);try{return new URL(t,globalThis.location?.href).href}catch{return t}}function xx(e,t){return t&&t!==e.authToken?{...e,authToken:t}:e}function Sx(){let e=hx();if(e)return xx(e,_x()??e.authToken??e.connectionMeta.authToken);let t=gx();if(t)return{connectionMeta:t,metaBaseUrl:t.baseUrl??bx(`./`),authToken:_x(t.authToken)}}async function Cx(e={}){if(e.connection){let t=xx(e.connection,_x(e.authToken??e.connection.authToken??e.connection.connectionMeta.authToken));return vx(t),t}let t=Array.isArray(e.baseURL)?e.baseURL:[e.baseURL??`./`];if(e.connectionMeta){let n={connectionMeta:e.connectionMeta,metaBaseUrl:bx(t[0]??`./`),authToken:_x(e.authToken??e.connectionMeta.authToken)};return vx(n),n}let n=Sx();if(n){let t=xx(n,_x(e.authToken??n.authToken??n.connectionMeta.authToken));return vx(t),t}let r=[];for(let n of t){let t=sx(ab,n),i=bx(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:_x(e.authToken??r.authToken)};return vx(a),a}catch(e){r.push(e)}}throw Error(`Failed to get connection meta from ${t.join(`, `)}`,{cause:r})}var wx=class extends Error{name=`DevframeConnectionError`;kind;constructor(e,t,n){super(t,n),this.kind=e}};function Tx(e=ub){try{let t=globalThis.location?.hash?.replace(/^#/,``)??``;return new URLSearchParams(t).get(e)||void 0}catch{return}}function Ex(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 Dx(e=ub){let t=Tx(e);return t&&Ex(e),t}async function Ox(e,t={}){let n=Dx(t.param??`devframe_otp`);return n?e.isTrusted?!0:e.requestTrustWithCode(n):!1}function kx(e){let t={},n=new WeakMap,r,i=()=>(r??=e.sharedState.get(lb,{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 Ax=Symbol.for(`immer-nothing`),jx=Symbol.for(`immer-draftable`),Mx=Symbol.for(`immer-state`);function Nx(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Px=Object,Fx=Px.getPrototypeOf,Ix=`constructor`,Lx=`prototype`,Rx=`configurable`,zx=`enumerable`,Bx=`writable`,Vx=`value`,Hx=e=>!!e&&!!e[Mx];function Ux(e){return e?Kx(e)||$x(e)||!!e[jx]||!!e[Ix]?.[jx]||eS(e)||tS(e):!1}var Wx=Px[Lx][Ix].toString(),Gx=new WeakMap;function Kx(e){if(!e||!nS(e))return!1;let t=Fx(e);if(t===null||t===Px[Lx])return!0;let n=Px.hasOwnProperty.call(t,Ix)&&t[Ix];if(n===Object)return!0;if(!rS(n))return!1;let r=Gx.get(n);return r===void 0&&(r=Function.toString.call(n),Gx.set(n,r)),r===Wx}function qx(e,t,n=!0){Jx(e)===0?(n?Reflect.ownKeys(e):Px.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Jx(e){let t=e[Mx];return t?t.type_:$x(e)?1:eS(e)?2:tS(e)?3:0}var Yx=(e,t,n=Jx(e))=>n===2?e.has(t):Px[Lx].hasOwnProperty.call(e,t),Xx=(e,t,n=Jx(e))=>n===2?e.get(t):e[t],Zx=(e,t,n,r=Jx(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Qx(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var $x=Array.isArray,eS=e=>e instanceof Map,tS=e=>e instanceof Set,nS=e=>typeof e==`object`,rS=e=>typeof e==`function`,iS=e=>typeof e==`boolean`;function aS(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var oS=e=>nS(e)?e?.[Mx]:null,sS=e=>e.copy_||e.base_,cS=e=>e.modified_?e.copy_:e.base_;function lS(e,t){if(eS(e))return new Map(e);if(tS(e))return new Set(e);if($x(e))return Array[Lx].slice.call(e);let n=Kx(e);if(t===!0||t===`class_only`&&!n){let t=Px.getOwnPropertyDescriptors(e);delete t[Mx];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Bx]===!1&&(a[Bx]=!0,a[Rx]=!0),(a.get||a.set)&&(t[i]={[Rx]:!0,[Bx]:!0,[zx]:a[zx],[Vx]:e[i]})}return Px.create(Fx(e),t)}{let t=Fx(e);if(t!==null&&n)return{...e};let r=Px.create(t);return Px.assign(r,e)}}function uS(e,t=!1){return pS(e)||Hx(e)||!Ux(e)?e:(Jx(e)>1&&Px.defineProperties(e,{set:fS,add:fS,clear:fS,delete:fS}),Px.freeze(e),t&&qx(e,(e,t)=>{uS(t,!0)},!1),e)}function dS(){Nx(2)}var fS={[Vx]:dS};function pS(e){return e===null||!nS(e)||Px.isFrozen(e)}var mS=`MapSet`,hS=`Patches`,gS=`ArrayMethods`,_S={};function vS(e){let t=_S[e];return t||Nx(0,e),t}var yS=e=>!!_S[e];function bS(e,t){_S[e]||(_S[e]=t)}var xS,SS=()=>xS,CS=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:yS(mS)?vS(mS):void 0,arrayMethodsPlugin_:yS(gS)?vS(gS):void 0});function wS(e,t){t&&(e.patchPlugin_=vS(hS),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function TS(e){ES(e),e.drafts_.forEach(OS),e.drafts_=null}function ES(e){e===xS&&(xS=e.parent_)}var DS=e=>xS=CS(xS,e);function OS(e){let t=e[Mx];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function kS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Mx].modified_&&(TS(t),Nx(4)),Ux(e)&&(e=AS(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Mx].base_,e,t)}else e=AS(t,n);return jS(t,e,!0),TS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Ax?void 0:e}function AS(e,t){if(pS(t))return t;let n=t[Mx];if(!n)return zS(t,e.handledSet_,e);if(!NS(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);LS(n,e)}return n.copy_}function jS(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uS(t,n)}function MS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var NS=(e,t)=>e.scope_===t,PS=[];function FS(e,t,n,r){let i=sS(e),a=e.type_;if(r!==void 0&&Xx(i,r,a)===t){Zx(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;qx(i,(e,n)=>{if(Hx(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??PS;for(let e of o)Zx(i,e,n,a)}function IS(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!NS(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=cS(i);FS(e,i.draft_??i,a,n),LS(i,r)})}function LS(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)}MS(e)}}function RS(e,t,n){let{scope_:r}=e;if(Hx(n)){let i=n[Mx];NS(i,r)&&i.callbacks_.push(function(){JS(e),FS(e,n,cS(i),t)})}else Ux(n)&&e.callbacks_.push(function(){let i=sS(e);e.type_===3?i.has(n)&&zS(n,r.handledSet_,r):Xx(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&zS(Xx(e.copy_,t,e.type_),r.handledSet_,r)})}function zS(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Hx(e)||t.has(e)||!Ux(e)||pS(e)?e:(t.add(e),qx(e,(r,i)=>{if(Hx(i)){let t=i[Mx];NS(t,n)&&(Zx(e,r,cS(t),e.type_),MS(t))}else Ux(i)&&zS(i,t,n)}),e)}function BS(e,t){let n=$x(e),r={type_:+!!n,scope_:t?t.scope_:SS(),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=VS;n&&(i=[r],a=HS);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var VS={get(e,t){if(t===Mx)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=sS(e);if(!Yx(i,t,e.type_))return GS(e,i,t);let a=i[t];if(e.finalized_||!Ux(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&aS(t))return a;if(a===US(e.base_,t)||WS(e,t,a)){JS(e);let n=e.type_===1?+t:t,r=XS(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in sS(e)},ownKeys(e){return Reflect.ownKeys(sS(e))},set(e,t,n){let r=KS(sS(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=US(sS(e),t),i=r?.[Mx];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Qx(n,r)&&(n!==void 0||Yx(e.base_,t,e.type_)))return!0;JS(e),qS(e)}return e.copy_[t]===n&&(n!==void 0||Yx(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),RS(e,t,n),!0)},deleteProperty(e,t){return JS(e),US(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),qS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=sS(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Bx]:!0,[Rx]:e.type_!==1||t!==`length`,[zx]:r[zx],[Vx]:n[t]}},defineProperty(){Nx(11)},getPrototypeOf(e){return Fx(e.base_)},setPrototypeOf(){Nx(12)}},HS={};for(let e in VS){let t=VS[e];HS[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}HS.deleteProperty=function(e,t){return HS.set.call(this,e,t,void 0)},HS.set=function(e,t,n){return VS.set.call(this,e[0],t,n,e[0])};function US(e,t){let n=e[Mx];return(n?sS(n):e)[t]}function WS(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Ux(n)||n[Mx]?!1:e.baseRefs_.has(n)}function GS(e,t,n){let r=KS(t,n);return r?Vx in r?r[Vx]:r.get?.call(e.draft_):void 0}function KS(e,t){if(!(t in e))return;let n=Fx(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Fx(n)}}function qS(e){e.modified_||(e.modified_=!0,e.parent_&&qS(e.parent_))}function JS(e){e.copy_||=(e.assigned_=new Map,lS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var YS=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(rS(e)&&!rS(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}rS(t)||Nx(6),n!==void 0&&!rS(n)&&Nx(7);let r;if(Ux(e)){let i=DS(this),a=XS(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?TS(i):ES(i)}return wS(i,n),kS(r,i)}if(!e||!nS(e)){if(r=t(e),r===void 0&&(r=e),r===Ax&&(r=void 0),this.autoFreeze_&&uS(r,!0),n){let t=[],i=[];vS(hS).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}Nx(1,e)},this.produceWithPatches=(e,t)=>{if(rS(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]},iS(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),iS(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),iS(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Ux(e)||Nx(8),Hx(e)&&(e=ZS(e));let t=DS(this),n=XS(t,e,void 0);return n[Mx].isManual_=!0,ES(t),n}finishDraft(e,t){let n=e&&e[Mx];(!n||!n.isManual_)&&Nx(9);let{scope_:r}=n;return wS(r,t),kS(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=vS(hS).applyPatches_;return Hx(e)?r(e,t):this.produce(e,e=>r(e,t))}};function XS(e,t,n,r){let[i,a]=eS(t)?vS(mS).proxyMap_(t,n):tS(t)?vS(mS).proxySet_(t,n):BS(t,n);return(n?.scope_??SS()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?IS(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 ZS(e){return Hx(e)||Nx(10,e),QS(e)}function QS(e){if(!Ux(e)||pS(e))return e;let t=e[Mx],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=lS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=lS(e,!0);return qx(n,(e,t)=>{Zx(n,e,QS(t))},r),t&&(t.finalized_=!1),n}function $S(){function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=oS(Xx(e,n.key_)),i=Xx(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||Yx(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=Xx(n,r),!nS(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?.[Mx];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;qx(e.assigned_,(e,l)=>{let u=Xx(o,e,c),f=Xx(s,e,c),p=l?Yx(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===Ax?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=Jx(o),n=i[e];typeof n!=`string`&&typeof n!=`number`&&(n=``+n),(t===0||t===1)&&(n===`__proto__`||n===Ix)&&Nx(19),rS(o)&&n===Lx&&Nx(19),o=Xx(o,n),(o===null||!nS(o))&&Nx(18,i.join(`/`))}let s=Jx(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:Nx(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:Nx(17,a)}}),e}function u(e){if(!Ux(e))return e;if($x(e))return e.map(u);if(eS(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,u(t)]));if(tS(e))return new Set(Array.from(e).map(u));let t=Object.create(Fx(e));for(let n in e)t[n]=u(e[n]);return Yx(e,jx)&&(t[jx]=e[jx]),t}function d(e){return Hx(e)?u(e):e}bS(hS,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}var eC=new YS,tC=eC.produce,nC=eC.produceWithPatches.bind(eC),rC=eC.applyPatches.bind(eC),iC=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function aC(e=21){let t=``,n=e;for(;n--;)t+=iC[Math.random()*64|0];return t}var oC=1e3;function sC(e,t){if(e.add(t),e.size>oC){let t=e.values().next().value;t!==void 0&&e.delete(t)}}function cC(e){let{enablePatches:t=!1}=e;t&&$S();let n=Zb(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=aC())=>{i.has(t)||($S(),r=rC(r,e),sC(i,t),n.emit(`updated`,r,void 0,t))},mutate:(e,a=aC())=>{if(!i.has(a)){if(sC(i,a),t){let[t,i]=nC(r,e);r=t,n.emit(`updated`,r,i,a)}else r=tC(r,e),n.emit(`updated`,r,void 0,a)}},syncIds:i}}function lC(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:ib.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:ib.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=cC({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(ib.client.isTrustedUpdated,e=>{e&&!n&&(n=!0,d())})}})}}}var uC=typeof self==`object`?self:globalThis,dC=new Set([`Error`,`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`,`AggregateError`]),fC=new Set([`Boolean`,`Number`,`String`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float16Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]);function pC(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=dC.has(e)?uC[e]:void 0;return n(new(r??uC.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`&&fC.has(a))return n(new uC[a](o),i);throw TypeError(`unable to deserialize unsafe or unknown type: ${String(a)}`)};return r}function mC(e){return pC(new Map,e)(0)}var hC=``,{toString:gC}={},{keys:_C}=Object;function vC(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=gC.call(e).slice(8,-1);switch(n){case`Array`:return[1,hC];case`Object`:return[2,hC];case`Date`:return[3,hC];case`RegExp`:return[4,hC];case`Map`:return[5,hC];case`Set`:return[6,hC];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function yC([e,t]){return e===0&&(t===`function`||t===`symbol`)}function bC(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]=vC(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 _C(r))(e||!yC(vC(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||!(yC(vC(n))||yC(vC(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!yC(vC(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function xC(e,t={}){let n=[];return bC(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:SC,stringify:CC}=JSON,wC={json:!0,lossy:!0};function TC(e){return mC(SC(e))}function EC(e){return CC(xC(e,wC))}function DC(e){return mC(e)}function OC(e){return EC(e)}function kC(e){return TC(e)}var AC=new Map;function jC(e=AC){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?Jb(n,r??``):`s:${OC(n)}`},deserialize:e=>{let n=e.startsWith(`s:`)?kC(e.slice(2)):JSON.parse(e);return n.t===`q`&&n.i&&n.m&&t.set(n.i,n.m),n}}}function MC(){}function NC(e){let{onConnected:t=MC,onError:n=MC,onDisconnected:r=MC,definitions:i,fetch:a=globalThis.fetch.bind(globalThis)}=e,o=e.url;e.authToken&&(o=`${o}${o.includes(`?`)?`&`:`?`}${db}=${encodeURIComponent(e.authToken)}`);let s=jC(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=r.search(/\n\n|\r\n\r\n/);if(e<0)break;let t=r.slice(0,e);r=r.slice(e+(r[e]===`\r`?4:2));let n=`message`,i=[];for(let e of t.split(/\r?\n/))e.startsWith(`:`)||(e.startsWith(`event:`)?n=e.slice(6).trimStart():e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``)));i.length>0&&_(n,i.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`,[sb]: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 PC(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var FC=Math.random.bind(Math),IC=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function LC(e=21){let t=``,n=e;for(;n--;)t+=IC[FC()*64|0];return t}var RC=6e4,zC=e=>e,BC=zC,{clearTimeout:VC,setTimeout:HC}=globalThis;function UC(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=zC,deserialize:s=BC,resolver:c,bind:l=`rpc`,timeout:u=RC,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}=PC(),_=LC();s.i=_;let v;async function y(n=s){return u>=0&&(v=HC(()=>{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{VC(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&&(VC(r.timeoutId),n?r.reject(n):r.resolve(t)),p.delete(e)}}return m=r(b),h}function WC(e,t){let{channel:n,rpcOptions:r={}}=t;return UC(e,{...n,timeout:-1,...r,proxify:!1})}function GC(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function KC(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=GC();function f(e,t=null){if(t?u=t:e===`connected`&&(u=null),e===l)return;let n=l;l=e,i.emit(ib.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 wx(`connection`,`[devframe] Not connected to the devframe server`,{cause:u??void 0}):l===`unauthorized`?new wx(`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(ib.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 wx(`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(ib.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(ib.client.connectionError,e),m(new wx(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){l!==`error`&&f(`disconnected`),m(new wx(`connection`,`[devframe] Disconnected from the devframe server`,{cause:u??void 0}))}}),y=WC(a.functions,{channel:v,rpcOptions:o});a.register({name:ib.broadcast.authRevoked,type:`event`,handler:()=>{c=!1;let e=new wx(`auth`,`[devframe] The devframe server revoked this client's trust`);f(`unauthorized`,e),i.emit(ib.client.connectionError,e),m(e),i.emit(ib.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 wx(`auth`,`[devframe] The devframe server refused this client's credentials`);f(`unauthorized`,e),i.emit(ib.client.connectionError,e)}return i.emit(ib.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(ib.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(ib.client.error,n,t),Promise.reject(n)):g(y.$call(...e),t)},callEvent:(...e)=>{let t=h();if(t){i.emit(ib.client.error,t,String(e[0]));return}return y.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(ib.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 JC(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 KC({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>NC({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 YC(e){let t=e.cause instanceof Error?e.cause:XC(e.cause)?YC(e.cause):e.cause,n=t===void 0?Error(e.message):Error(e.message,{cause:t});n.name=e.name;for(let t of Object.keys(e))t!==`name`&&t!==`message`&&t!==`cause`&&(n[t]=e[t]);return n}function XC(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function ZC(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function QC(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function $C(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function ew(e){if(e.error)throw YC(e.error);return e.output}function tw(e){return e.some(e=>e!=null)}function nw(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function rw(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?DC(e):e}function a(e,t){return i(nw(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 $C(r)?ew(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(ZC(r)){if(tw(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(QC(r)){let e=Eb(n),i=r.records[e];if(i)return ew(await s(i,r.serialization));if(r.fallback)return ew(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!tw(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 iw(e){let t=rw(await e.fetchJsonFromBases(cb),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 aw=256,ow=class extends Error{name=`StreamClosedError`};function sw(e={}){let t=e.id??aC(),n=Math.max(0,e.replayWindow??0),r=Zb(),i=new AbortController,a=[],o=!1,s=0;function c(e){if(o)throw new ow(`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=lw(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 cw(e={}){let t=e.id??aC(),n=Math.max(1,e.highWaterMark??aw),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 lw(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 uw=``;function dw(e,t){return`${e}${uw}${t}`}function fw(e){let t=new Map,n=new Map;e.client.register({name:ib.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(dw(e,n))?._push(r,i)}}),e.client.register({name:ib.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=dw(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:ib.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let r=dw(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(ib.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(uw);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=dw(n,r),o=t.get(a);if(o)return o;let s=cw({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(ib.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=dw(t,r),a=n.get(i);if(a)return a;let o=sw({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 pw(){}var mw=new Map;function hw(e){let t=e.url;e.authToken&&(t=`${t}?${db}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=pw,onError:i=pw,onDisconnected:a=pw,definitions:o=mw}=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=jC(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 gw(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 dx(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function _w(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=gw(n.websocket,r??`./`,location);return KC({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>hw({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 vw(e){return e.includes(`:`)}function yw(e,t){return vw(t)?t:`${e}:${t}`}function bw(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 xw(e,t){return{global:bw(e,t,`global`),project:bw(e,t,`project`)}}function Sw(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(vw(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(yw(t,n),...r)),callEvent:((n,...r)=>e.callEvent(yw(t,n),...r)),callOptional:((n,...r)=>e.callOptional(yw(t,n),...r)),sharedState:((n,r)=>e.sharedState.get(yw(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe(yw(t,n),r,i),upload:(n,r)=>e.streaming.upload(yw(t,n),r)}},settings:xw(e,t),scope:e.scope}}function Cw(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") — nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function ww(e={}){let{baseURL:t=`./`,rpcOptions:n={},cacheOptions:r=!1}=e,i=Zb(),a=Array.isArray(t)?t:[t],o=await Cx(e),{connectionMeta:s,metaBaseUrl:c,authToken:l}=o,u=a[0]??`./`;try{u=new URL(`.`,c).href}catch{}let d=new Db({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),f={rpc:void 0},p=new Kb(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(sx(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=Cw(e.transport??`auto`,s),_=g===`static`?await iw({fetchJsonFromBases:m}):g===`sse`?JC({...h,sseOptions:e.sseOptions}):_w({...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=>(yx(e),o={...o,authToken:e},_.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await _.requestTrustWithCode(e);if(!t)return!1;yx(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=lC(S),S.streaming=fw(S),S.services=kx(S);let C=new Map;S.scope=(e=>{if(!e)return S;let t=C.get(e);return t||(t=Sw(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 Ox(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 Tw=ww;function Ew(e,t){return!!(t.excludeUnderscoreProps&&e.startsWith(`_`)||t.excludeDollarProps&&e.startsWith(`$`))}var Dw=[];for(let e of[`WeakMap`,`WeakSet`,`WeakRef`,`ArrayBuffer`,`SharedArrayBuffer`]){let t=globalThis[e];typeof t==`function`&&Dw.push([t,e])}function Ow(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=Aw(e,r,0,`#`,[]);return r.stats.ms=Math.round((performance.now()-n)*100)/100,{data:i,stats:r.stats}}function kw(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):r[i];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 Aw(e,t,n,r,i){if(t.stats.nodes++,e==null)return e??null;let a=typeof e;if(a===`string`){let n=e;return n.length>t.opts.maxString?`${n.slice(0,t.opts.maxString)}… [$truncated string, ${n.length} chars]`:n}if(a===`number`)return Number.isFinite(e)?e:String(e);if(a===`boolean`)return e;if(a===`bigint`)return{$type:`bigint`,value:String(e)};if(a===`symbol`)return{$type:`symbol`,value:String(e)};if(a===`function`)return{$type:`function`,name:e.name||`(anonymous)`};let o=e,s=t.seen.get(o);if(s!==void 0)return t.stats.refs++,{$ref:s};if(o instanceof Date)return{$type:`Date`,value:Number.isNaN(o.getTime())?`Invalid Date`:o.toISOString()};if(o instanceof RegExp)return{$type:`RegExp`,value:String(o)};if(o instanceof URL)return{$type:`URL`,value:o.href};if(o instanceof Error)return{$type:`Error`,name:o.name,message:o.message};if(o instanceof Promise)return{$type:`Promise`};for(let[e,t]of Dw)if(o instanceof e)return{$type:t};if(n>=t.opts.maxDepth)return t.stats.truncatedDepth++,{$truncated:`depth`,$preview:Mw(o),$path:i};if(t.seen.set(o,r),Array.isArray(o)){let e=t.opts.excludeFunctions?o.filter(e=>typeof e!=`function`):o,a=Math.min(e.length,t.opts.maxEntries),s=Array.from({length:a});for(let o=0;o<a;o++)s[o]=Aw(e[o],t,n+1,`${r}[${o}]`,jw(i,[`i`,o]));return e.length>a&&(t.stats.truncatedEntries++,s.push({$truncated:`entries`,$total:e.length,$shown:a})),s}if(ArrayBuffer.isView(o)){let e=o;return{$type:o.constructor?.name??`TypedArray`,length:e.length??e.byteLength}}if(o instanceof Map){let e=[...o.entries()].slice(0,t.opts.maxEntries);if(o.size>e.length&&t.stats.truncatedEntries++,e.every(([e])=>typeof e==`string`)){let a={};for(let[o,s]of e)a[o]=Aw(s,t,n+1,`${r}.${String(o)}`,jw(i,[`k`,o]));return{$type:`Map`,size:o.size,value:a}}return{$type:`Map`,size:o.size,entries:e.map(([e,a],o)=>({key:Aw(e,t,n+1,`${r}~keys[${o}]`,jw(i,[`mk`,o])),value:Aw(a,t,n+1,`${r}~values[${o}]`,jw(i,[`mv`,o]))}))}}if(o instanceof Set){let e=[...o].slice(0,t.opts.maxEntries);return o.size>e.length&&t.stats.truncatedEntries++,{$type:`Set`,size:o.size,values:e.map((e,a)=>Aw(e,t,n+1,`${r}~set[${a}]`,jw(i,[`s`,a])))}}let c=Object.getPrototypeOf(o),l=c&&c!==Object.prototype&&c!==null?c.constructor?.name:void 0,u={};l&&l!==`Object`&&(u.$class=l);let d=Object.keys(o).filter(e=>!Ew(e,t.opts)),f=Math.min(d.length,t.opts.maxProps);for(let e=0;e<f;e++){let a=d[e],s;try{s=o[a]}catch(e){u[a]={$type:`getter-error`,message:e instanceof Error?e.message:String(e)};continue}t.opts.excludeFunctions&&typeof s==`function`||(u[a]=Aw(s,t,n+1,`${r}.${a}`,jw(i,[`k`,a])))}return d.length>f&&(t.stats.truncatedProps++,u.$truncated=`props: showing ${f} of ${d.length}`),u}function jw(e,t){return[...e,t]}function Mw(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 Nw=`modulepreload`,Pw=function(e,t){return new URL(e,t).href},Fw={},Iw=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=Pw(t,n),t=s(t),t in Fw)return;Fw[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`:Nw,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 Lw(e){return!!e&&typeof e==`object`&&e.$type===`Map`}function Rw(e){return!!e&&typeof e==`object`&&e.$type===`Set`}function zw(e){return!!e&&typeof e==`object`&&typeof e.entries==`function`&&typeof e.get==`function`}function Bw(e){return!!e&&typeof e==`object`&&typeof e.has==`function`&&typeof e[Symbol.iterator]==`function`&&typeof e.get!=`function`}var Vw;function Hw(){return Vw??=Iw(async()=>{let{default:e}=await Promise.resolve().then(()=>Vj);return{default:e}},void 0,import.meta.url).then(({default:e})=>e.setup({methods:{fromMap:e=>zw(e)?Object.fromEntries(e.entries()):Lw(e)?e.value??Object.fromEntries((e.entries??[]).map(e=>[String(e.key),e.value])):e,mapEntries:e=>zw(e)?[...e.entries()].map(([e,t])=>({key:e,value:t})):Lw(e)?e.entries?e.entries:Object.entries(e.value??{}).map(([e,t])=>({key:e,value:t})):[],fromSet:e=>Bw(e)?[...e]:Rw(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 Uw(e,t,n){try{let r=performance.now(),i=(await Hw())(t)(e),a=Math.round((performance.now()-r)*100)/100,{data:o,stats:s}=Ow(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 Ww(e,t,n,r){try{let i=performance.now(),a=kw((await Hw())(t)(e),n,r),o=Math.round((performance.now()-i)*100)/100,{data:s,stats:c}=Ow(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 Gw(e,t,n,r=30){try{let i=performance.now(),a=(await Hw())(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 Kw(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:Yw(e,r,0),nodes:r.nodes,ms:Math.round((performance.now()-n)*100)/100}}function qw(e){return typeof e.entries==`function`&&typeof e.get==`function`&&typeof e.size==`number`}function Jw(e){return typeof e.has==`function`&&typeof e[Symbol.iterator]==`function`&&typeof e.get!=`function`&&typeof e.size==`number`}function Yw(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 Xw(i,t,n)}finally{t.seen.delete(i)}}function Xw(e,t,n){if(Array.isArray(e)){let r=t.opts.excludeFunctions?e.filter(e=>typeof e!=`function`):e;if(r.length===0)return[];let i=Yw(r[0],t,n+1);return r.length>1?[i,`+${r.length-1} more`]:[i]}if(ArrayBuffer.isView(e))return e.constructor?.name??`TypedArray`;if(qw(e)){let r=e.entries().next().value;return r?{[`Map(${e.size})`]:{key:Yw(r[0],t,n+1),value:Yw(r[1],t,n+1)}}:`Map(0)`}if(Jw(e)){let r=e[Symbol.iterator]().next().value;return r===void 0?`Set(0)`:{[`Set(${e.size})`]:Yw(r,t,n+1)}}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=>!Ew(e,t.opts)),s=Math.min(o.length,t.opts.maxProps);for(let r=0;r<s;r++){let i=o[r],s;try{s=e[i]}catch{a[i]=`getter-error`;continue}t.opts.excludeFunctions&&typeof s==`function`||(a[i]=Yw(s,t,n+1))}return o.length>s&&(a[`...`]=`+${o.length-s} more props`),a}var Zw=Jt({connected:!1,status:`connecting`,error:null,mode:`rpc`}),Qw=ln(null);function $w(){if(!Qw.value)throw Error(`not connected`);return Qw.value}var eT=`devframe:docks:active`,tT=null;async function nT(e,t){let n=tT;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(eT,{initialValue:{activation:null}});r(e.value()),e.on(`updated`,r)}catch{}}function rT(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 iT(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 Uw(n(e),t,r)},async queryPath(e,t,r,i){return Ww(n(e),t,r,i)},async suggest(e,t,r){return Gw(n(e),t,r)},async skeleton(e,t){try{return{ok:!0,...Kw(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 aT(){let e=new URLSearchParams(location.search),t=e.get(db);if(!t)return;e.delete(db);let n=e.toString();return history.replaceState(null,``,n?`?${n}`:location.pathname),t}async function oT(){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 sT(e){Zw.status=e.status,Zw.connected=e.status===`connected`,Zw.error=e.connectionError?.message??null}async function cT(){let e=aT();try{let t=await oT();if(t){Qw.value=iT(t),Zw.mode=`static`,Zw.status=`connected`,Zw.connected=!0,Zw.error=null;return}let n=await Tw({baseURL:`./`,authToken:e});tT=n,Qw.value=rT(n),sT(n),n.events.on(`connection:status`,()=>sT(n)),await n.ensureTrusted(1e4).catch(()=>{}),sT(n)}catch(e){Zw.status=`error`,Zw.error=e instanceof Error?e.message:String(e)}}var lT=vd(),uT=Q(()=>lT.value?`dark`:`light`),dT={class:`min-w-0 flex items-center gap-1.5`},fT=[`title`],pT=W({__name:`AppHeader`,setup(e){let t=Q(()=>rb(Zw.status));return(e,n)=>(K(),J(eb,{glass:!1,class:`h-nav`},{search:U(()=>[...n[3]||=[Y(`div`,null,null,-1)]]),end:U(()=>[X(gm,{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(gm,{icon:`i-ph:sun-duotone dark:i-ph:moon-duotone`,title:`Toggle dark mode`,onClick:n[0]||=e=>lT.value=!H(lT)})]),default:U(()=>[Y(`div`,dT,[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(Zw).mode===`static`?(K(),J(Zy,{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(Zw).error??void 0},[Y(`span`,{class:ye(t.value.dot)},null,2),ws(` `+Oe(t.value.label),1)],10,fT)):Z(``,!0)])]),_:1}))}}),mT=`1.0.0-beta.16`,hT=Object.hasOwn||((e,t)=>Object.hasOwnProperty.call(e,t)),gT=Object.prototype.toString;function _T(e,t){return t!==void 0&&(CT(t)?t.forEach(t=>e.add(t)):e.add(t)),e}function vT(e,t,n){e.has(t)?e.get(t).add(n):e.set(t,new Set([n]))}function yT(e,t){return e&&hT(e,t)?e[t]:void 0}function bT(e){return typeof e==`object`&&!!e&&e.constructor===Object}function xT(e){return gT.call(e)===`[object RegExp]`}function ST(e){return e&&(CT(e)||hT(e,`length`)&&isFinite(e.length))}function CT(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function wT(e,t=0){let n=parseInt(e,10);return isNaN(n)?t:n}function TT(e){if(CT(e))return e.length>0;if(bT(e)){for(let t in e)if(hT(e,t))return!0;return!1}return!!e}function ET(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 DT={0:`\0`,b:`\b`,n:`
|
|
7
|
-
`,r:`\r`,f:`\f`,t:` `,v:`\v`};function OT(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?DT[a]||a:(!t&&/[\r\n\u2028\u2029]/.test(e)&&r(`Invalid line terminator`,{inside:[o+1,1]}),e)})}function kT(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 AT=/\n|\r\n?|\u2028|\u2029/g;function jT(e,t){let n=Math.max(t-32,0),r=Math.min(t+32,e.length),i=(n===0?``:`...`)+e.slice(n,t).replace(AT,`\\n`);return`${i}${e.slice(t,r).replace(AT,`\\n`)+(r===e.length?``:`...`)}\n${`-`.repeat(i.length)}^`}function MT(e,t){let n=e.slice(0,t).split(AT);return{line:n.length,column:n[n.length-1].length,offset:t}}var NT=59,PT={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`},FT=HT(48,49,29,49,31,49,20,49,21,49,50,51,30,51,52,53,23,25),IT={"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},LT={"...":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},RT=VT(10,11,12,13,15,16,17,18,14,19),zT=VT(26,27),BT=VT(0,1,22,25,2,3,4,9,5,8,6,7,49,51,53,26);function VT(...e){let t=new Int8Array(NT);for(let n of e)t[n]=1;return t}function HT(...e){let t=new Int8Array(NT).fill(-1);for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1];return t}var UT=[10,11,15,16,17,18,14],WT=[41,42,43,44,45,32,34,35,36,40,38,37,39],GT=[54,47,55,56,58,51,49,53,24,25,19,...WT,...UT],KT=VT(...GT),qT=VT(...GT);qT[49]=0;var JT=VT(...GT);JT[51]=0;var YT=VT(54,47,55,24,25,19,...WT,...UT);[32,34,41,42,43,44,45,15,17,16,18].forEach(e=>YT[e]=0);var XT=new Map([[null,KT],[47,KT],[55,KT],[56,KT],[54,KT],[26,KT],[27,KT],[48,KT],[33,KT],[12,KT],[13,KT],[29,qT],[31,qT],[20,qT],[21,qT],[50,JT],[30,JT],[8,YT],...WT.map(e=>[e,KT]),...UT.map(e=>[e,KT])]),ZT=/\/\/.*?(?:\n|\r\n?|\u2028|\u2029|$)|\/\*(?:.|\s)*?(?:\*\/|$)/y,QT=/\s+/y,$T=new RegExp(Object.keys(LT).map(e=>e.replace(/[\[\]{}()^$|?*+.]/g,`\\$&`)).join(`|`),`y`),eE=/(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)\b/y,tE=/(?:has no|not in|and|or|not|has|is|in|no|(?:asc|desc)(?:NA?|AN?)?)\b/y,nE=/\/(?:\\.|[^/])+\/[gimsu]*/y,rE=/(?:[_\d]*\.)?[_\d]+(?:[eE][-+]?[_\d]+)?\b|0[xX][_0-9a-fA-F]+\b/y,iE=/"(?:\\.|[^"])*"|'(?:\\.|[^'])*'/sy,aE=/`(?:\\.|[^`\\$]|\$(?!\{))*(\$\{|`)/sy,oE=/\}(?:\\.|[^`\\$]|\$(?!\{))*(\$\{|`)/sy,sE=()=>{},cE=new Map([[`true`,!0],[`false`,!1],[`null`,null],[`undefined`,void 0],[`Infinity`,1/0],[`NaN`,NaN]]),lE=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 PT[this.type]}get value(){return this.#t??=this.#e.slice(this.start,this.end)}};function*uE(e,t=!1){let n=fE(e,t),r;for(;r=n();)yield r}function dE(e,t=!1){let n=fE(e,t),r=[],i;for(;i=n();)r.push(i);return r}function fE(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]):sE,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){FT[e]===-1?x()===e&&c.pop():c.push(FT[e])}function x(){return c.length>0?c[c.length-1]:-1}function S(t){if(XT.get(f)?.[t.type]){d=t;let n,r;return f===null?(n=0,r=RT[t.type]?Math.max(0,t.start-1):t.start):RT[f]?(n=t.start,r=t.start):RT[t.type]?(n=p,r=Math.max(p,t.start-1)):(n=p,r=t.start),new lE(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(rE))return 0;if((n===`"`||n===`'`)&&h(iE))return 1;if(n==="`"&&h(aE))return e[o-1]=="`"?22:23;if(n===`}`&&x()===25&&h(oE))return e[o-1]==="`"?25:24;if(n===`/`)return!l&&h(nE)?2:(m(),44);if(v(n)){if(!u&&h(tE))return IT[e.slice(t,o)];if(h(eE))return!u&&cE.has(e.slice(t,o))?3:g()===`(`?(m(),20):4}return n===`$`?(m(),g()===`$`?(m(),9):h(eE)?g()===`(`?(m(),21):5:8):h($T)?LT[e.slice(t,o)]:(o++,57)}function w(){let t=o;return g()===`/`&&h(ZT)?(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(QT)&&(u=!1);while(w());let t=o,r=C(),i=new lE(r,t,o,e);return l=BT[r],u=zT[r],b(r),n?S(i):i}}var pE=Symbol(`RECOVERABLE_ERROR`),mE=-1,hE=!0,gE=!1,_E=VT(47),vE=HT(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 yE(e,t){let n=dE(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 pE;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 ${MT(e,r).line} column ${MT(e,r).column}`);let s=MT(e,r),c=i.type===57||n?.inside?[t,``,jT(e,r)]:[`Parse error on line ${s.line}:`,``,jT(e,r),...t?[``,t]:[]],l=i.type===57||!Array.isArray(n?.expected)?null:[...new Set([].concat(...n.expected).map(e=>`'${PT[e]}'`))];throw l&&c.push(``,`Expecting `+l.join(`, `)+` got `+PT[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:MT(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!==pE)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=ET(i.value,s);break;case 1:t=OT(i.value,!1,1,s);break;case 22:case 25:t=OT(i.value,!0,1,s);break;case 23:case 24:t=OT(i.value,!0,2,s);break;case 2:t=kT(i.value,s);break;case 3:t=cE.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(;vE[i.type]>=e&&!_(58);){let e=vE[i.type]+!_E[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 N();default:return ie()}}function N(){let e=y(),t=vE[i.type],n=m();return{type:`Prefix`,operator:n,argument:n===`is`?F():M(t+1),range:b(e)}}function ie(){let e=ae();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 ae(){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(vE[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(hE):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(gE):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(vE[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 bE={parse(e,t=!1){let n=[];return{ast:yE(e,{tolerant:t,onComment:n}),commentRanges:n}},createTokenizer:fE,tokenize:uE},xE=s({compile:()=>SE,stringify:()=>wE,walk:()=>CE});function SE(e,t){let n=t.scope.arg1;t.put(typeof n==`string`?n:`undefined`)}function CE(){}function wE(e,t){t.put(`$$`)}var TE=s({compile:()=>DE,stringify:()=>kE,suggest:()=>EE,walk:()=>OE});function EE(e,t){e.elements.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function DE(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}function OE(e,t){t.list(e.elements)}function kE(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}var AE=s({compile:()=>ME,stringify:()=>PE,suggest:()=>jE,walk:()=>NE});function jE(e,t){Array.isArray(e.assertion)||(t.range(e.assertion.range,`var`),t.range(e.assertion.range,`assertion`))}function ME(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 NE(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 PE(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 FE=s({compile:()=>zE,stringify:()=>VE,suggest:()=>RE,walk:()=>BE}),IE={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 LE(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 RE(e,t){switch(e.operator){case`in`:t.range(e.left.range,`in-value`,e.right,null),LE(t,e.left,e.right);break;case`not in`:LE(t,e.left,e.right);break;case`has`:t.range(e.right.range,`in-value`,e.left,null),LE(t,e.right,e.left);break;case`has no`:LE(t,e.right,e.left);break;case`=`:case`!=`:t.range(e.right.range,`value`,e.left,null)}}function zE(e,t){if(!(e.operator in IE)){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(IE[e.operator])),t.put(`(`),t.node(e.left),t.put(`,`),t.node(e.right),t.put(`)`)}}function BE(e,t){t.node(e.left),t.node(e.right)}function VE(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 HE=s({compile:()=>WE,stringify:()=>KE,suggest:()=>UE,walk:()=>GE});function UE(e,t){e.body===null&&t.queryRoot(e.range[1])}function WE(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 GE(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}function KE(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}var qE=s({compile:()=>YE,stringify:()=>ZE,walk:()=>XE}),JE={"":`cmp`,N:`cmpNatural`,A:`cmpAnalytical`,NA:`cmpNaturalAnalytical`,AN:`cmpNaturalAnalytical`};function YE(e,t){let n=e.order.startsWith(`desc`),r=JE[e.order.slice(n?4:3)]||JE[``];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 XE(e,t){t.node(e.query)}function ZE(e,t){t.node(e.query),t.put(` `),t.put(e.order)}var QE=s({compile:()=>$E,stringify:()=>tD,walk:()=>eD});function $E(e,t){t.put(`(_a, _b)=>{let _q;return `),t.list(e.compares,`||`),t.put(`||0}`)}function eD(e,t){t.list(e.compares)}function tD(e,t){t.list(e.compares,`,`)}var nD=s({compile:()=>rD,stringify:()=>aD,walk:()=>iD});function rD(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 iD(e,t){t.nodeOrNothing(e.test),t.nodeOrNothing(e.consequent),t.nodeOrNothing(e.alternate)}function aD(e,t){t.nodeOrNothing(e.test),t.put(`?`),t.nodeOrNothing(e.consequent),e.alternate&&(t.put(`:`),t.node(e.alternate))}var oD=s({compile:()=>sD,stringify:()=>lD,walk:()=>cD});function sD(e,t){t.put(`context`)}function cD(){}function lD(e,t){t.put(`#`)}var uD=s({compile:()=>fD,stringify:()=>mD,suggest:()=>dD,walk:()=>pD});function dD(e,t){e.range&&t.range(e.range,`var`)}function fD(e,t){t.put(t.scope.$ref)}function pD(){}function mD(e,t){t.put(`$`)}var hD=s({compile:()=>gD,stringify:()=>vD,walk:()=>_D});function gD(e,t){t.put(`data`)}function _D(){}function vD(e,t){t.put(`@`)}var yD=s({compile:()=>bD,stringify:()=>SD,walk:()=>xD});function bD(e,t){e.name&&t.putIdent(`$`+t.unescapeName(e.name,e),e)}function xD(){}function SD(e,t){t.put(e.name?`$`+e.name:`$`)}var CD=s({compile:()=>OD,stringify:()=>AD,suggest:()=>DD,walk:()=>kD}),wD=[`$data`,`$context`,`$ctx`,`$array`,`$idx`,`$index`],TD=function(e,t,n){return{type:`GetProperty`,value:e,property:t,range:n}},ED=function(e,t){return{type:`Identifier`,name:e,range:t}};function DD(e,t){e.value===null&&t.range(e.declarator.range,`path`)}function OD(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(wD.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||TD(null,ED(n))),t.put(`;`),t.scope.add(r),t.scope.own.add(r),t.scope.awaitInit.delete(r)}function kD(e,t){t.node(e.declarator),t.nodeOrNothing(e.value)}function AD(e,t){t.node(e.declarator),e.value!==null&&(t.put(`:`),t.node(e.value)),t.put(`;`)}var jD=s({compile:()=>MD,stringify:()=>PD,walk:()=>ND});function MD(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 ND(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function PD(e,t){t.nodeOrNothing(e.value),t.put(`.[`),t.node(e.query),t.put(`]`)}var FD=s({compile:()=>ID,stringify:()=>RD,walk:()=>LD});function ID(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 LD(e,t){t.node(e.body)}function RD(e,t){t.put(`=>`),t.node(e.body)}var zD=s({compile:()=>VD,stringify:()=>UD,suggest:()=>BD,walk:()=>HD});function BD(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 VD(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,`),t.node(e.property),t.put(`)`)}function HD(e,t){t.nodeOrNothing(e.value),t.node(e.property)}function UD(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.property)}var WD=s({compile:()=>GD,stringify:()=>qD,walk:()=>KD});function GD(e,t){t.put(JSON.stringify(t.unescapeName(e.name,e,!1)))}function KD(){}function qD(e,t){t.put(e.name)}var JD=s({compile:()=>YD,stringify:()=>ZD,walk:()=>XD});function YD(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}function XD(){}function ZD(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}var QD=s({compile:()=>$D,stringify:()=>tO,walk:()=>eO});function $D(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 eO(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function tO(e,t){t.nodeOrNothing(e.value),t.put(`.(`),t.node(e.query),t.put(`)`)}var nO=s({compile:()=>rO,stringify:()=>aO,walk:()=>iO});function rO(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 iO(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function aO(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 oO=s({compile:()=>cO,stringify:()=>uO,suggest:()=>sO,walk:()=>lO});function sO(e,t){e.arguments.length===0&&t.queryRoot(e.range[1]-1)}function cO(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 lO(e,t){t.node(e.reference),t.list(e.arguments)}function uO(e,t){t.node(e.reference),t.put(`(`),t.list(e.arguments,`,`),t.put(`)`)}var dO=s({compile:()=>fO,stringify:()=>mO,walk:()=>pO});function fO(e,t){t.node(e.method,e.value)}function pO(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 hO=s({compile:()=>_O,stringify:()=>yO,suggest:()=>gO,walk:()=>vO});function gO(e,t){e.properties.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function _O(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}function vO(e,t){t.list(e.properties)}function yO(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}var bO=s({compile:()=>TO,stringify:()=>DO,suggest:()=>wO,walk:()=>EO}),xO=function(e,t,n){return{type:`GetProperty`,value:e,property:t,range:n}},SO=function(e,t){return{type:`Identifier`,name:e,range:t}},CO=new Set([`Literal`,`Identifier`,`Reference`,`Current`]);function wO(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 TO(e,t){let n=e.value;switch(e.key.type){case`Current`:t.put(`...null`);return;case`Literal`:t.node(e.key),n||=xO(null,SO(String(e.key.value)));break;case`Identifier`:t.node(e.key),n||=xO(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 EO(e,t){t.node(e.key),t.nodeOrNothing(e.value)}function DO(e,t){if(CO.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 OO=s({compile:()=>kO,stringify:()=>jO,walk:()=>AO});function kO(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}function AO(e,t){t.node(e.body)}function jO(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}var MO=s({compile:()=>PO,stringify:()=>IO,suggest:()=>NO,walk:()=>FO});function NO(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 PO(e,t){t.put(t.buildinFn(`pick`)),t.put(`(`),t.node(e.value),e.getter&&(t.put(`,`),t.node(e.getter)),t.put(`)`)}function FO(e,t){t.node(e.value),e.getter!==null&&t.node(e.getter)}function IO(e,t){t.node(e.value),t.put(`[`),e.getter!==null&&t.node(e.getter),t.put(`]`)}var LO=s({compile:()=>RO,stringify:()=>BO,walk:()=>zO});function RO(e,t){t.put(`($=>(`),t.createScope(()=>t.node(e.right),e=>e+`,`),t.put(`))`),t.put(`(`),t.nodeOrCurrent(e.left),t.put(`)`)}function zO(e,t){t.node(e.left),t.node(e.right)}function BO(e,t){t.node(e.left),t.put(`|`),t.node(e.right)}var VO=s({compile:()=>UO,stringify:()=>GO,suggest:()=>HO,walk:()=>WO});function HO(e,t){t.queryRoot(e.range[1])}function UO(e,t){t.put(t.scope.$ref)}function WO(){}function GO(){}var KO=s({compile:()=>qO,stringify:()=>YO,walk:()=>JO});function qO(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 JO(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function YO(e,t){t.node(e.argument),t.put(` `),t.node(e.operator)}var XO=s({compile:()=>ZO,stringify:()=>$O,walk:()=>QO});function ZO(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 QO(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function $O(e,t){t.put(e.operator),e.operator!==`-`&&e.operator!==`+`&&t.put(` `),t.node(e.argument)}var ek=s({compile:()=>nk,stringify:()=>ik,suggest:()=>tk,walk:()=>rk});function tk(e,t){e.range&&t.range(e.range,`var`)}function nk(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 rk(e,t){t.node(e.name)}function ik(e,t){t.put(`$`),t.node(e.name)}var ak=s({compile:()=>ok,stringify:()=>ck,walk:()=>sk});function ok(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 sk(e,t){t.nodeOrNothing(e.value);for(let n of e.arguments.slice(0,3))n&&t.node(n)}function ck(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 lk=s({compile:()=>dk,stringify:()=>pk,suggest:()=>uk,walk:()=>fk});function uk(e,t){e.query===null&&t.queryRoot(e.range[1])}function dk(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 fk(e,t){t.nodeOrNothing(e.query)}function pk(e,t){t.put(`...`),t.nodeOrNothing(e.query)}var mk=s({compile:()=>gk,stringify:()=>vk,suggest:()=>hk,walk:()=>_k});function hk(e,t){for(let[n,r]of Object.entries(e.values))r===null&&t.queryRoot(e.values[Number(n)-1].range[1])}function gk(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(`"`+xk(r.value,yk)+`"`):(t.put(`(`),t.node(r),t.put(`)`)))}}function _k(e,t){for(let n of e.values)n!==null&&t.node(n)}function vk(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(xk(i.value,bk)),t.put(e===n?"`":"${")):i!==null&&t.node(i)}}var yk=new Map([[`\b`,`\\b`],[`
|
|
9
|
-
`,`\\n`],[`\r`,`\\r`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\u2028`,`\\u2028`],[`\u2029`,`\\u2029`],[`\\`,`\\\\`],[`"`,`\\"`]]),bk=new Map([[`\b`,`\\b`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\\`,`\\\\`],[`$`,`\\$`]]);function xk(e,t){let n=``;for(let r=0;r<e.length;r++)n+=t.get(e[r])||e[r];return n}var Sk={Arg1:xE,Array:TE,Assertion:AE,Binary:FE,Block:HE,Compare:qE,Conditional:nD,Context:oD,Current:uD,Data:hD,Declarator:yD,Definition:CD,Filter:jD,Function:FD,GetProperty:zD,Identifier:WD,Literal:JD,Map:QD,MapRecursive:nO,Method:oO,MethodCall:dO,Object:hO,ObjectEntry:bO,Parentheses:OO,Pick:MO,Pipeline:LO,Placeholder:VO,Postfix:KO,Prefix:XO,Reference:ek,SliceNotation:ak,CompareFunction:QE,Spread:lk,Template:mk},Ck=e=>new Map(Object.entries(Sk).map(([t,n])=>[t,n[e]]).filter(([,e])=>typeof e==`function`)),wk={};Ck(`build`).forEach((e,t)=>wk[t]=e);var Tk=Ck(`compile`),Ek=Ck(`walk`),Dk=Ck(`stringify`),Ok=Ck(`suggest`);function kk(e,t){function n(e){if(Ek.has(e.type))i(e),Ek.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 Ak(e,t){return t>=0&&t<e.length&&/[a-zA-Z_$0-9]/.test(e[t])}function jk(e,t){let n=e.charCodeAt(t);return n===9||n===10||n===13||n===32}function Mk(e,t,n){for(;t<n;t++)if(!jk(e,t))return!1;return!0}function Nk(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 Pk(e,t,n,r){let i=[];for(let a=0;a<e.length;a++){let[o,s,c,l]=e[a];if(Mk(t,o,s)){for(;o>=0&&jk(t,o-1);)o--;for(;s<t.length&&jk(t,s);)s++;if(Ak(t,o-1)){if(o===s)continue;o++}if(Ak(t,s)){if(o===s)continue;s--}}let u=Nk(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 Fk(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 kk(e,e=>{if(Ok.has(e.type)){let n=t;t=e,Ok.get(e.type)(e,a),t=n}}),r}function Ik(e,{ast:t,commentRanges:n}){let r=Fk(t),i=n.length&&n[n.length-1][1]===e.length&&!/[\r\n]$/.test(e);for(let[t,a]of r)r.set(t,Pk(a,e,n,i));return r}function Lk(e){return e.type===`GetProperty`}function Rk(e){return e.type===`MethodCall`}function zk(e){function t(e){if(Dk.has(e.type))Dk.get(e.type)(e,r);else throw Error(`Unknown node type "`+e.type+`"`)}let n=[],r={isSimpleGetPropertyQuery:Lk,isSimpleMethodCallQuery:Rk,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 Bk(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 Vk=/^[\p{ID_Start}$_]$/u,Hk=/^[\p{ID_Continue}$]$/u;function Uk(e,t,n){return Kk(e,`query`,t,n)}function Wk(e,t,n){return Kk(e,`method`,t,n)}var Gk=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 Kk(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(Tk.has(e.type))Tk.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 Gk,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?Vk:Hk;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(!hT(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(!hT(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
|
-
}`),qk(m,`return`+p.join(``)+`})`)}function qk(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 Bk(`SyntaxError`,`Jora query compilation error`,{compiledSource:`function(f,m,a){\n${t}\n}`,details:e})}}var Jk=0,Yk=1,Xk=2,Zk=4,Qk=8,$k=3,eA=12,tA=e=>typeof e==`number`||typeof e==`string`,nA=(e,t)=>t<e.length?e.charCodeAt(t):0,rA=e=>e===43||e===45,iA=e=>e>=48&&e<=57,aA=e=>e===9||e===10||e===12||e===13||e===32,oA=e=>e>32&&e<256&&(e<65||e>90)&&(e<97||e>122)&&!iA(e)&&!rA(e)||e===8470,sA=e=>e&&!aA(e)&&!oA(e)&&!iA(e),cA=(e,t,n)=>rA(e)?iA(t)?2:t===46&&iA(n)?3:0:+!!iA(e),lA=(e,t,n)=>{for(;n(nA(e,++t)););return t},uA=(e,t,n)=>{let r=nA(e,t);if(rA(r)&&(r=nA(e,t+=1)),iA(r)&&(t=lA(e,t,iA),r=nA(e,t)),r===46&&iA(nA(e,t+1))){if(n)return t;let i=lA(e,t+1,iA);if(r=nA(e,i),r===46)return t;t=i}if(r===69||r===101){let n=1;r=nA(e,t+1),rA(r)&&(n=2,r=nA(e,t+2)),iA(r)&&(t=lA(e,t+n,iA))}return t},dA=(e,t,n,r)=>{if(t>=e.length)return Jk;let i=nA(e,t);return aA(i)?Yk|lA(e,t,aA)-t<<4:oA(i)||r&&rA(i)?Xk|lA(e,t,oA)-t<<4:cA(i,nA(e,t+1),nA(e,t+2))?Zk|uA(e,t,n)-t<<4:Qk|lA(e,t,sA)-t<<4},fA=(e,t,n)=>{let r=0,i=0,a=!1,o=!1,s=0,c=0,l=!0;for(;;){let u=dA(e,r,a,o),d=dA(t,i,a,o),f=u&15,p=u>>4,m=d&15,h=d>>4;if(f!==m){if(l&&f&$k&&m&eA){s=1,c=f,r+=p;continue}if(l&&m&$k&&f&eA){s=-1,c=m,i+=h;continue}return f-m}if(f===Jk)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&$k)a=e[r+p-1]===`.`,_!==0&&f>c&&(c=f,s=_);else if(f&Zk){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=nA(e,r),o=nA(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}},pA=e=>(t,n)=>tA(t)&&tA(n)?Math.sign(fA(String(t),String(n),e)):0,mA=pA(!1),hA=pA(!0),gA=1,_A=2,vA=3,yA=4,bA=5,xA=6,SA=7,CA=8;function wA(e){switch(typeof e){case`boolean`:return gA;case`number`:return e===e?vA:_A;case`string`:return yA;case`object`:return e===null?bA:xA;case`undefined`:return CA;default:return SA}}function TA(e,t){let n=wA(e),r=wA(t);return n===r?e<t?-1:+(e>t):n<r?-1:1}function EA(e,t){let n=wA(e),r=wA(t);return n===r?n===vA?t-e:e<t?-1:+(e>t):n<r?-1:1}function DA(e,t){let n=wA(e),r=wA(t);return(n===vA||n===yA)&&(r===vA||r===yA)?mA(e,t):n===r?e<t?-1:+(e>t):n<r?-1:1}function OA(e,t){let n=wA(e),r=wA(t);return(n===vA||n===yA)&&(r===vA||r===yA)?hA(e,t,!0):n===r?e<t?-1:+(e>t):n<r?-1:1}function kA(e,t){return e.length===1?(n,r)=>t(e(n),e(r)):e}var AA=Object.freeze({awaitInitRef:jA,ensureArray:MA,bool:TT,and:(e,t)=>TT(e)?t:e,or:(e,t)=>TT(e)?e:t,add:NA,sub:PA,mul:FA,div:IA,mod:LA,eq:RA,ne:zA,lt:BA,lte:VA,gt:HA,gte:UA,in:WA,notIn:(e,t)=>!WA(e,t),has:(e,t)=>WA(t,e),hasNo:(e,t)=>!WA(t,e),cmp:TA,cmpAnalytical:EA,cmpNatural:DA,cmpNaturalAnalytical:OA,match:GA,pick:KA,indexOf:qA,lastIndexOf:YA,map:ZA,mapRecursive:QA,some:$A,filter:ej,slice:tj});function jA(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 MA(e){return CT(e)?e:[e]}function NA(e,t){return CT(e)||CT(t)?[...new Set([...CT(e)?e:[e],...CT(t)?t:[t]])]:e+t}function PA(e,t){if(CT(e)){let n=new Set(e);return CT(t)?t.forEach(e=>n.delete(e)):n.delete(t),[...n]}return e-t}function FA(e,t){return e*t}function IA(e,t){return e/t}function LA(e,t){return e%t}function RA(e,t){return Object.is(e,t)}function zA(e,t){return!Object.is(e,t)}function BA(e,t){return e<t}function VA(e,t){return e<=t}function HA(e,t){return e>t}function UA(e,t){return e>=t}function WA(e,t){return bT(t)?hT(t,e):t?JA(t,e)!==-1:!1}function GA(e,t){return typeof t==`function`?$A(e,t):xT(t)?$A(e,t.test.bind(t)):t==null}function KA(e,t=()=>!0){if(e){if(typeof t==`function`){if(CT(e)||typeof e==`string`){for(let n=0;n<e.length;n++)if(TT(t(e[n],n)))return e[n]}for(let n in e)if(hT(e,n)&&TT(t(e[n],n)))return e[n];return}return CT(e)||typeof e==`string`?isFinite(t)?e[t<0?e.length+Number(t):Number(t)||0]:void 0:hT(e,t)?e[t]:void 0}}function qA(e,t,n){return e?JA(e,t,n):-1}function JA(e,t,n=0){if(Number.isNaN(t)&&ST(e)){for(let t=wT(n,0);t<e.length;t++)if(Number.isNaN(e[t]))return t}return typeof e.indexOf==`function`?e.indexOf(t,n):-1}function YA(e,t,n){return e?XA(e,t,n):-1}function XA(e,t,n){if(Number.isNaN(t)&&ST(e)){for(let t=wT(n,e.length-1);t>=0;t--)if(Number.isNaN(e[t]))return t}return typeof e.lastIndexOf==`function`?e.lastIndexOf(t,wT(n,e.length-1)):-1}function ZA(e,t){let n=typeof t==`function`?t:e=>yT(e,t);return CT(e)?[...e.reduce((e,t)=>_T(e,n(t)),new Set)]:e===void 0?e:n(e)}function QA(e,t){let n=new Set;return _T(n,ZA(e,t)),n.forEach(e=>_T(n,ZA(e,t))),[...n]}function $A(e,t){return CT(e)?e.some(e=>TT(t(e))):TT(t(e))}function ej(e,t){return CT(e)?e.filter(e=>TT(t(e))):TT(t(e))?e:void 0}function tj(e,t,n,r=1){if(!ST(e))return[];if(t=wT(t,0),n=wT(n,e.length),r=wT(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 nj=rj(20)?1/0:rj(10)?10:0;function rj(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 ij(e,t){return e.length<=nj?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 aj=(e,t)=>e-t,oj=(e,t)=>t-e,sj=class{constructor(e,t,n,r=!1){this.maxSize=e||1/0,this.compare=t||oj,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]()}},cj=class extends sj{},lj=class extends sj{constructor(e,t,n,r){super(e,t?(e,n)=>-t(e,n):aj,n,r)}},uj=e=>e;function dj(e){return typeof e==`object`&&e?NaN:Number(e)}function fj(e,t,n){if(ST(e)){typeof t!=`function`&&(t=uj);for(let r of e){let e=t(r);e!==void 0&&n(dj(e))}}}function pj(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 lj(s+1,r):new cj(e.length-o,r);if(fj(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 hj(e,t){let n,r=0,i=0;return fj(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 gj(e,t){let n=[];return fj(e,t,n.push.bind(n)),n}function _j(e,t){let n=0;if(ST(e)){typeof t!=`function`&&(t=mj);for(let r of e)t(r)!==void 0&&n++}return n}function vj(e,t){return hj(e,t).sum}function yj(e,t){let{sum:n,count:r}=hj(e,t);if(r>0)return n/r}function bj(e,t){let n=0,r=0,i=0;if(fj(e,t,e=>{n+=1;let t=e-r;r+=t/n,i+=t*(e-r)}),n>0)return i/n}function xj(e,t){let n=bj(e,t);if(n!==void 0)return Math.sqrt(n)}function Sj(e,t=DA){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=kA(t,DA);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 Cj(e,t=DA){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=kA(t,DA);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 wj(e,t,n){if(ST(e))return pj(e,t,n)}function Tj(e,t){return wj(e,50,t)}function Ej(){}function Dj(e){return e}function Oj(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 kj(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 Aj=String.prototype.replaceAll||function(e,t){return xT(e)?this.replace(e,t):this.split(e).join(String(t))},jj=Object.freeze({bool:AA.bool,filter:AA.filter,map:AA.map,pick:AA.pick,indexOf:AA.indexOf,lastIndexOf:AA.lastIndexOf,keys(e){return Object.keys(e||{})},values(e){let t=new Set;for(let n in e)hT(e,n)&&_T(t,e[n]);return[...t]},entries(e){let t=[];for(let n in e)hT(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 bT(e)?Object.keys(e).length:e&&e.length||0},sort(e,t=TA){if(!CT(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=TA(t[e],n[e]);if(r!==0)return r}return 0}return TA(t,n)}}return ij(e,t)},reverse(e){return CT(e)?e.slice().reverse():e},slice(e,t,n){return typeof e==`string`||CT(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=Ej),typeof n!=`function`&&(n=Dj),CT(e)||(e=[e]);for(let i of e){let e=t(i);if(CT(e)){if(e.length>0){let t=n(i);for(let n of e)vT(r,n,t)}else vT(r,void 0,n(i))}else vT(r,e,n(i))}for(let[e,t]of r)i.push({key:e,value:[...t]});return i},join(e,t){return CT(e)?e.join(t):String(e)},match(e,t,n){let r=String(e),i=xT(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(Oj(a));return e}return Oj(r.match(t))},reduce(e,t,n=void 0){return CT(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(CT(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(CT(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 xT(t)&&!t.flags.includes(`g`)&&(t=new RegExp(t,t.flags+`g`)),Aj.call(String(e),t,typeof n==`function`?(...e)=>n(kj(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:gj,count:_j,sum:vj,avg:yj,variance:bj,stdev:xj,min:Sj,max:Cj,percentile:wj,p:wj,median:Tj}),Mj=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:bT,array:CT,regexp:xT,truthy:TT,falsy:e=>!TT(e)}),Nj={path:`property`,key:`value`,value:`value`,"in-value":`value`,"value-subset":`value`,var:`variable`,assertion:`assertion`};function Pj(e,t){typeof e==`object`&&e&&!CT(e)&&Reflect.ownKeys(e).forEach(t.add,t)}function Fj(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)Pj(t,e);else Pj(n,e);e.forEach(r.add,r);break}case`key`:{let e=new Set;for(let n of t)Pj(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)CT(n)?n.forEach(i):Pj(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 Ij(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 Lj(e,t){return typeof e==`function`?e:e===!0&&t}function Rj(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 zj(e){return t=>(typeof t==`string`?t:String(t)).toLowerCase().indexOf(e)!==-1}var Bj=(e,{value:t,stats:n,assertions:r})=>({get value(){return t},stat(t,r){return Ij(e,t,n,r)},suggestion(t,i){let{limit:a=1/0,sort:o,filter:s}=i||{};o=Lj(o,AA.cmp),s=Lj(s,zj);let c=o&&isFinite(a)?cj:Set,l=Ij(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=Nj[t];if(!u.has(p)){let e;switch(c){case cj:e=new cj(a,o,s&&s(Rj(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:Fj(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(Rj(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}}),Vj=s({default:()=>Qj}),Hj=new Map,Uj=new Map,Wj=new Map,Gj=new Map;function Kj(e,t,n,r,i){typeof n==`string`?Object.defineProperty(e,t,{configurable:!0,get(){let a=Yj(n,`method`)(AA,r,i);return Object.defineProperty(e,t,{enumerable:!0,value:a}),a}}):typeof n==`function`&&Object.defineProperty(e,t,{enumerable:!0,value:n})}function qj(e,t){if(!e&&!t)return{queryMethods:jj,queryAssertions:Mj};let n={...jj},r={...Mj};for(let[t,i]of Object.entries(e||{})){if(hT(jj,t))throw Error(`Builtin method "${t}" can\'t be overridden`);Kj(n,t,i,n,r)}for(let[e,i]of Object.entries(t||{})){if(hT(Mj,e))throw Error(`Builtin assertion "${e}" can\'t be overridden`);Kj(r,e,i,n,r)}return{queryMethods:n,queryAssertions:r}}function Jj(e,t){console.log(`[${e}]`),typeof t==`string`?console.log(t):t!==void 0&&console.dir(t,{depth:null}),console.log()}function Yj(e,t,n,r,i){i=typeof i==`function`?i:i?Jj:!1,i&&(i(`=========================`),i(`Compile query from source`,e));let a=bE.parse(e,r);i&&(i(`AST`,a.ast),i(`Restored source`,zk(a.ast)));let o=n?Ik(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`?Wk(a.ast,r,o):Uk(a.ast,r,o);return i&&i(`Compiled code`,s.toString()),s}function Xj(e,t){t||={};let n=!!t.stat,r=!!t.tolerant,i=n?r?Gj:Uj:r?Wj:Hj,{methods:a,assertions:o}=t||{},{queryMethods:s,queryAssertions:c}=qj(a,o),l;return e=String(e),i.has(e)&&!t.debug?l=i.get(e):(l=Yj(e,`query`,n,r,t.debug),i.set(e,l)),l=l(AA,s,c),n?Object.assign((t,n)=>Bj(e,l(t,n)),{query:l}):l}function Zj(e){let t=new Map,n=new Map,r=new Map,i=new Map,{methods:a,assertions:o}=e||{},{queryMethods:s,queryAssertions:c}=qj(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=Yj(e,`query`,o,l,a.debug)(AA,s,c);d=o?Object.assign((n,r)=>Bj(e,t(n,r)),{query:t}):t,u.set(e,d)}return d}}var Qj=Object.assign(Xj,{version:mT,buildin:AA,methods:jj,assertions:Mj,setup:Zj,syntax:{tokenize:bE.tokenize,parse:bE.parse,suggest:Ik,walk:kk,stringify:zk,compile:Uk,compileMethod:Wk}}),$j=400,eM=150,tM=300,nM=`data-inspector:drafts`,rM=5,iM=1,aM=3600,oM=[`excludeFunctions`,`excludeUnderscoreProps`,`excludeDollarProps`];function sM(){try{let e=JSON.parse(localStorage.getItem(nM)??`{}`);return e&&typeof e==`object`?e:{}}catch{return{}}}function cM(e){try{return Qj.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 lM(e){return Number.isFinite(e)?Math.min(aM,Math.max(iM,Math.round(e))):rM}function uM(){let e=new URLSearchParams(location.hash.replace(/^#/,``)),t={};for(let n of oM)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?lM(n):rM}}function dM(){let e=uM(),t=V([]),n=V(e.sourceId),r=V(e.query),i=sM(),a=!1;function o(){n.value&&(r.value?i[n.value]=r.value:delete i[n.value],localStorage.setItem(nM,JSON.stringify(i)))}function s(){a=!0,r.value=i[n.value]??``}let c=Jt({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 oM)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)},tM)}function p(){let e=uM();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 oM)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=ln(),b=V(!1),x=V(null),S=V([]),C=ln(),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(()=>Zw.mode===`rpc`&&!!E.value?.writable&&D.value),k=Q(()=>Zw.mode!==`rpc`||!E.value?null:E.value.writable?D.value?null:`derived-view`:`readonly-source`),A=null;async function ee(){t.value=await $w().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=cM(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 $w().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(),$j)}let N;function ie(){return typeof document<`u`&&document.hidden}function ae(){clearInterval(N),N=void 0,!(!l.value||ie())&&(N=setInterval(()=>{h.value||m.value.kind===`error`||M()},lM(u.value)*1e3))}typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{l.value&&(ae(),!ie()&&!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 $w().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 $w().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 $w().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 $w().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),eM)}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 oM)c[t]=e[t]??!1;r.value=e.query,M()}Tr(r,()=>{if(o(),f(),a){a=!1;return}re()}),Tr(n,()=>{S.value=[],s(),f(),M(),L()}),Tr(c,()=>{f(),M(),L()}),Tr([l,u],()=>{u.value=lM(u.value),f(),ae()}),l.value&&ae(),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 fM=Symbol(`data-inspector:workbench`);function pM(){let e=vr(fM);if(!e)throw Error(`workbench not provided`);return e}var mM={class:`flex flex-col h-full min-h-0`},hM={class:`flex gap-2`},gM={key:0,class:`text-sm op-fade`},_M={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`},vM={class:`flex-1 min-h-0 overflow-auto font-mono max-h50 text-xs border border-base rounded-lg px-3 py-2`},yM=[`title`,`onClick`],bM={class:`op50`},xM={key:1,class:`op50`},SM={key:2,class:`op50`},CM=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`,hM,[e.source?.description?(K(),q(`div`,gM,Oe(e.source.description),1)):Z(``,!0),n[1]||=Y(`div`,{class:`flex-auto`},null,-1),X(gm,{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`,_M,Oe(e.error),1)):Z(``,!0),Y(`div`,vM,[a.value.length?(K(),q(os,{key:0},[n[2]||=Y(`div`,{class:`op50 select-none`},` { `,-1),(K(!0),q(os,null,pa(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)},Oe(e.key),9,yM),Y(`span`,bM,`: `+Oe(e.label)+`,`,1)]))),128)),n[3]||=Y(`div`,{class:`op50 select-none`},` } `,-1)],64)):o.value?(K(),q(`span`,xM,Oe(o.value),1)):(K(),q(`span`,SM,`loading shape...`))])]))}});function wM(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 TM(e){if(Array.isArray(e))return e}function EM(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 DM(){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 OM(e,t){return TM(e)||EM(e,t)||kM(e,t)||DM()}function kM(e,t){if(e){if(typeof e==`string`)return wM(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)?wM(e,t):void 0}}var AM=Object.entries,jM=Object.setPrototypeOf,MM=Object.isFrozen,NM=Object.getPrototypeOf,PM=Object.getOwnPropertyDescriptor,FM=Object.freeze,IM=Object.seal,LM=Object.create,RM=typeof Reflect<`u`&&Reflect,zM=RM.apply,BM=RM.construct;FM||=function(e){return e},IM||=function(e){return e},zM||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},BM||=function(e){return new e(...[...arguments].slice(1))};var VM=sN(Array.prototype.forEach),HM=sN(Array.prototype.lastIndexOf),UM=sN(Array.prototype.pop),WM=sN(Array.prototype.push),GM=sN(Array.prototype.splice),KM=Array.isArray,qM=sN(String.prototype.toLowerCase),JM=sN(String.prototype.toString),YM=sN(String.prototype.match),XM=sN(String.prototype.replace),ZM=sN(String.prototype.indexOf),QM=sN(String.prototype.trim),$M=sN(Number.prototype.toString),eN=sN(Boolean.prototype.toString),tN=typeof BigInt>`u`?null:sN(BigInt.prototype.toString),nN=typeof Symbol>`u`?null:sN(Symbol.prototype.toString),rN=sN(Object.prototype.hasOwnProperty),iN=sN(Object.prototype.toString),aN=sN(RegExp.prototype.test),oN=cN(TypeError);function sN(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return zM(e,t,n)}}function cN(e){return function(){return BM(e,[...arguments])}}function lN(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qM;if(jM&&jM(e,null),!KM(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(MM(t)||(t[r]=e),i=e)}e[i]=!0}return e}function uN(e){for(let t=0;t<e.length;t++)rN(e,t)||(e[t]=null);return e}function dN(e){let t=LM(null);for(let r of AM(e)){var n=OM(r,2);let i=n[0],a=n[1];rN(e,i)&&(t[i]=KM(a)?uN(a):a&&typeof a==`object`&&a.constructor===Object?dN(a):a)}return t}function fN(e){switch(typeof e){case`string`:return e;case`number`:return $M(e);case`boolean`:return eN(e);case`bigint`:return tN?tN(e):`0`;case`symbol`:return nN?nN(e):`Symbol()`;case`undefined`:return iN(e);case`function`:case`object`:{if(e===null)return iN(e);let t=e,n=pN(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:iN(e)}return iN(e)}default:return iN(e)}}function pN(e,t){for(;e!==null;){let n=PM(e,t);if(n){if(n.get)return sN(n.get);if(typeof n.value==`function`)return sN(n.value)}e=NM(e)}function n(){return null}return n}function mN(e){try{return aN(e,``),!0}catch{return!1}}var hN=FM(`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(`.`)),gN=FM(`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(`.`)),_N=FM([`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`]),vN=FM([`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`]),yN=FM(`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(`.`)),bN=FM([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),xN=FM([`#text`]),SN=FM(`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(`.`)),CN=FM(`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.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.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(`.`)),wN=FM(`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(`.`)),TN=FM([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),EN=IM(/{{[\w\W]*|^[\w\W]*}}/g),DN=IM(/<%[\w\W]*|^[\w\W]*%>/g),ON=IM(/\${[\w\W]*/g),kN=IM(/^data-[\-\w.\u00B7-\uFFFF]+$/),AN=IM(/^aria-[\-\w]+$/),jN=IM(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),MN=IM(/^(?:\w+script|data):/i),NN=IM(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),PN=IM(/^html$/i),FN=IM(/^[a-z][.\w]*(-[.\w]+)+$/i),IN=IM(/<[/\w!]/g),LN=IM(/<[/\w]/g),RN=IM(/<\/no(script|embed|frames)/i),zN=IM(/\/>/i),BN={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},VN=function(){return typeof window>`u`?null:window},HN=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}},UN=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},WN=function(e,t,n,r){return rN(e,t)&&KM(e[t])?lN(r.base?dN(r.base):{},e[t],r.transform):n};function GN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VN(),t=e=>GN(e);if(t.version=`3.4.13`,t.removed=[],!e||!e.document||e.document.nodeType!==BN.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=pN(d,`cloneNode`),p=pN(d,`remove`),m=pN(d,`nextSibling`),h=pN(d,`childNodes`),g=pN(d,`parentNode`),_=pN(d,`shadowRoot`),v=pN(d,`attributes`),y=o&&o.prototype?pN(o.prototype,`nodeType`):null,b=o&&o.prototype?pN(o.prototype,`nodeName`):null,x=o&&o.prototype?pN(o.prototype,`ownerDocument`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let S,C=``,w,T=!1,E=0,D=function(){if(E>0)throw oN(`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.`)},O=function(e){D(),E++;try{return S.createHTML(e)}finally{E--}},k=function(e){D(),E++;try{return S.createScriptURL(e)}finally{E--}},A=function(){return T||=(w=HN(u,i),!0),w},ee=n,j=ee.implementation,te=ee.createNodeIterator,ne=ee.createDocumentFragment,M=ee.getElementsByTagName,re=r.importNode,N=UN();t.isSupported=typeof AM==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let ie=EN,ae=DN,P=ON,F=kN,I=AN,oe=MN,se=NN,L=FN,ce=jN,le=null,ue=lN({},[...hN,...gN,..._N,...yN,...xN]),de=null,fe=lN({},[...SN,...CN,...wN,...TN]),pe=Object.seal(LM(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}})),me=null,he=null,ge=Object.seal(LM(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),_e=!0,ve=!0,ye=!1,be=!0,xe=!1,Se=!0,Ce=!1,we=!1,Te=null,Ee=null,De=!1,Oe=!1,ke=!1,Ae=!1,je=!0,Me=!1,Ne=`user-content-`,Pe=!0,R=!1,Fe={},Ie=null,Le=lN({},`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(`.`)),Re=null,ze=lN({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Be=null,Ve=lN({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),He=`http://www.w3.org/1998/Math/MathML`,Ue=`http://www.w3.org/2000/svg`,We=`http://www.w3.org/1999/xhtml`,Ge=We,Ke=!1,qe=null,Je=lN({},[He,Ue,We],JM),Ye=FM([`mi`,`mo`,`mn`,`ms`,`mtext`]),Xe=lN({},Ye),Ze=FM([`annotation-xml`]),Qe=lN({},Ze),$e=lN({},[`title`,`style`,`font`,`a`,`script`]),et=null,tt=[`application/xhtml+xml`,`text/html`],nt=null,rt=null,it=n.createElement(`form`),at=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rt&&rt===e)return;(!e||typeof e!=`object`)&&(e={}),e=dN(e),et=tt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,nt=et===`application/xhtml+xml`?JM:qM,le=WN(e,`ALLOWED_TAGS`,ue,{transform:nt}),de=WN(e,`ALLOWED_ATTR`,fe,{transform:nt}),qe=WN(e,`ALLOWED_NAMESPACES`,Je,{transform:JM}),Be=WN(e,`ADD_URI_SAFE_ATTR`,Ve,{transform:nt,base:Ve}),Re=WN(e,`ADD_DATA_URI_TAGS`,ze,{transform:nt,base:ze}),Ie=WN(e,`FORBID_CONTENTS`,Le,{transform:nt}),me=WN(e,`FORBID_TAGS`,dN({}),{transform:nt}),he=WN(e,`FORBID_ATTR`,dN({}),{transform:nt}),Fe=rN(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?dN(e.USE_PROFILES):e.USE_PROFILES:!1,_e=e.ALLOW_ARIA_ATTR!==!1,ve=e.ALLOW_DATA_ATTR!==!1,ye=e.ALLOW_UNKNOWN_PROTOCOLS||!1,be=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,Ce=e.WHOLE_DOCUMENT||!1,Oe=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Ae=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,je=e.SANITIZE_DOM!==!1,Me=e.SANITIZE_NAMED_PROPS||!1,Pe=e.KEEP_CONTENT!==!1,R=e.IN_PLACE||!1,ce=mN(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:jN,Ge=typeof e.NAMESPACE==`string`?e.NAMESPACE:We,Xe=rN(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?dN(e.MATHML_TEXT_INTEGRATION_POINTS):lN({},Ye),Qe=rN(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?dN(e.HTML_INTEGRATION_POINTS):lN({},Ze);let t=rN(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?dN(e.CUSTOM_ELEMENT_HANDLING):LM(null);if(pe=LM(null),rN(t,`tagNameCheck`)&&at(t.tagNameCheck)&&(pe.tagNameCheck=t.tagNameCheck),rN(t,`attributeNameCheck`)&&at(t.attributeNameCheck)&&(pe.attributeNameCheck=t.attributeNameCheck),rN(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),IM(pe),xe&&(ve=!1),ke&&(Oe=!0),Fe&&(le=lN({},xN),de=LM(null),Fe.html===!0&&(lN(le,hN),lN(de,SN)),Fe.svg===!0&&(lN(le,gN),lN(de,CN),lN(de,TN)),Fe.svgFilters===!0&&(lN(le,_N),lN(de,CN),lN(de,TN)),Fe.mathMl===!0&&(lN(le,yN),lN(de,wN),lN(de,TN))),ge.tagCheck=null,ge.attributeCheck=null,rN(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ge.tagCheck=e.ADD_TAGS:KM(e.ADD_TAGS)&&(le===ue&&(le=dN(le)),lN(le,e.ADD_TAGS,nt))),rN(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ge.attributeCheck=e.ADD_ATTR:KM(e.ADD_ATTR)&&(de===fe&&(de=dN(de)),lN(de,e.ADD_ATTR,nt))),rN(e,`ADD_URI_SAFE_ATTR`)&&KM(e.ADD_URI_SAFE_ATTR)&&lN(Be,e.ADD_URI_SAFE_ATTR,nt),rN(e,`FORBID_CONTENTS`)&&KM(e.FORBID_CONTENTS)&&(Ie===Le&&(Ie=dN(Ie)),lN(Ie,e.FORBID_CONTENTS,nt)),rN(e,`ADD_FORBID_CONTENTS`)&&KM(e.ADD_FORBID_CONTENTS)&&(Ie===Le&&(Ie=dN(Ie)),lN(Ie,e.ADD_FORBID_CONTENTS,nt)),Pe&&(le[`#text`]=!0),Ce&&lN(le,[`html`,`head`,`body`]),le.table&&(lN(le,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw oN(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw oN(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=S;S=e.TRUSTED_TYPES_POLICY;try{C=O(``)}catch(e){throw S=t,e}}else e.TRUSTED_TYPES_POLICY===null?(S=void 0,C=``):(S===void 0&&(S=A()),S&&typeof C==`string`&&(C=O(``)));FM&&FM(e),rt=e},st=lN({},[...gN,..._N,...vN]),ct=lN({},[...yN,...bN]),lt=function(e,t,n){return t.namespaceURI===We?e===`svg`:t.namespaceURI===He?e===`svg`&&(n===`annotation-xml`||Xe[n]):!!st[e]},ut=function(e,t,n){return t.namespaceURI===We?e===`math`:t.namespaceURI===Ue?e===`math`&&Qe[n]:!!ct[e]},dt=function(e,t,n){return t.namespaceURI===Ue&&!Qe[n]||t.namespaceURI===He&&!Xe[n]?!1:!ct[e]&&($e[e]||!st[e])},ft=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ge,tagName:`template`});let n=qM(e.tagName),r=qM(t.tagName);return qe[e.namespaceURI]?e.namespaceURI===Ue?lt(n,t,r):e.namespaceURI===He?ut(n,t,r):e.namespaceURI===We?dt(n,t,r):!!(et===`application/xhtml+xml`&&qe[e.namespaceURI]):!1},pt=function(e){WM(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw oN(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},mt=function(e){gt(e);let t=h(e);if(t){let e=[];VM(t,t=>{WM(e,t)}),VM(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;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},ht=function(e,n){try{WM(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{WM(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(Oe||ke)try{pt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},z=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;if(!(typeof i!=`string`||de[nt(i)]))try{e.removeAttribute(i)}catch{}}},gt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===BN.element&&z(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},_t=function(e){if(!Se)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===BN.processingInstruction||n===BN.comment&&aN(LN,e.data)){try{p(e)}catch{}continue}if(n===BN.element){let t=e,n=nt(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},vt=function(e){let t=null,r=null;if(De)e=`<remove></remove>`+e;else{let t=YM(e,/^[\r\n\t ]+/);r=t&&t[0]}et===`application/xhtml+xml`&&Ge===We&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=S?O(e):e;if(Ge===We)try{t=new l().parseFromString(i,et)}catch{}if(!t||!t.documentElement){t=j.createDocument(Ge,`template`,null);try{t.documentElement.innerHTML=Ke?C:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ge===We?M.call(t,Ce?`html`:`body`)[0]:Ce?t.documentElement:a},yt=function(e){let t=x?x(e):e.ownerDocument;return te.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bt=function(e){return e=XM(e,ie,` `),e=XM(e,ae,` `),e=XM(e,P,` `),e},xt=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=te.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=bt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&VM(i,e=>{B(e.content)&&xt(e.content)})},St=function(e){let t=b?b(e):null;return typeof t!=`string`||nt(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)},B=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===BN.documentFragment}catch{return!1}},Ct=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function wt(e,n,r){e.length!==0&&VM(e,e=>{e.call(t,n,r,rt)})}let Tt=function(e,t){return!!(Se&&e.hasChildNodes()&&!Ct(e.firstElementChild)&&aN(IN,e.textContent)&&aN(IN,e.innerHTML)||Se&&e.namespaceURI===We&&t===`style`&&Ct(e.firstElementChild)||e.nodeType===BN.processingInstruction||Se&&e.nodeType===BN.comment&&aN(LN,e.data))},Et=function(e,t,n){if(!me[t]&&jt(t)&&(pe.tagNameCheck instanceof RegExp&&aN(pe.tagNameCheck,t)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(t)))return!1;if(Pe&&!Ie[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 pt(e),!0},Dt=function(e,t,n,r){return e.length===0?t:t===n||t===r?dN(t):t},Ot=function(e,n){if(wt(N.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return R&>(e),!0;if(St(e))return pt(e),!0;let r=nt(b?b(e):e.nodeName);if(le=Dt(N.uponSanitizeElement,le,ue,Te),wt(N.uponSanitizeElement,e,{tagName:r,allowedTags:le}),e!==n&&g(e)===null)return R&>(e),!0;if(Tt(e,r))return pt(e),!0;if(me[r]||!(ge.tagCheck instanceof Function&&ge.tagCheck(r))&&!le[r]){let t=Et(e,r,n);return t===!1&&wt(N.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===BN.element&&!ft(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&aN(RN,e.innerHTML))return pt(e),!0;if(xe&&e.nodeType===BN.text){let n=bt(e.textContent);e.textContent!==n&&(WM(t.removed,{element:e.cloneNode()}),e.textContent=n)}return wt(N.afterSanitizeElements,e,null),!1},kt=function(e,t,r){if(he[t]||Se&&t===`patchsrc`||Se&&t===`for`&&e!==`label`&&e!==`output`||je&&(t===`id`||t===`name`)&&(r in n||r in it))return!1;let i=de[t]||ge.attributeCheck instanceof Function&&ge.attributeCheck(t,e);if(!(ve&&aN(F,t))&&!(_e&&aN(I,t))){if(!i){if(!(jt(e)&&(pe.tagNameCheck instanceof RegExp&&aN(pe.tagNameCheck,e)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(e))&&(pe.attributeNameCheck instanceof RegExp&&aN(pe.attributeNameCheck,t)||pe.attributeNameCheck instanceof Function&&pe.attributeNameCheck(t,e))||t===`is`&&pe.allowCustomizedBuiltInElements&&(pe.tagNameCheck instanceof RegExp&&aN(pe.tagNameCheck,r)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(r))))return!1}else if(!Be[t]&&!aN(ce,XM(r,se,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ZM(r,`data:`)===0&&Re[e])&&!(ye&&!aN(oe,XM(r,se,``)))&&r)return!1}return!0},At=lN({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),jt=function(e){return!At[qM(e)]&&aN(L,e)},Mt=function(e,t,n,r){if(S&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return O(r);case`TrustedScriptURL`:return k(r)}return r},Nt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),St(e)?pt(e):UM(t.removed)}catch{ht(n,e)}},Pt=function(e){wt(N.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||St(e))return;de=Dt(N.uponSanitizeAttribute,de,fe,Ee);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0},r=t.length,i=nt(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=nt(o),u=c,d=o===`value`?u:QM(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,wt(N.uponSanitizeAttribute,e,n),d=n.attrValue,Me&&(l===`id`||l===`name`)&&ZM(d,Ne)!==0&&(ht(o,e),d=Ne+d),Se&&aN(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){ht(o,e);continue}if(l===`attributename`&&YM(d,`href`)){ht(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){ht(o,e);continue}if(!be&&aN(zN,d)){ht(o,e);continue}if(xe&&(d=bt(d)),!kt(i,l,d)){ht(o,e);continue}d=Mt(i,l,s,d),d!==u&&Nt(e,o,s,d)}}wt(N.afterSanitizeAttributes,e,null)},Ft=function(e){let t=null,n=yt(e);for(wt(N.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(wt(N.uponSanitizeShadowNode,t,null),Ot(t,e),Pt(t),B(t.content)&&Ft(t.content),(y?y(t):t.nodeType)===BN.element){let e=_(t);B(e)&&(It(e),Ft(e))}wt(N.afterSanitizeShadowDOM,e,null)},It=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ft(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===BN.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`&&nt(e)===`template`){let e=n.content;B(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);B(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(Ke=!e,Ke&&(e=`<!-->`),typeof e!=`string`&&!Ct(e)&&(e=fN(e),typeof e!=`string`))throw oN(`dirty is not a string, aborting`);if(!t.isSupported)return e;we?(le=Te,de=Ee):ot(n),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(le=dN(le)),N.uponSanitizeAttribute.length>0&&(de=dN(de)),t.removed=[];let c=R&&typeof e!=`string`&&Ct(e);if(c){_t(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=nt(t);if(!le[n]||me[n])throw mt(e),oN(`root node is forbidden and cannot be sanitized in-place`)}if(St(e))throw mt(e),oN(`root node is clobbered and cannot be sanitized in-place`);try{It(e)}catch(t){throw mt(e),t}}else if(Ct(e))i=vt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===BN.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),It(a);else{if(!Oe&&!xe&&!Ce&&e.indexOf(`<`)===-1)return S&&Ae?O(e):e;if(i=vt(e),!i)return Oe?null:Ae?C:``}i&&De&&pt(i.firstChild);let l=c?e:i;try{let e=yt(l);for(;o=e.nextNode();)Ot(o,l),Pt(o),B(o.content)&&Ft(o.content)}catch(n){throw c&&(mt(e),VM(t.removed,e=>{e.element&>(e.element)})),n}if(c)return VM(t.removed,e=>{e.element&>(e.element)}),xe&&xt(e),e;if(Oe){if(xe&&xt(i),ke)for(s=ne.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(de.shadowroot||de.shadowrootmode)&&(s=re.call(r,s,!0)),s}let u=Ce?i.outerHTML:i.innerHTML;return Ce&&le[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&aN(PN,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
27
|
-
`+u),xe&&(u=bt(u)),S&&Ae?O(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ot(e),we=!0,Te=le,Ee=de},t.clearConfig=function(){rt=null,we=!1,Te=null,Ee=null,S=w,C=``},t.isValidAttribute=function(e,t,n){rt||ot({});let r=nt(e),i=nt(t);return kt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&rN(N,e)&&WM(N[e],t)},t.removeHook=function(e,t){if(rN(N,e)){if(t!==void 0){let n=HM(N[e],t);return n===-1?void 0:GM(N[e],n,1)[0]}return UM(N[e])}},t.removeHooks=function(e){rN(N,e)&&(N[e]=[])},t.removeAllHooks=function(){N=UN()},t}var KN=GN(),qN=new Map,JN=KN();async function YN(e,t){let n=`${e}:${t}`;if(qN.has(n))return qN.get(n);let r=i().then(e=>(qN.set(n,e),e)).catch(e=>{throw qN.delete(n),e});return qN.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 JN.sanitize(r)}}var XN=[`innerHTML`],ZN=[`src`],QN=W({__name:`DisplayIconifyRemoteIcon`,props:{icon:{}},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 Sr(async()=>{if(!r.value){i.value=void 0;return}try{i.value=await YN(r.value.collection,r.value.icon)}catch{i.value=void 0}}),(t,n)=>r.value?(K(),q(`div`,{key:0,innerHTML:i.value},null,8,XN)):(K(),q(`img`,{key:1,src:e.icon,class:`m-auto h-full w-full`,draggable:`false`},null,8,ZN))}});function $N(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function eP(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n);return[t=>{let n=vr(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=>(_r(r,e),e)]}function tP(){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 nP(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 rP(e){return e==null}function iP(e,t){return rP(e)?!1:Array.isArray(e)?e.some(e=>_b(e,t)):_b(e,t)}function aP(e){return e?e.flatMap(e=>e.type===os?aP(e.children):[e]):[]}var[oP,sP]=eP(`ConfigProvider`),cP=Jt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});function lP(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 uP(e,t,n=`.`,r){if(!lP(t))return uP(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]]:lP(a)&&lP(i[t])?uP(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function dP(e){return(...t)=>t.reduce((t,n)=>uP(t,n,``,e),{})}var fP=dP(),pP=Vu(()=>{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=``,cP.layersWithOutsidePointerEventsDisabled.size===0&&(document.body.style.pointerEvents=``),document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,Mu&&i?.(),t.value=void 0};return Tr(n,(e,o)=>{if(!Du)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`?fP({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`),Mu&&(i=Zu(document,`touchmove`,e=>gP(e),{passive:!1})),Zn(()=>{n.value&&(document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`)})},{immediate:!0,flush:`sync`}),e});function mP(e){let t=Math.random().toString(36).substring(2,7),n=pP();n.value.set(t,e??!1);let r=Q({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return Gu(()=>{n.value.delete(t)}),r}function hP(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:hP(t)}}function gP(e){let t=e||window.event,n=t.target;return n instanceof Element&&hP(n)?!1:t.touches.length>1||(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function _P(e){let t=oP({dir:V(`ltr`)});return Q(()=>e?.value||t.dir?.value||`ltr`)}function vP(e){let t=Fs(),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(ae(t))]=(...n)=>e(t,...n)}),r}var yP=0;function bP(){Sr(e=>{if(!Du)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??xP()),document.body.insertAdjacentElement(`beforeend`,t[1]??xP()),yP++,e(()=>{yP===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),yP--})})}function xP(){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 SP(e){return Q(()=>!pn(e)||!!Xu(e)?.closest(`form`))}function CP(){let e=Fs(),t=V(),n=Q(()=>r());Qi(()=>{n.value!==r()&&fn(t)});function r(){return t.value&&`$el`in t.value&&[`#text`,`#comment`].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:Xu(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 wP(e){let t=Fs(),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=xn(e);return Q(()=>{let e={},i=t?.vnode.props??{};return Object.keys(i).forEach(t=>{e[ae(t)]=i[t]}),Object.keys({...n,...e}).reduce((e,t)=>(r.value[t]!==void 0&&(e[t]=r.value[t]),e),{})})}function TP(e,t){let n=wP(e),r=t?vP(t):{};return Q(()=>({...n.value,...r}))}function EP(){let e=Fs()?.vnode?.scopeId;return e?{[e]:``}:{}}var DP=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},OP=new WeakMap,kP=new WeakMap,AP={},jP=0,MP=function(e){return e&&(e.host||MP(e.parentNode))},NP=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=MP(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})},PP=function(e,t,n,r){var i=NP(t,Array.isArray(e)?e:[e]);AP[n]||(AP[n]=new WeakMap);var a=AP[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=(OP.get(e)||0)+1,l=(a.get(e)||0)+1;OP.set(e,c),a.set(e,l),o.push(e),c===1&&i&&kP.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(),jP++,function(){o.forEach(function(e){var t=OP.get(e)-1,i=a.get(e)-1;OP.set(e,t),a.set(e,i),t||(kP.has(e)||e.removeAttribute(r),kP.delete(e)),i||e.removeAttribute(n)}),jP--,jP||(OP=new WeakMap,OP=new WeakMap,kP=new WeakMap,AP={})}},FP=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||DP(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),PP(r,i,n,`aria-hidden`)):function(){return null}};function IP(e){let t;Tr(()=>Xu(e),e=>{let n=!1;try{n=!!e?.closest(`[popover]:not(:popover-open)`)}catch{}e&&!n?t=FP(e):t&&t()}),ea(()=>{t&&t()})}var LP=0;function RP(e,t=`reka`){if(e)return e;let n,r=oP({useId:void 0});return n=r.useId?r.useId():`useId`in xu?ii?.():`${++LP}`,t?`${t}-${n}`:n}function zP(e){let t=V(),n=Q(()=>t.value?.width??0),r=Q(()=>t.value?.height??0),i;return Xi(()=>{let n=Xu(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}),ea(()=>{i?.disconnect(),i=void 0}),{width:n,height:r}}function BP(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 VP(e){let t=Hu(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=tP(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=UP(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 HP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function UP(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=HP(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 WP(e,t){let n=V({}),r=V(`none`),i=V(e),a=e.value?`mounted`:`unmounted`,o,s=t.value?.ownerDocument.defaultView??Yu,{state:c,dispatch:l}=BP(a,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),u=e=>{if(Du){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};Tr(e,async(e,i)=>{let a=i!==e;if(await Zn(),a){let a=r.value,o=GP(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=GP(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=GP(t.value))},p=Tr(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=Tr(c,()=>{let e=GP(t.value);r.value=c.value===`mounted`?e:`none`});return ea(()=>{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 GP(e){return e&&getComputedStyle(e).animationName||`none`}var KP=W({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){let{present:r,forceMount:i}=vn(e),a=V(),{isPresent:o}=WP(r,a);n({present:o});let s=t.default({present:o.value});s=aP(s||[]);let c=Fs();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?tc(t.default({present:o.value})[0],{ref:e=>{let t=Xu(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),qP=W({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=aP(n.default()),r=e.findIndex(e=>e.type!==cs);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?ks(t,i.props):t,o=Cs({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),JP=[`area`,`img`,`input`],YP=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`&&JP.includes(r)?()=>tc(r,t):r===`template`?()=>tc(qP,t,{default:n.default}):()=>tc(e.as,t,{default:n.default})}});function XP(){let e=V();return{primitiveElement:e,currentElement:Q(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Xu(e))}}function ZP({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 QP({type:e,defaultValue:t,modelValue:n}){return e||ZP({type:e,defaultValue:t,modelValue:n})}function $P({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function eF(e,t){let n=Q(()=>QP(e)),r=xd(e,`modelValue`,t,{defaultValue:$P(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=_b(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(iP(t,e)){let n=t.findIndex(t=>_b(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Q(()=>n.value===`single`)}}var[tF,nF]=eP(`DialogRoot`),rF=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=xd(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=V(),a=V(),{modal:o,unmountOnHide:s}=vn(n);return nF({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})}}),iF=W({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;CP();let n=tF();return(e,r)=>(K(),J(H(YP),ks(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`]))}}),aF=`dismissableLayer.pointerDownOutside`,oF=`dismissableLayer.focusOutside`;function sF(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 cF(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=V(!1),a=V(()=>{});return Sr(o=>{if(!Du||!pn(n))return;let s=async n=>{let o=n.target;if(!(!t?.value||!o)){if(sF(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){nP(aF,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:()=>{pn(n)&&(i.value=!0)}}}function lF(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=V(!1);return Sr(a=>{if(!Du||!pn(n))return;let o=async n=>{if(!t?.value)return;await Zn(),await Zn();let r=n.target;!t.value||!r||sF(t.value,r)||n.target&&!i.value&&nP(oF,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{pn(n)&&(i.value=!0)},onBlurCapture:()=>{pn(n)&&(i.value=!1)}}}var uF=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}=CP(),o=Q(()=>a.value?.ownerDocument??globalThis.document),s=Q(()=>cP.layersRoot),c=Q(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=Q(()=>cP.layersWithOutsidePointerEventsDisabled.size>0),u=Q(()=>{let e=Array.from(s.value),[t]=[...cP.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=cF(async e=>{let t=[...cP.branches].some(t=>t?.contains(e.target));!n.present||!u.value||t||(r(`pointerDownOutside`,e),r(`interactOutside`,e),await Zn(),e.defaultPrevented||r(`dismiss`))},a),f=lF(e=>{let t=[...cP.branches].some(t=>t?.contains(e.target));!n.present||t||(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return td(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),Tr([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{!e||!n||t&&(cP.layersWithOutsidePointerEventsDisabled.size===0&&(cP.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),cP.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{cP.layersWithOutsidePointerEventsDisabled.delete(e),cP.layersWithOutsidePointerEventsDisabled.size===0&&!rP(cP.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=cP.originalBodyPointerEvents)}))},{immediate:!0}),Tr([a,()=>n.present],([e,t],n,r)=>{!e||!t||(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),Sr(e=>{e(()=>{a.value&&(s.value.delete(a.value),cP.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(K(),J(H(YP),{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`]))}}),dF=wu(()=>V([]));function fF(){let e=dF();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=pF(e.value,t),e.value.unshift(t)},remove(t){e.value=pF(e.value,t),e.value[0]?.resume()}}}function pF(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var mF=`focusScope.autoFocusOnMount`,hF=`focusScope.autoFocusOnUnmount`,gF={bubbles:!1,cancelable:!0};function _F(e,{select:t=!1}={}){let n=tP();for(let r of e)if(CF(r,{select:t}),tP()!==n)return!0}function vF(e){let t=yF(e);return[bF(t,e),bF(t.reverse(),e)]}function yF(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 bF(e,t){for(let n of e)if(!xF(n,{upTo:t}))return n}function xF(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 SF(e){return e instanceof HTMLInputElement&&`select`in e}function CF(e,{select:t=!1}={}){if(e&&e.focus){let n=tP();e.focus({preventScroll:!0}),e!==n&&SF(e)&&t&&e.select()}}var wF=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}=CP(),o=V(null),s=fF(),c=Jt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Sr(e=>{if(!Du)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:CF(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||CF(o.value,{select:!0}))}function s(e){let n=o.value;n!==null&&e.some(e=>e.removedNodes.length>0)&&(t.contains(n)||CF(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(mF,gF),i=e=>r(`mountAutoFocus`,e);e.addEventListener(mF,i),e.dispatchEvent(n),e.removeEventListener(mF,i),n.defaultPrevented||(_F(yF(e),{select:!0}),tP()===t&&CF(e))}Sr(async e=>{let t=a.value;if(await Zn(),!t)return;n.present!==!1&&s.add(c);let i=tP();!t.contains(i)&&n.present!==!1&&l(t,i),e(()=>{let e=new CustomEvent(hF,gF),n=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(hF,n),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||CF(i??document.body,{select:!0}),t.removeEventListener(hF,n),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})}),Tr(()=>n.present,async(e,t)=>{if(!Du)return;if(e===!1&&t===!0){s.remove(c);return}if(e!==!0||t!==!1)return;s.add(c),await Zn();let n=a.value;if(!n)return;let r=tP();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=tP();if(t&&r){let t=e.currentTarget,[i,a]=vF(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&CF(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&CF(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(K(),J(H(YP),{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`]))}}),TF=[`Enter`,` `],EF=[`ArrowDown`,`PageUp`,`Home`],DF=[`ArrowUp`,`PageDown`,`End`];[...EF,...DF],[...TF],[...TF];function OF(e){return e?`open`:`closed`}function kF(e){let t=tP();for(let n of e)if(n===t||(n.focus(),tP()!==t))return}var AF=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=tF(),{forwardRef:a,currentElement:o}=CP();return i.titleId||=RP(void 0,`reka-dialog-title`),i.descriptionId||=RP(void 0,`reka-dialog-description`),Xi(()=>{i.contentElement=o,tP()!==document.body&&(i.triggerElement.value=tP())}),(e,t)=>(K(),J(H(wF),{"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(uF),ks({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(OF)(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`]))}}),jF=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=tF(),a=vP(r),{forwardRef:o,currentElement:s}=CP();IP(Q(()=>n.present?s.value:void 0));let c=Q(()=>{let{present:e,...t}=n;return t});return Tr(()=>n.present,(e,t)=>{!e&&t&&i.triggerElement.value?.focus()}),(e,t)=>(K(),J(AF,ks({...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`]))}}),MF=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=vP(t);CP();let i=tF(),a=V(!1),o=V(!1),s=Q(()=>{let{present:e,...t}=n;return t});return Tr(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(K(),J(AF,ks({...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`]))}}),NF=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=tF(),a=vP(r),{forwardRef:o}=CP();return(e,t)=>(K(),J(H(KP),{present:e.forceMount||H(i).open.value,"force-mount":e.forceMount||!H(i).unmountOnHide.value},{default:U(({present:t})=>[H(i).modal.value?hr((K(),J(jF,ks({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`])),[[Hc,H(i).unmountOnHide.value||t]]):hr((K(),J(MF,ks({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`])),[[Hc,H(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),PF=W({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;CP();let n=tF();return(e,r)=>(K(),J(H(YP),ks(t,{id:H(n).descriptionId}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`id`]))}}),FF=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=tF(),r=mP(t.present);return Tr(()=>t.present,e=>r.value=e),CP(),(e,t)=>(K(),J(H(YP),{as:e.as,"as-child":e.asChild,"data-state":H(n).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=au(()=>{},[`left`,`self`,`prevent`])},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),IF=W({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=tF(),{forwardRef:n}=CP();return(e,r)=>H(t)?.modal.value?(K(),J(H(KP),{key:0,present:e.forceMount||H(t).open.value,"force-mount":e.forceMount||!H(t).unmountOnHide.value},{default:U(({present:r})=>[hr(X(FF,ks(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`]),[[Hc,H(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):Z(`v-if`,!0)}}),LF=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=Qu();return(e,t)=>H(i)||e.forceMount?(K(),J(Br,{key:0,to:r.value,disabled:e.disabled,defer:e.defer},[G(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):Z(`v-if`,!0)}}),RF=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(LF),be(Ss(t)),{default:U(()=>[G(e.$slots,`default`)]),_:3},16))}}),zF=W({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=tF();return CP(),(e,r)=>(K(),J(H(YP),ks(t,{id:H(n).titleId}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16,[`id`]))}}),BF=W({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=tF(),{forwardRef:r,currentElement:i}=CP();return n.contentId||=RP(void 0,`reka-dialog-content`),Xi(()=>{n.triggerElement.value=i.value}),(e,i)=>(K(),J(H(YP),ks(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`]))}}),VF=`data-reka-collection-item`;function HF(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:V(),itemMap:V(new Map)},_r(r,i)):i=vr(r);let a=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${VF}]`)),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}=XP();return Tr(a,()=>{i.collectionRef.value=a.value}),()=>tc(qP,{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}=XP();return Sr(t=>{if(a.value){let n=an(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>tc(qP,{...n,[VF]:``,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 UF=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(YP),{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`]))}}),WF=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}=XP();return Tr(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(UF,ks({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),GF=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(os,null,[Z(` We render single input if it's required `),n.value?(K(),J(WF,ks({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(K(!0),q(os,{key:1},pa(r.value,n=>(K(),J(WF,ks({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),KF=`rovingFocusGroup.onEntryFocus`,qF={bubbles:!1,cancelable:!0},JF={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function YF(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function XF(e,t,n){let r=YF(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return JF[r]}function ZF(e,t=!1){let n=tP();for(let r of e)if(r===n||(r.focus({preventScroll:t}),tP()!==n))return}function QF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[$F,eI]=eP(`PopperRoot`),tI=W({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=V();return eI({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>G(e.$slots,`default`)}}),nI=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}=CP(),i=$F();return Cr(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(K(),J(H(YP),{ref:H(n),as:e.as,"as-child":e.asChild},{default:U(()=>[G(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function rI(e){return e!==null}function iI(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]=aI(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 aI(e){let[t,n=`center`]=e.split(`-`);return[t,n]}function oI(){return typeof window<`u`}function sI(e){return uI(e)?(e.nodeName||``).toLowerCase():`#document`}function cI(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lI(e){return((uI(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function uI(e){return oI()?e instanceof Node||e instanceof cI(e).Node:!1}function dI(e){return oI()?e instanceof Element||e instanceof cI(e).Element:!1}function fI(e){return oI()?e instanceof HTMLElement||e instanceof cI(e).HTMLElement:!1}function pI(e){return!oI()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof cI(e).ShadowRoot}function mI(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=TI(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function hI(e){return/^(table|td|th)$/.test(sI(e))}function gI(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _I=/transform|translate|scale|rotate|perspective|filter/,vI=/paint|layout|strict|content/,yI=e=>!!e&&e!==`none`,bI;function xI(e){let t=dI(e)?TI(e):e;return yI(t.transform)||yI(t.translate)||yI(t.scale)||yI(t.rotate)||yI(t.perspective)||!CI()&&(yI(t.backdropFilter)||yI(t.filter))||_I.test(t.willChange||``)||vI.test(t.contain||``)}function SI(e){let t=DI(e);for(;fI(t)&&!wI(t);){if(xI(t))return t;if(gI(t))return null;t=DI(t)}return null}function CI(){return bI??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),bI}function wI(e){return/^(html|body|#document)$/.test(sI(e))}function TI(e){return cI(e).getComputedStyle(e)}function EI(e){return dI(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function DI(e){if(sI(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||pI(e)&&e.host||lI(e);return pI(t)?t.host:t}function OI(e){let t=DI(e);return wI(t)?(e.ownerDocument||e).body:fI(t)&&mI(t)?t:OI(t)}function kI(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=OI(e),i=r===e.ownerDocument?.body,a=cI(r);if(i){let e=AI(a);return t.concat(a,a.visualViewport||[],mI(r)?r:[],e&&n?kI(e):[])}return t.concat(r,kI(r,[],n))}function AI(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jI(e){let t=TI(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=fI(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Nd(n)!==a||Nd(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function MI(e){return dI(e)?e:e.contextElement}function NI(e){let t=MI(e);if(!fI(t))return Fd(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=jI(t),o=(a?Nd(n.width):n.width)/r,s=(a?Nd(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var PI=Fd(0);function FI(e){let t=cI(e);return!CI()||!t.visualViewport?PI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function II(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===cI(e)}function LI(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=MI(e),o=Fd(1);t&&(r?dI(r)&&(o=NI(r)):o=NI(e));let s=II(a,n,r)?FI(a):Fd(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=cI(a),t=dI(r)?cI(r):r,n=e,i=AI(n);for(;i&&t!==n;){let e=NI(i),t=i.getBoundingClientRect(),r=TI(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=cI(i),i=AI(n)}}return rf({width:u,height:d,x:c,y:l})}function RI(e,t){let n=EI(e).scrollLeft;return t?t.left+n:LI(lI(e)).left+n}function zI(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-RI(e,n),y:n.top+t.scrollTop}}function BI(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=lI(r),s=t?gI(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Fd(1),u=Fd(0),d=fI(r);if((d||!a)&&((sI(r)!==`body`||mI(o))&&(c=EI(r)),d)){let e=LI(r);l=NI(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?zI(o,c):Fd(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 VI(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function HI(e){let t=EI(e),n=e.ownerDocument.body,r=Md(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Md(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+RI(e),o=-t.scrollTop;return TI(n).direction===`rtl`&&(a+=Md(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var UI=25;function WI(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=cI(e),a=lI(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!CI()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(RI(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<=UI&&(s-=o)}return{width:s,height:c,x:l,y:u}}function GI(e,t){let n=LI(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=NI(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function KI(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=WI(e,n,t);else if(t===`document`)r=HI(lI(e));else if(dI(t))r=GI(t,n);else{let n=FI(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rf(r)}function qI(e,t){let n=t.get(e);if(n)return n;let r=kI(e,[],!1).filter(e=>dI(e)&&sI(e)!==`body`),i=null,a=TI(e).position===`fixed`,o=a?DI(e):e;for(;dI(o)&&!wI(o);){let e=TI(o),t=xI(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=DI(o)}return t.set(e,r),r}function JI(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gI(t)?[]:qI(t,this._c):[].concat(n),r],o=KI(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=KI(t,a[e],i);s=Md(n.top,s),c=jd(n.right,c),l=jd(n.bottom,l),u=Md(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function YI(e){let{width:t,height:n}=jI(e);return{width:t,height:n}}function XI(e,t,n){let r=fI(t),i=lI(t),a=n===`fixed`,o=LI(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Fd(0);if((r||!a)&&((sI(t)!==`body`||mI(i))&&(s=EI(t)),r)){let e=LI(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=RI(i));let l=i&&!r&&!a?zI(i,s):Fd(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 ZI(e){return TI(e).position===`static`}function QI(e,t){if(!fI(e)||TI(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return lI(e)===n&&(n=n.ownerDocument.body),n}function $I(e,t){let n=cI(e);if(gI(e))return n;if(!fI(e)){let t=DI(e);for(;t&&!wI(t);){if(dI(t)&&!ZI(t))return t;t=DI(t)}return n}let r=QI(e,t);for(;r&&hI(r)&&ZI(r);)r=QI(r,t);return r&&wI(r)&&ZI(r)&&!xI(r)?n:r||SI(e)||n}var eL=async function(e){let t=this.getOffsetParent||$I,n=this.getDimensions,r=await n(e.floating);return{reference:XI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tL(e){return TI(e).direction===`rtl`}var nL={convertOffsetParentRelativeRectToViewportRelativeRect:BI,getDocumentElement:lI,getClippingRect:JI,getOffsetParent:$I,getElementRects:eL,getClientRects:VI,getDimensions:YI,getScale:NI,isElement:dI,isRTL:tL};function rL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iL(e,t,n){let r=null,i,a=lI(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=Pd(d),h=Pd(a.clientWidth-(u+f)),g=Pd(a.clientHeight-(d+p)),_=Pd(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Md(0,jd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!rL(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=cI(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function aL(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=MI(e),u=i||a?[...l?kI(l):[],...t?kI(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?iL(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?LI(e):null;c&&g();function g(){let t=LI(e);h&&!rL(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=vf,sL=yf,cL=ff,lL=xf,uL=hf,dL=lf,fL=bf,pL=(e,t,n)=>{let r=new Map,i=n??{},a={...nL,...i.platform,_c:r};return cf(e,t,{...i,platform:a})};function mL(e){return typeof e==`object`&&!!e&&`$el`in e}function hL(e){if(mL(e)){let t=e.$el;return uI(t)&&sI(t)===`#comment`?null:t}return e}function gL(e){return typeof e==`function`?e():H(e)}function _L(e){return{name:`arrow`,options:e,fn(t){let n=hL(gL(e.element));return n==null?{}:dL({element:n,padding:e.padding}).fn(t)}}}function vL(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yL(e,t){let n=vL(e);return Math.round(t*n)/n}function bL(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=Q(()=>gL(n.open)??!0),a=Q(()=>gL(n.middleware)),o=Q(()=>gL(n.placement)??`bottom`),s=Q(()=>gL(n.strategy)??`absolute`),c=Q(()=>gL(n.transform)??!0),l=Q(()=>hL(e.value)),u=Q(()=>hL(t.value)),d=V(0),f=V(0),p=V(s.value),m=V(o.value),h=ln({}),g=V(!1),_=Q(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=yL(u.value,d.value),n=yL(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...vL(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;pL(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 Tr([a,o,s,i],y,{flush:`sync`}),Tr([l,u],x,{flush:`sync`}),Tr(i,S,{flush:`sync`}),R()&&Fe(b),{x:Zt(d),y:Zt(f),strategy:Zt(p),placement:Zt(m),middlewareData:Zt(h),isPositioned:Zt(g),floatingStyles:_,update:y}}var xL=[`dir`],SL={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},[CL,wL]=eP(`PopperContent`),TL=W({inheritAttrs:!1,__name:`PopperContent`,props:Na({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}},{...SL}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=$F(),{forwardRef:a,currentElement:o}=CP(),s=_P(Q(()=>n.dir)),c=V(),l=V(),{width:u,height:d}=zP(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(rI),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&&cL({...h.value,...g.value}),n.avoidCollisions&&sL({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?fL():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&cL({...h.value,...g.value}),lL({...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&&_L({element:l.value,padding:n.arrowPadding}),iI({arrowWidth:u.value,arrowHeight:d.value,dir:s.value}),n.hideWhenDetached&&uL({strategy:`referenceHidden`,...h.value})]),{floatingStyles:v,placement:y,isPositioned:b,middlewareData:x,update:S}=bL(Q(()=>n.reference??i.anchor.value),c,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...e)=>aL(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:_}),C=Q(()=>aI(y.value)[0]),w=Q(()=>aI(y.value)[1]);Cr(()=>{b.value&&r(`placed`)});let T=Q(()=>{let e=x.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),E=V(``);return Sr(()=>{o.value&&(E.value=window.getComputedStyle(o.value).zIndex)}),wL({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?rc([n.asChild,n.as,C.value,w.value,H(b),...Object.values(e.$attrs),...n.memoDependencies],()=>(K(),J(H(YP),ks({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(YP),ks({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,xL))}});function EL(e){let t=oP({nonce:V()});return Q(()=>e?.value||t.nonce?.value)}var[DL,OL]=eP(`RovingFocusGroup`),kL=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}=vn(r),c=_P(s),l=xd(r,`currentTabStopId`,i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),u=V(!1),d=V(!1),f=V(0),{getItems:p,CollectionSlot:m}=HF({isProvider:!0});function h(e){let t=!d.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!u.value){let t=new CustomEvent(KF,qF);if(e.currentTarget.dispatchEvent(t),i(`entryFocus`,t),!t.defaultPrevented){let e=p().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);ZF([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}),OL({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(YP),{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}))}}),AL=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=DL(),r=RP(),i=Q(()=>t.tabStopId||r),a=Q(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=HF();Xi(()=>{t.focusable&&n.onFocusableItemAdd()}),ea(()=>{t.focusable&&n.onFocusableItemRemove()}),Tr(()=>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=XF(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?QF(i,t+1):i.slice(t+1)}Zn(()=>ZF(i))}}return(e,t)=>(K(),J(H(s),null,{default:U(()=>[X(H(YP),{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}))}}),[jL,ML]=eP(`CheckboxGroupRoot`);function NL(e){return e===`indeterminate`}function PL(e){return NL(e)?`indeterminate`:e?`checked`:`unchecked`}var[FL,IL]=eP(`CheckboxRoot`),LL=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}=CP(),o=jL(null),s=xd(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),c=Q(()=>o?.disabled.value||n.disabled),l=Q(()=>_b(s.value,n.trueValue)),u=Q(()=>rP(o?.modelValue.value)?s.value===`indeterminate`?`indeterminate`:l.value:iP(o.modelValue.value,n.value));function d(){if(rP(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(iP(e,n.value)){let t=e.findIndex(e=>_b(e,n.value));e.splice(t,1)}else e.push(n.value);o.modelValue.value=e}}let f=SP(a),p=EP(),m=Aa(),h=Q(()=>{if(!m[`aria-label`])return n.id&&a.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0});return IL({disabled:c,state:u}),(e,t)=>(K(),q(os,null,[(K(),J(la(H(o)?.rovingFocus.value?H(AL):H(YP)),ks({...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(NL)(u.value)?`mixed`:u.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||h.value,"data-state":H(PL)(u.value),"data-disabled":c.value?``:void 0,disabled:c.value,focusable:H(o)?.rovingFocus.value?!c.value:void 0,onKeydown:su(au(()=>{},[`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(GF),ks({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))}}),RL=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}=CP(),n=FL();return(e,r)=>(K(),J(H(KP),{present:e.forceMount||H(NL)(H(n).state.value)||H(n).state.value===!0},{default:U(()=>[X(H(YP),ks({ref:H(t),"data-state":H(PL)(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`]))}}),zL=[` `,`Enter`,`ArrowUp`,`ArrowDown`],BL=[` `,`Enter`];function VL(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>HL(e,t,n)):HL(e,t,n)}function HL(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]:_b(e,t)}function UL(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var WL=[`value`],[GL,KL]=eP(`SelectRoot`),qL=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}=vn(n),c=xd(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=xd(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:rP(c.value));HF({isProvider:!0});let m=_P(s),h=SP(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=>HL(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=>VL(e,t.value,n.by))}return KL({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(tI),null,{default:U(()=>[G(e.$slots,`default`,{modelValue:H(c),open:H(l)}),H(h)&&e.name?(K(),J(JL,{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(rP)(H(c))?(K(),q(`option`,{key:0,value:e.nullableValue},null,8,WL)):Z(`v-if`,!0),(K(!0),q(os,null,pa(Array.from(g.value),e=>(K(),q(`option`,ks({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):Z(`v-if`,!0)]),_:3}))}}),JL=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=GL();Tr(()=>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(UF),{"as-child":``},{default:U(()=>[Y(`select`,ks({ref_key:`selectElement`,ref:n},t,{onInput:i}),[G(e.$slots,`default`)],16)]),_:3}))}}),YL=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=wP(e);return(e,n)=>(K(),J(H(TL),ks(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))}}),XL={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[ZL,QL]=eP(`SelectContent`),$L=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=GL();bP(),mP(n.bodyLock);let{CollectionSlot:a,getItems:o}=HF(),s=V();IP(s);let{search:c,handleTypeaheadSearch:l}=VP(),u=V(),d=V(),f=V(),p=V(!1),m=V(!1),h=V(!1);function g(){d.value&&s.value&&kF([d.value,s.value])}Tr(p,()=>{g()});let{onOpenChange:_,triggerPointerDownPosRef:v}=i;Sr(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(()=>kF(t)),e.preventDefault()}}let b=wP(Q(()=>n.position===`popper`?n:{}).value);return QL({content:s,viewport:u,onViewportChange:e=>{u.value=e},itemRefCallback:(e,t,n)=>{let r=!m.value&&!n,a=VL(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;(VL(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(wF),{"as-child":``,onMountAutoFocus:t[6]||=au(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{r(`closeAutoFocus`,e),!e.defaultPrevented&&(H(i).triggerElement.value?.focus({preventScroll:!0}),e.preventDefault())}},{default:U(()=>[X(H(uF),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onFocusOutside:t[2]||=au(()=>{},[`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(la(e.position===`popper`?YL:nR),ks({...e.$attrs,...H(b)},{id:H(i).contentId,ref:e=>{if(!e)return;let t=H(Xu)(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]||=au(()=>{},[`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}))}}),[eR,tR]=eP(`SelectItemAlignedPosition`),nR=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}=HF(),a=GL(),o=ZL(),s=V(!1),c=V(!0),l=V(),{forwardRef:u,currentElement:d}=CP(),{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=$N(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=$N(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(``);Xi(async()=>{await Zn(),g(),d.value&&(_.value=window.getComputedStyle(d.value).zIndex)});function v(e){e&&c.value===!0&&(g(),h?.(),c.value=!1)}return yd(a.triggerElement,()=>{g()}),tR({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(YP),ks({ref:H(u),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:U(()=>[G(e.$slots,`default`)]),_:3},16)],4))}}),rR=W({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{type:Object,required:!0}},setup(e){return KL(e.context),QL(XL),(e,t)=>G(e.$slots,`default`)}}),iR={key:1},aR=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=TP(n,t),i=GL(),a=V();Xi(()=>{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 Tr(s,(e,t,n)=>{u(),l=setTimeout(()=>{c.value=s.value,l=void 0}),n(u)}),ea(u),(e,t)=>s.value||c.value||o.value?.present?(K(),J(H(KP),{key:0,ref_key:`presenceRef`,ref:o,present:s.value},{default:U(()=>[X($L,be(Ss({...H(r),...e.$attrs})),{default:U(()=>[G(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`])):a.value?(K(),q(`div`,iR,[(K(),J(Br,{to:a.value},[X(rR,{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(YP),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:U(()=>[G(e.$slots,`default`,{},()=>[t[0]||=ws(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),[sR,cR]=eP(`SelectItem`),lR=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}=vn(n),a=GL(),o=ZL(),{forwardRef:s,currentElement:c}=CP(),{CollectionItem:l}=HF(),u=Q(()=>VL(a.modelValue?.value,n.value,a.by)),d=V(!1),f=V(n.textValue??``),p=RP(void 0,`reka-select-item-text`);async function m(e){e.defaultPrevented||nP(`select.select`,h,{originalEvent:e,value:n.value})}async function h(e){await Zn(),r(`select`,e),!e.defaultPrevented&&(i.value||(a.onValueChange(n.value),a.multiple.value||a.onOpenChange(!1)))}async function g(e){await Zn(),!e.defaultPrevented&&(i.value?o.onItemLeave?.():e.currentTarget?.focus({preventScroll:!0}))}async function _(e){await Zn(),!e.defaultPrevented&&e.currentTarget===tP()&&o.onItemLeave?.()}async function v(e){await Zn(),!e.defaultPrevented&&(o.searchRef?.value===``||e.key!==` `)&&(BL.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 Xi(()=>{c.value&&o.itemRefCallback(c.value,n.value,n.disabled)}),cR({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(YP),{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]||=au(()=>{},[`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`]))}}),uR=W({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=sR();return(e,r)=>H(n).isSelected.value?(K(),J(H(YP),ks({key:0,"aria-hidden":`true`},t),{default:U(()=>[G(e.$slots,`default`)]),_:3},16)):Z(`v-if`,!0)}}),dR=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(LF),be(Ss(t)),{default:U(()=>[G(e.$slots,`default`)]),_:3},16))}}),fR=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=GL(),{forwardRef:r,currentElement:i}=CP(),a=Q(()=>n.disabled?.value||t.disabled);n.contentId||=RP(void 0,`reka-select-content`),Xi(()=>{n.onTriggerChange(i.value)});let{getItems:o}=HF(),{search:s,handleTypeaheadSearch:c,resetTypeahead:l}=VP();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(nI),{"as-child":``,reference:e.reference},{default:U(()=>[X(H(YP),{ref:H(r),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":H(n).contentId,"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(UL)(H(n).modelValue?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:g,onPointerdown:m,onMousedown:h,onPointerup:t[0]||=au(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(zL).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`]))}}),pR=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}=vn(t),r=EL(n),i=ZL(),a=i.position===`item-aligned`?eR():void 0,{forwardRef:o,currentElement:s}=CP();Xi(()=>{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(os,null,[X(H(YP),ks({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(YP),{as:`style`,nonce:H(r)},{default:U(()=>n[0]||=[ws(` /* 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))}}),[mR,hR]=eP(`ToggleGroupRoot`),gR=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}=vn(n),c=_P(s),{forwardRef:l,currentElement:u}=CP(),{modelValue:d,changeModelValue:f,isSingle:p}=eF(n,r),m=SP(u);return hR({isSingle:p,modelValue:d,changeModelValue:f,dir:c,orientation:n.orientation,loop:i,rovingFocus:a,disabled:o}),(e,t)=>(K(),J(la(H(a)?H(kL):H(YP)),{"as-child":``,orientation:H(a)?e.orientation:void 0,dir:H(c),loop:H(a)?H(i):void 0},{default:U(()=>[X(H(YP),{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(GF,{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`]))}}),_R=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}=CP(),o=EP(),s=mR(null),c=xd(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=SP(a);return(e,t)=>(K(),q(os,null,[X(H(YP),ks({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(GF,ks({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))}}),vR=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=mR(),r=Q(()=>n.disabled?.value||t.disabled),i=Q(()=>iP(n.modelValue.value,t.value)),{forwardRef:a}=CP(),o=EP();return(e,s)=>(K(),J(la(H(n).rovingFocus.value?H(AL):H(YP)),ks({"as-child":``},H(n).rovingFocus.value?{focusable:!r.value,active:i.value}:{}),{default:U(()=>[X(H(_R),ks({...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(Ss(t)))]),_:3},16,[`disabled`,`model-value`])]),_:3},16))}}),yR={class:`inline-flex items-center gap-2 min-w-0`},bR={class:`truncate font-semibold text-primary`},xR={class:`flex flex-col min-w-0 flex-1 of-hidden`},SR={class:`flex items-center gap-1.5`},CR={class:`truncate font-medium`},wR={key:0,class:`shrink-0 text-10px op-fade border border-base rounded px-1`},TR={key:0,class:`text-11px color-faint truncate`},ER=`i-ph:database-duotone`,DR=W({__name:`DataSourceSelect`,props:Pa({sources:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=no(e,`modelValue`),r=Q(()=>t.sources.find(e=>e.id===n.value));function i(e){return e?.icon||ER}return(t,a)=>(K(),J(H(qL),{modelValue:n.value,"onUpdate:modelValue":a[0]||=e=>n.value=e},{default:U(()=>[X(H(fR),{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`,yR,[X(QN,{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`,bR,Oe(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(dR),null,{default:U(()=>[X(H(aR),{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(pR),{class:`p-1`},{default:U(()=>[(K(!0),q(os,null,pa(e.sources,e=>(K(),J(H(lR),{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(QN,{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`,xR,[Y(`span`,SR,[Y(`span`,CR,Oe(e.title),1),e.static?(K(),q(`span`,wR,`static`)):Z(``,!0)]),e.description?(K(),q(`span`,TR,Oe(e.description),1)):Z(``,!0)]),X(H(uR),{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`]))}}),OR={class:`px3 py2 border-b border-base flex flex-col gap-2 shrink-0`},kR={class:`flex items-center gap-2`},AR=[`title`],jR={key:0,class:`text-xs color-muted`},MR=W({__name:`DataSourcePanel`,setup(e){let t=pM(),n=V(!1);return(e,r)=>(K(),q(`div`,OR,[Y(`div`,kR,[r[4]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none ws-nowrap`},` Data Source `,-1),X(DR,{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},Oe(H(t).activeSource.value?.description),9,AR)):Z(``,!0),r[5]||=Y(`div`,{class:`flex-auto`},null,-1),X(gm,{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(Zw).connected&&!H(t).sources.value.length?(K(),q(`div`,jR,[...r[6]||=[ws(` No data sources registered yet. Call `,-1),Y(`code`,{class:`font-mono bg-secondary border border-base rounded px-1`},`registerDataSource()`,-1),ws(` 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),ws(`. `,-1)]])):Z(``,!0),n.value?(K(),J(CM,{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)]))}}),NR=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))}}),PR=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 px-2.5! py-1!`:`btn-primary`:t.variant===`text`?`inline-flex items-center gap-1.5 op75 hover:op100 transition${a.value?` text-sm`:``}`:a.value?`btn-action-sm`:`btn-action`),s=Q(()=>t.disabled||t.loading);return(t,a)=>(K(),J(la(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(NR,{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:FR,hasOwnProperty:IR}=Object.prototype,LR=e=>FR.call(e),RR=Object.hasOwn||((e,t)=>IR.call(e,t));function $(e,t,n){let r=document.createElement(e);typeof t==`string`&&(t={class:t});for(let e in t)if(RR(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 zR(e){return document.createTextNode(String(e))}function BR(e){return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function VR(...e){let t=document.createDocumentFragment();return e.forEach(e=>t.appendChild(e instanceof Node?e:zR(e))),t}var HR=!(()=>{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}),UR=/\.\d+(?:eE[-+]?\d+)?|\B(?=(?:\d{3})+(?:\D|$))/g;function WR(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function GR(e,t=!0){let n=t&&typeof e!=`number`?WR(String(e)):String(e);return n.length>3?n.replace(UR,e=>e||`<span class="num-delim"></span>`):n}var KR=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}},qR=typeof ResizeObserver==`function`,JR=class extends KR{static supported=qR;el;observer;constructor(){super(null),this.el=null,this.observer=qR?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}},YR=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}},XR=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 N(e){return e.display.wrapper.ownerDocument}function ie(e){return ae(e.display.wrapper)}function ae(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function P(e){return N(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,N=0;N<u;)if(i.test(d[N])){var ie=N;for(++N;N<u&&i.test(d[N]);++N);M.push(new o(0,ie,N))}else{var ae=N,P=M.length,F=+(c==`rtl`);for(++N;N<u&&d[N]!=`L`;++N);for(var I=ae;I<N;)if(a.test(d[I])){ae<I&&(M.splice(P,0,new o(1,ae,I)),P+=F);var oe=I;for(++I;I<N&&a.test(d[I]);++I);M.splice(P,0,new o(2,oe,I)),P+=F,ae=I}else++I;ae<N&&M.splice(P,0,new o(1,ae,N))}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 V(e){return+!!e.inclusiveRight}function ln(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)||V(e)-V(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||ln(r,i.marker)<0)&&(r=i.marker);return r}function dn(e){return un(e,!0)}function fn(e){return un(e,!1)}function H(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||ln(r,a.marker)<0)&&(r=a.marker)}return r}function pn(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)||V(c.marker)-V(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&&(!_||ln(_.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 U(e,t,n,r){return _r(e,gr(e,t),n,r)}function hr(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=hr(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(N(e)));var c=s.left+(r==`window`?0:Er(N(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(N(e)),i-=Dr(N(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,U(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=H(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 W(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&&ii(e,u,i)}else(l||e.options.showCursorWhenSelecting)&&ii(e,c.head,i);l||oi(e,c,a)}}return r}function ii(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=U(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(ie(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(ie(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(ae(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 G(e){var t=ma(e);return t.x*=pa,t.y*=pa,t}function ha(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=hr(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(pn(e,t.line,t,n,a)||t.line!=n.line&&pn(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();ii(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 K(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/)?K(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 K(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 fs(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())}),q(e,i+` `+t,n,r))return!0}return q(e,t,n,r)}function q(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 J(e,t){var n=ns(t,!0);return n?t.shiftKey&&!e.state.keySeq?hs(e,`Shift-`+n,t,function(t){return fs(e,t,!0)})||hs(e,n,t,function(t){if(typeof t==`string`?/^go[A-Z]/.test(t):t.motion)return fs(e,t)}):hs(e,n,t,function(t){return fs(e,t)}):!1}function gs(e,t,n){return hs(e,`'`+n+`'`,t,function(t){return fs(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(ie(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=J(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 Y(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)&&J(t,e))){var i=String.fromCharCode(r??n);i!=`\b`&&(gs(t,e,i)||t.display.input.onKeyPress(e))}}}var X=400,xs=function(e,t,n){this.time=e,this.pos=t,this.button=n};xs.prototype.compare=function(e,t,n){return this.time+X>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 xs(n,e,t),Ss=null,`double`):(Ss=new xs(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&&Z(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 Z(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 Es(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(ie(e));var i=Es(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(ie(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 ha(e,t)}),R(t.scroller,`DOMMouseScroll`,function(t){return ha(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,Y)),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 Q(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(Y),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=tc(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()?tc(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=tc(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(ie(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 tc(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(ae(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=W(this.cm,!1);return e.focus=te(ae(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(ae(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=hr(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=W(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(ae(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(ae(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=G,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),Q(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}))})),ZR=l(XR(),1);function QR(e){let t=new Set([`has`,`in`,`no`,`not`,`and`,`or`,`is`,`asc`,`ascN`,`ascA`,`ascAN`,`ascNA`,`desc`,`descN`,`descA`,`descAN`,`descNA`]),n=ZR.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 ZR.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 $R(e,t){let n=typeof t.isDiscoveryViewDefined==`function`?t.isDiscoveryViewDefined:()=>{},r=ZR.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(XR()):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 N(){D.state.context=new ne(D.state.context,D.state.localVars,!1),D.state.localVars=re}function ie(){D.state.context=new ne(D.state.context,D.state.localVars,!0),D.state.localVars=null}N.lex=ie.lex=!0;function ae(){D.state.localVars=D.state.context.vars,D.state.context=D.state.context.prev}ae.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(`}`),ie,Oe,F,ae):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`),ie,Xe,oe,ae,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`),ie,Oe,F,F,ae):e==`case`?k(L,I(`:`)):e=="default"?k(I(`:`)):e==`catch`?k(P(`form`),N,se,oe,F,ae):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(N,P(`)`),Ee(nt,`)`),F,I(`=>`),r,ae);if(e==`variable`)return O(N,We,I(`=>`),r,ae)}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(N,n?_e:ge,ae);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(N,P(`)`),Ee(nt,`)`),F,je,oe,ae);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(N,P(`)`),Ee(nt,`)`),F,je,ae);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!=ae)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:ez,compatMode:tz}=document,nz=tz===`CSS1Compat`;function rz(e){let t=e.offsetParent;for(;t!==null&&t!==ez&&getComputedStyle(t).position===`static`;)t=t.offsetParent;return t||ez}function iz(e){let t=e.parentNode;for(;t!==null&&t!==ez&&getComputedStyle(t).overflow===`visible`;)t=t.parentNode;return t||ez}function az(e=null){let t=0,n=0;if(typeof e?.getBoundingClientRect==`function`){let r=e.getBoundingClientRect();t=-r.top,n=-r.left}else if(nz)t=window.pageYOffset||ez.scrollTop,n=window.pageXOffset||ez.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=az(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 sz(e,t=null){let{top:n,left:r}=e===(nz?ez:document.body)&&!t?az():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 cz=`discovery-view-editor-hints-popup`,lz=`discovery-view-editor-hint`,uz=`active`,dz=window.requestAnimationFrame||(e=>setTimeout(e,1e3/60)),fz=window.cancelAnimationFrame||clearTimeout;ZR.default.commands.autocomplete=ZR.default.showHint,ZR.default.defineOption(`showHintOptions`,null),ZR.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 pz(this,e),this.state.completionActive.update(!0),ZR.default.signal(this,`startCompletion`,this)))});var pz=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&&ZR.default.signal(this.data,`close`),this.widget.close()),ZR.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(mz(n),n.from||e.from,n.to||e.to,`complete`),ZR.default.signal(e,`pick`,n),this.close()}cursorActivity(){this.debounce&&=(fz(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=dz(()=>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&&ZR.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 gz(this,e),ZR.default.signal(e,`shown`)))}};function mz(e){return typeof e==`string`?e:e.text}function hz(e,t){for(;t&&t.parentNode!==e;)t=t.parentNode;return t}var gz=class{constructor(e,t){let n=e.cm,r=this.hintsEl=document.createElement(`ul`),i=[cz,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=lz,n===this.selectedHint&&i.classList.add(uz),e.render?e.render(i,t,e):i.appendChild(document.createTextNode(e.displayText||mz(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,HR);ZR.default.on(r,`mousedown`,e=>{let t=hz(r,e.target),i=this.items.indexOf(t);i!==-1&&(this.close(),this.selectedHint=i,this.pick(),setTimeout(()=>n.focus(),1))}),ZR.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,HR)}}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(uz),r.classList.add(uz),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),ZR.default.signal(this.data,`select`,this.data.list[this.selectedHint],r))}getCursorCoords(){let{completion:e,hintsEl:t}=this,n=e.cm,r=rz(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}=iz(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(ZR.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 _z=(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=WR(i.substring(0,u))+`<span class="match">`+WR(i.slice(u,u+l.length))+`</span>`+WR(i.slice(u+l.length))),e.classList.add(`type-`+n),e.appendChild($(`span`,`name`,i))},vz=class extends YR{static CodeMirror=ZR.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,ZR.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 JR;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()}},yz=class extends vz{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:_z,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)}},bz=class extends vz{constructor(){super({mode:{name:`discovery-view`,isDiscoveryViewDefined:e=>this.isViewDefined(e)}})}isViewDefined(){return!1}};ZR.default.defineMode(`jora`,QR),ZR.default.defineMode(`discovery-query`,QR),ZR.default.defineMode(`discovery-view`,$R);function xz(e){Object.assign(e.view,{QueryEditor:class extends yz{get container(){return e.dom.container}},ViewEditor:class extends bz{isViewDefined(t){return e.view.isDefined(t)||e.textView.isDefined(t)}}})}var Sz={class:`flex flex-col gap-2 h-full min-h-0`},Cz={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`},wz={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`},Tz=`jora query, runs as you type. Ctrl+Space for suggestions, Ctrl+Enter to run now`,Ez=W({__name:`QueryEditor`,props:Pa({syntax:{},suggestions:{}},{modelValue:{default:``},modelModifiers:{}}),emits:Pa([`run`,`suggest`,`accept`,`dismiss`],[`update:modelValue`]),setup(e,{emit:t}){let n=e,r=t,i=no(e,`modelValue`),a=ln(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}),Zn(()=>{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 Xi(()=>{let e=a.value;if(!e)return;let t=new vz({mode:`jora`,placeholder:Tz,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}),$i(()=>{clearTimeout(c),s?.state.completionActive?.close(),o?.el.remove(),o=null,s=null}),Tr(i,e=>o?.setValue(e??``)),Tr(()=>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`,Sz,[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`,Cz,Oe(e.syntax.message),1)):e.syntax.kind===`pending`?(K(),q(`div`,wz,` incomplete query, keep typing `)):Z(``,!0)]))}}),Dz=`outline-none border border-base rounded bg-base 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`,Oz=W({inheritAttrs:!1,__name:`FormCheckbox`,props:Pa({label:{},disabled:{type:Boolean}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=no(e,`modelValue`);return(n,r)=>e.label||n.$slots.default?(K(),q(`label`,ks({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(LL),{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,disabled:e.disabled,class:ye(Dz)},{default:U(()=>[X(H(RL),{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`,{},()=>[ws(Oe(e.label),1)])])],16)):(K(),J(H(LL),ks({key:1},n.$attrs,{modelValue:t.value,"onUpdate:modelValue":r[1]||=e=>t.value=e,disabled:e.disabled,class:Dz}),{default:U(()=>[X(H(RL),{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`]))}}),kz={class:`flex flex-col gap-2 text-sm`},Az={class:`flex items-center gap-4 flex-wrap`},jz={class:`flex items-center gap-2 select-none color-base`},Mz=[`disabled`],Nz=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=no(e,`modelValue`),n=no(e,`autoRun`),r=no(e,`autoRunSeconds`);return(e,i)=>(K(),q(`div`,kz,[Y(`div`,Az,[i[5]||=Y(`span`,{class:`text-xs font-medium color-muted uppercase tracking-wide select-none`},`Filters`,-1),X(Oz,{modelValue:t.value.excludeFunctions,"onUpdate:modelValue":i[0]||=e=>t.value.excludeFunctions=e,label:`Exclude functions`},null,8,[`modelValue`]),X(Oz,{modelValue:t.value.excludeUnderscoreProps,"onUpdate:modelValue":i[1]||=e=>t.value.excludeUnderscoreProps=e,label:`Exclude _ props`},null,8,[`modelValue`]),X(Oz,{modelValue:t.value.excludeDollarProps,"onUpdate:modelValue":i[2]||=e=>t.value.excludeDollarProps=e,label:`Exclude $ props`},null,8,[`modelValue`])]),Y(`div`,jz,[X(Oz,{modelValue:n.value,"onUpdate:modelValue":i[3]||=e=>n.value=e,label:`Auto rerun every`},null,8,[`modelValue`]),hr(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,Mz),[[Gl,r.value,void 0,{number:!0}]]),Y(`span`,{class:ye([`text-xs`,n.value?`color-muted`:`color-faint`])},`seconds`,2)])]))}}),Pz={class:`border-b border-base flex-auto flex-col flex`},Fz={class:`flex px3 py2 items-center gap-2 select-none`},Iz=W({__name:`QueryPanel`,setup(e){let t=pM(),n=ln(!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`,Pz,[Y(`div`,Fz,[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(gm,{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(PR,{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(PR,{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(Ez,{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(Nz,{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`])]))}}),Lz={neutral:`color-scale-neutral`,low:`color-scale-low`,medium:`color-scale-medium`,high:`color-scale-high`,critical:`color-scale-critical`};function Rz(e,t){for(let[n,r]of t)if(e<=n)return r;return t.at(-1)?.[1]??Lz.neutral}var zz=`en-US`,Bz=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`],Vz=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`];function Hz(e,t={}){let{base:n=1024,digits:r=2}=t;if(!e||e<0)return[`0`,`B`];let i=n===1e3?Vz:Bz,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 Uz=1024,Wz=1024*Uz,Gz=[[80*Uz,Lz.neutral],[500*Uz,Lz.low],[Wz,Lz.medium],[10*Wz,Lz.high],[1/0,Lz.critical]];function Kz(e,t=Gz){return Rz(e,t)}var qz={ns:1e-6,us:.001,ms:1,s:1e3};function Jz(e,t={}){if(e==null)return[``,`-`];let n=t.unit??`ms`,r=e*qz[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 Yz=[[50,Lz.neutral],[200,Lz.low],[1e3,Lz.medium],[5e3,Lz.high],[1/0,Lz.critical]];function Xz(e,t=Yz){return Rz(e,t)}var Zz=1e3,Qz=60*Zz,$z=60*Qz,eB=24*$z,tB=30*eB,nB=365*eB,rB=[[Qz,Zz,`s`],[$z,Qz,`min`],[eB,$z,`h`],[tB,eB,`d`],[nB,tB,`mo`],[1/0,nB,`y`]];function iB(e,t=Date.now()){let n=t-(e instanceof Date?e.getTime():e),r=Math.abs(n);if(r<Zz)return`just now`;for(let[e,t,i]of rB)if(r<e){let e=Math.round(r/t);return n>=0?`${e} ${i} ago`:`in ${e} ${i}`}return``}var aB=[[180*eB,Lz.neutral],[365*eB,Lz.low],[3*nB,Lz.medium],[5*nB,Lz.high],[1/0,Lz.critical]];function oB(e,t=aB){return Rz(e,t)}function sB(e,t,n){return new Intl.DateTimeFormat(n??zz,t??{dateStyle:`medium`,timeStyle:`short`}).format(e)}var cB={class:`text-xs ml-0.5 op-fade`},lB={key:0,class:`text-xs ml-1 op-mute`},uB=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(()=>Hz(t.bytes,{base:t.base,digits:t.digits})),r=Q(()=>t.colorize?Kz(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,[ws(Oe(n.value[0]),1),Y(`span`,cB,Oe(n.value[1]),1),i.value==null?Z(``,!0):(K(),q(`span`,lB,Oe(i.value.toFixed(0))+`%`,1))])])],2))}}),dB=[`datetime`],fB=W({__name:`DisplayDate`,props:{date:{},colorize:{type:Boolean},scale:{},live:{type:Boolean},interval:{default:3e4}},setup(e){let t=e,n=V(Date.now());qu(()=>{t.live&&(n.value=Date.now())},xn(t,`interval`)),Tr(()=>t.date,()=>{t.live&&(n.value=Date.now())});let r=Q(()=>new Date(t.date).getTime()),i=Q(()=>iB(r.value,t.live?n.value:Date.now())),a=Q(()=>sB(r.value)),o=Q(()=>t.colorize?oB(Math.abs(n.value-r.value),t.scale):``);return(e,t)=>hr((K(),q(`time`,{datetime:new Date(r.value).toISOString(),class:ye(o.value)},[G(e.$slots,`default`,{relative:i.value,exact:a.value},()=>[ws(Oe(i.value),1)])],10,dB)),[[H(hm),a.value]])}}),pB={class:`text-xs ml-0.5 op-fade`},mB=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(()=>Jz(t.ms,{unit:t.unit})),i=Q(()=>t.colorize?Xz(t.ms*n[t.unit],t.scale):``);return(t,n)=>(K(),q(`span`,{class:ye([i.value,{"font-mono tabular-nums":e.mono}])},[ws(Oe(r.value[0]),1),Y(`span`,pB,Oe(r.value[1]),1)],2))}}),hB=`1.0.0-beta.99`,gB=`1.0.0-beta.15`,_B=Object.hasOwn||((e,t)=>Object.hasOwnProperty.call(e,t)),vB=Object.prototype.toString;function yB(e,t){return t!==void 0&&(TB(t)?t.forEach(t=>e.add(t)):e.add(t)),e}function bB(e,t,n){e.has(t)?e.get(t).add(n):e.set(t,new Set([n]))}function xB(e,t){return e&&_B(e,t)?e[t]:void 0}function SB(e){return typeof e==`object`&&!!e&&e.constructor===Object}function CB(e){return vB.call(e)===`[object RegExp]`}function wB(e){return e&&(TB(e)||_B(e,`length`)&&isFinite(e.length))}function TB(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function EB(e,t=0){let n=parseInt(e,10);return isNaN(n)?t:n}function DB(e){if(TB(e))return e.length>0;if(SB(e)){for(let t in e)if(_B(e,t))return!0;return!1}return!!e}var OB=(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 kB(){this.yy={}}kB.prototype={Parser:kB,lexer:OB,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 AB=(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 kB),jB=s({compile:()=>MB,stringify:()=>PB,walk:()=>NB});function MB(e,t){let n=t.scope.arg1;t.put(typeof n==`string`?n:`undefined`)}function NB(){}function PB(e,t){t.put(`$$`)}var FB=s({compile:()=>LB,stringify:()=>zB,suggest:()=>IB,walk:()=>RB});function IB(e,t){e.elements.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function LB(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}function RB(e,t){t.list(e.elements)}function zB(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}var BB=s({compile:()=>HB,stringify:()=>WB,suggest:()=>VB,walk:()=>UB});function VB(e,t){Array.isArray(e.assertion)||(t.range(e.assertion.range,`var`),t.range(e.assertion.range,`assertion`))}function HB(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 UB(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 WB(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 GB=s({compile:()=>YB,stringify:()=>ZB,suggest:()=>JB,walk:()=>XB}),KB={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 qB(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 JB(e,t){switch(e.operator){case`in`:t.range(e.left.range,`in-value`,e.right,null),qB(t,e.left,e.right);break;case`not in`:qB(t,e.left,e.right);break;case`has`:t.range(e.right.range,`in-value`,e.left,null),qB(t,e.right,e.left);break;case`has no`:qB(t,e.right,e.left);break;case`=`:case`!=`:t.range(e.right.range,`value`,e.left,null)}}function YB(e,t){if(!(e.operator in KB)){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(KB[e.operator])),t.put(`(`),t.node(e.left),t.put(`,`),t.node(e.right),t.put(`)`)}}function XB(e,t){t.node(e.left),t.node(e.right)}function ZB(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 QB=s({compile:()=>eV,stringify:()=>nV,suggest:()=>$B,walk:()=>tV});function $B(e,t){e.body===null&&t.queryRoot(e.range[1])}function eV(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 tV(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}function nV(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}var rV=s({compile:()=>aV,stringify:()=>sV,walk:()=>oV}),iV={"":`cmp`,N:`cmpNatural`,A:`cmpAnalytical`,NA:`cmpNaturalAnalytical`,AN:`cmpNaturalAnalytical`};function aV(e,t){let n=e.order.startsWith(`desc`),r=iV[e.order.slice(n?4:3)]||iV[``];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 sV(e,t){t.node(e.query),t.put(` `),t.put(e.order)}var cV=s({compile:()=>lV,stringify:()=>dV,walk:()=>uV});function lV(e,t){t.put(`(_a, _b)=>{let _q;return `),t.list(e.compares,`||`),t.put(`||0}`)}function uV(e,t){t.list(e.compares)}function dV(e,t){t.list(e.compares,`,`)}var fV=s({compile:()=>pV,stringify:()=>hV,walk:()=>mV});function pV(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 mV(e,t){t.nodeOrNothing(e.test),t.nodeOrNothing(e.consequent),t.nodeOrNothing(e.alternate)}function hV(e,t){t.nodeOrNothing(e.test),t.put(`?`),t.nodeOrNothing(e.consequent),e.alternate&&(t.put(`:`),t.node(e.alternate))}var gV=s({compile:()=>_V,stringify:()=>yV,walk:()=>vV});function _V(e,t){t.put(`context`)}function vV(){}function yV(e,t){t.put(`#`)}var bV=s({compile:()=>SV,stringify:()=>wV,suggest:()=>xV,walk:()=>CV});function xV(e,t){e.range&&t.range(e.range,`var`)}function SV(e,t){t.put(t.scope.$ref)}function CV(){}function wV(e,t){t.put(`$`)}var TV=s({compile:()=>EV,stringify:()=>OV,walk:()=>DV});function EV(e,t){t.put(`data`)}function DV(){}function OV(e,t){t.put(`@`)}var kV=s({compile:()=>AV,stringify:()=>MV,walk:()=>jV});function AV(e,t){e.name&&t.putIdent(`$`+t.unescapeName(e.name,e),e)}function jV(){}function MV(e,t){t.put(e.name?`$`+e.name:`$`)}function NV(e,t){return{type:`GetProperty`,value:e,property:t}}function PV(e){return{type:`Identifier`,name:e}}var FV=s({compile:()=>RV,stringify:()=>BV,suggest:()=>LV,walk:()=>zV}),IV=[`$data`,`$context`,`$ctx`,`$array`,`$idx`,`$index`];function LV(e,t){e.value===null&&t.range(e.declarator.range,`path`)}function RV(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(IV.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||NV(null,PV(n))),t.put(`;`),t.scope.add(r),t.scope.own.add(r),t.scope.awaitInit.delete(r)}function zV(e,t){t.node(e.declarator),t.nodeOrNothing(e.value)}function BV(e,t){t.node(e.declarator),e.value!==null&&(t.put(`:`),t.node(e.value)),t.put(`;`)}var VV=s({compile:()=>HV,stringify:()=>WV,walk:()=>UV});function HV(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 UV(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function WV(e,t){t.nodeOrNothing(e.value),t.put(`.[`),t.node(e.query),t.put(`]`)}var GV=s({compile:()=>KV,stringify:()=>JV,walk:()=>qV});function KV(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 qV(e,t){t.node(e.body)}function JV(e,t){t.put(`=>`),t.node(e.body)}var YV=s({compile:()=>ZV,stringify:()=>$V,suggest:()=>XV,walk:()=>QV});function XV(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 ZV(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,`),t.node(e.property),t.put(`)`)}function QV(e,t){t.nodeOrNothing(e.value),t.node(e.property)}function $V(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.property)}var eH=s({compile:()=>tH,stringify:()=>rH,walk:()=>nH});function tH(e,t){t.put(JSON.stringify(t.unescapeName(e.name,e,!1)))}function nH(){}function rH(e,t){t.put(e.name)}var iH=s({compile:()=>aH,stringify:()=>sH,walk:()=>oH});function aH(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}function oH(){}function sH(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}var cH=s({compile:()=>lH,stringify:()=>dH,walk:()=>uH});function lH(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 uH(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function dH(e,t){t.nodeOrNothing(e.value),t.put(`.(`),t.node(e.query),t.put(`)`)}var fH=s({compile:()=>pH,stringify:()=>hH,walk:()=>mH});function pH(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 mH(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function hH(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 gH=s({compile:()=>vH,stringify:()=>bH,suggest:()=>_H,walk:()=>yH});function _H(e,t){e.arguments.length===0&&t.queryRoot(e.range[1]-1)}function vH(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 yH(e,t){t.node(e.reference),t.list(e.arguments)}function bH(e,t){t.node(e.reference),t.put(`(`),t.list(e.arguments,`,`),t.put(`)`)}var xH=s({compile:()=>SH,stringify:()=>wH,walk:()=>CH});function SH(e,t){t.node(e.method,e.value)}function CH(e,t){t.nodeOrNothing(e.value),t.node(e.method)}function wH(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.method)}var TH=s({compile:()=>DH,stringify:()=>kH,suggest:()=>EH,walk:()=>OH});function EH(e,t){e.properties.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function DH(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}function OH(e,t){t.list(e.properties)}function kH(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}var AH=s({compile:()=>NH,stringify:()=>FH,suggest:()=>MH,walk:()=>PH}),jH=new Set([`Literal`,`Identifier`,`Reference`,`Current`]);function MH(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 NH(e,t){let n=e.value;switch(e.key.type){case`Current`:t.put(`...null`);return;case`Literal`:t.node(e.key),n||=NV(null,PV(String(e.key.value)));break;case`Identifier`:t.node(e.key),n||=NV(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 PH(e,t){t.node(e.key),t.nodeOrNothing(e.value)}function FH(e,t){if(jH.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 IH=s({compile:()=>LH,stringify:()=>zH,walk:()=>RH});function LH(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}function RH(e,t){t.node(e.body)}function zH(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}var BH=s({compile:()=>HH,stringify:()=>WH,suggest:()=>VH,walk:()=>UH});function VH(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 HH(e,t){t.put(t.buildinFn(`pick`)),t.put(`(`),t.node(e.value),e.getter&&(t.put(`,`),t.node(e.getter)),t.put(`)`)}function UH(e,t){t.node(e.value),e.getter!==null&&t.node(e.getter)}function WH(e,t){t.node(e.value),t.put(`[`),e.getter!==null&&t.node(e.getter),t.put(`]`)}var GH=s({compile:()=>KH,stringify:()=>JH,walk:()=>qH});function KH(e,t){t.put(`($=>(`),t.createScope(()=>t.node(e.right),e=>e+`,`),t.put(`))`),t.put(`(`),t.nodeOrCurrent(e.left),t.put(`)`)}function qH(e,t){t.node(e.left),t.node(e.right)}function JH(e,t){t.node(e.left),t.put(`|`),t.node(e.right)}var YH=s({compile:()=>ZH,stringify:()=>$H,suggest:()=>XH,walk:()=>QH});function XH(e,t){t.queryRoot(e.range[1])}function ZH(e,t){t.put(t.scope.$ref)}function QH(){}function $H(){}var eU=s({compile:()=>tU,stringify:()=>rU,walk:()=>nU});function tU(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 nU(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function rU(e,t){t.node(e.argument),t.put(` `),t.node(e.operator)}var iU=s({compile:()=>aU,stringify:()=>sU,walk:()=>oU});function aU(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 sU(e,t){t.put(e.operator),e.operator!==`-`&&e.operator!==`+`&&t.put(` `),t.node(e.argument)}var cU=s({compile:()=>uU,stringify:()=>fU,suggest:()=>lU,walk:()=>dU});function lU(e,t){e.range&&t.range(e.range,`var`)}function uU(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 dU(e,t){t.node(e.name)}function fU(e,t){t.put(`$`),t.node(e.name)}var pU=s({compile:()=>mU,stringify:()=>gU,walk:()=>hU});function mU(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 hU(e,t){t.nodeOrNothing(e.value);for(let n of e.arguments.slice(0,3))n&&t.node(n)}function gU(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 _U=s({compile:()=>yU,stringify:()=>xU,suggest:()=>vU,walk:()=>bU});function vU(e,t){e.query===null&&t.queryRoot(e.range[1])}function yU(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 bU(e,t){t.nodeOrNothing(e.query)}function xU(e,t){t.put(`...`),t.nodeOrNothing(e.query)}var SU=s({compile:()=>wU,stringify:()=>EU,suggest:()=>CU,walk:()=>TU});function CU(e,t){for(let[n,r]of Object.entries(e.values))r===null&&t.queryRoot(e.values[Number(n)-1].range[1])}function wU(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(`"`+kU(r.value,DU)+`"`):(t.put(`(`),t.node(r),t.put(`)`)))}}function TU(e,t){for(let n of e.values)n!==null&&t.node(n)}function EU(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(kU(i.value,OU)),t.put(e===n?"`":"${")):i!==null&&t.node(i)}}var DU=new Map([[`\b`,`\\b`],[`
|
|
64
|
-
`,`\\n`],[`\r`,`\\r`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\u2028`,`\\u2028`],[`\u2029`,`\\u2029`],[`\\`,`\\\\`],[`"`,`\\"`]]),OU=new Map([[`\b`,`\\b`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\\`,`\\\\`],[`$`,`\\$`]]);function kU(e,t){let n=``;for(let r=0;r<e.length;r++)n+=t.get(e[r])||e[r];return n}var AU={Arg1:jB,Array:FB,Assertion:BB,Binary:GB,Block:QB,Compare:rV,Conditional:fV,Context:gV,Current:bV,Data:TV,Declarator:kV,Definition:FV,Filter:VV,Function:GV,GetProperty:YV,Identifier:eH,Literal:iH,Map:cH,MapRecursive:fH,Method:gH,MethodCall:xH,Object:TH,ObjectEntry:AH,Parentheses:IH,Pick:BH,Pipeline:GH,Placeholder:YH,Postfix:eU,Prefix:iU,Reference:cU,SliceNotation:pU,CompareFunction:cV,Spread:_U,Template:SU},jU=e=>new Map(Object.entries(AU).map(([t,n])=>[t,n[e]]).filter(([,e])=>typeof e==`function`)),MU={};jU(`build`).forEach((e,t)=>MU[t]=e);var NU=jU(`compile`),PU=jU(`walk`),FU=jU(`stringify`),IU=jU(`suggest`);function LU(e,t){function n(e){if(PU.has(e.type))i(e),PU.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 RU(e,t){return t>=0&&t<e.length&&/[a-zA-Z_$0-9]/.test(e[t])}function zU(e,t){let n=e.charCodeAt(t);return n===9||n===10||n===13||n===32}function BU(e,t,n){for(;t<n;t++)if(!zU(e,t))return!1;return!0}function VU(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 HU(e,t,n,r){let i=[];for(let a=0;a<e.length;a++){let[o,s,c,l]=e[a];if(BU(t,o,s)){for(;o>=0&&zU(t,o-1);)o--;for(;s<t.length&&zU(t,s);)s++;if(RU(t,o-1)){if(o===s)continue;o++}if(RU(t,s)){if(o===s)continue;s--}}let u=VU(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 UU(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 LU(e,e=>{if(IU.has(e.type)){let n=t;t=e,IU.get(e.type)(e,a),t=n}}),r}function WU(e,{ast:t,commentRanges:n}){let r=UU(t),i=n.length&&n[n.length-1][1]===e.length&&!/[\r\n]$/.test(e);for(let[t,a]of r)r.set(t,HU(a,e,n,i));return r}function GU(e){return e.type===`GetProperty`}function KU(e){return e.type===`MethodCall`}function qU(e){function t(e){if(FU.has(e.type))FU.get(e.type)(e,r);else throw Error(`Unknown node type "`+e.type+`"`)}let n=[],r={isSimpleGetPropertyQuery:GU,isSimpleMethodCallQuery:KU,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 JU(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 YU=/^[\p{ID_Start}$_]$/u,XU=/^[\p{ID_Continue}$]$/u;function ZU(e,t,n){return eW(e,`query`,t,n)}function QU(e,t,n){return eW(e,`method`,t,n)}var $U=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 eW(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(NU.has(e.type))NU.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 $U,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?YU:XU;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(!_B(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(!_B(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
|
-
}`),tW(m,`return`+p.join(``)+`})`)}function tW(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 JU(`SyntaxError`,`Jora query compilation error`,{compiledSource:`function(f,m,a){\n${t}\n}`,details:e})}}var nW=1,rW=2,iW=3,aW=4,oW=5,sW=6,cW=7,lW=8;function uW(e){switch(typeof e){case`boolean`:return nW;case`number`:return e===e?iW:rW;case`string`:return aW;case`object`:return e===null?oW:sW;case`undefined`:return lW;default:return cW}}function dW(e,t){let n=uW(e),r=uW(t);return n===r?e<t?-1:+(e>t):n<r?-1:1}function fW(e,t){let n=uW(e),r=uW(t);return n===r?n===iW?t-e:e<t?-1:+(e>t):n<r?-1:1}function pW(e,t){let n=uW(e),r=uW(t);return(n===iW||n===aW)&&(r===iW||r===aW)?mA(e,t):n===r?e<t?-1:+(e>t):n<r?-1:1}function mW(e,t){let n=uW(e),r=uW(t);return(n===iW||n===aW)&&(r===iW||r===aW)?hA(e,t,!0):n===r?e<t?-1:+(e>t):n<r?-1:1}function hW(e,t){return e.length===1?(n,r)=>t(e(n),e(r)):e}var gW=Object.freeze({awaitInitRef:_W,ensureArray:vW,bool:DB,and:(e,t)=>DB(e)?t:e,or:(e,t)=>DB(e)?e:t,add:yW,sub:bW,mul:xW,div:SW,mod:CW,eq:wW,ne:TW,lt:EW,lte:DW,gt:OW,gte:kW,in:AW,notIn:(e,t)=>!AW(e,t),has:(e,t)=>AW(t,e),hasNo:(e,t)=>!AW(t,e),cmp:dW,cmpAnalytical:fW,cmpNatural:pW,cmpNaturalAnalytical:mW,match:jW,pick:MW,indexOf:NW,lastIndexOf:FW,map:LW,mapRecursive:RW,some:zW,filter:BW,slice:VW});function _W(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 vW(e){return TB(e)?e:[e]}function yW(e,t){return TB(e)||TB(t)?[...new Set([...TB(e)?e:[e],...TB(t)?t:[t]])]:e+t}function bW(e,t){if(TB(e)){let n=new Set(e);return TB(t)?t.forEach(e=>n.delete(e)):n.delete(t),[...n]}return e-t}function xW(e,t){return e*t}function SW(e,t){return e/t}function CW(e,t){return e%t}function wW(e,t){return Object.is(e,t)}function TW(e,t){return!Object.is(e,t)}function EW(e,t){return e<t}function DW(e,t){return e<=t}function OW(e,t){return e>t}function kW(e,t){return e>=t}function AW(e,t){return SB(t)?_B(t,e):t?PW(t,e)!==-1:!1}function jW(e,t){return typeof t==`function`?zW(e,t):CB(t)?zW(e,t.test.bind(t)):t==null}function MW(e,t=()=>!0){if(e){if(typeof t==`function`){if(TB(e)||typeof e==`string`){for(let n=0;n<e.length;n++)if(DB(t(e[n],n)))return e[n]}for(let n in e)if(_B(e,n)&&DB(t(e[n],n)))return e[n];return}return TB(e)||typeof e==`string`?isFinite(t)?e[t<0?e.length+Number(t):Number(t)||0]:void 0:_B(e,t)?e[t]:void 0}}function NW(e,t,n){return e?PW(e,t,n):-1}function PW(e,t,n=0){if(Number.isNaN(t)&&wB(e)){for(let t=EB(n,0);t<e.length;t++)if(Number.isNaN(e[t]))return t}return typeof e.indexOf==`function`?e.indexOf(t,n):-1}function FW(e,t,n){return e?IW(e,t,n):-1}function IW(e,t,n){if(Number.isNaN(t)&&wB(e)){for(let t=EB(n,e.length-1);t>=0;t--)if(Number.isNaN(e[t]))return t}return typeof e.lastIndexOf==`function`?e.lastIndexOf(t,EB(n,e.length-1)):-1}function LW(e,t){let n=typeof t==`function`?t:e=>xB(e,t);return TB(e)?[...e.reduce((e,t)=>yB(e,n(t)),new Set)]:e===void 0?e:n(e)}function RW(e,t){let n=new Set;return yB(n,LW(e,t)),n.forEach(e=>yB(n,LW(e,t))),[...n]}function zW(e,t){return TB(e)?e.some(e=>DB(t(e))):DB(t(e))}function BW(e,t){return TB(e)?e.filter(e=>DB(t(e))):DB(t(e))?e:void 0}function VW(e,t,n,r=1){if(!wB(e))return[];if(t=EB(t,0),n=EB(n,e.length),r=EB(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 HW=UW(20)?1/0:UW(10)?10:0;function UW(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 WW(e,t){return e.length<=HW?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 GW=(e,t)=>e-t,KW=(e,t)=>t-e,qW=class{constructor(e,t,n,r=!1){this.maxSize=e||1/0,this.compare=t||KW,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]()}},JW=class extends qW{},YW=class extends qW{constructor(e,t,n,r){super(e,t?(e,n)=>-t(e,n):GW,n,r)}},XW=e=>e;function ZW(e){return typeof e==`object`&&e?NaN:Number(e)}function QW(e,t,n){if(wB(e)){typeof t!=`function`&&(t=XW);for(let r of e){let e=t(r);e!==void 0&&n(ZW(e))}}}function $W(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 YW(s+1,r):new JW(e.length-o,r);if(QW(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 eG=e=>e;function tG(e,t){let n,r=0,i=0;return QW(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 nG(e,t){let n=[];return QW(e,t,n.push.bind(n)),n}function rG(e,t){let n=0;if(wB(e)){typeof t!=`function`&&(t=eG);for(let r of e)t(r)!==void 0&&n++}return n}function iG(e,t){return tG(e,t).sum}function aG(e,t){let{sum:n,count:r}=tG(e,t);if(r>0)return n/r}function oG(e,t){let n=0,r=0,i=0;if(QW(e,t,e=>{n+=1;let t=e-r;r+=t/n,i+=t*(e-r)}),n>0)return i/n}function sG(e,t){let n=oG(e,t);if(n!==void 0)return Math.sqrt(n)}function cG(e,t=pW){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=hW(t,pW);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 lG(e,t=pW){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=hW(t,pW);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 uG(e,t,n){if(wB(e))return $W(e,t,n)}function dG(e,t){return uG(e,50,t)}function fG(){}function pG(e){return e}function mG(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 hG(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 gG=String.prototype.replaceAll||function(e,t){return CB(e)?this.replace(e,t):this.split(e).join(String(t))},_G=Object.freeze({bool:gW.bool,filter:gW.filter,map:gW.map,pick:gW.pick,indexOf:gW.indexOf,lastIndexOf:gW.lastIndexOf,keys(e){return Object.keys(e||{})},values(e){let t=new Set;for(let n in e)_B(e,n)&&yB(t,e[n]);return[...t]},entries(e){let t=[];for(let n in e)_B(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 SB(e)?Object.keys(e).length:e&&e.length||0},sort(e,t=dW){if(!TB(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=dW(t[e],n[e]);if(r!==0)return r}return 0}return dW(t,n)}}return WW(e,t)},reverse(e){return TB(e)?e.slice().reverse():e},slice(e,t,n){return typeof e==`string`||TB(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=fG),typeof n!=`function`&&(n=pG),TB(e)||(e=[e]);for(let i of e){let e=t(i);if(TB(e)){if(e.length>0){let t=n(i);for(let n of e)bB(r,n,t)}else bB(r,void 0,n(i))}else bB(r,e,n(i))}for(let[e,t]of r)i.push({key:e,value:[...t]});return i},join(e,t){return TB(e)?e.join(t):String(e)},match(e,t,n){let r=String(e),i=CB(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(mG(a));return e}return mG(r.match(t))},reduce(e,t,n=void 0){return TB(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(TB(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(TB(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 CB(t)&&!t.flags.includes(`g`)&&(t=new RegExp(t,t.flags+`g`)),gG.call(String(e),t,typeof n==`function`?(...e)=>n(hG(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:nG,count:rG,sum:iG,avg:aG,variance:oG,stdev:sG,min:cG,max:lG,percentile:uG,p:uG,median:dG}),vG=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:SB,array:TB,regexp:CB,truthy:DB,falsy:e=>!DB(e)}),yG={path:`property`,key:`value`,value:`value`,"in-value":`value`,"value-subset":`value`,var:`variable`,assertion:`assertion`};function bG(e,t){Object.keys(e).forEach(t.add,t)}function xG(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)SB(t)&&bG(t,e);else SB(n)&&bG(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)&&bG(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)TB(n)?n.forEach(i):SB(n)&&bG(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 SG(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 CG(e,t){return typeof e==`function`?e:e===!0&&t}function wG(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 TG(e){return t=>(typeof t==`string`?t:String(t)).toLowerCase().indexOf(e)!==-1}var EG=(e,{value:t,stats:n,assertions:r})=>({get value(){return t},stat(t,r){return SG(e,t,n,r)},suggestion(t,i){let{limit:a=1/0,sort:o,filter:s}=i||{};o=CG(o,gW.cmp),s=CG(s,TG);let c=o&&isFinite(a)?JW:Set,l=SG(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=yG[t];if(!u.has(p)){let e;switch(c){case JW:e=new JW(a,o,s&&s(wG(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:xG(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(wG(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}}),DG=new Map,OG=new Map,kG=new Map,AG=new Map;function jG(e,t,n,r,i){typeof n==`string`?Object.defineProperty(e,t,{configurable:!0,get(){let a=PG(n,`method`)(gW,r,i);return Object.defineProperty(e,t,{enumerable:!0,value:a}),a}}):typeof n==`function`&&Object.defineProperty(e,t,{enumerable:!0,value:n})}function MG(e,t){if(!e&&!t)return{queryMethods:_G,queryAssertions:vG};let n={..._G},r={...vG};for(let[t,i]of Object.entries(e||{})){if(_B(_G,t))throw Error(`Builtin method "${t}" can\'t be overridden`);jG(n,t,i,n,r)}for(let[e,i]of Object.entries(t||{})){if(_B(vG,e))throw Error(`Builtin assertion "${e}" can\'t be overridden`);jG(r,e,i,n,r)}return{queryMethods:n,queryAssertions:r}}function NG(e,t){console.log(`[${e}]`),typeof t==`string`?console.log(t):t!==void 0&&console.dir(t,{depth:null}),console.log()}function PG(e,t,n,r,i){i=typeof i==`function`?i:i?NG:!1,i&&(i(`=========================`),i(`Compile query from source`,e));let a=AB.parse(e,r);i&&(i(`AST`,a.ast),i(`Restored source`,qU(a.ast)));let o=n?WU(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`?QU(a.ast,r,o):ZU(a.ast,r,o);return i&&i(`Compiled code`,s.toString()),s}function FG(e,t){t||={};let n=!!t.stat,r=!!t.tolerant,i=n?r?AG:OG:r?kG:DG,{methods:a,assertions:o}=t||{},{queryMethods:s,queryAssertions:c}=MG(a,o),l;return e=String(e),i.has(e)&&!t.debug?l=i.get(e):(l=PG(e,`query`,n,r,t.debug),i.set(e,l)),l=l(gW,s,c),n?Object.assign((t,n)=>EG(e,l(t,n)),{query:l}):l}function IG(e){let t=new Map,n=new Map,r=new Map,i=new Map,{methods:a,assertions:o}=e||{},{queryMethods:s,queryAssertions:c}=MG(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=PG(e,`query`,o,l,a.debug)(gW,s,c);d=o?Object.assign((n,r)=>EG(e,t(n,r)),{query:t}):t,u.set(e,d)}return d}}var LG=Object.assign(FG,{version:gB,buildin:gW,methods:_G,assertions:vG,setup:IG,syntax:{tokenize:AB.tokenize,parse:AB.parse,suggest:WU,walk:LU,stringify:qU,compile:ZU,compileMethod:QU}});function RG(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 zG(e){let t=RG(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 BG(e){if(!e)return[];if(!Array.isArray(e))throw Error(`Encodings must be an array`);return e.map(zG)}function VG(e){return typeof e==`object`&&!!e&&(typeof e[Symbol.iterator]==`function`||typeof e[Symbol.asyncIterator]==`function`)}function HG(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 UG(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 WG(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 GG(e,t){(e===null||Array.isArray(e)||typeof e!=`object`)&&(e={replacer:e,space:t});let n=UG(e.replacer),r=Object.keys;if(Array.isArray(n)){let e=n;r=()=>e,n=null}return{...e,replacer:n,getKeys:r,space:WG(e.space)}}var KG=1,qG=2,JG=new TextDecoder;function YG(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 XG(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 ZG(e){let t=typeof e==`function`?e():e;if(VG(t)){let e=new QG;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 YG(t,e)}}throw TypeError(`Invalid chunk emitter: Expected an Iterable, AsyncIterable, generator, async generator, or a function returning an Iterable or AsyncIterable`)}var QG=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]===KG?(t&&(this.jsonParseOffset--,e=`{`+e+`}`),Object.assign(this.valueStack.value,JSON.parse(e))):(t&&(this.jsonParseOffset--,e=`[`+e+`]`),XG(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]===KG?`}`:`]`;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]===KG){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]===KG?`{`:`[`)+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=JG.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++]=KG;break;case 91:r=i+1,this.stack[this.flushDepth++]=qG;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}},$G=typeof Object.hasOwn==`function`?Object.hasOwn:(e,t)=>Object.hasOwnProperty.call(e,t),eK={8:`\\b`,9:`\\t`,10:`\\n`,12:`\\f`,13:`\\r`,34:`\\"`,92:`\\\\`},tK=Uint8Array.from({length:2048},(e,t)=>$G(eK,t)?2:t<32?6:t<128?1:2);function nK(e){return e>=55296&&e<=56319}function rK(e){return e>=56320&&e<=57343}function iK(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+=tK[i];else if(nK(i)){t+=6,n=!0;continue}else rK(i)?t=n?t-2:t+6:t+=3;n=!1}return t+2}function aK(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 iK(e);case`number`:return Number.isFinite(e)?Number.isInteger(e)?aK(e):String(e).length:4;case`boolean`:return e?4:5;case`undefined`:case`object`:return 4;default:return 0}}function sK(e,...t){let{replacer:n,getKeys:r,...i}=GG(...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=HG(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=iK(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 cK=Object.freeze({name:`json`,test:()=>!0,streaming:!0,decode:ZG}),lK=new Uint8Array([0,0,74,83,79,78,88,76]),uK=9,dK=268435455,fK=2,pK=4,mK=8,hK=16,gK=32,_K=64,vK=128,yK=0,bK=1,xK=2,SK=3,CK=4,wK=5,TK=6,EK=8,DK=9,OK=10,kK=11,AK=12,jK=224,MK=7936,NK=0,PK=1,FK=2,IK=3,LK=4,RK=5,zK=6,BK=7,VK=8,HK=16,UK=32;~hK;var WK=fK|gK|_K,GK=new Uint8Array(256).map((e,t)=>{for(let n=0;n<8;n++)e+=t>>n&1;return e}),KK=new Uint32Array(16);KK.subarray(0,8),KK.subarray(8,16),new TextEncoder;var qK=new Uint8Array(33);for(let e=0;e<33;e++)qK[32-e]=Math.ceil(e/7)||1;function JK(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}var YK=new Map;Object.freeze({hasInlinedEntries:!1,columns:YK}),Object.freeze({hasInlinedEntries:!0,columns:YK}),XK();function XK(){return new Proxy(Object.create(null),{get(e,t){return Object.hasOwn(e,t)?Reflect.get(...arguments):e[t]=0}})}Object.hasOwnProperty;function ZK(e,t,n,r=Array(n)){let i=t&15,a=t&48,o=n,s=0,c=0;switch(a){case HK:s=r[0]=e.readIntVar(),o--,c=1;break;case UK:s=e.readIntVar()}switch(i){case FK:for(let t=0;t<o;t++)r[c+t]=e.readVlq();break;case IK:for(let t=0;t<o;t++)r[c+t]=e.readIntVar();break;case LK:{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 RK:{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 zK:{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 BK:{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 VK:{let t=r[0]=e.readIntVar(),i=e.readIntVar();for(let e=1;e<n;e++)r[e]=t+=i;break}case NK:case PK:{let n=i===PK,a=t>>8,s=n?t&MK|a&jK:a;if(GK[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 HK:r[0]=s;for(let e=1;e<n;e++)r[e]+=r[e-1];break;case UK:for(let e=0;e<n;e++)r[e]+=s}return r}function QK(e){let t=$K(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 $K(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 eq=12;function tq(e){return e===uK}function nq(e){try{let{version:t}=rq(e);if(tq(t))return!0;throw Error(`Unsupported jsonxl version "${t}", expected "${uK}"`)}catch{return!1}}function rq(e){if(e.byteLength<eq)throw Error(`Header length must be at least ${eq} bytes`);let t=new Uint8Array(e.buffer,e.byteOffset,eq);if(t.subarray(0,8).some((e,t)=>e!==lK[t]))throw Error(`Bad magic number`);let n=new DataView(t.buffer,t.byteOffset,eq);return{version:n.getUint16(8,!0),flags:n.getUint16(10,!0),headerSize:eq}}var iq=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}=rq(this.view);return this.pos+=n,{version:e,flags:t}}loadStrings(){this.strings=QK(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&dK,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 yK:return this.readUint8();case bK:return this.readUint16();case xK:return this.readUint24();case SK:return this.readUint32();case CK:return this.readUintVar();case EK:return this.readInt8();case DK:return this.readInt16();case OK:return this.readInt24();case kK:return this.readInt32();case AK:return this.readIntVar();case wK:return this.readFloat32();case TK:return this.readFloat64()}}readNumericArrayEncoding(){let e=this.readUint8();switch(e&15){case NK:case PK:case zK:case BK: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 ZK(this,e,t,n)}};function aq(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=Sy.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=GK[u]>1?a.readTypeIndex(e,u,!0):null;if(u&WK){if(f===null)switch(u){case fK:d.fill(null);break;case gK:d.fill(!0);break;case _K:d.fill(!1);break}else for(let t=0;t<e;t++)switch(f[t]){case fK:d[t]=null;break;case gK:d[t]=!0;break;case _K:d[t]=!1;break}}if(u&mK)for(let t=0;t<e;t++)(f===null||f[t]===mK)&&(d[t]=a.readString());if(u&pK){if(u===pK)a.readNumbers(o,e,d);else{let t=JK(f,pK),n=a.readNumbers(o,t);for(let t=0,r=0;t<e;t++)f[t]===pK&&(d[t]=n[r++])}}if(u&vK){if(l){let t=u===vK?e:JK(f,vK),n=a.readNumericArray(t),i=r();for(let t=0,r=0,a=0;t<e;t++)(f===null||f[t]===vK)&&(d[t]=i.slice(a,a+=n[r++]))}else for(let t=0;t<e;t++)(f===null||f[t]===vK)&&(d[t]=r())}if(u&hK){let t=u===hK?d:[];for(let n=0,r=0;n<e;n++)(f===null||f[n]===hK)&&(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 fK:return null;case mK:return a.readString();case pK:return a.readNumber(e>>3);case hK:return n();case gK:return!0;case _K:return!1;case vK:return r()}}let a=new iq(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:nq,streaming:!1,decode:aq}),sq=[{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 cq(e){return e.reduce((e,t)=>e+t.byteLength,0)}function lq(e,t){switch(e.length){case 0:return;case 1:return e[0];default:{let n=new Uint8Array(t||cq(e)),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}}}async function uq(e){let t=[],n=0;for await(let r of e)t.push(r),n+=r.byteLength;return lq(t,n)}function dq(e,t){if(typeof e!=`string`){for(let n of t)if(n.test(e))return n}return null}var fq=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=dq(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)}},pq=262144,mq=class{#e;#t;#n;constructor(e,t=pq){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 hq(e){try{return new URL(e,location.origin).origin===location.origin}catch{return!1}}function gq(e){return e.ok}function _q(e){return e.headers.get(`x-file-encoded-size`)||e.headers.get(`content-length`)}function vq(e){return e.headers.get(`x-file-size`)||(hq(e.url)&&!e.headers.get(`content-encoding`)?e.headers.get(`content-length`):void 0)}function yq(e){return e.headers.get(`x-file-created-at`)||e.headers.get(`last-modified`)||void 0}function bq(e){let t=e?Object.keys(e):[],n=[`name`,`createdAt`,`elapsedTime`,`data`];return!(t.length!==4||t.some(e=>!n.includes(e)))}function xq(e,t,{size:n,compression:r,encoding:i}){let a=null;if(bq(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 Sq(e,t,n,r){let i=Date.now(),a=[...BG(t),oq,cK],o=0,s=!1,c=`unknown`,l=0;await r(`receiving`,d(!1));let u=e.pipeThrough(new TransformStream(new mq(f))).pipeThrough(new TransformStream(new fq(sq,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):uq(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 Cq(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 Sq(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}=xq(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 wq(e,t){let n=new KR({stage:`inited`});return{state:n,dataset:e(n),...t}}function Tq(e){return t=>Cq(e,t)}function Eq(e,t){return wq(Tq(()=>({method:`stream`,stream:e,resource:t?.resource,options:t})))}function Dq(e,t){let n=jq(e);return wq(Tq(()=>({method:`file`,stream:e.stream(),resource:t?.resource||n,options:t})),{title:`Load data from file: `+(n?.name||`unknown`)})}function Oq(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 Dq(n,t)}function kq(e,t){return t||={},wq(Tq(async()=>{let n=await fetch(e,t.fetch),r=jq(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 Aq(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||={},wq(Tq(()=>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 jq(e,t){if(e instanceof Response){let n=t?.isResponseOk||gq,r=t?.getContentSize||vq,i=t?.getContentEncodedSize||_q,a=t?.getContentCreatedAt||yq;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 Mq=class extends YR{#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 Nq(e,t){let{ast:n}=LG.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:LG.syntax.stringify(n):r[t]=n.type===`Literal`&&(typeof n.value!=`string`||n.value[0]!==`=`)?n.value:`=`+LG.syntax.stringify(n)}return r}var Pq=Object.freeze({type:void 0}),Fq=Object.freeze({view:``}),Iq=new WeakMap,Lq=new WeakMap,Rq=new Set([`view`,`when`,`context`,`data`,`whenData`,`postRender`]);function zq(e){return typeof e==`string`||Array.isArray(e)||typeof e==`object`&&!!e&&typeof e.view==`string`}function Bq(e,t){return Iq.set(e,t),e}function Vq(){return{name:`config-error`,options:Pq,render(e,t){e.appendText(`[Error: ${t.reason}]`),`config`in t}}}function Hq(e,t,n,r,i,a,o,s){return!RR(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 Uq=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 Wq(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 Qq(e,e,e,e):Array.isArray(e)?new Qq(...e):new Qq(e.top||null,e.right||null,e.bottom||null,e.left||null)}},Wq=class{value;constructor(e){this.value=String(e)}},Gq=class{node;constructor(){this.node=null}setNode(e){this.node=e}};function Kq(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 qq(e,t){return e.length>t?e.slice(0,t):e}function Jq(e,t=e,n=t,r=e){return(i,a)=>a===1?r:i===0?e:i+1===a?n:t}function Yq(e){return Array.isArray(e)?Jq(...e):e}function Xq(e,t=e,n=t){return(r,i,a)=>`${e}${``.padStart(r+i+a-e.length-n.length,t)}${n}`}function Zq(e){return Array.isArray(e)?Xq(...e):e}var Qq=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=Yq(this.left),i=Yq(this.right),a=Zq(this.top),o=Zq(this.bottom),s=Kq(e),c=0,l=0;if(r){if(typeof r==`function`){let t=e.map((t,n)=>String(r(n,e.length)??``));c=Kq(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=Kq(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(qq(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(qq(i,r)),t.push([{length:e[e.length-1].length,node:n}]))}}return{spans:t,lines:e}}};async function $q(e,t,n,r,i,a,o,s,c){let l=new Uq(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 eJ(e,t,n,r){return $q(e,e.defaultRenderErrorRenderer,n,Fq,{type:`render`,reason:t,config:r})}function tJ(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 nJ(e,t,n,r,i,a){if(Array.isArray(n))return Promise.all(n.map(n=>nJ(e,t,n,r,i,a))).then(e=>new Uq(`inline`,e));let o=r&&typeof i==`number`?r[i]:r,s=null;switch(typeof n.view){case`function`:s={name:!1,options:Pq,render:n.view};break;case`string`:s=e.get(n.view)||null}t||=new Uq;let c=new Gq;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),eJ(e,t,c,n)}try{if(Hq(`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(Hq(`whenData`,e,n,l,t,r,i,c))return await $q(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),eJ(e,String(t),c,Fq)}}var rJ=class e extends Mq{host;defaultRenderErrorRenderer;viewEls;constructor(e){super(),this.host=e,this.defaultRenderErrorRenderer=Vq(),this.viewEls=new WeakMap}define(t,n,r){let i=zq(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(tJ(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 Bq(Nq(t,n+r),e)}catch(t){return Bq(this.badConfig(e,t),e)}return Bq({view:t,data:r},e)}return Bq({view:e},e)}return typeof e==`function`?Bq({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=>Bq({...e,...t},[e,t])):Bq({...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))Rq.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&&(Lq.set(e,{props:i,fn:r}),i=e)}return i}textWidth(e){if(e===null)return 0;if(e instanceof Uq){let t=0;for(let n of e.children)t+=this.textWidth(n);return t}return e instanceof Gq?this.textWidth(e.node):e.value.length}cleanUpRenderTree(e){if(e===null)return null;if(e instanceof Gq)return this.cleanUpRenderTree(e.node);if(e instanceof Uq){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 Uq(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 Wq){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 Uq){let t=`none`;for(let s of e.children){let c=s instanceof Uq?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,Kq(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,Kq(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 Uq(e):e||=new Uq,await nJ(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=Iq.get(e)||[];return Array.isArray(t)||(t=[t]),{value:e,deps:t.map(this.getViewConfigTransitionTree,this)}}getViewPropsTransition(e){let t=Lq.get(e)||null;return t&&{props:t.props,fn:t.fn,query:t.fn.query||null}}},iJ=e=>({demo:`${e}:"hello world\\nsome text..."`}),aJ=s({default:()=>oJ});function oJ({textView:e}){e.define(`alert`,{type:`block`,usage:iJ,border:{top:[`╔`,`═`,`╗`],left:`║ `,right:` ║`,bottom:[`╚`,`═`,`╝`]},render(t,n,r,i){let{content:a=`text`}=n;return e.render(t,a,r,i)}})}var sJ=(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"`]}}]}),cJ=s({default:()=>lJ});function lJ({textView:e}){let t={type:`inline-block`,usage:sJ,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 uJ=(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()}]}),dJ=s({default:()=>fJ});function fJ({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:uJ,render:t}),e.define(`inline-block`,{type:`inline-block`,usage:uJ,render:t}),e.define(`block`,{type:`block`,usage:uJ,render:t}),e.define(`line`,{type:`line`,usage:uJ,render:t})}var pJ=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)}`)}]}),mJ=pJ,hJ=s({default:()=>gJ});function gJ({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:mJ,border:{left:`> `}})}var _J={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`]}},vJ=s({default:()=>yJ});function yJ({textView:e}){e.define(`context`,function(t,n,r,i){let{content:a=[]}=n;return e.render(t,a,r,i)},{usage:_J})}var bJ=(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"`}]}]}),xJ=s({default:()=>SJ});function SJ({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:bJ}),e.define(`h1`,t(1),{type:`block`,usage:bJ}),e.define(`h2`,t(2),{type:`block`,usage:bJ}),e.define(`h3`,t(3),{type:`block`,usage:bJ}),e.define(`h4`,t(4),{type:`block`,usage:bJ}),e.define(`h5`,t(5),{type:`block`,usage:bJ})}var CJ={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"`}]}]},wJ=s({default:()=>EJ}),TJ=`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 EJ({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:TJ,usage:CJ})}var DJ=(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: "#" + $ }`}]}]}]}),OJ=s({default:()=>kJ});function kJ({textView:e}){e.define(`list`,t(`line`,``),{type:`block`,usage:DJ}),e.define(`inline-list`,t(`inline-block`),{type:`inline-block`,usage:DJ}),e.define(`comma-list`,t(`inline-block`,``,`,`),{type:`inline-block`,usage:DJ}),e.define(`ol`,t(`line`,e=>1+e.index+`. `),{type:`block`,usage:DJ}),e.define(`ul`,t(`line`,`- `),{type:`block`,usage:DJ}),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 AJ='let name = "world";\n\nconsole.log(`Hello, ${name}!`);',jJ=Function(`return num => num + 5`)(),MJ={demo:{view:`source`,syntax:`js`,source:AJ},examples:[{title:`Custom line numbers`,highlightProps:[`lineNum`],demo:[{view:`source`,source:AJ,syntax:`js`,lineNum:jJ},{view:`source`,source:AJ,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:AJ,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`}]}}]},NJ=s({default:()=>FJ}),PJ=`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 FJ(e){e.textView.define(`source`,{type:`block`,props:PJ,usage:MJ,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 IJ={demo:{view:`switch`,content:[{when:`expr`,content:'text:"Renders when `expr` is truthy"'},{content:'text:"Renders when all other `when` conditions are falsy"'}]}},LJ=s({default:()=>RJ});function RJ(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:IJ})}function zJ(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function BJ(e){return Array.isArray(e)||zJ(e)}function VJ(e){return LR(e)===`[object Set]`}function HJ(e){return LR(e)===`[object RegExp]`}function UJ(e){return typeof e==`object`&&!!e}var WJ=typeof Symbol.toStringTag==`symbol`,GJ=Error,KJ=globalThis.DOMError,qJ=typeof GJ.isError==`function`?GJ.isError:JJ;function JJ(e){if(!e||typeof e!=`object`&&typeof e!=`function`)return!1;if(!WJ||!(Symbol.toStringTag in e)){let t=LR(e);return t===`[object Error]`||t===`[object DOMException]`||t===`[object DOMError]`||t===`[object Exception]`}return KJ!==void 0&&e instanceof KJ||e instanceof Error}var YJ={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:{}}}}},XJ=s({default:()=>$J});function ZJ(e,t){return{header:e,view:`table-cell`,data:t}}function QJ(e,t,n){return typeof t==`string`&&(t={content:t}),RR(t,`content`)||RR(t,`data`)?{header:e,view:`table-cell`,...t}:{...ZJ(e,n),...t}}function $J(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),VJ(o)&&(o=[...o]),BJ(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`?ZJ(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(RR(r,t)?QJ(t,r[t],e.pathToQuery([t])):ZJ(t,e.pathToQuery([t])))}if(c&&s.unshift({header:`[value]`,view:`table-cell`,details:!1}),s=s.filter(t=>!RR(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&&!RR(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:YJ}),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(eY(r,s))}})}function eY(e,t){if(Array.isArray(e)||ArrayBuffer.isView(e))return e.length||``;if(t){for(let t in e)if(RR(e,t))return`{…}`;return`{}`}return e===void 0?``:String(e)}var tY={demo:`text:"just a text"`},nY=s({default:()=>rY});function rY({textView:e}){e.define(`text`,{props:`{ text: #.props has no 'text'? } | overrideProps()`,usage:tY,render(e,t){let{text:n}=t;e.appendText(String(n))}})}var iY=s({alert:()=>aJ,badge:()=>cJ,block:()=>dJ,blockquote:()=>hJ,context:()=>vJ,headerViews:()=>xJ,link:()=>wJ,listViews:()=>OJ,source:()=>NJ,switchView:()=>LJ,table:()=>XJ,textViews:()=>nY}),aY=class e extends Mq{#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,sY=null;function cY(e){sY=null;for(let[t,n]of oY.entries())e.warn.groupCollapsed(`${t} (${n.length})`,n);oY.clear()}function lY(e,t,...n){sY===null&&oY.size===0&&(sY=setTimeout(()=>cY(e),1));let r=oY.get(t);r===void 0?oY.set(t,[n]):r.push(n)}function uY(e,t,n){switch(typeof t){case`function`:return t;case`string`:return Object.assign(e=>e&&RR(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 dY(e,t,n,r){let i=t&&RR(t,n)?t[n]:void 0;return i===void 0?r:uY(e,i,`"${n}" option`)}function fY(e,t,n){return(Array.isArray(t[n])&&t[n]||[]).map(t=>uY(e,t,`"${n}" option`))}function pY(e,t=!1){return e===null?!1:t?typeof e==`object`:typeof e==`object`||typeof e==`number`||typeof e==`string`}function mY(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(pY(r)){if(!u.has(r)){u.set(r,t);continue}u.get(r)!==t&&lY(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(!pY(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 hY=class e extends Mq{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=fY(t,n,`refs`),i=fY(t,n,`lookupRefs`),a=!!n.annotateScalars,o=n.page,s=typeof o==`string`?o:null,c=dY(t,n,`ref`,null),l=dY(t,n,`title`,c||(()=>null));return e.define(this,t,Object.freeze(mY(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 gY(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 _Y(e,t,n){return typeof e==`function`?gY(e,t,n):e instanceof Date?`${n}new Date("${e.toISOString()}")`:Array.isArray(e)?`${n}[${e.join(`, `)}]`:n+String(e)}var vY=new Set([`[object Function]`,`[object RegExp]`,`[object Date]`]);function yY(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function bY(e,t,n=4){let r=[];return String(JSON.stringify(e,t||function(e,t){return typeof t==`string`&&LR(this[e])===`[object Date]`&&(t=this[e]),t!==null&&(vY.has(LR(t))||yY(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+_Y(r.shift(),n,a))}function xY(...e){try{return JSON.parse(...e)}catch(e){return e}}function SY(...e){try{return JSON.stringify(...e)??`null`}catch(e){return String(e)}}var CY=new TextEncoder,wY=new TextDecoder,[TY,EY]=(()=>{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 DY(e){return wY.decode(OY(e))}function OY(e){typeof e==`string`&&(e=CY.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++]=TY[e],r-=e<<i}for(i!==0&&(t[n++]=TY[r<<6-i]);n<t.length;)t[n++]=61;return t}function kY(e){return wY.decode(AY(e))}function AY(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|EY[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 jY=/^data:image\/([a-z\+]+?(?:;base64)?),/,MY=/^([a-z\-]+:|\.{0,2}\/)/i;function NY(e){return e.includes(`http://www.w3.org/2000/svg`)?/(?:<|%3[cC])svg[:\s]/.test(e):!1}function PY(e){return typeof e==`string`&&jY.test(e)}function FY(e){let t=zY(e);if(t!==null)return`data:image/${t.type},${t.content}`}function IY(e){return typeof e==`string`&&MY.test(e)&&(PY(e)||!RY(e))}function LY(e){if(typeof e==`string`)return IY(e)?e:FY(e)}function RY(e){return zY(e)!==null}function zY(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:NY(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`))&&NY(kY(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(jY);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 BY={overrideProps:VY,jsonInfo:sK,jsonParse:xY,jsonStringify:SY,imagecontent:zY,imagedatauri:FY,imagesrc:LY};function VY(e,t=this.context.props){if(!t)return e;let n={...e};for(let e of Object.keys(n))RR(t,e)&&(n[e]=t[e]);return n}var HY={error:qJ,imagecontent:RY,imagedatauri:PY,imagesrc:IY};function UY(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 WY(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={...BY,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={...HY};typeof t==`function`&&t(r),n.lock(),e.queryFnFromString=LG.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 GY(e,t){let n=new hY(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={...BY,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={...HY},c=LG.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=LG.setup({methods:o={...o,...e}})}function u(e){c=LG.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 KY=new WeakMap,qY=[`variable`,`property`,`value`,`assertion`,`method`],JY=(e,t)=>qY.indexOf(e.type)-qY.indexOf(t.type),YY=e=>{let t=e.toLowerCase();return n=>n!==e&&(typeof n==`string`?n:String(n)).toLowerCase().indexOf(t)!==-1};function XY(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 ZY(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 QY(e,t,n,r,i){try{let a=KY.get(e);if((!a||a.query!==t||a.data!==r||a.context!==i)&&(KY.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&&ZY(a.api,a.offset,n))return a.suggestions;let o=a.api.suggestion(a.offset=n,{sort:!0,filter:YY,limit:50});if(o){a.suggestions=[];for(let e of o.sort(JY))a.suggestions.push(...e.suggestions.map(t=>({type:e.type,from:e.from,to:e.to,text:e.text,value:e.type===`value`?XY(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 $Y=new Proxy({},{get:()=>()=>{}}),eX=[`silent`,`error`,`warn`,`info`,`perf`,`debug`],tX={error:[`error`,`error`],warn:[`warn`,`warn`],info:[`info`,`info`],perf:[`log`,`perf`],log:[`log`,`any`],debug:[`debug`,`debug`]},nX=class{#e;#t;#n;error;warn;info;perf;debug;log;constructor(e=``,t=`debug`,n=console){this.#t=e,this.#n=n||$Y,this.logLevel=t}shouldLogLevel(e){let t=eX.indexOf(e);return this.#e!==`silent`&&t!==-1&&t<=eX.indexOf(this.#e)}get logLevel(){return this.#e}set logLevel(e){if(eX.indexOf(e)===-1&&console.error(this.#t,`Bad log level "${e}", supported: ${eX.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(tX))this[e]=n===`any`||this.shouldLogLevel(n)?Object.assign(r(t),{group:i(t,!1),groupCollapsed:i(t,!0)}):Object.assign(()=>{},{group:()=>()=>{},groupCollapsed:()=>()=>{}})}}},rX=(e,t)=>iX(e,t,rX);function iX(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(RR(e,r)&&(!RR(t,r)||!n(e[r],t[r])))return!1;for(let n in t)if(RR(t,n)&&!RR(e,n))return!1;return!0}var aX=()=>void 0,oX=`[Discovery]`,sX=e=>/^[a-zA-Z_][a-zA-Z_$0-9]*$/.test(e)&&!cX.includes(e),cX=[`and`,`or`,`in`,`has`,`is`,`not`,`no`,`asc`,`ascN`,`ascA`,`ascNA`,`ascAN`,`desc`,`descN`,`descA`,`descNA`,`descAN`],lX=(e,t)=>({...t,encodings:Array.isArray(t?.encodings)?[...t.encodings,...e.encodings]:e.encodings}),uX=class extends YR{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 nX(oX,a,o),this.action=new aY,this.objectMarkers=new hY(this.logger),this.linkResolvers=[],this.datasets=[],this.encodings=BG(c),this.data=void 0,this.#e=l,this.prepare=e=>e,this.#t=!0,this.textView=new rJ(this),this.apply(s),typeof u==`function`?(this.#t=!1,WY(this,u)):WY(this,()=>{}),this.apply(iY);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};iX(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?GY(this,t):UY(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(Eq(e,lX(this,t)))}loadDataFromEvent(e,t){return this.trackLoadDataProgress(Oq(e,lX(this,t)))}loadDataFromFile(e,t){return this.trackLoadDataProgress(Dq(e,lX(this,t)))}loadDataFromUrl(e,t){return this.trackLoadDataProgress(kq(e,lX(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:LG.version,link:`https://discoveryjs.github.io/jora/#article:jora-syntax`}}queryFnFromString(){return aX}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 LG.buildin.bool(this.query(e,t,n))}querySuggestions(e,t,n,r){return QY(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}]`):sX(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 dX(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 fX=hX(`localStorage`),pX=gX(`localStorage`),mX=new Map;function hX(e){let t=_X(e),n=new Map;return function(e){let r=n.get(e);return r===void 0&&(r=new yX(t,e),n.set(e,r),vX(t,n)),r}}function gX(e){let t=_X(e);return function(e){return t?.getItem(e)??null}}function _X(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 vX(e,t){e!==null&&!mX.has(e)&&(mX.set(e,t),mX.size===1&&addEventListener(`storage`,e=>{let t=mX.get(e.storageArea);if(t!==void 0){let n=t.get(e.key);n&&n.forceSync()}}))}var yX=class extends KR{#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}},bX=`discoveryjs:color-scheme`,xX=Object.freeze([`auto`,`light`,`dark`]),SX=Object.freeze([`auto`,`light`,`dark`,`light-only`,`dark-only`]);function CX(e){return xX.includes(e)}function wX(){return matchMedia(`(prefers-color-scheme:dark)`)}function TX(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=pX(bX);CX(t)&&(e=t)}return e}function EX(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 DX(e){let t=OX(e);return t===`auto`?wX().matches?`dark`:`light`:t}function OX(e){switch(e){case`auto`:return`auto`;case`dark`:case`dark-only`:return`dark`;default:return`light`}}var kX=class{#e;#t;#n;#r;#i;#a;persistent;state;value;serializedValue;mode;constructor(e=`auto`,t=!1){this.#e=t?fX(bX):null,this.#r=[],this.#i=TX(e,t),this.#a=DX(this.#i),Object.defineProperties(this,{persistent:{get:()=>this.#e!==null},state:{get:()=>this.#i},value:{get:()=>this.#a},serializedValue:{get:()=>OX(this.#i)},mode:{get:()=>EX(this.#i)}}),this.#t=this.#e?.subscribe(e=>{CX(e)&&e!==this.serializedValue&&this.mode!==`only`&&this.set(e)}),this.#n=()=>{let e=wX(),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(!SX.includes(e)){console.warn(`Bad value "${e}" for ColorScheme#state, value ignored`);return}this.#i=e,this.#a=DX(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(wX().matches?`dark`:`light`);return;case`dark`:this.set(e&&!wX().matches?`auto`:`light`);return;case`light`:this.set(e&&wX().matches?`auto`:`dark`);return}console.warn(`ColorScheme is locked for changes (mode=${this.#i})`)}},AX=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]}},jX=class extends AX{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`),` ${hB}`]);this.host=e,this.popup=null,this.data=null,this.context=null,this.primary=new AX(e,`nav-button`),this.secondary=this,this.menu=new AX(e,`menu-item`),this.config=[this.secondary.items,{view:`nav-button`,name:`burger`,whenData:!0,data:async()=>{let e=VR();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 JR,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))}},MX=Object.freeze({tag:void 0}),NX=Object.freeze({view:``}),PX=new WeakMap,FX=new WeakMap,IX=new WeakMap,LX=new WeakMap,RX=new Set([`view`,`when`,`context`,`data`,`whenData`,`postRender`,`className`,`tooltip`]);function zX(e){return typeof e==`string`||Array.isArray(e)||typeof e==`object`&&!!e&&typeof e.view==`string`}function BX(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 VX(e,t,n){return t+n>=e?e:t}function HX(e,t){return IX.set(e,t),e}function UX(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=FX.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)UX(e,i,n,r)}function WX(e){return{name:`config-error`,options:MX,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 GX(e,t,n,r,i,a,o,s){return!RR(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 KX(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 qX(e,t,n,r,i){let a=n?KX(e,n,r,i):null;a!==null&&t.classList.add(...a)}async function JX(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(!BR(u))e.viewEls.set(u,d),t.name&&u.classList.add(`view-${t.name}`),qX(e.host,u,r.className,a,o),r.tooltip&&ZX(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 YX(e,t,n,r){return JX(e,e.defaultRenderErrorRenderer,n,NX,{type:`render`,reason:t,config:r})}function XX(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:KX.bind(null,e),applyComputedClassName:qX.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?ZX(e.host,t,n,r,i):e.host.logger.warn(`A tooltip can be attached to a HTML element only`)}}}function ZX(e,t,n,r,i){t.classList.add(`discovery-view-has-tooltip`),PX.set(t,{config:n,data:r,context:i}),e.view.tooltip===null&&(e.view.tooltip=eZ(e))}function QX(e){return!!e&&!Array.isArray(e)&&typeof e!=`string`&&typeof e!=`function`&&!e.view}function $X(e,t){return Number.isFinite(e)?Number(e):t}function eZ(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}=PX.get(e)||{};return QX(t)?t.showDelay??!0:!0},render(r,i){let{config:a,data:o,context:s}=PX.get(i)||{},c=`pointer`,l=`natural`,u=3,d=3,f=!1,p=a;return t!==null&&(r.classList.remove(...t),t=null),QX(a)&&(t=KX(e,a.className,o,s),t!==null&&r.classList.add(...t),c=a.position||c,l=a.positionMode||l,u=$X(a.pointerOffsetX,u),d=$X(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 tZ(e,t,n,r,i,a){if(Array.isArray(n)){await Promise.all(n.map(n=>tZ(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:MX,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),YX(e,t,c,n)}try{if(GX(`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(GX(`whenData`,e,n,l,t,r,i,c))return await JX(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),YX(e,String(t),c,NX)}}var nZ=class{el;position;positionMode;pointerOffsetX;pointerOffsetY;hideOnTriggerClick;constructor(){}toggle(){}async show(){}hide(){}},rZ=class e extends Mq{host;defaultRenderErrorRenderer;viewEls;fragmentEls;tooltip;Popup=nZ;constructor(e){super(),this.host=e,this.defaultRenderErrorRenderer=WX(this),this.viewEls=new WeakMap,this.fragmentEls=new WeakMap,this.tooltip=null}define(t,n,r){let i=zX(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(XX(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 HX(Nq(t,n+r),e)}catch(t){return HX(this.badConfig(e,t),e)}return HX({view:t,data:r},e)}return HX({view:e},e)}return typeof e==`function`?HX({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=>HX({...e,...t},[e,t])):HX({...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))RX.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&&(LX.set(e,{props:i,fn:r}),i=e)}return i}render(e,t,n,r,i){return tZ(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 YX(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=BX(a),d=e.appendChild(document.createComment(``)),f=document.createDocumentFragment(),p=n.length,m=p-i,h=i===0?VX(m,u.start,u.startTolerance):VX(m,u.base,u.tolerance),g=VX(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){ZX(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){FX.set(e,{name:t,...n})}getViewTree(e){let t=new Set(e||[]),n=[];return UX(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=IX.get(e)||[];return Array.isArray(t)||(t=[t]),{value:e,deps:t.map(this.getViewConfigTransitionTree,this)}}getViewPropsTransition(e){let t=LX.get(e)||null;return t&&{props:t.props,fn:t.fn,query:t.fn.query||null}}},iZ=Symbol(`config`),aZ={name:`not-found`,render:(e,{name:t})=>{e.style.cssText=`color:#a00`,e.innerText=`Page \`${t}\` not found`}},oZ=class e extends Mq{#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 KR(!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}=zX(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),[iZ]:i}))}render(e,t,n,r){let i=this.get(t);i||(i=this.get(`not-found`)||aZ,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[iZ],renderState:f}}},sZ=class e extends Mq{#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)}},cZ=(()=>{let e=new KR({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}),HR),e.readonly})();function lZ(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function uZ(e,t){if(typeof e!=`function`)throw TypeError(`Expected a function`);if(typeof t==`number`&&(t={wait:t}),!lZ(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 dZ=0,fZ=[{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 pZ(e){let t=iz(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 mZ(){dZ=0}function hZ(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=dZ,pZ(t)})}},...fZ]},{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){dZ=e.querySelector(`.sidebar`)?.scrollTop||0,t(r.self)}},...fZ]}]}}}function gZ(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 _Z={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`?gZ(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`}}]}]},vZ={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:gZ(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`}]}]},yZ={view:`block`,className:`content-section data`,data:`#.view`,content:[{view:`context`,data:`..parent`,content:vZ},{view:`context`,content:{...vZ,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 bZ(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 xZ=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=uZ(()=>{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),bZ(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}=cZ.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,HR),document.addEventListener(`keydown`,m,!0),cZ.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,HR),document.removeEventListener(`keydown`,m,!0),cZ.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(),mZ(),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:[hZ(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:[_Z,{view:`block`,className:[`content`,`data-context`],content:[yZ,{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},SZ=(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}}}]}),CZ=`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 wZ(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:CZ,usage:SZ}),e.view.define(`button-primary`,t,{tag:`button`,props:CZ,usage:SZ}),e.view.define(`button-danger`,t,{tag:`button`,props:CZ,usage:SZ}),e.view.define(`button-warning`,t,{tag:`button`,props:CZ,usage:SZ})}var TZ={demo:{view:`checkbox-list`,checkbox:{content:`text`},data:[`one`,`two`,`three`]}};function EZ(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:TZ})}var DZ={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!"`}}]},OZ=`#.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 kZ(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:OZ,usage:DZ})}var AZ={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 jZ(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:AZ})}var MZ={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 NZ(e,t){if(!e||!t||typeof e!=`object`||typeof t!=`object`)return e===t;for(let n in e)if(RR(e,n)&&e[n]!==t[n])return!1;for(let n in t)if(RR(t,n)&&e[n]!==t[n])return!1;return!0}function PZ(e){e.view.define(`dropdown`,function(t,n,r,i){function a(e,t){return typeof h==`function`?h(e,t):NZ(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:MZ})}function FZ(e,t){try{return RegExp(`((?:`+e+`)+)`,t)}catch{}return RegExp(`((?:`+e.replace(/[\[\]\(\)\?\+\*\{\}\\]/g,`\\$&`)+`)+)`,t)}function IZ(e,t=`i`){return Object.assign(FZ(e,t),{rawSource:e})}var LZ=Function("return (value) => alert(`Changed to ${value}!`)")(),RZ={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:LZ}},{title:`Input with onChange debounced`,demo:{view:`input`,onChange:LZ,debounce:300}}]},zZ=`#.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 BZ(e){let t={regexp:e=>e?IZ(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`,uZ(()=>{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:RZ,props:zZ})}var VZ={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 HZ(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:VZ})}var UZ={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 WZ(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:UZ})}var GZ={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!`)}}]},KZ=`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 qZ(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:KZ,usage:GZ})}var JZ={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 YZ(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:JZ})}var XZ={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 ZZ(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:XZ})}var QZ={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`}}]},$Z=`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 eQ(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:QZ,props:$Z})}var tQ=()=>alert(`clicked!`),nQ={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:tQ},{value:`two`,text:`Two`,onClick:tQ},{value:`three`,text:`Three`,onClick:tQ}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}}}]},rQ=`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 iQ(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:nQ,props:rQ})}var aQ={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:aQ})}function sQ(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:aQ})}var cQ={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 lQ(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:cQ})}var uQ={demo:{view:`columns`,data:[`one`,`two`,`three`,`four`],column:`text`}};function dQ(e){e.view.define(`column`,function(t,n,r,i){let{content:a=[]}=n;return e.view.render(t,a,r,i)},{usage:uQ})}function fQ(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:uQ})}var pQ={demo:{view:`expand`,header:`text:"Expand me!"`,content:`text:"Content"`}},mQ=`is not array? | {
|
|
195
|
-
header: undefined,
|
|
196
|
-
content: undefined,
|
|
197
|
-
expanded: false,
|
|
198
|
-
onToggle: undefined
|
|
199
|
-
} | overrideProps() | {
|
|
200
|
-
...,
|
|
201
|
-
expanded.bool()
|
|
202
|
-
}`;function hQ(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:pQ,props:mQ})}var gQ={demo:{view:`hstack`,content:[`button:{text:"First button"}`,`button-primary:{text:"Second button"}`]}};function _Q(e){e.view.define(`hstack`,function(t,n,r,i){let{content:a=[]}=n;return e.view.render(t,a,r,i)},{usage:gQ})}function vQ(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 yQ=(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 bQ(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:yQ}),e.view.define(`inline-list`,t,{usage:yQ}),e.view.define(`comma-list`,t,{usage:yQ}),e.view.define(`ol`,t,{tag:`ol`,usage:yQ}),e.view.define(`ul`,t,{tag:`ul`,usage:yQ})}var xQ=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 SQ(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:xQ})}var CQ=[!1,`popup-hover`,`trigger-click`],wQ=300;function TQ(e){return!e||e.getRootNode({composed:!0})===document}function EQ(e,t){return typeof e==`function`&&(e=e(t)),typeof e==`number`?OQ(e):typeof e==`boolean`&&e?wQ:0}function DQ(e,t){e.lastChild!==t&&e.appendChild(t)}function OQ(e,t=0){return Number.isFinite(e)?e:t}function kQ(e){return CQ.includes(e)}function AQ(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))))}},HR),e.addHostElEventListener(`mouseleave`,({target:e})=>{for(let t of r)t.lastHoverTriggerEl===e&&(m(t),t.lastHoverTriggerEl=null,t.hideTimer=setTimeout(t.hide,100))},HR),e.addGlobalEventListener(`scroll`,o,HR),e.addHostElEventListener(`scroll`,e=>{s(),u(e)},HR),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)])};cZ.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),EQ(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=OQ(o,3),this.pointerOffsetY=OQ(s,3),this.hoverTriggers=c||null,this.hoverPin=kQ(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&&EQ(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&&(DQ(o,this.el),this.updatePosition())}),await r(this.el,n,this.hide),this.lastRenderMarker!==e)return;this.lastRenderMarker=null}DQ(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=rz(r.firstChild),a=sz(window,i),{x:o,y:s}=cZ.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(){(!TQ(this.lastHoverTriggerEl)||!TQ(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 jQ={demo:{view:`section`,header:`text:"I am section"`,content:[`text:"content"`]}};function MQ(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:jQ})}function NQ(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 PQ=(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 FQ(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:PQ}),e.view.define(`alert-primary`,t,{usage:PQ}),e.view.define(`alert-success`,t,{usage:PQ}),e.view.define(`alert-danger`,t,{usage:PQ}),e.view.define(`alert-warning`,t,{usage:PQ})}function IQ(){return[performance.timeOrigin.toString(16),(1e4*performance.now()).toString(16),Math.random().toString(16).slice(2)].join(`-`)}var LQ=Symbol(`stop-match`);function RQ(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 zQ(e,t,n){let r=e.indexOf(t,n);return r===-1?null:{offset:r,length:t.length}}function BQ(e,t,n,r,i=!1){if(!HJ(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`?zQ(a,t,o):RQ(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),LQ)===LQ),o=i.offset+i.length}while(o!==e.length)}function VQ(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 HQ(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{}VQ(e)}var UQ={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" }`]}]},WQ=`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 GQ(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:WQ,usage:UQ})}function KQ(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 qQ=(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" }`]}}]}),JQ=`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 YQ(e,t,n){if(!n)return;let r=e.appendChild(document.createElement(`span`));r.className=t,r.textContent=n}function XQ(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)})),YQ(e,`prefix`,p),l?h=this.render(e,l,n,r):e.append(document.createTextNode(c)),YQ(e,`postfix`,m),h}e.view.define(`badge`,t,{tag:`a`,props:JQ,usage:qQ}),e.view.define(`pill-badge`,t,{tag:`a`,props:JQ,usage:qQ})}function ZQ(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:pJ})}var QQ=/[\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 $Q(e,t){return typeof e==`string`?(t||(e=e.toLowerCase()),e.replace(QQ,``).replace(/ /g,`-`)):``}var e$=(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 t$(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=$Q(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:e$}),e.view.define(`h1`,t,{tag:`h1`,usage:e$}),e.view.define(`h2`,t,{tag:`h2`,usage:e$}),e.view.define(`h3`,t,{tag:`h3`,usage:e$}),e.view.define(`h4`,t,{tag:`h4`,usage:e$}),e.view.define(`h5`,t,{tag:`h5`,usage:e$})}var n$={demo:{view:`html`,data:`"<h1>I am inner HTML</h1>"`}};function r$(e){let t=document.createElement(`div`);e.view.define(`html`,function(e,n,r){t.innerHTML=r,e.append(...t.childNodes)},{tag:null,usage:n$})}var i$=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjggMTI4Ij4KICAgIDxyZWN0IHg9IjY1LjYiIHk9IjI0LjYiIHRyYW5zZm9ybT0ibWF0cml4KDAuOTM5NyAtMC4zNDIgMC4zNDIgMC45Mzk3IC05Ljk0MjYgMzEuODI4KSIgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9IjM5LjMiIGhlaWdodD0iMzkiPjwvcmVjdD4KICAgIDxyZWN0IHg9IjcwLjYiIHk9IjUyLjciIHRyYW5zZm9ybT0ibWF0cml4KC0wLjkzOTcgMC4zNDIgLTAuMzQyIC0wLjkzOTcgMTk0Ljc4NTIgODEuMTIwNCkiIGZpbGw9IiNDN0Q3RTIiIHdpZHRoPSIzOS4zIiBoZWlnaHQ9IjEwIj48L3JlY3Q+CiAgICA8cGF0aCBmaWxsPSIjOThCRUQ4IiBkPSJNMTExLjUsNTQuNmwtMS4xLDEuMUw5Ny4xLDE5LjFsMS41LDAuMmM4LDAuOSwxNC43LDYuMiwxNy40LDEzLjdsMCwwQzExOC44LDQwLjQsMTE3LDQ4LjgsMTExLjUsNTQuNnoiPjwvcGF0aD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik03My41LDcyLjJjLTEuMiwwLTIuNC0wLjgtMi44LTJMNTcuMywzMy41Yy0wLjMtMC43LTAuMi0xLjYsMC4xLTIuM2MwLjMtMC43LDAuOS0xLjMsMS43LTEuNmwzNi45LTEzLjRjMS42LTAuNiwzLjMsMC4yLDMuOCwxLjhsMTMuMywzNi42YzAuMywwLjcsMC4yLDEuNi0wLjEsMi4zYy0wLjMsMC43LTAuOSwxLjMtMS43LDEuNkw3NC41LDcyQzc0LjIsNzIuMSw3My44LDcyLjIsNzMuNSw3Mi4yek02NCwzNC4zbDExLjMsMzFsMzEuMy0xMS40bC0xMS4zLTMxTDY0LDM0LjN6Ij48L3BhdGg+CiAgICA8cmVjdCB4PSIzNSIgeT0iNDYuNyIgdHJhbnNmb3JtPSJtYXRyaXgoMC45Mzk3IC0wLjM0MiAwLjM0MiAwLjkzOTcgLTE2LjIwMTEgMjAuOTg4KSIgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9IjMyLjgiIGhlaWdodD0iMTkuNSI+PC9yZWN0PgogICAgPHJlY3QgeD0iMzcuMyIgeT0iNTkuOCIgdHJhbnNmb3JtPSJtYXRyaXgoLTAuOTM5NyAwLjM0MiAtMC4zNDIgLTAuOTM5NyAxMjUuNjc2MyAxMDMuMzk0NikiIGZpbGw9IiNDN0Q3RTIiIHdpZHRoPSIzMi44IiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik0zOS40LDc0LjJjLTAuNCwwLTAuOS0wLjEtMS4zLTAuM2MtMC43LTAuMy0xLjMtMC45LTEuNi0xLjdsLTYuNy0xOC4zYy0wLjMtMC43LTAuMi0xLjYsMC4xLTIuM2MwLjMtMC43LDAuOS0xLjMsMS43LTEuNmwzMC44LTExLjJjMC43LTAuMywxLjYtMC4yLDIuMywwLjFjMC43LDAuMywxLjMsMC45LDEuNiwxLjdMNzMsNTljMC42LDEuNi0wLjIsMy4zLTEuOCwzLjhMNDAuNCw3NEM0MCw3NC4xLDM5LjcsNzQuMiwzOS40LDc0LjJ6IE0zNi41LDU0LjdsNC42LDEyLjdsMjUuMi05LjJsLTQuNi0xMi43TDM2LjUsNTQuN3oiPjwvcGF0aD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik03MCwxMTguOWMtMS4yLDAtMi40LTAuNy0yLjgtMS45bC0xNC0zNy4ybC04LjQsMy4xbC0xNy4yLDM0LjRjLTAuNywxLjUtMi41LDIuMS00LDEuM2MtMS41LTAuNy0yLjEtMi41LTEuMy00TDQwLDc5YzAuMy0wLjcsMC45LTEuMiwxLjctMS41TDU0LDczLjFjMS41LTAuNiwzLjMsMC4yLDMuOCwxLjhsMTUsNDBjMC42LDEuNi0wLjIsMy4zLTEuOCwzLjlDNzAuNywxMTguOCw3MC40LDExOC45LDcwLDExOC45eiI+PC9wYXRoPgogICAgPHBhdGggZmlsbD0iIzQ1NEI1NCIgZD0iTTEzLjYsODAuMWMtMS4yLDAtMi40LTAuOC0yLjgtMkw2LjMsNjUuOWMtMC42LTEuNiwwLjItMy4zLDEuOC0zLjhjMS42LTAuNiwzLjMsMC4yLDMuOCwxLjhsNC40LDEyLjJjMC42LDEuNi0wLjIsMy4zLTEuOCwzLjhDMTQuMyw4MC4xLDE0LDgwLjEsMTMuNiw4MC4xeiI+PC9wYXRoPgogICAgPHBhdGggZmlsbD0iIzQ1NEI1NCIgZD0iTTEzLjIsNzMuM2MtMS4yLDAtMi40LTAuOC0yLjgtMmMtMC42LTEuNiwwLjItMy4zLDEuOC0zLjhMMzUsNTkuMmMxLjYtMC42LDMuMywwLjIsMy44LDEuOGMwLjYsMS42LTAuMiwzLjMtMS44LDMuOGwtMjIuOCw4LjNDMTMuOSw3My4zLDEzLjYsNzMuMywxMy4yLDczLjN6Ij48L3BhdGg+Cjwvc3ZnPgo=`,a$={demo:{view:`image`,src:i$,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 s$(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:a$})}var c$={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:i$,height:100},examples:[{title:`Src is not defined`,demo:`image-preview`},{title:`Bad url`,demo:`image-preview{ src: "<bad url>" }`}]};function l$(e){e.view.define(`image-preview`,function(e,t,n,r){this.render(e,{view:`image`,...t},n,r)},{usage:c$})}var u$={demo:{view:`indicator`,data:{label:`Label`,value:`1234`}},examples:[{title:`Indicator as link`,demo:{view:`indicator`,data:{label:`Label`,value:`4321`,href:`#`}}}]};function d$(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:u$})}var f$={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>"`]}}]},p$=`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 m$(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:p$,usage:f$})}function h$(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var g$=h$();function _$(e){g$=e}var v$=/[&<>"']/,y$=new RegExp(v$.source,`g`),b$=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,x$=new RegExp(b$.source,`g`),S$={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},C$=e=>S$[e];function w$(e,t){if(t){if(v$.test(e))return e.replace(y$,C$)}else if(b$.test(e))return e.replace(x$,C$);return e}var T$=/(^|[^\[])\^/g;function E$(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(T$,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function D$(e){try{e=encodeURI(e).replace(/%25/g,`%`)}catch{return null}return e}var O$={exec:()=>null};function k$(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 A$(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 j$(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 M$(e,t,n,r){let i=t.href,a=t.title?w$(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:w$(o)}}function N$(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 P$=class{options;rules;lexer;constructor(e){this.options=e||g$}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:A$(e,`
|
|
245
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=N$(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=A$(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:A$(t[0],`
|
|
246
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=A$(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=k$(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(k$(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:w$(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=A$(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=j$(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)),M$(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 M$(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=w$(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=w$(t[1]),n=`mailto:`+e):(e=w$(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=w$(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=w$(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]:w$(t[0]),{type:`text`,raw:t[0],text:e}}}},F$=/^(?:[ \t]*(?:\n|$))+/,I$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,L$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,R$=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,z$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,B$=/(?:[*+-]|\d{1,9}[.)])/,V$=E$(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,B$).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(),H$=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,U$=/^[^\n]+/,W$=/(?!\s*\])(?:\\.|[^\[\]\\])+/,G$=E$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,W$).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),K$=E$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,B$).getRegex(),q$=`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`,J$=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Y$=E$(`^ {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`,J$).replace(`tag`,q$).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),X$=E$(H$).replace(`hr`,R$).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`,q$).getRegex(),Z$={blockquote:E$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,X$).getRegex(),code:I$,def:G$,fences:L$,heading:z$,hr:R$,html:Y$,lheading:V$,list:K$,newline:F$,paragraph:X$,table:O$,text:U$},Q$=E$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,R$).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`,q$).getRegex(),$$={...Z$,table:Q$,paragraph:E$(H$).replace(`hr`,R$).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Q$).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`,q$).getRegex()},e1={...Z$,html:E$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,J$).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:O$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:E$(H$).replace(`hr`,R$).replace(`heading`,` *#{1,6} *[^
|
|
265
|
-
]`).replace(`lheading`,V$).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},t1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,n1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,r1=/^( {2,}|\\)\n(?!\s*$)/,i1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,a1=`\\p{P}\\p{S}`,o1=E$(/^((?![*_])[\spunctuation])/,`u`).replace(/punctuation/g,a1).getRegex(),s1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,c1=E$(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,`u`).replace(/punct/g,a1).getRegex(),l1=E$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])`,`gu`).replace(/punct/g,a1).getRegex(),u1=E$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])`,`gu`).replace(/punct/g,a1).getRegex(),d1=E$(/\\([punct])/,`gu`).replace(/punct/g,a1).getRegex(),f1=E$(/^<(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(),p1=E$(J$).replace(`(?:-->|$)`,`-->`).getRegex(),m1=E$(`^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`,p1).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),h1=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,g1=E$(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace(`label`,h1).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_1=E$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,h1).replace(`ref`,W$).getRegex(),v1=E$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,W$).getRegex(),y1={_backpedal:O$,anyPunctuation:d1,autolink:f1,blockSkip:s1,br:r1,code:n1,del:O$,emStrongLDelim:c1,emStrongRDelimAst:l1,emStrongRDelimUnd:u1,escape:t1,link:g1,nolink:v1,punctuation:o1,reflink:_1,reflinkSearch:E$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,_1).replace(`nolink`,v1).getRegex(),tag:m1,text:i1,url:O$},b1={...y1,link:E$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,h1).getRegex(),reflink:E$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,h1).getRegex()},x1={...y1,escape:E$(t1).replace(`])`,`~|])`).getRegex(),url:E$(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},S1={...x1,br:E$(r1).replace(`{2,}`,`*`).getRegex(),text:E$(x1.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},C1={normal:Z$,gfm:$$,pedantic:e1},w1={normal:y1,gfm:x1,breaks:S1,pedantic:b1},T1=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||g$,this.options.tokenizer=this.options.tokenizer||new P$,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:C1.normal,inline:w1.normal};this.options.pedantic?(t.block=C1.pedantic,t.inline=w1.pedantic):this.options.gfm&&(t.block=C1.gfm,t.inline=this.options.breaks?w1.breaks:w1.gfm),this.tokenizer.rules=t}static get rules(){return{block:C1,inline:w1}}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}},E1=class{options;parser;constructor(e){this.options=e||g$}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-`+w$(r)+`">`+(n?i:w$(i,!0))+`</code></pre>
|
|
277
|
-
`:`<pre><code>`+(n?i:w$(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=D$(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=D$(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}},D1=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``}},O1=class e{options;renderer;textRenderer;constructor(e){this.options=e||g$,this.options.renderer=this.options.renderer||new E1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new D1}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}},k1=class{options;block;constructor(e){this.options=e||g$}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?T1.lex:T1.lexInline}provideParser(){return this.block?O1.parse:O1.parseInline}},A1=class{defaults=h$();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=O1;Renderer=E1;TextRenderer=D1;Lexer=T1;Tokenizer=P$;Hooks=k1;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 E1(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 P$(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 k1;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]=k1.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 T1.lex(e,t??this.defaults)}parser(e,t){return O1.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?T1.lex:T1.lexInline,s=i.hooks?i.hooks.provideParser():e?O1.parse:O1.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>`+w$(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},j1=new A1;function M1(e,t){return j1.parse(e,t)}M1.options=M1.setOptions=function(e){return j1.setOptions(e),M1.defaults=j1.defaults,_$(M1.defaults),M1},M1.getDefaults=h$,M1.defaults=g$,M1.use=function(...e){return j1.use(...e),M1.defaults=j1.defaults,_$(M1.defaults),M1},M1.walkTokens=function(e,t){return j1.walkTokens(e,t)},M1.parseInline=j1.parseInline,M1.Parser=O1,M1.parser=O1.parse,M1.Renderer=E1,M1.TextRenderer=D1,M1.Lexer=T1,M1.lexer=T1.lex,M1.Tokenizer=P$,M1.Hooks=k1,M1.parse=M1,M1.options,M1.setOptions,M1.use,M1.walkTokens,M1.parseInline,O1.parse,T1.lex;var N1=class extends E1{heading({tokens:e,depth:t,text:n}){let{discoveryjs:{host:r,useAnchors:i}}=this.options,a=$Q(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:${WR(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="`+WR(t)+`"`;return n&&(i+=` title="`+WR(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
|
-
`}},P1={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 F1(e,t){let{nodeValue:n}=e,r=n.replace(/{{(\d+)}}/gs,(e,n)=>t[n]);r!==n&&(e.nodeValue=r)}function I1(e,t){for(let n of e.childNodes)switch(n.nodeType){case document.ELEMENT_NODE:if(!n.classList.contains(`view-source`)){I1(n,t);for(let e of n.attributes)F1(e,t)}break;case document.TEXT_NODE:F1(n,t)}}function L1(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 R1=`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 z1(e){let t=new A1().setOptions({smartLists:!0,renderer:new N1});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)}I1(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?L1(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:R1,usage:P1}),e.view.define(`md`,n,{props:R1,usage:P1})}var B1=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}})),V1=o(((e,t)=>{var{newLineLength:n}=B1();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++)}})),H1=o(((e,t)=>{var{newLineLength:n}=B1();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++)}})),U1=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)}}})),W1=o(((e,t)=>{var{newLineLength:n}=B1();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)}}})),G1=o(((e,t)=>{t.exports={lines:V1(),lineContents:H1(),matches:U1(),newlines:W1()}})),K1=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}})),q1=o(((e,t)=>{t.exports=K1().createPrinter()})),J1=o(((e,t)=>{var{createPrinter:n}=K1();t.exports=n({print:e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)})})),Y1=o(((e,t)=>{var{forkPrinterSet:n}=K1();t.exports=n.call({},{noop:q1(),html:J1(),tty:q1()})})),X1=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}})),Z1=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}})),Q1=o(((e,t)=>{var n=G1(),r=Y1(),i=X1(),a=Z1();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)}})})),$1=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(XR()):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`})})})),e0=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(XR()):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})})})),t0=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(XR()):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`)})})),n0=l(Q1(),1);$1(),e0(),t0();var r0='let name = "world";\n\nconsole.log(`Hello, ${name}!`);',i0=Function(`return num => num + 5`)(),a0=Function(`return () => alert("Hello world!")`)(),o0=`/src/views/text/source.js`,s0=`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 c0(){let e=new Set,t=new Map,n=e=>{let n=ZR.default.resolveMode(e);return[...t.keys()].find(e=>iX(e,n))||(t.set(n,{name:new Set,mime:new Set}),n)};for(let[r,i]of Object.entries(ZR.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(ZR.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(ZR.default.modes))if(!e.has(n)){let e=ZR.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 l0={demo:{view:`source`,syntax:`js`,source:r0},examples:[{title:`Supported syntaxes`,beforeDemo:['md:"Following values (for both `name` and `mime`) are supported for `syntax` option:"',`html:"<br>"`,{view:`table`,data:c0,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:s0}},{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:r0,syntax:`js`,maxSourceSizeToHighlight:4}},{title:`Custom line numbers`,highlightProps:[`lineNum`],demo:[{view:`source`,source:r0,syntax:`js`,lineNum:i0},{view:`source`,source:r0,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:r0,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:a0}],source:r0,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:r0,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}`"}}]}}]};ZR.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 u0(e,t){let n=ZR.default.getMode(ZR.default.defaults,{name:ZR.default.modeToMime[e]||e,isDiscoveryViewDefined:e=>t.view.isDefined(e)||t.textView.isDefined(e)});return(e,t)=>{let r=ZR.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 ZR.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 d0(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 f0(e,t=`spotlight`){return`${d0(e,t)}${e.marker?` data-marker="${e.marker}"`:``}${typeof e.tooltipId==`number`?` data-tooltip-id="${e.tooltipId}"`:``}`}function p0(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 f0(e,t)+` data-render-id=${e.renderId}${e.kind?` data-kind="${e.kind}"`:``}${n===void 0?``:` data-prefix="${WR(String(n))}"`}${r===void 0?``:` data-postfix="${WR(String(r))}"`}`}var m0={html:{open({data:e}){switch(e.type){case`link`:return`<a href=${JSON.stringify(e.href)}${f0(e,`spotlight`)}>`;case`span`:case`spotlight`:return`<span${f0(e,`spotlight`)}>`}},close({data:e}){switch(e.type){case`link`:return`</a>`;case`span`:case`spotlight`:return`</span>`}}}},h0={html:{open({data:e}){switch(e.type){case`link`:return`<a href=${JSON.stringify(e.href)}${p0(e,`mark`)}>`;case`span`:return`<span${p0(e,`mark`)}>`}},close({data:e}){switch(e.type){case`link`:return`</a>`;case`span`:return`</span>`}}}},g0=`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 _0(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([u0(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})}),m0]),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)}),h0]);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,n0.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 HQ(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:g0,usage:l0,tag:`pre`})}var v0={demo:{view:`text`,data:`"Hello world!"`},examples:[{title:`Shorthand usage`,view:`text:"Hello world!"`}]},y0=`{
|
|
431
|
-
text: #.props has no 'text'?
|
|
432
|
-
} | overrideProps()`;function b0(e){e.view.define(`text`,function(e,{text:t}){e.appendChild(document.createTextNode(String(t)))},{tag:!1,props:y0,usage:v0})}var x0=[`char`,`word`,`wordws`,`sentence`,`line`],S0=[`both`,`added`,`removed`],C0=`The quick brown fox jumps over the lazy dog. It lands softly and runs away.
|
|
433
|
-
The sun is shining brightly. Birds are singing in the trees.`,w0=`A quick brown fox jumped over a lazy dog. It landed softly, then ran away.
|
|
434
|
-
The sun is shining brightly. Birds are singing in the trees.`,T0={demo:{view:`text-diff`,before:`Hello world!`,after:`Hello Discovery.js!`},examples:[{title:`Types`,demoData:x0.map(e=>({type:e,before:C0,after:w0})),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:S0.map(e=>({delta:e,before:C0,after:w0})),demo:{view:`table`,cols:[{header:`Type`,content:[`text:delta`,{view:`text`,when:`delta="both"`,text:` (default)`}]},{header:`Preview`,content:`text-diff{ delta }`}]}}]},E0=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}},D0=new class extends E0{};function O0(e,t,n){return D0.diff(e,t,n)}function k0(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 A0(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 j0(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 M0(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 N0(e,t){return j0(e,t,``)}function P0(e,t){return M0(e,t,``)}function F0(e,t){return t.slice(0,I0(e,t))}function I0(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 L0(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 R0(e,t){if(t)return B0(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function z0(e,t){if(t)return B0(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function B0(e,t){if(!t)return[z0(e),R0(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=L0(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var V0=`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}`,H0=RegExp(`[${V0}]+|\\s+|[^${V0}]`,`ug`),U0=new class extends E0{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=L0(e,r)}else n=e.match(H0)||[];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)&&G0(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&G0(n,i,r,null,t.intlSegmenter),e}};function W0(e,t,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?q0(e,t,n):U0.diff(e,t,n)}function G0(e,t,n,r,i){if(t&&n){let[a,o]=B0(t.value,i),[s,c]=B0(n.value,i);if(e){let r=k0(a,s);e.value=M0(e.value,s,r),t.value=N0(t.value,r),n.value=N0(n.value,r)}if(r){let e=A0(o,c);r.value=j0(r.value,c,e),t.value=P0(t.value,e),n.value=P0(n.value,e)}}else if(n){if(e){let e=z0(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=z0(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=z0(r.value,i),[a,o]=B0(t.value,i),s=k0(n,a);t.value=N0(t.value,s);let c=A0(N0(n,s),o);t.value=P0(t.value,c),r.value=j0(r.value,n,c),e.value=M0(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=z0(r.value,i),n=F0(R0(t.value,i),e);t.value=P0(t.value,n)}else if(e){let n=F0(R0(e.value,i),z0(t.value,i));t.value=N0(t.value,n)}}var K0=new class extends E0{tokenize(e){let t=RegExp(`(\\r?\\n)|[${V0}]+|[^\\S\\n\\r]+|[^${V0}]`,`ug`);return e.match(t)||[]}};function q0(e,t,n){return K0.diff(e,t,n)}var J0=new class extends E0{constructor(){super(...arguments),this.tokenize=X0}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 Y0(e,t,n){return J0.diff(e,t,n)}function X0(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 Z0(e){return e==`.`||e==`!`||e==`?`}var Q0=new class extends E0{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(Z0(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 $0(e,t,n){return Q0.diff(e,t,n)}new class extends E0{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends E0{constructor(){super(...arguments),this.tokenize=X0}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(e2(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 e2(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]=e2(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]=e2(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends E0{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var t2={char:O0,word:W0,wordws:q0,sentence:$0,line:Y0},n2=`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(t2))} ?: 'wordws'
|
|
449
|
-
}`;function r2(e){e.view.define(`text-diff`,function(e,t){let{type:n,before:r,after:i,delta:a}=t,o=t2[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:n2,usage:T0})}var i2={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)}}]},a2=$(`span`,`view-text-match`),o2=`is not array? | {
|
|
450
|
-
text: #.props has no 'text' ? text,
|
|
451
|
-
match,
|
|
452
|
-
ignoreCase: ignoreCase or false
|
|
453
|
-
} | overrideProps()`;function s2(e){e.view.define(`text-match`,function(e,t){let{text:n,match:r,ignoreCase:i}=t;BQ(String(n),r,t=>e.append(t),t=>e.appendChild(a2.cloneNode()).append(t),i)},{tag:!1,props:o2,usage:i2})}var c2={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`}]},l2=`{
|
|
454
|
-
text: #.props has no 'text'?
|
|
455
|
-
} | overrideProps()`;function u2(e){e.view.define(`text-numeric`,function(e,{text:t}){e.innerHTML=GR(t)},{tag:`span`,props:l2,usage:c2})}var d2={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 p2(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&&(!RR(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:d2})}var m2={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 h2(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:m2})}var g2={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 _2(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:g2}),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(!RR(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)),y2(e[r],t-1,i.map)}}function y2(e,t,n=Object.create(null)){let r=e===null?`null`:BJ(e)?`array`:VJ(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++)y2(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)y2(r,t,n.set.map)}return n}var b2=[`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)`],x2=[`null`,`undefined`,`string`,`number`,`bigint`,`boolean`,`symbol`,`function`,`array`,`set`,`object`];function S2(e,t,n,r,i=[],a=``,o=null){Object.keys(t).sort((e,t)=>x2.indexOf(e)-x2.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(`: `),S2(_,o,n,r,i.concat(d?`*`:e),h),_.append(`;
|
|
462
|
-
`)}g.append(_),g.append(a,`}`);break}case`array`:e.append(`[`),S2(e,t[s].map,n,r,i,a),e.append(`]`);break;case`set`:e.append(`Set(`),S2(e,t[s].map,n,r,i,a),e.append(`)`)}})}function C2(e,t){return e.toFixed(t).replace(/\.?0+$/,``)}function w2(e){return[Math.cos(2*Math.PI*e),Math.sin(2*Math.PI*e)]}function T2(e){let t=0;return[`<svg viewBox="-1 -1 2 2" class="pie">`,...e.map(e=>{let[n,r]=w2(t),[i,a]=w2(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 E2(e){let t=0;for(let n in e)e[n].forEach(e=>t+=e);return t}function D2(e){let t=Object.create(null);for(let n in e)t[n]=0,e[n].forEach(e=>t[n]+=e);return t}function O2(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:C2(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),k2(e,{context:r,map:c,count:l},n)}function k2(e,{context:t,map:n,count:r},i){let a=D2(n),o=[],s=x2.filter(e=>e in n);Object.entries(a).sort(([,e],[,t])=>t-e).forEach(([e,t],n)=>{o.push({name:WR(e),count:t,percent:t/r,percent100:C2(100*t/r,1),color:b2[n]})}),i.view.render(e,{view:`block`,when:`typeStat.size() > 1`,data:`typeStat`,className:`pie-stat`,content:[{view:`block`,content:{view:`html`,data:T2}},{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=>A2(e,{context:t,name:r,stat:n},i))}function A2(e,t,n){let r=t.context,i=t.stat[t.name],a=E2(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:C2(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:WR(String(i)),count:t,percent:t/c.count,percent100:C2(100*t/c.count,1),color:b2[n]})}if(e.length){let t=c.count-r;t>0&&e.push({name:`...`,count:t,percent:t/c.count,percent100:C2(100*t/c.count,1),color:b2[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:T2}},{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){k2(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:C2(100*c.count/a,1)+`%`},r)}var j2={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 M2(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)RR(n,t)&&(e.keys.add(t),e.count++,y2(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}S2(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 O2(n,i,e);case`type`:return A2(n,i,e)}}}),e.view.define(`signature`,function(e,n,r,i){let{expanded:a,path:o}=n,s=y2(r,a),c=Array.isArray(o)?o:void 0,l=`rootData`in n?n.rootData:!c||c.length===0?r:void 0;S2(e,s,t,{...i,rootData:l},c)},{usage:j2})}var N2=/^(?:https?:)?\/\/(?:[a-z0-9\-]+(?:\.[a-z0-9\-]+)+|\d+(?:\.\d+){3})(?:\:\d+)?(?:\/\S*?)?$/i;function P2(e,t){return`<span class="${e}">${t}</span>`}function F2(e){return P2(`more`,`\u2026 ${GR(e)} more`)}function I2(e){return WR(L2(e))}function L2(e){return/[^\x20\x21\x23-\x5B\x5D-\uD799]/.test(e)?JSON.stringify(e).slice(1,-1):e}function R2(e,t,n){switch(typeof e){case`boolean`:case`undefined`:return P2(`keyword`,String(e));case`number`:case`bigint`:return P2(`number`,GR(e));case`symbol`:return P2(`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(BQ(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=L2(e.slice(0,n));if(n>r){let e=r-2;s=P2(`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+=P2(`match`,I2(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=P2(`more suffix`,GR(t)))}l>0&&(o+=I2(e.slice(i,i+l)),a-=l)}}}}o===``&&(o=I2(e.slice(0,i)),c=P2(`more suffix`,GR(r-i)))}else n.match?BQ(e,n.match,e=>{o+=I2(e)},e=>{o+=P2(`match`,I2(e))}):o=I2(e);return P2(`string`,!t&&(e[0]===`h`||e[0]===`/`)&&N2.test(e)?`"${s}<a href="${WR(e)}" target="_blank">${o}</a>${c}"`:`"${s}${o}${c}"`)}case`object`:{if(e===null)return P2(`keyword`,`null`);if(BJ(e)){let t=e.length,r=n.limitCollapsed===!1||n.limitCollapsed>t?t:n.limitCollapsed,i=Array.from({length:r},(t,r)=>R2(e[r],!0,n));return t>r&&i.push(`${F2(t-r)} `),`[${i.join(`, `)}]`}if(qJ(e))return`<span class="error-value"><span class="error-value__name">${WR(e.name)}</span>`+(t?``:`<span class="error-value__message">${WR(e.message)}</span>`)+`</span>`;switch(LR(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},()=>R2(i.next().value,!0,n));return t>r&&a.push(`${F2(t-r)} `),`[${a.join(`, `)}]`}case`[object Date]`:return P2(`date`,String(e));case`[object RegExp]`:return P2(`regexp`,String(e))}if(t&&n.limitCompactObjectEntries===0){for(let t in e)if(RR(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(RR(e,t)){if(a<r){let r=WR(t.length>n.maxCompactPropertyLength?t.slice(0,n.maxCompactPropertyLength)+`…`:t);i.push(`${P2(`property`,r)}: ${R2(e[t],!0,n)}`)}a++}return a>r&&i.push(F2(a-r)),i.length?`{ ${i.join(`, `)} }`:`{}`}default:return`unknown type "${typeof e}"`}}var z2=(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=L2(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 B2(e){return e?`, `+GR(e)+` bytes`:``}function V2(e){for(;e.parent!==null;)e=e.parent;return e.host[``]}function H2(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:()=>HQ(JSON.stringify(c))},{text:`Copy as unquoted string`,action:()=>HQ(JSON.stringify(c).slice(1,-1))},{text:`Copy a value (unescaped)`,action:()=>HQ(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}=sK(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:WR(t),action:()=>HQ(t)});let r=V2(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${B2(d)})`,error:a,disabled:!!a,action:()=>HQ(JSON.stringify(c,null,4))}),l.push({text:`Copy as JSON`,notes:`(compact${B2(u)})`,error:o,disabled:!!o,action:()=>HQ(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 U2=[`none`,`default`,`badge`],W2=new WeakMap;function G2(e,t){return Array.isArray(e)?Array.isArray(t)?e.concat(t):e:t}function K2(e){return Array.isArray(e)&&e.length>0?e.map(e=>typeof e==`string`||typeof e==`function`?{query:e}:e):!1}function q2(e){if(typeof e==`string`&&e.length>64){let t=zY(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 J2(e){return K2([...[...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}}),q2])}function Y2(e,t){return G2(t,K2(e))}function X2(e){return U2.includes(e)}function Z2(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=X2(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=GR(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=W2.get(t);n===void 0&&(W2.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 Q2={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},$2={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:Q2,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:Q2,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`}}}]},e4={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`})}},t4=VR(`"`,e4.collapse,e4.actions,e4.stringMode,$(`span`,`string-length`),$(`span`,`string-text-wrapper`,[$(`span`,`string-text`)]),`"`),n4=VR(`[`,e4.collapse,e4.signature,e4.actions,e4.viewAsTable,$(`span`,`value-size`),`]`),r4=VR(`{`,e4.collapse,e4.signature,e4.actions,e4.viewAsTable,e4.sortKeys,$(`span`,`value-size`),`}`),i4=$(`div`,`entry-line`),a4=$(`span`,`value`),o4=$(`span`,`match`),s4=$(`span`,`label`,[`\xA0\xA0\xA0\xA0`,$(`span`,`property`),`:\xA0`]);function c4(e){for(;e.parent!==null;)e=e.parent;return e.host[``]}function l4(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:c4(l),path:i(s)},c,u.context).then(()=>a.classList.remove(`computing`))},16)}})}var u4=50,d4=4,f4=0,p4=150,m4=40,h4=10,g4=1/0,_4=35;function v4(e,t){return typeof e==`number`&&isFinite(e)&&e>=1?parseInt(e,10):t}function y4(e,t){if(typeof e==`string`)return e.length>t.maxStringLength||/[\r\n\f\t]/.test(e);if(BJ(e))return e.length>0;if(typeof e==`object`&&e)switch(LR(e)){case`[object Set]`:return e.size>0;case`[object Object]`:for(let t in e)if(RR(e,t))return!0}return!1}function b4(e){return!(typeof e==`string`||zJ(e)||BJ(e)&&e.every(e=>typeof e==`number`))}function x4(e,t){e.appendChild(document.createTextNode(t))}function S4(e,t,n){t>1&&(e.lastElementChild.innerHTML=GR(t)+` `+n)}function C4(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 w4(e,t,n){let r=s4.cloneNode(!0),i=t.length>n?t.slice(0,n)+`…`:t;x4(r.firstElementChild,i),e.appendChild(r)}function T4(e){function t(e){let t=f.get(e),n=u.get(e);e.classList.add(`struct-expand-value`),e.innerHTML=R2(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=t4.cloneNode(!0),r=n.lastChild.previousSibling,i=r.firstChild,o=r.previousSibling,c=L2(a);o.innerHTML=`length: ${GR(c.length)} chars`,t.match?BQ(a,t.match,e=>i.append(JSON.stringify(e).slice(1,-1)),e=>i.appendChild(o4.cloneNode()).append(JSON.stringify(e).slice(1,-1))):x4(i,c),e.replaceChildren(n),s(e,o)}else if(BJ(a)||VJ(a)){let n=d.get(e),o=f.get(e),c=typeof a.size==`number`?a.size:a.length;e.replaceChildren(n4.cloneNode(!0)),S4(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(r4.cloneNode(!0)),S4(e,l.length,`entries`),s(e,e.lastElementChild),C4(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),w4(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=y4(t,i),s=a4.cloneNode(!0);u.set(s,t),d.set(s,a),f.set(s,i),o&&b4(t)&&r?(e.classList.add(`struct-expanded-value`),n(s,r-1)):(o&&s.classList.add(`struct-expand-value`),s.innerHTML=R2(t,!1,i)),c(s,t,i,a),e.appendChild(s)}function i(t,n,r,a,o,s=0,c=u4){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=i4.cloneNode(!0);o(n,t,s),s!==u&&x4(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);!BJ(r)&&!VJ(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,Z2(m),m.length&&l()}))}let u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakSet,m=[],h=J2(e),g=h,_=null,v=z2(n,t,l,a,p,H2(e,u,d,o),l4(e,u,d,f,o));return e.addHostElEventListener(`click`,v,!1),e.legacyPrepare||e.action.define(`setStructViewAnnotations`,e=>{g=G2(h,K2(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=Y2(o,e.legacyPrepare?e.annotations:g),x={renderer:this,context:a,annotations:b||[],match:HJ(s)||typeof s==`string`?s:null,limit:e.view.listLimit(u,u4),limitCollapsed:e.view.listLimit(d,d4),limitCompactObjectEntries:e.view.listLimit(f,f4),maxStringLength:v4(m,p4),maxCompactStringLength:v4(h,m4),allowedExcessStringLength:v4(_,h4),maxPropertyLength:v4(v,g4),maxCompactPropertyLength:v4(y,_4)};p.add(t),r(t,i,c,x,{parent:null,host:{"":i},key:``,index:0}),l(),(!c||!b4(i))&&y4(i,x)&&t.classList.add(`struct-expand`)},{usage:$2}),()=>{document.removeEventListener(`click`,v,!1)}}var E4=[{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`}],D4={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:E4},{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:E4},{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:E4},{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:E4},{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:E4},{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:E4.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:E4,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:E4,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:E4,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 O4(e,t){return{header:e,sorting:`${t} ascN`,view:`table-cell`,data:t}}function k4(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 A4(e,t,n){return typeof t==`string`&&(t={content:t}),RR(t,`content`)||RR(t,`data`)?{header:e,view:`table-cell`,...t}:{...O4(e,n),...t}}function j4(e){return Array.isArray(e)?e.length:e}function M4(e,t,n){if(typeof n!=`function`)return 0;let r=0;try{for(let e=1,i=j4(t[0]);e<t.length;e++){let a=j4(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 N4(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),VJ(o)&&(o=[...o]),BJ(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=>RR(t,`sorting`)?e.query(t.sorting,null,a):k4(t,e,a));return this.render(n,{view:`table-header`,cols:t,sortings:r,getRowsOrder:t=>M4(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`?O4(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(RR(r,t)?A4(t,r[t],e.pathToQuery([t])):O4(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=>!RR(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:D4})}function P4(e,t,n){return e?r=>{r===`asc`?n(e,!0):r===`desc`&&!t?n():n(e)}:null}function F4(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:P4(d,s,u)},UJ(e)?Array.isArray(e)||`view`in e?{content:e}:e:{text:e}),n,r)}))},{tag:`thead`})}function I4(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 L4(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`},UJ(i)&&typeof i.view!=`string`?i:{content:i})})}return n}function R4(e){e.view.define(`table-footer`,async function(t,n,r,i){let{cols:a}=n,o=L4(a,this.composeConfig),s=t.appendChild($(`tr`)),c=o.map(()=>VR()),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 z4={view:`struct`,expanded:1},B4=[`left`,`center`,`right`];function V4(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=GR(n,!1):e.textContent=n}function H4(e,t,n){if(Array.isArray(t)||ArrayBuffer.isView(t)){t.length>0&&V4(e,t.length);return}if(n){e.classList.add(`complex`);for(let n in t)if(RR(t,n)){e.textContent=`{…}`;return}e.textContent=`{}`;return}if(t!==void 0){if(typeof t==`number`){V4(e,t);return}(t===null||t===!1||t===!0)&&e.classList.add(`keyword`),e.textContent=String(t)}}function U4(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||z4,r,i)}}function W4(e,t){typeof t==`string`&&B4.includes(t)&&e.classList.add(`align-${t}`)}function G4(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(W4(t,u),(s||s===void 0&&d)&&e.queryBool(c,r,i)&&(t.classList.add(`details`),t.addEventListener(`click`,U4(e,t,s,r,i))),a)return e.view.render(t,a,r,i);H4(t,r,d)}},{tag:`td`})}function K4(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 q4(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(W4(t,u),(s||s===void 0&&d)&&e.queryBool(c,r,i)&&(t.classList.add(`details`),t.addEventListener(`click`,U4(e,t,s,r,i))),a)return e.view.render(t,a,r,i);H4(t,r,d)}},{tag:`td`})}var J4=()=>alert(`toggled!`),Y4=([e,...t],n=``)=>{let r=[];for(let i=0;i<e;i++){let e=n+`.`+(i+1);r.push({title:e,children:t.length?Y4(t,e):null})}return r},X4={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:J4},demoData:{text:`Root`,children:[{text:`Child`},{text:`Another child`,children:[{text:`Lvl 2 child`},{text:`Lvl 2 child`}]}]}},{title:`limitLines`,highlightProps:[`limitLines`],demoData:Y4([5,3,3]),demo:{view:`tree`,item:`text:title`,limitLines:7}}]};function Z4(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:X4})}var Q4=`#.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 $4(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:Q4})}var e3=s({alerts:()=>FQ,appHeader:()=>GQ,autoLink:()=>KQ,badges:()=>XQ,block:()=>lQ,blockquote:()=>ZQ,button:()=>wZ,checkbox:()=>kZ,checkboxList:()=>EZ,column:()=>dQ,columns:()=>fQ,contentFilter:()=>jZ,context:()=>p2,dropdown:()=>PZ,editors:()=>xz,expand:()=>hQ,headers:()=>t$,hstack:()=>_Q,html:()=>r$,image:()=>s$,imagePreview:()=>l$,indicator:()=>d$,input:()=>BZ,link:()=>m$,listItem:()=>vQ,lists:()=>bQ,markdown:()=>z1,menu:()=>HZ,menuItem:()=>WZ,navButton:()=>qZ,pageHeader:()=>SQ,popup:()=>AQ,progressbar:()=>YZ,section:()=>MQ,select:()=>ZZ,signature:()=>M2,source:()=>_0,struct:()=>T4,switchView:()=>h2,tab:()=>iQ,table:()=>N4,tableCell:()=>q4,tableFooter:()=>R4,tableFooterCell:()=>G4,tableHeader:()=>F4,tableHeaderCell:()=>I4,tableRow:()=>K4,tabs:()=>eQ,text:()=>b0,textDiff:()=>r2,textMatch:()=>s2,textNumeric:()=>u2,textRender:()=>_2,tocSection:()=>NQ,toggle:()=>oQ,toggleGroup:()=>sQ,tree:()=>Z4,treeItem:()=>$4});function t3(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 n3(e){e.page.define(`not-found`,['alert-warning:"Page `" + name + "` not found"'])}function r3(e,t=``){return typeof e==`string`?e:t}var i3=[`query`,`graph`,`view`,`viewEditorHidden`,`title`,`dzen`,`noedit`],a3=[`q`,`graph`,`v`,`vh`,`title`,`dzen`,`noedit`];function o3(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`,DY(t)]),n&&l.push([`graph`,DY(JSON.stringify(n))]),typeof r==`string`&&l.push(r?[`v`,DY(r)]:[`v`]),i&&l.push([`vh`]);for(let[e,t]of Object.keys(c||{}).sort())i3.includes(e)||l.push([e,e.endsWith(`-b64`)&&typeof t==`string`?DY(t):t]);return l}function s3(e){let t=Object.fromEntries(e),n={title:r3(t.title),query:kY(r3(t.q)),graph:JSON.parse(kY(r3(t.graph))||`null`),view:`v`in t?kY(r3(t.v)):void 0,viewEditorHidden:`vh`in t,dzen:`dzen`in t,noedit:`noedit`in t};for(let[e,r]of Object.entries(t))a3.includes(e)||(n[e]=e.endsWith(`-b64`)&&typeof r==`string`?kY(r):t[e]);return n}function c3(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!i3.includes(e)))}function l3(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 u3(e,t={}){let n={...e,params:c3(e.params)};return!l3(t,n,`params`,`actions`)||!l3(t.params,n.params)||!l3(t.actions,n.actions)?n:t}function d3(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 p3(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 m3(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 h3(e){let t=m3(e);return t?t.toISOString().replace(/^(\d{4})-(\d{2})-(\d{2})T([\d:]+).*/,`$3/$2/$1 $4 UTC`):null}function g3(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()=>HQ(await e.action.call(`permalink`,e.pageHash))},{text:`Copy page hash`,action:()=>HQ(e.pageHash)},{text:`Copy page as JSON`,action:()=>HQ(p3(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}=d3(t),l=h3(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 `+h3(new Date)}}}function _3(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 y3(e){return Array.isArray(e)?`Array (${_3(e,`element`,`elements`)})`:e&&typeof e==`object`?`Object (${_3(Object.keys(e),`entry`,`entries`)})`:`Scalar (${e===null?`null`:typeof e})`}function b3(e){return $(`span`,`num-delim-wrapper`,GR(e))}function x3(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 S3(e,t,n){Array.isArray(t)||(t=[]);let r=t.map(e=>({type:e.resource?.type||`unknown`,name:e.resource?.name||`unknown`}));if(rX(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 C3(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(x3(`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?x3(`line`,{stroke:`#888`,x1:s,y1:l,x2:u,y2:d}):x3(`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 w3(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 T3(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 E3(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 D3(e,t){let n=e.view.QueryEditor,r={},i,a=NaN,o=!1,s=NaN,c,l,u=w3({}),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]=E3(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]=E3(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=T3(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,...T3(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`,N(e)}},[$(`span`,{class:`query-input-variable`,"data-name":`input`},[`@`]),e.state===`awaiting`?`Computing...`:e.state===`canceled`?`Not available (undefined)`:b3(y3(e.data))]),$(`div`,{class:`query-input-context`,tabindex:-1,onclick(){i=i===`context`?void 0:`context`,N(e)}},[$(`span`,{class:`query-input-variable`,"data-name":`context`},[`#`]),e.state===`awaiting`?`Computing...`:e.state===`canceled`?`Not available (undefined)`:b3(y3(e.context))])),N(e)}function N(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 ie(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 ae(e){switch(e.state){case`canceled`:b.setValue(e.query),ie(e,`Result`,`Not available`);break;case`awaiting`:b.setValue(e.query),ie(e,null,`Awaiting...`);break;case`computing`:b.setValue(e.query,e.data,e.context),ie(e,null,`Computing...`);break;case`successful`:b.setValue(e.query,e.data,e.context),ie(e,`Result`,[b3(y3(e.computed)),` in `,b3(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),ie(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">`+WR(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),ae(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=T3(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=u3(n,d),a=d3(n),o=a.query,s=a.view,p=w3({...a.graph||r});return S.classList.toggle(`root`,p.current.length<2),f=S3(O,i.datasets||[],f),C3(k,p,e,{query:o,view:s}),u=p,d=i,c=o,l=s,L(u,t,i)}}}function O3(e){return!!(e&&e.nodeType===Node.TEXT_NODE)}function k3(e,t=`
|
|
513
|
-
`){let n=``;for(let r of e.childNodes)!O3(r)&&r.previousSibling&&!O3(r.previousSibling)&&(n+=t),n+=A3(r,t);return n}function A3(e,t=`
|
|
514
|
-
`){switch(e.nodeType){case Node.ELEMENT_NODE:let[n,r=``]=e.cloneNode().outerHTML.split(/(?=<\/[^>]+>$)/);return n+(e.firstChild&&!O3(e.firstChild)?t+` `:``)+k3(e,t+` `)+(e.lastChild&&!O3(e.lastChild)?t:``)+r;case Node.TEXT_NODE:return e.nodeValue;case Node.COMMENT_NODE:return`<!--`+e.nodeValue+`-->`;case Node.DOCUMENT_FRAGMENT_NODE:return k3(e,t)}return``}function j3(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 M3=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 N3(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=bY(e.demo||e.view);return{syntax:`discovery-view`,content:t,refs:j3(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:j3(e,t)}}}]},{when:`#.code="html"`,content:{view:`source`,data:(e,t)=>({syntax:`html`,content:k3(t.root)})}}]}}};return{view:`block`,className:`discovery-view-usage`,context:M3(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 P3=`{
|
|
515
|
-
view: 'struct',
|
|
516
|
-
expanded: 1
|
|
517
|
-
}`,F3=[{name:`Table`,content:bY({view:`table`})},{name:`Auto-link list`,content:bY({view:`ol`,item:`auto-link`})},{name:`Signature`,content:bY({view:`signature`,expanded:2})},{name:`Text render`,content:bY({view:`text-render`,content:[`table`]})}];function I3(e,t,n){return $(`div`,{class:`discovery-editor-tab`,onclick:()=>n({view:t})},e||`Untitled preset`)}function L3(e,t){let n=e.view.ViewEditor,r=F3,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:P3,viewEditorHidden:!1},!0)}},e===`Custom`?[e,$(`span`,`show-view-editor-toggle`)]:e))),$(`div`,`discovery-editor-tabs presets`,r.map(({name:e,content:n})=>I3(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:bY(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,N3(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`,uZ(p,100)),{el:f,render(t,n,r){let a=u3(n,i.context),o=d3(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=P3),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=WR(String(t))+`<br>(see details in console)`,e.logger.error(t)})}i={data:t,context:a,view:d}}}}}function R3(e){function t(t,n){return e.setPageParams({...e.pageParams,...t},n)}function n(){if(o!==null)return o;let n=g3(e,t),r=D3(e,t),i=L3(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:o3,decodeParams:s3})}var z3=`
|
|
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
|
-
`,B3=`
|
|
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
|
-
`,V3={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 H3(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:M3(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:z3,codeConfig:V3},{view:`markdown`,when:`#.render = "text"`,source:B3,codeConfig:V3}]},{content:[N3(e)]}]}}},{sidebar:!1})}var U3=s({default:()=>t3,discovery:()=>R3,notFound:()=>n3,viewsShowcase:()=>H3}),W3=[`nav`,`sidebar`,`page`],G3=()=>{},K3=e=>e,q3=e=>Object.fromEntries(e);function J3(e,t,n){n?e.dataset[t]=n:delete e.dataset[t]}function Y3(e,t,n,r){let i=e.page.get(t)?.options;return i!==void 0&&RR(i,n)?i[n]:r}function X3(e,t,n,r){let i=Y3(e,t,n,r);return typeof i==`function`?i:r}var Z3=class extends uX{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 kX(c,l),this.inspectMode=new KR(!1),this.initDom(n),this.view=new rZ(this),this.nav=new jX(this),this.preset=new sZ(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(e3),this.apply(U3),u&&this.page.define(this.defaultPageId,u),m&&this.apply(xZ),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=dX(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=[...W3]);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!==G3&&(this.initRenderTriggers(),this.initRenderTriggers=G3,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=X3(this,e,`encodeParams`,K3)(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=>X3(this,e||this.defaultPageId,`decodeParams`,q3));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||!rX(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,J3(this.dom.container,`page`,t),J3(this.dom.container,`dzen`,!!n.dzen),J3(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($3(),{setup:$3});var Q3=e=>/^\./.test(e);function $3(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=>Q3(e)),mimeTypes:o.filter(e=>!Q3(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(i6(),{setup:i6});var e6=()=>{},t6=[`primary`,`secondary`,`menu`],n6=[`insert`,`prepend`,`append`,`before`,`after`,`replace`,`remove`];function r6(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 i6(e){let t=e?.hostId||IQ(),n=e?.postponeMessages,r=typeof e?.onNotify==`function`?e.onNotify:()=>{};return function(e){let i=null,a=e6,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=e6,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=IQ();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(!SX.includes(t)){e.logger.warn(`Wrong value for colorScheme "${t}", supported values: ${SX.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(!t6.includes(t)){e.logger.warn(`Wrong value for nav button place "${t}", supported values: ${t6.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(r6(i,l,a),r,n);break}case`prepend`:case`append`:{let{config:n,commands:r}=u;e.nav[t][u.action](r6(n,l,r));break}case`before`:case`after`:case`replace`:{let{name:n,config:r,commands:i}=u;e.nav[t][u.action](n,r6(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: ${n6.map(e=>JSON.stringify(e)).join(`, `)}`)}break}case`unloadData`:o(),e.unloadData();break;case`dataStream`:{let{stream:e,resource:t}=u;o(),d(Eq(e,{resource:t}));break}case`startChunkedDataUpload`:{let{acceptToken:e,resource:t}=u;o(),i=Object.assign(Aq({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:OX(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 a6=`.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}`,o6=`di-expand:`,s6=`di-edit:`;function c6(e){return s6+encodeURIComponent(JSON.stringify(e))}function l6(e){if(!e.startsWith(s6))return null;try{return JSON.parse(decodeURIComponent(e.slice(8)))}catch{return null}}function u6(e){return o6+encodeURIComponent(JSON.stringify(e))}function d6(e){if(!e.startsWith(o6))return null;try{return JSON.parse(decodeURIComponent(e.slice(10)))}catch{return null}}var f6=[],p6=new WeakMap,m6=new WeakMap,h6=new WeakMap,g6=new WeakMap,_6={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 ${_6[e]??`di-type-other`}`}}function y6(e){return!!e&&typeof e==`object`&&(`$ref`in e||`$truncated`in e)}function b6(e,t,n,r,i){return e&&typeof e==`object`?(h6.set(e,t),!1):(i[r]=t,!0)}function x6(e,t,n=`i`){if(!e||typeof e!=`object`)return{value:e};if(Array.isArray(e)){let r=Array.from({length:e.length}),i={},a={},o=!1,s=!1;return e.forEach((e,c)=>{let l=t&&!y6(e)?[...t,[n,c]]:null,u=x6(e,l);r[c]=u.value,l&&b6(u.value,l,r,c,a)&&(s=!0),u.badge&&(u.value&&typeof u.value==`object`?p6.set(u.value,u.badge):(i[c]=u.badge,o=!0))}),o&&m6.set(r,i),s&&g6.set(r,a),{value:r}}let r=e;if(r.$truncated===`depth`&&Array.isArray(r.$path))return{value:typeof r.$preview==`string`?r.$preview:`load deeper`,badge:{text:`load deeper`,className:`di-type-badge di-type-lazy`,href:u6([...f6,...r.$path])}};if(typeof r.$type==`string`){let e=r.$type;switch(e){case`function`:{let e=typeof r.name==`string`&&r.name!==`(anonymous)`?r.name:``;return{value:e?`<function ${e}>`:`<function>`,badge:v6(`function`,`Function`)}}case`Map`:return{value:(r.value===void 0?x6(r.entries??{},null):x6(r.value,t)).value,badge:v6(`Map`,`Map(${r.size??`?`})`)};case`Set`:return{value:x6(r.values??[],t,`s`).value,badge:v6(`Set`,`Set(${r.size??`?`})`)};case`Date`:case`RegExp`:case`URL`:case`bigint`:case`symbol`:return{value:r.value,badge:v6(e,e===`bigint`?`BigInt`:e===`symbol`?`Symbol`:e)};case`Error`:{let e={...r};return delete e.$type,{value:e,badge:v6(`Error`)}}case`getter-error`:return{value:String(r.message??``),badge:v6(`getter-error`,`getter threw`)};default:return{value:`<${e}>`,badge:v6(e,typeof r.length==`number`?`${e}(${r.length})`:e)}}}let i={},a={},o={},s=!1,c=!1,l,u=t&&!y6(r)?t:null;for(let[e,t]of Object.entries(r)){if(e===`$class`&&typeof t==`string`){l={text:`class ${t}`,className:`di-type-badge di-type-class`};continue}let n=u&&e!==`$truncated`&&!y6(t)?[...u,[`k`,e]]:null,r=x6(t,n);i[e]=r.value,n&&b6(r.value,n,i,e,o)&&(c=!0),r.badge&&(r.value&&typeof r.value==`object`?p6.set(r.value,r.badge):(a[e]=r.badge,s=!0))}return s&&m6.set(i,a),c&&g6.set(i,o),{value:i,badge:l}}function S6(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 C6(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 w6(e,t=[],n=!1){f6=t;try{let r=x6(e,n&&!y6(e)?t:null);return r.badge&&r.value&&typeof r.value==`object`&&p6.set(r.value,r.badge),n&&r.value&&typeof r.value==`object`&&!y6(e)&&h6.set(r.value,t),r.value}finally{f6=[]}}var T6=`
|
|
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 E6(e){return e.closest(`.value-annotations`)??e.parentElement??e}function D6(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=p6.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=m6.get(n)?.[t.key];if(e)return{place:`after`,style:`badge`,...e}}}function O6(e,t,n={view:`struct`,expanded:2},r={},i,a){let o=ln(null),s=null;function c(e,t){if(!a?.enabled())return;let n;if(e&&typeof e==`object`)n=h6.get(e);else{let e=t?.host;e&&typeof e==`object`&&t?.key!==void 0&&(n=g6.get(e)?.[t.key])}if(n)return{place:`after`,style:`badge`,text:`✎`,className:`di-type-badge di-type-edit`,href:c6(n),tooltip:{content:`text:"Edit this value"`}}}let l={annotations:[D6,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=d6(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`,E6(r).after(n),t.view.render(n,l,w6(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),E6(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=l6(n.getAttribute(`href`)??``);r&&t(r)})}Xi(async()=>{if(!e.value)return;let n=new Z3({container:e.value,styles:[a6,T6],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)}),ea(()=>{o.value=null}),Tr(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 k6={class:`flex flex-col h-full min-h-0 bg-base border-l border-base w-100`},A6={class:`flex items-center gap-2 px3 py2 border-b border-base select-none`},j6=[`title`],M6={class:`flex-1 min-h-0 overflow-auto px3 py2 flex flex-col gap-4 text-sm`},N6={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`},P6={key:1,class:`flex flex-col gap-2`},F6={class:`flex flex-wrap gap-1 p-0.5 bg-secondary rounded-lg self-start`,role:`tablist`},I6=[`onClick`],L6=[`placeholder`],R6={key:2,class:`flex items-center gap-2 text-xs cursor-pointer select-none`},z6={class:`font-mono`},B6={key:3,class:`text-xs color-faint font-mono select-none`},V6={key:2,class:`flex flex-col gap-2`},H6={class:`flex gap-2`},U6={key:3,class:`flex flex-col gap-2`},W6={class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},G6=[`placeholder`],K6={class:`flex flex-wrap gap-1 p-0.5 bg-secondary rounded-lg self-start`,role:`tablist`},q6=[`onClick`],J6={key:3,class:`flex items-center gap-2 text-xs cursor-pointer select-none`},Y6={class:`font-mono`},X6={key:4,class:`text-xs color-faint font-mono select-none`},Z6={key:4,class:`flex flex-col gap-2`},Q6=W({__name:`EditPanel`,props:{path:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=pM(),a=[`string`,`number`,`boolean`,`null`,`undefined`,`json`],o=Q(()=>S6(i.result.value,n.path)),s=Q(()=>C6(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=``}}}Tr(()=>n.path,g,{immediate:!0});let _=ln(null),v=ln(!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(``);Tr(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=ln(!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`,k6,[Y(`div`,A6,[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},Oe(s.value),9,j6),t[12]||=Y(`div`,{class:`flex-auto`},null,-1),X(gm,{class:`text-sm`,icon:`i-ph:x`,label:`Close`,tooltip:`Close the edit panel`,onClick:t[0]||=e=>r(`close`)})]),Y(`div`,M6,[_.value?(K(),q(`div`,N6,Oe(_.value),1)):Z(``,!0),d.value?(K(),q(`section`,P6,[t[14]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Set value `,-1),Y(`div`,F6,[(K(),q(os,null,pa(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},Oe(e),11,I6)),64))]),p.value===`string`||p.value===`number`?hr((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:su(x,[`enter`])},null,40,L6)),[[Gl,m.value]]):p.value===`json`?hr((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)),[[Gl,m.value]]):p.value===`boolean`?(K(),q(`label`,R6,[hr(Y(`input`,{"onUpdate:modelValue":t[3]||=e=>h.value=e,type:`checkbox`},null,512),[[Kl,h.value]]),Y(`code`,z6,Oe(h.value),1)])):(K(),q(`div`,B6,Oe(p.value),1)),X(PR,{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`,V6,[t[16]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Rename key `,-1),Y(`div`,H6,[hr(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:su(C,[`enter`])},null,544),[[Gl,S.value]]),X(PR,{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`,U6,[Y(`div`,W6,` Add to `+Oe(c.value),1),c.value===`set`?Z(``,!0):hr((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,G6)),[[Gl,w.value]]),Y(`div`,K6,[(K(),q(os,null,pa(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},Oe(e),11,q6)),64))]),T.value===`string`||T.value===`number`?hr((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:su(A,[`enter`])},null,544)),[[Gl,E.value]]):T.value===`json`?hr((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)),[[Gl,E.value]]):T.value===`boolean`?(K(),q(`label`,J6,[hr(Y(`input`,{"onUpdate:modelValue":t[8]||=e=>D.value=e,type:`checkbox`},null,512),[[Kl,D.value]]),Y(`code`,Y6,Oe(D.value),1)])):(K(),q(`div`,X6,Oe(T.value),1)),X(PR,{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`,Z6,[t[18]||=Y(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Danger `,-1),X(PR,{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,Oe(ee.value?`Confirm Delete?`:`Delete Key`),1)]),_:1},8,[`disabled`,`title`])])):Z(``,!0)])]))}}),$6={class:`flex flex-col h-full min-h-0`},e8={class:`flex items-center gap-1`},t8={class:`flex items-center gap-1`},n8={class:`flex items-center gap-1`},r8={class:`flex items-center gap-1`},i8={class:`flex items-center gap-1`},a8={key:1,class:`op-fade select-none`},o8={key:2,class:`flex items-center gap-1.5 color-faint`},s8=[`title`],c8={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`},l8={class:`flex-1 min-h-0 flex`},u8={key:1,class:`flex-1 grid place-items-center select-none`},d8=100,f8=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=ln(null),a=ln(null),o=O6(a,uT,{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});Tr(()=>[n.result,n.canEdit],([e])=>{n.hasResult&&o.setData(w6(e,[],n.canEdit??!1))}),Tr(()=>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=ln(!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`,$6,[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(os,{key:0},[Y(`span`,e8,[n[4]||=Y(`span`,{class:`op50`},`jora`,-1),n[5]||=ws(),X(mB,{ms:e.stats.queryMs,colorize:``},null,8,[`ms`])]),n[14]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,t8,[n[6]||=Y(`span`,{class:`op50`},`norm`,-1),n[7]||=ws(),X(mB,{ms:e.stats.normalize.ms,colorize:``},null,8,[`ms`])]),n[15]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,n8,[n[8]||=Y(`span`,{class:`op50`},`rpc`,-1),n[9]||=ws(),X(mB,{ms:e.stats.rpcMs,colorize:``},null,8,[`ms`])]),n[16]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,r8,[X(uB,{bytes:e.stats.payloadBytes,colorize:``},null,8,[`bytes`])]),n[17]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,null,[ws(Oe(e.stats.normalize.nodes)+` `,1),n[10]||=Y(`span`,{class:`op50`},`nodes`,-1)]),e.stats.normalize.refs?(K(),q(os,{key:0},[n[12]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,null,[ws(Oe(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(Zy,{key:1,color:12,text:`truncated`})):Z(``,!0),e.lastRunAt?(K(),q(os,{key:2},[n[13]||=Y(`div`,{class:`h-5 border-r border-base`},null,-1),Y(`span`,i8,[X(fB,{date:e.lastRunAt,live:``},null,8,[`date`])])],64)):Z(``,!0)],64)):(K(),q(`span`,a8,`no query run yet`)),n[19]||=Y(`div`,{class:`flex-auto`},null,-1),e.running?(K(),q(`span`,o8,[...n[18]||=[Y(`span`,{class:`i-ph:circle-notch animate-spin`},null,-1),ws(` 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,s8)):Z(``,!0),e.hasResult?(K(),J(gm,{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(d8)})):Z(``,!0),e.hasResult?(K(),J(gm,{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(gm,{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(gm,{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`,c8,Oe(e.error),1)):Z(``,!0),hr(Y(`div`,l8,[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(Q6,{key:0,path:i.value,onClose:n[3]||=e=>i.value=null},null,8,[`path`])):Z(``,!0)],512),[[Hc,e.hasResult]]),e.hasResult?Z(``,!0):(K(),q(`div`,u8,[...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)]]))]))}}),p8={key:1},m8=W({__name:`ActionToggleGroup`,props:Pa({options:{},multiple:{type:Boolean,default:!1},iconOnly:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=no(e,`modelValue`);return(n,r)=>(K(),J(H(gR),{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,type:e.multiple?`multiple`:`single`,class:`p-1 rounded-lg bg-secondary inline-flex gap-1 w-max`},{default:U(()=>[(K(!0),q(os,null,pa(e.options,t=>(K(),J(H(vR),{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-base 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`,p8,Oe(t.label??t.value),1))]),_:2},1032,[`value`,`disabled`,`aria-label`,`class`]))),128))]),_:1},8,[`modelValue`,`type`]))}}),h8=[`type`,`placeholder`,`disabled`,`aria-invalid`],g8=W({__name:`FormTextInput`,props:Pa({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=no(e,`modelValue`);return(n,r)=>(K(),q(`label`,{class:ye([`px-2 border rounded bg-base 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`),hr(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,h8),[[$l,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))}}),_8={class:`p-4 flex pointer-events-none items-center inset-0 justify-center fixed z-modal-content`},v8={key:0,class:`px-3 py-2 border-b border-base flex shrink-0 gap-2 items-start justify-between`},y8={class:`min-w-0`},b8={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`},S8=W({__name:`OverlayModal`,props:Pa({title:{},description:{}},{open:{type:Boolean},openModifiers:{}}),emits:[`update:open`],setup(e){let t=no(e,`open`);return(n,r)=>(K(),J(H(rF),{open:t.value,"onUpdate:open":r[0]||=e=>t.value=e},{default:U(()=>[n.$slots.trigger?(K(),J(H(BF),{key:0,"as-child":``},{default:U(()=>[G(n.$slots,`trigger`)]),_:3})):Z(``,!0),X(H(RF),null,{default:U(()=>[X(H(IF),{class:`bg-[#ddd]/40 inset-0 fixed z-modal-backdrop backdrop-blur-sm dark:bg-black/40`,"data-af-animate":``}),Y(`div`,_8,[X(H(NF),{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`,v8,[Y(`div`,y8,[e.title?(K(),J(H(zF),{key:0,class:`color-base font-medium`},{default:U(()=>[ws(Oe(e.title),1)]),_:1})):Z(``,!0),e.description?(K(),J(H(PF),{key:1,class:`text-sm op-fade`},{default:U(()=>[ws(Oe(e.description),1)]),_:1})):Z(``,!0),G(n.$slots,`header`)]),X(H(iF),{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`,b8,[G(n.$slots,`default`)]),n.$slots.footer?(K(),q(`footer`,x8,[G(n.$slots,`footer`)])):Z(``,!0)]),_:3})])]),_:3})]),_:3},8,[`open`]))}}),C8={class:`flex flex-col gap-2 min-h-0`},w8={class:`flex items-center gap-2`},T8={key:0,class:`text-xs op-fade font-mono tabular-nums`},E8={key:0,class:`grid grid-cols-[repeat(auto-fit,minmax(15rem,1fr))] gap-1`},D8=[`title`,`onClick`],O8={class:`flex flex-col min-w-0`},k8={class:`text-sm truncate`},A8={key:0,class:`font-mono text-11px color-faint truncate`},j8=[`title`],M8={key:1,class:`text-xs color-faint px-1 select-none`},N8={class:`flex flex-col gap-3`},P8={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`},F8={class:`flex items-center gap-3 flex-wrap text-xs`},I8={class:`flex flex-col gap-1.5`},L8={class:`text-11px color-faint`},R8=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`,C8,[Y(`div`,w8,[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`,T8,`(`+Oe(e.saved.length+e.suggested.length)+`)`,1)):Z(``,!0),n[7]||=Y(`div`,{class:`flex-1`},null,-1),e.readonly?Z(``,!0):(K(),J(PR,{key:1,class:`text-sm`,icon:`i-ph:bookmark-simple-duotone`,onClick:d},{default:U(()=>[...n[5]||=[ws(` Save query `,-1)]]),_:1}))]),u.value.length?(K(),q(`div`,E8,[(K(!0),q(os,null,pa(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`,O8,[Y(`span`,k8,Oe(t.recipe.title??(t.recipe.query||`$ (entire object)`)),1),t.recipe.title||!t.recipe.query?(K(),q(`span`,A8,Oe(t.recipe.query||`$`),1)):Z(``,!0)]),n[8]||=Y(`div`,{class:`flex-1`},null,-1),(K(!0),q(os,null,pa(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`},Oe(e.label),9,j8))),128)),t.saved&&!e.readonly?(K(),J(gm,{key:0,icon:`i-ph:trash-duotone`,label:`Delete`,tooltip:`Delete`,class:`text-sm op0 group-hover:op100 transition-opacity`,onClick:au(e=>r(`remove`,t.saved),[`stop`])},null,8,[`onClick`])):Z(``,!0)],8,D8))),128))])):(K(),q(`div`,M8,` No queries yet. Compose one and hit "Save query". `)),X(S8,{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(PR,{onClick:n[3]||=e=>i.value=!1},{default:U(()=>[...n[11]||=[ws(` Cancel `,-1)]]),_:1}),X(PR,{variant:`primary`,onClick:f},{default:U(()=>[...n[12]||=[ws(` Save `,-1)]]),_:1})]),default:U(()=>[Y(`div`,N8,[Y(`div`,P8,Oe(e.currentQuery.trim()||`$`),1),Y(`div`,F8,[n[9]||=Y(`span`,{class:`color-muted`},`Filters:`,-1),(K(!0),q(os,null,pa(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),ws(` `+Oe(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`,I8,[n[10]||=Y(`span`,{class:`text-xs color-muted`},`Save location`,-1),X(m8,{modelValue:s.value,"onUpdate:modelValue":n[2]||=e=>s.value=e,options:c},null,8,[`modelValue`]),Y(`span`,L8,Oe(s.value===`workspace`?`.devframe/ — committed, shared with the team`:`node_modules/ — this checkout only`),1)])])]),_:1},8,[`open`])]))}});function z8(){let e=V([]);async function t(){e.value=await $w().savedList()}async function n(e){let n=await $w().savedSave(e);return await t(),n}async function r(e){await $w().savedDelete(e.id,e.scope),await t()}return{saved:e,refresh:t,save:n,remove:r}}var B8={class:`h-100dvh flex flex-col bg-base color-base font-sans`},V8={class:`flex-1 min-h-0`},H8={class:`flex flex-col h-full overflow-hidden min-h-0`},U8={class:`flex-1 min-h-0 overflow-y-auto`},W8={class:`min-h-full flex flex-col`};hu(W({__name:`App`,setup(e){let t=dM(),n=z8();_r(fM,t),Ed(()=>uT.value),Xi(async()=>{await cT(),Zw.connected&&(await Promise.all([t.loadSources(),n.refresh()]),$w().onSourcesChanged(()=>void t.loadSources()),$w().onDataChanged(e=>t.handleDataChanged(e)),nT(`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`,B8,[Y(`main`,V8,[X(wd,{"storage-key":`data-inspector-panes`,class:`h-full`},{default:U(()=>[X(H(Cd),{size:38,"min-size":`24`,class:`min-w-0`},{default:U(()=>[Y(`div`,H8,[X(pT),X(MR),Y(`div`,U8,[Y(`div`,W8,[X(Iz),X(R8,{saved:H(n).saved.value,suggested:H(t).activeSource.value?.queries??[],"current-query":H(t).query.value,"current-filters":H(t).settings,readonly:H(Zw).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(Cd),{class:`min-w-0`},{default:U(()=>[X(f8,{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`);
|