var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(u){var C=0;return function(){return C<u.length?{done:!1,value:u[C++]}:{done:!0}}};$jscomp.arrayIterator=function(u){return{next:$jscomp.arrayIteratorImpl(u)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(u,C,A){if(u==Array.prototype||u==Object.prototype)return u;u[C]=A.value;return u};$jscomp.getGlobal=function(u){u=["object"==typeof globalThis&&globalThis,u,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var C=0;C<u.length;++C){var A=u[C];if(A&&A.Math==Math)return A}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(u,C){var A=$jscomp.propertyToPolyfillSymbol[C];if(null==A)return u[C];A=u[A];return void 0!==A?A:u[C]};
$jscomp.polyfill=function(u,C,A,G){C&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(u,C,A,G):$jscomp.polyfillUnisolated(u,C,A,G))};$jscomp.polyfillUnisolated=function(u,C,A,G){A=$jscomp.global;u=u.split(".");for(G=0;G<u.length-1;G++){var H=u[G];if(!(H in A))return;A=A[H]}u=u[u.length-1];G=A[u];C=C(G);C!=G&&null!=C&&$jscomp.defineProperty(A,u,{configurable:!0,writable:!0,value:C})};
$jscomp.polyfillIsolated=function(u,C,A,G){var H=u.split(".");u=1===H.length;G=H[0];G=!u&&G in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var x=0;x<H.length-1;x++){var M=H[x];if(!(M in G))return;G=G[M]}H=H[H.length-1];A=$jscomp.IS_SYMBOL_NATIVE&&"es6"===A?G[H]:null;C=C(A);null!=C&&(u?$jscomp.defineProperty($jscomp.polyfills,H,{configurable:!0,writable:!0,value:C}):C!==A&&(void 0===$jscomp.propertyToPolyfillSymbol[H]&&(A=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[H]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(H):$jscomp.POLYFILL_PREFIX+A+"$"+H),$jscomp.defineProperty(G,$jscomp.propertyToPolyfillSymbol[H],{configurable:!0,writable:!0,value:C})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(u){if(u)return u;var C=function(x,M){this.$jscomp$symbol$id_=x;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:M})};C.prototype.toString=function(){return this.$jscomp$symbol$id_};var A="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",G=0,H=function(x){if(this instanceof H)throw new TypeError("Symbol is not a constructor");return new C(A+(x||"")+"_"+G++,x)};return H},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(u){if(u)return u;u=Symbol("Symbol.iterator");for(var C="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),A=0;A<C.length;A++){var G=$jscomp.global[C[A]];"function"===typeof G&&"function"!=typeof G.prototype[u]&&$jscomp.defineProperty(G.prototype,u,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return u},"es6",
"es3");$jscomp.iteratorPrototype=function(u){u={next:u};u[Symbol.iterator]=function(){return this};return u};$jscomp.iteratorFromArray=function(u,C){u instanceof String&&(u+="");var A=0,G=!1,H={next:function(){if(!G&&A<u.length){var x=A++;return{value:C(x,u[x]),done:!1}}G=!0;return{done:!0,value:void 0}}};H[Symbol.iterator]=function(){return H};return H};$jscomp.polyfill("Array.prototype.keys",function(u){return u?u:function(){return $jscomp.iteratorFromArray(this,function(C){return C})}},"es6","es3");
(function(){function u(){var n=this,q,l=[],h=[],m=[],v;this.setType=function(g){q=g};this.getType=function(){return q};this.supportIncrementalMaterialize=function(){return!1};this.protectedIsTableInUse=function(){throw Error("override me");};this.insertSource=function(g,c){for(var b=!1,k=g.getSourceId(),a=0;a<l.length;a++)if(k==l[a].getSourceId()){b=!0;break}b||(l.splice(c,0,g),f(u.KEY_ADD_PREPARED_SOURCE,[g]))};this.batchAddSource=function(g){for(var c=[],b=0;b<g.length;b++){for(var k=!1,a=g[b],
d=a.getSourceId(),p=0;p<l.length;p++)if(d==l[p].getSourceId()){k=!0;break}k||(l.push(a),c.push(a))}f(u.KEY_ADD_PREPARED_SOURCE,c)};this.setSource=function(g,c){l=g;!c&&f(u.KEY_SET_PREPARED_SOURCE,l)};this.removeSource=function(g){var c=l.indexOf(g);return-1<c?(l.splice(c,1),f(u.KEY_REMOVE_PREPARED_SOURCE,[g]),c):-1};this.batchRemoveUserSqlTable=function(g){g=n.getUserSqlTables(g);for(var c=0;c<g.length;c++)n.removeTableIfUseless(g[c])};this.batchRemoveSource=function(g){for(var c=0;c<g.length;c++){var b=
l.indexOf(g[c]);-1<b&&l.splice(b,1)}f(u.KEY_REMOVE_PREPARED_SOURCE,g)};this.getSource=function(g){for(var c=0,b=l.length;c<b;c++)if(l[c].getId()==g)return l[c]};this.getAllSource=function(){return l};this.isSourceUsed=function(g){g=g.getId();for(var c=0,b=h.length;c<b;c++){var k=h[c];if(k.getSourceUid()==g&&n.protectedIsTableInUse(k))return!0}return!1};this.addTable=function(g){for(var c=0,b=h.length;c<b;c++)if(h[c].isSame(g))return;h.push(g);g.addPropertyChangeCallback(f);f(u.KEY_ADD_TABLE,g)};this.updateTable=
function(g,c){for(var b=-1,k=0,a=h.length;k<a;k++)if(h[k].isSame(c)){b=k;break}-1<b&&(h.splice(b,1),h.splice(b,0,g),c.removePropertyChangeCallback(f),g.addPropertyChangeCallback(f))};this.batchAddTable=function(g){for(var c=0;c<g.length;c++)n.addTable(g[c])};this.setTables=function(g){h=g};this.getTable=function(g){for(var c=0,b=h.length;c<b;c++)if(h[c].getUid()==g)return h[c]};this.removeTable=function(g){var c=h.indexOf(g);-1<c&&(h.splice(c,1),g.removePropertyChangeCallback(f),f(u.KEY_REMOVE_TABLE,
g));return c};this.batchRemoveTable=function(g){for(var c=0;c<g.length;c++){var b=g[c];n.removeTable(b);b.removePropertyChangeCallback(f)}};this.insertTable=function(g,c){for(var b=0,k=h.length;b<k;b++)if(h[b].isSame(g))return;h.splice(c,0,g);g.addPropertyChangeCallback(f);f(u.KEY_ADD_TABLE,g)};this.getUserSqlTables=function(g){for(var c=[],b=0,k=h.length;b<k;b++){var a=h[b];a.isUserSql()&&a.getSourceUid()==g&&c.push(a)}return c};this.getAllUserSqlTables=function(){for(var g=[],c=0,b=h.length;c<b;c++)h[c].isUserSql()&&
g.push(h[c]);return g};this.getAllTable=function(g){for(var c=[],b=0,k=h.length;b<k;b++){var a=h[b];g?(n.protectedIsTableInUse(a)||a.isUserSql())&&c.push(a):n.protectedIsTableInUse(a)&&c.push(a)}return c};this.getSameTable=function(g){for(var c=0,b=h.length;c<b;c++)if(h[c].isSame(g))return h[c]};this.isSameTableAndSourceExist=function(g,c,b){for(var k=0;k<h.length;k++){var a=h[k];if(a.getTableName()==c&&a.getNamespace()==b&&n.getSource(a.getSourceUid()).getSourceId()==g)return!0}return!1};this.setMaterializedConfig=
function(g){v=g};this.getMaterializedConfig=function(){return v};this.toJsonObject=function(){var g={};g.type=q;for(var c=[],b=0;b<l.length;b++)c.push(l[b].toJsonObject());g.sources=c;c=[];for(b=0;b<h.length;b++){var k=h[b];(n.protectedIsTableInUse(k)||k.isUserSql())&&c.push(k.toJsonObject())}g.tables=c;v&&(g.materializedConfig=v.toJsonObject());n.protectedToJsonObject(g);return g};this.fromJsonObject=function(g){q=g.type;var c=g.sources;if(c)for(var b=0;b<c.length;b++){var k=c[b],a=new H;a.fromJsonObject(k);
l.push(a)}if(c=g.tables)for(b=0;b<c.length;b++)k=new A,k.fromJsonObject(c[b]),k.addPropertyChangeCallback(f),h.push(k);(b=g.materializedConfig)?(v=new N,v.fromJsonObject(b)):v=null;n.protectedFromJsonObject(g)};this.isUserSqlTableInUse=function(g){g=n.getSameTable(g);return n.protectedIsTableInUse(g)};this.protectedToJsonObject=function(g){};this.protectedFromJsonObject=function(g){};this.addPropertyChangeCallback=function(g){m.push(g)};this.removePropertyChangeCallback=function(g){g=m.indexOf(g);
-1<g&&m.splice(g,1)};this.clearPropertyChangeCallback=function(){m=[]};var f=function(g,c){for(var b=0,k=m.length;b<k;b++)m[b](g,c)};this.protectedMethod={firePropertyChangeEvt:f,copy:function(g){g.setType(q);for(var c=[],b=0;b<l.length;b++)c.push(l[b].copy());g.setSource(c,!0);c=[];for(b=0;b<h.length;b++)c.push(h[b].clone());g.setTables(c);v&&g.setMaterializedConfig(v.copy())}}}function C(){var n=this,q,l,h,m,v,f,g,c,b=[];this.setId=function(a){q=a};this.getId=function(){return q};this.setAlias=
function(a){l=a;m=void 0;k(u.KEY_NODE_CHANGE_ALIAS,n)};this.getAlias=function(){return l};this.setNameIndex=function(a){m=a};this.getNameIndex=function(){return m};this.getX=function(){return v};this.getY=function(){return f};this.getWidth=function(){return g};this.getHeight=function(){return c};this.setPosition=function(a,d){v=a;f=d};this.changePosition=function(a,d){n.setPosition(a,d);k(u.KEY_NODE_CHANGE_POSITION,n)};this.setSize=function(a,d){g=a;c=d};this.setType=function(a){h=a};this.getType=
function(a){return h};this.addPropertyChangeCallback=function(a){b.push(a)};this.removePropertyChangeCallback=function(a){a=b.indexOf(a);-1<a&&b.splice(a,1)};this.toJsonObject=function(){var a={};a.id=q;a.alias=l;a.x=v;a.y=f;a.type=h;m&&(a.nameIndex=m);n.protectedToJson(a);return a};this.fromJsonObject=function(a){q=a.id;l=a.alias;v=a.x;f=a.y;h=a.type;var d=parseInt(a.nameIndex);isNaN(d)||(m=d);n.protectedFromJson(a)};this.protectedToJson=function(a){};this.protectedFromJson=function(a){};var k=function(a,
d){for(var p=0,y=b.length;p<y;p++)b[p](a,d)};this.protectedMethod={firePropertyChangeEvt:function(a){k(a,n)}}}function A(){var n=this,q,l,h,m,v,f,g,c=[],b=[];this.setUid=function(a){q=a};this.getUid=function(){return q};this.isUserSql=function(){return f?!0:!1};this.getUserSql=function(){return f};this.setUserSql=function(a){f=a};this.setTableName=function(a){l=a};this.getTableName=function(){return l};this.setSourceUid=function(a){h=a};this.getSourceUid=function(){return h};this.setNamespace=function(a){m=
a};this.getNamespace=function(){return m};this.setDisplayName=function(a){v=a};this.getDisplayName=function(){return v};this.setSelectedFields=function(a){g=a;k(u.KEY_TABLE_SELECT_FIELD,n)};this.getSelectedFields=function(){return g};this.setFilterItems=function(a){c=a;k(u.KEY_TABLE_SET_FILTER,n)};this.getFilterItems=function(){return c};this.addPropertyChangeCallback=function(a){b.push(a)};this.removePropertyChangeCallback=function(a){a=b.indexOf(a);-1<a&&b.splice(a,1)};this.isSame=function(a){return h==
a.getSourceUid()&&l==a.getTableName()&&m==a.getNamespace()&&(!n.isUserSql()&&!a.isUserSql()||n.isUserSql()&&a.isUserSql()&&(a=a.getUserSql(),a.getSqlType()==f.getSqlType()&&a.getContent()==f.getContent()))?!0:!1};this.toJsonObject=function(){var a={};a.id=q;a.name=l;a.sourceId=h;a.namespace=m;n.isUserSql()&&(a.userSQL=f.toJsonObject());if(g){for(var d=[],p=0;p<g.length;p++)d.push(g[p].toJsonObject());a.selectedFields=d}if(c){d=[];for(p=0;p<c.length;p++)d.push(c[p].toJsonObject());a.filterItems=d}return a};
this.fromJsonObject=function(a){q=a.id;l=a.name;h=a.sourceId;m=a.namespace;v=a.displayName;a.userSQL&&(f=new G,f.fromJsonObject(a.userSQL));var d=a.selectedFields;if(d){for(var p=[],y=0;y<d.length;y++){var r=new x;r.fromJsonObject(d[y]);p.push(r)}g=p}if(a=a.filterItems){d=[];for(y=0;y<a.length;y++)p=new w,p.fromJsonObject(a[y]),d.push(p);c=d}};this.clone=function(){var a=new A;a.setUid(q);a.setTableName(l);a.setNamespace(m);a.setDisplayName(v);a.setSourceUid(h);f&&a.setUserSql(f.copy());var d=[];
if(g){for(var p=0;p<g.length;p++)d.push(g[p].clone());a.setSelectedFields(d)}d=[];for(p=0;p<c.length;p++)d.push(c[p].copy());a.setFilterItems(d);return a};var k=function(a,d){for(var p=0,y=b.length;p<y;p++)b[p](a,d)}}function G(){var n,q;this.getSqlType=function(){return n};this.setSqlType=function(l){n=l};this.setContent=function(l){q=l};this.getContent=function(){return q};this.fromJsonObject=function(l){n=l.type;q=l.content};this.toJsonObject=function(){var l={};l.type=n;l.content=q;return l};
this.copy=function(){var l=new G;l.setSqlType(n);l.setContent(q);return l}}function H(){var n,q,l,h,m,v;this.setId=function(f){n=f};this.getId=function(){return n};this.getSourceId=function(){return q};this.setSourceId=function(f){q=f};this.setSourceRefId=function(f){l=sId};this.getSourceRefId=function(){return l};this.getName=function(){return h};this.setName=function(f){h=f};this.setSourceType=function(f){m=f};this.getSourceType=function(){return m};this.setModelId=function(f){v=f};this.getModelId=
function(){return v};this.copy=function(){var f=new H;f.setId(n);f.setSourceId(q);f.setSourceType(m);f.setName(h);f.setSourceType(m);f.setModelId(v);return f};this.toJsonObject=function(){var f={};f.id=n;f.modelSetSourceId=q;f.modelSetSourceRefId=l;f.modelId=v;return f};this.fromJsonObject=function(f){n=f.id;q=f.modelSetSourceId;l=f.modelSetSourceRefId;m=f.type;h=f.name}}function x(){var n=this,q,l,h,m,v,f,g,c,b,k;this.setTableId=function(d){q=d};this.getTableId=function(){return q};this.setFromNode=
function(d){l=d};this.getSourceNodeId=function(){return l};this.setName=function(d){h=d};this.getName=function(){return h};this.getFullName=function(){return l?l+"_"+h:q+"_"+h};this.setAlias=function(d){m=d};this.getAlias=function(){return m?m:h};this.setDataType=function(d){a(d);v=d};this.getDataType=function(){return v};this.setAppointedDataType=function(d){d&&a(d);f=d==v?null:d};this.getAppointedDataType=function(){return f};this.getOutputDataType=function(){return f?f:v};this.setRoundMode=function(d){c=
d};this.getRoundMode=function(){return c};this.setScale=function(d){g=d};this.getScale=function(){return g};this.getFormat=function(){return b};this.setFormat=function(d){b=d};this.setExtensions=function(d){k=d};this.getEnumValue=function(){return k?k[x.EXTENSION_BIZ_FIELD_ENUM_KEY]:null};this.isMulBaseData=function(){return k?k[x.EXTENSION_IS_MUL_BASE_DATA]:!1};this.isPk=function(){return k?k[x.EXTENSION_IS_PK]:!1};this.isEnum=function(){if(n.isMulBaseData()||n.getOutputDataType()!=x.DT_STRING)return!1;
var d=n.getEnumValue();return 0==(d?Object.keys(d):[]).length?!1:!0};this.fromJsonObject=function(d){h=d.name;m=d.alias;v=d.dataType;f=d.appointedDataType;l=d.fromNode;void 0!=d.scale&&(g=d.scale);d.roundMode&&(c=d.roundMode);k=d.extensions;d.format&&(b=d.format);d.tableId&&(q=d.tableId)};this.toJsonObject=function(){var d={};d.name=h;d.alias=m;d.dataType=v;d.fromNode=l;f&&(d.appointedDataType=f);void 0!=g&&(d.scale=g);c&&(d.roundMode=c);k&&(d.extensions=k);q&&(d.tableId=q);return d};var a=function(d){if(d!==
x.DT_STRING&&d!==x.DT_INT&&d!==x.DT_NUMBER&&d!==x.DT_DATE&&d!==x.DT_DATETIME&&d!==x.DT_BOOLEAN)throw Error("IllegalArgument: "+d);};this.clone=function(){var d=new x;d.setName(h);v&&d.setDataType(v);d.setAlias(m);f&&d.setAppointedDataType(f);d.setFromNode(l);void 0!=g&&d.setScale(g);c&&d.setRoundMode(c);d.setExtensions(k);b&&d.setFormat(b);q&&d.setTableId(q);return d};this.equals=function(d){return h==d.getName()&&m==d.getAlias()&&f==d.getAppointedDataType()&&g==d.getScale()&&c==d.getRoundMode()?
!0:!1}}function M(){var n,q;this.setExtractPartlyData=function(l,h){n=l;q=h};this.setExtractAllData=function(l){n=M.ALL_DATA_NUMBER;q=l};this.toJsonObject=function(){var l={};l.extractCount=n;l.previewCount=q;return l}}function L(){var n=this,q,l;this.setId=function(h){q=h};this.getId=function(){return q};this.toJsonObject=function(){var h={};h.id=q;h.type=l;n.protectedToJson(h);return h};this.protectedToJson=function(h){};this.protectedMethod={setType:function(h){l=h}}}function X(){var n=[],q,l=
[];this.isValid=function(){return q};this.getCases=function(){return l};this.getCheckedNodeIds=function(){return n};this.fromJsonObject=function(h){q=h.valid;n=h.nodeIds;if(h=h.cases){l=[];for(var m=new Y,v=0;v<h.length;v++){var f=h[v],g=m.getInvalidityCase(f.type);f&&(g.fromJsonObject(f),l.push(g))}}}}function Y(){this.getInvalidityCase=function(n){switch(n){case I.TYPE_MULTI_OUTPUT:return new D;case I.TYPE_LACK_OUTPUT:return new S;case I.TYPE_INVALID_CONFIG:return new ba;case I.TYPE_LACK_INPUT:return new ca;
case I.TYPE_INVALID_UPWARDNODE:return new da;case I.TYPE_INVALID_SOURCE:return new ea;case I.TYPE_TABLE_NO_FIELD:return new fa;case I.TYPE_TABLE_NO_AUTHORITY:return new ha}}}function I(){var n,q=this;this.getType=function(){return n};this.fromJsonObject=function(l){n=l.type;q.protectedFromJsonObject(l)};this.protectedFromJsonObject=function(l){}}function D(){I.call(this);var n=[];this.protectedFromJsonObject=function(q){n=q.outputNodes};this.getOutputNodeIds=function(){return n}}function S(){I.call(this)}
function ba(){I.call(this);var n;this.protectedFromJsonObject=function(q){n=q.nodeIds};this.getNodeIds=function(){return n}}function ha(){I.call(this);var n;this.protectedFromJsonObject=function(q){n=q.nodeIds};this.getNodeIds=function(){return n}}function ca(){I.call(this);var n;this.protectedFromJsonObject=function(q){n=q.nodeIds};this.getNodeIds=function(){return n}}function da(){I.call(this);var n;this.protectedFromJsonObject=function(q){n=q.nodeIds};this.getNodeIds=function(){return n}}function ea(){I.call(this);
var n;this.protectedFromJsonObject=function(q){n=q.nodeIds};this.getNodeIds=function(){return n}}function fa(){I.call(this);var n;this.protectedFromJsonObject=function(q){n=q.nodeIds};this.getNodeIds=function(){return n}}function W(){var n,q=[],l=[];this.getField=function(h){return q[h]};this.getAllField=function(){return q};this.getColumnCount=function(){return q?q.length:0};this.getOneRow=function(h){return l[h]};this.getRowCount=function(){return l?l.length:0};this.getNodeId=function(){return n};
this.fromJsonObject=function(h){for(var m=h.fields,v=0;v<m.length;v++){var f=new x;f.fromJsonObject(m[v]);q.push(f)}l=h.data;n=h.nodeId}}function w(){var n,q,l,h,m=0,v=0,f,g=null;this.setField=function(b){(n=b)&&!b.isMulBaseData()&&q&&l&&(b=b.getOutputDataType(),b!==x.DT_DATE&&b!==x.DT_DATETIME||w.REG_DATETIME.test(l)||w.isCompareOpWithinOrNotWithinValue(q)||(l=(new Date).getTime()));c()};this.updateNotExistFieldByMyself=function(){var b=new x;b.setFromNode(n.getSourceNodeId());b.setName(n.getName());
b.setAlias(n.getAlias());n=b};this.updateNotExistField=function(b){var k=new x;k.setFromNode(b.getSourceNodeId());k.setName(b.getName());k.setAlias(b.getAlias());n=k};this.getField=function(){return n};this.getTargetFieldFullName=function(){return n?n.getFullName():null};this.setCompareOp=function(b){q=b};this.getCompareOp=function(){return q};this.setValue=function(b){l=b;c()};this.getValue=function(){return l};this.setDisplayValue=function(b){h=b};this.getDisplayValue=function(b){return h?!b&&w.isCompareOpWithinOrNotWithinValue(q)?
JSON.parse(h).join(","):w.isCompareOpRelativeDateRangeValue(q)?(b=n.getOutputDataType()===x.DT_DATETIME,J.modelToDisplayText(g,b)):h:""};this.setLeftBracketCount=function(b){m=b};this.getLeftBracketCount=function(){return m};this.setRightBracketCount=function(b){v=b};this.getRightBracketCount=function(){return v};this.setLogicOp=function(b){f=b};this.getLogicOp=function(){return f};this.setRelativeDateRange=function(b){g=b};this.getRelativeDateRange=function(){return g};this.isEmpty=function(){return 0===
m&&0===v&&!n&&!q&&!l&&!f};var c=function(){if(n&&q){var b=n.getOutputDataType();if(l){var k=n.isEnum(),a=n.isMulBaseData(),d=k?n.getEnumValue():null;if(w.isCompareOpWithinOrNotWithinValue(q))if(k){b=JSON.parse(l);k=[];for(a=0;a<b.length;a++){var p=d[b[a]];p&&k.push(p)}h=JSON.stringify(k)}else h=l;else a?h=l:b===x.DT_DATE||b===x.DT_DATETIME?(d=new Date,d.setTime(l),k=new com.kingdee.bos.qing.common.DateFormater,a=k.setFormatString,b=b===x.DT_DATE?"yyyy-MM-dd":"yyyy-MM-dd HH:mm:ss",a.call(k,b),h=k.format(d)):
b===x.DT_BOOLEAN?(d=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(z),h=l===x.BOOLEAN_TRUE?d.get("dataTypeTrue","\u771f"):l===x.BOOLEAN_FALSE?d.get("dataTypeFalse","\u5047"):""):h=k?d[l]?d[l]:"":l}else h=w.isCompareOpRelativeDateRangeValue(q)&&null!=g?J.modelToDisplayText(g,b===x.DT_DATETIME):null}};this.copy=function(){var b=new w;b.setField(n);b.setCompareOp(q);b.setValue(l);b.setDisplayValue(h);b.setLeftBracketCount(m);b.setRightBracketCount(v);b.setLogicOp(f);
b.setRelativeDateRange(g);return b};this.equals=function(b){if(!b)return!1;var k;if(k=n.equals(b.getField())&&q===b.getCompareOp()&&l===b.getValue()&&m===b.getLeftBracketCount()&&v===b.getRightBracketCount()&&f===b.getLogicOp())k=g||b.getRelativeDateRange()?g&&b.getRelativeDateRange()?JSON.stringify(g.toJsonObject())===JSON.stringify(b.getRelativeDateRange().toJsonObject()):!1:!0;return k?!0:!1};this.toJsonObject=function(){if(!n)return null;var b={};b.field=n.toJsonObject();b.compareOp=q;b.value=
l;b.displayValue=h;b.leftBrackets=m;b.rightBrackets=v;b.logicOp=f;g&&(b.relativeDateRange=g.toJsonObject());return b};this.fromJsonObject=function(b){b&&(n=new x,n.fromJsonObject(b.field),q=b.compareOp,l=b.value,h=b.displayValue,m=b.leftBrackets,v=b.rightBrackets,f=b.logicOp,b=b.relativeDateRange)&&(g=new Z,g.fromJsonObject(b))}}function O(){var n=this,q,l=[];this.getNodeIdInConfig=function(){return[]};this.addPropertyChangeCallback=function(h){l.push(h)};this.toJsonObject=function(){var h={};h.type=
q;n.protectedToJsonObject(h);return h};this.fromJsonObject=function(h){q=h.type;n.protectedFromJsonObject(h)};this.protectedToJsonObject=function(h){};this.protectedFromJsonObject=function(h){};this.protectedMethod={firePropertyChangeEvt:function(h){for(var m=0,v=l.length;m<v;m++)l[m](h)},setType:function(h){q=h}}}function aa(){O.call(this);var n=this,q=this.protectedMethod;q.setType(O.TYPE_FILTER);var l=[];this.getFilterItems=function(){return l};this.setFilterItems=function(h){l=h};this.copyFilterItems=
function(){for(var h=[],m=0;m<l.length;m++)h.push(l[m].copy());return h};this.firePropertyChangeEvt=function(){q.firePropertyChangeEvt(TableModeler.KEY_TRANSFORM_FILTER)};this.getNotEmptyFilterItems=function(){for(var h=[],m=0;m<l.length;m++)l[m].isEmpty()||h.push(l[m]);return h};this.protectedToJsonObject=function(h){for(var m=n.getNotEmptyFilterItems(),v=[],f=0,g=m.length;f<g;f++)v.push(m[f].toJsonObject());h.filterItems=v};this.protectedFromJsonObject=function(h){if(h){h=h.filterItems;for(var m=
0;m<h.length;m++){var v=new w;v.fromJsonObject(h[m]);l.push(v)}}};this.clone=function(){var h=new aa;h.setFilterItems(n.getNotEmptyFilterItems());return h}}function N(){var n=N.TYPE_ONCE,q=N.STRATEGY_FULL,l,h;this.setType=function(m){if(m===N.TYPE_ONCE||m===N.TYPE_TIMING)n=m;else throw Error("IllegalArgument: "+m);};this.getType=function(){return n};this.setStrategy=function(m){if(m===N.STRATEGY_FULL||m===N.STRATEGY_INCREMENTAL)q=m;else throw Error("IllegalArgument: "+m);};this.getStrategy=function(){return q};
this.setSchedule=function(m){l=m};this.getSchedule=function(){return l};this.setBasedFields=function(m){h=m};this.getBasedFields=function(){return h};this.copy=function(){var m=new N;m.setType(n);m.setStrategy(q);l&&m.setSchedule(l.copy());if(h){for(var v=[],f=0;f<h.length;f++)v.push(h[f].copy());m.setBasedFields(v)}return m};this.toJsonObject=function(){var m={};m.type=n;m.strategy=q;l&&(m.schedule=l.toJsonObject());if(h){for(var v=[],f=0;f<h.length;f++)v.push(h[f].toJsonObject());m.basedFields=
v}return m};this.fromJsonObject=function(m){n=m.type;q=m.strategy;m.schedule&&(l=new T,l.fromJsonObject(m.schedule));if(m=m.basedFields){h=[];for(var v=0;v<m.length;v++){var f=new V;f.fromJsonObject(m[v]);h.push(f)}}};this.equals=function(m){if(m instanceof N){if(n!==m.getType()||q!==m.getStrategy())return!1;var v=m.getSchedule();if(l&&!v||!l&&v)return!1;if(l&&v){var f=l.toJsonObject();v=v.toJsonObject();for(var g in f)if(f[g]!==v[g])return!1}m=m.getBasedFields();if(!h&&!m)return!0;if(!h||!m||h.length!==
m.length)return!1;for(f=0;f<h.length;f++)if(!h[f].equals(m[f]))return!1;return!0}return!1}}function V(){var n,q,l,h;this.setTableId=function(m){n=m};this.getTableId=function(){return n};this.setTableName=function(m){q=m};this.getTableName=function(){return q};this.setName=function(m){l=m};this.getName=function(){return l};this.setAlias=function(m){h=m};this.getAlias=function(){return h};this.copy=function(){var m=new V;m.setTableId(n);m.setTableName(q);m.setName(l);m.setAlias(h);return m};this.toJsonObject=
function(){var m={};m.tableId=n;m.tableName=q;m.name=l;m.alias=h;return m};this.fromJsonObject=function(m){n=m.tableId;q=m.tableName;l=m.name;h=m.alias};this.equals=function(m){return m instanceof V?n===m.getTableId()&&q===m.getTableName()&&l===m.getName()&&h===m.getAlias():!1}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==
typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var z=com.kingdee.bos.qing.modeler.designer;z.QingModeler=function(){var n;this.setModelerModel=function(q){n=q};this.getModelerModel=function(){return n};this.toJsonObject=function(){var q={};q.modelerModel=n.toJsonObject();return q};this.fromJsonObject=function(q){(q=q.modelerModel)&&(n=z.ModelerModerParser.parseToModel(q.type,
q))}};z.AbstractModelerModelParser=function(){this.parseToModel=function(n){throw Error("override me");}};z.ModelerModel=u;z.AbstractPage=function(){function n(f,g,c,b){this.getLeftExtension=function(){return f};this.getTopExtension=function(){return g};this.getHorizonExtension=function(){return f+c};this.getVerticalExtension=function(){return g+b}}var q=this,l=1024,h=768,m=[];this.getWidth=function(){return l};this.getHeight=function(){return h};this.addPropertyChangeCallback=function(f){m.push(f)};
this.setExtension=function(f,g,c,b){f=new n(f,g,c,b);l+=f.getHorizonExtension();h+=f.getVerticalExtension();v(u.KEY_PAGE_SIZE,f)};this.toJsonObject=function(){var f={};f.width=l;f.height=h;q.protectedToJsonObject(f);return f};this.fromJsonObject=function(f){l=f.width;h=f.height;q.protectedFromJsonObject(f)};this.protectedToJsonObject=function(f){};this.protectedFromJsonObject=function(f){};var v=function(f,g){for(var c=0,b=m.length;c<b;c++)m[c](f,g)};this.protectedMethod={firePropertyChangeEvt:v}};
z.Node=C;z.Table=A;z.DesignTimeSource=H;z.Field=x;z.UserSQL=G;z.PreviewConfig=M;z.RuntimeModel=function(){var n,q=[],l=[],h;this.setOutputVertexId=function(m){n=m};this.addEdge=function(m){q.push(m)};this.addVertex=function(m){l.push(m)};this.getVertexes=function(){return l};this.setPreviewConfig=function(m){h=m};this.toJsonObject=function(){for(var m={},v=[],f=[],g=0,c=q.length;g<c;g++)v.push(q[g].toJsonObject());g=0;for(c=l.length;g<c;g++)f.push(l[g].toJsonObject());m.edges=v;m.vertexes=f;m.outputVertexId=
n;m.previewConfig=h?h.toJsonObject():null;return m}};z.Edge=function(n,q){this.toJsonObject=function(){var l={};l.fromId=n;l.toId=q;return l}};z.SourceVertex=function(){L.call(this);var n,q,l;this.protectedMethod.setType(L.TYPE_SOURCE);this.setTable=function(h){n=h};this.setSource=function(h){q=h};this.setSelectedFields=function(h){l=h};this.protectedToJson=function(h){h.table=n.toJsonObject();h.source=q.toJsonObject();if(l){for(var m=[],v=0;v<l.length;v++)m.push(l[v].toJsonObject());h.selectedFields=
m}}};z.ExecuteResult=function(){var n,q=[],l,h;this.getNodeId=function(){return n};this.getValidity=function(){return h};this.getPreviewData=function(){return l};this.getFields=function(){return q};this.fromJsonObject=function(m){n=m.nodeId;var v=m.validity;v&&(h=new X,h.fromJsonObject(v));if(v=m.previewData)l=new W,l.fromJsonObject(v);if(m=m.fields)for(v=0;v<m.length;v++){var f=m[v],g=new x;g.fromJsonObject(f);q.push(g)}}};z.PreviewData=W;z.FilterItem=w;z.MaterializedConfig=N;z.BasedField=V;z.FilterConfig=
aa;var Z,J,T;(function(){var n=com.kingdee.bos.qing.common;Z=n.RelativePeriodModel;n=com.kingdee.bos.qing.common.ui;J=n.RelativePeriodPanel;n=com.kingdee.bos.qing.schedule;T=n.QingSchedule})();z.ModelerModerParser=new function(){var n={};this.registerParser=function(q,l){n[q]=l};this.parseToModel=function(q,l){return(q=n[q])&&q.parseToModel(l)}};u.TYPE_TABLE_MODELER="table";u.TYPE_RELATION_MODELER="relation";u.TYPE_METRIC_MODELER="metric";u.KEY_UPDATE_TABLE="update_table";u.KEY_ADD_TABLE="add_table";
u.KEY_REMOVE_TABLE="remove_table";u.KEY_TABLE_SELECT_FIELD="table_select_field";u.KEY_TABLE_SET_FILTER="table_set_filter";u.KEY_PAGE_SIZE="page_change_size";u.KEY_ADD_PREPARED_SOURCE="add_prepared_source";u.KEY_REMOVE_PREPARED_SOURCE="remove_prepared_source";u.KEY_SET_PREPARED_SOURCE="set_prepared_source";u.KEY_NODE_CHANGE_ALIAS="node_change_alias";u.KEY_NODE_CHANGE_POSITION="node_change_position";u.KEY_TABLE_NODE_SELECT_FIELD="table_node_select_field";C.TYPE_TABLE="table";C.TYPE_TRANSFORM="transform";
x.DT_BOOLEAN="BOOLEAN";x.DT_INT="INT";x.DT_NUMBER="NUMBER";x.DT_DATE="DATE";x.DT_DATETIME="DATETIME";x.DT_STRING="STRING";x.ROUND_MODE_UP="ROUND_UP";x.ROUND_MODE_DOWN="ROUND_DOWN";x.ROUND_MODE_HALF_UP="ROUND_HALF_UP";x.BOOLEAN_TRUE="true";x.BOOLEAN_FALSE="false";x.EXTENSION_BIZ_FIELD_ENUM_KEY="bizFieldEnumKey";x.EXTENSION_IS_MUL_BASE_DATA="isMulBaseData";x.EXTENSION_IS_PK="isPK";z.UIDHelper=new function(){var n,q={};this.init=function(a,d){q={};n=a;d&z.UIDHelper.SUPPORT_TYPE_NODE&&g();d&z.UIDHelper.SUPPORT_TYPE_SOURCE&&
c();d&z.UIDHelper.SUPPORT_TYPE_TABLE&&b();d&z.UIDHelper.SUPPORT_TYPE_LINE&&k();d&z.UIDHelper.SUPPORT_TYPE_DIMENSION&&h();d&z.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION&&m();d&z.UIDHelper.SUPPORT_TYPE_METRIC&&v();d&z.UIDHelper.SUPPORT_TYPE_REFERENCE&&f()};this.getUID=function(a){var d=q[a];d||(d=0);d+=1;q[a]=d;return a+d};var l=function(a,d,p){for(var y=0,r=0;r<d.length;r++)for(var e=p(d[r]),t=0;t<e.length;t++){var B=e[t];y=Math.max(y,parseInt(B.slice(a.length,B.length)))}q[a]=y},h=function(){var a=n.getAllDimension();
a&&l(z.UIDHelper.NS_DIMENSION,a,function(d){return[d.getDimensionId()]})},m=function(){var a=n.getPublicDimensions();a&&l(z.UIDHelper.NS_PUBLIC_DIMENSION,a,function(d){return[d.getId()]});(a=n.getAllDimension())&&l(z.UIDHelper.NS_PUBLIC_DIMENSION,a,function(d){return[d.getPublicDimensionId()]})},v=function(){var a=n.getAllMetric();a&&l(z.UIDHelper.NS_METRIC,a,function(d){return[d.getId()]})},f=function(){var a=n.getExprReferences();a&&l(z.UIDHelper.NS_REFERENCE,a,function(d){return[d.getId()]})},
g=function(){var a=n.getAllNodes();a&&l(z.UIDHelper.NS_NODE,a,function(d){var p=[];p.push(d.getId());d.getType()==C.TYPE_TRANSFORM&&(d=d.getNodeIdInConfig(),p=p.concat(d));return p})},c=function(){var a=n.getAllSource();a&&l(z.UIDHelper.NS_SOURCE,a,function(d){return[d.getId()]})},b=function(){var a=n.getAllTable();a&&l(z.UIDHelper.NS_TABLE,a,function(d){return[d.getUid()]})},k=function(){var a=n.getAllLines();a&&l(z.UIDHelper.NS_LINE,a,function(d){return[d.getId()]})}};z.UIDHelper.NS_NODE="n";z.UIDHelper.NS_LINE=
"l";z.UIDHelper.NS_TABLE="t";z.UIDHelper.NS_SOURCE="s";z.UIDHelper.NS_DIMENSION="d";z.UIDHelper.NS_PUBLIC_DIMENSION="pd";z.UIDHelper.NS_METRIC="m";z.UIDHelper.NS_REFERENCE="r";z.UIDHelper.SUPPORT_TYPE_NODE=1;z.UIDHelper.SUPPORT_TYPE_LINE=2;z.UIDHelper.SUPPORT_TYPE_TABLE=4;z.UIDHelper.SUPPORT_TYPE_SOURCE=8;z.UIDHelper.SUPPORT_TYPE_DIMENSION=16;z.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION=32;z.UIDHelper.SUPPORT_TYPE_METRIC=64;z.UIDHelper.SUPPORT_TYPE_REFERENCE=128;z.UIDHelper.METRIC_SCENE=z.UIDHelper.SUPPORT_TYPE_TABLE|
z.UIDHelper.SUPPORT_TYPE_SOURCE|z.UIDHelper.SUPPORT_TYPE_DIMENSION|z.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION|z.UIDHelper.SUPPORT_TYPE_METRIC|z.UIDHelper.SUPPORT_TYPE_REFERENCE;M.ALL_DATA_NUMBER=-1;L.TYPE_SOURCE="source";L.TYPE_TRANSFORM_FIELD_SELECT="field_select";L.TYPE_TRANSFORM_FIELD_SETTING="field_setting";L.TYPE_TRANSFORM_GROUP_BY="group_by";L.TYPE_TRANSFORM_FILTER="filter";L.TYPE_TRANSFORM_SORT="sort";L.TYPE_TRANSFORM_JOIN="join";I.TYPE_MULTI_OUTPUT="multiOutput";I.TYPE_LACK_OUTPUT="lackOutputNode";
I.TYPE_INVALID_CONFIG="invalidConfig";I.TYPE_LACK_INPUT="lackInputNode";I.TYPE_INVALID_UPWARDNODE="invalidUpwardNode";I.TYPE_INVALID_SOURCE="invalidSource";I.TYPE_TABLE_NO_FIELD="tableNoField";I.TYPE_TABLE_NO_AUTHORITY="tableNoAuthority";w.REG_NUMBER=/^-?\d+(\.\d+)?$/;w.REG_DATETIME=/^-?\d+(\.\d+)?$/;w.COMPARE_EQUAL="EQUAL";w.COMPARE_NOT_EQUAL="NOT_EQUAL";w.COMPARE_GREATER="GREATER";w.COMPARE_GREATER_EQUAL="GREATER_EQUAL";w.COMPARE_LESS="LESS";w.COMPARE_LESS_EQUAL="LESS_EQUAL";w.COMPARE_INCLUDE="INCLUDE";
w.COMPARE_NOT_INCLUDE="NOT_INCLUDE";w.COMPARE_START_WITH="START_WITH";w.COMPARE_END_WITH="END_WITH";w.COMPARE_NULL="NULL";w.COMPARE_NOT_NULL="NOT_NULL";w.COMPARE_IN="IN";w.COMPARE_NOT_IN="NOT_IN";w.COMPARE_RELATIVE_DATE_RANGE="RELATIVE_DATE_RANGE";w.LOGIC_AND="AND";w.LOGIC_OR="OR";w.COMPARES_FOR_STRING=[w.COMPARE_EQUAL,w.COMPARE_NOT_EQUAL,w.COMPARE_INCLUDE,w.COMPARE_NOT_INCLUDE,w.COMPARE_START_WITH,w.COMPARE_END_WITH,w.COMPARE_NULL,w.COMPARE_NOT_NULL,w.COMPARE_IN,w.COMPARE_NOT_IN];w.COMPARES_FOR_ENUM=
[w.COMPARE_EQUAL,w.COMPARE_NOT_EQUAL,w.COMPARE_NULL,w.COMPARE_NOT_NULL,w.COMPARE_IN,w.COMPARE_NOT_IN];w.COMPARES_FOR_NUMBER=[w.COMPARE_EQUAL,w.COMPARE_NOT_EQUAL,w.COMPARE_GREATER,w.COMPARE_GREATER_EQUAL,w.COMPARE_LESS,w.COMPARE_LESS_EQUAL,w.COMPARE_NULL,w.COMPARE_NOT_NULL,w.COMPARE_IN,w.COMPARE_NOT_IN];w.COMPARES_FOR_DATETIME=[w.COMPARE_RELATIVE_DATE_RANGE,w.COMPARE_EQUAL,w.COMPARE_NOT_EQUAL,w.COMPARE_GREATER,w.COMPARE_GREATER_EQUAL,w.COMPARE_LESS,w.COMPARE_LESS_EQUAL,w.COMPARE_NULL,w.COMPARE_NOT_NULL];
w.COMPARES_FOR_BOOLEAN=[w.COMPARE_EQUAL,w.COMPARE_NOT_EQUAL,w.COMPARE_NULL,w.COMPARE_NOT_NULL];w.isCompareOpWithoutValue=function(n){return n===w.COMPARE_NULL||n===w.COMPARE_NOT_NULL};w.isCompareOpWithinOrNotWithinValue=function(n){return n===w.COMPARE_IN||n===w.COMPARE_NOT_IN};w.isCompareOpRelativeDateRangeValue=function(n){return n===w.COMPARE_RELATIVE_DATE_RANGE};w.getSelectableCompares=function(n,q){switch(n){case x.DT_STRING:return q?w.COMPARES_FOR_ENUM:w.COMPARES_FOR_STRING;case x.DT_NUMBER:case x.DT_INT:return w.COMPARES_FOR_NUMBER;
case x.DT_DATE:case x.DT_DATETIME:return w.COMPARES_FOR_DATETIME;case x.DT_BOOLEAN:return w.COMPARES_FOR_BOOLEAN;default:throw Error("Unknown DataType");}};w.FiltersCheckingResult=function(n,q){var l=q;this.getFiltersErrorRow=function(){return n};this.getPrompt=function(){return l};this.setPrompt=function(h){l=h}};O.TYPE_FIELD_SELECT="field_select";O.TYPE_FIELD_SETTING="field_setting";O.TYPE_FILTER="filter";O.TYPE_SORT="sort";O.TYPE_GROUP_BY="group_by";O.TYPE_CALCULATED_FIELD="calculated_field";O.TYPE_CUSTOM_GROUP=
"custom_group";O.TYPE_JOIN="join";O.TYPE_UNION="union";N.TYPE_ONCE="once";N.TYPE_TIMING="timing";N.STRATEGY_FULL="full";N.STRATEGY_INCREMENTAL="incremental";z.ENTITY_SEPARATOR="@#!&@"})();(function(){function u(){T.call(this);var f=this,g=this.protectedMethod,c=[],b=[],k=[],a=[],d=[];f.setType(T.TYPE_METRIC_MODELER);f.setMaterializedConfig(new v);this.protectedIsTableInUse=function(r){return!0};this.isTableReferred=function(r){p();for(var e=0;e<a.length;e++){var t=a[e];if(t instanceof M&&t.getTableId()==r.getUid())return!0}for(e=0;e<c.length;e++){t=c[e].getFilterItems();for(var B=0;B<t.length;B++){var E=t[B].getField();if(E&&E.getTableId()==r.getUid())return!0}}return!1};this.getAllDimension=
function(){return b};this.setDimensions=function(r){b=r};this.addDimension=function(r,e){isNaN(e)?b.push(r):b.splice(e,0,r);g.firePropertyChangeEvt(u.KEY_ADD_DIMENSION,r)};this.removeDimension=function(r){for(var e=0;e<b.length;e++)if(b[e].isSame(r))return b.splice(e,1),g.firePropertyChangeEvt(u.KEY_REMOVE_DIMENSION,[r]),e;return-1};this.updateDimension=function(r,e){if(isNaN(e))return!1;b.splice(e,1);b.splice(e,0,r);g.firePropertyChangeEvt(u.KEY_UPDATE_DIMENSION,b)};this.updateDimensions=function(r){b=
r;g.firePropertyChangeEvt(u.KEY_BATCH_UPDATE_DIMENSION,r)};this.getDimensionById=function(r){for(var e=0;e<b.length;e++)if(b[e].getDimensionId()==r)return b[e]};this.getDimensionByName=function(r){for(var e=0;e<b.length;e++)if(b[e].getName()==r)return b[e]};this.getPublicDimensions=function(){return k};this.getPublicDimensionById=function(r){for(var e=0;e<k.length;e++)if(k[e].getId()==r)return k[e]};this.getSamePublicDimension=function(r){for(var e=0;e<k.length;e++){var t=k[e];if(t.isSame(r))return t}};
this.setPublicDimensions=function(r){k=r};this.removePublicDimensionById=function(r){for(var e=0;e<k.length;e++)if(k[e].getId()==r)return k.splice(e,1),e;return-1};this.addPublicDimension=function(r,e){isNaN(e)?k.push(r):k.splice(e,0,r)};this.checkDimensionRef=function(r,e){var t=f.getAllTable();if(e&&2<=t.length)return!0;for(e=0;e<b.length;e++)if(b[e].getPublicDimensionId()==r)return!0;return!1};this.checkTableExist=function(r){for(var e=f.getAllTable(),t=0;t<e.length;t++)if(r==e[t].getUid())return!0;
return!1};this.setMetrics=function(r){c=r};this.addMetric=function(r,e){isNaN(e)?c.push(r):c.splice(e,0,r);g.firePropertyChangeEvt(u.KEY_ADD_METRIC,r)};this.removeMetric=function(r){var e=c.indexOf(r);return-1<e?(c.splice(e,1),g.firePropertyChangeEvt(u.KEY_REMOVE_METRIC,r),e):-1};this.updateMetric=function(r){var e=f.getMetric(r.getId());e&&(e.update(r),g.firePropertyChangeEvt(u.KEY_UPDATE_METRIC,e))};this.getAllMetric=function(){return c};this.getMetric=function(r){for(var e=0;e<c.length;e++){var t=
c[e];if(t.getId()==r)return t}};this.setExprReferences=function(r){a=r};this.setUnreferencedRef=function(r){d=r};this.getExprReferences=function(){return a};this.copyExprReferences=function(){for(var r=[],e=0;e<a.length;e++){var t=a[e].copy();r.push(t)}return r};this.getExprReference=function(r){for(var e=0;e<a.length;e++){var t=a[e];if(r==t.getId())return t}};this.repairDimensionRef=function(r){};this.addExprRefIfNotExist=function(r){for(var e=0;e<a.length;e++){var t=a[e];if(t.equals(r))return t}for(e=
0;e<d.length;e++)if(t=d[e],t.equals(r)){r=t;d.splice(e,1);break}a.push(r);return r};this.protectedToJsonObject=function(r){for(var e=[],t=0;t<c.length;t++)e.push(c[t].toJsonObject());r.metrics=e;p();e=[];for(t=0;t<a.length;t++)e.push(a[t].toJsonObject());r.references=e;e=[];for(t=0;t<d.length;t++)e.push(d[t].toJsonObject());r.unreferencedRef=e;e=[];for(t=0;t<b.length;t++)e.push(b[t].toJsonObject());r.dimensions=e;e=[];for(t=0;t<k.length;t++)k[t].isEmpty()||e.push(k[t].toJsonObject());r.publicDimensions=
e;f.getMaterializedConfig()||(t=new v,r.materializedConfig=t.toJsonObject())};this.protectedFromJsonObject=function(r){var e=r.metrics;if(e)for(var t=0;t<e.length;t++){var B=new C;B.fromJsonObject(e[t]);c.push(B)}if(e=r.references)for(t=0;t<e.length;t++){B=e[t];switch(B.type){case x.FIELD_TYPE:var E=new M;break;case x.METRIC_TYPE:E=new L;break;default:throw Error("unknown type");}E.fromJsonObject(B);a.push(E)}if(e=r.dimensions)for(t=0;t<e.length;t++)B=new A,B.fromJsonObject(e[t]),b.push(B);if(r=r.publicDimensions)for(t=
0;t<r.length;t++)e=new G,e.fromJsonObject(r[t]),k.push(e);e=y();t=[];for(r=0;r<e.length;r++)B=e[r],f.getExprReference(B)||t.push(B);for(r=0;r<t.length;r++)for(e=t[r],B=0;B<c.length;B++){E=c[B];var K=E.getExpr();E.setExpr(J.ExprRefHelper.replaceRefText(K,e,""))}};this.copy=function(){var r=new u;g.copy(r);for(var e=[],t=0;t<c.length;t++)e.push(c[t].clone());r.setMetrics(e);e=[];for(t=0;t<b.length;t++)e.push(b[t].copy());r.setDimensions(e);e=[];for(t=0;t<k.length;t++)e.push(k[t].copy());r.setPublicDimensions(e);
e=[];for(t=0;t<a.length;t++)e.push(a[t].copy());r.setExprReferences(e);e=[];for(t=0;t<d.length;t++)e.push(d[t].copy());r.setUnreferencedRef(e);return r};var p=function(){for(var r=y(),e=[],t=[],B=0;B<a.length;B++){var E=a[B];-1<r.indexOf(E.getId())?e.push(E):t.push(E)}a=e;d=t},y=function(){for(var r=[],e=0;e<c.length;e++){var t=c[e].getExpr();(t=J.ExprRefHelper.getRefTextInExpr(t))&&(r=r.concat(t))}return r}}function C(){var f,g,c,b,k,a,d=[];this.setNumber=function(p){f=p};this.getNumber=function(){return f};
this.setId=function(p){g=p};this.getId=function(){return g};this.setName=function(p){c=p};this.getName=function(){return c};this.setDesc=function(p){b=p};this.getDesc=function(){return b};this.setExpr=function(p){k=p};this.getExpr=function(){return k};this.setFormat=function(p){a=p};this.getFormat=function(){return a};this.setFilterItems=function(p){d=p};this.getFilterItems=function(){return d};this.update=function(p){f=p.getNumber();k=p.getExpr();c=p.getName();b=p.getDesc();a=p.getFormat();d=p.getFilterItems()};
this.clone=function(){var p=new C;p.setNumber(f);p.setId(g);p.setExpr(k);p.setName(c);p.setDesc(b);p.setFormat(a);for(var y=[],r=0;r<d.length;r++){var e=d[r].copy();y.push(e)}p.setFilterItems(y);return p};this.equals=function(p){if(p.getName()!==c||p.getDesc()!==b||p.getExpr()!==k||p.getFormat()!==a||p.getNumber()!==f||d.length!==p.getFilterItems().length)return!1;p=p.getFilterItems();for(var y=0;y<d.length;y++)if(!d[y].equals(p[y]))return!1;return!0};this.toJsonObject=function(){var p={};p.number=
f;p.id=g;p.name=c;p.desc=b;p.expr=k;p.format=a;for(var y=[],r=0;r<d.length;r++)y.push(d[r].toJsonObject());p.filterItems=y;return p};this.fromJsonObject=function(p){g=p.id;f=p.number;c=p.name;b=p.desc;k=p.expr;a=p.format;if(p=p.filterItems)for(var y=0;y<p.length;y++){var r=new m;r.fromJsonObject(p[y]);d.push(r)}}}function A(){var f,g,c,b=!1,k=!1,a,d,p,y,r=this;this.setDimensionId=function(e){f=e};this.getDimensionId=function(){return f};this.setName=function(e){g=e};this.getName=function(){return g};
this.setNumber=function(e){c=e};this.getNumber=function(){return c};this.setNumberModified=function(e){b=e};this.isNumberModified=function(){return b};this.setNameModified=function(e){k=e};this.isNameModified=function(){return k};this.setDimensionType=function(e){a=e};this.getDimensionType=function(){return a};this.setDateFormat=function(e){d=e};this.getDateFormat=function(){return d};this.setRequired=function(e){p=e};this.isRequired=function(){return p};this.getPublicDimensionId=function(){return y};
this.setPublicDimensionId=function(e){y=e};this.copy=function(){var e=new A;e.setDimensionId(f);e.setName(g);e.setNumber(c);e.setNumberModified(b);e.setNameModified(k);e.setDimensionType(a);d?e.setDateFormat(d):a==A.TYPE_DATE&&e.setDateFormat(A.VALUE_YYYY);e.setRequired(p);e.setPublicDimensionId(y);return e};this.isSame=function(e){return e?g==e.getName()&&c==e.getNumber()&&b==e.isNumberModified()&&k==e.isNameModified()&&a==e.getDimensionType()&&f==e.getDimensionId()&&(d==e.getDateFormat()||null==
d&&e.getDateFormat()==A.VALUE_YYYY)&&y==e.getPublicDimensionId()?!0:!1:!1};this.toJsonObject=function(){var e={};e.id=f;e.name=g;e.number=c;e.isNumberModified=b;e.isNameModified=k;e.dimensionType=a;e.dateFormatType=d;e.required=p;e.publicDimensionId=y;return e};this.fromJsonObject=function(e){f=e.id;g=e.name;c=e.number;b=e.isNumberModified;k=e.isNameModified;a=e.dimensionType;void 0!=e.dateFormatType&&r.setDateFormat(e.dateFormatType);e.required&&r.setRequired(e.required);y=e.publicDimensionId}}function G(){var f,
g,c=!1,b=[];this.setId=function(a){f=a};this.getId=function(){return f};this.setName=function(a){g=a};this.getName=function(){return g};this.setNameModified=function(a){c=a};this.isNameModified=function(){return c};this.isSame=function(a){if(!a)return!1;a=a.getFields();if(a.length!=b.length)return!1;for(var d=0;d<b.length;d++)if(!b[d].isSame(a[d]))return!1;return!0};this.getDataType=function(){return 0==b.length?null:b[0].getDataType()};this.setFields=function(a){b=a};this.addField=function(a){b.push(a)};
this.insertField=function(a,d){b.splice(a,0,d)};this.getFields=function(){return b};this.getFieldByIndex=function(a){return b[a]};this.getLastField=function(){return b[b.length-1]};this.removeField=function(a){b.splice(a,1)};this.empty=function(a){g=null;a&&(f=null)};this.isEmpty=function(){return!g};this.updateFields=function(a){for(var d=0;d<b.length;d++){var p=b[d];if(p&&p.getName()){var y=p.getTableId();y=a[y]?a[y]:[];for(var r=!1,e=0;e<y.length;e++)if(y[e]&&y[e].getName()==p.getName()){r=!0;
p.update(y[e]);break}r||p.updateWhenNotExist();p.setExist(r)}}};this.isDataTypeConsistent=function(){if(0==b.length)return!1;var a=b[0];if(!a)return!1;for(var d=1;d<b.length;d++){var p=b[d];if(!p||a.getDataType()!=p.getDataType()||!k(a.getField(),p.getField()))return!1}return!0};this.tryGenerateId=function(a){var d=!0;if(a){a=a.getFields();for(var p=0;p<b.length;p++){var y=a[p].getField().getFullName(),r=b[p].getField().getFullName();if(y==r){d=!1;break}}}else d=!1;if(!f||d)d=com.kingdee.bos.qing.modeler.designer.UIDHelper,
f=d.getUID(d.NS_PUBLIC_DIMENSION)};this.tryGenerateName=function(a){if(0!=b.length){var d=b[0];g=c||!d.getAlias()?g:a()}};this.isFieldsCompleted=function(){for(var a=!1,d=0;d<b.length;d++)b[d].getName()&&(a=!0);if(!a&&!g)return!0;for(d=0;d<b.length;d++)if(a=b[d],!a.getName()||!a.isExist())return!1;return!0};this.copy=function(){var a=new G;a.setId(f);a.setName(g);for(var d=[],p=0;p<b.length;p++){var y=b[p].copy();d.push(y)}a.setFields(d);a.setNameModified(c);return a};this.toJsonObject=function(){var a=
{};a.id=f;a.name=g;a.isNameModified=c;for(var d=[],p=0;p<b.length;p++)d.push(b[p].toJsonObject());a.fields=d;return a};this.fromJsonObject=function(a){f=a.id;g=a.name;c=a.isNameModified;if(a=a.fields)for(var d=0;d<a.length;d++){var p=new H;p.fromJsonObject(a[d]);b.push(p)}};var k=function(a,d){a=a?a.getEnumValue():null;d=d?d.getEnumValue():null;if(!a&&!d)return!0;if(!a&&d||a&&!d||Object.keys(d).length!=Object.keys(a).length)return!1;for(var p in d){var y=d[p],r=a[p];if(!r||r!=y)return!1}return!0}}
function H(){var f=new l,g=!0;this.getField=function(){return f};this.setField=function(c){f=c};this.setName=function(c){f.setName(c)};this.getName=function(){return f.getName()};this.getTableId=function(){return f.getTableId()};this.setTableId=function(c){f.setTableId(c)};this.getDataType=function(){return f.getDataType()};this.setDataType=function(c){f.setDataType(c)};this.getAlias=function(){return f.getAlias()};this.setAlias=function(c){f.setAlias(c)};this.setExist=function(c){g=c};this.isExist=
function(){return g};this.update=function(c){f=c};this.updateWhenNotExist=function(){var c=new l;c.setName(f.getName());c.setTableId(f.getTableId());c.setAlias(f.getAlias());f=c};this.copy=function(){var c=new H;c.setField(f);c.setExist(g);return c};this.isSame=function(c){return f.getName()==c.getName()&&f.getTableId()==c.getTableId()?!0:!1};this.toJsonObject=function(){var c={};c.name=f.getName();c.tableId=f.getTableId();c.alias=f.getAlias();return c};this.fromJsonObject=function(c){f.setName(c.name);
f.setTableId(c.tableId);f.setAlias(c.alias)}}function x(){var f=this,g,c;this.setId=function(b){g=b};this.getId=function(){return g};this.setType=function(b){c=b};this.getType=function(){return c};this.getRefDisplayText=function(b){throw Error("override me");};this.isRightDisplayFormat=function(b,k){throw Error("override me");};this.fromDisplayText=function(b,k,a){throw Error("override me");};this.equals=function(b){throw Error("override me");};this.fromJsonObject=function(b){g=b.id;c=b.type;f.protectedFromJsonObject(b)};
this.toJsonObject=function(){var b={};b.id=g;b.type=c;f.protectedToJsonObject(b);return b};this.protectedFromJsonObject=function(b){};this.protectedToJsonObject=function(b){};this.protectedMethod={copy:function(b){b.setId(g);b.setType(c)}}}function M(){x.call(this);var f=this,g=this.protectedMethod,c,b,k;f.setType(x.FIELD_TYPE);this.copy=function(){var a=new M;a.setTableId(c);a.setFieldName(b);a.setAlias(k);g.copy(a);return a};this.setTableId=function(a){c=a};this.getTableId=function(){return c};
this.setFieldName=function(a){b=a};this.getFieldName=function(){return b};this.setAlias=function(a){k=a};this.getRefDisplayText=function(a){a=a.getTable(c);var d=k?k:b;return J.TableNameHelper.getDisplayText(a)+"."+d};this.isRightDisplayFormat=function(a){return-1<a.indexOf(".")};this.fromDisplayText=function(a,d,p){var y=a.split(".")[0];c=y;var r=d.getAllTable();for(d=0;d<r.length;d++){var e=r[d];if(J.TableNameHelper.getDisplayText(e)==y){c=e.getUid();break}}b=a=a.substring(y.length+1);p=p?p[c]:
[];for(d=0;d<p.length;d++)if(y=p[d],y.getAlias()==a){b=y.getName();k=a;break}};this.equals=function(a){return a.getType()!=f.getType()?!1:a.getTableId()==c&&a.getFieldName()==b?!0:!1};this.copy=function(){var a=new M;g.copy(a);a.setTableId(c);a.setFieldName(b);a.setAlias(k);return a};this.protectedFromJsonObject=function(a){c=a.tableId;b=a.fieldName;k=a.alias};this.protectedToJsonObject=function(a){a.tableId=c;a.fieldName=b}}function L(){x.call(this);var f=this,g=this.protectedMethod,c;f.setType(x.METRIC_TYPE);
this.copy=function(){var b=new L;b.setMetricId(c);g.copy(b);return b};this.setMetricId=function(b){c=b};this.getMetricId=function(){return c};this.getRefDisplayText=function(b){return(b=b.getMetric(c))?b.getName():""};this.isRightDisplayFormat=function(b,k){var a=b.match(/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/),d=!1;if(a){k=k.getAllMetric();for(var p=0;p<k.length;p++)k[p].getName()==b&&(d=!0)}return a&&d};this.fromDisplayText=function(b,k){k=k.getAllMetric();for(var a=0;a<k.length;a++){var d=k[a];
if(d.getName()==b){c=d.getId();break}}if(!c)throw Error("invalid ref");};this.equals=function(b){return b.getType()!=f.getType()?!1:c==b.getMetricId()};this.copy=function(){var b=new L;g.copy(b);b.setMetricId(c);return b};this.protectedFromJsonObject=function(b){c=b.metricId};this.protectedToJsonObject=function(b){b.metricId=c}}function X(){x.call(this);var f=this,g=this.protectedMethod,c,b;f.setType(x.DIMENSION_TYPE);this.copy=function(){var k=new L;k.setDimensionId(c);k.setDimensionName(b);g.copy(k);
return k};this.setDimensionId=function(k){c=k};this.getDimensionId=function(){return c};this.setDimensionName=function(k){b=k};this.getDimensionName=function(){return b};this.getRefDisplayText=function(k){var a=k.getDimensionById(c);a||(a=k.getDimensionByName(b));return a?a.getName():b};this.isRightDisplayFormat=function(k,a){var d=k.match(/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_()]{1,}$/),p=!1;if(d){a=a.getAllDimension();for(var y=0;y<a.length;y++)a[y].getName()==k&&(p=!0)}return d&&p};this.fromDisplayText=
function(k,a){a=a.getAllDimension();for(var d=0;d<a.length;d++){var p=a[d];if(p.getName()==k){c=p.getDimensionId();b=p.getName();break}}if(!c)throw Error("invalid ref");};this.equals=function(k){return k.getType()!=f.getType()?!1:c==k.getDimensionId()&&b==k.getDimensionName()};this.copy=function(){var k=new X;g.copy(k);k.setDimensionId(c);k.setDimensionName(b);return k};this.protectedFromJsonObject=function(k){c=k.dimensionId;b=k.dimensionName};this.protectedToJsonObject=function(k){k.dimensionId=
c;k.dimensionName=b}}function Y(){var f,g,c=[];this.isValid=function(){return f};this.getCases=function(){return c};this.isModelEmpty=function(){return g};this.fromJsonObject=function(b){f=b.valid;g=b.modelIsEmpty;if(b=b.cases){c=[];for(var k=new I,a=0;a<b.length;a++){var d=b[a],p=k.getInvalidityCase(d.type);d&&(p.fromJsonObject(d),c.push(p))}}}}function I(){this.getInvalidityCase=function(f){switch(f){case D.TYPE_NO_METRIC:return new ba;case D.TYPE_INVALID_FIELD_REF:return new ha;case D.TYPE_INVALID_EXPR:return new ea;
case D.TYPE_INVALID_FIELD_FILTER_REF:return new ca;case D.TYPE_INVALID_DIMENSION_REF:return new w;case D.TYPE_INVALID_DIMENSION_TYPE:return new O;case D.TYPE_INVALID_PUBLIC_DIMENSION:return new N;case D.TYPE_INVALID_TABLE:return new Z;case D.TYPE_INVALID_EXPR_DATA_TYPE:return new fa;case D.TYPE_INCOMPLETE_MATERIALIZED_CONFIG:return new V;case D.TYPE_INVALID_DIMENSION_NOT_EXIST:case D.TYPE_INVALID_DIMENSION_GRANULARITY_NOT_MATCH:case D.TYPE_INVALID_DIMENSION_TYPE_NOT_MATCH:return new da}}}function D(){var f,
g=this;this.getType=function(){return f};this.fromJsonObject=function(c){f=c.type;g.protectedFromJsonObject(c)};this.protectedFromJsonObject=function(c){}}function S(){D.call(this);var f=[];this.getMetricIds=function(){return f};this.protectedFromJsonObject=function(g){g&&g.metricIds&&(f=g.metricIds)}}function ba(){D.call(this)}function ha(){S.call(this)}function ca(){S.call(this)}function da(){S.call(this)}function ea(){S.call(this);var f;this.getMetricPrompt=function(c){if(!f)return null;for(var b=
Object.keys(f),k=0;k<b.length;k++)for(var a=b[k],d=f[a],p=0;p<d.length;p++)if(c==d[p])return a};var g=this.protectedFromJsonObject;this.protectedFromJsonObject=function(c){g(c);f=c.promptMap}}function fa(){S.call(this);var f=this.protectedFromJsonObject;this.protectedFromJsonObject=function(g){f(g)}}function W(){D.call(this);var f;this.getDimensionIds=function(){return f};this.protectedFromJsonObject=function(g){g.dimensionIds&&(f=g.dimensionIds)}}function w(){W.call(this)}function O(){W.call(this)}
function aa(){D.call(this);var f;this.getPublicDimensionIds=function(){return f};this.protectedFromJsonObject=function(g){g.publicDimensionIds&&(f=g.publicDimensionIds)}}function N(){aa.call(this)}function V(){D.call(this)}function z(){D.call(this);var f,g;this.getTableIds=function(){return f};this.getInvalidTableMap=function(){return g};this.protectedFromJsonObject=function(c){c.tableIds&&(f=c.tableIds);c.tableException&&(g=c.tableException)}}function Z(){z.call(this)}"undefined"==typeof com&&(com=
{});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner={});var J=
com.kingdee.bos.qing.modeler.designer.metricdesigner;J.MetricModeler=u;J.Metric=C;J.ExprValidity=function(){var f,g,c;this.isValid=function(){return f};this.getPrompt=function(){return g};this.getExceptionType=function(){return c};this.fromJsonObject=function(b){f=b.valid;g=b.prompt;c=b.exceptionType}};J.Dimension=A;J.PublicDimension=G;J.MappingField=H;J.DimensionFilterItem=function(){var f,g;this.getDimensionKey=function(){return f};this.setDimensionKey=function(c){f=c};this.getValues=function(){return g};
this.setValues=function(c){g=c};this.fromJsonObject=function(c){f=c.dimensionKey;g=c.values};this.toJsonObject=function(){var c={};c.dimensionKey=f;c.values=g;return c}};J.ModelerValidity=Y;J.MetricModelerInvalidityCase=D;J.TableFieldMeta=function(){var f={},g;this.getTableFieldMap=function(){return f};this.setTableFieldMap=function(c){f=c};this.getValidity=function(){return g};this.setValidity=function(c){g=c};this.fromJsonObject=function(c){if(c){var b=c.validity;b&&(g=new Y,g.fromJsonObject(b));
f={};if(c=c.tableFields){b=Object.keys(c);for(var k=0;k<b.length;k++){var a=b[k],d=f,p=a;a=c[a];for(var y=[],r=0;r<a.length;r++){var e=new l;e.fromJsonObject(a[r]);y.push(e)}d[p]=y}}}}};J.DimensionExprReference=X;var T,n,q,l,h,m,v;(function(){var f=com.kingdee.bos.qing.modeler.designer;T=f.ModelerModel;n=f.AbstractModelerModelParser;q=f.ModelerModerParser;l=f.Field;h=f.UIDHelper;m=f.FilterItem;v=f.MaterializedConfig})();q.registerParser(T.TYPE_METRIC_MODELER,new function(){n.call(this);this.parseToModel=
function(f){var g=new u;g.fromJsonObject(f);return g}});u.KEY_ADD_METRIC="metric_designer_add_metric";u.KEY_REMOVE_METRIC="metric_designer_remove_metric";u.KEY_UPDATE_METRIC="metric_designer_update_metric";u.KEY_ADD_DIMENSION="metric_designer_add_dimension";u.KEY_REMOVE_DIMENSION="metric_designer_remove_dimension";u.KEY_UPDATE_DIMENSION="metric_designer_update_dimension";u.KEY_BATCH_UPDATE_DIMENSION="metric_designer_batch_update_dimension";A.TYPE_DATE="DATE";A.TYPE_NORMAL="NORMAL";A.VALUE_YYYY=0;
A.VALUE_QUARTER=1;A.VALUE_MONTH=2;A.VALUE_DAY=3;A.VALUE_YEAR_QUARTER=4;A.VALUE_YEAR_MONTH=5;A.VALUE_YEAR_WEEK=6;A.VALUE_WEEK_OF_YEAR=7;A.VALUE_DAY_OF_WEEK=8;A.VALUE_YEAR_MONTH_DAY=9;J.TableNameHelper=new function(){var f={};this.removeTableName=function(c){c=c.getUid();f[c]&&(f[c]=null)};this.addTableName=function(c,b){c=c.getUid();f[c]=b};this.getDisplayText=function(c){var b=c.getUid(),k=f[b];if(k)return k;for(c=k=(k=c.getDisplayName())?k:c.getTableName();-1<c.indexOf(".");)c=c.replace(".","_");
c=g(c);return f[b]=c};var g=function(c,b){for(var k=b?c+"_"+b:c,a=!1,d=Object.keys(f),p=0;p<d.length;p++)if(f[d[p]]==k){a=!0;break}return a?g(c,b?b+1:1):k}};J.ExprRefHelper=new function(){function f(e){b.call(this,e,"#666")}function g(e){b.call(this,e,"#e8893a")}function c(e){b.call(this,e,"#4071ee")}function b(e,t){this.getText=function(){return e};this.getColor=function(){return t}}var k=this,a,d=[],p=/\[(.+?)\]/g;this.setGlobal=function(e){a=e};this.translateToExeExpr=function(e,t){for(var B=k.getRefTextInExpr(e),
E=0;E<B.length;E++){var K=B[E];a:{var F=K;for(var R=t,P=a.getModelerModel(),Q=P.getExprReferences(),U=0;U<Q.length;U++){var ia=Q[U];if(ia.getRefDisplayText(P)==F){F=ia;break a}}for(U=0;U<d.length;U++)if(Q=new d[U],Q.isRightDisplayFormat(F,P)){try{Q.fromDisplayText(F,P,R)}catch(ja){continue}Q=P.addExprRefIfNotExist(Q);Q.getId()||(F=Q,R=h.getUID(h.NS_REFERENCE),F.setId(R));F=Q;break a}F=void 0}F&&(e=k.replaceRefText(e,K,F.getId()))}return e};this.translateToTextSegment=function(e){var t=k.getRefTextInExpr(e),
B=[],E=a.getModelerModel();y(e,t,function(K,F){K&&0<K.length&&(K=new f(K),B.push(K));F&&(F=E.getExprReference(F),F=F instanceof M?new c("["+F.getRefDisplayText(E)+"]"):F instanceof L?new g("["+F.getRefDisplayText(E)+"]"):new f("[]"),B.push(F))});return B};var y=function(e,t,B){for(var E,K,F=0;F<t.length;F++){var R=t[F],P=e.indexOf("["+R+"]");-1<P&&(void 0==E||E>P)&&(E=P,K=R)}E||0==E?(F=e.substring(0,E),B(F,K,E),e=e.substring(E+("["+K+"]").length),y(e,t,B)):B(e,null,null)};this.translateToDisplayExpr=
function(e){for(var t=k.getRefTextInExpr(e),B=a.getModelerModel(),E=0;E<t.length;E++){var K=t[E],F=B.getExprReference(K);F=F instanceof M?F.getRefDisplayText(B):F instanceof L?F.getRefDisplayText(B):"";e=k.replaceRefText(e,K,F)}return e};this.getRefTextInExpr=function(e){var t=[];e=e.match(p);if(!e)return t;for(var B=0;B<e.length;B++){var E=e[B];E=E.substring(1,E.length-1);0>t.indexOf(E)&&t.push(E)}return t};this.getRefFullDisplayText=function(e){var t=a.getModelerModel();return"["+e.getRefDisplayText(t)+
"]"};this.createFieldReference=function(e,t){var B=new M;B.setTableId(e);B.setFieldName(t.getName());B.setAlias(t.getAlias());return r(B)};this.createMetricReference=function(e){var t=new L;t.setMetricId(e);return r(t)};this.registReference=function(e){0<d.indexOf(e)||d.push(e)};this.getMetricReferredInfo=function(e){var t=[];e=e.getId();for(var B=a.getModelerModel(),E=B.getAllMetric(),K=0;K<E.length;K++){var F=E[K];if(F.getId()!=e)for(var R=k.getRefTextInExpr(F.getExpr()),P=0;P<R.length;P++){var Q=
B.getExprReference(R[P]);Q instanceof L&&Q.getMetricId()==e&&t.push(F)}}return t};this.replaceRefText=function(e,t,B){B="["+B+"]";for(t="["+t+"]";-1<e.indexOf(t);)e=e.replace(t,B);return e};var r=function(e){var t=h.getUID(h.NS_REFERENCE);e.setId(t);return a.getModelerModel().addExprRefIfNotExist(e)}};x.FIELD_TYPE="field";x.METRIC_TYPE="metric";x.DIMENSION_TYPE="dimension";J.ExprRefHelper.registReference(M);J.ExprRefHelper.registReference(L);D.TYPE_NO_METRIC="noMetric";D.TYPE_INVALID_FIELD_REF="invalidFieldRef";
D.TYPE_INVALID_EXPR="invalidExpr";D.TYPE_INVALID_EXPR_DATA_TYPE="invalidExprDataType";D.TYPE_INVALID_FIELD_FILTER_REF="invalidFieldFilterRef";D.TYPE_INVALID_DIMENSION_REF="invalidDimensionRef";D.TYPE_INVALID_DIMENSION_TYPE="invalidDimensionType";D.TYPE_INVALID_PUBLIC_DIMENSION="invalidPublicDimension";D.TYPE_INVALID_TABLE="invalidTable";D.TYPE_INVALID_TABLE_FILTER="invalidTableFilter";D.TYPE_DB_CONNECTION_FAIL="dbConnectionFail";D.TYPE_USER_NO_DB_CENTER_PERMISSION="userNoDBCenterPermission";D.TYPE_CREATOR_NO_DB_CENTER_PERMISSION=
"creatorNoDBCenterPermission";D.TYPE_USER_NO_PUBLIC_SOURCE_PERMISSION="userNoPublicSourcePermission";D.TYPE_CREATOR_NO_PUBLIC_SOURCE_PERMISSION="creatorNoPublicSourcePermission";D.TYPE_USER_NO_ENTITY_PERMISSION="userNoEntityPermission";D.TYPE_REF_PUBLIC_SOURCE_NOT_EXIST="refPublicSourceNotExist";D.TYPE_TABLE_NOT_EXIST="tableNotExist";D.TYPE_MODEL_NOT_EXIST="modelNotExist";D.TYPE_MODEL_DAMAGE="modelDamage";D.TYPE_MODEL_NO_DATA_PERMISSION="modelNoDataPermission";D.TYPE_MODEL_CYCLE_REFERENCE="modelCycleReference";
D.TYPE_INCOMPLETE_MATERIALIZED_CONFIG="incompleteMaterializedConfig";D.TYPE_INVALID_DIMENSION_GRANULARITY_NOT_MATCH="invalidDimensionGranularityNotMatch";D.TYPE_INVALID_DIMENSION_TYPE_NOT_MATCH="invalidDimensionTypeNotMatch";D.TYPE_INVALID_DIMENSION_NOT_EXIST="invalidDimensionNotExist"})();
//qingVersionTag: 20250415