@nocobase/plugin-charts 1.2.14-alpha → 1.3.0-alpha.20240710141659

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.
@@ -7,47 +7,47 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- (function(A,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("react/jsx-runtime"),require("@formily/core"),require("@nocobase/client"),require("react"),require("antd"),require("@formily/antd-v5"),require("@formily/react"),require("@nocobase/utils/client"),require("react-i18next"),require("@ant-design/icons"),require("react-router-dom"),require("lodash"),require("@formily/shared")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@formily/core","@nocobase/client","react","antd","@formily/antd-v5","@formily/react","@nocobase/utils/client","react-i18next","@ant-design/icons","react-router-dom","lodash","@formily/shared"],u):(A=typeof globalThis!="undefined"?globalThis:A||self,u(A["@nocobase/plugin-charts"]={},A.jsxRuntime,A["@formily/core"],A["@nocobase/client"],A.react,A.antd,A["@formily/antd-v5"],A["@formily/react"],A["@nocobase/utils"],A["react-i18next"],A["@ant-design/icons"],A["react-router-dom"],A.lodash,A["@formily/shared"]))})(this,function(A,u,w,o,y,L,eu,I,G,Y,ou,Wu,lu,nu){"use strict";var $e=Object.defineProperty,Qe=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var au=Object.getOwnPropertySymbols;var Ku=Object.prototype.hasOwnProperty,Uu=Object.prototype.propertyIsEnumerable;var Hu=(A,u,w)=>u in A?$e(A,u,{enumerable:!0,configurable:!0,writable:!0,value:w}):A[u]=w,b=(A,u)=>{for(var w in u||(u={}))Ku.call(u,w)&&Hu(A,w,u[w]);if(au)for(var w of au(u))Uu.call(u,w)&&Hu(A,w,u[w]);return A},U=(A,u)=>Qe(A,_e(u));var cu=(A,u)=>{var w={};for(var o in A)Ku.call(A,o)&&u.indexOf(o)<0&&(w[o]=A[o]);if(A!=null&&au)for(var o of au(A))u.indexOf(o)<0&&Uu.call(A,o)&&(w[o]=A[o]);return w};var J=(A,u,w)=>new Promise((o,y)=>{var L=G=>{try{I(w.next(G))}catch(Y){y(Y)}},eu=G=>{try{I(w.throw(G))}catch(Y){y(Y)}},I=G=>G.done?o(G.value):Promise.resolve(G.value).then(L,eu);I((w=w.apply(A,u)).next())});var Xu=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Yu=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Ru=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,pu={Space_Separator:Xu,ID_Start:Yu,ID_Continue:Ru},q={isSpaceSeparator(e){return typeof e=="string"&&pu.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||pu.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||pu.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let Cu,T,_,iu,K,$,k,du,tu;var ue=function(t,n){Cu=String(t),T="start",_=[],iu=0,K=1,$=0,k=void 0,du=void 0,tu=void 0;do k=ee(),oe[T]();while(k.type!=="eof");return typeof n=="function"?Fu({"":tu},"",n):tu};function Fu(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let c=0;c<i.length;c++){const D=String(c),a=Fu(i,D,n);a===void 0?delete i[D]:Object.defineProperty(i,D,{value:a,writable:!0,enumerable:!0,configurable:!0})}else for(const c in i){const D=Fu(i,c,n);D===void 0?delete i[c]:Object.defineProperty(i,c,{value:D,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,t,i)}let E,d,ru,Z,f;function ee(){for(E="default",d="",ru=!1,Z=1;;){f=H();const e=yu[E]();if(e)return e}}function H(){if(Cu[iu])return String.fromCodePoint(Cu.codePointAt(iu))}function r(){const e=H();return e===`
11
- `?(K++,$=0):e?$+=e.length:$++,e&&(iu+=e.length),e}const yu={default(){switch(f){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
12
- `:case"\r":case"\u2028":case"\u2029":r();return;case"/":r(),E="comment";return;case void 0:return r(),S("eof")}if(q.isSpaceSeparator(f)){r();return}return yu[T]()},comment(){switch(f){case"*":r(),E="multiLineComment";return;case"/":r(),E="singleLineComment";return}throw v(r())},multiLineComment(){switch(f){case"*":r(),E="multiLineCommentAsterisk";return;case void 0:throw v(r())}r()},multiLineCommentAsterisk(){switch(f){case"*":r();return;case"/":r(),E="default";return;case void 0:throw v(r())}r(),E="multiLineComment"},singleLineComment(){switch(f){case`
13
- `:case"\r":case"\u2028":case"\u2029":r(),E="default";return;case void 0:return r(),S("eof")}r()},value(){switch(f){case"{":case"[":return S("punctuator",r());case"n":return r(),W("ull"),S("null",null);case"t":return r(),W("rue"),S("boolean",!0);case"f":return r(),W("alse"),S("boolean",!1);case"-":case"+":r()==="-"&&(Z=-1),E="sign";return;case".":d=r(),E="decimalPointLeading";return;case"0":d=r(),E="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":d=r(),E="decimalInteger";return;case"I":return r(),W("nfinity"),S("numeric",1/0);case"N":return r(),W("aN"),S("numeric",NaN);case'"':case"'":ru=r()==='"',d="",E="string";return}throw v(r())},identifierNameStartEscape(){if(f!=="u")throw v(r());r();const e=Au();switch(e){case"$":case"_":break;default:if(!q.isIdStartChar(e))throw gu();break}d+=e,E="identifierName"},identifierName(){switch(f){case"$":case"_":case"‌":case"‍":d+=r();return;case"\\":r(),E="identifierNameEscape";return}if(q.isIdContinueChar(f)){d+=r();return}return S("identifier",d)},identifierNameEscape(){if(f!=="u")throw v(r());r();const e=Au();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!q.isIdContinueChar(e))throw gu();break}d+=e,E="identifierName"},sign(){switch(f){case".":d=r(),E="decimalPointLeading";return;case"0":d=r(),E="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":d=r(),E="decimalInteger";return;case"I":return r(),W("nfinity"),S("numeric",Z*(1/0));case"N":return r(),W("aN"),S("numeric",NaN)}throw v(r())},zero(){switch(f){case".":d+=r(),E="decimalPoint";return;case"e":case"E":d+=r(),E="decimalExponent";return;case"x":case"X":d+=r(),E="hexadecimal";return}return S("numeric",Z*0)},decimalInteger(){switch(f){case".":d+=r(),E="decimalPoint";return;case"e":case"E":d+=r(),E="decimalExponent";return}if(q.isDigit(f)){d+=r();return}return S("numeric",Z*Number(d))},decimalPointLeading(){if(q.isDigit(f)){d+=r(),E="decimalFraction";return}throw v(r())},decimalPoint(){switch(f){case"e":case"E":d+=r(),E="decimalExponent";return}if(q.isDigit(f)){d+=r(),E="decimalFraction";return}return S("numeric",Z*Number(d))},decimalFraction(){switch(f){case"e":case"E":d+=r(),E="decimalExponent";return}if(q.isDigit(f)){d+=r();return}return S("numeric",Z*Number(d))},decimalExponent(){switch(f){case"+":case"-":d+=r(),E="decimalExponentSign";return}if(q.isDigit(f)){d+=r(),E="decimalExponentInteger";return}throw v(r())},decimalExponentSign(){if(q.isDigit(f)){d+=r(),E="decimalExponentInteger";return}throw v(r())},decimalExponentInteger(){if(q.isDigit(f)){d+=r();return}return S("numeric",Z*Number(d))},hexadecimal(){if(q.isHexDigit(f)){d+=r(),E="hexadecimalInteger";return}throw v(r())},hexadecimalInteger(){if(q.isHexDigit(f)){d+=r();return}return S("numeric",Z*Number(d))},string(){switch(f){case"\\":r(),d+=te();return;case'"':if(ru)return r(),S("string",d);d+=r();return;case"'":if(!ru)return r(),S("string",d);d+=r();return;case`
14
- `:case"\r":throw v(r());case"\u2028":case"\u2029":ne(f);break;case void 0:throw v(r())}d+=r()},start(){switch(f){case"{":case"[":return S("punctuator",r())}E="value"},beforePropertyName(){switch(f){case"$":case"_":d=r(),E="identifierName";return;case"\\":r(),E="identifierNameStartEscape";return;case"}":return S("punctuator",r());case'"':case"'":ru=r()==='"',E="string";return}if(q.isIdStartChar(f)){d+=r(),E="identifierName";return}throw v(r())},afterPropertyName(){if(f===":")return S("punctuator",r());throw v(r())},beforePropertyValue(){E="value"},afterPropertyValue(){switch(f){case",":case"}":return S("punctuator",r())}throw v(r())},beforeArrayValue(){if(f==="]")return S("punctuator",r());E="value"},afterArrayValue(){switch(f){case",":case"]":return S("punctuator",r())}throw v(r())},end(){throw v(r())}};function S(e,t){return{type:e,value:t,line:K,column:$}}function W(e){for(const t of e){if(H()!==t)throw v(r());r()}}function te(){switch(H()){case"b":return r(),"\b";case"f":return r(),"\f";case"n":return r(),`
15
- `;case"r":return r(),"\r";case"t":return r()," ";case"v":return r(),"\v";case"0":if(r(),q.isDigit(H()))throw v(r());return"\0";case"x":return r(),re();case"u":return r(),Au();case`
10
+ (function(A,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("react/jsx-runtime"),require("@formily/core"),require("@nocobase/client"),require("react"),require("antd"),require("@formily/antd-v5"),require("@formily/react"),require("@nocobase/utils/client"),require("react-i18next"),require("@ant-design/icons"),require("react-router-dom"),require("lodash"),require("@formily/shared")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@formily/core","@nocobase/client","react","antd","@formily/antd-v5","@formily/react","@nocobase/utils/client","react-i18next","@ant-design/icons","react-router-dom","lodash","@formily/shared"],u):(A=typeof globalThis!="undefined"?globalThis:A||self,u(A["@nocobase/plugin-charts"]={},A.jsxRuntime,A["@formily/core"],A["@nocobase/client"],A.react,A.antd,A["@formily/antd-v5"],A["@formily/react"],A["@nocobase/utils"],A["react-i18next"],A["@ant-design/icons"],A["react-router-dom"],A.lodash,A["@formily/shared"]))})(this,function(A,u,w,o,B,L,eu,I,G,Y,ou,Xu,lu,nu){"use strict";var Qe=Object.defineProperty,_e=Object.defineProperties;var Ze=Object.getOwnPropertyDescriptors;var au=Object.getOwnPropertySymbols;var Uu=Object.prototype.hasOwnProperty,Wu=Object.prototype.propertyIsEnumerable;var Ku=(A,u,w)=>u in A?Qe(A,u,{enumerable:!0,configurable:!0,writable:!0,value:w}):A[u]=w,b=(A,u)=>{for(var w in u||(u={}))Uu.call(u,w)&&Ku(A,w,u[w]);if(au)for(var w of au(u))Wu.call(u,w)&&Ku(A,w,u[w]);return A},U=(A,u)=>_e(A,Ze(u));var cu=(A,u)=>{var w={};for(var o in A)Uu.call(A,o)&&u.indexOf(o)<0&&(w[o]=A[o]);if(A!=null&&au)for(var o of au(A))u.indexOf(o)<0&&Wu.call(A,o)&&(w[o]=A[o]);return w};var J=(A,u,w)=>new Promise((o,B)=>{var L=G=>{try{I(w.next(G))}catch(Y){B(Y)}},eu=G=>{try{I(w.throw(G))}catch(Y){B(Y)}},I=G=>G.done?o(G.value):Promise.resolve(G.value).then(L,eu);I((w=w.apply(A,u)).next())});var Yu=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Ru=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,pu={Space_Separator:Yu,ID_Start:Ru,ID_Continue:ue},q={isSpaceSeparator(e){return typeof e=="string"&&pu.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||pu.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||pu.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let Cu,T,_,iu,K,$,k,du,tu;var ee=function(t,n){Cu=String(t),T="start",_=[],iu=0,K=1,$=0,k=void 0,du=void 0,tu=void 0;do k=te(),ne[T]();while(k.type!=="eof");return typeof n=="function"?Fu({"":tu},"",n):tu};function Fu(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let a=0;a<i.length;a++){const D=String(a),c=Fu(i,D,n);c===void 0?delete i[D]:Object.defineProperty(i,D,{value:c,writable:!0,enumerable:!0,configurable:!0})}else for(const a in i){const D=Fu(i,a,n);D===void 0?delete i[a]:Object.defineProperty(i,a,{value:D,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,t,i)}let E,d,ru,Z,h;function te(){for(E="default",d="",ru=!1,Z=1;;){h=H();const e=gu[E]();if(e)return e}}function H(){if(Cu[iu])return String.fromCodePoint(Cu.codePointAt(iu))}function r(){const e=H();return e===`
11
+ `?(K++,$=0):e?$+=e.length:$++,e&&(iu+=e.length),e}const gu={default(){switch(h){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
12
+ `:case"\r":case"\u2028":case"\u2029":r();return;case"/":r(),E="comment";return;case void 0:return r(),S("eof")}if(q.isSpaceSeparator(h)){r();return}return gu[T]()},comment(){switch(h){case"*":r(),E="multiLineComment";return;case"/":r(),E="singleLineComment";return}throw v(r())},multiLineComment(){switch(h){case"*":r(),E="multiLineCommentAsterisk";return;case void 0:throw v(r())}r()},multiLineCommentAsterisk(){switch(h){case"*":r();return;case"/":r(),E="default";return;case void 0:throw v(r())}r(),E="multiLineComment"},singleLineComment(){switch(h){case`
13
+ `:case"\r":case"\u2028":case"\u2029":r(),E="default";return;case void 0:return r(),S("eof")}r()},value(){switch(h){case"{":case"[":return S("punctuator",r());case"n":return r(),W("ull"),S("null",null);case"t":return r(),W("rue"),S("boolean",!0);case"f":return r(),W("alse"),S("boolean",!1);case"-":case"+":r()==="-"&&(Z=-1),E="sign";return;case".":d=r(),E="decimalPointLeading";return;case"0":d=r(),E="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":d=r(),E="decimalInteger";return;case"I":return r(),W("nfinity"),S("numeric",1/0);case"N":return r(),W("aN"),S("numeric",NaN);case'"':case"'":ru=r()==='"',d="",E="string";return}throw v(r())},identifierNameStartEscape(){if(h!=="u")throw v(r());r();const e=Au();switch(e){case"$":case"_":break;default:if(!q.isIdStartChar(e))throw xu();break}d+=e,E="identifierName"},identifierName(){switch(h){case"$":case"_":case"‌":case"‍":d+=r();return;case"\\":r(),E="identifierNameEscape";return}if(q.isIdContinueChar(h)){d+=r();return}return S("identifier",d)},identifierNameEscape(){if(h!=="u")throw v(r());r();const e=Au();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!q.isIdContinueChar(e))throw xu();break}d+=e,E="identifierName"},sign(){switch(h){case".":d=r(),E="decimalPointLeading";return;case"0":d=r(),E="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":d=r(),E="decimalInteger";return;case"I":return r(),W("nfinity"),S("numeric",Z*(1/0));case"N":return r(),W("aN"),S("numeric",NaN)}throw v(r())},zero(){switch(h){case".":d+=r(),E="decimalPoint";return;case"e":case"E":d+=r(),E="decimalExponent";return;case"x":case"X":d+=r(),E="hexadecimal";return}return S("numeric",Z*0)},decimalInteger(){switch(h){case".":d+=r(),E="decimalPoint";return;case"e":case"E":d+=r(),E="decimalExponent";return}if(q.isDigit(h)){d+=r();return}return S("numeric",Z*Number(d))},decimalPointLeading(){if(q.isDigit(h)){d+=r(),E="decimalFraction";return}throw v(r())},decimalPoint(){switch(h){case"e":case"E":d+=r(),E="decimalExponent";return}if(q.isDigit(h)){d+=r(),E="decimalFraction";return}return S("numeric",Z*Number(d))},decimalFraction(){switch(h){case"e":case"E":d+=r(),E="decimalExponent";return}if(q.isDigit(h)){d+=r();return}return S("numeric",Z*Number(d))},decimalExponent(){switch(h){case"+":case"-":d+=r(),E="decimalExponentSign";return}if(q.isDigit(h)){d+=r(),E="decimalExponentInteger";return}throw v(r())},decimalExponentSign(){if(q.isDigit(h)){d+=r(),E="decimalExponentInteger";return}throw v(r())},decimalExponentInteger(){if(q.isDigit(h)){d+=r();return}return S("numeric",Z*Number(d))},hexadecimal(){if(q.isHexDigit(h)){d+=r(),E="hexadecimalInteger";return}throw v(r())},hexadecimalInteger(){if(q.isHexDigit(h)){d+=r();return}return S("numeric",Z*Number(d))},string(){switch(h){case"\\":r(),d+=re();return;case'"':if(ru)return r(),S("string",d);d+=r();return;case"'":if(!ru)return r(),S("string",d);d+=r();return;case`
14
+ `:case"\r":throw v(r());case"\u2028":case"\u2029":ie(h);break;case void 0:throw v(r())}d+=r()},start(){switch(h){case"{":case"[":return S("punctuator",r())}E="value"},beforePropertyName(){switch(h){case"$":case"_":d=r(),E="identifierName";return;case"\\":r(),E="identifierNameStartEscape";return;case"}":return S("punctuator",r());case'"':case"'":ru=r()==='"',E="string";return}if(q.isIdStartChar(h)){d+=r(),E="identifierName";return}throw v(r())},afterPropertyName(){if(h===":")return S("punctuator",r());throw v(r())},beforePropertyValue(){E="value"},afterPropertyValue(){switch(h){case",":case"}":return S("punctuator",r())}throw v(r())},beforeArrayValue(){if(h==="]")return S("punctuator",r());E="value"},afterArrayValue(){switch(h){case",":case"]":return S("punctuator",r())}throw v(r())},end(){throw v(r())}};function S(e,t){return{type:e,value:t,line:K,column:$}}function W(e){for(const t of e){if(H()!==t)throw v(r());r()}}function re(){switch(H()){case"b":return r(),"\b";case"f":return r(),"\f";case"n":return r(),`
15
+ `;case"r":return r(),"\r";case"t":return r()," ";case"v":return r(),"\v";case"0":if(r(),q.isDigit(H()))throw v(r());return"\0";case"x":return r(),oe();case"u":return r(),Au();case`
16
16
  `:case"\u2028":case"\u2029":return r(),"";case"\r":return r(),H()===`
17
- `&&r(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw v(r());case void 0:throw v(r())}return r()}function re(){let e="",t=H();if(!q.isHexDigit(t)||(e+=r(),t=H(),!q.isHexDigit(t)))throw v(r());return e+=r(),String.fromCodePoint(parseInt(e,16))}function Au(){let e="",t=4;for(;t-- >0;){const n=H();if(!q.isHexDigit(n))throw v(r());e+=r()}return String.fromCodePoint(parseInt(e,16))}const oe={start(){if(k.type==="eof")throw X();Eu()},beforePropertyName(){switch(k.type){case"identifier":case"string":du=k.value,T="afterPropertyName";return;case"punctuator":Du();return;case"eof":throw X()}},afterPropertyName(){if(k.type==="eof")throw X();T="beforePropertyValue"},beforePropertyValue(){if(k.type==="eof")throw X();Eu()},beforeArrayValue(){if(k.type==="eof")throw X();if(k.type==="punctuator"&&k.value==="]"){Du();return}Eu()},afterPropertyValue(){if(k.type==="eof")throw X();switch(k.value){case",":T="beforePropertyName";return;case"}":Du()}},afterArrayValue(){if(k.type==="eof")throw X();switch(k.value){case",":T="beforeArrayValue";return;case"]":Du()}},end(){}};function Eu(){let e;switch(k.type){case"punctuator":switch(k.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=k.value;break}if(tu===void 0)tu=e;else{const t=_[_.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,du,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")_.push(e),Array.isArray(e)?T="beforeArrayValue":T="beforePropertyName";else{const t=_[_.length-1];t==null?T="end":Array.isArray(t)?T="afterArrayValue":T="afterPropertyValue"}}function Du(){_.pop();const e=_[_.length-1];e==null?T="end":Array.isArray(e)?T="afterArrayValue":T="afterPropertyValue"}function v(e){return su(e===void 0?`JSON5: invalid end of input at ${K}:${$}`:`JSON5: invalid character '${xu(e)}' at ${K}:${$}`)}function X(){return su(`JSON5: invalid end of input at ${K}:${$}`)}function gu(){return $-=5,su(`JSON5: invalid identifier character at ${K}:${$}`)}function ne(e){console.warn(`JSON5: '${xu(e)}' in strings is not valid ECMAScript; consider escaping`)}function xu(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function su(e){const t=new SyntaxError(e);return t.lineNumber=K,t.columnNumber=$,t}var ie=function(t,n,i){const c=[];let D="",a,F,s="",h;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,h=n.quote,n=n.replacer),typeof n=="function")F=n;else if(Array.isArray(n)){a=[];for(const p of n){let C;typeof p=="string"?C=p:(typeof p=="number"||p instanceof String||p instanceof Number)&&(C=String(p)),C!==void 0&&a.indexOf(C)<0&&a.push(C)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),s=" ".substr(0,i)):typeof i=="string"&&(s=i.substr(0,10)),g("",{"":t});function g(p,C){let l=C[p];switch(l!=null&&(typeof l.toJSON5=="function"?l=l.toJSON5(p):typeof l.toJSON=="function"&&(l=l.toJSON(p))),F&&(l=F.call(C,p,l)),l instanceof Number?l=Number(l):l instanceof String?l=String(l):l instanceof Boolean&&(l=l.valueOf()),l){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof l=="string")return z(l);if(typeof l=="number")return String(l);if(typeof l=="object")return Array.isArray(l)?x(l):M(l)}function z(p){const C={"'":.1,'"':.2},l={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let P="";for(let B=0;B<p.length;B++){const O=p[B];switch(O){case"'":case'"':C[O]++,P+=O;continue;case"\0":if(q.isDigit(p[B+1])){P+="\\x00";continue}}if(l[O]){P+=l[O];continue}if(O<" "){let uu=O.charCodeAt(0).toString(16);P+="\\x"+("00"+uu).substring(uu.length);continue}P+=O}const N=h||Object.keys(C).reduce((B,O)=>C[B]<C[O]?B:O);return P=P.replace(new RegExp(N,"g"),l[N]),N+P+N}function M(p){if(c.indexOf(p)>=0)throw TypeError("Converting circular structure to JSON5");c.push(p);let C=D;D=D+s;let l=a||Object.keys(p),P=[];for(const B of l){const O=g(B,p);if(O!==void 0){let uu=Q(B)+":";s!==""&&(uu+=" "),uu+=O,P.push(uu)}}let N;if(P.length===0)N="{}";else{let B;if(s==="")B=P.join(","),N="{"+B+"}";else{let O=`,
18
- `+D;B=P.join(O),N=`{
19
- `+D+B+`,
20
- `+C+"}"}}return c.pop(),D=C,N}function Q(p){if(p.length===0)return z(p);const C=String.fromCodePoint(p.codePointAt(0));if(!q.isIdStartChar(C))return z(p);for(let l=C.length;l<p.length;l++)if(!q.isIdContinueChar(String.fromCodePoint(p.codePointAt(l))))return z(p);return p}function x(p){if(c.indexOf(p)>=0)throw TypeError("Converting circular structure to JSON5");c.push(p);let C=D;D=D+s;let l=[];for(let N=0;N<p.length;N++){const B=g(String(N),p);l.push(B!==void 0?B:"null")}let P;if(l.length===0)P="[]";else if(s==="")P="["+l.join(",")+"]";else{let N=`,
21
- `+D,B=l.join(N);P=`[
22
- `+D+B+`,
23
- `+C+"]"}return c.pop(),D=C,P}},V={parse:ue,stringify:ie};const mu=y.createContext({refresh:()=>{},data:[]});mu.displayName="ChartQueryMetadataContext";const De=e=>{var s;const t=o.useAPIClient(),n={resource:"chartsQueries",action:"listMetadata",params:{paginate:!1,sort:["-id"]}},c=Wu.useLocation().pathname.startsWith("/admin"),D=t.auth.getToken()||"",a=o.useRequest(n,{refreshDeps:[c,D],ready:!!(c&&D)}),F=()=>J(this,null,function*(){const{data:h}=yield t.request(n);return a.mutate(h),(h==null?void 0:h.data)||[]});return a.loading?u.jsx(L.Spin,{}):u.jsx(mu.Provider,{value:{refresh:F,data:(s=a.data)==null?void 0:s.data},children:e.children})},R=()=>y.useContext(mu),fu="charts";function m(e){return o.i18n.t(e,{ns:fu})}const se={json:{type:"object",properties:{data:{title:"JSON",required:!0,"x-component":"Input.TextArea","x-validator":{json5:!0},"x-component-props":{autoSize:{maxRows:20,minRows:10}},"x-decorator":"FormItem"}}},sql:{type:"object",properties:{sql:{title:"SQL",required:!0,"x-component":"Input.TextArea","x-decorator":"FormItem","x-validator":{triggerType:"onBlur",validator:"{{validateSQL}}"},"x-component-props":{autoSize:{maxRows:20,minRows:10}}}}},api:{type:"object",properties:{api:{title:"API",required:!0,"x-component":"Input","x-decorator":"FormItem"}}}},Su=e=>lu.cloneDeep(se[e]),ae=e=>{const Q=e,{templateWrap:t,onCreateBlockSchema:n,componentType:i,createBlockSchema:c}=Q,D=cu(Q,["templateWrap","onCreateBlockSchema","componentType","createBlockSchema"]),{setVisible:a}=o.useSchemaInitializer(),F=o.useAPIClient(),s=R(),h=y.useContext(I.SchemaOptionsContext),{theme:g}=o.useGlobalTheme(),z=y.useCallback(x=>{o.FormDialog({sql:m("Add SQL query"),json:m("Add JSON query")}[x.key],()=>u.jsx("div",{children:u.jsx(o.SchemaComponentOptions,{scope:h.scope,components:b({},h.components),children:u.jsx(eu.FormLayout,{layout:"vertical",children:u.jsx(o.SchemaComponent,{schema:{type:"object",properties:{title:{title:m("Title"),required:!0,"x-component":"Input","x-decorator":"FormItem"},options:Su(x.key)}}})})})}),g).open({initialValues:{type:x.key}}).then(p=>J(this,null,function*(){var C;try{if((C=F.resource("chartsQueries"))!=null&&C.create){const{data:l}=yield F.resource("chartsQueries").create({values:p}),N=(yield s.refresh()).find(B=>{var O;return B.id===((O=l==null?void 0:l.data)==null?void 0:O.id)});n({item:N})}a(!1)}catch(l){G.error(l)}})).catch(p=>{G.error(p)})},[F,s,n,h.components,h.scope,a]),M=y.useMemo(()=>{const x=[{type:"itemGroup",title:m("Select query data"),children:[]}],p=s.data;if(p&&Array.isArray(p)){const C=p.length>0?{type:"itemGroup",title:'{{t("Select chart query", {ns: "charts"})}}',children:p}:null,l=p.length>0?{type:"divider"}:null;return[C,l,{type:"subMenu",title:m("Add chart query"),children:[{key:"sql",type:"item",title:"SQL",onClick:z},{key:"json",type:"item",title:"JSON",onClick:z}]}].filter(Boolean)}return x},[s.data,z]);return u.jsx(o.SchemaInitializerItem,U(b({icon:u.jsx(ou.TableOutlined,{})},D),{onClick:p=>J(this,[p],function*({item:x}){n({item:x}),a(!1)}),items:M}))},hu=({queryId:e,fields:t})=>{const{dataSet:n,loading:i,error:c}=zu(e),D={};if(t)for(const F of t)D[F.name]={type:"void",title:F.name,"x-component":"TableV2.Column","x-component-props":{},properties:{[F.name]:{type:"string","x-component":"Input","x-read-pretty":!0}}};const a={type:"void",properties:{input:{type:"array","x-component":"TableV2","x-component-props":{scroll:{y:300}},default:n,properties:D}}};return c?u.jsx(u.Fragment,{children:u.jsx(L.Empty,{description:u.jsx("span",{children:"May be this chart block's query data has been deleted,please check!"})})}):i?u.jsx(u.Fragment,{children:u.jsx(L.Spin,{})}):(n.forEach(F=>{for(const s in F)F[s]&&F[s]instanceof Object&&(F[s]=JSON.stringify(F[s]))}),u.jsx(o.SchemaComponentProvider,{scope:{dataSet:n},components:{TableV2:o.TableV2,Input:o.Input,FormItem:o.FormItem},children:u.jsx(o.SchemaComponent,{schema:a})}))},vu={appendPadding:10,angleField:"{{metric}}",colorField:"{{dimension}}",radius:.9,label:{type:"inner",offset:"-30%",content:"{{({percent}) => `${(percent * 100).toFixed(0)}%`}}",style:{fontSize:14,textAlign:"center"}},interactions:[{type:"element-active"}]},ce={description:"1 「Time」 or 「Order Noun」 field, 1 「Value」 field",title:"Pie",type:"Pie",iconId:"icon-pie",group:2,renderComponent:"G2Plot",defaultChartOptions:vu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Sector label / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Sector Angle / Metric",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(vu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Pie | G2Plot","https://g2plot.antv.antgroup.com/api/plots/pie")}}',"x-validator":{json5:!0}}}}}}},bu={appendPadding:10,isGroup:!0,yField:"{{dimension}}",xField:"{{metric}}",seriesField:"{{category}}",label:{position:"middle",style:{fill:"#FFFFFF",opacity:.6}},xAxis:{label:{autoHide:!0,autoRotate:!1}}},le={description:"1 「time」 or 「ordered noun」 field, 1 「value」 field, 0~ 1 「unordered noun」",type:"Bar",title:"Bar",iconId:"icon-bar",group:2,renderComponent:"G2Plot",defaultChartOptions:bu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(bu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Bar | G2Plot","https://g2plot.antv.antgroup.com/api/plots/bar")}}',"x-validator":{json5:!0}}}}}}},wu={appendPadding:10,isGroup:!0,yField:"{{metric}}",xField:"{{dimension}}",seriesField:"{{category}}",label:{position:"middle",style:{fill:"#FFFFFF",opacity:.6}},xAxis:{label:{autoHide:!0,autoRotate:!1}}},pe={description:"1 「time」 or 「ordered noun」 field, 1 「value」 field, 0 to 1 「unordered noun」",type:"Column",title:"Column",iconId:"icon-column",group:2,renderComponent:"G2Plot",defaultChartOptions:wu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(wu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Column | G2Plot","https://g2plot.antv.antgroup.com/api/plots/column")}}',"x-validator":{json5:!0}}}}}}},Iu={yField:"{{metric}}",xField:"{{dimension}}",seriesField:"{{category}}",xAxis:{},yAxis:{}},Ce={description:"1 「Time」 or 「Order Noun」 field, 1 「Value」 field",type:"Line",title:"Line",iconId:"icon-line",group:2,renderComponent:"G2Plot",defaultChartOptions:Iu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Iu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Line | G2Plot","https://g2plot.antv.antgroup.com/api/plots/line")}}',"x-validator":{json5:!0}}}}}}},Pu={yField:"{{metric}}",xField:"{{dimension}}",seriesField:"{{category}}"},de={description:"1 「time」or 「Ordered Noun」 field,1 「Numerical」 field,1 「Unordered Noun」 field (optional)",type:"Area",title:"Area",iconId:"icon-area",group:2,renderComponent:"G2Plot",defaultChartOptions:Pu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Pu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Area | G2Plot","https://g2plot.antv.antgroup.com/api/plots/area")}}',"x-validator":{json5:!0}}}}}}},Nu={appendPadding:10,xField:"{{metric}}",yField:"{{dimension}}",colorField:"{{category}}",shape:"circle",size:4,yAxis:{nice:!0,line:{style:{stroke:"#aaa"}}},xAxis:{min:-100,grid:{line:{style:{stroke:"#eee"}}},line:{style:{stroke:"#aaa"}}}},Fe={description:"1 「Numeric」 field, 0~ 1 「Unordered Noun」 field",type:"Scatter",title:"Scatter",iconId:"icon-scatter",group:2,renderComponent:"G2Plot",defaultChartOptions:Nu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Nu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Scatter | G2Plot","https://g2plot.antv.antgroup.com/api/plots/scatter")}}',"x-validator":{json5:!0}}}}}}},qu={xField:"{{dimension}}",yField:"{{metric}}",appendPadding:[0,10,0,10],xAxis:{tickLine:null},yAxis:{label:!1,grid:{alternateColor:"rgba(0, 0, 0, 0.04)"}},point:{size:2},area:{}},Ae={description:"1~ 2 「Unordered Noun」 fields, 1 「Numeric」 field",type:"Radar",title:"Radar",iconId:"icon-radar",group:1,renderComponent:"G2Plot",defaultChartOptions:qu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Branch Tags/Dimensions",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Branch Length/Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(qu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Radar | G2Plot","https://g2plot.antv.antgroup.com/api/plots/radar")}}',"x-validator":{json5:!0}}}}}}},Lu={xField:"{{dimension}}",yField:"{{metric}}",seriesField:"{{category}}",legend:!1},Ee={description:"1 「Unordered Noun」 field, 1 「Numeric」 field",type:"Funnel",title:"Funnel",iconId:"icon-funnel",group:1,renderComponent:"G2Plot",defaultChartOptions:Lu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Sector label / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Funnel Layer Width/Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Lu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Funnel | G2Plot","https://g2plot.antv.antgroup.com/api/plots/funnel")}}',"x-validator":{json5:!0}}}}}}},j=new Map;j.set("Pie",ce),j.set("Line",Ce),j.set("Area",de),j.set("Bar",le),j.set("Column",pe),j.set("Scatter",Fe),j.set("Radar",Ae),j.set("Funnel",Ee);const Ou=I.observer(e=>{const t=I.useForm();I.useField();const[n,i]=y.useState(new I.Schema({})),[c,D]=y.useState(t.values.type);return y.useEffect(()=>{var a,F;if(D((a=t==null?void 0:t.values)==null?void 0:a.type),c!==((F=t==null?void 0:t.values)==null?void 0:F.type)&&t.clearFormGraph("options.*"),t.values.type){const s=j.get(t.values.type);i(new I.Schema(s.configurableProperties||{}))}},[t.values.type]),u.jsx(I.RecursionField,{schema:n})},{displayName:"Options"}),me=e=>{const{insert:t}=o.useSchemaInitializer(),n=y.useContext(I.SchemaOptionsContext),i=o.useAPIClient(),c=o.useCompile(),{theme:D}=o.useGlobalTheme();return u.jsx(ae,U(b({},e),{componentType:"Charts",onCreateBlockSchema:F=>J(this,[F],function*({item:a}){const s=a==null?void 0:a.fields.map(g=>({label:g.name,value:g.name})),h=yield o.FormDialog({okText:c('{{t("Submit")}}'),title:m("Create chart block"),width:1200,bodyStyle:{background:"var(--nb-box-bg)",maxHeight:"65vh",overflow:"auto"}},function(){var x,p;const z=I.useForm(),[M,Q]=y.useState(null);return y.useEffect(()=>{const C={query:{id:a==null?void 0:a.id},chart:z.values};Q(C)},[z.values.type]),u.jsx(o.APIClientProvider,{apiClient:i,children:u.jsx(o.SchemaComponentOptions,{scope:n.scope,components:b({},n.components),children:u.jsxs("section",{className:o.css`
17
+ `&&r(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw v(r());case void 0:throw v(r())}return r()}function oe(){let e="",t=H();if(!q.isHexDigit(t)||(e+=r(),t=H(),!q.isHexDigit(t)))throw v(r());return e+=r(),String.fromCodePoint(parseInt(e,16))}function Au(){let e="",t=4;for(;t-- >0;){const n=H();if(!q.isHexDigit(n))throw v(r());e+=r()}return String.fromCodePoint(parseInt(e,16))}const ne={start(){if(k.type==="eof")throw X();Eu()},beforePropertyName(){switch(k.type){case"identifier":case"string":du=k.value,T="afterPropertyName";return;case"punctuator":Du();return;case"eof":throw X()}},afterPropertyName(){if(k.type==="eof")throw X();T="beforePropertyValue"},beforePropertyValue(){if(k.type==="eof")throw X();Eu()},beforeArrayValue(){if(k.type==="eof")throw X();if(k.type==="punctuator"&&k.value==="]"){Du();return}Eu()},afterPropertyValue(){if(k.type==="eof")throw X();switch(k.value){case",":T="beforePropertyName";return;case"}":Du()}},afterArrayValue(){if(k.type==="eof")throw X();switch(k.value){case",":T="beforeArrayValue";return;case"]":Du()}},end(){}};function Eu(){let e;switch(k.type){case"punctuator":switch(k.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=k.value;break}if(tu===void 0)tu=e;else{const t=_[_.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,du,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")_.push(e),Array.isArray(e)?T="beforeArrayValue":T="beforePropertyName";else{const t=_[_.length-1];t==null?T="end":Array.isArray(t)?T="afterArrayValue":T="afterPropertyValue"}}function Du(){_.pop();const e=_[_.length-1];e==null?T="end":Array.isArray(e)?T="afterArrayValue":T="afterPropertyValue"}function v(e){return su(e===void 0?`JSON5: invalid end of input at ${K}:${$}`:`JSON5: invalid character '${Su(e)}' at ${K}:${$}`)}function X(){return su(`JSON5: invalid end of input at ${K}:${$}`)}function xu(){return $-=5,su(`JSON5: invalid identifier character at ${K}:${$}`)}function ie(e){console.warn(`JSON5: '${Su(e)}' in strings is not valid ECMAScript; consider escaping`)}function Su(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function su(e){const t=new SyntaxError(e);return t.lineNumber=K,t.columnNumber=$,t}var De=function(t,n,i){const a=[];let D="",c,F,s="",m;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,m=n.quote,n=n.replacer),typeof n=="function")F=n;else if(Array.isArray(n)){c=[];for(const p of n){let C;typeof p=="string"?C=p:(typeof p=="number"||p instanceof String||p instanceof Number)&&(C=String(p)),C!==void 0&&c.indexOf(C)<0&&c.push(C)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),s=" ".substr(0,i)):typeof i=="string"&&(s=i.substr(0,10)),g("",{"":t});function g(p,C){let l=C[p];switch(l!=null&&(typeof l.toJSON5=="function"?l=l.toJSON5(p):typeof l.toJSON=="function"&&(l=l.toJSON(p))),F&&(l=F.call(C,p,l)),l instanceof Number?l=Number(l):l instanceof String?l=String(l):l instanceof Boolean&&(l=l.valueOf()),l){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof l=="string")return z(l);if(typeof l=="number")return String(l);if(typeof l=="object")return Array.isArray(l)?x(l):M(l)}function z(p){const C={"'":.1,'"':.2},l={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let P="";for(let y=0;y<p.length;y++){const O=p[y];switch(O){case"'":case'"':C[O]++,P+=O;continue;case"\0":if(q.isDigit(p[y+1])){P+="\\x00";continue}}if(l[O]){P+=l[O];continue}if(O<" "){let uu=O.charCodeAt(0).toString(16);P+="\\x"+("00"+uu).substring(uu.length);continue}P+=O}const N=m||Object.keys(C).reduce((y,O)=>C[y]<C[O]?y:O);return P=P.replace(new RegExp(N,"g"),l[N]),N+P+N}function M(p){if(a.indexOf(p)>=0)throw TypeError("Converting circular structure to JSON5");a.push(p);let C=D;D=D+s;let l=c||Object.keys(p),P=[];for(const y of l){const O=g(y,p);if(O!==void 0){let uu=Q(y)+":";s!==""&&(uu+=" "),uu+=O,P.push(uu)}}let N;if(P.length===0)N="{}";else{let y;if(s==="")y=P.join(","),N="{"+y+"}";else{let O=`,
18
+ `+D;y=P.join(O),N=`{
19
+ `+D+y+`,
20
+ `+C+"}"}}return a.pop(),D=C,N}function Q(p){if(p.length===0)return z(p);const C=String.fromCodePoint(p.codePointAt(0));if(!q.isIdStartChar(C))return z(p);for(let l=C.length;l<p.length;l++)if(!q.isIdContinueChar(String.fromCodePoint(p.codePointAt(l))))return z(p);return p}function x(p){if(a.indexOf(p)>=0)throw TypeError("Converting circular structure to JSON5");a.push(p);let C=D;D=D+s;let l=[];for(let N=0;N<p.length;N++){const y=g(String(N),p);l.push(y!==void 0?y:"null")}let P;if(l.length===0)P="[]";else if(s==="")P="["+l.join(",")+"]";else{let N=`,
21
+ `+D,y=l.join(N);P=`[
22
+ `+D+y+`,
23
+ `+C+"]"}return a.pop(),D=C,P}},V={parse:ee,stringify:De};const mu=B.createContext({refresh:()=>{},data:[]});mu.displayName="ChartQueryMetadataContext";const fu={resource:"chartsQueries",action:"listMetadata",params:{paginate:!1,sort:["-id"]}},se=e=>{var s;const t=o.useAPIClient(),i=Xu.useLocation().pathname.startsWith("/admin"),a=t.auth.getToken()||"",D=o.useRequest(fu,{refreshDeps:[i,a],ready:!!(i&&a)}),c=B.useCallback(()=>J(this,null,function*(){const{data:m}=yield t.request(fu);return D.mutate(m),(m==null?void 0:m.data)||[]}),[fu,D]),F=B.useMemo(()=>{var m;return{refresh:c,data:(m=D.data)==null?void 0:m.data}},[(s=D.data)==null?void 0:s.data,c]);return D.loading?u.jsx(L.Spin,{}):u.jsx(mu.Provider,{value:F,children:e.children})},R=()=>B.useContext(mu),hu="charts";function f(e){return o.i18n.t(e,{ns:hu})}const ae={json:{type:"object",properties:{data:{title:"JSON",required:!0,"x-component":"Input.TextArea","x-validator":{json5:!0},"x-component-props":{autoSize:{maxRows:20,minRows:10}},"x-decorator":"FormItem"}}},sql:{type:"object",properties:{sql:{title:"SQL",required:!0,"x-component":"Input.TextArea","x-decorator":"FormItem","x-validator":{triggerType:"onBlur",validator:"{{validateSQL}}"},"x-component-props":{autoSize:{maxRows:20,minRows:10}}}}},api:{type:"object",properties:{api:{title:"API",required:!0,"x-component":"Input","x-decorator":"FormItem"}}}},vu=e=>lu.cloneDeep(ae[e]),ce=e=>{const Q=e,{templateWrap:t,onCreateBlockSchema:n,componentType:i,createBlockSchema:a}=Q,D=cu(Q,["templateWrap","onCreateBlockSchema","componentType","createBlockSchema"]),{setVisible:c}=o.useSchemaInitializer(),F=o.useAPIClient(),s=R(),m=B.useContext(I.SchemaOptionsContext),{theme:g}=o.useGlobalTheme(),z=B.useCallback(x=>{o.FormDialog({sql:f("Add SQL query"),json:f("Add JSON query")}[x.key],()=>u.jsx("div",{children:u.jsx(o.SchemaComponentOptions,{scope:m.scope,components:b({},m.components),children:u.jsx(eu.FormLayout,{layout:"vertical",children:u.jsx(o.SchemaComponent,{schema:{type:"object",properties:{title:{title:f("Title"),required:!0,"x-component":"Input","x-decorator":"FormItem"},options:vu(x.key)}}})})})}),g).open({initialValues:{type:x.key}}).then(p=>J(this,null,function*(){var C;try{if((C=F.resource("chartsQueries"))!=null&&C.create){const{data:l}=yield F.resource("chartsQueries").create({values:p}),N=(yield s.refresh()).find(y=>{var O;return y.id===((O=l==null?void 0:l.data)==null?void 0:O.id)});n({item:N})}c(!1)}catch(l){G.error(l)}})).catch(p=>{G.error(p)})},[F,s,n,m.components,m.scope,c]),M=B.useMemo(()=>{const x=[{type:"itemGroup",title:f("Select query data"),children:[]}],p=s.data;if(p&&Array.isArray(p)){const C=p.length>0?{type:"itemGroup",title:'{{t("Select chart query", {ns: "charts"})}}',children:p}:null,l=p.length>0?{type:"divider"}:null;return[C,l,{type:"subMenu",title:f("Add chart query"),children:[{key:"sql",type:"item",title:"SQL",onClick:z},{key:"json",type:"item",title:"JSON",onClick:z}]}].filter(Boolean)}return x},[s.data,z]);return u.jsx(o.SchemaInitializerItem,U(b({icon:u.jsx(ou.TableOutlined,{})},D),{onClick:p=>J(this,[p],function*({item:x}){n({item:x}),c(!1)}),items:M}))},Bu=({queryId:e,fields:t})=>{const{dataSet:n,loading:i,error:a}=Mu(e),D={};if(t)for(const F of t)D[F.name]={type:"void",title:F.name,"x-component":"TableV2.Column","x-component-props":{},properties:{[F.name]:{type:"string","x-component":"Input","x-read-pretty":!0}}};const c={type:"void",properties:{input:{type:"array","x-component":"TableV2","x-component-props":{scroll:{y:300}},default:n,properties:D}}};return a?u.jsx(u.Fragment,{children:u.jsx(L.Empty,{description:u.jsx("span",{children:"May be this chart block's query data has been deleted,please check!"})})}):i?u.jsx(u.Fragment,{children:u.jsx(L.Spin,{})}):(n.forEach(F=>{for(const s in F)F[s]&&F[s]instanceof Object&&(F[s]=JSON.stringify(F[s]))}),u.jsx(o.SchemaComponentProvider,{scope:{dataSet:n},components:{TableV2:o.TableV2,Input:o.Input,FormItem:o.FormItem},children:u.jsx(o.SchemaComponent,{schema:c})}))},bu={appendPadding:10,angleField:"{{metric}}",colorField:"{{dimension}}",radius:.9,label:{type:"inner",offset:"-30%",content:"{{({percent}) => `${(percent * 100).toFixed(0)}%`}}",style:{fontSize:14,textAlign:"center"}},interactions:[{type:"element-active"}]},le={description:"1 「Time」 or 「Order Noun」 field, 1 「Value」 field",title:"Pie",type:"Pie",iconId:"icon-pie",group:2,renderComponent:"G2Plot",defaultChartOptions:bu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Sector label / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Sector Angle / Metric",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(bu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Pie | G2Plot","https://g2plot.antv.antgroup.com/api/plots/pie")}}',"x-validator":{json5:!0}}}}}}},wu={appendPadding:10,isGroup:!0,yField:"{{dimension}}",xField:"{{metric}}",seriesField:"{{category}}",label:{position:"middle",style:{fill:"#FFFFFF",opacity:.6}},xAxis:{label:{autoHide:!0,autoRotate:!1}}},pe={description:"1 「time」 or 「ordered noun」 field, 1 「value」 field, 0~ 1 「unordered noun」",type:"Bar",title:"Bar",iconId:"icon-bar",group:2,renderComponent:"G2Plot",defaultChartOptions:wu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(wu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Bar | G2Plot","https://g2plot.antv.antgroup.com/api/plots/bar")}}',"x-validator":{json5:!0}}}}}}},Iu={appendPadding:10,isGroup:!0,yField:"{{metric}}",xField:"{{dimension}}",seriesField:"{{category}}",label:{position:"middle",style:{fill:"#FFFFFF",opacity:.6}},xAxis:{label:{autoHide:!0,autoRotate:!1}}},Ce={description:"1 「time」 or 「ordered noun」 field, 1 「value」 field, 0 to 1 「unordered noun」",type:"Column",title:"Column",iconId:"icon-column",group:2,renderComponent:"G2Plot",defaultChartOptions:Iu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Iu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Column | G2Plot","https://g2plot.antv.antgroup.com/api/plots/column")}}',"x-validator":{json5:!0}}}}}}},Pu={yField:"{{metric}}",xField:"{{dimension}}",seriesField:"{{category}}",xAxis:{},yAxis:{}},de={description:"1 「Time」 or 「Order Noun」 field, 1 「Value」 field",type:"Line",title:"Line",iconId:"icon-line",group:2,renderComponent:"G2Plot",defaultChartOptions:Pu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Pu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Line | G2Plot","https://g2plot.antv.antgroup.com/api/plots/line")}}',"x-validator":{json5:!0}}}}}}},Nu={yField:"{{metric}}",xField:"{{dimension}}",seriesField:"{{category}}"},Fe={description:"1 「time」or 「Ordered Noun」 field,1 「Numerical」 field,1 「Unordered Noun」 field (optional)",type:"Area",title:"Area",iconId:"icon-area",group:2,renderComponent:"G2Plot",defaultChartOptions:Nu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Nu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Area | G2Plot","https://g2plot.antv.antgroup.com/api/plots/area")}}',"x-validator":{json5:!0}}}}}}},qu={appendPadding:10,xField:"{{metric}}",yField:"{{dimension}}",colorField:"{{category}}",shape:"circle",size:4,yAxis:{nice:!0,line:{style:{stroke:"#aaa"}}},xAxis:{min:-100,grid:{line:{style:{stroke:"#eee"}}},line:{style:{stroke:"#aaa"}}}},Ae={description:"1 「Numeric」 field, 0~ 1 「Unordered Noun」 field",type:"Scatter",title:"Scatter",iconId:"icon-scatter",group:2,renderComponent:"G2Plot",defaultChartOptions:qu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Category axis / Dimension",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Value axis / Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(qu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Scatter | G2Plot","https://g2plot.antv.antgroup.com/api/plots/scatter")}}',"x-validator":{json5:!0}}}}}}},Lu={xField:"{{dimension}}",yField:"{{metric}}",appendPadding:[0,10,0,10],xAxis:{tickLine:null},yAxis:{label:!1,grid:{alternateColor:"rgba(0, 0, 0, 0.04)"}},point:{size:2},area:{}},Ee={description:"1~ 2 「Unordered Noun」 fields, 1 「Numeric」 field",type:"Radar",title:"Radar",iconId:"icon-radar",group:1,renderComponent:"G2Plot",defaultChartOptions:Lu,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Branch Tags/Dimensions",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Branch Length/Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Lu,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Radar | G2Plot","https://g2plot.antv.antgroup.com/api/plots/radar")}}',"x-validator":{json5:!0}}}}}}},Ou={xField:"{{dimension}}",yField:"{{metric}}",seriesField:"{{category}}",legend:!1},me={description:"1 「Unordered Noun」 field, 1 「Numeric」 field",type:"Funnel",title:"Funnel",iconId:"icon-funnel",group:1,renderComponent:"G2Plot",defaultChartOptions:Ou,configurableProperties:{type:"void",properties:{dimension:{required:!0,type:"string",title:'{{t("Sector label / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},metric:{required:!0,type:"string",title:'{{t("Funnel Layer Width/Metrics",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},category:{type:"string",title:'{{t("Color legend / Dimensional",{ns:"charts"})}}',"x-decorator":"FormItem","x-component":"Select",enum:"{{dataSource}}"},jsonConfig:{type:"void","x-component":"div",properties:{template:{required:!0,title:'{{t("JSON config",{ns:"charts"})}}',type:"string",default:V.stringify(Ou,null,2),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:8,maxRows:16}},description:'{{jsonConfigDesc("Funnel | G2Plot","https://g2plot.antv.antgroup.com/api/plots/funnel")}}',"x-validator":{json5:!0}}}}}}},j=new Map;j.set("Pie",le),j.set("Line",de),j.set("Area",Fe),j.set("Bar",pe),j.set("Column",Ce),j.set("Scatter",Ae),j.set("Radar",Ee),j.set("Funnel",me);const ku=I.observer(e=>{const t=I.useForm();I.useField();const[n,i]=B.useState(new I.Schema({})),[a,D]=B.useState(t.values.type);return B.useEffect(()=>{var c,F;if(D((c=t==null?void 0:t.values)==null?void 0:c.type),a!==((F=t==null?void 0:t.values)==null?void 0:F.type)&&t.clearFormGraph("options.*"),t.values.type){const s=j.get(t.values.type);i(new I.Schema(s.configurableProperties||{}))}},[t.values.type]),u.jsx(I.RecursionField,{schema:n})},{displayName:"Options"}),fe=e=>{const{insert:t}=o.useSchemaInitializer(),n=B.useContext(I.SchemaOptionsContext),i=o.useAPIClient(),a=o.useCompile(),{theme:D}=o.useGlobalTheme();return u.jsx(ce,U(b({},e),{componentType:"Charts",onCreateBlockSchema:F=>J(this,[F],function*({item:c}){const s=c==null?void 0:c.fields.map(g=>({label:g.name,value:g.name})),m=yield o.FormDialog({okText:a('{{t("Submit")}}'),title:f("Create chart block"),width:1200,bodyStyle:{background:"var(--nb-box-bg)",maxHeight:"65vh",overflow:"auto"}},function(){var x,p;const z=I.useForm(),[M,Q]=B.useState(null);return B.useEffect(()=>{const C={query:{id:c==null?void 0:c.id},chart:z.values};Q(C)},[z.values.type]),u.jsx(o.APIClientProvider,{apiClient:i,children:u.jsx(o.SchemaComponentOptions,{scope:n.scope,components:b({},n.components),children:u.jsxs("section",{className:o.css`
24
24
  display: flex;
25
25
  gap: 24px;
26
- `,children:[u.jsx(L.Card,{title:m("Chart config"),size:"default",className:o.css`
26
+ `,children:[u.jsx(L.Card,{title:f("Chart config"),size:"default",className:o.css`
27
27
  flex: 1;
28
- `,children:u.jsx(o.FormProvider,{form:z,children:u.jsx(eu.FormLayout,{layout:"vertical",children:u.jsx(o.SchemaComponent,{scope:{dataSource:s,JSON5:V,jsonConfigDesc:ku},components:{Options:Ou},schema:{properties:{type:{title:m("Chart type"),required:!0,"x-component":"CustomSelect","x-decorator":"FormItem",enum:[...j.values()].map(C=>({title:C.title,key:C.type,description:C.description,group:C.group,iconId:C.iconId}))},options:{type:"void","x-component":"Options"}}}})})})}),u.jsxs("div",{className:o.css`
28
+ `,children:u.jsx(o.FormProvider,{form:z,children:u.jsx(eu.FormLayout,{layout:"vertical",children:u.jsx(o.SchemaComponent,{scope:{dataSource:s,JSON5:V,jsonConfigDesc:zu},components:{Options:ku},schema:{properties:{type:{title:f("Chart type"),required:!0,"x-component":"CustomSelect","x-decorator":"FormItem",enum:[...j.values()].map(C=>({title:C.title,key:C.type,description:C.description,group:C.group,iconId:C.iconId}))},options:{type:"void","x-component":"Options"}}}})})})}),u.jsxs("div",{className:o.css`
29
29
  flex: 1;
30
30
  min-width: 600px;
31
- `,children:[u.jsx(L.Card,{size:"default",title:m("Chart preview"),children:M&&u.jsx(u.Fragment,{children:u.jsx(o.SchemaComponent,{schema:{properties:{chartPreview:{type:"void","x-decorator":"CardItem","x-component":"ChartBlockEngine","x-component-props":{chartBlockEngineMetaData:M}}}}})})}),u.jsx(L.Card,{size:"default",title:m("Data preview"),className:o.css`
31
+ `,children:[u.jsx(L.Card,{size:"default",title:f("Chart preview"),children:M&&u.jsx(u.Fragment,{children:u.jsx(o.SchemaComponent,{schema:{properties:{chartPreview:{type:"void","x-decorator":"CardItem","x-component":"ChartBlockEngine","x-component-props":{chartBlockEngineMetaData:M}}}}})})}),u.jsx(L.Card,{size:"default",title:f("Data preview"),className:o.css`
32
32
  margin-top: 24px;
33
33
  overflow: scroll;
34
- `,children:((x=M==null?void 0:M.query)==null?void 0:x.id)&&u.jsx(hu,{queryId:(p=M==null?void 0:M.query)==null?void 0:p.id,fields:a==null?void 0:a.fields})})]})]})})})},D).open({initialValues:{}});if(h){const g={query:{id:a.id},chart:h};t({type:"void",title:h==null?void 0:h.title,"x-designer":"ChartBlockEngine.Designer","x-decorator":"CardItem","x-component":"ChartBlockEngine","x-component-props":{chartBlockEngineMetaData:g}})}})}))},fe=e=>{const[t,n]=y.useState([]),i=R();return y.useEffect(()=>{const c=i==null?void 0:i.data;if(c&&Array.isArray(c)){const D=c.find(a=>a.id===e);n((D==null?void 0:D.fields)||[])}},[e]),{fields:t}},ku=(e,t)=>u.jsxs("span",{children:[m("Json config references: "),u.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:m(e)})]}),he=()=>{const e=I.useFieldSchema(),{chartBlockEngineMetaData:t}=(e==null?void 0:e["x-component-props"])||{};return u.jsxs(o.GeneralSchemaDesigner,{children:[u.jsx(Be,{chartBlockEngineMetaData:t}),u.jsx(o.SchemaSettingsDivider,{}),u.jsx(o.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})},Be=e=>{const{chartBlockEngineMetaData:t}=e,{t:n}=Y.useTranslation(),i=y.useContext(I.SchemaOptionsContext),{dn:c}=o.useDesignable(),D=I.useFieldSchema(),a=o.useAPIClient(),F=I.useField(),s=o.useCompile(),{chart:h,query:g}=t,{fields:z}=fe(g.id),{theme:M}=o.useGlobalTheme(),Q=z.map(x=>({label:x.name,value:x.name}));return u.jsx(o.SchemaSettingsItem,{title:e.title||"Edit chart block",onClick:()=>J(this,null,function*(){o.FormDialog({okText:s('{{t("Submit")}}'),title:m("Edit chart block"),width:1200,bodyStyle:{background:"var(--nb-box-bg)",maxHeight:"65vh",overflow:"auto"}},function(p){var P,N;const[C,l]=y.useState(null);return y.useEffect(()=>{const B={query:{id:g==null?void 0:g.id},chart:p.values};l(B)},[p.values.type]),u.jsx(o.APIClientProvider,{apiClient:a,children:u.jsx(o.SchemaComponentOptions,{scope:i.scope,components:b({},i.components),children:u.jsxs("section",{className:o.css`
34
+ `,children:((x=M==null?void 0:M.query)==null?void 0:x.id)&&u.jsx(Bu,{queryId:(p=M==null?void 0:M.query)==null?void 0:p.id,fields:c==null?void 0:c.fields})})]})]})})})},D).open({initialValues:{}});if(m){const g={query:{id:c.id},chart:m};t({type:"void",title:m==null?void 0:m.title,"x-designer":"ChartBlockEngine.Designer","x-decorator":"CardItem","x-component":"ChartBlockEngine","x-component-props":{chartBlockEngineMetaData:g}})}})}))},he=e=>{const[t,n]=B.useState([]),i=R();return B.useEffect(()=>{const a=i==null?void 0:i.data;if(a&&Array.isArray(a)){const D=a.find(c=>c.id===e);n((D==null?void 0:D.fields)||[])}},[e]),{fields:t}},zu=(e,t)=>u.jsxs("span",{children:[f("Json config references: "),u.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:f(e)})]}),Be=()=>{const e=I.useFieldSchema(),{chartBlockEngineMetaData:t}=(e==null?void 0:e["x-component-props"])||{};return u.jsxs(o.GeneralSchemaDesigner,{children:[u.jsx(ye,{chartBlockEngineMetaData:t}),u.jsx(o.SchemaSettingsDivider,{}),u.jsx(o.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})},ye=e=>{const{chartBlockEngineMetaData:t}=e,{t:n}=Y.useTranslation(),i=B.useContext(I.SchemaOptionsContext),{dn:a}=o.useDesignable(),D=I.useFieldSchema(),c=o.useAPIClient(),F=I.useField(),s=o.useCompile(),{chart:m,query:g}=t,{fields:z}=he(g.id),{theme:M}=o.useGlobalTheme(),Q=z.map(x=>({label:x.name,value:x.name}));return u.jsx(o.SchemaSettingsItem,{title:e.title||"Edit chart block",onClick:()=>J(this,null,function*(){o.FormDialog({okText:s('{{t("Submit")}}'),title:f("Edit chart block"),width:1200,bodyStyle:{background:"var(--nb-box-bg)",maxHeight:"65vh",overflow:"auto"}},function(p){var P,N;const[C,l]=B.useState(null);return B.useEffect(()=>{const y={query:{id:g==null?void 0:g.id},chart:p.values};l(y)},[p.values.type]),u.jsx(o.APIClientProvider,{apiClient:c,children:u.jsx(o.SchemaComponentOptions,{scope:i.scope,components:b({},i.components),children:u.jsxs("section",{className:o.css`
35
35
  display: flex;
36
36
  gap: 24px;
37
37
  `,children:[u.jsx(L.Card,{bordered:!1,title:o.i18n.t("Chart config"),size:"default",className:o.css`
38
38
  flex: 1;
39
- `,children:u.jsx(eu.FormLayout,{layout:"vertical",children:u.jsx(o.SchemaComponent,{scope:{dataSource:Q,JSON5:V,jsonConfigDesc:ku},components:{Options:Ou},schema:{properties:{type:{title:n("Chart type"),required:!0,"x-component":"CustomSelect","x-decorator":"FormItem",enum:[...j.values()].map(B=>({title:B.title,key:B.type,description:B.description,group:B.group,iconId:B.iconId}))},options:{type:"void","x-component":"Options"}}}})})}),u.jsxs("div",{className:o.css`
39
+ `,children:u.jsx(eu.FormLayout,{layout:"vertical",children:u.jsx(o.SchemaComponent,{scope:{dataSource:Q,JSON5:V,jsonConfigDesc:zu},components:{Options:ku},schema:{properties:{type:{title:n("Chart type"),required:!0,"x-component":"CustomSelect","x-decorator":"FormItem",enum:[...j.values()].map(y=>({title:y.title,key:y.type,description:y.description,group:y.group,iconId:y.iconId}))},options:{type:"void","x-component":"Options"}}}})})}),u.jsxs("div",{className:o.css`
40
40
  flex: 1;
41
41
  min-width: 600px;
42
- `,children:[u.jsx(L.Card,{size:"default",title:m("Chart preview"),children:C&&u.jsx(u.Fragment,{children:u.jsx(o.SchemaComponent,{schema:{properties:{chartPreview:{type:"void","x-decorator":"CardItem","x-component":"ChartBlockEngine","x-component-props":{chartBlockEngineMetaData:C}}}}})})}),u.jsx(L.Card,{size:"default",title:m("Data preview"),className:o.css`
42
+ `,children:[u.jsx(L.Card,{size:"default",title:f("Chart preview"),children:C&&u.jsx(u.Fragment,{children:u.jsx(o.SchemaComponent,{schema:{properties:{chartPreview:{type:"void","x-decorator":"CardItem","x-component":"ChartBlockEngine","x-component-props":{chartBlockEngineMetaData:C}}}}})})}),u.jsx(L.Card,{size:"default",title:f("Data preview"),className:o.css`
43
43
  margin-top: 24px;
44
44
  overflow: scroll;
45
- `,children:((P=C==null?void 0:C.query)==null?void 0:P.id)&&u.jsx(hu,{queryId:(N=C==null?void 0:C.query)==null?void 0:N.id,fields:z})})]})]})})})},M).open({initialValues:b({},h)}).then(x=>{x={query:g,chart:x},F.title=x.chart.title,D.title=x.chart.title,F.componentProps.chartBlockEngineMetaData=x,lu.set(D,"x-component-props.chartBlockEngineMetaData",x),c.emit("patch",{schema:{"x-uid":D["x-uid"],"x-component-props":D["x-component-props"]}}),c.refresh()}).catch(x=>{G.error(x)})}),children:e.children||e.title||m("Edit chart block")})},Bu=new Map;Bu.set("G2Plot",o.G2Plot),Bu.set("DataSetPreviewTable",hu);const ye=({chartBlockEngineMetaData:e})=>{var z,M,Q;const t=o.useCompile(),n=e.chart.type,i=(z=j.get(n))==null?void 0:z.renderComponent,c=Bu.get(i),D=e.chart,{loading:a,dataSet:F,error:s}=zu(e.query.id),[h,g]=y.useState({});if(y.useEffect(()=>{g(D)},[JSON.stringify(D)]),s)return u.jsx(u.Fragment,{children:u.jsx(L.Empty,{description:u.jsx("span",{children:"May be this chart block's query data has been deleted,please check!"})})});if(h.type!==D.type)return u.jsx(u.Fragment,{});switch(i){case"G2Plot":{const x=(M=j.get(n))==null?void 0:M.defaultChartOptions;let p;try{p=V.parse(D==null?void 0:D.template)}catch(l){p={}}const C=t(U(b(b({},x),p),{data:F}),U(b({},D),{category:(Q=D==null?void 0:D.category)!=null?Q:""}));if(C&&D){const{dimension:l,metric:P,category:N}=D;if(!P||!l)return u.jsx(u.Fragment,{children:m("Please check the chart config")})}return u.jsx(u.Fragment,{children:a?u.jsx(L.Spin,{}):u.jsx(c,{plot:D.type,config:C})})}}return u.jsx(u.Fragment,{})},zu=e=>{const{data:t,loading:n,error:i}=o.useRequest({url:`/chartsQueries:getData/${e}`}),c=t==null?void 0:t.data;return{loading:n,dataSet:c,error:i}},Mu=({chartBlockEngineMetaData:e})=>{var i,c;let t;const n=(i=e==null?void 0:e.chart)==null?void 0:i.type;return n&&(t=(c=j.get(n))==null?void 0:c.renderComponent),!n||!t?u.jsx(u.Fragment,{children:m("Please check the chart config")}):u.jsx(u.Fragment,{children:u.jsx(ye,{chartBlockEngineMetaData:e})})};Mu.Designer=he;const ge=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M523 573.5c-3.9 0.7-7.9 1.1-12 1.1-5.3 0-10.4-0.6-15.2-1.8l-62.2 189.7 167.4-76L523 573.5z"}),u.jsx("path",{d:"M398.3 767.3l68.9-210.1c-6.4-6-11.5-13.3-15-21.4l-192.6 52.7L398.3 767.3z"}),u.jsx("path",{d:"M528 448.9c4.1 1.1 8 2.6 11.7 4.5l72.5-61.8L528 263.7 528 448.9z"}),u.jsx("path",{d:"M259.6 555.4 447.3 504c0.4-4.2 1.3-8.3 2.5-12.2L270.9 373.4 259.6 555.4z"}),u.jsx("path",{d:"M655.5 396.7l208.3 185.7 30.2 4.8c4.8-24.6 7.4-49.9 7.4-75.9 0-95.9-34.6-183.7-92-251.6L655.5 396.7z"}),u.jsx("path",{d:"M794.4 563.4 630.9 417.7l-67 57.1c5.6 8.3 9.3 18 10.6 28.4L794.4 563.4z"}),u.jsx("path",{d:"M496 448.4 496 239.6l-218.8 99.6 189.4 125.4C474.7 456.8 484.8 451.1 496 448.4z"}),u.jsx("path",{d:"M619.3 713.3 420 803.8l-19.1 81.6c35 10.3 72.1 15.9 110.4 15.9 74.4 0 143.9-20.8 203-56.9L619.3 713.3z"}),u.jsx("path",{d:"M648.7 699.5l92.3 127.2c63.3-46.2 112.2-111 138.6-186.4L648.7 699.5z"}),u.jsx("path",{d:"M386.2 804 226.1 597.7l-87.9 27.4c34.9 114.7 121.3 207 232.2 250L386.2 804z"}),u.jsx("path",{d:"M226.9 564.3 240.2 353l-64.4-40.5c-34.6 58.2-54.4 126.2-54.4 198.8 0 28.4 3 56.2 8.8 82.9L226.9 564.3z"}),u.jsx("path",{d:"M842.8 609.8l-272.7-74.7c-4 9.5-10.1 17.9-17.9 24.4l77.3 112.1L842.8 609.8z"}),u.jsx("path",{d:"M528 205.4l108.8 165.2 151-134.5c-67-67.3-158.4-110.2-259.7-114.5L528.1 205.4z"}),u.jsx("path",{d:"M245.7 318.4l250.3-114 0-82.8c-125 4.8-234.8 68.5-302.8 164L245.7 318.4z"})]}),xe=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M533.6 784.5c6.6 16.4-1.3 35-17.6 41.7l0 0c-16.4 6.6-35-1.3-41.7-17.6L129.9 236c-6.6-16.4 1.3-35 17.6-41.7l0 0c16.4-6.6 35 1.3 41.7 17.6L533.6 784.5z"}),u.jsx("path",{d:"M536 812.2c-6.9 16.3-25.7 23.9-41.9 17l0 0c-16.3-6.9-23.9-25.7-17-41.9l357.6-575.7c6.9-16.3 25.7-23.9 41.9-17l0 0c16.3 6.9 23.9 25.7 17 41.9L536 812.2z"}),u.jsx("path",{d:"M895.4 224c0 17.7-14.3 32-32 32l-704 0c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l704 0C881 192 895.4 206.3 895.4 224L895.4 224z"}),u.jsx("path",{d:"M278.6 384l465 0 0 64-465 0 0-64Z"}),u.jsx("path",{d:"M391.6 576l232.5 0 0 64-232.5 0 0-64Z"})]}),Se=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M745.6 765.9"}),u.jsx("path",{d:"M307.6 244.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M560 479.2m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M391.9 387.7m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M540.4 244.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M732.9 292.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M792.9 717.9m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M307.6 527.2m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M439.9 662.4m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"})]}),ve=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M745.6 765.9"}),u.jsx("path",{d:"M342.1 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L278.7 489c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L342.1 734.3z"}),u.jsx("path",{d:"M493.8 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L430.4 387c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L493.8 734.3z"}),u.jsx("path",{d:"M797.3 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L733.9 234.5c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L797.3 734.3z"}),u.jsx("path",{d:"M645.5 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7l0-97.2c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L645.5 734.3z"})]}),be=()=>u.jsx("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:u.jsx("path",{d:"M131.072 156.16c0-17.92 14.336-31.744 31.744-31.744 17.92 0 31.744 14.336 31.744 31.744v712.192c0 17.92-14.336 31.744-31.744 31.744-17.92 0-31.744-14.336-31.744-31.744V156.16zM292.864 338.944c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h245.248c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-245.248zM292.864 490.496c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744H640c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-347.136zM292.864 794.112c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h499.712c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-499.712zM292.864 642.56c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h97.28c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-97.28z"})}),we=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M307.1 686.3c-12.4 12.4-32.4 12.4-44.8 0l0 0c-12.4-12.4-12.4-32.4 0-44.8l173.4-173.4c12.4-12.4 32.4-12.4 44.8 0l0 0c12.4 12.4 12.4 32.4 0 44.8L307.1 686.3z"}),u.jsx("path",{d:"M608.8 640c-12.4 12.4-32.4 12.4-44.8 0l0 0c-12.4-12.4-12.4-32.4 0-44.8l212.7-212.7c12.4-12.4 32.4-12.4 44.8 0l0 0c12.4 12.4 12.4 32.4 0 44.8L608.8 640z"}),u.jsx("path",{d:"M608 595.3c12.4 12.4 12.4 32.4 0 44.8l0 0c-12.4 12.4-32.4 12.4-44.8 0L436 512.8c-12.4-12.4-12.4-32.4 0-44.8l0 0c12.4-12.4 32.4-12.4 44.8 0L608 595.3z"})]}),Ie=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M489.7 511 489 511 489 126.9c-201 12.3-360.1 179.2-360.1 383.3 0 212.1 171.9 384 384 384 106.5 0 202.9-43.4 272.5-113.4L489.7 511z"}),u.jsx("path",{d:"M773.1 237.2l6-6c-62.7-59.6-143.5-95.8-228.2-104l0 304.7L773.1 237.2z"}),u.jsx("path",{d:"M819.5 281.6 564.1 505.1 822 739c3-4 5.9-8.1 8.7-12.3 41.4-61.3 65.6-135.2 65.6-214.7C896.3 425.6 867.7 345.8 819.5 281.6z"})]}),Pe=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M830.6 338.2 830.6 338.2c0.9-9.2-2.1-18.6-9.1-25.7-12.4-12.4-32.4-12.4-44.8 0L586 503.3 480.8 398.1c-6.2-6.2-14.4-9.3-22.5-9.3-8.1 0-16.3 3.1-22.5 9.3L262.4 571.5c-6 6-9.1 13.8-9.3 21.6 0 0.1 0 0.1 0 0.2l0 111.8c0 35.3 28.7 64 64 64l449.7 0c33.8 0 61.4-26.1 63.8-59.3l0 0 0-0.2c0.1-1.5 0.2-3 0.2-4.5L830.8 593.3c0-0.3-0.1-0.7-0.2-1L830.6 338.2z"})]});o.Icon.register({"icon-area":e=>u.jsx(o.Icon,b({component:Pe},e)),"icon-pie":e=>u.jsx(o.Icon,b({component:Ie},e)),"icon-radar":e=>u.jsx(o.Icon,b({component:ge},e)),"icon-funnel":e=>u.jsx(o.Icon,b({component:xe},e)),"icon-line":e=>u.jsx(o.Icon,b({component:we},e)),"icon-bar":e=>u.jsx(o.Icon,b({component:be},e)),"icon-column":e=>u.jsx(o.Icon,b({component:ve},e)),"icon-scatter":e=>u.jsx(o.Icon,b({component:Se},e))});const Ne={label:"label",value:"value",color:"color",options:"children"},qe=(e,t,n)=>{function i(a){const F=[];for(let s=0;s<a.length;s++){const h=a[s][n.options];Array.isArray(h)&&F.push(...i(h)),F.push(b({},a[s]))}return F}const c=i(t);return e=lu.castArray(e).filter(a=>a!=null).map(a=>typeof a=="object"?a[n.value]:a),(a=>{if(!a)return[];const F=[];for(const s of e){const h=a.find(g=>g[n.value]===s)||{value:s,label:s};F.push(h)}return F})(c)},Tu=I.observer(e=>{var a;const t=b(b({},Ne),e.fieldNames),n=I.useField(),i=o.useCompile();if(!nu.isValid(e.value))return u.jsx("div",{});if(w.isArrayField(n)&&((a=n==null?void 0:n.value)==null?void 0:a.length)===0)return u.jsx("div",{});const c=n.dataSource||e.options||[],D=qe(n.value,c,t);return u.jsx("div",{children:D.map((F,s)=>u.jsx(L.Tag,{color:F[t.color],icon:F.icon,children:i(F[t.label])},s))})},{displayName:"ReadPretty"}),{Option:ju,OptGroup:Vu}=L.Select,Le=(e,t)=>{var n;return((n=t==null?void 0:t.label)!=null?n:"").toLowerCase().includes((e||"").toLowerCase())},Ju=I.connect(e=>{const t=cu(e,[]),F=b({},t),{options:n}=F,i=cu(F,["options"]),c=e.mode||e.multiple?"multiple":void 0,D=n.filter(s=>s.group===2),a=n.filter(s=>s.group===1);return u.jsxs(L.Select,U(b({showSearch:!0,filterOption:Le,allowClear:!0},i),{onChange:s=>{var h;(h=e.onChange)==null||h.call(e,s===void 0?null:s)},mode:c,children:[u.jsx(Vu,{label:m("Basic charts"),children:D.map(s=>u.jsx(ju,{value:s.key,label:m(s.title),children:u.jsx(o.StablePopover,{placement:"right",zIndex:99999999999,content:()=>{var h;return u.jsx("span",{children:(h=m(s==null?void 0:s.description))==null?void 0:h.split(",").map(g=>u.jsx("div",{children:g},g))})},trigger:"hover",children:u.jsxs("div",{className:o.css`
45
+ `,children:((P=C==null?void 0:C.query)==null?void 0:P.id)&&u.jsx(Bu,{queryId:(N=C==null?void 0:C.query)==null?void 0:N.id,fields:z})})]})]})})})},M).open({initialValues:b({},m)}).then(x=>{x={query:g,chart:x},F.title=x.chart.title,D.title=x.chart.title,F.componentProps.chartBlockEngineMetaData=x,lu.set(D,"x-component-props.chartBlockEngineMetaData",x),a.emit("patch",{schema:{"x-uid":D["x-uid"],"x-component-props":D["x-component-props"]}}),a.refresh()}).catch(x=>{G.error(x)})}),children:e.children||e.title||f("Edit chart block")})},yu=new Map;yu.set("G2Plot",o.G2Plot),yu.set("DataSetPreviewTable",Bu);const ge=({chartBlockEngineMetaData:e})=>{var z,M,Q;const t=o.useCompile(),n=e.chart.type,i=(z=j.get(n))==null?void 0:z.renderComponent,a=yu.get(i),D=e.chart,{loading:c,dataSet:F,error:s}=Mu(e.query.id),[m,g]=B.useState({});if(B.useEffect(()=>{g(D)},[JSON.stringify(D)]),s)return u.jsx(u.Fragment,{children:u.jsx(L.Empty,{description:u.jsx("span",{children:"May be this chart block's query data has been deleted,please check!"})})});if(m.type!==D.type)return u.jsx(u.Fragment,{});switch(i){case"G2Plot":{const x=(M=j.get(n))==null?void 0:M.defaultChartOptions;let p;try{p=V.parse(D==null?void 0:D.template)}catch(l){p={}}const C=t(U(b(b({},x),p),{data:F}),U(b({},D),{category:(Q=D==null?void 0:D.category)!=null?Q:""}));if(C&&D){const{dimension:l,metric:P,category:N}=D;if(!P||!l)return u.jsx(u.Fragment,{children:f("Please check the chart config")})}return u.jsx(u.Fragment,{children:c?u.jsx(L.Spin,{}):u.jsx(a,{plot:D.type,config:C})})}}return u.jsx(u.Fragment,{})},Mu=e=>{const{data:t,loading:n,error:i}=o.useRequest({url:`/chartsQueries:getData/${e}`}),a=t==null?void 0:t.data;return{loading:n,dataSet:a,error:i}},Tu=({chartBlockEngineMetaData:e})=>{var i,a;let t;const n=(i=e==null?void 0:e.chart)==null?void 0:i.type;return n&&(t=(a=j.get(n))==null?void 0:a.renderComponent),!n||!t?u.jsx(u.Fragment,{children:f("Please check the chart config")}):u.jsx(u.Fragment,{children:u.jsx(ge,{chartBlockEngineMetaData:e})})};Tu.Designer=Be;const xe=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M523 573.5c-3.9 0.7-7.9 1.1-12 1.1-5.3 0-10.4-0.6-15.2-1.8l-62.2 189.7 167.4-76L523 573.5z"}),u.jsx("path",{d:"M398.3 767.3l68.9-210.1c-6.4-6-11.5-13.3-15-21.4l-192.6 52.7L398.3 767.3z"}),u.jsx("path",{d:"M528 448.9c4.1 1.1 8 2.6 11.7 4.5l72.5-61.8L528 263.7 528 448.9z"}),u.jsx("path",{d:"M259.6 555.4 447.3 504c0.4-4.2 1.3-8.3 2.5-12.2L270.9 373.4 259.6 555.4z"}),u.jsx("path",{d:"M655.5 396.7l208.3 185.7 30.2 4.8c4.8-24.6 7.4-49.9 7.4-75.9 0-95.9-34.6-183.7-92-251.6L655.5 396.7z"}),u.jsx("path",{d:"M794.4 563.4 630.9 417.7l-67 57.1c5.6 8.3 9.3 18 10.6 28.4L794.4 563.4z"}),u.jsx("path",{d:"M496 448.4 496 239.6l-218.8 99.6 189.4 125.4C474.7 456.8 484.8 451.1 496 448.4z"}),u.jsx("path",{d:"M619.3 713.3 420 803.8l-19.1 81.6c35 10.3 72.1 15.9 110.4 15.9 74.4 0 143.9-20.8 203-56.9L619.3 713.3z"}),u.jsx("path",{d:"M648.7 699.5l92.3 127.2c63.3-46.2 112.2-111 138.6-186.4L648.7 699.5z"}),u.jsx("path",{d:"M386.2 804 226.1 597.7l-87.9 27.4c34.9 114.7 121.3 207 232.2 250L386.2 804z"}),u.jsx("path",{d:"M226.9 564.3 240.2 353l-64.4-40.5c-34.6 58.2-54.4 126.2-54.4 198.8 0 28.4 3 56.2 8.8 82.9L226.9 564.3z"}),u.jsx("path",{d:"M842.8 609.8l-272.7-74.7c-4 9.5-10.1 17.9-17.9 24.4l77.3 112.1L842.8 609.8z"}),u.jsx("path",{d:"M528 205.4l108.8 165.2 151-134.5c-67-67.3-158.4-110.2-259.7-114.5L528.1 205.4z"}),u.jsx("path",{d:"M245.7 318.4l250.3-114 0-82.8c-125 4.8-234.8 68.5-302.8 164L245.7 318.4z"})]}),Se=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M533.6 784.5c6.6 16.4-1.3 35-17.6 41.7l0 0c-16.4 6.6-35-1.3-41.7-17.6L129.9 236c-6.6-16.4 1.3-35 17.6-41.7l0 0c16.4-6.6 35 1.3 41.7 17.6L533.6 784.5z"}),u.jsx("path",{d:"M536 812.2c-6.9 16.3-25.7 23.9-41.9 17l0 0c-16.3-6.9-23.9-25.7-17-41.9l357.6-575.7c6.9-16.3 25.7-23.9 41.9-17l0 0c16.3 6.9 23.9 25.7 17 41.9L536 812.2z"}),u.jsx("path",{d:"M895.4 224c0 17.7-14.3 32-32 32l-704 0c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l704 0C881 192 895.4 206.3 895.4 224L895.4 224z"}),u.jsx("path",{d:"M278.6 384l465 0 0 64-465 0 0-64Z"}),u.jsx("path",{d:"M391.6 576l232.5 0 0 64-232.5 0 0-64Z"})]}),ve=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M745.6 765.9"}),u.jsx("path",{d:"M307.6 244.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M560 479.2m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M391.9 387.7m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M540.4 244.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M732.9 292.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M792.9 717.9m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M307.6 527.2m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M439.9 662.4m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"})]}),be=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M745.6 765.9"}),u.jsx("path",{d:"M342.1 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L278.7 489c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L342.1 734.3z"}),u.jsx("path",{d:"M493.8 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L430.4 387c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L493.8 734.3z"}),u.jsx("path",{d:"M797.3 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L733.9 234.5c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L797.3 734.3z"}),u.jsx("path",{d:"M645.5 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7l0-97.2c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L645.5 734.3z"})]}),we=()=>u.jsx("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:u.jsx("path",{d:"M131.072 156.16c0-17.92 14.336-31.744 31.744-31.744 17.92 0 31.744 14.336 31.744 31.744v712.192c0 17.92-14.336 31.744-31.744 31.744-17.92 0-31.744-14.336-31.744-31.744V156.16zM292.864 338.944c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h245.248c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-245.248zM292.864 490.496c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744H640c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-347.136zM292.864 794.112c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h499.712c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-499.712zM292.864 642.56c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h97.28c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-97.28z"})}),Ie=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M307.1 686.3c-12.4 12.4-32.4 12.4-44.8 0l0 0c-12.4-12.4-12.4-32.4 0-44.8l173.4-173.4c12.4-12.4 32.4-12.4 44.8 0l0 0c12.4 12.4 12.4 32.4 0 44.8L307.1 686.3z"}),u.jsx("path",{d:"M608.8 640c-12.4 12.4-32.4 12.4-44.8 0l0 0c-12.4-12.4-12.4-32.4 0-44.8l212.7-212.7c12.4-12.4 32.4-12.4 44.8 0l0 0c12.4 12.4 12.4 32.4 0 44.8L608.8 640z"}),u.jsx("path",{d:"M608 595.3c12.4 12.4 12.4 32.4 0 44.8l0 0c-12.4 12.4-32.4 12.4-44.8 0L436 512.8c-12.4-12.4-12.4-32.4 0-44.8l0 0c12.4-12.4 32.4-12.4 44.8 0L608 595.3z"})]}),Pe=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M489.7 511 489 511 489 126.9c-201 12.3-360.1 179.2-360.1 383.3 0 212.1 171.9 384 384 384 106.5 0 202.9-43.4 272.5-113.4L489.7 511z"}),u.jsx("path",{d:"M773.1 237.2l6-6c-62.7-59.6-143.5-95.8-228.2-104l0 304.7L773.1 237.2z"}),u.jsx("path",{d:"M819.5 281.6 564.1 505.1 822 739c3-4 5.9-8.1 8.7-12.3 41.4-61.3 65.6-135.2 65.6-214.7C896.3 425.6 867.7 345.8 819.5 281.6z"})]}),Ne=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M830.6 338.2 830.6 338.2c0.9-9.2-2.1-18.6-9.1-25.7-12.4-12.4-32.4-12.4-44.8 0L586 503.3 480.8 398.1c-6.2-6.2-14.4-9.3-22.5-9.3-8.1 0-16.3 3.1-22.5 9.3L262.4 571.5c-6 6-9.1 13.8-9.3 21.6 0 0.1 0 0.1 0 0.2l0 111.8c0 35.3 28.7 64 64 64l449.7 0c33.8 0 61.4-26.1 63.8-59.3l0 0 0-0.2c0.1-1.5 0.2-3 0.2-4.5L830.8 593.3c0-0.3-0.1-0.7-0.2-1L830.6 338.2z"})]});o.Icon.register({"icon-area":e=>u.jsx(o.Icon,b({component:Ne},e)),"icon-pie":e=>u.jsx(o.Icon,b({component:Pe},e)),"icon-radar":e=>u.jsx(o.Icon,b({component:xe},e)),"icon-funnel":e=>u.jsx(o.Icon,b({component:Se},e)),"icon-line":e=>u.jsx(o.Icon,b({component:Ie},e)),"icon-bar":e=>u.jsx(o.Icon,b({component:we},e)),"icon-column":e=>u.jsx(o.Icon,b({component:be},e)),"icon-scatter":e=>u.jsx(o.Icon,b({component:ve},e))});const qe={label:"label",value:"value",color:"color",options:"children"},Le=(e,t,n)=>{function i(c){const F=[];for(let s=0;s<c.length;s++){const m=c[s][n.options];Array.isArray(m)&&F.push(...i(m)),F.push(b({},c[s]))}return F}const a=i(t);return e=lu.castArray(e).filter(c=>c!=null).map(c=>typeof c=="object"?c[n.value]:c),(c=>{if(!c)return[];const F=[];for(const s of e){const m=c.find(g=>g[n.value]===s)||{value:s,label:s};F.push(m)}return F})(a)},ju=I.observer(e=>{var c;const t=b(b({},qe),e.fieldNames),n=I.useField(),i=o.useCompile();if(!nu.isValid(e.value))return u.jsx("div",{});if(w.isArrayField(n)&&((c=n==null?void 0:n.value)==null?void 0:c.length)===0)return u.jsx("div",{});const a=n.dataSource||e.options||[],D=Le(n.value,a,t);return u.jsx("div",{children:D.map((F,s)=>u.jsx(L.Tag,{color:F[t.color],icon:F.icon,children:i(F[t.label])},s))})},{displayName:"ReadPretty"}),{Option:Vu,OptGroup:Ju}=L.Select,Oe=(e,t)=>{var n;return((n=t==null?void 0:t.label)!=null?n:"").toLowerCase().includes((e||"").toLowerCase())},Gu=I.connect(e=>{const t=cu(e,[]),F=b({},t),{options:n}=F,i=cu(F,["options"]),a=e.mode||e.multiple?"multiple":void 0,D=n.filter(s=>s.group===2),c=n.filter(s=>s.group===1);return u.jsxs(L.Select,U(b({showSearch:!0,filterOption:Oe,allowClear:!0},i),{onChange:s=>{var m;(m=e.onChange)==null||m.call(e,s===void 0?null:s)},mode:a,children:[u.jsx(Ju,{label:f("Basic charts"),children:D.map(s=>u.jsx(Vu,{value:s.key,label:f(s.title),children:u.jsx(o.StablePopover,{placement:"right",zIndex:99999999999,content:()=>{var m;return u.jsx("span",{children:(m=f(s==null?void 0:s.description))==null?void 0:m.split(",").map(g=>u.jsx("div",{children:g},g))})},trigger:"hover",children:u.jsxs("div",{className:o.css`
46
46
  display: flex;
47
47
  gap: 4px;
48
48
  align-items: center;
49
- `,children:[u.jsx(o.Icon,{type:s.iconId}),u.jsx("span",{role:"img","aria-label":m(s.title),children:m(s.title)})]})})},s.key))}),u.jsx(Vu,{label:m("More charts"),children:a.map(s=>u.jsx(ju,{value:s.key,label:m(s.title),children:u.jsx(o.StablePopover,{placement:"right",zIndex:99999999999,content:()=>{var h;return u.jsx("span",{children:(h=m(s==null?void 0:s.description))==null?void 0:h.split(",").map(g=>u.jsx("div",{children:g},g))})},trigger:"hover",children:u.jsxs("div",{className:o.css`
49
+ `,children:[u.jsx(o.Icon,{type:s.iconId}),u.jsx("span",{role:"img","aria-label":f(s.title),children:f(s.title)})]})})},s.key))}),u.jsx(Ju,{label:f("More charts"),children:c.map(s=>u.jsx(Vu,{value:s.key,label:f(s.title),children:u.jsx(o.StablePopover,{placement:"right",zIndex:99999999999,content:()=>{var m;return u.jsx("span",{children:(m=f(s==null?void 0:s.description))==null?void 0:m.split(",").map(g=>u.jsx("div",{children:g},g))})},trigger:"hover",children:u.jsxs("div",{className:o.css`
50
50
  display: flex;
51
51
  gap: 4px;
52
52
  align-items: center;
53
- `,children:[u.jsx(o.Icon,{type:s.iconId}),u.jsx("span",{role:"img","aria-label":m(s.title),children:m(s.title)})]})})},s.key))})]}))},I.mapProps({dataSource:"options",loading:!0},(e,t)=>U(b({},e),{suffixIcon:t!=null&&t.loading||t!=null&&t.validating?u.jsx(ou.LoadingOutlined,{}):e==null?void 0:e.suffixIcon})),I.mapReadPretty(Tu));Ju.ReadPretty=Tu;const Oe=()=>{const{setVisible:e}=o.useActionContext(),t=I.useForm(),{refresh:n}=o.useResourceActionContext(),{resource:i}=o.useResourceContext(),c=R();return{run(){return J(this,null,function*(){yield t.submit(),yield i.create({values:t.values}),e(!1),yield t.reset(),n(),c.refresh()})}}},ke=()=>{const{setVisible:e}=o.useActionContext(),t=I.useForm(),{refresh:n}=o.useResourceActionContext(),{resource:i,targetKey:c}=o.useResourceContext(),{[c]:D}=o.useRecord(),a=R();return{run(){return J(this,null,function*(){yield t.submit(),yield i.update({filterByTk:D,values:t.values}),e(!1),yield t.reset(),n(),a.refresh()})}}},Gu=()=>{const{setVisible:e}=o.useActionContext();return{run(){return J(this,null,function*(){e(!1)})}}},$u=(e,{form:t,isNewRecord:n})=>{const i=e.type;return{type:"void",name:nu.uid(),"x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{form:t},title:m(n?"Add query":"Edit query"),properties:{title:{title:m("Title"),required:!0,"x-component":"Input","x-decorator":"FormItem"},options:Su(i),footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{"x-component":"Action",title:m("Cancel"),"x-component-props":{useAction:"{{ useCloseAction }}"}},submit:{"x-component":"Action",title:m("Submit"),"x-component-props":{type:"primary",useAction:"{{ useSubmitAction }}"}}}}}}},ze=()=>{const[e,t]=y.useState(!1),[n,i]=y.useState({}),c=y.useMemo(()=>w.createForm(),[]),D=y.useMemo(()=>({onClick:a=>{t(!0),c.setValues({type:a.key}),i($u({type:a.key},{form:c,isNewRecord:!0}))},items:[{key:"json",label:"JSON"},{key:"sql",label:"SQL"},{key:"api",label:"API",disabled:!0},{key:"collection",label:"Collection",disabled:!0}]}),[c]);return u.jsxs(o.ActionContextProvider,{value:{visible:e,setVisible:t},children:[u.jsx(L.Dropdown,{menu:D,children:u.jsxs(L.Button,{icon:u.jsx(ou.PlusOutlined,{}),type:"primary",children:[m("Add query")," ",u.jsx(ou.DownOutlined,{})]})}),u.jsx(o.SchemaComponent,{schema:n,scope:{useCloseAction:Gu,useSubmitAction:Oe}})]})},Me=()=>{const[e,t]=y.useState(!1),n=o.useRecord(),i=y.useMemo(()=>w.createForm(),[]),c=$u(n,{form:i,isNewRecord:!1});return u.jsxs(o.ActionContextProvider,{value:{visible:e,setVisible:t},children:[u.jsx("a",{onClick:()=>{i.setValues(n),t(!0)},children:m("Edit")}),u.jsx(o.SchemaComponent,{schema:c,scope:{useCloseAction:Gu,useSubmitAction:ke}})]})},Te=()=>{const e=o.useRecord();return u.jsx(L.Table,{columns:[{title:"字段标识",dataIndex:"name"}],dataSource:e.fields||[]})},Qu={name:"chartsQueries",fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{t("Title",{ns:"charts"})}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Type",{ns:"charts"})}}',type:"string","x-component":"Select",required:!0,enum:[{label:'{{t("API")}}',value:"api"},{label:'{{t("SQL")}}',value:"sql"},{label:'{{t("JSON")}}',value:"json"}]}}]},je=()=>{const e=R(),{refresh:t}=o.useResourceActionContext(),{resource:n,targetKey:i}=o.useResourceContext(),{[i]:c}=o.useRecord();return{run(){return J(this,null,function*(){yield n.destroy({filterByTk:c}),t(),e.refresh()})}}},Ve=()=>{const e=R(),{state:t,setState:n,refresh:i}=o.useResourceActionContext(),{resource:c,targetKey:D}=o.useResourceContext();return{run(){return J(this,null,function*(){yield c.destroy({filterByTk:(t==null?void 0:t.selectedRowKeys)||[]}),n==null||n({selectedRowKeys:[]}),i(),e.refresh()})}}},Je={type:"object",properties:{[nu.uid()]:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:Qu,resourceName:"chartsQueries",request:{resource:"chartsQueries",action:"list",params:{pageSize:50,sort:["-id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:Qu},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{useAction:"{{ useDestroyAllSelectedQueriesAction }}",confirm:{title:'{{t("Delete queries",{ns:"charts"})}}',content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add query")}}',"x-component":"AddNewQuery","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(e){const t=o.useActionContext();return o.useRequest(()=>Promise.resolve({data:{name:`s_${nu.uid()}`}}),U(b({},e),{refreshDeps:[t.visible]}))}},title:'{{t("Add query",{ns:"charts"})}}',properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel",{ns:"charts"})}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit",{ns:"charts"})}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{fields:{type:"void",title:'{{t("Configure fields")}}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer",title:'{{t("Configure fields")}}',properties:{configure:{type:"void","x-component":"ConfigureFields"}}}}},update:{type:"void",title:'{{t("Edit")}}',"x-component":"EditQuery","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel",{ns:"charts"})}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit",{ns:"charts"})}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:'{{t("Delete query",{ns:"charts"})}}',content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ useDestroyQueryItemAction }}"}}}}}}}}}}}},Ge=()=>(y.useState(!1),Y.useTranslation(),u.jsx(L.Card,{bordered:!1,children:u.jsx(o.SchemaComponent,{scope:{JSON5:V,useDestroyQueryItemAction:je,useDestroyAllSelectedQueriesAction:Ve},schema:Je,components:{AddNewQuery:ze,EditQuery:Me,ConfigureFields:Te}})}));w.registerValidateRules({json5:(e,t)=>{if(!e)return"";try{const n=V.parse(e);return isNaN(n)?"":{type:"error",message:m("Invalid JSON format")}}catch(n){return console.error(n),{type:"error",message:m("Invalid JSON format")}}}});const _u=y.memo(e=>{const t=o.useAPIClient(),n=i=>new Promise(c=>{t.request({url:"chartsQueries:validate",method:"post",data:{sql:i}}).then(({data:D})=>{var a;c((a=D==null?void 0:D.data)==null?void 0:a.errorMessage)}).catch(()=>{c("Invalid SQL")})});return u.jsx(De,{children:u.jsx(o.SchemaComponentOptions,{scope:{validateSQL:n},components:{CustomSelect:Ju,ChartBlockInitializer:me,ChartBlockEngine:Mu},children:e.children})})});_u.displayName="ChartsProvider";class Zu extends o.Plugin{afterAdd(){return J(this,null,function*(){this.app.pm.add(o.BlockSchemaComponentPlugin)})}load(){return J(this,null,function*(){this.app.use(_u),this.app.pluginSettingsManager.add(fu,{title:`{{t("Charts", { ns: "${fu}" })}}`,icon:"PieChartOutlined",Component:Ge,aclSnippet:"pm.charts.queries"})})}}A.ChartsPlugin=Zu,A.default=Zu,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
53
+ `,children:[u.jsx(o.Icon,{type:s.iconId}),u.jsx("span",{role:"img","aria-label":f(s.title),children:f(s.title)})]})})},s.key))})]}))},I.mapProps({dataSource:"options",loading:!0},(e,t)=>U(b({},e),{suffixIcon:t!=null&&t.loading||t!=null&&t.validating?u.jsx(ou.LoadingOutlined,{}):e==null?void 0:e.suffixIcon})),I.mapReadPretty(ju));Gu.ReadPretty=ju;const ke=()=>{const{setVisible:e}=o.useActionContext(),t=I.useForm(),{refresh:n}=o.useResourceActionContext(),{resource:i}=o.useResourceContext(),a=R();return{run(){return J(this,null,function*(){yield t.submit(),yield i.create({values:t.values}),e(!1),yield t.reset(),n(),a.refresh()})}}},ze=()=>{const{setVisible:e}=o.useActionContext(),t=I.useForm(),{refresh:n}=o.useResourceActionContext(),{resource:i,targetKey:a}=o.useResourceContext(),{[a]:D}=o.useRecord(),c=R();return{run(){return J(this,null,function*(){yield t.submit(),yield i.update({filterByTk:D,values:t.values}),e(!1),yield t.reset(),n(),c.refresh()})}}},$u=()=>{const{setVisible:e}=o.useActionContext();return{run(){return J(this,null,function*(){e(!1)})}}},Qu=(e,{form:t,isNewRecord:n})=>{const i=e.type;return{type:"void",name:nu.uid(),"x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{form:t},title:f(n?"Add query":"Edit query"),properties:{title:{title:f("Title"),required:!0,"x-component":"Input","x-decorator":"FormItem"},options:vu(i),footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{"x-component":"Action",title:f("Cancel"),"x-component-props":{useAction:"{{ useCloseAction }}"}},submit:{"x-component":"Action",title:f("Submit"),"x-component-props":{type:"primary",useAction:"{{ useSubmitAction }}"}}}}}}},Me=()=>{const[e,t]=B.useState(!1),[n,i]=B.useState({}),a=B.useMemo(()=>w.createForm(),[]),D=B.useMemo(()=>({onClick:c=>{t(!0),a.setValues({type:c.key}),i(Qu({type:c.key},{form:a,isNewRecord:!0}))},items:[{key:"json",label:"JSON"},{key:"sql",label:"SQL"},{key:"api",label:"API",disabled:!0},{key:"collection",label:"Collection",disabled:!0}]}),[a]);return u.jsxs(o.ActionContextProvider,{value:{visible:e,setVisible:t},children:[u.jsx(L.Dropdown,{menu:D,children:u.jsxs(L.Button,{icon:u.jsx(ou.PlusOutlined,{}),type:"primary",children:[f("Add query")," ",u.jsx(ou.DownOutlined,{})]})}),u.jsx(o.SchemaComponent,{schema:n,scope:{useCloseAction:$u,useSubmitAction:ke}})]})},Te=()=>{const[e,t]=B.useState(!1),n=o.useRecord(),i=B.useMemo(()=>w.createForm(),[]),a=Qu(n,{form:i,isNewRecord:!1});return u.jsxs(o.ActionContextProvider,{value:{visible:e,setVisible:t},children:[u.jsx("a",{onClick:()=>{i.setValues(n),t(!0)},children:f("Edit")}),u.jsx(o.SchemaComponent,{schema:a,scope:{useCloseAction:$u,useSubmitAction:ze}})]})},je=()=>{const e=o.useRecord();return u.jsx(L.Table,{columns:[{title:"字段标识",dataIndex:"name"}],dataSource:e.fields||[]})},_u={name:"chartsQueries",fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{t("Title",{ns:"charts"})}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Type",{ns:"charts"})}}',type:"string","x-component":"Select",required:!0,enum:[{label:'{{t("API")}}',value:"api"},{label:'{{t("SQL")}}',value:"sql"},{label:'{{t("JSON")}}',value:"json"}]}}]},Ve=()=>{const e=R(),{refresh:t}=o.useResourceActionContext(),{resource:n,targetKey:i}=o.useResourceContext(),{[i]:a}=o.useRecord();return{run(){return J(this,null,function*(){yield n.destroy({filterByTk:a}),t(),e.refresh()})}}},Je=()=>{const e=R(),{state:t,setState:n,refresh:i}=o.useResourceActionContext(),{resource:a,targetKey:D}=o.useResourceContext();return{run(){return J(this,null,function*(){yield a.destroy({filterByTk:(t==null?void 0:t.selectedRowKeys)||[]}),n==null||n({selectedRowKeys:[]}),i(),e.refresh()})}}},Ge={type:"object",properties:{[nu.uid()]:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:_u,resourceName:"chartsQueries",request:{resource:"chartsQueries",action:"list",params:{pageSize:50,sort:["-id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:_u},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{useAction:"{{ useDestroyAllSelectedQueriesAction }}",confirm:{title:'{{t("Delete queries",{ns:"charts"})}}',content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add query")}}',"x-component":"AddNewQuery","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(e){const t=o.useActionContext();return o.useRequest(()=>Promise.resolve({data:{name:`s_${nu.uid()}`}}),U(b({},e),{refreshDeps:[t.visible]}))}},title:'{{t("Add query",{ns:"charts"})}}',properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel",{ns:"charts"})}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit",{ns:"charts"})}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{fields:{type:"void",title:'{{t("Configure fields")}}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer",title:'{{t("Configure fields")}}',properties:{configure:{type:"void","x-component":"ConfigureFields"}}}}},update:{type:"void",title:'{{t("Edit")}}',"x-component":"EditQuery","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel",{ns:"charts"})}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit",{ns:"charts"})}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:'{{t("Delete query",{ns:"charts"})}}',content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ useDestroyQueryItemAction }}"}}}}}}}}}}}},$e=()=>(B.useState(!1),Y.useTranslation(),u.jsx(L.Card,{bordered:!1,children:u.jsx(o.SchemaComponent,{scope:{JSON5:V,useDestroyQueryItemAction:Ve,useDestroyAllSelectedQueriesAction:Je},schema:Ge,components:{AddNewQuery:Me,EditQuery:Te,ConfigureFields:je}})}));w.registerValidateRules({json5:(e,t)=>{if(!e)return"";try{const n=V.parse(e);return isNaN(n)?"":{type:"error",message:f("Invalid JSON format")}}catch(n){return console.error(n),{type:"error",message:f("Invalid JSON format")}}}});const Zu=B.memo(e=>{const t=o.useAPIClient(),n=i=>new Promise(a=>{t.request({url:"chartsQueries:validate",method:"post",data:{sql:i}}).then(({data:D})=>{var c;a((c=D==null?void 0:D.data)==null?void 0:c.errorMessage)}).catch(()=>{a("Invalid SQL")})});return u.jsx(se,{children:u.jsx(o.SchemaComponentOptions,{scope:{validateSQL:n},components:{CustomSelect:Gu,ChartBlockInitializer:fe,ChartBlockEngine:Tu},children:e.children})})});Zu.displayName="ChartsProvider";class Hu extends o.Plugin{afterAdd(){return J(this,null,function*(){this.app.pm.add(o.BlockSchemaComponentPlugin)})}load(){return J(this,null,function*(){this.app.use(Zu),this.app.pluginSettingsManager.add(hu,{title:`{{t("Charts", { ns: "${hu}" })}}`,icon:"PieChartOutlined",Component:$e,aclSnippet:"pm.charts.queries"})})}}A.ChartsPlugin=Hu,A.default=Hu,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -8,18 +8,18 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.2.14-alpha",
11
+ "@nocobase/client": "1.3.0-alpha.20240710141659",
12
12
  "antd": "5.12.8",
