@devtable/dashboard 13.40.0 → 13.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard.es.js +4 -2
- package/dist/dashboard.umd.js +2 -2
- package/dist/stats.html +1 -1
- package/dist/version.json +2 -2
- package/package.json +1 -1
package/dist/dashboard.es.js
CHANGED
|
@@ -1092,10 +1092,12 @@ function lv(e, t) {
|
|
|
1092
1092
|
case "quantile":
|
|
1093
1093
|
return zs(e, t.config.p);
|
|
1094
1094
|
case "CV":
|
|
1095
|
+
if (e.length === 0)
|
|
1096
|
+
return Number.NaN;
|
|
1095
1097
|
const n = ti.std(...e), i = ti.mean(...e);
|
|
1096
1098
|
return i ? n / i : Number.NaN;
|
|
1097
1099
|
case "std":
|
|
1098
|
-
return ti.std(...e);
|
|
1100
|
+
return e.length === 0 ? Number.NaN : ti.std(...e);
|
|
1099
1101
|
default:
|
|
1100
1102
|
return e;
|
|
1101
1103
|
}
|
|
@@ -9657,7 +9659,7 @@ class oc {
|
|
|
9657
9659
|
}), this.instanceRegistry.clear(), this.factoryRegistry.clear();
|
|
9658
9660
|
}
|
|
9659
9661
|
}
|
|
9660
|
-
const bf = "13.40.
|
|
9662
|
+
const bf = "13.40.1", h1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9661
9663
|
__proto__: null,
|
|
9662
9664
|
version: bf
|
|
9663
9665
|
}, Symbol.toStringTag, { value: "Module" }));
|
package/dist/dashboard.umd.js
CHANGED
|
@@ -52,7 +52,7 @@ Check the top-level render call using <`+N+">.")}return A}}function Zg(S,A){{if(
|
|
|
52
52
|
</tbody>
|
|
53
53
|
</table>
|
|
54
54
|
`;function Mi(e,t){const n=Object.keys(t),s=Object.values(t);try{return new Function(...n,`return \`${e}\`;`)(...s)}catch(i){throw n.length===0&&e.includes("$")?new Error("[formatSQL] insufficient payload"):i}}function zi(e,t){try{return Mi(e,t)}catch(n){return console.error(n),n.message}}function tx({sql:e,pre_process:t}){if(!t.trim())return e;try{return new Function(`return ${t}`)()({sql:e},Pt)}catch(n){throw console.error(n),n}}function nx(e,t,n){if(!e.trim())return t;try{return new Function(`return ${e}`)()(t,Pt,n)}catch(s){throw console.error(s),s}}function rx(e){e=e||{};const t=Object.keys(e).sort(),n=[];for(let s=0;s<t.length;s++){const i=t[s];if(i!="authentication"&&e[i])n.push(t[s]+"="+(typeof e[i]=="object"?JSON.stringify(e[i]):e[i]));else{const a=Object.keys(e[i]).sort();for(let l=0;l<a.length;l++){const c=a[l];c!="sign"&&e[i][c]&&n.push(a[l]+"="+(typeof e[i][c]=="object"?JSON.stringify(e[i][c]):e[i][c]))}}}return n.sort().join("&")}function sx(e,t){let n=rx(e);return n+="&key="+t,Um.MD5(n).toString().toUpperCase()}class Sc{constructor(){this.type="default_api_client",this.baseURL="http://localhost:31200",this.app_id="",this.app_secret=""}getAuthentication(t){if(!this.app_id||!this.app_secret)return;const n=new Date().getTime().toString();return{app_id:this.app_id,nonce_str:n,sign:sx({app_id:this.app_id,nonce_str:n,...t},this.app_secret)}}getRequest(t,n){return(s,i,a,l)=>{const c=this.buildHeader(a),u=this.buildAxiosConfig(t,s,i,a,c,n);return Rt(u).then(d=>l?d:d.data).catch(d=>{if(Rt.isCancel(d))return Promise.reject(d);const p=v.get(d,"response.data.detail.message",d.message);return Promise.reject(new Error(p))})}}get(t){return this.getRequest("GET",t)}post(t){return this.getRequest("POST",t)}put(t){return this.getRequest("PUT",t)}buildAxiosConfig(t,n,s,i,a,l){const c={baseURL:this.baseURL,method:t,url:n,params:t==="GET"?s:i.params,headers:a,signal:l};return["POST","PUT"].includes(t)&&(c.data=i.string?JSON.stringify(s):s,c.data.authentication=this.getAuthentication(c.data)),c}buildHeader(t){const n=window.localStorage.getItem("token");return{"X-Requested-With":"XMLHttpRequest","Content-Type":t.string?"application/x-www-form-urlencoded":"application/json",authorization:n?`bearer ${n}`:"",...t.headers}}}class ix{constructor(t){this.implementation=t}getRequest(t,n){return this.implementation.getRequest(t,n)}get(t){return this.getRequest("GET",t)}post(t){return this.getRequest("POST",t)}put(t){return this.getRequest("PUT",t)}}class kc extends Sc{constructor(){super(...arguments);q(this,"makeQueryENV",null)}query(n){return async(s,i={})=>{var a;return s.env||(s.env=((a=this.makeQueryENV)==null?void 0:a.call(this))??{error:"failed to run makeQueryENV"}),this.post(n)("/query",s,i)}}httpDataSourceQuery(n){return async(s,i={})=>{var a;return s.env||(s.env=((a=this.makeQueryENV)==null?void 0:a.call(this))??{error:"failed to run makeQueryENV"}),this.getRequest("POST",n)("/query",s,i,!0)}}structure(n){return async(s,i={})=>this.post(n)("/query/structure",s,i)}}class Tc{constructor(t){this.implementation=t}query(t){return this.implementation.query(t)}httpDataSourceQuery(t){return this.implementation.httpDataSourceQuery(t)}structure(t){return this.implementation.structure(t)}getRequest(t,n){return this.implementation.getRequest(t,n)}get(t){return this.getRequest("GET",t)}post(t){return this.getRequest("POST",t)}put(t){return this.getRequest("PUT",t)}}const Un=new kc;function Ei(e){Un.baseURL!==e.apiBaseURL&&(Un.baseURL=e.apiBaseURL),e.app_id&&(Un.app_id=e.app_id),e.app_secret&&(Un.app_secret=e.app_secret),e.makeQueryENV&&(Un.makeQueryENV=e.makeQueryENV)}const Dc=new Tc(Un),Yt=Dc;f.forwardRef(function({value:t,onChange:n,...s},i){return r.jsx(o.TextInput,{ref:i,value:t,onChange:n,...s})});class ax{constructor({valueRange:t,colorRange:n}){q(this,"mapper");this.mapper=xn.interpolate(t,n)}getColor(t){return this.mapper(t)}}function ox(e,t){if(e.type==="static")return e.staticColor;if(e.type==="continuous")try{const n=Number(t);if(Number.isNaN(n))throw new Error(`[getColorByColorConf] Invalid type of aggregated value: ${t}, parsed: ${n}`);return new ax(e).getColor(n)}catch(n){return console.error(n),"black"}return"black"}const lx=ox;function L(e){const[t,n]=e.split(".");return{queryID:t,columnKey:n}}function cx(e){return e.includes(".")?L(e):{queryID:"",columnKey:e}}function Ot(e,t){var i;const{queryID:n,columnKey:s}=L(t);return n?s?((i=e[n])==null?void 0:i.map(a=>a[s]))??[]:e[n]:[]}function cs(e,t){const{queryID:n}=L(t);return n?e[n]:[]}function ux(e){return Object.values(e)[0]}function us(e,t){const{queryID:n,columnKey:s}=L(t);return e[s]}const Ic=["function aggregation({ queryData }, utils) {",' return "Aggregation Result";',"}"].join(`
|
|
55
|
-
`),Yn={type:"none",config:{},fallback:"0"};function dx(e){const t=Array.from(e).sort((s,i)=>s-i),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function px(e,t){switch(t.type){case"sum":return v.sum(e);case"mean":return v.mean(e);case"median":return dx(e);case"max":return v.max(e);case"min":return v.min(e);case"quantile":return vr.quantile(e,t.config.p);case"CV":const n=Qn.std(...e),s=Qn.mean(...e);return s?n/s:Number.NaN;case"std":return Qn.std(...e);default:return e}}function Ai(e,t){const n=e.map(Number),s=px(n,t);return typeof s=="number"?Number.isFinite(s)?s:t.fallback:s??t.fallback}function hx(e,t,n){try{const s=cs(e,t);return new Function(`return ${n.config.func}`)()({queryData:s},Pt)}catch(s){return console.error(s),s.message}}function fx(e,t,n){try{const s=Ot(e,t),{method:i}=n.config;return v[i](s)}catch(s){return console.error(s),n.fallback}}function Pi(e,t,n){try{return n.type==="custom"?hx(e,t,n):n.type==="pick_record"?fx(e,t,n):Ai(Ot(e,t),n)}catch(s){return console.error(s),null}}const Oi={fontSize:"14px",lineHeight:"32px",color:"#3D3E45",ul:{paddingLeft:"2em",margin:"6px 0 0"},p:{margin:"0 !important"},a:{WebkitTapHighlightColor:"transparent",color:"rgb(34, 139, 230)",textDecoration:"none","&:hover":{textDecoration:"underline"},"&:active, &:hover":{outlineWidth:0}},table:{tr:{"th, td":{padding:"0 .5em"}}},"table.rich-text-table-render, div.tableWrapper table":{"th, td":{border:"1px solid #eaeaea"},"tr:last-of-type td":{borderBottom:"1px solid #eaeaea"}},".resize-cursor":{cursor:"col-resize"},details:{summary:{listStyle:"none",cursor:"pointer",transition:"color 300ms ease",userSelect:"none"},"summary::-webkit-details-marker":{display:"none"},"summary:hover":{color:"black","&::before":{opacity:1}},"summary::before":{content:'"►"',fontSize:"10px",margin:"0px 5px",opacity:.5,display:"inline-block",transition:"opacity 300ms ease, transform 300ms ease"}},"details[open] summary::before":{transform:"rotate(90deg)"},"details + details":{marginTop:"10px"},blockquote:{fontSize:"14px",lineHeight:"32px",color:"#3D3E45",margin:"0 0 14px"}};function Mc(e,t,n){for(let s=0;;s++){if(s==e.childCount||s==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(s),a=t.child(s);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let l=0;i.text[l]==a.text[l];l++)n++;return n}if(i.content.size||a.content.size){let l=Mc(i.content,a.content,n+1);if(l!=null)return l}n+=i.nodeSize}}function zc(e,t,n,s){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:s};let l=e.child(--i),c=t.child(--a),u=l.nodeSize;if(l==c){n-=u,s-=u;continue}if(!l.sameMarkup(c))return{a:n,b:s};if(l.isText&&l.text!=c.text){let d=0,p=Math.min(l.text.length,c.text.length);for(;d<p&&l.text[l.text.length-d-1]==c.text[c.text.length-d-1];)d++,n--,s--;return{a:n,b:s}}if(l.content.size||c.content.size){let d=zc(l.content,c.content,n-1,s-1);if(d)return d}n-=u,s-=u}}class he{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let s=0;s<t.length;s++)this.size+=t[s].nodeSize}nodesBetween(t,n,s,i=0,a){for(let l=0,c=0;c<n;l++){let u=this.content[l],d=c+u.nodeSize;if(d>t&&s(u,i+c,a||null,l)!==!1&&u.content.size){let p=c+1;u.nodesBetween(Math.max(0,t-p),Math.min(u.content.size,n-p),s,i+p)}c=d}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,s,i){let a="",l=!0;return this.nodesBetween(t,n,(c,u)=>{c.isText?(a+=c.text.slice(Math.max(t,u)-u,n-u),l=!s):c.isLeaf?(i?a+=typeof i=="function"?i(c):i:c.type.spec.leafText&&(a+=c.type.spec.leafText(c)),l=!s):!l&&c.isBlock&&(a+=s,l=!0)},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,s=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(s)&&(i[i.length-1]=n.withText(n.text+s.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new he(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let s=[],i=0;if(n>t)for(let a=0,l=0;l<n;a++){let c=this.content[a],u=l+c.nodeSize;u>t&&((l<t||u>n)&&(c.isText?c=c.cut(Math.max(0,t-l),Math.min(c.text.length,n-l)):c=c.cut(Math.max(0,t-l-1),Math.min(c.content.size,n-l-1))),s.push(c),i+=c.nodeSize),l=u}return new he(s,i)}cutByIndex(t,n){return t==n?he.empty:t==0&&n==this.content.length?this:new he(this.content.slice(t,n))}replaceChild(t,n){let s=this.content[t];if(s==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-s.nodeSize;return i[t]=n,new he(i,a)}addToStart(t){return new he([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new he(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,s=0;n<this.content.length;n++){let i=this.content[n];t(i,s,n),s+=i.nodeSize}}findDiffStart(t,n=0){return Mc(this,t,n)}findDiffEnd(t,n=this.size,s=t.size){return zc(this,t,n,s)}findIndex(t,n=-1){if(t==0)return ds(0,t);if(t==this.size)return ds(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let s=0,i=0;;s++){let a=this.child(s),l=i+a.nodeSize;if(l>=t)return l==t||n>0?ds(s+1,l):ds(s,i);i=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return he.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new he(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return he.empty;let n,s=0;for(let i=0;i<t.length;i++){let a=t[i];s+=a.nodeSize,i&&a.isText&&t[i-1].sameMarkup(a)?(n||(n=t.slice(0,i)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new he(n||t,s)}static from(t){if(!t)return he.empty;if(t instanceof he)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new he([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}he.empty=new he([],0);const Li={index:0,offset:0};function ds(e,t){return Li.index=e,Li.offset=t,Li}function Bi(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let s=0;s<e.length;s++)if(!Bi(e[s],t[s]))return!1}else{for(let s in e)if(!(s in t)||!Bi(e[s],t[s]))return!1;for(let s in t)if(!(s in e))return!1}return!0}let Kt=class Jl{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,s=!1;for(let i=0;i<t.length;i++){let a=t[i];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,i));else{if(a.type.excludes(this.type))return t;!s&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),s=!0),n&&n.push(a)}}return n||(n=t.slice()),s||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Bi(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let s=t.marks[n.type];if(!s)throw new RangeError(`There is no mark type ${n.type} in this schema`);return s.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let s=0;s<t.length;s++)if(!t[s].eq(n[s]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Jl.none;if(t instanceof Jl)return[t];let n=t.slice();return n.sort((s,i)=>s.type.rank-i.type.rank),n}};Kt.none=[];class gx extends Error{}class ye{constructor(t,n,s){this.content=t,this.openStart=n,this.openEnd=s}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let s=Ac(this.content,t+this.openStart,n);return s&&new ye(s,this.openStart,this.openEnd)}removeBetween(t,n){return new ye(Ec(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ye.empty;let s=n.openStart||0,i=n.openEnd||0;if(typeof s!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ye(he.fromJSON(t,n.content),s,i)}static maxOpen(t,n=!0){let s=0,i=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)s++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new ye(t,s,i)}}ye.empty=new ye(he.empty,0,0);function Ec(e,t,n){let{index:s,offset:i}=e.findIndex(t),a=e.maybeChild(s),{index:l,offset:c}=e.findIndex(n);if(i==t||a.isText){if(c!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(s!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(s,a.copy(Ec(a.content,t-i-1,n-i-1)))}function Ac(e,t,n,s){let{index:i,offset:a}=e.findIndex(t),l=e.maybeChild(i);if(a==t||l.isText)return s&&!s.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=Ac(l.content,t-a-1,n);return c&&e.replaceChild(i,l.copy(c))}let mx=class Zl{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(s=>{s.tag?this.tags.push(s):s.style&&this.styles.push(s)}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=t.nodes[s.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let s=new Bc(this,n,!1);return s.addAll(t,n.from,n.to),s.finish()}parseSlice(t,n={}){let s=new Bc(this,n,!0);return s.addAll(t,n.from,n.to),ye.maxOpen(s.finish())}matchTag(t,n,s){for(let i=s?this.tags.indexOf(s)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(yx(t,a.tag)&&(a.namespace===void 0||t.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let l=a.getAttrs(t);if(l===!1)continue;a.attrs=l||void 0}return a}}}matchStyle(t,n,s,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let l=this.styles[a],c=l.style;if(!(c.indexOf(t)!=0||l.context&&!s.matchesContext(l.context)||c.length>t.length&&(c.charCodeAt(t.length)!=61||c.slice(t.length+1)!=n))){if(l.getAttrs){let u=l.getAttrs(n);if(u===!1)continue;l.attrs=u||void 0}return l}}}static schemaRules(t){let n=[];function s(i){let a=i.priority==null?50:i.priority,l=0;for(;l<n.length;l++){let c=n[l];if((c.priority==null?50:c.priority)<a)break}n.splice(l,0,i)}for(let i in t.marks){let a=t.marks[i].spec.parseDOM;a&&a.forEach(l=>{s(l=Vc(l)),l.mark||l.ignore||l.clearMark||(l.mark=i)})}for(let i in t.nodes){let a=t.nodes[i].spec.parseDOM;a&&a.forEach(l=>{s(l=Vc(l)),l.node||l.ignore||l.mark||(l.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Zl(t,Zl.schemaRules(t)))}};const Pc={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xx={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Oc={ol:!0,ul:!0},ps=1,hs=2,wr=4;function Lc(e,t,n){return t!=null?(t?ps:0)|(t==="full"?hs:0):e&&e.whitespace=="pre"?ps|hs:n&~wr}class fs{constructor(t,n,s,i,a,l,c){this.type=t,this.attrs=n,this.marks=s,this.pendingMarks=i,this.solid=a,this.options=c,this.content=[],this.activeMarks=Kt.none,this.stashMarks=[],this.match=l||(c&wr?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(he.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let s=this.type.contentMatch,i;return(i=s.findWrapping(t.type))?(this.match=s,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&ps)){let s=this.content[this.content.length-1],i;if(s&&s.isText&&(i=/[ \t\r\n\u000c]+$/.exec(s.text))){let a=s;s.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let n=he.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(he.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,s=this.pendingMarks;n<s.length;n++){let i=s[n];(this.type?this.type.allowsMarkType(i.type):_x(i.type,t))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Pc.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Bc{constructor(t,n,s){this.parser=t,this.options=n,this.isOpen=s,this.open=0;let i=n.topNode,a,l=Lc(null,n.preserveWhitespace,0)|(s?wr:0);i?a=new fs(i.type,i.attrs,Kt.none,Kt.none,!0,n.topMatch||i.type.contentMatch,l):s?a=new fs(null,null,Kt.none,Kt.none,!0,null,l):a=new fs(t.schema.topNodeType,null,Kt.none,Kt.none,!0,null,l),this.nodes=[a],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let s=this.readStyles(vx(n));if(!s)return;let[i,a]=s,l=this.top;for(let c=0;c<a.length;c++)this.removePendingMark(a[c],l);for(let c=0;c<i.length;c++)this.addPendingMark(i[c]);this.addElement(t);for(let c=0;c<i.length;c++)this.removePendingMark(i[c],l);for(let c=0;c<a.length;c++)this.addPendingMark(a[c])}}}addTextNode(t){let n=t.nodeValue,s=this.top;if(s.options&hs||s.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(s.options&ps)s.options&hs?n=n.replace(/\r\n?/g,`
|
|
55
|
+
`),Yn={type:"none",config:{},fallback:"0"};function dx(e){const t=Array.from(e).sort((s,i)=>s-i),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function px(e,t){switch(t.type){case"sum":return v.sum(e);case"mean":return v.mean(e);case"median":return dx(e);case"max":return v.max(e);case"min":return v.min(e);case"quantile":return vr.quantile(e,t.config.p);case"CV":if(e.length===0)return Number.NaN;const n=Qn.std(...e),s=Qn.mean(...e);return s?n/s:Number.NaN;case"std":return e.length===0?Number.NaN:Qn.std(...e);default:return e}}function Ai(e,t){const n=e.map(Number),s=px(n,t);return typeof s=="number"?Number.isFinite(s)?s:t.fallback:s??t.fallback}function hx(e,t,n){try{const s=cs(e,t);return new Function(`return ${n.config.func}`)()({queryData:s},Pt)}catch(s){return console.error(s),s.message}}function fx(e,t,n){try{const s=Ot(e,t),{method:i}=n.config;return v[i](s)}catch(s){return console.error(s),n.fallback}}function Pi(e,t,n){try{return n.type==="custom"?hx(e,t,n):n.type==="pick_record"?fx(e,t,n):Ai(Ot(e,t),n)}catch(s){return console.error(s),null}}const Oi={fontSize:"14px",lineHeight:"32px",color:"#3D3E45",ul:{paddingLeft:"2em",margin:"6px 0 0"},p:{margin:"0 !important"},a:{WebkitTapHighlightColor:"transparent",color:"rgb(34, 139, 230)",textDecoration:"none","&:hover":{textDecoration:"underline"},"&:active, &:hover":{outlineWidth:0}},table:{tr:{"th, td":{padding:"0 .5em"}}},"table.rich-text-table-render, div.tableWrapper table":{"th, td":{border:"1px solid #eaeaea"},"tr:last-of-type td":{borderBottom:"1px solid #eaeaea"}},".resize-cursor":{cursor:"col-resize"},details:{summary:{listStyle:"none",cursor:"pointer",transition:"color 300ms ease",userSelect:"none"},"summary::-webkit-details-marker":{display:"none"},"summary:hover":{color:"black","&::before":{opacity:1}},"summary::before":{content:'"►"',fontSize:"10px",margin:"0px 5px",opacity:.5,display:"inline-block",transition:"opacity 300ms ease, transform 300ms ease"}},"details[open] summary::before":{transform:"rotate(90deg)"},"details + details":{marginTop:"10px"},blockquote:{fontSize:"14px",lineHeight:"32px",color:"#3D3E45",margin:"0 0 14px"}};function Mc(e,t,n){for(let s=0;;s++){if(s==e.childCount||s==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(s),a=t.child(s);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let l=0;i.text[l]==a.text[l];l++)n++;return n}if(i.content.size||a.content.size){let l=Mc(i.content,a.content,n+1);if(l!=null)return l}n+=i.nodeSize}}function zc(e,t,n,s){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:s};let l=e.child(--i),c=t.child(--a),u=l.nodeSize;if(l==c){n-=u,s-=u;continue}if(!l.sameMarkup(c))return{a:n,b:s};if(l.isText&&l.text!=c.text){let d=0,p=Math.min(l.text.length,c.text.length);for(;d<p&&l.text[l.text.length-d-1]==c.text[c.text.length-d-1];)d++,n--,s--;return{a:n,b:s}}if(l.content.size||c.content.size){let d=zc(l.content,c.content,n-1,s-1);if(d)return d}n-=u,s-=u}}class he{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let s=0;s<t.length;s++)this.size+=t[s].nodeSize}nodesBetween(t,n,s,i=0,a){for(let l=0,c=0;c<n;l++){let u=this.content[l],d=c+u.nodeSize;if(d>t&&s(u,i+c,a||null,l)!==!1&&u.content.size){let p=c+1;u.nodesBetween(Math.max(0,t-p),Math.min(u.content.size,n-p),s,i+p)}c=d}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,s,i){let a="",l=!0;return this.nodesBetween(t,n,(c,u)=>{c.isText?(a+=c.text.slice(Math.max(t,u)-u,n-u),l=!s):c.isLeaf?(i?a+=typeof i=="function"?i(c):i:c.type.spec.leafText&&(a+=c.type.spec.leafText(c)),l=!s):!l&&c.isBlock&&(a+=s,l=!0)},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,s=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(s)&&(i[i.length-1]=n.withText(n.text+s.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new he(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let s=[],i=0;if(n>t)for(let a=0,l=0;l<n;a++){let c=this.content[a],u=l+c.nodeSize;u>t&&((l<t||u>n)&&(c.isText?c=c.cut(Math.max(0,t-l),Math.min(c.text.length,n-l)):c=c.cut(Math.max(0,t-l-1),Math.min(c.content.size,n-l-1))),s.push(c),i+=c.nodeSize),l=u}return new he(s,i)}cutByIndex(t,n){return t==n?he.empty:t==0&&n==this.content.length?this:new he(this.content.slice(t,n))}replaceChild(t,n){let s=this.content[t];if(s==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-s.nodeSize;return i[t]=n,new he(i,a)}addToStart(t){return new he([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new he(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,s=0;n<this.content.length;n++){let i=this.content[n];t(i,s,n),s+=i.nodeSize}}findDiffStart(t,n=0){return Mc(this,t,n)}findDiffEnd(t,n=this.size,s=t.size){return zc(this,t,n,s)}findIndex(t,n=-1){if(t==0)return ds(0,t);if(t==this.size)return ds(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let s=0,i=0;;s++){let a=this.child(s),l=i+a.nodeSize;if(l>=t)return l==t||n>0?ds(s+1,l):ds(s,i);i=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return he.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new he(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return he.empty;let n,s=0;for(let i=0;i<t.length;i++){let a=t[i];s+=a.nodeSize,i&&a.isText&&t[i-1].sameMarkup(a)?(n||(n=t.slice(0,i)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new he(n||t,s)}static from(t){if(!t)return he.empty;if(t instanceof he)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new he([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}he.empty=new he([],0);const Li={index:0,offset:0};function ds(e,t){return Li.index=e,Li.offset=t,Li}function Bi(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let s=0;s<e.length;s++)if(!Bi(e[s],t[s]))return!1}else{for(let s in e)if(!(s in t)||!Bi(e[s],t[s]))return!1;for(let s in t)if(!(s in e))return!1}return!0}let Kt=class Jl{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,s=!1;for(let i=0;i<t.length;i++){let a=t[i];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,i));else{if(a.type.excludes(this.type))return t;!s&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),s=!0),n&&n.push(a)}}return n||(n=t.slice()),s||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Bi(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let s=t.marks[n.type];if(!s)throw new RangeError(`There is no mark type ${n.type} in this schema`);return s.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let s=0;s<t.length;s++)if(!t[s].eq(n[s]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Jl.none;if(t instanceof Jl)return[t];let n=t.slice();return n.sort((s,i)=>s.type.rank-i.type.rank),n}};Kt.none=[];class gx extends Error{}class ye{constructor(t,n,s){this.content=t,this.openStart=n,this.openEnd=s}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let s=Ac(this.content,t+this.openStart,n);return s&&new ye(s,this.openStart,this.openEnd)}removeBetween(t,n){return new ye(Ec(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ye.empty;let s=n.openStart||0,i=n.openEnd||0;if(typeof s!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ye(he.fromJSON(t,n.content),s,i)}static maxOpen(t,n=!0){let s=0,i=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)s++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new ye(t,s,i)}}ye.empty=new ye(he.empty,0,0);function Ec(e,t,n){let{index:s,offset:i}=e.findIndex(t),a=e.maybeChild(s),{index:l,offset:c}=e.findIndex(n);if(i==t||a.isText){if(c!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(s!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(s,a.copy(Ec(a.content,t-i-1,n-i-1)))}function Ac(e,t,n,s){let{index:i,offset:a}=e.findIndex(t),l=e.maybeChild(i);if(a==t||l.isText)return s&&!s.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=Ac(l.content,t-a-1,n);return c&&e.replaceChild(i,l.copy(c))}let mx=class Zl{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(s=>{s.tag?this.tags.push(s):s.style&&this.styles.push(s)}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=t.nodes[s.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let s=new Bc(this,n,!1);return s.addAll(t,n.from,n.to),s.finish()}parseSlice(t,n={}){let s=new Bc(this,n,!0);return s.addAll(t,n.from,n.to),ye.maxOpen(s.finish())}matchTag(t,n,s){for(let i=s?this.tags.indexOf(s)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(yx(t,a.tag)&&(a.namespace===void 0||t.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let l=a.getAttrs(t);if(l===!1)continue;a.attrs=l||void 0}return a}}}matchStyle(t,n,s,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let l=this.styles[a],c=l.style;if(!(c.indexOf(t)!=0||l.context&&!s.matchesContext(l.context)||c.length>t.length&&(c.charCodeAt(t.length)!=61||c.slice(t.length+1)!=n))){if(l.getAttrs){let u=l.getAttrs(n);if(u===!1)continue;l.attrs=u||void 0}return l}}}static schemaRules(t){let n=[];function s(i){let a=i.priority==null?50:i.priority,l=0;for(;l<n.length;l++){let c=n[l];if((c.priority==null?50:c.priority)<a)break}n.splice(l,0,i)}for(let i in t.marks){let a=t.marks[i].spec.parseDOM;a&&a.forEach(l=>{s(l=Vc(l)),l.mark||l.ignore||l.clearMark||(l.mark=i)})}for(let i in t.nodes){let a=t.nodes[i].spec.parseDOM;a&&a.forEach(l=>{s(l=Vc(l)),l.node||l.ignore||l.mark||(l.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Zl(t,Zl.schemaRules(t)))}};const Pc={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xx={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Oc={ol:!0,ul:!0},ps=1,hs=2,wr=4;function Lc(e,t,n){return t!=null?(t?ps:0)|(t==="full"?hs:0):e&&e.whitespace=="pre"?ps|hs:n&~wr}class fs{constructor(t,n,s,i,a,l,c){this.type=t,this.attrs=n,this.marks=s,this.pendingMarks=i,this.solid=a,this.options=c,this.content=[],this.activeMarks=Kt.none,this.stashMarks=[],this.match=l||(c&wr?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(he.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let s=this.type.contentMatch,i;return(i=s.findWrapping(t.type))?(this.match=s,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&ps)){let s=this.content[this.content.length-1],i;if(s&&s.isText&&(i=/[ \t\r\n\u000c]+$/.exec(s.text))){let a=s;s.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let n=he.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(he.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,s=this.pendingMarks;n<s.length;n++){let i=s[n];(this.type?this.type.allowsMarkType(i.type):_x(i.type,t))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Pc.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Bc{constructor(t,n,s){this.parser=t,this.options=n,this.isOpen=s,this.open=0;let i=n.topNode,a,l=Lc(null,n.preserveWhitespace,0)|(s?wr:0);i?a=new fs(i.type,i.attrs,Kt.none,Kt.none,!0,n.topMatch||i.type.contentMatch,l):s?a=new fs(null,null,Kt.none,Kt.none,!0,null,l):a=new fs(t.schema.topNodeType,null,Kt.none,Kt.none,!0,null,l),this.nodes=[a],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let s=this.readStyles(vx(n));if(!s)return;let[i,a]=s,l=this.top;for(let c=0;c<a.length;c++)this.removePendingMark(a[c],l);for(let c=0;c<i.length;c++)this.addPendingMark(i[c]);this.addElement(t);for(let c=0;c<i.length;c++)this.removePendingMark(i[c],l);for(let c=0;c<a.length;c++)this.addPendingMark(a[c])}}}addTextNode(t){let n=t.nodeValue,s=this.top;if(s.options&hs||s.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(s.options&ps)s.options&hs?n=n.replace(/\r\n?/g,`
|
|
56
56
|
`):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=s.content[s.content.length-1],a=t.previousSibling;(!i||a&&a.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let s=t.nodeName.toLowerCase(),i;Oc.hasOwnProperty(s)&&this.parser.normalizeLists&&bx(t);let a=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(a?a.ignore:xx.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(t=a.skip);let l,c=this.top,u=this.needsBlock;if(Pc.hasOwnProperty(s))c.content.length&&c.content[0].isInline&&this.open&&(this.open--,c=this.top),l=!0,c.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),l&&this.sync(c),this.needsBlock=u}else this.addElementByRule(t,a,a.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
57
57
|
`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=Kt.none,s=Kt.none;for(let i=0;i<t.length;i+=2)for(let a=void 0;;){let l=this.parser.matchStyle(t[i],t[i+1],this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(c=>{l.clearMark(c)&&(s=c.addToSet(s))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}return[n,s]}addElementByRule(t,n,s){let i,a,l;n.node?(a=this.parser.schema.nodes[n.node],a.isLeaf?this.insertNode(a.create(n.attrs))||this.leafFallback(t):i=this.enter(a,n.attrs||null,n.preserveWhitespace)):(l=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(l));let c=this.top;if(a&&a.isLeaf)this.findInside(t);else if(s)this.addElement(t,s);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u)}i&&this.sync(c)&&this.open--,l&&this.removePendingMark(l,c)}addAll(t,n,s){let i=n||0;for(let a=n?t.childNodes[n]:t.firstChild,l=s==null?null:t.childNodes[s];a!=l;a=a.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(a);this.findAtPoint(t,i)}findPlace(t){let n,s;for(let i=this.open;i>=0;i--){let a=this.nodes[i],l=a.findWrapping(t);if(l&&(!n||n.length>l.length)&&(n=l,s=a,!l.length)||a.solid)break}if(!n)return!1;this.sync(s);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let s=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(s=t.marks[i].addToSet(s));return n.content.push(t.mark(s)),!0}return!1}enter(t,n,s){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,s),i}enterInner(t,n=null,s=!1,i){this.closeExtra();let a=this.top;a.applyPending(t),a.match=a.match&&a.match.matchType(t);let l=Lc(t,i,a.options);a.options&wr&&a.content.length==0&&(l|=wr),this.nodes.push(new fs(t,n,a.activeMarks,a.pendingMarks,s,null,l)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let s=this.nodes[n].content;for(let i=s.length-1;i>=0;i--)t+=s[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let s=0;s<this.find.length;s++)this.find[s].node==t&&this.find[s].offset==n&&(this.find[s].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,s){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(s?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),s=this.options.context,i=!this.isOpen&&(!s||s.parent.type==this.nodes[0].type),a=-(s?s.depth+1:0)+(i?0:1),l=(c,u)=>{for(;c>=0;c--){let d=n[c];if(d==""){if(c==n.length-1||c==0)continue;for(;u>=a;u--)if(l(c-1,u))return!0;return!1}else{let p=u>0||u==0&&i?this.nodes[u].type:s&&u>=a?s.node(u-a).type:null;if(!p||p.name!=d&&p.groups.indexOf(d)==-1)return!1;u--}}return!0};return l(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let s=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(s&&s.isTextblock&&s.defaultAttrs)return s}for(let n in this.parser.schema.nodes){let s=this.parser.schema.nodes[n];if(s.isTextblock&&s.defaultAttrs)return s}}addPendingMark(t){let n=jx(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let s=this.open;s>=0;s--){let i=this.nodes[s];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let l=i.popFromStashMark(t);l&&i.type&&i.type.allowsMarkType(l.type)&&(i.activeMarks=l.addToSet(i.activeMarks))}if(i==n)break}}}function bx(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let s=t.nodeType==1?t.nodeName.toLowerCase():null;s&&Oc.hasOwnProperty(s)&&n?(n.appendChild(t),t=n):s=="li"?n=t:s&&(n=null)}}function yx(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function vx(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,s=[];for(;n=t.exec(e);)s.push(n[1],n[2].trim());return s}function Vc(e){let t={};for(let n in e)t[n]=e[n];return t}function _x(e,t){let n=t.schema.nodes;for(let s in n){let i=n[s];if(!i.allowsMarkType(e))continue;let a=[],l=c=>{a.push(c);for(let u=0;u<c.edgeCount;u++){let{type:d,next:p}=c.edge(u);if(d==t||a.indexOf(p)<0&&l(p))return!0}};if(l(i.contentMatch))return!0}}function jx(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}const Nc=65535,qc=Math.pow(2,16);function wx(e,t){return e+t*qc}function $c(e){return e&Nc}function Cx(e){return(e-(e&Nc))/qc}const Fc=1,Gc=2,gs=4,Wc=8;class Rc{constructor(t,n,s){this.pos=t,this.delInfo=n,this.recover=s}get deleted(){return(this.delInfo&Wc)>0}get deletedBefore(){return(this.delInfo&(Fc|gs))>0}get deletedAfter(){return(this.delInfo&(Gc|gs))>0}get deletedAcross(){return(this.delInfo&gs)>0}}class wt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&wt.empty)return wt.empty}recover(t){let n=0,s=$c(t);if(!this.inverted)for(let i=0;i<s;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[s*3]+n+Cx(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,s){let i=0,a=this.inverted?2:1,l=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let u=this.ranges[c]-(this.inverted?i:0);if(u>t)break;let d=this.ranges[c+a],p=this.ranges[c+l],h=u+d;if(t<=h){let g=d?t==u?-1:t==h?1:n:n,b=u+i+(g<0?0:p);if(s)return b;let x=t==(n<0?u:h)?null:wx(c/3,t-u),_=t==u?Gc:t==h?Fc:gs;return(n<0?t!=u:t!=h)&&(_|=Wc),new Rc(b,_,x)}i+=p-d}return s?t+i:new Rc(t+i,0,null)}touches(t,n){let s=0,i=$c(n),a=this.inverted?2:1,l=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let u=this.ranges[c]-(this.inverted?s:0);if(u>t)break;let d=this.ranges[c+a],p=u+d;if(t<=p&&c==i*3)return!0;s+=this.ranges[c+l]-d}return!1}forEach(t){let n=this.inverted?2:1,s=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let l=this.ranges[i],c=l-(this.inverted?a:0),u=l+(this.inverted?0:a),d=this.ranges[i+n],p=this.ranges[i+s];t(c,c+d,u,u+p),a+=p-d}}invert(){return new wt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?wt.empty:new wt(t<0?[0,-t,0]:[0,0,t])}}wt.empty=new wt([]);const Vi=Object.create(null);class it{getMap(){return wt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let s=Vi[n.stepType];if(!s)throw new RangeError(`No step type ${n.stepType} defined`);return s.fromJSON(t,n)}static jsonID(t,n){if(t in Vi)throw new RangeError("Duplicate use of step JSON ID "+t);return Vi[t]=n,n.prototype.jsonID=t,n}}class Le{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Le(t,null)}static fail(t){return new Le(null,t)}static fromReplace(t,n,s,i){try{return Le.ok(t.replace(n,s,i))}catch(a){if(a instanceof gx)return Le.fail(a.message);throw a}}}function Ni(e,t,n){let s=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ni(a.content,t,a))),a.isInline&&(a=t(a,n,i)),s.push(a)}return he.fromArray(s)}class On extends it{constructor(t,n,s){super(),this.from=t,this.to=n,this.mark=s}apply(t){let n=t.slice(this.from,this.to),s=t.resolve(this.from),i=s.node(s.sharedDepth(this.to)),a=new ye(Ni(n.content,(l,c)=>!l.isAtom||!c.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),i),n.openStart,n.openEnd);return Le.fromReplace(t,this.from,this.to,a)}invert(){return new Ln(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),s=t.mapResult(this.to,-1);return n.deleted&&s.deleted||n.pos>=s.pos?null:new On(n.pos,s.pos,this.mark)}merge(t){return t instanceof On&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new On(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new On(n.from,n.to,t.markFromJSON(n.mark))}}it.jsonID("addMark",On);class Ln extends it{constructor(t,n,s){super(),this.from=t,this.to=n,this.mark=s}apply(t){let n=t.slice(this.from,this.to),s=new ye(Ni(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Le.fromReplace(t,this.from,this.to,s)}invert(){return new On(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),s=t.mapResult(this.to,-1);return n.deleted&&s.deleted||n.pos>=s.pos?null:new Ln(n.pos,s.pos,this.mark)}merge(t){return t instanceof Ln&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ln(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ln(n.from,n.to,t.markFromJSON(n.mark))}}it.jsonID("removeMark",Ln);class Bn extends it{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Le.fail("No node at mark step's position");let s=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Le.fromReplace(t,this.pos,this.pos+1,new ye(he.from(s),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let s=this.mark.addToSet(n.marks);if(s.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(s))return new Bn(this.pos,n.marks[i]);return new Bn(this.pos,this.mark)}}return new Cr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Bn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Bn(n.pos,t.markFromJSON(n.mark))}}it.jsonID("addNodeMark",Bn);class Cr extends it{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Le.fail("No node at mark step's position");let s=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Le.fromReplace(t,this.pos,this.pos+1,new ye(he.from(s),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Bn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Cr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Cr(n.pos,t.markFromJSON(n.mark))}}it.jsonID("removeNodeMark",Cr);class Xt extends it{constructor(t,n,s,i=!1){super(),this.from=t,this.to=n,this.slice=s,this.structure=i}apply(t){return this.structure&&qi(t,this.from,this.to)?Le.fail("Structure replace would overwrite content"):Le.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new wt([this.from,this.to-this.from,this.slice.size])}invert(t){return new Xt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),s=t.mapResult(this.to,-1);return n.deletedAcross&&s.deletedAcross?null:new Xt(n.pos,Math.max(n.pos,s.pos),this.slice)}merge(t){if(!(t instanceof Xt)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ye.empty:new ye(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Xt(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ye.empty:new ye(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Xt(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Xt(n.from,n.to,ye.fromJSON(t,n.slice),!!n.structure)}}it.jsonID("replace",Xt);class Vn extends it{constructor(t,n,s,i,a,l,c=!1){super(),this.from=t,this.to=n,this.gapFrom=s,this.gapTo=i,this.slice=a,this.insert=l,this.structure=c}apply(t){if(this.structure&&(qi(t,this.from,this.gapFrom)||qi(t,this.gapTo,this.to)))return Le.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Le.fail("Gap is not a flat range");let s=this.slice.insertAt(this.insert,n.content);return s?Le.fromReplace(t,this.from,this.to,s):Le.fail("Content does not fit in gap")}getMap(){return new wt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Vn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),s=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),a=t.map(this.gapTo,1);return n.deletedAcross&&s.deletedAcross||i<n.pos||a>s.pos?null:new Vn(n.pos,s.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Vn(n.from,n.to,n.gapFrom,n.gapTo,ye.fromJSON(t,n.slice),n.insert,!!n.structure)}}it.jsonID("replaceAround",Vn);function qi(e,t,n){let s=e.resolve(t),i=n-t,a=s.depth;for(;i>0&&a>0&&s.indexAfter(a)==s.node(a).childCount;)a--,i--;if(i>0){let l=s.node(a).maybeChild(s.indexAfter(a));for(;i>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,i--}}return!1}function Sx(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function kx(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let s=e.depth;;--s){let i=e.$from.node(s),a=e.$from.index(s),l=e.$to.indexAfter(s);if(s<e.depth&&i.canReplace(a,l,n))return s;if(s==0||i.type.spec.isolating||!Sx(i,a,l))break}return null}function ms(e,t,n=1,s){let i=e.resolve(t),a=i.depth-n,l=s&&s[s.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!l.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,p=n-2;d>a;d--,p--){let h=i.node(d),g=i.index(d);if(h.type.spec.isolating)return!1;let b=h.content.cutByIndex(g,h.childCount),x=s&&s[p+1];x&&(b=b.replaceChild(0,x.type.create(x.attrs)));let _=s&&s[p]||h;if(!h.canReplace(g+1,h.childCount)||!_.type.validContent(b))return!1}let c=i.indexAfter(a),u=s&&s[0];return i.node(a).canReplaceWith(c,c,u?u.type:i.node(a+1).type)}function Qc(e,t){let n=e.resolve(t),s=n.index();return Tx(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(s,s+1)}function Tx(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}class Sr extends it{constructor(t,n,s){super(),this.pos=t,this.attr=n,this.value=s}apply(t){let n=t.nodeAt(this.pos);if(!n)return Le.fail("No node at attribute step's position");let s=Object.create(null);for(let a in n.attrs)s[a]=n.attrs[a];s[this.attr]=this.value;let i=n.type.create(s,null,n.marks);return Le.fromReplace(t,this.pos,this.pos+1,new ye(he.from(i),0,n.isLeaf?0:1))}getMap(){return wt.empty}invert(t){return new Sr(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Sr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Sr(n.pos,n.attr,n.value)}}it.jsonID("attr",Sr);let kr=class extends Error{};kr=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},kr.prototype=Object.create(Error.prototype),kr.prototype.constructor=kr,kr.prototype.name="TransformError";const $i=Object.create(null);class ke{constructor(t,n,s){this.$anchor=t,this.$head=n,this.ranges=s||[new Dx(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ye.empty){let s=n.content.lastChild,i=null;for(let c=0;c<n.openEnd;c++)i=s,s=s.lastChild;let a=t.steps.length,l=this.ranges;for(let c=0;c<l.length;c++){let{$from:u,$to:d}=l[c],p=t.mapping.slice(a);t.replaceRange(p.map(u.pos),p.map(d.pos),c?ye.empty:n),c==0&&Kc(t,a,(s?s.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let s=t.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:c}=i[a],u=t.mapping.slice(s),d=u.map(l.pos),p=u.map(c.pos);a?t.deleteRange(d,p):(t.replaceRangeWith(d,p,n),Kc(t,s,n.isInline?-1:1))}}static findFrom(t,n,s=!1){let i=t.parent.inlineContent?new Be(t):Kn(t.node(0),t.parent,t.pos,t.index(),n,s);if(i)return i;for(let a=t.depth-1;a>=0;a--){let l=n<0?Kn(t.node(0),t.node(a),t.before(a+1),t.index(a),n,s):Kn(t.node(0),t.node(a),t.after(a+1),t.index(a)+1,n,s);if(l)return l}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new on(t.node(0))}static atStart(t){return Kn(t,t,0,0,1)||new on(t)}static atEnd(t){return Kn(t,t,t.content.size,t.childCount,-1)||new on(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let s=$i[n.type];if(!s)throw new RangeError(`No selection type ${n.type} defined`);return s.fromJSON(t,n)}static jsonID(t,n){if(t in $i)throw new RangeError("Duplicate use of selection JSON ID "+t);return $i[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Be.between(this.$anchor,this.$head).getBookmark()}}ke.prototype.visible=!0;class Dx{constructor(t,n){this.$from=t,this.$to=n}}let Uc=!1;function Yc(e){!Uc&&!e.parent.inlineContent&&(Uc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Be extends ke{constructor(t,n=t){Yc(t),Yc(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let s=t.resolve(n.map(this.head));if(!s.parent.inlineContent)return ke.near(s);let i=t.resolve(n.map(this.anchor));return new Be(i.parent.inlineContent?i:s,s)}replace(t,n=ye.empty){if(super.replace(t,n),n==ye.empty){let s=this.$from.marksAcross(this.$to);s&&t.ensureMarks(s)}}eq(t){return t instanceof Be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new xs(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Be(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,s=n){let i=t.resolve(n);return new this(i,s==n?i:t.resolve(s))}static between(t,n,s){let i=t.pos-n.pos;if((!s||i)&&(s=i>=0?1:-1),!n.parent.inlineContent){let a=ke.findFrom(n,s,!0)||ke.findFrom(n,-s,!0);if(a)n=a.$head;else return ke.near(n,s)}return t.parent.inlineContent||(i==0?t=n:(t=(ke.findFrom(t,-s,!0)||ke.findFrom(t,s,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Be(t,n)}}ke.jsonID("text",Be);class xs{constructor(t,n){this.anchor=t,this.head=n}map(t){return new xs(t.map(this.anchor),t.map(this.head))}resolve(t){return Be.between(t.resolve(this.anchor),t.resolve(this.head))}}class mt extends ke{constructor(t){let n=t.nodeAfter,s=t.node(0).resolve(t.pos+n.nodeSize);super(t,s),this.node=n}map(t,n){let{deleted:s,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return s?ke.near(a):new mt(a)}content(){return new ye(he.from(this.node),0,0)}eq(t){return t instanceof mt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Fi(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new mt(t.resolve(n.anchor))}static create(t,n){return new mt(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}mt.prototype.visible=!1,ke.jsonID("node",mt);class Fi{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:s}=t.mapResult(this.anchor);return n?new xs(s,s):new Fi(s)}resolve(t){let n=t.resolve(this.anchor),s=n.nodeAfter;return s&&mt.isSelectable(s)?new mt(n):ke.near(n)}}class on extends ke{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ye.empty){if(n==ye.empty){t.delete(0,t.doc.content.size);let s=ke.atStart(t.doc);s.eq(t.selection)||t.setSelection(s)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new on(t)}map(t){return new on(t)}eq(t){return t instanceof on}getBookmark(){return Ix}}ke.jsonID("all",on);const Ix={map(){return this},resolve(e){return new on(e)}};function Kn(e,t,n,s,i,a=!1){if(t.inlineContent)return Be.create(e,n);for(let l=s-(i>0?0:1);i>0?l<t.childCount:l>=0;l+=i){let c=t.child(l);if(c.isAtom){if(!a&&mt.isSelectable(c))return mt.create(e,n-(i<0?c.nodeSize:0))}else{let u=Kn(e,c,n+i,i<0?c.childCount:0,i,a);if(u)return u}n+=c.nodeSize*i}return null}function Kc(e,t,n){let s=e.steps.length-1;if(s<t)return;let i=e.steps[s];if(!(i instanceof Xt||i instanceof Vn))return;let a=e.mapping.maps[s],l;a.forEach((c,u,d,p)=>{l==null&&(l=p)}),e.setSelection(ke.near(e.doc.resolve(l),n))}function Xc(e,t){return!t||!e?e:e.bind(t)}class bs{constructor(t,n,s){this.name=t,this.init=Xc(n.init,s),this.apply=Xc(n.apply,s)}}new bs("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new bs("selection",{init(e,t){return e.selection||ke.atStart(t.doc)},apply(e){return e.selection}}),new bs("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,s){return s.selection.$cursor?e.storedMarks:null}}),new bs("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function Jc(e,t,n){for(let s in e){let i=e[s];i instanceof Function?i=i.bind(t):s=="handleDOMEvents"&&(i=Jc(i,t,{})),n[s]=i}return n}let Tr=class{constructor(t){this.spec=t,this.props={},t.props&&Jc(t.props,this,this.props),this.key=t.key?t.key.key:Zc("plugin")}getState(t){return t[this.key]}};const Gi=Object.create(null);function Zc(e){return e in Gi?e+"$"+ ++Gi[e]:(Gi[e]=0,e+"$")}class Dr{constructor(t="key"){this.key=Zc(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function Hc(e){const{state:t,transaction:n}=e;let{selection:s}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return s},get doc(){return i},get tr(){return s=n.selection,i=n.doc,a=n.storedMarks,n}}}class Mx{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:s}=this,{view:i}=n,{tr:a}=s,l=this.buildProps(a);return Object.fromEntries(Object.entries(t).map(([c,u])=>[c,(...p)=>{const h=u(...p)(l);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:s,editor:i,state:a}=this,{view:l}=i,c=[],u=!!t,d=t||a.tr,p=()=>(!u&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(d),c.every(g=>g===!0)),h={...Object.fromEntries(Object.entries(s).map(([g,b])=>[g,(..._)=>{const T=this.buildProps(d,n),C=b(..._)(T);return c.push(C),h}])),run:p};return h}createCan(t){const{rawCommands:n,state:s}=this,i=!1,a=t||s.tr,l=this.buildProps(a,i);return{...Object.fromEntries(Object.entries(n).map(([u,d])=>[u,(...p)=>d(...p)({...l,dispatch:void 0})])),chain:()=>this.createChain(a,i)}}buildProps(t,n=!0){const{rawCommands:s,editor:i,state:a}=this,{view:l}=i;a.storedMarks&&t.setStoredMarks(a.storedMarks);const c={tr:t,editor:i,view:l,state:Hc({state:a,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(s).map(([u,d])=>[u,(...p)=>d(...p)(c)]))}};return c}}function xt(e,t,n){return e.config[t]===void 0&&e.parent?xt(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?xt(e.parent,t,n):null}):e.config[t]}function zx(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),s=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:s}}function Ke(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Ex(e){return typeof e=="function"}function Lt(e,t=void 0,...n){return Ex(e)?t?e.bind(t)(...n):e(...n):e}function Ax(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Px(e){return Object.prototype.toString.call(e).slice(8,-1)}function Wi(e){return Px(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Ri(e,t){const n={...e};return Wi(e)&&Wi(t)&&Object.keys(t).forEach(s=>{Wi(t[s])?s in e?n[s]=Ri(e[s],t[s]):Object.assign(n,{[s]:t[s]}):Object.assign(n,{[s]:t[s]})}),n}class Jt{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Lt(xt(this,"addOptions",{name:this.name}))),this.storage=Lt(xt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Jt(t)}configure(t={}){const n=this.extend();return n.options=Ri(this.options,t),n.storage=Lt(xt(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Jt(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Lt(xt(n,"addOptions",{name:n.name})),n.storage=Lt(xt(n,"addStorage",{name:n.name,options:n.options})),n}}function Ox(e,t,n){const{from:s,to:i}=t,{blockSeparator:a=`
|
|
58
58
|
|
|
@@ -88,7 +88,7 @@ Check the top-level render call using <`+N+">.")}return A}}function Zg(S,A){{if(
|
|
|
88
88
|
${Object.entries(t).map(([s,i])=>`const ${s} = '${i}';`).join(`
|
|
89
89
|
`)}
|
|
90
90
|
return ${e};
|
|
91
|
-
`)(n)}catch(s){return console.error(s),console.log(e),e}}function Ys(e,t,n,s){const i=B_(t,s);return e.replaceAll(/(\{\{([^{\}]+(?=}))\}\})/g,(...l)=>{const c=l[2];if(!c)return c;const u=i[c];if(u)return u;const d=V_(c);return N_(d,i,n)})}function q_(e,t){const n=xc.decode(t);n!==e&&(console.error("Inconsistent sql"),console.groupCollapsed("Inconsistent sql"),console.table({before:e,after:t,v:n}),console.groupEnd())}async function $_({query:e,name:t,payload:n,additionals:s},i){if(!e.sql)return[];const{type:a,key:l,sql:c,pre_process:u,post_process:d}=e,p=Mi(c,n),h=tx({sql:p,pre_process:u}),g=xc.encode(h);q_(h,g);let b=await Yt.query(i)({type:a,key:l,query:g,...s},{params:{name:t}});return b=nx(d,b,fo(n)),b}async function F_({type:e,key:t,configString:n,name:s,additionals:i},a){try{return await Yt.httpDataSourceQuery(a)({type:e,key:t,query:n,...i},{params:{name:s}})}catch(l){if(Rt.isCancel(l))throw l;return console.error(l),l}}async function go(){try{return(await Yt.post()("/datasource/list",{filter:{},sort:[{field:"create_time",order:"ASC"}],pagination:{page:1,pagesize:100}},{})).data}catch(e){return console.error(e),[]}}async function Fp(){try{return(await Yt.post()("/sql_snippet/list",{filter:{},sort:[{field:"id",order:"ASC"}],pagination:{page:1,pagesize:1e3}},{})).data}catch(e){return console.error(e),[]}}class Gp{constructor(t){q(this,"rootRef");this.rootRef=re.observable({current:t})}async deleteItem(t){re.runInAction(()=>{v.unset(this.rootRef.current,[t])})}getItem(t){const n=this.getValueFromRoot(t);return Promise.resolve(n)}getValueFromRoot(t){return t===null?re.toJS(this.rootRef.current):v.get(this.rootRef.current,[t])}setItem(t,n){if(t===null)if(v.isObject(n))re.runInAction(()=>{this.rootRef.current=n});else throw new Error("Cannot set root value to non-object");else re.runInAction(()=>{v.set(this.rootRef.current,[t],n)});return Promise.resolve(this.getItem(t))}watchItem(t,n,s){return re.reaction(()=>this.getValueFromRoot(t),(i,a)=>{n(i,a)},{requiresObservable:!0,fireImmediately:v.get(s,"fireImmediately",!1)})}}class G_{constructor(){q(this,"channels",new Map);q(this,"globalChannel",new bc)}getChannel(t){const n=this.channels.get(t);if(n)return n;const s=new bc;return this.channels.set(t,s),s}}class W_{constructor(t){q(this,"instances",new Map);this.pluginManager=t}get availableVizList(){return this.pluginManager.installedPlugins.flatMap(t=>t.manifest.viz)}resolveComponent(t){return this.pluginManager.factory.viz(t)}getOrCreateInstance(t){const n=this.instances.get(t.id);if(n)return n;const s={id:t.id,name:t.viz.type,type:t.viz.type,messageChannels:new G_,instanceData:new Gp(t.viz.conf)};return this.instances.set(t.id,s),s}}function Wp(e,t,n,s){return{vizManager:n,locale:"zh",msgChannels:e.messageChannels,instanceData:e.instanceData,pluginData:new Gp({}),colorPalette:{getColor(){return()=>""}},data:t,variables:s}}const R_=e=>{const{panel:t,measure:n,vizManager:s,data:i,variables:a}=e,l=s.resolveComponent(t.viz.type),c=s.getOrCreateInstance(t),u={...Wp(c,i,s,a),viewport:{width:n.w,height:n.h}},d=l.viewRender;return r.jsx(d,{context:u,instance:c,...v.omit(e,["panel","vizManager","data"])})},Q_=e=>{const{vizManager:t,panel:n,data:s,variables:i}=e,a=t.resolveComponent(n.viz.type),l=t.getOrCreateInstance(n),c={...Wp(l,s,t,i)},u=a.configRender;return r.jsx(u,{context:c,instance:l,...v.omit(e,["panel","vizManager","data"])})},Rp=(e,t)=>{const n=Et.bezier(e),s=Et.bezier(t);return function(i){return i<50?n(i*2/100).hex():s((i-50)*2/100).hex()}},Ks=e=>{const t=Et.bezier(e);return function(n){return t(n/100).hex()}},U_={type:"interpolation",displayName:"style.color.interpolation.palette.red_green",getColor:Rp(["darkred","deeppink","lightyellow"],["lightyellow","lightgreen","teal"]),name:"red-green",category:"diverging"},Y_={type:"interpolation",displayName:"style.color.interpolation.palette.yellow_blue",getColor:Rp(["#8f531d","#ffd347","#e3efe3"],["#eefaee","#4ecbbf","#003f94"]),name:"yellow-blue",category:"diverging"},K_={type:"interpolation",displayName:"style.color.interpolation.palette.red",getColor:Ks(["#fff7f1","darkred"]),name:"red",category:"sequential"},X_={type:"interpolation",displayName:"style.color.interpolation.palette.green",getColor:Ks(["#f0ffed","darkgreen"]),name:"green",category:"sequential"},J_={type:"interpolation",displayName:"style.color.interpolation.palette.blue",getColor:Ks(["#f9fcff","#48b3e9","darkblue"]),name:"blue",category:"sequential"},Z_={type:"interpolation",displayName:"style.color.interpolation.palette.orange",getColor:Ks(["#fff7f1","darkorange","#b60000"]),name:"orange",category:"sequential"};class H_{constructor(t){q(this,"symbol");this.symbol=Symbol(t)}}function pn(e){return new H_(e)}class mo{constructor(){q(this,"parent");q(this,"factoryRegistry",new Map);q(this,"instanceRegistry",new Map)}createScoped(){const t=new mo;return t.parent=this,t}getRequired(t){return this.get(t)}get(t){if(this.instanceRegistry.has(t.symbol))return this.instanceRegistry.get(t.symbol);const n=this.factoryRegistry.get(t.symbol);if(n){const s=n(this);return this.instanceRegistry.set(t.symbol,s),s}if(this.parent)return this.parent.get(t)}provideFactory(t,n){return this.factoryRegistry.has(t.symbol)?console.warn(`Token ${t.symbol.toString()} is already registered`):this.factoryRegistry.set(t.symbol,n),this}provideValue(t,n){return this.factoryRegistry.has(t.symbol)?console.warn(`Token ${t.symbol.toString()} is already registered`):this.factoryRegistry.set(t.symbol,()=>n),this}dispose(){this.instanceRegistry.forEach(t=>{const n=v.get(t,"dispose");v.isFunction(n)&&n.bind(t)()}),this.instanceRegistry.clear(),this.factoryRegistry.clear()}}const Qp="13.40.0",ej=Object.freeze(Object.defineProperty({__proto__:null,version:Qp},Symbol.toStringTag,{value:"Module"}));class tj{constructor(t){q(this,"staticColors",new Map);q(this,"interpolations",new Map);t.installedPlugins.forEach(n=>{n.manifest.color.forEach(s=>{this.register(s)})})}getStaticColors(){return Array.from(this.staticColors.values())}register(t){const n=this.encodeColor(t);t.type==="single"?(this.staticColors.has(n)&&console.warn(`the color '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`),this.staticColors.set(n,t)):t.type==="interpolation"&&(this.interpolations.has(n)&&console.warn(`the interpolation '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`,`the interpolation '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`),this.interpolations.set(n,t))}decodeStaticColor(t){return this.staticColors.get(t)}encodeColor(t){return`\${${t.category}}.{${t.name}}`}decodeInterpolation(t){return this.interpolations.get(t)}getColorInterpolations(){return Array.from(this.interpolations.values())}}class nj{constructor(){q(this,"plugins",new Map);q(this,"vizComponents",new Map);q(this,"factory",{viz:t=>{const n=this.vizComponents.get(t);if(n)return n;throw new Error(`Viz Component (${t}) not found`)}})}install(t){if(this.plugins.has(t.id))throw new Error(`Plugin (${t.id}) has been installed before`);this.plugins.set(t.id,t);for(const n of t.manifest.viz){if(this.vizComponents.has(n.name))throw new Error(`Viz Component (${n.name}) has been installed before`);this.vizComponents.set(n.name,n)}}get installedPlugins(){return Array.from(this.plugins.values())}}class rj{constructor(){q(this,"migrations",[])}version(t,n){return this.migrations.push({version:t,handler:n}),this}run(t,n,s){var l;if(t.from===t.to)return n;if(t.from>t.to)throw new Error(`Can not downgrade from version '${t.from}' to (${t.to})`);const i=this.migrations.filter(c=>c.version>t.from&&c.version<=t.to),a=v.orderBy(i,"version","asc");if(((l=v.last(a))==null?void 0:l.version)!==t.to)throw new Error(`Migration to version ${t.to} not found`);return a.reduce((c,u)=>u.handler(c,s),n)}}class De extends rj{constructor(){super(),this.configVersions()}version(t,n){return super.version(t,(s,i)=>({version:t,...n(s,i)}))}async migrate({configData:t,panelModel:n}){const s=await t.getItem(null),i=v.get(s,"version",0),a=this.run({from:i,to:this.VERSION},s,{panelModel:n});await t.setItem(null,a)}async needMigration({configData:t}){const n=await t.getItem(null);return v.get(n,"version",0)<this.VERSION}}const Q=(e,t)=>{const[n,{setFalse:s}]=X.useBoolean(!0),[i,a]=f.useState();f.useEffect(()=>(e.getItem(t).then(c=>{a(c),s()}),e.watchItem(t,c=>{a(c)})));const l=f.useCallback(async c=>{await e.setItem(t,c),a(c)},[e,t]);return{loading:n,value:i,set:l}},ut={top:16,right:16,bottom:16,left:16},Vt=e=>Math.max(0,e-ut.left-ut.right),Nt=e=>Math.max(0,e-ut.top-ut.bottom),Zr=(e,t)=>({width:Vt(e),height:Nt(t)}),dt=({width:e,height:t,children:n})=>r.jsx(o.Box,{pt:ut.top,pr:ut.right,pb:ut.bottom,pl:ut.left,sx:{width:e,height:t,overflow:"hidden",position:"relative"},children:n}),xo={x_axis_data_key:"",y_axis_data_key:"",z_axis_data_key:"",xAxis3D:{type:"value",name:"X Axis Name"},yAxis3D:{type:"value",name:"Y Axis Name"},zAxis3D:{type:"value",name:"Z Axis Name"}};function sj({context:e}){const{value:t}=Q(e.instanceData,"config"),n=e.data,{width:s,height:i}=e.viewport,{x_axis_data_key:a,y_axis_data_key:l,z_axis_data_key:c,xAxis3D:u,yAxis3D:d,zAxis3D:p}=v.defaults({},t,xo),h=f.useMemo(()=>cs(n,a),[n,a]),{x:g,y:b,z:x}=f.useMemo(()=>({x:L(a),y:L(l),z:L(c)}),[a,l,c]),{min:_,max:T}=f.useMemo(()=>{const D=v.minBy(h,M=>M[x.columnKey]),z=v.maxBy(h,M=>M[x.columnKey]);return{min:v.get(D,x.columnKey),max:v.get(z,x.columnKey)}},[h,x]),C={tooltip:{},backgroundColor:"#fff",visualMap:{show:!0,dimension:2,min:_,max:T,inRange:{color:["#313695","#4575b4","#74add1","#abd9e9","#e0f3f8","#ffffbf","#fee090","#fdae61","#f46d43","#d73027","#a50026"]}},xAxis3D:u,yAxis3D:d,zAxis3D:p,grid3D:{viewControl:{projection:"orthographic",autoRotate:!1},light:{main:{shadow:!0,quality:"ultra",intensity:1.5}}},series:[{type:"bar3D",wireframe:{},data:h.map(D=>[D[g.columnKey],D[b.columnKey],D[x.columnKey]])}]};return t?r.jsx(dt,{width:s,height:i,children:r.jsx(Ye,{echarts:Ue,option:C,style:Zr(s,i),notMerge:!0,theme:"merico-light"})}):null}const U=I.observer(f.forwardRef(({label:e,required:t,description:n,value:s,onChange:i,queryID:a,clearable:l=!1,sx:c,...u},d)=>{const{panel:p}=nt(),h=f.useMemo(()=>p.dataFieldOptions(s,l,a),[s,l,a]);if(h.length===0){const g=p.explainDataKey(s);return r.jsxs(o.HoverCard,{shadow:"md",position:"bottom-start",withinPortal:!0,zIndex:320,children:[r.jsx(o.HoverCard.Target,{children:r.jsx(o.Box,{children:r.jsx(o.TextInput,{label:e,required:t,defaultValue:g.columnKey,readOnly:!0,disabled:!0})})}),r.jsx(o.HoverCard.Dropdown,{children:r.jsxs(o.Group,{position:"left",spacing:0,children:[r.jsx(o.Text,{size:"xs",color:g.queryName?"black":"red",sx:{fontFamily:"monospace"},children:g.queryName??g.queryID}),r.jsx(o.Text,{size:"xs",color:"black",sx:{fontFamily:"monospace"},children:"."}),r.jsx(o.Text,{size:"xs",color:"red",sx:{fontFamily:"monospace"},children:g.columnKey})]})})]})}return r.jsx(o.Select,{ref:d,label:e,description:n,data:h,value:s,onChange:i,required:t,sx:c,maxDropdownHeight:500,...u})}));function ij({context:e}){const{value:t,set:n}=Q(e.instanceData,"config"),s=v.defaults({},t,xo),{control:i,handleSubmit:a,reset:l}=y.useForm({defaultValues:s});return f.useEffect(()=>{l(s)},[t]),t?r.jsx(o.Stack,{spacing:"xs",children:r.jsxs("form",{onSubmit:a(n),children:[r.jsx(o.Text,{children:"X Axis"}),r.jsxs(o.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[r.jsx(y.Controller,{name:"x_axis_data_key",control:i,render:({field:c})=>r.jsx(U,{label:"Data Field",required:!0,...c})}),r.jsx(y.Controller,{name:"xAxis3D.name",control:i,render:({field:c})=>r.jsx(o.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...c})})]}),r.jsx(o.Text,{mt:"lg",children:"Y Axis"}),r.jsxs(o.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[r.jsx(y.Controller,{name:"y_axis_data_key",control:i,render:({field:c})=>r.jsx(U,{label:"Data Field",required:!0,...c})}),r.jsx(y.Controller,{name:"yAxis3D.name",control:i,render:({field:c})=>r.jsx(o.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...c})})]}),r.jsx(o.Text,{mt:"lg",children:"Z Axis"}),r.jsxs(o.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[r.jsx(y.Controller,{name:"z_axis_data_key",control:i,render:({field:c})=>r.jsx(U,{label:"Data Field",required:!0,...c})}),r.jsx(y.Controller,{name:"zAxis3D.name",control:i,render:({field:c})=>r.jsx(o.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...c})})]}),r.jsx(o.Group,{position:"center",mt:"xl",grow:!0,sx:{width:"60%"},mx:"auto",children:r.jsxs(o.Button,{color:"blue",type:"submit",children:[r.jsx(k.IconDeviceFloppy,{size:20}),r.jsx(o.Text,{ml:"md",children:"Save"})]})})]})}):null}const aj=[{lang:"en",resources:{bar_chart_3d:{viz_name:"Bar Chart(3D)"}}},{lang:"zh",resources:{bar_chart_3d:{viz_name:"柱图(3D)"}}}];function oj(e,{panelModel:t}){try{const n=t.queryIDs[0];if(!n)throw new Error("cannot migrate when queryID is empty");const s=u=>u&&`${n}.${u}`,{x_axis_data_key:i,y_axis_data_key:a,z_axis_data_key:l,...c}=e;return{...c,x_axis_data_key:s(i),y_axis_data_key:s(a),z_axis_data_key:s(l)}}catch(n){throw console.error("[Migration failed]",n),n}}class lj extends De{constructor(){super(...arguments);q(this,"VERSION",2)}configVersions(){this.version(1,n=>({version:1,config:n})),this.version(2,(n,s)=>{const{config:i}=n;return{...n,version:2,config:oj(i,s)}})}}const cj={displayName:"viz.bar_chart_3d.viz_name",displayGroup:"chart.groups.echarts_based_charts",migrator:new lj,name:"bar-3d",viewRender:sj,configRender:ij,createConfig(){return{version:2,config:v.cloneDeep(xo)}},translation:aj},uj=({disabled:e,value:t,onChange:n})=>{const s=i=>{i&&n(i)};return r.jsxs(o.Box,{sx:{position:"relative"},children:[e&&r.jsx(o.Overlay,{opacity:.6,color:"#fff",zIndex:5,blur:2}),r.jsx(gt,{height:"500px",defaultLanguage:"javascript",value:t,onChange:s,theme:"vs-dark",options:{minimap:{enabled:!1},readOnly:e}})]})};function pt({enabled:e,func_content:t}){return(n,s)=>{if(!e)return n;try{return new Function(`return ${t}`)()(n,s)}catch(i){return console.error(`[getEchartsXAxisLabel] failed parsing custom function, error: ${i.message}`),n}}}function et(){return{enabled:!1,func_content:["function label(value, index) {"," // your code goes here"," // return value","}"].join(`
|
|
91
|
+
`)(n)}catch(s){return console.error(s),console.log(e),e}}function Ys(e,t,n,s){const i=B_(t,s);return e.replaceAll(/(\{\{([^{\}]+(?=}))\}\})/g,(...l)=>{const c=l[2];if(!c)return c;const u=i[c];if(u)return u;const d=V_(c);return N_(d,i,n)})}function q_(e,t){const n=xc.decode(t);n!==e&&(console.error("Inconsistent sql"),console.groupCollapsed("Inconsistent sql"),console.table({before:e,after:t,v:n}),console.groupEnd())}async function $_({query:e,name:t,payload:n,additionals:s},i){if(!e.sql)return[];const{type:a,key:l,sql:c,pre_process:u,post_process:d}=e,p=Mi(c,n),h=tx({sql:p,pre_process:u}),g=xc.encode(h);q_(h,g);let b=await Yt.query(i)({type:a,key:l,query:g,...s},{params:{name:t}});return b=nx(d,b,fo(n)),b}async function F_({type:e,key:t,configString:n,name:s,additionals:i},a){try{return await Yt.httpDataSourceQuery(a)({type:e,key:t,query:n,...i},{params:{name:s}})}catch(l){if(Rt.isCancel(l))throw l;return console.error(l),l}}async function go(){try{return(await Yt.post()("/datasource/list",{filter:{},sort:[{field:"create_time",order:"ASC"}],pagination:{page:1,pagesize:100}},{})).data}catch(e){return console.error(e),[]}}async function Fp(){try{return(await Yt.post()("/sql_snippet/list",{filter:{},sort:[{field:"id",order:"ASC"}],pagination:{page:1,pagesize:1e3}},{})).data}catch(e){return console.error(e),[]}}class Gp{constructor(t){q(this,"rootRef");this.rootRef=re.observable({current:t})}async deleteItem(t){re.runInAction(()=>{v.unset(this.rootRef.current,[t])})}getItem(t){const n=this.getValueFromRoot(t);return Promise.resolve(n)}getValueFromRoot(t){return t===null?re.toJS(this.rootRef.current):v.get(this.rootRef.current,[t])}setItem(t,n){if(t===null)if(v.isObject(n))re.runInAction(()=>{this.rootRef.current=n});else throw new Error("Cannot set root value to non-object");else re.runInAction(()=>{v.set(this.rootRef.current,[t],n)});return Promise.resolve(this.getItem(t))}watchItem(t,n,s){return re.reaction(()=>this.getValueFromRoot(t),(i,a)=>{n(i,a)},{requiresObservable:!0,fireImmediately:v.get(s,"fireImmediately",!1)})}}class G_{constructor(){q(this,"channels",new Map);q(this,"globalChannel",new bc)}getChannel(t){const n=this.channels.get(t);if(n)return n;const s=new bc;return this.channels.set(t,s),s}}class W_{constructor(t){q(this,"instances",new Map);this.pluginManager=t}get availableVizList(){return this.pluginManager.installedPlugins.flatMap(t=>t.manifest.viz)}resolveComponent(t){return this.pluginManager.factory.viz(t)}getOrCreateInstance(t){const n=this.instances.get(t.id);if(n)return n;const s={id:t.id,name:t.viz.type,type:t.viz.type,messageChannels:new G_,instanceData:new Gp(t.viz.conf)};return this.instances.set(t.id,s),s}}function Wp(e,t,n,s){return{vizManager:n,locale:"zh",msgChannels:e.messageChannels,instanceData:e.instanceData,pluginData:new Gp({}),colorPalette:{getColor(){return()=>""}},data:t,variables:s}}const R_=e=>{const{panel:t,measure:n,vizManager:s,data:i,variables:a}=e,l=s.resolveComponent(t.viz.type),c=s.getOrCreateInstance(t),u={...Wp(c,i,s,a),viewport:{width:n.w,height:n.h}},d=l.viewRender;return r.jsx(d,{context:u,instance:c,...v.omit(e,["panel","vizManager","data"])})},Q_=e=>{const{vizManager:t,panel:n,data:s,variables:i}=e,a=t.resolveComponent(n.viz.type),l=t.getOrCreateInstance(n),c={...Wp(l,s,t,i)},u=a.configRender;return r.jsx(u,{context:c,instance:l,...v.omit(e,["panel","vizManager","data"])})},Rp=(e,t)=>{const n=Et.bezier(e),s=Et.bezier(t);return function(i){return i<50?n(i*2/100).hex():s((i-50)*2/100).hex()}},Ks=e=>{const t=Et.bezier(e);return function(n){return t(n/100).hex()}},U_={type:"interpolation",displayName:"style.color.interpolation.palette.red_green",getColor:Rp(["darkred","deeppink","lightyellow"],["lightyellow","lightgreen","teal"]),name:"red-green",category:"diverging"},Y_={type:"interpolation",displayName:"style.color.interpolation.palette.yellow_blue",getColor:Rp(["#8f531d","#ffd347","#e3efe3"],["#eefaee","#4ecbbf","#003f94"]),name:"yellow-blue",category:"diverging"},K_={type:"interpolation",displayName:"style.color.interpolation.palette.red",getColor:Ks(["#fff7f1","darkred"]),name:"red",category:"sequential"},X_={type:"interpolation",displayName:"style.color.interpolation.palette.green",getColor:Ks(["#f0ffed","darkgreen"]),name:"green",category:"sequential"},J_={type:"interpolation",displayName:"style.color.interpolation.palette.blue",getColor:Ks(["#f9fcff","#48b3e9","darkblue"]),name:"blue",category:"sequential"},Z_={type:"interpolation",displayName:"style.color.interpolation.palette.orange",getColor:Ks(["#fff7f1","darkorange","#b60000"]),name:"orange",category:"sequential"};class H_{constructor(t){q(this,"symbol");this.symbol=Symbol(t)}}function pn(e){return new H_(e)}class mo{constructor(){q(this,"parent");q(this,"factoryRegistry",new Map);q(this,"instanceRegistry",new Map)}createScoped(){const t=new mo;return t.parent=this,t}getRequired(t){return this.get(t)}get(t){if(this.instanceRegistry.has(t.symbol))return this.instanceRegistry.get(t.symbol);const n=this.factoryRegistry.get(t.symbol);if(n){const s=n(this);return this.instanceRegistry.set(t.symbol,s),s}if(this.parent)return this.parent.get(t)}provideFactory(t,n){return this.factoryRegistry.has(t.symbol)?console.warn(`Token ${t.symbol.toString()} is already registered`):this.factoryRegistry.set(t.symbol,n),this}provideValue(t,n){return this.factoryRegistry.has(t.symbol)?console.warn(`Token ${t.symbol.toString()} is already registered`):this.factoryRegistry.set(t.symbol,()=>n),this}dispose(){this.instanceRegistry.forEach(t=>{const n=v.get(t,"dispose");v.isFunction(n)&&n.bind(t)()}),this.instanceRegistry.clear(),this.factoryRegistry.clear()}}const Qp="13.40.1",ej=Object.freeze(Object.defineProperty({__proto__:null,version:Qp},Symbol.toStringTag,{value:"Module"}));class tj{constructor(t){q(this,"staticColors",new Map);q(this,"interpolations",new Map);t.installedPlugins.forEach(n=>{n.manifest.color.forEach(s=>{this.register(s)})})}getStaticColors(){return Array.from(this.staticColors.values())}register(t){const n=this.encodeColor(t);t.type==="single"?(this.staticColors.has(n)&&console.warn(`the color '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`),this.staticColors.set(n,t)):t.type==="interpolation"&&(this.interpolations.has(n)&&console.warn(`the interpolation '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`,`the interpolation '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`),this.interpolations.set(n,t))}decodeStaticColor(t){return this.staticColors.get(t)}encodeColor(t){return`\${${t.category}}.{${t.name}}`}decodeInterpolation(t){return this.interpolations.get(t)}getColorInterpolations(){return Array.from(this.interpolations.values())}}class nj{constructor(){q(this,"plugins",new Map);q(this,"vizComponents",new Map);q(this,"factory",{viz:t=>{const n=this.vizComponents.get(t);if(n)return n;throw new Error(`Viz Component (${t}) not found`)}})}install(t){if(this.plugins.has(t.id))throw new Error(`Plugin (${t.id}) has been installed before`);this.plugins.set(t.id,t);for(const n of t.manifest.viz){if(this.vizComponents.has(n.name))throw new Error(`Viz Component (${n.name}) has been installed before`);this.vizComponents.set(n.name,n)}}get installedPlugins(){return Array.from(this.plugins.values())}}class rj{constructor(){q(this,"migrations",[])}version(t,n){return this.migrations.push({version:t,handler:n}),this}run(t,n,s){var l;if(t.from===t.to)return n;if(t.from>t.to)throw new Error(`Can not downgrade from version '${t.from}' to (${t.to})`);const i=this.migrations.filter(c=>c.version>t.from&&c.version<=t.to),a=v.orderBy(i,"version","asc");if(((l=v.last(a))==null?void 0:l.version)!==t.to)throw new Error(`Migration to version ${t.to} not found`);return a.reduce((c,u)=>u.handler(c,s),n)}}class De extends rj{constructor(){super(),this.configVersions()}version(t,n){return super.version(t,(s,i)=>({version:t,...n(s,i)}))}async migrate({configData:t,panelModel:n}){const s=await t.getItem(null),i=v.get(s,"version",0),a=this.run({from:i,to:this.VERSION},s,{panelModel:n});await t.setItem(null,a)}async needMigration({configData:t}){const n=await t.getItem(null);return v.get(n,"version",0)<this.VERSION}}const Q=(e,t)=>{const[n,{setFalse:s}]=X.useBoolean(!0),[i,a]=f.useState();f.useEffect(()=>(e.getItem(t).then(c=>{a(c),s()}),e.watchItem(t,c=>{a(c)})));const l=f.useCallback(async c=>{await e.setItem(t,c),a(c)},[e,t]);return{loading:n,value:i,set:l}},ut={top:16,right:16,bottom:16,left:16},Vt=e=>Math.max(0,e-ut.left-ut.right),Nt=e=>Math.max(0,e-ut.top-ut.bottom),Zr=(e,t)=>({width:Vt(e),height:Nt(t)}),dt=({width:e,height:t,children:n})=>r.jsx(o.Box,{pt:ut.top,pr:ut.right,pb:ut.bottom,pl:ut.left,sx:{width:e,height:t,overflow:"hidden",position:"relative"},children:n}),xo={x_axis_data_key:"",y_axis_data_key:"",z_axis_data_key:"",xAxis3D:{type:"value",name:"X Axis Name"},yAxis3D:{type:"value",name:"Y Axis Name"},zAxis3D:{type:"value",name:"Z Axis Name"}};function sj({context:e}){const{value:t}=Q(e.instanceData,"config"),n=e.data,{width:s,height:i}=e.viewport,{x_axis_data_key:a,y_axis_data_key:l,z_axis_data_key:c,xAxis3D:u,yAxis3D:d,zAxis3D:p}=v.defaults({},t,xo),h=f.useMemo(()=>cs(n,a),[n,a]),{x:g,y:b,z:x}=f.useMemo(()=>({x:L(a),y:L(l),z:L(c)}),[a,l,c]),{min:_,max:T}=f.useMemo(()=>{const D=v.minBy(h,M=>M[x.columnKey]),z=v.maxBy(h,M=>M[x.columnKey]);return{min:v.get(D,x.columnKey),max:v.get(z,x.columnKey)}},[h,x]),C={tooltip:{},backgroundColor:"#fff",visualMap:{show:!0,dimension:2,min:_,max:T,inRange:{color:["#313695","#4575b4","#74add1","#abd9e9","#e0f3f8","#ffffbf","#fee090","#fdae61","#f46d43","#d73027","#a50026"]}},xAxis3D:u,yAxis3D:d,zAxis3D:p,grid3D:{viewControl:{projection:"orthographic",autoRotate:!1},light:{main:{shadow:!0,quality:"ultra",intensity:1.5}}},series:[{type:"bar3D",wireframe:{},data:h.map(D=>[D[g.columnKey],D[b.columnKey],D[x.columnKey]])}]};return t?r.jsx(dt,{width:s,height:i,children:r.jsx(Ye,{echarts:Ue,option:C,style:Zr(s,i),notMerge:!0,theme:"merico-light"})}):null}const U=I.observer(f.forwardRef(({label:e,required:t,description:n,value:s,onChange:i,queryID:a,clearable:l=!1,sx:c,...u},d)=>{const{panel:p}=nt(),h=f.useMemo(()=>p.dataFieldOptions(s,l,a),[s,l,a]);if(h.length===0){const g=p.explainDataKey(s);return r.jsxs(o.HoverCard,{shadow:"md",position:"bottom-start",withinPortal:!0,zIndex:320,children:[r.jsx(o.HoverCard.Target,{children:r.jsx(o.Box,{children:r.jsx(o.TextInput,{label:e,required:t,defaultValue:g.columnKey,readOnly:!0,disabled:!0})})}),r.jsx(o.HoverCard.Dropdown,{children:r.jsxs(o.Group,{position:"left",spacing:0,children:[r.jsx(o.Text,{size:"xs",color:g.queryName?"black":"red",sx:{fontFamily:"monospace"},children:g.queryName??g.queryID}),r.jsx(o.Text,{size:"xs",color:"black",sx:{fontFamily:"monospace"},children:"."}),r.jsx(o.Text,{size:"xs",color:"red",sx:{fontFamily:"monospace"},children:g.columnKey})]})})]})}return r.jsx(o.Select,{ref:d,label:e,description:n,data:h,value:s,onChange:i,required:t,sx:c,maxDropdownHeight:500,...u})}));function ij({context:e}){const{value:t,set:n}=Q(e.instanceData,"config"),s=v.defaults({},t,xo),{control:i,handleSubmit:a,reset:l}=y.useForm({defaultValues:s});return f.useEffect(()=>{l(s)},[t]),t?r.jsx(o.Stack,{spacing:"xs",children:r.jsxs("form",{onSubmit:a(n),children:[r.jsx(o.Text,{children:"X Axis"}),r.jsxs(o.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[r.jsx(y.Controller,{name:"x_axis_data_key",control:i,render:({field:c})=>r.jsx(U,{label:"Data Field",required:!0,...c})}),r.jsx(y.Controller,{name:"xAxis3D.name",control:i,render:({field:c})=>r.jsx(o.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...c})})]}),r.jsx(o.Text,{mt:"lg",children:"Y Axis"}),r.jsxs(o.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[r.jsx(y.Controller,{name:"y_axis_data_key",control:i,render:({field:c})=>r.jsx(U,{label:"Data Field",required:!0,...c})}),r.jsx(y.Controller,{name:"yAxis3D.name",control:i,render:({field:c})=>r.jsx(o.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...c})})]}),r.jsx(o.Text,{mt:"lg",children:"Z Axis"}),r.jsxs(o.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[r.jsx(y.Controller,{name:"z_axis_data_key",control:i,render:({field:c})=>r.jsx(U,{label:"Data Field",required:!0,...c})}),r.jsx(y.Controller,{name:"zAxis3D.name",control:i,render:({field:c})=>r.jsx(o.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...c})})]}),r.jsx(o.Group,{position:"center",mt:"xl",grow:!0,sx:{width:"60%"},mx:"auto",children:r.jsxs(o.Button,{color:"blue",type:"submit",children:[r.jsx(k.IconDeviceFloppy,{size:20}),r.jsx(o.Text,{ml:"md",children:"Save"})]})})]})}):null}const aj=[{lang:"en",resources:{bar_chart_3d:{viz_name:"Bar Chart(3D)"}}},{lang:"zh",resources:{bar_chart_3d:{viz_name:"柱图(3D)"}}}];function oj(e,{panelModel:t}){try{const n=t.queryIDs[0];if(!n)throw new Error("cannot migrate when queryID is empty");const s=u=>u&&`${n}.${u}`,{x_axis_data_key:i,y_axis_data_key:a,z_axis_data_key:l,...c}=e;return{...c,x_axis_data_key:s(i),y_axis_data_key:s(a),z_axis_data_key:s(l)}}catch(n){throw console.error("[Migration failed]",n),n}}class lj extends De{constructor(){super(...arguments);q(this,"VERSION",2)}configVersions(){this.version(1,n=>({version:1,config:n})),this.version(2,(n,s)=>{const{config:i}=n;return{...n,version:2,config:oj(i,s)}})}}const cj={displayName:"viz.bar_chart_3d.viz_name",displayGroup:"chart.groups.echarts_based_charts",migrator:new lj,name:"bar-3d",viewRender:sj,configRender:ij,createConfig(){return{version:2,config:v.cloneDeep(xo)}},translation:aj},uj=({disabled:e,value:t,onChange:n})=>{const s=i=>{i&&n(i)};return r.jsxs(o.Box,{sx:{position:"relative"},children:[e&&r.jsx(o.Overlay,{opacity:.6,color:"#fff",zIndex:5,blur:2}),r.jsx(gt,{height:"500px",defaultLanguage:"javascript",value:t,onChange:s,theme:"vs-dark",options:{minimap:{enabled:!1},readOnly:e}})]})};function pt({enabled:e,func_content:t}){return(n,s)=>{if(!e)return n;try{return new Function(`return ${t}`)()(n,s)}catch(i){return console.error(`[getEchartsXAxisLabel] failed parsing custom function, error: ${i.message}`),n}}}function et(){return{enabled:!1,func_content:["function label(value, index) {"," // your code goes here"," // return value","}"].join(`
|
|
92
92
|
`)}}const qt=f.forwardRef(({value:e,onChange:t,triggerButtonText:n},s)=>{const{t:i}=j.useTranslation(),[a,{setTrue:l,setFalse:c}]=X.useBoolean(),[u,d]=f.useState(e);f.useEffect(()=>{d(e)},[e]);const p=T=>{d({...u,enabled:T})},h=()=>{c();const{enabled:T,func_content:C}=u,D={enabled:T,func_content:C};d(D),t(D)},g=()=>{c(),d(e)},b=T=>{d(C=>({...C,func_content:T}))},x=()=>{b(et().func_content)},_=n??i("chart.axis.customize_label");return r.jsxs(r.Fragment,{children:[r.jsx(o.Button,{variant:"filled",color:"grape",leftIcon:r.jsx(k.IconMathFunction,{size:16}),mt:24,onClick:l,sx:{flexGrow:0},children:_}),r.jsx(o.Modal,{size:800,title:_,opened:a,onClose:c,closeOnClickOutside:!1,withCloseButton:!1,zIndex:320,children:a&&r.jsxs(o.Stack,{children:[r.jsx(o.Checkbox,{mt:10,label:i("common.enabled"),checked:u.enabled,onChange:T=>p(T.currentTarget.checked)}),r.jsx(uj,{value:u.func_content,onChange:b,disabled:!u.enabled}),r.jsxs(o.Group,{position:"apart",children:[r.jsx(o.Button,{onClick:x,color:"red",leftIcon:r.jsx(k.IconRecycle,{size:20}),children:i("common.actions.reset_to_default")}),r.jsxs(o.Group,{position:"right",children:[r.jsx(o.Button,{onClick:g,variant:"subtle",children:i("common.actions.cancel")}),r.jsx(o.Button,{color:"green",leftIcon:r.jsx(k.IconDeviceFloppy,{size:16}),onClick:h,children:i("common.actions.save")})]})]})]})})]})}),Fn={x_axis_scroll:!1,y_axis_scroll:!1,x_axis_slider:!1,y_axis_slider:!1};function Up(){return v.cloneDeep(Fn)}const dj=[{lang:"en",resources:{boxplot:{viz_name:"Boxplot Chart",box:"Box",outlier:"Outlier",scatter:"Scatter",click_series:{label:"Click box, scatter or outlier"}}}},{lang:"zh",resources:{boxplot:{viz_name:"箱线图",box:"箱体",outlier:"异常点",scatter:"散点",click_series:{label:"点击箱体、散点或异常点"}}}}],Yp={id:"builtin:echarts:click-echart:series",displayName:"viz.boxplot.click_series.label",nameRender:hj,configRender:pj,payload:[{name:"type",description:"Always 'click'",valueType:"string"},{name:"seriesType",description:"'boxplot'",valueType:"string"},{name:"name",description:"Name of the series clicked",valueType:"string"},{name:"color",description:"Color",valueType:"string"},{name:"value",description:"Record of 'name', 'min', 'q1', 'median', 'q3', 'max'",valueType:"object"},{name:"rowData",description:"Data of the row",valueType:"object"}]};function pj(e){return r.jsx(r.Fragment,{})}function hj(e){const{t}=j.useTranslation();return r.jsx(o.Text,{children:t("viz.boxplot.click_series.label")})}const Xs=f.forwardRef(({sectionTitle:e,value:t,onChange:n},s)=>{const{t:i,i18n:a}=j.useTranslation(),l=u=>d=>{const p=v.cloneDeep(t);v.set(p,u,d),n(p)},c=f.useMemo(()=>[{label:i("chart.axis.overflow.truncate"),value:"truncate"},{label:i("chart.axis.overflow.break_line"),value:"break"},{label:i("chart.axis.overflow.break_word"),value:"breakAll"}],[a.language]);return r.jsxs(o.Stack,{spacing:0,children:[e&&r.jsx(o.Divider,{mb:-5,mt:5,variant:"dotted",label:e,labelPosition:"right",labelProps:{color:"dimmed"}}),r.jsxs(o.Group,{grow:!0,noWrap:!0,children:[r.jsx(o.NumberInput,{label:i("chart.axis.overflow.max_width"),hideControls:!0,value:t.width,onChange:l("width")}),r.jsx(o.Select,{label:i("chart.axis.overflow.label"),data:c,value:t.overflow,onChange:l("overflow")}),r.jsx(o.TextInput,{label:i("chart.axis.overflow.ellipsis"),value:t.ellipsis,disabled:!0})]})]})}),$t=f.forwardRef(({value:e,onChange:t},n)=>{const{t:s}=j.useTranslation(),i=l=>{t({...e,on_axis:l})},a=l=>{t({...e,in_tooltip:l})};return r.jsxs(o.Stack,{ref:n,spacing:0,children:[r.jsx(Xs,{sectionTitle:s("chart.axis.overflow.section_title.on_axis"),value:e.on_axis,onChange:i}),r.jsx(Xs,{sectionTitle:s("chart.axis.overflow.section_title.in_tooltip"),value:e.in_tooltip,onChange:a})]})});function ht(){return{on_axis:{width:80,overflow:"truncate",ellipsis:"..."},in_tooltip:{width:200,overflow:"break",ellipsis:"..."}}}function Dt({overflow:e,width:t}){const n={truncate:"initial",break:"break-all",breakAll:"break-word"}[e],s=e==="truncate"?"nowrap":"initial",i={truncate:"ellipsis",break:"clip",breakAll:"clip"}[e];return`
|
|
93
93
|
max-width: ${t}px;
|
|
94
94
|
word-break: ${n};
|