13
13
  "react": "18.2.0",
14
14
  "@formily/antd-v5": "1.1.9",
15
15
  "@formily/react": "2.3.0",
16
- "@nocobase/utils": "1.2.14-alpha",
16
+ "@nocobase/utils": "1.3.0-alpha.20240710141659",
17
17
  "react-i18next": "11.18.6",
18
18
  "lodash": "4.17.21",
19
19
  "@formily/core": "2.3.0",
20
20
  "@ant-design/icons": "5.2.6",
21
21
  "react-router-dom": "6.21.0",
22
22
  "@formily/shared": "2.3.0",
23
- "@nocobase/server": "1.2.14-alpha",
24
- "@nocobase/database": "1.2.14-alpha"
23
+ "@nocobase/server": "1.3.0-alpha.20240710141659",
24
+ "@nocobase/database": "1.3.0-alpha.20240710141659"
25
25
  };
@@ -1 +1 @@
1
- {"name":"json5","version":"2.2.3","description":"JSON for Humans","main":"lib/index.js","module":"dist/index.mjs","bin":"lib/cli.js","browser":"dist/index.js","types":"lib/index.d.ts","files":["lib/","dist/"],"engines":{"node":">=6"},"scripts":{"build":"rollup -c","build-package":"node build/package.js","build-unicode":"node build/unicode.js","coverage":"tap --coverage-report html test","lint":"eslint --fix .","lint-report":"eslint .","prepublishOnly":"npm run production","preversion":"npm run production","production":"run-s test build","tap":"tap -Rspec --100 test","test":"run-s lint-report tap","version":"npm run build-package && git add package.json5"},"repository":{"type":"git","url":"git+https://github.com/json5/json5.git"},"keywords":["json","json5","es5","es2015","ecmascript"],"author":"Aseem Kishore <aseem.kishore@gmail.com>","contributors":["Max Nanasy <max.nanasy@gmail.com>","Andrew Eisenberg <andrew@eisenberg.as>","Jordan Tucker <jordanbtucker@gmail.com>"],"license":"MIT","bugs":{"url":"https://github.com/json5/json5/issues"},"homepage":"http://json5.org/","devDependencies":{"core-js":"^2.6.5","eslint":"^5.15.3","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.16.0","eslint-plugin-node":"^8.0.1","eslint-plugin-promise":"^4.0.1","eslint-plugin-standard":"^4.0.0","npm-run-all":"^4.1.5","regenerate":"^1.4.0","rollup":"^0.64.1","rollup-plugin-buble":"^0.19.6","rollup-plugin-commonjs":"^9.2.1","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-terser":"^1.0.1","sinon":"^6.3.5","tap":"^12.6.0","unicode-10.0.0":"^0.7.5"},"_lastModified":"2024-07-11T04:40:41.930Z"}
1
+ {"name":"json5","version":"2.2.3","description":"JSON for Humans","main":"lib/index.js","module":"dist/index.mjs","bin":"lib/cli.js","browser":"dist/index.js","types":"lib/index.d.ts","files":["lib/","dist/"],"engines":{"node":">=6"},"scripts":{"build":"rollup -c","build-package":"node build/package.js","build-unicode":"node build/unicode.js","coverage":"tap --coverage-report html test","lint":"eslint --fix .","lint-report":"eslint .","prepublishOnly":"npm run production","preversion":"npm run production","production":"run-s test build","tap":"tap -Rspec --100 test","test":"run-s lint-report tap","version":"npm run build-package && git add package.json5"},"repository":{"type":"git","url":"git+https://github.com/json5/json5.git"},"keywords":["json","json5","es5","es2015","ecmascript"],"author":"Aseem Kishore <aseem.kishore@gmail.com>","contributors":["Max Nanasy <max.nanasy@gmail.com>","Andrew Eisenberg <andrew@eisenberg.as>","Jordan Tucker <jordanbtucker@gmail.com>"],"license":"MIT","bugs":{"url":"https://github.com/json5/json5/issues"},"homepage":"http://json5.org/","devDependencies":{"core-js":"^2.6.5","eslint":"^5.15.3","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.16.0","eslint-plugin-node":"^8.0.1","eslint-plugin-promise":"^4.0.1","eslint-plugin-standard":"^4.0.0","npm-run-all":"^4.1.5","regenerate":"^1.4.0","rollup":"^0.64.1","rollup-plugin-buble":"^0.19.6","rollup-plugin-commonjs":"^9.2.1","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-terser":"^1.0.1","sinon":"^6.3.5","tap":"^12.6.0","unicode-10.0.0":"^0.7.5"},"_lastModified":"2024-07-10T14:29:09.970Z"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "图表(废弃)",
5
5
  "description": "The plugin has been deprecated, please use the data visualization plugin instead.",
6
6
  "description.zh-CN": "已废弃插件,请使用数据可视化插件代替。",
7
- "version": "1.2.14-alpha",
7
+ "version": "1.3.0-alpha.20240710141659",
8
8
  "main": "./dist/server/index.js",
9
9
  "license": "AGPL-3.0",
10
10
  "devDependencies": {
@@ -26,5 +26,5 @@
26
26
  "@nocobase/test": "1.x",
27
27
  "@nocobase/utils": "1.x"
28
28
  },
29
- "gitHead": "717c71eee8cec8d230f1856759d97d6a843f8be6"
29
+ "gitHead": "cb8b234443034da0dfa57dd5d6cca1f3b3db6f08"
30
30
  }